From d5bbb8b5085e57870503e56c79cdebb26122c915 Mon Sep 17 00:00:00 2001 From: Dirk Koopman Date: Sun, 23 Jan 2022 08:31:47 +0000 Subject: [PATCH] try to improve spot display To keep the ':' for logging programs (sigh) --- Changes | 4 ++++ perl/DXCommandmode.pm | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 77b8924c..c3dcd6db 100644 --- 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 diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index 1960a890..8abd8d4e 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -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; } -- 2.34.1