From c7afce56e54e01aa4a44185d23a8dbcf62a946ef Mon Sep 17 00:00:00 2001 From: CCS Operator Account Date: Fri, 5 Nov 2021 09:28:24 -0700 Subject: [PATCH] Bug fixes after testing --- lib/acquire.py | 5 +++-- lib/config.py | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/lib/acquire.py b/lib/acquire.py index 88fb091..e90d299 100755 --- a/lib/acquire.py +++ b/lib/acquire.py @@ -556,6 +556,7 @@ def do_scan(options): tc.take_images() def do_one_time_config(options): - idle_flush = options.get("IDLE_FLUSH") - if idle_flush: + print "one_time_config called %s" % options + if "idle_flush" in options: + idle_flush = options.getBool("idle_flush") fp.fp.sequencerConfig().change("idleFlushTimeout", 0 if idle_flush else -1) diff --git a/lib/config.py b/lib/config.py index 0e155e8..3088335 100755 --- a/lib/config.py +++ b/lib/config.py @@ -36,9 +36,9 @@ def execute(config, command_line_options): time.sleep(30) # wait a bit for getting settled command_line_options["symlink"] = "/".join([symlink,alabel]) - one_time_config = config.options("CONFIG") + one_time_config = config.items("CONFIG") if one_time_config: - acquire.do_one_time_config(one_time_config) + acquire.do_one_time_config(Config(dict(one_time_config))) items = config.options("ACQUIRE") for item in items: @@ -74,5 +74,15 @@ def getFloat(self, key, defaultValue=None): raise Exception('Missing config value %s' % key) return float(value) + def getBool(self, key, defaultValue=None): + value = self.get(key) + if not value: + if defaultValue != None: + return defaultValue + else: + raise Exception('Missing config value %s' % key) + return value.lower() in ['true', '1', 't', 'y', 'yes'] + + def getList(self, key): return self.get(key).replace('\n','').split(',')