MCPcopy Create free account
hub / github.com/cjcliffe/CubicSDR / handleModeSelector

Method handleModeSelector

src/AppFrame.cpp:2396–2425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2394}
2395
2396void AppFrame::handleModeSelector() {
2397 DemodulatorMgr *mgr = &wxGetApp().getDemodMgr();
2398
2399 string dSelection = demodModeSelector->getSelectionLabel();
2400#ifdef ENABLE_DIGITAL_LAB
2401 string dSelectionadv = demodModeSelectorAdv->getSelectionLabel();
2402
2403 // basic demodulators
2404 if (!dSelection.empty() && dSelection != mgr->getLastDemodulatorType()) {
2405 mgr->setLastDemodulatorType(dSelection);
2406 mgr->setLastBandwidth(Modem::getModemDefaultSampleRate(dSelection));
2407 demodTuner->setHalfBand(dSelection == "USB" || dSelection == "LSB");
2408 demodModeSelectorAdv->setSelection(-1);
2409 }
2410 // advanced demodulators
2411 else if (!dSelectionadv.empty() && dSelectionadv != mgr->getLastDemodulatorType()) {
2412 mgr->setLastDemodulatorType(dSelectionadv);
2413 mgr->setLastBandwidth(Modem::getModemDefaultSampleRate(dSelectionadv));
2414 demodTuner->setHalfBand(false);
2415 demodModeSelector->setSelection(-1);
2416 }
2417#else
2418 // basic demodulators
2419 if (dSelection != "" && dSelection != mgr->getLastDemodulatorType()) {
2420 mgr->setLastDemodulatorType(dSelection);
2421 mgr->setLastBandwidth(Modem::getModemDefaultSampleRate(dSelection));
2422 demodTuner->setHalfBand(dSelection=="USB" || dSelection=="LSB");
2423 }
2424#endif
2425}
2426
2427void AppFrame::handleCurrentModem() {
2428

Callers

nothing calls this directly

Calls 7

getSelectionLabelMethod · 0.80
setLastBandwidthMethod · 0.80
setHalfBandMethod · 0.80
setSelectionMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected