1. Fixed DXBearing::is_qra so that it correctly detects full QRA locators
authordjk <djk>
Sun, 6 Dec 1998 17:30:15 +0000 (17:30 +0000)
committerdjk <djk>
Sun, 6 Dec 1998 17:30:15 +0000 (17:30 +0000)
2. Added sh/qra for doing locator distances and bearings
3. Added some stuff to Notes.txt on hints for command writers
4. Changed help system to use just one file per language
5. Started adding more help
6. Fixed 24Mhz band limits

14 files changed:
Changes
cmd/Commands_en.hlp [new file with mode: 0644]
cmd/Notes.txt
cmd/announce.hlp [deleted file]
cmd/apropos.pl [new file with mode: 0644]
cmd/bye.hlp [deleted file]
cmd/dx.hlp [deleted file]
cmd/help.hlp [deleted file]
cmd/help.pl
cmd/show/dx.hlp [deleted file]
cmd/show/dxcc.hlp [deleted file]
cmd/show/prefix.hlp [deleted file]
data/bands.pl
perl/Messages

diff --git a/Changes b/Changes
index 7da05fce3a636f99a7ccd670809982ffcbe934cb..34c5ba28ccd7d22544bfd31207dcd6a5271052a8 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,8 +1,10 @@
 06Dec98========================================================================
 1. Fixed DXBearing::is_qra so that it correctly detects full QRA locators
-2. Added a QRA locator thing to sh/heading so that if the 'prefix' looks like
-a locator it will print the bearing and distance to it (as well as doing the 
-normal sh/heading on a prefix thing).
+2. Added sh/qra for doing locator distances and bearings
+3. Added some stuff to Notes.txt on hints for command writers
+4. Changed help system to use just one file per language
+5. Started adding more help
+6. Fixed 24Mhz band limits
 05Dec98========================================================================
 1. Added sh/heading and QRA locator calculation stuff
 04Dec98========================================================================
diff --git a/cmd/Commands_en.hlp b/cmd/Commands_en.hlp
new file mode 100644 (file)
index 0000000..0b4766e
--- /dev/null
@@ -0,0 +1,88 @@
+#
+# please put your help in in alphabetical order
+#
+# a string search is done in the command field (case is ignored)
+# and all commands matching the asked for command are printed out
+#
+# the order of the fields in each header is 
+#   privilege, command, Description 
+# if the command ends in a - then that line isn't printed, but any
+# subsequent lines are
+#
+# Comment lines are indented before printing
+#
+=== 0^ANNOUNCE <text>^Send an announcement to LOCAL users only
+
+=== 0^ANNOUNCE FULL <text>^Send an announcement cluster wide
+This will send your announcement cluster wide
+
+=== 5^ANNOUNCE SYSOP <text>^Send an announcement to Sysops only
+
+=== 0^ANNOUNCE-
+<text> is the text of the announcement you wish to broadcast 
+
+=== 0^BYE^Exit from the cluster
+This will disconnect you from the cluster
+   
+=== 0^DX <freq> <callsign> <remarks>^Send a DX spot throughout the cluster
+<freq> is compared against the available bands set up in the cluster.
+see show/bands for more information.
+
+=== 0^HELP^The HELP Command
+HELP is available for a number of commands. The syntax is:-
+
+  HELP <cmd>
+  
+Where <cmd> is the name of the command you want help on.
+
+All commands can be abbreviated, so SHOW/DX can be abbreviated
+to SH/DX, ANNOUNCE can be shorted to AN and so on.
+
+=== 0^SHOW/DX^Interrogate the spot database
+If you just type SHOW/DX you will get the last so many spots
+(sysop configurable, but usually 10).
+   
+In addition you can add any number of these commands in very nearly
+any order to the basic SHOW/DX command, they are:-
+   
+on <band>       - eg 160m 20m 2m 23cm 6mm
+on <region>     - eg hf vhf uhf shf      (see SHOW/BANDS)
+   
+<number>        - the number of spots you want
+<from>-<to>     - <from> spot no <to> spot no in the selected list
+   
+<prefix>        - for a spotted callsign beginning with <prefix>
+*<suffix>       - for a spotted callsign ending in <suffix>
+*<string>*      - for a spotted callsign containing <string>
+   
+day <number>    - starting <number> days ago
+day <from>-<to> - <from> days <to> days ago
+   
+info <text>     - any spots containing <text> in the info or remarks
+   
+spotter <call>  - any spots spotted by <call>
+   
+e.g. 
+   
+   SH/DX 9m0
+   SH/DX on 20m info iota
+   SH/DX 9a on vhf day 30
+
+=== 0^SHOW/DXCC <prefix>^Interrogate the spot database by country
+This command takes the <prefix> (which can be a full or partial 
+callsign if desired), looks up which internal country number it is
+and then displays all the spots as per SH/DX for that country.
+   
+The options for SHOW/DX also apply to this command.   
+e.g. 
+   
+   SH/DXCC G
+   SH/DXCC W on 20m info iota
+
+=== 0^SHOW/PREFIX <callsign>^Interrogate the spot database by country
+This command takes the <callsign> (which can be a full or partial 
+callsign or a prefix if desired), looks up which internal country number 
+it is and then displays all the relevant prefixes for that country
+together with the internal country no, the CQ and ITU regions. 
+
+See also SHOW/DXCC
index fb3b303ad5c40590101c6cf6ecdec4be28046a0d..c058941bc516b8a655fe174d579e64e2cb1865e1 100644 (file)
@@ -62,7 +62,9 @@ Programming Notes ($Id$)
 
 * The normal privilege levels are:-
     0 - user privilege.
+    1 - remote user user privilege
     5 - sysop privilege.
+    8 - maximum recommended remote sysop privilege
     9 - console privilege.
 
   The sysop privilege is for things that you are prepared for remote
@@ -85,23 +87,37 @@ Programming Notes ($Id$)
   you can have one callsign, you can have several. Interpret your
   arguments; so for example:-
 
-    set/locator jo02lq       - sets your own locator to JO02LQ
-    set/locator g1tlh jo02lq - sets G1TLH's locator (if you are allowed)
+    set/qra jo02lq       - sets your own locator to JO02LQ
+    set/qra g1tlh jo02lq - sets G1TLH's locator (if you are allowed)
 
   or
 
-    show/locator             - displays your locator (and other info?)
-    show/locator in92jo      - displays the bearing and distance to 
-                               IN92JO using your lat/long or locator
-    show/locator jn56in in92jo  - bearing and distance between two
-                                  locators
-    show/locator gb7dxc      - bearing and distance to gb7dxc if poss.  
+    show/qra in92jo      - displays the bearing and distance to 
+                           IN92JO using your lat/long or locator
+    show/qra jn56in in92jo  - bearing and distance between two
+                              locators
 
 * It is important that you remember when you have tie hashes using MLDBM
   et al. If you do a DXUser->get($call) you will get a different (older)
   thing than the one in $self->$user. This is almost certainly NOT what
   you want if want to modify a user that is currently connected.
 
+* If you want to debug something, start the cluster.pl up thus:-
+    
+    perl -d cluster.pl
+    dbg> r
+
+  Then you can go into debug mode at anytime by using the command :-
+    debug
+
+  or you can put the line:-
+
+    $DB::single = 1;
+
+  in an appropriate place in a command. This will only have an effect
+  if you are running in perl debug mode.
+
 * Anything you output with a > as the last character is taken to mean
   that this is a prompt and will not have a \r or \n appended to it.
 
@@ -110,3 +126,6 @@ Programming Notes ($Id$)
   have a '.hlp' appended to the command name rather than a '.pl'. All 
   in the help file are sent to the user except those starting with a '#'
   character.
+
+* PLEASE add your new commands to the Commands_*.hlp file so that 
+  people know about and how to use them!
diff --git a/cmd/announce.hlp b/cmd/announce.hlp
deleted file mode 100644 (file)
index e65b898..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-=== 0^EN^ANNOUNCE^Send an announcement to the local cluster users
-   ANNOUNCE <text>
-   
-   <text> is the text of the announcement you wish to broadcast
-   
-=== 0^EN^ANNOUNCE FULL^Send an announcement to all cluster users
-   ANNOUNCE FULL <text>
-=== 5^EN^ANNOUNCE SYSOP^Send an announcement to sysops 
-   ANNOUNCE SYSOP <text>
diff --git a/cmd/apropos.pl b/cmd/apropos.pl
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/cmd/bye.hlp b/cmd/bye.hlp
deleted file mode 100644 (file)
index 1fe6432..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-=== 0^EN^BYE^Exit from the cluster
-   BYE
-   
-   This will disconnect you from the cluster
-   
diff --git a/cmd/dx.hlp b/cmd/dx.hlp
deleted file mode 100644 (file)
index 22dbc67..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-=== 0^EN^DX^Send a DX spot throughout the cluster
-   DX <freq> <callsign> <remarks>
-   or
-   DX <spotter> <freq> <callsign> <remarks>
-   
-   Use the second form only if you wish to credit the spot to someone
-   else.
diff --git a/cmd/help.hlp b/cmd/help.hlp
deleted file mode 100644 (file)
index 23576f8..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-=== 0^EN^HELP^The HELP Command
-HELP is available for a number of commands. The syntax is:-
-
-  HELP <cmd>
-  
-Where <cmd> is the name of the command you want help on.
-
-Commands for which help is available:-
-
-=== 0^EN^ANNOUNCE^make an announcement to the cluster
-=== 0^EN^BYE^exit from the cluster
-=== 9^EN^CREATE^Create various things
-=== 9^EN^DELETE^Delete various things
-=== 9^EN^DISCONNECT^Disconnect a user or node from the cluster
-=== 0^EN^DX^send a DX spot to the cluster
-=== 0^EN^SET^set various parameters
-=== 0^EN^SHOW^show various parameters
-=== 5^EN^SHUTDOWN^shutdown this node completely
-=== 5^EN^STAT^show the status of various system related things
-=== 0^EN^TALK^talk to another user of the cluster
-=== 0^EN^UNSET^unset or reset various parameters
-=== 0^EN^WWV^send a WWV spot
-=== 0^EN^WX^send a weather announcement to the cluster
index 781edc3222167d9f80fa490cf79a87a96cbd8375..c74fad166ba4a073f70cf2d025be99040b99fcf4 100644 (file)
@@ -2,11 +2,9 @@
 # the help subsystem
 #
 # It is a very simple system in that you type in 'help <cmd>' and it
-# looks for a file called <cmd>.hlp in either the local_cmd directory
+# looks for a file called command.hlp in either the local_cmd directory
 # or the cmd directory (in that order). 
 #
-# if you just type in 'help' by itself you get what is in 'help.hlp'.
-#
 # Copyright (c) 1998 - Dirk Koopman G1TLH
 #
 # $Id$
 
 my ($self, $line) = @_;
 my @out;
-my ($path, $fcmd) = ($main::cmd, "help");;
-my @out;
-my @inpaths = ($main::localcmd, $main::cmd);
-my @helpfiles;
 
 # this is naff but it will work for now
 $line = "help" if !$line;
-$fcmd = lc $line;
+my $lang = $self->lang;
+$lang = 'en' if !$lang;
 
-# each help file starts with a line that looks like:-
+# each help file contains lines that looks like:-
+#
+# === 0^EN^*^Description
+# text
+# text
 #
-# === 0^EN^HELP^Description
+# === 0^EN^help^Description
 # text
 # text
 # text 
@@ -33,31 +32,38 @@ $fcmd = lc $line;
 # The fields are:- privilege level, Language, full command name, short description
 #
 
-if (!open(H, "$path/$fcmd.hlp")) {
-  return (1, "no help on $line available");
+my $h = new FileHandle;
+
+if (!open($h, "$main::localcmd/Commands_$lang.hlp")) {
+       if (!open($h, "$main::cmd/Commands_$lang.hlp")) {
+               return (1, $self->msg('helpe1'));
+       }
 }
 my $in;
-my $include = 0;
-my @in = <H>;
-close(H);
-
-foreach $in (@in) {
-  next if $in =~ /^\s*\#/;
-  chomp $in;
-  if ($in =~ /^===/) {
-    $include = 0;
-    $in =~ s/=== //;
-       my ($priv, $lang, $cmd, $desc) = split /\^/, $in;
-       next if $priv > $self->priv;             # ignore subcommands that are of no concern
-       next if $self->lang && $self->lang ne $lang;
-       push @out, "$cmd - $desc";
-       $include = 1;
-       next;
-  }
-  push @out, $in if $include;
+
+$line =~ s/![\w\/]//og;
+$line =~ s/\//\.\*\//og;
+
+my $include;
+foreach $in (<$h>) {
+       next if $in =~ /^\#/;
+       chomp $in;
+       if ($in =~ /^===/) {
+               $include = 0;
+               $in =~ s/=== //;
+               my ($priv, $cmd, $desc) = split /\^/, $in;
+               next if $priv > $self->priv;             # ignore subcommands that are of no concern
+               next unless $cmd =~ /$line/i;
+               push @out, "$cmd $desc" unless $cmd =~ /-$/o;
+               $include = 1;
+               next;
+       }
+       push @out, "   $in" if $include;
 }
 
-push @out, "No help available for $line" if @out == 0;
+close($h);
+
+push @out, $self->msg('helpe2', $line) if @out == 0;
 
 return (1, @out);
 
diff --git a/cmd/show/dx.hlp b/cmd/show/dx.hlp
deleted file mode 100644 (file)
index deb06a7..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-=== 0^EN^SHOW/DX^Interrogate the spot database
-   SHOW/DX 
-   
-   If you just type SHOW/DX you will get the last so many spots
-   (sysop configurable, but usually 10).
-   
-   In addition you can add any number of these commands in very nearly
-   any order to the basic SHOW/DX command, they are:-
-   
-   on <band>       - eg 160m 20m 2m 23cm 6mm
-   on <region>     - eg hf vhf uhf shf
-   
-   <number>        - the number of spots you want
-   <from>-<to>     - <from> spot no <to> spot no in the selected list
-   
-   <prefix>        - for a spotted callsign beginning with <prefix>
-   *<suffix>       - for a spotted callsign ending in <suffix>
-   *<string>*      - for a spotted callsign containing <string>
-   
-   day <number>    - starting <number> days ago
-   day <from>-<to> - <from> days <to> days ago
-   
-   info <text>     - any spots containing <text> in the info or remarks
-   
-   spotter <call>  - any spots spotted by <call>
-   
-   e.g. 
-   
-   SH/DX 9m0
-   SH/DX on 20m info iota
-   SH/DX 9a on vhf day 30
-   See also SHOW/DXCC
diff --git a/cmd/show/dxcc.hlp b/cmd/show/dxcc.hlp
deleted file mode 100644 (file)
index 9cef871..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-=== 0^EN^SHOW/DXCC^Interrogate the spot database by country
-   SHOW/DXCC <prefix>
-   
-   This command takes the <prefix> (which can be a full or partial 
-   callsign if desired), looks up which internal country number it is
-   and then displays all the spots as per SH/DX for that country.
-   
-   In addition you can add any number of these commands in very nearly
-   any order to the basic SHOW/DXCC command, they are:-
-   
-   on <band>       - eg 160m 20m 2m 23cm 6mm
-   on <region>     - eg hf vhf uhf shf
-   
-   <number>        - the number of spots you want
-   <from>-<to>     - <from> spot no <to> spot no in the selected list
-   
-   day <number>    - starting <number> days ago
-   day <from>-<to> - <from> days <to> days ago
-   
-   info <text>     - any spots containing <text> in the info or remarks
-   
-   spotter <call>  - any spots spotted by <call>
-   
-   e.g. 
-   
-   SH/DX G
-   SH/DX W on 20m info iota
-   See also SHOW/DXCC
diff --git a/cmd/show/prefix.hlp b/cmd/show/prefix.hlp
deleted file mode 100644 (file)
index 942073a..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-=== 0^EN^SHOW/PREFIX^Interrogate the spot database by country
-   SHOW/PREFIX <prefix> or <callsign>
-   
-   This command takes the <prefix> (which can be a full or partial 
-   callsign if desired), looks up which internal country number it is
-   and then displays all the relevant prefixes for that country
-   together with the internal country no, the CQ and ITU regions. 
index 7ac51e10f75efdd8a1279ae91a4ae628dd1134e7..9f0daa91f44e1555fe281a98b45146a9a785e196 100644 (file)
                     ssb => [ 21151, 21450] 
                   }, 'Bands'),
 
-  '12m' => bless( { band => [ 21000, 21450 ], 
-                    cw => [ 21000, 21150 ], 
-                    data => [ 21100, 21120 ], 
-                    ssb => [ 21151, 21450] 
+  '12m' => bless( { band => [ 24890, 24990 ], 
+                    cw => [ 24890, 24990 ], 
+                    ssb => [ 24920, 24930], 
+                    rtty => [ 24930, 24990], 
                   }, 'Bands'),
 
 
index 8d75053f7a19c7c11c97f32bc770bb394c89fcdd..60eb3c00d519f7aa50a196486220fdff79737374 100644 (file)
@@ -35,6 +35,8 @@ package DXM;
                                e8 => 'Need a callsign and some text',
                                e9 => 'Need at least some text',
                                email => 'E-mail address set to: $_[0]',
+                               helpe1 => 'Help system unavailable, tell sysop',
+                               helpe2 => 'No help available on $_[0]',
                                heres => 'Here set on $_[0]',
                                heade1 => 'Using $main::mycall Coords, consider doing a set/location or set/qra',
                                hereu => 'Here unset on $_[0]',