From 2c8f1131f6d6bd665cd1f306b4b36e759ff39d6d Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Mon, 18 Aug 2014 12:34:24 +1000 Subject: [PATCH] Add wrapper_property nosctcontroller = to gen_sct --- site_ansto/instrument/util/gen_sct.py | 33 +++++++++++++++------------ 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/site_ansto/instrument/util/gen_sct.py b/site_ansto/instrument/util/gen_sct.py index 7734ea71..049d036a 100755 --- a/site_ansto/instrument/util/gen_sct.py +++ b/site_ansto/instrument/util/gen_sct.py @@ -1474,22 +1474,25 @@ def put_postamble(MyDriver): txt += [' %s::sics_log 9 "add_%s ${name} ${IP} ${port} %s"' % (MyDriver['namespace'], MyDriver['name'], make_args)] else: txt += [' %s::sics_log 9 "add_%s ${name} ${IP} ${port}"' % (MyDriver['namespace'], MyDriver['name'])] - txt += [' if {[string equal -nocase [SplitReply [%s]] "false"]} {' % MyDriver['simulation_group']] - txt += [' if {[string equal -nocase "aqadapter" "${IP}"]} {'] - txt += [' %s::sics_log 9 "makesctcontroller sct_${name} aqadapter ${port}"' % MyDriver['namespace']] - txt += [' makesctcontroller sct_${name} aqadapter ${port}'] - txt += [' } else {'] - if 'protocol_args' in MyDriver: - protocol_args = MyDriver['protocol_args'].replace('\\', '\\\\').replace('"', '\\"') - txt += [' %s::sics_log 9 "makesctcontroller sct_${name} %s ${IP}:${port} %s"' % (MyDriver['namespace'], MyDriver['protocol'], protocol_args)] - txt += [' makesctcontroller sct_${name} %s ${IP}:${port} %s' % (MyDriver['protocol'], MyDriver['protocol_args'])] + if ('WrapperProperty' in MyDriver) and ('nosctcontroller' in MyDriver['WrapperProperty']): + txt += [' %s::sics_log 9 "No sctcontroller for %s"' % (MyDriver['namespace'], MyDriver['name'])] else: - txt += [' %s::sics_log 9 "makesctcontroller sct_${name} %s ${IP}:${port}"' % (MyDriver['namespace'], MyDriver['protocol'])] - txt += [' makesctcontroller sct_${name} %s ${IP}:${port}' % MyDriver['protocol']] - txt += [' }'] - txt += [' } else {'] - txt += [' %s::sics_log 9 "[%s] => No sctcontroller for %s"' % (MyDriver['namespace'], MyDriver['simulation_group'], MyDriver['name'])] - txt += [' }'] + txt += [' if {[string equal -nocase [SplitReply [%s]] "false"]} {' % MyDriver['simulation_group']] + txt += [' if {[string equal -nocase "aqadapter" "${IP}"]} {'] + txt += [' %s::sics_log 9 "makesctcontroller sct_${name} aqadapter ${port}"' % MyDriver['namespace']] + txt += [' makesctcontroller sct_${name} aqadapter ${port}'] + txt += [' } else {'] + if 'protocol_args' in MyDriver: + protocol_args = MyDriver['protocol_args'].replace('\\', '\\\\').replace('"', '\\"') + txt += [' %s::sics_log 9 "makesctcontroller sct_${name} %s ${IP}:${port} %s"' % (MyDriver['namespace'], MyDriver['protocol'], protocol_args)] + txt += [' makesctcontroller sct_${name} %s ${IP}:${port} %s' % (MyDriver['protocol'], MyDriver['protocol_args'])] + else: + txt += [' %s::sics_log 9 "makesctcontroller sct_${name} %s ${IP}:${port}"' % (MyDriver['namespace'], MyDriver['protocol'])] + txt += [' makesctcontroller sct_${name} %s ${IP}:${port}' % MyDriver['protocol']] + txt += [' }'] + txt += [' } else {'] + txt += [' %s::sics_log 9 "[%s] => No sctcontroller for %s"' % (MyDriver['namespace'], MyDriver['simulation_group'], MyDriver['name'])] + txt += [' }'] if 'make_args' in MyDriver: make_args = ' '.join(["${%s}"%arg for arg in MyDriver['make_args'].split()]) txt += [' %s::sics_log 1 "%s::mkDriver sct_${name} ${name} %s"' % (MyDriver['namespace'], MyDriver['namespace'], make_args)]