From 3f95659d37a2ef4b1d85ee6c9bcda3af7b09c00c Mon Sep 17 00:00:00 2001 From: TenkyuChimata Date: Sun, 30 Jun 2024 20:09:01 +0800 Subject: [PATCH] Fix gaps and Sample rate issue --- CHANGELOG.md | 4 ++++ VERSION | 2 +- driver/serial/filter.go | 3 --- feature/geophone/daemon.go | 3 +-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bfbd6dd9..c82fab15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ Starting from v2.2.5, all notable changes to this project will be documented in this file. +## v2.12.6 + +- Fix gaps and Sample rate issue + ## v2.12.5 - Fix gaps in MiniSEED records diff --git a/VERSION b/VERSION index 8c118ca0..ea0f7e0d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.12.5 +v2.12.6 diff --git a/driver/serial/filter.go b/driver/serial/filter.go index 7dc473b7..d5c7c283 100644 --- a/driver/serial/filter.go +++ b/driver/serial/filter.go @@ -5,7 +5,6 @@ import ( "fmt" "io" "math" - "time" ) func Filter(port io.ReadWriteCloser, signature []byte) ([]byte, error) { @@ -19,8 +18,6 @@ func Filter(port io.ReadWriteCloser, signature []byte) ([]byte, error) { if bytes.Equal(header, signature) { return header, nil - } else { - time.Sleep(time.Millisecond) } } diff --git a/feature/geophone/daemon.go b/feature/geophone/daemon.go index 0bfee72e..dbfed11a 100644 --- a/feature/geophone/daemon.go +++ b/feature/geophone/daemon.go @@ -87,9 +87,8 @@ func (g *Geophone) Run(options *feature.FeatureOptions, waitGroup *sync.WaitGrou for { <-g.Ticker.C currentTime, _ := duration.Timestamp(options.Status.System.Offset) - timeDiff := duration.Difference(currentTime, options.Status.LastRecvTime) // Set packet timestamp, note that the timestamp in buffer is the start of the packet - options.Status.Buffer.TS = currentTime.UnixMilli() - timeDiff.Milliseconds() + options.Status.Buffer.TS = currentTime.UnixMilli() - time.Second.Milliseconds() // Set last received time is the current timestamp options.Status.LastRecvTime = currentTime options.Status.System.Messages++