Some further tweaking

pull/2/head
Jean-Marc MEESSEN 4 years ago
parent 8c35ac4650
commit 12c892c6b0

2
.gitignore vendored

@ -5,7 +5,7 @@
*.so *.so
*.dylib *.dylib
FLEcli FLEcli
executables/* #executables/*
test/output/temp/* test/output/temp/*
# Test binary, built with `go test -c` # Test binary, built with `go test -c`

@ -1,4 +1,4 @@
package cmd package cmd
//VersionString is the version that will be displayed with the -v switch //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)"

@ -71,6 +71,10 @@ func processAdifCommand() {
fmt.Println("Missing MY-WWFF reference. Aborting...") fmt.Println("Missing MY-WWFF reference. Aborting...")
return return
} }
if loadedLogFile[0].Operator == "" {
fmt.Println("Missing Operator. Aborting...")
return
}
} }
if isSOTAcli { if isSOTAcli {
if loadedLogFile[0].MySOTA == "" { if loadedLogFile[0].MySOTA == "" {

@ -27,8 +27,6 @@ import (
// outputAdif generates and writes data in ADIF format // outputAdif generates and writes data in ADIF format
func outputAdif(outputFile string, fullLog []LogLine, isWWFF bool, isSOTA bool) { 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 //convert the log data to an in-memory ADIF file
adifData := buildAdif(fullLog, isWWFF, isSOTA) 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_SENT", logLine.RSTsent))
adifLine.WriteString(adifElement("RST_RCVD", logLine.RSTrcvd)) 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 != "" { if logLine.QSLmsg != "" {
adifLine.WriteString(adifElement("QSLMSG", logLine.RSTrcvd)) adifLine.WriteString(adifElement("QSLMSG", logLine.QSLmsg))
} }
if isWWFF { if isWWFF {
adifLine.WriteString(adifElement("MY_SIG", "WWFF")) adifLine.WriteString(adifElement("MY_SIG", "WWFF"))
@ -103,7 +107,7 @@ func writeFile(outputFile string, adifData []string) {
checkFileError(err) checkFileError(err)
lineCount++ 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 // adifElement generated the ADIF sub-element

Binary file not shown.

@ -13,3 +13,5 @@ echo "--------------------------"
echo "--------------------------" echo "--------------------------"
./FLEcli -i test/FLE-sample/sota_wwff.txt csv -o=test/output/temp/sota_wwff.csv --interpolate --overwrite ./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!" 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

@ -1,7 +1,7 @@
{ Sample WWFF and SOTA log } { Sample WWFF and SOTA log }
# Header # Header
mycall g3wgv mycall g3wgv/p
operator operator g3wgv
mywwff gff-0014 mywwff gff-0014
mysota g/ld-008 mysota g/ld-008

Loading…
Cancel
Save