@@ -38,6 +38,7 @@ def __init__(self, config_file, version):
3838 # Scan elements
3939 self ._camera_scanner = None
4040 self ._camera_switch = None
41+ self ._latest_holder_plate = None
4142
4243 self ._init_ui ()
4344
@@ -267,14 +268,20 @@ def _read_side_scan(self):
267268 # Barcode successfully read
268269 Beeper .beep ()
269270 print ("MAIN: puck barcode recorded" )
270- if self ._record_table . unique_side_barcode (plate ): # if new side barcode
271- self .original_plate = plate
271+ if not self ._is_latest_holder_plate (plate ):
272+ self ._latest_holder_plate = plate
272273 self ._latest_holder_image = holder_image
273274 self ._message_box .display (MessageFactory .puck_recorded_message ())
274275 self ._camera_switch .restart_live_capture_from_top ()
275276 else :
276277 self ._message_box .display (MessageFactory .duplicate_barcode_message ())
277278
279+ def _is_latest_holder_plate (self , plate ):
280+ if self ._latest_holder_plate is None :
281+ return False
282+
283+ return self ._latest_holder_plate .barcodes ()[0 ] == plate .barcodes ()[0 ]
284+
278285 def _read_top_scan (self ):
279286 if self ._result_queue .empty ():
280287 if self ._camera_switch .is_top_scan_timeout ():
@@ -286,8 +293,8 @@ def _read_top_scan(self):
286293 # Get the result
287294 plate , pins_image = self ._result_queue .get (False )
288295
289- # Add new record to the table - side is the original_plate read first, top is the plate
290- self ._record_table .add_record_frame (self .original_plate , plate , self ._latest_holder_image , pins_image )
296+ # Add new record to the table - side is the _latest_holder_plate read first, top is the plate
297+ self ._record_table .add_record_frame (self ._latest_holder_plate , plate , self ._latest_holder_image , pins_image )
291298 if not plate .is_full_valid ():
292299 return
293300
0 commit comments