add the option to disable the scondary fft
This commit is contained in:
parent
5db5cb9eae
commit
cafdb3a9f2
|
|
@ -64,6 +64,9 @@ class SecondaryDemodulator(Chain):
|
||||||
def setSampleRate(self, sampleRate: int) -> None:
|
def setSampleRate(self, sampleRate: int) -> None:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def isSecondaryFftShown(self):
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
class ServiceDemodulator(SecondaryDemodulator, FixedAudioRateChain, metaclass=ABCMeta):
|
class ServiceDemodulator(SecondaryDemodulator, FixedAudioRateChain, metaclass=ABCMeta):
|
||||||
pass
|
pass
|
||||||
|
|
|
||||||
|
|
@ -19,3 +19,6 @@ class Dump1090(ServiceDemodulator):
|
||||||
|
|
||||||
def getFixedAudioRate(self) -> int:
|
def getFixedAudioRate(self) -> int:
|
||||||
return 2400000
|
return 2400000
|
||||||
|
|
||||||
|
def isSecondaryFftShown(self):
|
||||||
|
return False
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,8 @@ DemodulatorPanel.prototype.disableDigiMode = function() {
|
||||||
DemodulatorPanel.prototype.updatePanels = function() {
|
DemodulatorPanel.prototype.updatePanels = function() {
|
||||||
var modulation = this.getDemodulator().get_secondary_demod();
|
var modulation = this.getDemodulator().get_secondary_demod();
|
||||||
$('#openwebrx-panel-digimodes').attr('data-mode', modulation);
|
$('#openwebrx-panel-digimodes').attr('data-mode', modulation);
|
||||||
toggle_panel("openwebrx-panel-digimodes", !!modulation);
|
var mode = Modes.findByModulation(modulation);
|
||||||
|
toggle_panel("openwebrx-panel-digimodes", modulation && (!mode || mode.secondaryFft));
|
||||||
toggle_panel("openwebrx-panel-wsjt-message", ['ft8', 'wspr', 'jt65', 'jt9', 'ft4', 'fst4', 'fst4w', "q65", "msk144"].indexOf(modulation) >= 0);
|
toggle_panel("openwebrx-panel-wsjt-message", ['ft8', 'wspr', 'jt65', 'jt9', 'ft4', 'fst4', 'fst4w', "q65", "msk144"].indexOf(modulation) >= 0);
|
||||||
toggle_panel("openwebrx-panel-js8-message", modulation === "js8");
|
toggle_panel("openwebrx-panel-js8-message", modulation === "js8");
|
||||||
toggle_panel("openwebrx-panel-packet-message", modulation === "packet");
|
toggle_panel("openwebrx-panel-packet-message", modulation === "packet");
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ var Mode = function(json){
|
||||||
}
|
}
|
||||||
if (this.type === 'digimode') {
|
if (this.type === 'digimode') {
|
||||||
this.underlying = json.underlying;
|
this.underlying = json.underlying;
|
||||||
|
this.secondaryFft = json.secondaryFft;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -443,6 +443,7 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient):
|
||||||
res["bandpass"] = {"low_cut": m.bandpass.low_cut, "high_cut": m.bandpass.high_cut}
|
res["bandpass"] = {"low_cut": m.bandpass.low_cut, "high_cut": m.bandpass.high_cut}
|
||||||
if isinstance(m, DigitalMode):
|
if isinstance(m, DigitalMode):
|
||||||
res["underlying"] = m.underlying
|
res["underlying"] = m.underlying
|
||||||
|
res["secondaryFft"] = m.secondaryFft
|
||||||
return res
|
return res
|
||||||
|
|
||||||
self.send({"type": "modes", "value": [to_json(m) for m in modes]})
|
self.send({"type": "modes", "value": [to_json(m) for m in modes]})
|
||||||
|
|
|
||||||
|
|
@ -196,11 +196,11 @@ class ClientDemodulatorChain(Chain):
|
||||||
self.secondaryDemodulator.setReader(self.audioBuffer.getReader())
|
self.secondaryDemodulator.setReader(self.audioBuffer.getReader())
|
||||||
self.secondaryDemodulator.setWriter(self.secondaryWriter)
|
self.secondaryDemodulator.setWriter(self.secondaryWriter)
|
||||||
|
|
||||||
if self.secondaryDemodulator is None and self.secondaryFftChain is not None:
|
if (self.secondaryDemodulator is None or not self.secondaryDemodulator.isSecondaryFftShown()) and self.secondaryFftChain is not None:
|
||||||
self.secondaryFftChain.stop()
|
self.secondaryFftChain.stop()
|
||||||
self.secondaryFftChain = None
|
self.secondaryFftChain = None
|
||||||
|
|
||||||
if self.secondaryDemodulator is not None and self.secondaryFftChain is None:
|
if (self.secondaryDemodulator is not None and self.secondaryDemodulator.isSecondaryFftShown()) and self.secondaryFftChain is None:
|
||||||
self._createSecondaryFftChain()
|
self._createSecondaryFftChain()
|
||||||
|
|
||||||
if self.secondaryFftChain is not None:
|
if self.secondaryFftChain is not None:
|
||||||
|
|
|
||||||
|
|
@ -42,10 +42,19 @@ class AnalogMode(Mode):
|
||||||
|
|
||||||
class DigitalMode(Mode):
|
class DigitalMode(Mode):
|
||||||
def __init__(
|
def __init__(
|
||||||
self, modulation, name, underlying, bandpass: Bandpass = None, requirements=None, service=False, squelch=True
|
self,
|
||||||
|
modulation,
|
||||||
|
name,
|
||||||
|
underlying,
|
||||||
|
bandpass: Bandpass = None,
|
||||||
|
requirements=None,
|
||||||
|
service=False,
|
||||||
|
squelch=True,
|
||||||
|
secondaryFft=True
|
||||||
):
|
):
|
||||||
super().__init__(modulation, name, bandpass, requirements, service, squelch)
|
super().__init__(modulation, name, bandpass, requirements, service, squelch)
|
||||||
self.underlying = underlying
|
self.underlying = underlying
|
||||||
|
self.secondaryFft = secondaryFft
|
||||||
|
|
||||||
def get_underlying_mode(self):
|
def get_underlying_mode(self):
|
||||||
mode = Modes.findByModulation(self.underlying[0])
|
mode = Modes.findByModulation(self.underlying[0])
|
||||||
|
|
@ -162,6 +171,7 @@ class Modes(object):
|
||||||
bandpass=Bandpass(-1e6, 1e6),
|
bandpass=Bandpass(-1e6, 1e6),
|
||||||
requirements=["dump1090"],
|
requirements=["dump1090"],
|
||||||
squelch=False,
|
squelch=False,
|
||||||
|
secondaryFft=False,
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue