ModeConverter

This commit is contained in:
int2001
2025-10-25 04:22:00 +00:00
parent 98e4272422
commit a13f646cee
2 changed files with 29 additions and 1 deletions

View File

@@ -1468,7 +1468,7 @@ mymap.on('mousemove', onQsoMapMove);
});
cat2UI($('#frequency_rx'),data.frequency_rx,false,true,function(d){$("#band_rx").val(frequencyToBand(d))});
cat2UI($('.mode'),data.mode,false,false,function(d){setRst($(".mode").val())});
cat2UI($('.mode'),catmode(data.mode),false,false,function(d){setRst($(".mode").val())});
cat2UI($('#sat_name'),data.satname,false,false);
cat2UI($('#sat_mode'),data.satmode,false,false);
cat2UI($('#transmit_power'),data.power,false,false);

View File

@@ -66,6 +66,34 @@ function frequencyToBand(frequency) {
}
}
function catmode(mode) {
switch ((mode || '').toUpperCase()) {
case 'CW-U':
case 'CW-L':
case 'CW-R':
case 'CWU':
case 'CWL':
return 'CW';
break;
case 'RTTY-L':
case 'RTTY-U':
case 'RTTY-R':
return 'RTTY';
break;
case 'USB-D':
case 'USB-D1':
return 'USB';
break;
case 'LSB-D':
case 'LSB-D1':
return 'LSB';
break;
default:
return (mode || '');;
break;
}
}
function LatLng2Loc(y, x, num) {
if (x<-180) {x=x+360;}
if (x>180) {x=x-360;}