This commit is contained in:
Binary file not shown.
@@ -21,14 +21,17 @@ class BarcodeReader(DeviceBase):
|
||||
try:
|
||||
self.setState(State.Busy)
|
||||
microscan.flush()
|
||||
ret = microscan.waitString(int(timeout * 1000))
|
||||
ret = microscan.waitString(int(timeout * 1000))
|
||||
if ret is not None:
|
||||
ret = ret.strip()
|
||||
self.setCache(ret, None)
|
||||
return ret
|
||||
except:
|
||||
self.setCache(None, None)
|
||||
return None
|
||||
finally:
|
||||
self.setState(State.Ready)
|
||||
if self.state == State.Busy:
|
||||
self.setState(State.Ready)
|
||||
|
||||
def doUpdate(self):
|
||||
self.get()
|
||||
|
||||
@@ -602,7 +602,7 @@ class RobotTCP(TcpDevice, Stoppable):
|
||||
"mode": self.working_mode,
|
||||
"status": self.status,
|
||||
"open": self.tool_open,
|
||||
"pos": self.get_current_point_cached() if self.state==State.Ready else None #TODO: make it calculated in robot by possiung funtion
|
||||
"pos": self.get_current_point_cached() if self.state==State.Ready else None #TODO: make it calculated in robot by polling funtion
|
||||
}, None)
|
||||
if self.cartesian_motors_enabled:
|
||||
for m in self.cartesian_motors:
|
||||
|
||||
@@ -17,13 +17,16 @@ run("setup/Layout")
|
||||
# Configuration
|
||||
###################################################################################################
|
||||
|
||||
IMAGING_ENABLED_PREFERENCE = "imaging_enabled"
|
||||
PUCK_TYPES_PREFERENCE = "puck_types"
|
||||
BARCODE_READER_SCAN_PUCKS = "barcode_reader_scan_pucks"
|
||||
|
||||
def is_imaging_enabled():
|
||||
setting = get_setting("ImagingEnabled")
|
||||
setting = get_setting(IMAGING_ENABLED_PREFERENCE)
|
||||
return not (str(setting) == 'False')
|
||||
|
||||
def set_imaging_enabled(value):
|
||||
set_setting("ImagingEnabled", True if value else False )
|
||||
set_setting(IMAGING_ENABLED_PREFERENCE, True if value else False )
|
||||
|
||||
def assert_imaging_enabled():
|
||||
if is_imaging_enabled() == False:
|
||||
@@ -31,17 +34,27 @@ def assert_imaging_enabled():
|
||||
|
||||
#"unipuck", "minispine" or "mixed"
|
||||
def set_puck_types(value):
|
||||
set_setting("ImagingEnabled", True if value else False )
|
||||
set_setting(PUCK_TYPES_PREFERENCE, True if value else False )
|
||||
|
||||
def get_puck_types():
|
||||
setting = get_setting("ImagingEnabled")
|
||||
setting = get_setting(PUCK_TYPES_PREFERENCE)
|
||||
if setting == "unipuck" or setting == "minispine":
|
||||
return setting
|
||||
return "mixed"
|
||||
|
||||
|
||||
def is_barcode_reader_scan_pucks():
|
||||
setting = get_setting(BARCODE_READER_SCAN_PUCKS)
|
||||
return False if setting is None else setting.lower() == "true"
|
||||
|
||||
def set_barcode_reader_scan_pucks(value):
|
||||
set_setting(BARCODE_READER_SCAN_PUCKS, True if value else False )
|
||||
|
||||
|
||||
#In order to apply current config
|
||||
set_imaging_enabled(is_imaging_enabled())
|
||||
set_puck_types(get_puck_types())
|
||||
set_barcode_reader_scan_pucks(is_barcode_reader_scan_pucks())
|
||||
|
||||
###################################################################################################
|
||||
# Scripted devices and pseudo-devices
|
||||
|
||||
11
script/test/TestCameraStability1.py
Normal file
11
script/test/TestCameraStability1.py
Normal file
@@ -0,0 +1,11 @@
|
||||
for i in range(10):
|
||||
time.sleep(2)
|
||||
move_home()
|
||||
time.sleep(1)
|
||||
move_park()
|
||||
start = time.time()
|
||||
while get_img_cover_pos() != 'A':
|
||||
print ".",
|
||||
time.sleep(0.001)
|
||||
print "Time = " , ( time.time() - start)
|
||||
|
||||
11
script/test/TestCameraStability2.py
Normal file
11
script/test/TestCameraStability2.py
Normal file
@@ -0,0 +1,11 @@
|
||||
cover_detection_debug=False
|
||||
|
||||
for pos in ['A', 'B', 'C', 'D', 'E', 'F']:
|
||||
print "Moving to ", pos
|
||||
hexiposi.move(pos)
|
||||
ret = run("imgproc/CoverDetection")
|
||||
det = ret[0]
|
||||
print "Detected: ", det
|
||||
if det != pos:
|
||||
raise "Position error"
|
||||
|
||||
9
script/test/TestCameraStability3.py
Normal file
9
script/test/TestCameraStability3.py
Normal file
@@ -0,0 +1,9 @@
|
||||
for i in range(10):
|
||||
time.sleep(1)
|
||||
move_home()
|
||||
time.sleep(1)
|
||||
move_park()
|
||||
start = time.time()
|
||||
time.sleep(1.0)
|
||||
print run("imgproc/LedDetectionProc.py")
|
||||
|
||||
Reference in New Issue
Block a user