update secondary parameters

This commit is contained in:
Jakob Ketterl
2020-04-30 22:31:18 +02:00
parent 33762574c3
commit 1764abe65f
2 changed files with 20 additions and 8 deletions

View File

@ -108,6 +108,7 @@ function Demodulator(offset_frequency, modulation) {
this.squelch_level = -150;
this.dmr_filter = 3;
this.state = {};
this.secondary_demod = false;
var mode = Modes.findByModulation(modulation);
if (mode) {
this.low_cut = mode.bandpass.low_cut;
@ -175,7 +176,9 @@ Demodulator.prototype.set = function () { //this function sends demodulator par
"offset_freq": this.offset_frequency,
"mod": this.modulation,
"dmr_filter": this.dmr_filter,
"squelch_level": this.squelch_level
"squelch_level": this.squelch_level,
"secondary_mod": this.secondary_demod,
"secondary_offset_freq": this.secondary_offset_freq
};
var to_send = {};
for (var key in params) {
@ -215,3 +218,13 @@ Demodulator.prototype.getBandpass = function() {
high_cut: this.high_cut
};
};
Demodulator.prototype.set_secondary_demod = function(secondary_demod) {
this.secondary_demod = secondary_demod;
this.set();
};
Demodulator.prototype.set_secondary_offset_freq = function(secondary_offset) {
this.secondary_offset_freq = secondary_offset;
this.set();
};