move bsread_port check into make_bsread_sender

This commit is contained in:
2025-10-18 00:41:19 +02:00
parent 0568f6be07
commit 37a86ba423
2 changed files with 4 additions and 3 deletions

View File

@@ -29,8 +29,7 @@ def accumulate(accumulator_addr, bsread_port):
sorter = Sorter()
if bsread_port:
sender = make_bsread_sender(bsread_port)
sender = make_bsread_sender(bsread_port)
while True:
if not zmq_socks.has_data():
@@ -54,7 +53,7 @@ def accumulate(accumulator_addr, bsread_port):
output.write(pulse_id, res_is_good_frame, res_is_hit_frame, res_number_of_spots, res_laser_on, *res_roi_intensities)
if not bsread_port:
if not sender:
continue
timestamp = tuple(results["timestamp"])

View File

@@ -2,6 +2,8 @@ from bsread.sender import Sender, PUB
def make_bsread_sender(bsread_port):
if not bsread_port:
return None
sender = Sender(port=bsread_port, block=False, mode=PUB)
sender.open()
return sender