This commit is contained in:
gac-S_Changer
2018-09-04 13:32:11 +02:00
parent 03a3023b4d
commit 07664f8749
7 changed files with 54 additions and 7 deletions

View File

@@ -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