Modem instance setting read/write

This commit is contained in:
Charles J. Cliffe 2015-11-23 22:16:09 -05:00
parent c5bccb4211
commit abdb5d32d9
3 changed files with 33 additions and 0 deletions

View File

@ -856,6 +856,8 @@ void AppFrame::OnIdle(wxIdleEvent& event) {
demodModeSelectorAdv->setSelection(dType);
#endif
demodMuteButton->setSelection(demod->isMuted()?1:-1);
newModemArgs = demod->getModemArgs();
modemPropertiesUpdated.store(true);
}
if (demodWaterfallCanvas->getDragState() == WaterfallCanvas::WF_DRAG_NONE) {
long long centerFreq = demod->getFrequency();

View File

@ -330,3 +330,30 @@ void DemodulatorInstance::setMuted(bool muted) {
DemodulatorThreadInputQueue *DemodulatorInstance::getIQInputDataPipe() {
return pipeIQInputData;
}
ModemArgInfoList DemodulatorInstance::getModemArgs() {
Modem *m = demodulatorPreThread->getModem();
ModemArgInfoList args;
if (m != nullptr) {
args = m->getSettings();
}
return args;
}
std::string DemodulatorInstance::readModemSetting(std::string setting) {
Modem *m = demodulatorPreThread->getModem();
if (m) {
return m->readSetting(setting);
}
return "";
}
void DemodulatorInstance::writeModemSetting(std::string setting, std::string value) {
Modem *m = demodulatorPreThread->getModem();
if (m) {
m->writeSetting(setting, value);
}
}

View File

@ -82,6 +82,10 @@ public:
DemodulatorThreadInputQueue *getIQInputDataPipe();
ModemArgInfoList getModemArgs();
std::string readModemSetting(std::string setting);
void writeModemSetting(std::string setting, std::string value);
protected:
DemodulatorThreadInputQueue* pipeIQInputData;
DemodulatorThreadPostInputQueue* pipeIQDemodData;