using packet timestamp

This commit is contained in:
Martino Ferrari
2026-05-21 15:56:29 +02:00
parent 3315c02282
commit b465dd680c
2 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -328,7 +328,7 @@ func buildSourcesMsg(sm map[string]*sourceHubState) []byte {
// Run is the hub's main goroutine. Must be started with go hub.Run(). // Run is the hub's main goroutine. Must be started with go hub.Run().
func (h *Hub) Run() { func (h *Hub) Run() {
ticker := time.NewTicker(time.Second / 20) ticker := time.NewTicker(time.Second / 30)
defer ticker.Stop() defer ticker.Stop()
statsTicker := time.NewTicker(time.Second) statsTicker := time.NewTicker(time.Second)
+5 -3
View File
@@ -1965,18 +1965,20 @@ function renderDirtyPlots() {
// via setScale instead of rebuilding all data arrays (much cheaper). // via setScale instead of rebuilding all data arrays (much cheaper).
if (!trig.enabled && !globalPause) { if (!trig.enabled && !globalPause) {
plots.forEach(p => { plots.forEach(p => {
if (!p.uplot || p.xRange) return; if (!p.uplot || p.xRange || p.traces.length === 0) return;
p.needsRedraw = true; p.needsRedraw = true;
}); });
} }
plots.forEach(p => { plots.forEach(p => {
if (!p.needsRedraw || !p.uplot) return; if (!p.needsRedraw || !p.uplot || p.traces.length === 0) return;
const inTrigModeNow = trig.enabled && trig.snapshot !== null; const inTrigModeNow = trig.enabled && trig.snapshot !== null;
const isRolling = !trig.enabled && !p.xRange; const isRolling = !trig.enabled && !p.xRange;
// Fast path: rolling-window plot with no new data — just shift viewport. // Fast path: rolling-window plot with no new data — just shift viewport
// anchored to buffer timestamps so the x-range only advances when
// signal data actually moves forward.
if (isRolling && _dataGen === p.lastDataGen && p.uplot.data && p.uplot.data[0] && p.uplot.data[0].length > 0) { if (isRolling && _dataGen === p.lastDataGen && p.uplot.data && p.uplot.data[0] && p.uplot.data[0].length > 0) {
p.needsRedraw = false; p.needsRedraw = false;
zoomGuard = true; zoomGuard = true;