From 26539285c8bf9e34fbae26655b38705da4b154ac Mon Sep 17 00:00:00 2001 From: remilia Date: Tue, 13 May 2025 20:19:36 +0800 Subject: [PATCH] fix for ttyplot --- flandre/launcher.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/flandre/launcher.py b/flandre/launcher.py index 4bcc0ea..9494434 100644 --- a/flandre/launcher.py +++ b/flandre/launcher.py @@ -218,15 +218,21 @@ def device_upload(name, file: TextIOWrapper): @device.command('recvtest') -def device_upload(): +def device_recv_test(): ctx = zmq.Context() pull = ctx.socket(zmq.PULL) pull.connect(C.live_push_socket) last_ts = 0 + first = True while True: b = pull.recv() + ts, sequence_id, encoder, buffer = b2t(b) - print(ts, ts - last_ts) + if first: + last_ts = ts + first = False + continue + print((ts - last_ts)/10**6,flush=True) last_ts = ts