move bsread_port check into make_bsread_sender
This commit is contained in:
@@ -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"])
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user