Adding utility function to adjust frequency by modulation.
This commit is contained in:
parent
783bbfade8
commit
8425a46e20
|
|
@ -292,11 +292,7 @@ FeatureMarker.prototype.getInfoHTML = function(name, receiverMarker = null) {
|
||||||
for (var j=0 ; j<this.schedule.length ; ++j) {
|
for (var j=0 ; j<this.schedule.length ; ++j) {
|
||||||
var freq = this.schedule[j].freq;
|
var freq = this.schedule[j].freq;
|
||||||
var mode = this.schedule[j].mode;
|
var mode = this.schedule[j].mode;
|
||||||
var tune = mode === 'cw'? freq - 800
|
var tune = Utils.offsetFreq(freq, mode);
|
||||||
: mode === 'fax'? freq - 1900
|
|
||||||
: mode === 'rtty450'? freq - 1000
|
|
||||||
: mode === 'sitorb'? freq - 1000
|
|
||||||
: freq;
|
|
||||||
|
|
||||||
var name = ('0000' + this.schedule[j].time1).slice(-4)
|
var name = ('0000' + this.schedule[j].time1).slice(-4)
|
||||||
+ '‑' + ('0000' + this.schedule[j].time2).slice(-4)
|
+ '‑' + ('0000' + this.schedule[j].time2).slice(-4)
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,26 @@ Utils.htmlEscape = function(input) {
|
||||||
return $('<div/>').text(input).html()
|
return $('<div/>').text(input).html()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Change frequency as required by given modulation
|
||||||
|
Utils.offsetFreq = function(freq, mod) {
|
||||||
|
switch(mod) {
|
||||||
|
case 'cw':
|
||||||
|
return freq - 800;
|
||||||
|
case 'fax':
|
||||||
|
return freq - 1900;
|
||||||
|
case 'cwdecoder':
|
||||||
|
case 'rtty450':
|
||||||
|
case 'rtty170':
|
||||||
|
case 'rtty85':
|
||||||
|
case 'sitorb':
|
||||||
|
case 'bpsk31':
|
||||||
|
case 'bpsk63':
|
||||||
|
return freq - 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
return freq;
|
||||||
|
}
|
||||||
|
|
||||||
// Wrap given callsign or other ID into a clickable link.
|
// Wrap given callsign or other ID into a clickable link.
|
||||||
Utils.linkify = function(id, url = null, content = null, tip = null) {
|
Utils.linkify = function(id, url = null, content = null, tip = null) {
|
||||||
// If no specific content, use the ID itself
|
// If no specific content, use the ID itself
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue