diff --git a/.gitignore b/.gitignore index 5b90041..b5c09a0 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ *.so *.dylib FLEcli -executables/* +#executables/* test/output/temp/* # Test binary, built with `go test -c` diff --git a/cmd/FLEcli_version.go b/cmd/FLEcli_version.go index ba53bfb..a525a30 100644 --- a/cmd/FLEcli_version.go +++ b/cmd/FLEcli_version.go @@ -1,4 +1,4 @@ package cmd //VersionString is the version that will be displayed with the -v switch -const VersionString = "v0.0.0.0-12-geec547e (2020-07-16)" +const VersionString = "v0.0.0.0-15-g8c35ac4 (2020-07-16)" diff --git a/cmd/adif.go b/cmd/adif.go index 2f65abb..61e4e19 100644 --- a/cmd/adif.go +++ b/cmd/adif.go @@ -71,6 +71,10 @@ func processAdifCommand() { fmt.Println("Missing MY-WWFF reference. Aborting...") return } + if loadedLogFile[0].Operator == "" { + fmt.Println("Missing Operator. Aborting...") + return + } } if isSOTAcli { if loadedLogFile[0].MySOTA == "" { diff --git a/cmd/adif_write.go b/cmd/adif_write.go index 52aa4f1..c336998 100644 --- a/cmd/adif_write.go +++ b/cmd/adif_write.go @@ -27,8 +27,6 @@ import ( // outputAdif generates and writes data in ADIF format func outputAdif(outputFile string, fullLog []LogLine, isWWFF bool, isSOTA bool) { - //TODO: validate input data for combination - //convert the log data to an in-memory ADIF file adifData := buildAdif(fullLog, isWWFF, isSOTA) @@ -57,8 +55,14 @@ func buildAdif(fullLog []LogLine, isWWFF bool, isSOTA bool) (adifList []string) } adifLine.WriteString(adifElement("RST_SENT", logLine.RSTsent)) adifLine.WriteString(adifElement("RST_RCVD", logLine.RSTrcvd)) + if logLine.Comment != "" { + adifLine.WriteString(adifElement("COMMENT", logLine.Comment)) + } + if logLine.OMname != "" { + adifLine.WriteString(adifElement("NAME", logLine.OMname)) + } if logLine.QSLmsg != "" { - adifLine.WriteString(adifElement("QSLMSG", logLine.RSTrcvd)) + adifLine.WriteString(adifElement("QSLMSG", logLine.QSLmsg)) } if isWWFF { adifLine.WriteString(adifElement("MY_SIG", "WWFF")) @@ -103,7 +107,7 @@ func writeFile(outputFile string, adifData []string) { checkFileError(err) lineCount++ } - fmt.Printf("\nSuccessfully wrote %d lines to file \"%s\"", lineCount, outputFile) + fmt.Printf("\nSuccessfully wrote %d lines to file \"%s\"\n", lineCount, outputFile) } // adifElement generated the ADIF sub-element diff --git a/executables/linux/FLEcli-amd64 b/executables/linux/FLEcli-amd64 new file mode 100755 index 0000000..a7b8ee1 Binary files /dev/null and b/executables/linux/FLEcli-amd64 differ diff --git a/test.sh b/test.sh index 7cba7da..721a2b6 100755 --- a/test.sh +++ b/test.sh @@ -12,4 +12,6 @@ echo "--------------------------" ./FLEcli -i test/data/ON4KJM@ONFF-025920200524.txt load echo "--------------------------" ./FLEcli -i test/FLE-sample/sota_wwff.txt csv -o=test/output/temp/sota_wwff.csv --interpolate --overwrite -diff test/output/temp/sota_wwff.csv test/FLE-sample/sota_wwff.csv --strip-trailing-cr && echo "no difference" || echo "differences!" \ No newline at end of file +diff test/output/temp/sota_wwff.csv test/FLE-sample/sota_wwff.csv --strip-trailing-cr && echo "no difference" || echo "differences!" +echo "--------------------------" +./FLEcli -i test/FLE-sample/sota_wwff.txt adif -o=test/output/temp/sota_wwff.adif --interpolate --overwrite --wwff --sota diff --git a/test/FLE-sample/sota_wwff.adi b/test/FLE-sample/sota_wwff.adif similarity index 99% rename from test/FLE-sample/sota_wwff.adi rename to test/FLE-sample/sota_wwff.adif index 34c0b55..8f87e09 100644 --- a/test/FLE-sample/sota_wwff.adi +++ b/test/FLE-sample/sota_wwff.adif @@ -1,12 +1,12 @@ -ADIF Export for Fast Log Entry by DF3CB -FLE -3.1.0 - -G3WGV G4ELZ 20160424 1202 40m CW 599 599 WWFF GFF-0014 G/LD-008 -G3WGV G3NOH 20160424 1204 40m CW 599 599 PSE QSL Direct WWFF GFF-0014 G/LD-008 -G3WGV GW4GTE 20160424 1227 2m FM 59 59 Dave WWFF GFF-0014 G/LD-008 -G3WGV GW0TLK/M 20160424 1228 2m FM 59 59 WWFF GFF-0014 WWFF GWFF-0021 G/LD-008 -G3WGV GM0AAA 20160603 1404 40m CW 539 579 WWFF GFF-0014 G/LD-008 -G3WGV ON4CK/P 20160603 1405 40m CW 529 599 WWFF GFF-0014 G/LD-008 ON/ON-018 -G3WGV DL0DAN/P 20160603 1407 40m CW 599 599 WWFF GFF-0014 WWFF DLFF-0002 G/LD-008 DL/AL-044 -G3WGV YU7LS 20160603 1410 20m CW 599 599 WWFF GFF-0014 G/LD-008 +ADIF Export for Fast Log Entry by DF3CB +FLE +3.1.0 + +G3WGV G4ELZ 20160424 1202 40m CW 599 599 WWFF GFF-0014 G/LD-008 +G3WGV G3NOH 20160424 1204 40m CW 599 599 PSE QSL Direct WWFF GFF-0014 G/LD-008 +G3WGV GW4GTE 20160424 1227 2m FM 59 59 Dave WWFF GFF-0014 G/LD-008 +G3WGV GW0TLK/M 20160424 1228 2m FM 59 59 WWFF GFF-0014 WWFF GWFF-0021 G/LD-008 +G3WGV GM0AAA 20160603 1404 40m CW 539 579 WWFF GFF-0014 G/LD-008 +G3WGV ON4CK/P 20160603 1405 40m CW 529 599 WWFF GFF-0014 G/LD-008 ON/ON-018 +G3WGV DL0DAN/P 20160603 1407 40m CW 599 599 WWFF GFF-0014 WWFF DLFF-0002 G/LD-008 DL/AL-044 +G3WGV YU7LS 20160603 1410 20m CW 599 599 WWFF GFF-0014 G/LD-008 diff --git a/test/FLE-sample/sota_wwff.txt b/test/FLE-sample/sota_wwff.txt index 9923243..6198ff9 100644 --- a/test/FLE-sample/sota_wwff.txt +++ b/test/FLE-sample/sota_wwff.txt @@ -1,7 +1,7 @@ { Sample WWFF and SOTA log } # Header -mycall g3wgv -operator +mycall g3wgv/p +operator g3wgv mywwff gff-0014 mysota g/ld-008