From d36c6c776e44451b4cf3c319a905c6ab30b1e5f8 Mon Sep 17 00:00:00 2001 From: Eric Codes Date: Tue, 14 Jan 2025 16:03:42 -0500 Subject: [PATCH] Generate a canonical POTA log without the --pota flag There is no reason why a POTA log should not be generated like the canonical one without the --pota flag. Now the --pota flag turns on validation. If you forget to turn on --pota and include a MyPark header directive, POTA.app will reject your log because it is missing MY_SIG_INFO. Branch: support-pota-hunters --- flecmd/adif.go | 2 +- fleprocess/adif_write.go | 2 +- test/bats-scripts/test.bats | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/flecmd/adif.go b/flecmd/adif.go index 3c941bf..dcf8d9b 100644 --- a/flecmd/adif.go +++ b/flecmd/adif.go @@ -86,6 +86,6 @@ func init() { adifCmd.PersistentFlags().BoolVarP(&isInterpolateTime, "interpolate", "i", false, "Interpolates the missing time entries.") adifCmd.PersistentFlags().BoolVarP(&isWWFFcli, "wwff", "w", false, "Generates a WWFF ready ADIF file.") adifCmd.PersistentFlags().BoolVarP(&isSOTAcli, "sota", "s", false, "Generates a SOTA ready ADIF file.") - adifCmd.PersistentFlags().BoolVarP(&isPOTAcli, "pota", "p", false, "Generates a POTA ready ADIF file.") + adifCmd.PersistentFlags().BoolVarP(&isPOTAcli, "pota", "p", false, "Check if the POTA activation log is valid") adifCmd.PersistentFlags().BoolVarP(&isOverwrite, "overwrite", "o", false, "Overwrites the output file if it exisits") } diff --git a/fleprocess/adif_write.go b/fleprocess/adif_write.go index 8a48838..a203be3 100644 --- a/fleprocess/adif_write.go +++ b/fleprocess/adif_write.go @@ -73,7 +73,7 @@ func buildAdif(fullLog []LogLine, adifParams AdifParams) (adifList []string) { adifLine.WriteString(adifElement("SIG_INFO", logLine.WWFF)) } } - if adifParams.IsPOTA { + if logLine.MyPOTA != "" { adifLine.WriteString(adifElement("MY_SIG", "POTA")) adifLine.WriteString(adifElement("MY_SIG_INFO", logLine.MyPOTA)) } diff --git a/test/bats-scripts/test.bats b/test/bats-scripts/test.bats index fcf3fa2..e1bf4a9 100644 --- a/test/bats-scripts/test.bats +++ b/test/bats-scripts/test.bats @@ -35,6 +35,12 @@ diff test/output/temp/sample_pota.adif test/output/POTA/sample_pota.adif --strip-trailing-cr } +@test "Is the generated POTA adif equivalent to the canonical one without the --pota flag?" { + mkdir -p test/output/temp + output=$(test/docker-FLEcli.sh adif -o -i test/data/sample_pota.txt test/output/temp/sample_pota.adif) + diff test/output/temp/sample_pota.adif test/output/POTA/sample_pota.adif --strip-trailing-cr +} + @test "Processing a FLE file with no QSO must fail!" { run test/docker-FLEcli.sh csv -o -i test/data/fle-4-no-qso.txt [ "$status" -eq 1 ]