fix digimode init from hash

This commit is contained in:
Jakob Ketterl 2020-05-02 02:13:16 +02:00
parent a96690c8bd
commit 28c1425a8f
2 changed files with 8 additions and 5 deletions

View File

@ -237,8 +237,6 @@ Demodulator.prototype.set_offset_frequency = function(to_what) {
this.set(); this.set();
this.emit("frequencychange", to_what); this.emit("frequencychange", to_what);
mkenvelopes(get_visible_freq_range()); mkenvelopes(get_visible_freq_range());
//tunedFrequencyDisplay.setFrequency(center_freq + to_what);
updateHash();
}; };
Demodulator.prototype.get_offset_frequency = function() { Demodulator.prototype.get_offset_frequency = function() {

View File

@ -102,6 +102,7 @@ DemodulatorPanel.prototype.setMode = function(modulation) {
var self = this; var self = this;
this.demodulator.on("frequencychange", function(freq) { this.demodulator.on("frequencychange", function(freq) {
self.tuneableFrequencyDisplay.setFrequency(center_freq + freq); self.tuneableFrequencyDisplay.setFrequency(center_freq + freq);
updateHash();
}); });
} }
if (mode.type === 'digimode') { if (mode.type === 'digimode') {
@ -139,7 +140,7 @@ DemodulatorPanel.prototype.getDemodulator = function() {
}; };
DemodulatorPanel.prototype.startDemodulator = function() { DemodulatorPanel.prototype.startDemodulator = function() {
var params = $.extend(this.initialParams || {}, validateHash()); var params = $.extend(this.initialParams || {}, this.transformHashParams(validateHash()));
this._apply(params); this._apply(params);
}; };
@ -154,10 +155,14 @@ DemodulatorPanel.prototype.setInitialParams = function(params) {
}; };
DemodulatorPanel.prototype.setHashParams = function(params) { DemodulatorPanel.prototype.setHashParams = function(params) {
this._apply({ this._apply(this.transformHashParams(params));
};
DemodulatorPanel.prototype.transformHashParams = function(params) {
return {
mod: params.secondary_mod || params.mod, mod: params.secondary_mod || params.mod,
offset_frequency: params.offset_frequency offset_frequency: params.offset_frequency
}); };
}; };
DemodulatorPanel.prototype.updateButtons = function() { DemodulatorPanel.prototype.updateButtons = function() {