added option to run demodulator without bandpass

This commit is contained in:
Jakob Ketterl 2023-08-25 21:12:13 +02:00
parent 5b86ebdcba
commit 37ee7796db
7 changed files with 64 additions and 15 deletions

View file

@ -83,9 +83,13 @@ Envelope.prototype.draw = function(visible_range){
scale_ctx.stroke();
scale_ctx.lineWidth = 1;
scale_ctx.textAlign = "left";
scale_ctx.fillText(this.demodulator.high_cut.toString(), to_px + env_att_w, env_h2);
if (this.demodulator.high_cut) {
scale_ctx.fillText(this.demodulator.high_cut.toString(), to_px + env_att_w, env_h2);
}
scale_ctx.textAlign = "right";
scale_ctx.fillText(this.demodulator.low_cut.toString(), from_px - env_att_w, env_h2);
if (this.demodulator.low_cut) {
scale_ctx.fillText(this.demodulator.low_cut.toString(), from_px - env_att_w, env_h2);
}
scale_ctx.lineWidth = 3;
}
if (typeof line !== "undefined") // out of screen?
@ -332,6 +336,13 @@ Demodulator.prototype.setBandpass = function(bandpass) {
this.set();
};
Demodulator.prototype.disableBandpass = function() {
delete this.bandpass;
this.low_cut = null;
this.high_cut = null;
this.set()
}
Demodulator.prototype.setLowCut = function(low_cut) {
this.low_cut = low_cut;
this.set();

View file

@ -137,6 +137,8 @@ DemodulatorPanel.prototype.setMode = function(requestedModulation, underlyingMod
this.demodulator.set_secondary_demod(mode.modulation);
if (mode.bandpass) {
this.demodulator.setBandpass(mode.bandpass);
} else {
this.demodulator.disableBandpass();
}
} else {
this.demodulator.set_secondary_demod(false);