From 4f72bcaaf576b602f4538632d5cb09d3d8a7be79 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Fri, 11 Jul 2014 13:18:38 +1000 Subject: [PATCH] allow legacy sct controllers in generated drivers --- site_ansto/instrument/util/gen_sct.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/site_ansto/instrument/util/gen_sct.py b/site_ansto/instrument/util/gen_sct.py index 7c94502b..162c5caf 100755 --- a/site_ansto/instrument/util/gen_sct.py +++ b/site_ansto/instrument/util/gen_sct.py @@ -1426,6 +1426,10 @@ def put_read_config(MyDriver): txt += [' ${ns}::sics_log 9 "[%s] => using null asyncqueue"' % MyDriver['simulation_group']] txt += [' } elseif { [dict exists $v "asyncqueue"] } {'] txt += [' set asyncqueue [dict get $v "asyncqueue"]'] + txt += [' if { [string equal -nocase ${asyncqueue} "sct"] } {'] + txt += [' set IP [dict get $v ip]'] + txt += [' set PORT [dict get $v port]'] + txt += [' }'] txt += [' } else {'] txt += [' if { [dict exists $v "asyncprotocol"] } {'] txt += [' set asyncprotocol [dict get $v "asyncprotocol"]'] @@ -1455,9 +1459,17 @@ def put_read_config(MyDriver): txt += [' error "Missing configuration value $arg"'] txt += [' }'] txt += [' }'] - txt += [' add_%s ${name} "aqadapter" ${asyncqueue} {*}$arg_list' % MyDriver['name']] + txt += [' if { [string equal -nocase ${asyncqueue} "sct"] } {'] + txt += [' add_%s ${name} ${IP} ${PORT} {*}$arg_list' % MyDriver['name']] + txt += [' } else {'] + txt += [' add_%s ${name} "aqadapter" ${asyncqueue} {*}$arg_list' % MyDriver['name']] + txt += [' }'] else: - txt += [' add_%s ${name} "aqadapter" ${asyncqueue}' % MyDriver['name']] + txt += [' if { [string equal -nocase ${asyncqueue} "sct"] } {'] + txt += [' add_%s ${name} ${IP} ${PORT}' % MyDriver['name']] + txt += [' } else {'] + txt += [' add_%s ${name} "aqadapter" ${asyncqueue}' % MyDriver['name']] + txt += [' }'] txt += [' }'] txt += [' }'] txt += [' }']