Add wrapper_property nosctcontroller = <anything> to gen_sct

This commit is contained in:
Douglas Clowes
2014-08-18 12:34:24 +10:00
parent ea9de2c617
commit 2c8f1131f6

View File

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