forked from luarvique/openwebrx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makebookmarks.pl
executable file
·55 lines (47 loc) · 1.38 KB
/
makebookmarks.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/perl
$First = 1;
printf("[\n");
while(<STDIN>)
{
if(/^(.*)\|(.*)\|(.*)\|(\S*)\|(\S+)\s*$/)
{
$Name = $1;
$Text1 = $2;
$Text2 = $3;
$Freq = $4;
$Mod = $5;
if(($Name ne "") && ($Freq ne "") && ($Mod ne ""))
{
if($Text1 ne "")
{
$Name = $Name . " - " . $Text1;
#if($Text2 ne "")
#{
# $Name = $Name . ", " . $Text2;
#}
}
elsif($Text2 ne "")
{
$Name = $Name . " - " . $Text2;
}
if($First) { $First=0; } else { printf(",\n"); }
# Set FAX frequencies 1.9kHz lower than the carrier
if(lc($Mod) eq "fax") { $Freq -= 1.9; }
# Set RTTY frequencies 1kHz lower than the left carrier
if(lc($Mod) eq "rtty450") { $Freq -= 1.0; }
if(lc($Mod) eq "rtty170") { $Freq -= 1.0; }
if(lc($Mod) eq "rtty85") { $Freq -= 1.0; }
# Set NAVTEX/SITOR-B/DSC frequencies 1kHz lower than the left carrier
if(lc($Mod) eq "sitorb") { $Freq -= 1.0; }
if(lc($Mod) eq "dsc") { $Freq -= 1.0; }
# Set CW frequencies 800Hz lower than the carrier
if(lc($Mod) eq "cw") { $Freq -= 0.8; }
printf(" {\n");
printf(" \"name\" : \"%s\",\n", $Name);
printf(" \"frequency\" : %d,\n", $Freq * 1000);
printf(" \"modulation\" : \"%s\"\n", lc($Mod));
printf(" }");
}
}
}
printf("\n]\n");