try to improve spot display
authorDirk Koopman <djk@tobit.co.uk>
Sun, 23 Jan 2022 08:31:47 +0000 (08:31 +0000)
committerDirk Koopman <djk@tobit.co.uk>
Sun, 23 Jan 2022 08:31:47 +0000 (08:31 +0000)
To keep the ':' for logging programs (sigh)

Changes
perl/DXCommandmode.pm

diff --git a/Changes b/Changes
index 77b8924c5fd55ff805f8c9e25974b01a110b2b65..c3dcd6db890ec2b9bf0d98fa3f53449c28662743 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,7 @@
+22Jan22=======================================================================
+1. Refine spot display to retain the ':' and also reduce the likelyhood of
+   of misalignment by using the available space in the 39 characters more
+   intelligently. This is WIP.
 21Jan22=======================================================================
 1. Fix version tracking in PC92
 2. Bring the major parts of master and mojo together to make maintenance a
index 1960a8905f36a4561e1a23a41790328c2f3088fa..8abd8d4eeadc586b387b71974c38951be9f3069e 100644 (file)
@@ -1057,7 +1057,21 @@ sub format_dx_spot
                }
        }
 
-       return sprintf "DX de %-8.8s%10.1f  %-12.12s %-s $t$slot2", "$_[4]:", $_[0], $_[1], $comment;
+       my $o = sprintf("%-9s", $_[4] . ':');
+       my $qrg = sprintf "%8.1f", $_[0];
+       if (length $qrg >= 9) {
+               while (length($o)+length($qrg) > 17 && $o =~ / $/) {
+                       chop $o;
+               }
+       }
+       my $spot = sprintf "%-12s", $_[1];
+       my $front = "DX de $o $qrg  $spot";
+       while (length($front) > 38 && $front =~ /  $/) {
+               chop $front;
+       }
+
+       
+       return sprintf "$front %-s $t$slot2", $comment;
 }