Skip to content

Commit

Permalink
simplify gpmdinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
stilldavid committed Mar 29, 2017
1 parent d1d3795 commit 72a1e45
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions bin/gpmdinfo/gpmdinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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{}
}
}

0 comments on commit 72a1e45

Please sign in to comment.