fix command
This commit is contained in:
parent
26539285c8
commit
bba3096a82
@ -1,3 +1,4 @@
|
|||||||
|
import hashlib
|
||||||
import importlib
|
import importlib
|
||||||
import logging
|
import logging
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
@ -217,8 +218,8 @@ def device_upload(name, file: TextIOWrapper):
|
|||||||
dd.set_name_and_file_only(name, file.read())
|
dd.set_name_and_file_only(name, file.read())
|
||||||
|
|
||||||
|
|
||||||
@device.command('recvtest')
|
@device.command('recvplot')
|
||||||
def device_recv_test():
|
def device_recvplot():
|
||||||
ctx = zmq.Context()
|
ctx = zmq.Context()
|
||||||
pull = ctx.socket(zmq.PULL)
|
pull = ctx.socket(zmq.PULL)
|
||||||
pull.connect(C.live_push_socket)
|
pull.connect(C.live_push_socket)
|
||||||
@ -235,6 +236,31 @@ def device_recv_test():
|
|||||||
print((ts - last_ts)/10**6,flush=True)
|
print((ts - last_ts)/10**6,flush=True)
|
||||||
last_ts = ts
|
last_ts = ts
|
||||||
|
|
||||||
|
def b2b(b):
|
||||||
|
return hashlib.blake2b(b, digest_size=4).hexdigest()
|
||||||
|
|
||||||
|
@device.command('recvzero')
|
||||||
|
def device_recvzero():
|
||||||
|
ctx = zmq.Context()
|
||||||
|
pull = ctx.socket(zmq.PULL)
|
||||||
|
pull.connect(C.live_push_socket)
|
||||||
|
last_ts = 0
|
||||||
|
last_sequence_id = 0
|
||||||
|
last_b = b''
|
||||||
|
first = True
|
||||||
|
while True:
|
||||||
|
b = pull.recv()
|
||||||
|
ts, sequence_id, encoder, buffer = b2t(b)
|
||||||
|
if ts==last_ts:
|
||||||
|
print('tszero', sequence_id, encoder, (ts - last_ts)/10**6,flush=True)
|
||||||
|
print(b2b(b),b2b(last_b))
|
||||||
|
if sequence_id==last_sequence_id:
|
||||||
|
print('szero', sequence_id, encoder,flush=True)
|
||||||
|
print(b2b(b),b2b(last_b))
|
||||||
|
last_ts = ts
|
||||||
|
last_sequence_id = sequence_id
|
||||||
|
last_b = b
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
entrypoint()
|
entrypoint()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user