Skip to content

Commit

Permalink
add skip time for BBL
Browse files Browse the repository at this point in the history
  • Loading branch information
stronnag committed Aug 23, 2024
1 parent 89b5311 commit 8957a84
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/bbl/bblreader.go
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,11 @@ func (lg *BBLOG) Reader(meta types.FlightMeta, ch chan interface{}) (types.LogSe
leffic := 0.0
lwhkm := 0.0
whacc := 0.0
var skiptime uint64 = 0

if options.Config.SkipTime > 0 {
skiptime = uint64(options.Config.SkipTime) * 1000
}

for i := 0; ; i++ {
record, err := r.Read()
Expand Down Expand Up @@ -793,6 +798,11 @@ func (lg *BBLOG) Reader(meta types.FlightMeta, ch chan interface{}) (types.LogSe
}
} else {
us := b.Stamp
var deltat = us - st
if skiptime > 0 && deltat < skiptime {
continue
}

if us > st {
var d float64
var c float64
Expand Down
2 changes: 2 additions & 0 deletions pkg/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ type Configuration struct {
Verbose int `json:"-"`
SitlConfig string `json:"-"`
SitlMinimal bool `json:"-"`
SkipTime int `json:"-"`
}

var Config Configuration = Configuration{Intvl: 1000, Blackbox_decode: "blackbox_decode", Bulletvers: 2, SplitTime: 120, Epsilon: 0.015, StartOff: 30, EndOff: -30, Engunit: "mah", MaxWP: 120}
Expand Down Expand Up @@ -161,6 +162,7 @@ func ParseCLI(gv func() string) ([]string, string) {
flag.BoolVar(&Config.Metas, "metas", false, "list metadata and exit")
flag.BoolVar(&Config.Fast, "fast", false, "faster replay")
flag.IntVar(&Config.Type, "type", Config.Type, "model type")
flag.IntVar(&Config.SkipTime, "skiptime", Config.SkipTime, "[BBL] Skip Time (ms)")
} else if strings.HasPrefix(app, "log2mission") {
flag.Float64Var(&Config.Epsilon, "epsilon", Config.Epsilon, "Epsilon")
flag.IntVar(&Config.StartOff, "start-offset", Config.StartOff, "Start Offset (seconds)")
Expand Down

0 comments on commit 8957a84

Please sign in to comment.