kopia lustrzana https://github.com/AlexandreRouma/SDRPlusPlus
Porównaj commity
3 Commity
2813aa7c93
...
da1417b5ab
Autor | SHA1 | Data |
---|---|---|
AlexandreRouma | da1417b5ab | |
AlexandreRouma | e60eca5d6d | |
AlexandreRouma | ccb10bfb9a |
|
@ -9,6 +9,7 @@
|
|||
namespace dsp {
|
||||
class generic_block {
|
||||
public:
|
||||
virtual ~generic_block() {}
|
||||
virtual void start() {}
|
||||
virtual void stop() {}
|
||||
virtual int run() { return -1; }
|
||||
|
@ -16,8 +17,6 @@ namespace dsp {
|
|||
|
||||
class block : public generic_block {
|
||||
public:
|
||||
virtual void init() {}
|
||||
|
||||
virtual ~block() {
|
||||
if (!_block_init) { return; }
|
||||
stop();
|
||||
|
|
|
@ -10,6 +10,8 @@ namespace dsp {
|
|||
|
||||
Operator(stream<A>* a, stream<B>* b) { init(a, b); }
|
||||
|
||||
virtual ~Operator() {}
|
||||
|
||||
virtual void init(stream<A>* a, stream<B>* b) {
|
||||
_a = a;
|
||||
_b = b;
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
namespace dsp {
|
||||
class untyped_stream {
|
||||
public:
|
||||
virtual ~untyped_stream() {}
|
||||
virtual bool swap(int size) { return false; }
|
||||
virtual int read() { return -1; }
|
||||
virtual void flush() {}
|
||||
|
|
|
@ -42,6 +42,7 @@ public:
|
|||
|
||||
class Instance {
|
||||
public:
|
||||
virtual ~Instance() {}
|
||||
virtual void postInit() = 0;
|
||||
virtual void enable() = 0;
|
||||
virtual void disable() = 0;
|
||||
|
|
|
@ -597,14 +597,16 @@ private:
|
|||
|
||||
static void moduleInterfaceHandler(int code, void* in, void* out, void* ctx) {
|
||||
RadioModule* _this = (RadioModule*)ctx;
|
||||
if (!_this->enabled || !_this->selectedDemod) { return; }
|
||||
|
||||
// If no demod is selected, reject the command
|
||||
if (!_this->selectedDemod) { return; }
|
||||
|
||||
// Execute commands
|
||||
if (code == RADIO_IFACE_CMD_GET_MODE && out) {
|
||||
int* _out = (int*)out;
|
||||
*_out = _this->selectedDemodID;
|
||||
}
|
||||
else if (code == RADIO_IFACE_CMD_SET_MODE && in) {
|
||||
else if (code == RADIO_IFACE_CMD_SET_MODE && in && _this->enabled) {
|
||||
int* _in = (int*)in;
|
||||
_this->selectDemodByID((DemodID)*_in);
|
||||
}
|
||||
|
@ -612,7 +614,7 @@ private:
|
|||
float* _out = (float*)out;
|
||||
*_out = _this->bandwidth;
|
||||
}
|
||||
else if (code == RADIO_IFACE_CMD_SET_BANDWIDTH && in) {
|
||||
else if (code == RADIO_IFACE_CMD_SET_BANDWIDTH && in && _this->enabled) {
|
||||
float* _in = (float*)in;
|
||||
if (_this->bandwidthLocked) { return; }
|
||||
_this->setBandwidth(*_in);
|
||||
|
@ -621,7 +623,7 @@ private:
|
|||
bool* _out = (bool*)out;
|
||||
*_out = _this->squelchEnabled;
|
||||
}
|
||||
else if (code == RADIO_IFACE_CMD_SET_SQUELCH_ENABLED && in) {
|
||||
else if (code == RADIO_IFACE_CMD_SET_SQUELCH_ENABLED && in && _this->enabled) {
|
||||
bool* _in = (bool*)in;
|
||||
_this->setSquelchEnabled(*_in);
|
||||
}
|
||||
|
@ -629,7 +631,7 @@ private:
|
|||
float* _out = (float*)out;
|
||||
*_out = _this->squelchLevel;
|
||||
}
|
||||
else if (code == RADIO_IFACE_CMD_SET_SQUELCH_LEVEL && in) {
|
||||
else if (code == RADIO_IFACE_CMD_SET_SQUELCH_LEVEL && in && _this->enabled) {
|
||||
float* _in = (float*)in;
|
||||
_this->setSquelchLevel(*_in);
|
||||
}
|
||||
|
|
|
@ -476,9 +476,9 @@ private:
|
|||
sprintf(monStr, "%02d", ltm->tm_mon + 1);
|
||||
sprintf(yearStr, "%02d", ltm->tm_year + 1900);
|
||||
if (core::modComManager.getModuleName(name) == "radio") {
|
||||
int mode;
|
||||
int mode = -1;
|
||||
core::modComManager.callInterface(name, RADIO_IFACE_CMD_GET_MODE, NULL, &mode);
|
||||
modeStr = radioModeToString[mode];
|
||||
if (mode >= 0) { modeStr = radioModeToString[mode]; };
|
||||
}
|
||||
|
||||
// Replace in template
|
||||
|
|
Ładowanie…
Reference in New Issue