From 72a1e45c91e8f5aeb49866fc3ac727683a07eaaf Mon Sep 17 00:00:00 2001 From: Dave Stillman Date: Wed, 29 Mar 2017 07:33:01 -0600 Subject: [PATCH] simplify gpmdinfo --- bin/gpmdinfo/gpmdinfo.go | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/bin/gpmdinfo/gpmdinfo.go b/bin/gpmdinfo/gpmdinfo.go index f76a244..23b7950 100644 --- a/bin/gpmdinfo/gpmdinfo.go +++ b/bin/gpmdinfo/gpmdinfo.go @@ -34,8 +34,6 @@ func main() { // currently processing sentence t := &telemetry.TELEM{} - // previous sentence - keep it around mostly for the timestamp - t_prev := &telemetry.TELEM{} for { t, err = telemetry.Read(telemFile) @@ -51,21 +49,10 @@ func main() { break } - // first full, guess it's about a second - if t_prev.IsZero() { - *t_prev = *t - t.Clear() - continue - } - - // process the previous timestamp until current known timestamp - t_prev.FillTimes(t.Time.Time) - - // this is pretty useless: change it to pick a field you want - // or mangle it to your wishes - fmt.Println(t_prev.Time) + // this is pretty useless and info overload: change it to pick a field you want + // or mangle it to your wishes into JSON/CSV/format of choice + fmt.Println(t) - *t_prev = *t t = &telemetry.TELEM{} } }