Add GMSK, fix modem bandwidth logic, cleanup.

This commit is contained in:
Charles J. Cliffe
2015-11-30 21:58:54 -05:00
parent ceb6d62089
commit 76d69ffd78
35 changed files with 365 additions and 77 deletions
+12 -1
View File
@@ -264,13 +264,25 @@ void DemodulatorInstance::setDemodulatorType(std::string demod_type_in) {
std::string currentDemodType = demodulatorPreThread->getDemodType();
if ((currentDemodType != "") && (currentDemodType != demod_type_in)) {
lastModemSettings[currentDemodType] = demodulatorPreThread->readModemSettings();
lastModemBandwidth[currentDemodType] = demodulatorPreThread->getBandwidth();
}
#if ENABLE_DIGITAL_LAB
if (activeOutput) {
activeOutput->Hide();
}
#endif
demodulatorPreThread->setDemodType(demod_type_in);
int lastbw = 0;
if (currentDemodType != "" && lastModemBandwidth.find(demod_type_in) != lastModemBandwidth.end()) {
lastbw = lastModemBandwidth[demod_type_in];
}
if (!lastbw) {
lastbw = Modem::getModemDefaultSampleRate(demod_type_in);
}
if (lastbw) {
setBandwidth(lastbw);
}
}
}
@@ -297,7 +309,6 @@ int DemodulatorInstance::getDemodulatorLock() {
void DemodulatorInstance::setBandwidth(int bw) {
demodulatorPreThread->setBandwidth(bw);
wxGetApp().getDemodMgr().setLastBandwidth(bw);
}
int DemodulatorInstance::getBandwidth() {
+1
View File
@@ -127,6 +127,7 @@ private:
std::atomic<float> currentAudioGain;
std::atomic_bool follow, tracking;
std::map<std::string, ModemSettings> lastModemSettings;
std::map<std::string, int> lastModemBandwidth;
#if ENABLE_DIGITAL_LAB
ModemDigitalOutput *activeOutput;
#endif
-15
View File
@@ -8,13 +8,6 @@
DemodulatorMgr::DemodulatorMgr() :
activeDemodulator(NULL), lastActiveDemodulator(NULL), activeVisualDemodulator(NULL), lastBandwidth(DEFAULT_DEMOD_BW), lastDemodType(
DEFAULT_DEMOD_TYPE), lastSquelchEnabled(false), lastSquelch(-100), lastGain(1.0), lastMuted(false) {
setLastBandwidth("FM",200000);
setLastBandwidth("FMS",200000);
setLastBandwidth("AM",6000);
setLastBandwidth("USB",5400);
setLastBandwidth("LSB",5400);
setLastBandwidth("DSB",5400);
setLastBandwidth("IQ",48000);
}
DemodulatorMgr::~DemodulatorMgr() {
@@ -171,7 +164,6 @@ void DemodulatorMgr::updateLastState() {
lastSquelch = lastActiveDemodulator->getSquelchLevel();
lastGain = lastActiveDemodulator->getGain();
lastModemSettings[lastDemodType] = lastActiveDemodulator->readModemSettings();
lastBandwidthNamed[lastDemodType] = lastBandwidth;
}
}
@@ -236,10 +228,3 @@ ModemSettings DemodulatorMgr::getLastModemSettings(std::string modemType) {
void DemodulatorMgr::setLastModemSettings(std::string modemType, ModemSettings settings) {
lastModemSettings[modemType] = settings;
}
int DemodulatorMgr::getLastBandwidth(std::string modemType) {
return lastBandwidthNamed[modemType];
}
void DemodulatorMgr::setLastBandwidth(std::string modemType, int lastBandwidth_in) {
lastBandwidthNamed[modemType] = lastBandwidth_in;
}
-4
View File
@@ -25,9 +25,6 @@ public:
int getLastBandwidth() const;
void setLastBandwidth(int lastBandwidth);
int getLastBandwidth(std::string modemType);
void setLastBandwidth(std::string modemType, int lastBandwidth);
std::string getLastDemodulatorType() const;
void setLastDemodulatorType(std::string lastDemodType);
@@ -57,7 +54,6 @@ private:
DemodulatorInstance *lastActiveDemodulator;
DemodulatorInstance *activeVisualDemodulator;
std::map<std::string, int> lastBandwidthNamed;
int lastBandwidth;
std::string lastDemodType;
bool lastDemodLock;