From 2cd7c4ee354ea3c8e71d7d7c7deff856e0d4a2f6 Mon Sep 17 00:00:00 2001 From: remilia Date: Sun, 25 May 2025 15:59:31 +0800 Subject: [PATCH] debug --- flandre/__init__.py | 2 +- flandre/launcher.py | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/flandre/__init__.py b/flandre/__init__.py index 6d79c1a..b487cea 100644 --- a/flandre/__init__.py +++ b/flandre/__init__.py @@ -60,7 +60,7 @@ class SoftwareConfig: video_height: int = 1080 video_width: int = 960 - live_ip: str = 'vmaosmax.as' + live_ip: str = 'vmaosmax' live_push_port: int = 5555 live_rep_port: int = 5556 device_py_rep_port: int = 5558 diff --git a/flandre/launcher.py b/flandre/launcher.py index bb6f99c..b7268b4 100644 --- a/flandre/launcher.py +++ b/flandre/launcher.py @@ -191,7 +191,10 @@ dd: Device = None @entrypoint.group() -def device(): +@click.option('--ip', default=None) +def device(ip): + if ip is not None: + C.live_ip = ip global device_req ctx = zmq.Context() device_req = ctx.socket(zmq.REQ) @@ -243,10 +246,15 @@ def device_recvmonitor(): ctx = zmq.Context() pull = ctx.socket(zmq.PULL) pull.connect(C.live_push_socket) + last_device_ts_low = 0 + last_host_ts = 0 while True: b = pull.recv() seq, encoder, host_ts, device_ts_low, device_ts_high, buffer = b2t(b) - print(f'S={seq} E={encoder} HT={host_ts} DTL={device_ts_low} BS={buffer.__len__()}') + print( + f'S={seq} E={encoder} HT={host_ts} DTL={device_ts_low} HTDF={host_ts - last_host_ts} DTLDF={device_ts_low - last_device_ts_low} DTH={device_ts_high} BS={buffer.__len__()}') + last_device_ts_low = device_ts_low + last_host_ts = host_ts @device.command('recvplot')