mirror of
				https://github.com/AlexandreRouma/SDRPlusPlus.git
				synced 2025-11-04 10:49:11 +01:00 
			
		
		
		
	bunch of stuff idk i'm tired
This commit is contained in:
		@@ -30,6 +30,10 @@ void VFOManager::VFO::setOffset(double offset) {
 | 
			
		||||
    dspVFO->setOffset(wtfVFO->centerOffset);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
double VFOManager::VFO::getOffset() {
 | 
			
		||||
    return wtfVFO->generalOffset;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void VFOManager::VFO::setCenterOffset(double offset) {
 | 
			
		||||
    wtfVFO->setCenterOffset(offset);
 | 
			
		||||
    dspVFO->setOffset(offset);
 | 
			
		||||
@@ -104,6 +108,13 @@ void VFOManager::setOffset(std::string name, double offset) {
 | 
			
		||||
    vfos[name]->setOffset(offset);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
double VFOManager::getOffset(std::string name) {
 | 
			
		||||
    if (vfos.find(name) == vfos.end()) {
 | 
			
		||||
        return 0;
 | 
			
		||||
    }
 | 
			
		||||
    return vfos[name]->getOffset();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void VFOManager::setCenterOffset(std::string name, double offset) {
 | 
			
		||||
    if (vfos.find(name) == vfos.end()) {
 | 
			
		||||
        return;
 | 
			
		||||
 
 | 
			
		||||
@@ -13,6 +13,7 @@ public:
 | 
			
		||||
        ~VFO();
 | 
			
		||||
 | 
			
		||||
        void setOffset(double offset);
 | 
			
		||||
        double getOffset();
 | 
			
		||||
        void setCenterOffset(double offset);
 | 
			
		||||
        void setBandwidth(double bandwidth, bool updateWaterfall = true);
 | 
			
		||||
        void setSampleRate(double sampleRate, double bandwidth);
 | 
			
		||||
@@ -37,6 +38,7 @@ public:
 | 
			
		||||
    void deleteVFO(VFOManager::VFO* vfo);
 | 
			
		||||
 | 
			
		||||
    void setOffset(std::string name, double offset);
 | 
			
		||||
    double getOffset(std::string name);
 | 
			
		||||
    void setCenterOffset(std::string name, double offset);
 | 
			
		||||
    void setBandwidth(std::string name, double bandwidth, bool updateWaterfall = true);
 | 
			
		||||
    void setSampleRate(std::string name, double sampleRate, double bandwidth);
 | 
			
		||||
 
 | 
			
		||||
@@ -26,16 +26,19 @@ public:
 | 
			
		||||
        _config->aquire();
 | 
			
		||||
        if(_config->conf.contains(prefix)) {
 | 
			
		||||
            if(!_config->conf[prefix].contains("AM")) {
 | 
			
		||||
                if (!_config->conf[prefix]["AM"].contains("bandwidth")) { _config->conf[prefix]["AM"]["bandwidth"] = bw; }
 | 
			
		||||
                if (!_config->conf[prefix]["AM"].contains("snapInterval")) { _config->conf[prefix]["AM"]["snapInterval"] = snapInterval; }
 | 
			
		||||
                _config->conf[prefix]["AM"]["bandwidth"] = bw;
 | 
			
		||||
                _config->conf[prefix]["AM"]["snapInterval"] = snapInterval;
 | 
			
		||||
                _config->conf[prefix]["AM"]["squelchLevel"] = squelchLevel;
 | 
			
		||||
            }
 | 
			
		||||
            json conf = _config->conf[prefix]["AM"];
 | 
			
		||||
            bw = conf["bandwidth"];
 | 
			
		||||
            snapInterval = conf["snapInterval"];
 | 
			
		||||
            if (conf.contains("bandwidth")) { bw = conf["bandwidth"]; }
 | 
			
		||||
            if (conf.contains("snapInterval")) { snapInterval = conf["snapInterval"]; }
 | 
			
		||||
            if (conf.contains("squelchLevel")) { squelchLevel = conf["squelchLevel"]; }
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            _config->conf[prefix]["AM"]["bandwidth"] = bw;
 | 
			
		||||
            _config->conf[prefix]["AM"]["snapInterval"] = snapInterval;
 | 
			
		||||
            _config->conf[prefix]["AM"]["squelchLevel"] = squelchLevel;
 | 
			
		||||
        }
 | 
			
		||||
        _config->release(true);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -29,16 +29,19 @@ public:
 | 
			
		||||
        _config->aquire();
 | 
			
		||||
        if(_config->conf.contains(prefix)) {
 | 
			
		||||
            if(!_config->conf[prefix].contains("CW")) {
 | 
			
		||||
                if (!_config->conf[prefix]["CW"].contains("bandwidth")) { _config->conf[prefix]["CW"]["bandwidth"] = bw; }
 | 
			
		||||
                if (!_config->conf[prefix]["CW"].contains("snapInterval")) { _config->conf[prefix]["CW"]["snapInterval"] = snapInterval; }
 | 
			
		||||
                _config->conf[prefix]["CW"]["bandwidth"] = bw;
 | 
			
		||||
                _config->conf[prefix]["CW"]["snapInterval"] = snapInterval;
 | 
			
		||||
                _config->conf[prefix]["CW"]["squelchLevel"] = squelchLevel;
 | 
			
		||||
            }
 | 
			
		||||
            json conf = _config->conf[prefix]["CW"];
 | 
			
		||||
            bw = conf["bandwidth"];
 | 
			
		||||
            snapInterval = conf["snapInterval"];
 | 
			
		||||
            if (conf.contains("bandwidth")) { bw = conf["bandwidth"]; }
 | 
			
		||||
            if (conf.contains("snapInterval")) { snapInterval = conf["snapInterval"]; }
 | 
			
		||||
            if (conf.contains("squelchLevel")) { squelchLevel = conf["squelchLevel"]; }
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            _config->conf[prefix]["CW"]["bandwidth"] = bw;
 | 
			
		||||
            _config->conf[prefix]["CW"]["snapInterval"] = snapInterval;
 | 
			
		||||
            _config->conf[prefix]["CW"]["squelchLevel"] = squelchLevel;
 | 
			
		||||
        }
 | 
			
		||||
        _config->release(true);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -26,16 +26,19 @@ public:
 | 
			
		||||
        _config->aquire();
 | 
			
		||||
        if(_config->conf.contains(prefix)) {
 | 
			
		||||
            if(!_config->conf[prefix].contains("DSB")) {
 | 
			
		||||
                if (!_config->conf[prefix]["DSB"].contains("bandwidth")) { _config->conf[prefix]["DSB"]["bandwidth"] = bw; }
 | 
			
		||||
                if (!_config->conf[prefix]["DSB"].contains("snapInterval")) { _config->conf[prefix]["DSB"]["snapInterval"] = snapInterval; }
 | 
			
		||||
                _config->conf[prefix]["DSB"]["bandwidth"] = bw;
 | 
			
		||||
                _config->conf[prefix]["DSB"]["snapInterval"] = snapInterval;
 | 
			
		||||
                _config->conf[prefix]["DSB"]["squelchLevel"] = squelchLevel;
 | 
			
		||||
            }
 | 
			
		||||
            json conf = _config->conf[prefix]["DSB"];
 | 
			
		||||
            bw = conf["bandwidth"];
 | 
			
		||||
            snapInterval = conf["snapInterval"];
 | 
			
		||||
            if (conf.contains("bandwidth")) { bw = conf["bandwidth"]; }
 | 
			
		||||
            if (conf.contains("snapInterval")) { snapInterval = conf["snapInterval"]; }
 | 
			
		||||
            if (conf.contains("squelchLevel")) { squelchLevel = conf["squelchLevel"]; }
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            _config->conf[prefix]["DSB"]["bandwidth"] = bw;
 | 
			
		||||
            _config->conf[prefix]["DSB"]["snapInterval"] = snapInterval;
 | 
			
		||||
            _config->conf[prefix]["DSB"]["squelchLevel"] = squelchLevel;
 | 
			
		||||
        }
 | 
			
		||||
        _config->release(true);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -26,16 +26,19 @@ public:
 | 
			
		||||
        _config->aquire();
 | 
			
		||||
        if(_config->conf.contains(prefix)) {
 | 
			
		||||
            if(!_config->conf[prefix].contains("FM")) {
 | 
			
		||||
                if (!_config->conf[prefix]["FM"].contains("bandwidth")) { _config->conf[prefix]["FM"]["bandwidth"] = bw; }
 | 
			
		||||
                if (!_config->conf[prefix]["FM"].contains("snapInterval")) { _config->conf[prefix]["FM"]["snapInterval"] = snapInterval; }
 | 
			
		||||
                _config->conf[prefix]["FM"]["bandwidth"] = bw;
 | 
			
		||||
                _config->conf[prefix]["FM"]["snapInterval"] = snapInterval;
 | 
			
		||||
                _config->conf[prefix]["FM"]["squelchLevel"] = squelchLevel;
 | 
			
		||||
            }
 | 
			
		||||
            json conf = _config->conf[prefix]["FM"];
 | 
			
		||||
            bw = conf["bandwidth"];
 | 
			
		||||
            snapInterval = conf["snapInterval"];
 | 
			
		||||
            if (conf.contains("bandwidth")) { bw = conf["bandwidth"]; }
 | 
			
		||||
            if (conf.contains("snapInterval")) { snapInterval = conf["snapInterval"]; }
 | 
			
		||||
            if (conf.contains("squelchLevel")) { squelchLevel = conf["squelchLevel"]; }
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            _config->conf[prefix]["FM"]["bandwidth"] = bw;
 | 
			
		||||
            _config->conf[prefix]["FM"]["snapInterval"] = snapInterval;
 | 
			
		||||
            _config->conf[prefix]["FM"]["squelchLevel"] = squelchLevel;
 | 
			
		||||
        }
 | 
			
		||||
        _config->release(true);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -26,16 +26,19 @@ public:
 | 
			
		||||
        _config->aquire();
 | 
			
		||||
        if(_config->conf.contains(prefix)) {
 | 
			
		||||
            if(!_config->conf[prefix].contains("LSB")) {
 | 
			
		||||
                if (!_config->conf[prefix]["LSB"].contains("bandwidth")) { _config->conf[prefix]["LSB"]["bandwidth"] = bw; }
 | 
			
		||||
                if (!_config->conf[prefix]["LSB"].contains("snapInterval")) { _config->conf[prefix]["LSB"]["snapInterval"] = snapInterval; }
 | 
			
		||||
                _config->conf[prefix]["LSB"]["bandwidth"] = bw;
 | 
			
		||||
                _config->conf[prefix]["LSB"]["snapInterval"] = snapInterval;
 | 
			
		||||
                _config->conf[prefix]["LSB"]["squelchLevel"] = squelchLevel;
 | 
			
		||||
            }
 | 
			
		||||
            json conf = _config->conf[prefix]["LSB"];
 | 
			
		||||
            bw = conf["bandwidth"];
 | 
			
		||||
            snapInterval = conf["snapInterval"];
 | 
			
		||||
            if (conf.contains("bandwidth")) { bw = conf["bandwidth"]; }
 | 
			
		||||
            if (conf.contains("snapInterval")) { snapInterval = conf["snapInterval"]; }
 | 
			
		||||
            if (conf.contains("squelchLevel")) { squelchLevel = conf["squelchLevel"]; }
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            _config->conf[prefix]["LSB"]["bandwidth"] = bw;
 | 
			
		||||
            _config->conf[prefix]["LSB"]["snapInterval"] = snapInterval;
 | 
			
		||||
            _config->conf[prefix]["LSB"]["squelchLevel"] = squelchLevel;
 | 
			
		||||
        }
 | 
			
		||||
        _config->release(true);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -73,7 +73,8 @@ public:
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void enable() {
 | 
			
		||||
        vfo = sigpath::vfoManager.createVFO(name, ImGui::WaterfallVFO::REF_CENTER, 0, 200000, 200000, 50000, 200000, false);
 | 
			
		||||
        double bw = gui::waterfall.getBandwidth();
 | 
			
		||||
        vfo = sigpath::vfoManager.createVFO(name, ImGui::WaterfallVFO::REF_CENTER, std::clamp<double>(savedOffset, -bw/2.0, bw/2.0), 200000, 200000, 50000, 200000, false);
 | 
			
		||||
 | 
			
		||||
        wfmDemod.setVFO(vfo);
 | 
			
		||||
        fmDemod.setVFO(vfo);
 | 
			
		||||
@@ -91,9 +92,8 @@ public:
 | 
			
		||||
 | 
			
		||||
    void disable() {
 | 
			
		||||
        currentDemod->stop();
 | 
			
		||||
        savedOffset = vfo->getOffset();
 | 
			
		||||
        sigpath::vfoManager.deleteVFO(vfo);
 | 
			
		||||
        //ns.setInput(vfo->output);
 | 
			
		||||
        //ns.start();
 | 
			
		||||
        enabled = false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -194,6 +194,7 @@ private:
 | 
			
		||||
    bool enabled = true;
 | 
			
		||||
    int demodId = 0;
 | 
			
		||||
    float audioSampRate = 48000;
 | 
			
		||||
    double savedOffset;
 | 
			
		||||
    Demodulator* currentDemod = NULL;
 | 
			
		||||
 | 
			
		||||
    VFOManager::VFO* vfo;
 | 
			
		||||
 
 | 
			
		||||
@@ -25,14 +25,17 @@ public:
 | 
			
		||||
 | 
			
		||||
        _config->aquire();
 | 
			
		||||
        if(_config->conf.contains(prefix)) {
 | 
			
		||||
            if(!_config->conf[prefix].contains("RAW")) {
 | 
			
		||||
               if (!_config->conf[prefix]["RAW"].contains("snapInterval")) { _config->conf[prefix]["RAW"]["snapInterval"] = snapInterval; }
 | 
			
		||||
            if(!_config->conf[prefix].contains("CW")) {
 | 
			
		||||
                _config->conf[prefix]["CW"]["snapInterval"] = snapInterval;
 | 
			
		||||
                _config->conf[prefix]["CW"]["squelchLevel"] = squelchLevel;
 | 
			
		||||
            }
 | 
			
		||||
            json conf = _config->conf[prefix]["RAW"];
 | 
			
		||||
            snapInterval = conf["snapInterval"];
 | 
			
		||||
            json conf = _config->conf[prefix]["CW"];
 | 
			
		||||
            if (conf.contains("snapInterval")) { snapInterval = conf["snapInterval"]; }
 | 
			
		||||
            if (conf.contains("squelchLevel")) { squelchLevel = conf["squelchLevel"]; }
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            _config->conf[prefix]["RAW"]["snapInterval"] = snapInterval;
 | 
			
		||||
            _config->conf[prefix]["CW"]["snapInterval"] = snapInterval;
 | 
			
		||||
            _config->conf[prefix]["CW"]["squelchLevel"] = squelchLevel;
 | 
			
		||||
        }
 | 
			
		||||
        _config->release(true);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -26,16 +26,19 @@ public:
 | 
			
		||||
        _config->aquire();
 | 
			
		||||
        if(_config->conf.contains(prefix)) {
 | 
			
		||||
            if(!_config->conf[prefix].contains("USB")) {
 | 
			
		||||
                if (!_config->conf[prefix]["USB"].contains("bandwidth")) { _config->conf[prefix]["USB"]["bandwidth"] = bw; }
 | 
			
		||||
                if (!_config->conf[prefix]["USB"].contains("snapInterval")) { _config->conf[prefix]["USB"]["snapInterval"] = snapInterval; }
 | 
			
		||||
                _config->conf[prefix]["USB"]["bandwidth"] = bw;
 | 
			
		||||
                _config->conf[prefix]["USB"]["snapInterval"] = snapInterval;
 | 
			
		||||
                _config->conf[prefix]["USB"]["squelchLevel"] = squelchLevel;
 | 
			
		||||
            }
 | 
			
		||||
            json conf = _config->conf[prefix]["USB"];
 | 
			
		||||
            bw = conf["bandwidth"];
 | 
			
		||||
            snapInterval = conf["snapInterval"];
 | 
			
		||||
            if (conf.contains("bandwidth")) { bw = conf["bandwidth"]; }
 | 
			
		||||
            if (conf.contains("snapInterval")) { snapInterval = conf["snapInterval"]; }
 | 
			
		||||
            if (conf.contains("squelchLevel")) { squelchLevel = conf["squelchLevel"]; }
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            _config->conf[prefix]["USB"]["bandwidth"] = bw;
 | 
			
		||||
            _config->conf[prefix]["USB"]["snapInterval"] = snapInterval;
 | 
			
		||||
            _config->conf[prefix]["USB"]["squelchLevel"] = squelchLevel;
 | 
			
		||||
        }
 | 
			
		||||
        _config->release(true);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user