From 97886041a8154afe88743dd55f80af0ba88254e5 Mon Sep 17 00:00:00 2001 From: Sebastian Denz Date: Fri, 27 Nov 2020 09:57:26 +0100 Subject: [PATCH] fix timestamp logging --- .gitignore | 2 +- shared/wsjtx/wsjtx.go | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index afd75ba..fb2b73f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ import/ -.swp +*.swp diff --git a/shared/wsjtx/wsjtx.go b/shared/wsjtx/wsjtx.go index b1052f4..953b468 100644 --- a/shared/wsjtx/wsjtx.go +++ b/shared/wsjtx/wsjtx.go @@ -35,6 +35,18 @@ type Result struct { Rx int } +var blackList = map[string]bool { + "73": true, + "RR73;": true, + "GL": true, + "TNX": true, + "<...>": true, + "QSO": true, + "QSY": true, + "TIME": true, + "TIMESYNC": true, +} + func GetBand(freq float64) (string){ band := "unknown" if (freq>1 && freq<2) { @@ -122,7 +134,7 @@ func ScanLine(line string) (Result, bool) { } // ignore 'TNX QSO GL 73' etc. - if result.Call == "73" || result.Call == "<...>" || result.Call == "QSO" || result.Call == "QSY" { + if blackList[result.Call] { log.WithFields(log.Fields{"line":line,"callsign":result.Call}).Trace("skipping callsign") return *result, false } @@ -153,7 +165,7 @@ func ScanLine(line string) (Result, bool) { "dxcc":result.Ent.DXCC, "continent":result.Ent.Continent, "band":result.Band, - "time":result.Timestamp.String(), + "sendtime":result.Timestamp, "mode":result.Mode, "geohash":result.GeoHash, "rx":result.Rx,