allow legacy sct controllers in generated drivers

This commit is contained in:
Douglas Clowes
2014-07-11 13:18:38 +10:00
parent 5ee7e6719f
commit 4f72bcaaf5

View File

@ -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 += [' }']