add some basic infrastructure for hfdl

This commit is contained in:
Jakob Ketterl 2023-09-03 23:48:56 +02:00
parent 7eb277ce97
commit f794f285f3
12 changed files with 118 additions and 31 deletions

View file

@ -164,8 +164,10 @@ DemodulatorPanel.prototype.updatePanels = function() {
$('#openwebrx-panel-digimodes').attr('data-mode', modulation);
var mode = Modes.findByModulation(modulation);
toggle_panel("openwebrx-panel-digimodes", modulation && (!mode || mode.secondaryFft));
// WSJT-X modes share the same panel
toggle_panel("openwebrx-panel-wsjt-message", ['ft8', 'wspr', 'jt65', 'jt9', 'ft4', 'fst4', 'fst4w', "q65", "msk144"].indexOf(modulation) >= 0);
['js8', 'packet', 'pocsag', 'adsb', 'ism'].forEach(function(m) {
// these modes come with their own
['js8', 'packet', 'pocsag', 'adsb', 'ism', 'hfdl'].forEach(function(m) {
toggle_panel('openwebrx-panel-' + m + '-message', modulation === m);
});

View file

@ -460,4 +460,40 @@ $.fn.ismMessagePanel = function() {
this.data('panel', new IsmMessagePanel(this));
}
return this.data('panel');
};
HfdlMessagePanel = function(el) {
MessagePanel.call(this, el);
this.initClearTimer();
}
HfdlMessagePanel.prototype = new MessagePanel();
HfdlMessagePanel.prototype.render = function() {
$(this.el).append($(
'<table>' +
'<thead><tr>' +
'<th class="model">Model</th>' +
'<th class="id">ID</th>' +
'<th class="channel">Channel</th>' +
'<th class="data">Data</th>' +
'</tr></thead>' +
'<tbody></tbody>' +
'</table>'
));
};
HfdlMessagePanel.prototype.supportsMessage = function(message) {
return message['mode'] === 'HFDL';
};
HfdlMessagePanel.prototype.pushMessage = function(message) {
console.info(message);
};
$.fn.hfdlMessagePanel = function() {
if (!this.data('panel')) {
this.data('panel', new HfdlMessagePanel(this));
}
return this.data('panel');
};