From 814256714b8ac05c35d873ad6fdc70a6fc5c142b Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Wed, 26 Apr 2023 20:58:12 +0200 Subject: [PATCH] [Cabrillo export] Tuned the output string --- application/libraries/Cabrilloformat.php | 32 ++++++++++++++++-------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/application/libraries/Cabrilloformat.php b/application/libraries/Cabrilloformat.php index 46339a21..764aa52b 100644 --- a/application/libraries/Cabrilloformat.php +++ b/application/libraries/Cabrilloformat.php @@ -124,19 +124,29 @@ class Cabrilloformat { $time = str_replace(":","",$time); - if ($qso->COL_STX_STRING != "") { + $returnstring = "QSO: ".sprintf("%6s", $freq)." ".$mode." ".$time." ".sprintf("%-13s", $qso->station_callsign)." ".sprintf("%3s", $qso->COL_RST_SENT)." "; - if($qso->COL_SRX_STRING != "") { - $rx_string = $qso->COL_SRX_STRING; - } else { - $rx_string = "--"; - } - - return "QSO: ".sprintf("%6s", $freq)." ".$mode." ".$time." ".sprintf("%-13s", $qso->station_callsign)." ".sprintf("%3s", $qso->COL_RST_SENT)." ".sprintf("%-6s", sprintf("%03d", $qso->COL_STX))." ".$qso->COL_STX_STRING . " " .sprintf("%-13s", $qso->COL_CALL)." ".sprintf("%3s", $qso->COL_RST_RCVD)." ".sprintf("%-6s", sprintf("%03d", $qso->COL_SRX))." " . $rx_string . " 0\n"; - } else { - - return "QSO: ".sprintf("%6s", $freq)." ".$mode." ".$time." ".sprintf("%-13s", $qso->station_callsign)." ".sprintf("%3s", $qso->COL_RST_SENT)." ".sprintf("%-6s", sprintf("%03d", $qso->COL_STX))." ".sprintf("%-13s", $qso->COL_CALL)." ".sprintf("%3s", $qso->COL_RST_RCVD)." ".sprintf("%-6s", sprintf("%03d", $qso->COL_SRX))." 0\n"; + if ($qso->COL_STX != NULL) { + $returnstring .= sprintf("%-6s", sprintf("%03d", $qso->COL_STX)) ." "; } + if ($qso->COL_STX_STRING != "") { + $returnstring .= $qso->COL_STX_STRING ." "; + } + + $returnstring .= sprintf("%-13s", $qso->COL_CALL)." ".sprintf("%3s", $qso->COL_RST_RCVD)." "; + + if ($qso->COL_SRX != NULL) { + $returnstring .= sprintf("%-6s", sprintf("%03d", $qso->COL_SRX)) ." "; + } + + if ($qso->COL_SRX_STRING != "") { + $returnstring .= $qso->COL_SRX_STRING ." "; + } + + $returnstring .= " 0\n"; + + return $returnstring; + } }