Improve handling and logging for xxx_simulation case
This commit is contained in:
@ -1266,7 +1266,7 @@ def put_group(MyDriver, MyGroup):
|
|||||||
txt += [' hsetprop ${scobj_hpath} %s "%s"' % (key, MyGroup['GroupProperty'][key])]
|
txt += [' hsetprop ${scobj_hpath} %s "%s"' % (key, MyGroup['GroupProperty'][key])]
|
||||||
if readable_or_writeable:
|
if readable_or_writeable:
|
||||||
txt += ['']
|
txt += ['']
|
||||||
txt += [' if {[SplitReply [%s]]=="false"} {' % MyDriver['simulation_group']]
|
txt += [' if {[string equal -nocase [SplitReply [%s]] "false"]} {' % MyDriver['simulation_group']]
|
||||||
for var in sorted(MyGroup['Vars']):
|
for var in sorted(MyGroup['Vars']):
|
||||||
MyVar = MyGroup['Vars'][var]
|
MyVar = MyGroup['Vars'][var]
|
||||||
nodename = groupname + MyVar['name']
|
nodename = groupname + MyVar['name']
|
||||||
@ -1284,6 +1284,8 @@ def put_group(MyDriver, MyGroup):
|
|||||||
# Generate <dev>_<group...>_<name> at runtime for driveable
|
# Generate <dev>_<group...>_<name> at runtime for driveable
|
||||||
driveable = '${name}_' + make_path(MyVar)
|
driveable = '${name}_' + make_path(MyVar)
|
||||||
txt += [' ansto_makesctdrive %s ${scobj_hpath}/%s ${scobj_hpath}/%s ${sct_controller}' % (driveable, nodename, MyVar['driveable'])]
|
txt += [' ansto_makesctdrive %s ${scobj_hpath}/%s ${scobj_hpath}/%s ${sct_controller}' % (driveable, nodename, MyVar['driveable'])]
|
||||||
|
txt += [' } else {']
|
||||||
|
txt += [' %s::sics_log 9 "[%s] => No poll/write for %s"' % (MyDriver['namespace'], MyDriver['simulation_group'], MyDriver['name'])]
|
||||||
txt += [' }']
|
txt += [' }']
|
||||||
for grp in sorted(MyGroup['Groups']):
|
for grp in sorted(MyGroup['Groups']):
|
||||||
txt += put_group(MyDriver, MyGroup['Groups'][grp])
|
txt += put_group(MyDriver, MyGroup['Groups'][grp])
|
||||||
@ -1357,7 +1359,7 @@ def put_postamble(MyDriver):
|
|||||||
txt += [' %s::sics_log 9 "add_%s ${name} ${IP} ${port} %s"' % (MyDriver['namespace'], MyDriver['name'], make_args)]
|
txt += [' %s::sics_log 9 "add_%s ${name} ${IP} ${port} %s"' % (MyDriver['namespace'], MyDriver['name'], make_args)]
|
||||||
else:
|
else:
|
||||||
txt += [' %s::sics_log 9 "add_%s ${name} ${IP} ${port}"' % (MyDriver['namespace'], MyDriver['name'])]
|
txt += [' %s::sics_log 9 "add_%s ${name} ${IP} ${port}"' % (MyDriver['namespace'], MyDriver['name'])]
|
||||||
txt += [' if {[SplitReply [%s]]=="false"} {' % MyDriver['simulation_group']]
|
txt += [' if {[string equal -nocase [SplitReply [%s]] "false"]} {' % MyDriver['simulation_group']]
|
||||||
txt += [' if {[string equal -nocase "aqadapter" "${IP}"]} {']
|
txt += [' if {[string equal -nocase "aqadapter" "${IP}"]} {']
|
||||||
txt += [' %s::sics_log 9 "makesctcontroller sct_${name} aqadapter ${port}"' % MyDriver['namespace']]
|
txt += [' %s::sics_log 9 "makesctcontroller sct_${name} aqadapter ${port}"' % MyDriver['namespace']]
|
||||||
txt += [' makesctcontroller sct_${name} aqadapter ${port}']
|
txt += [' makesctcontroller sct_${name} aqadapter ${port}']
|
||||||
@ -1370,6 +1372,8 @@ def put_postamble(MyDriver):
|
|||||||
txt += [' %s::sics_log 9 "makesctcontroller sct_${name} %s ${IP}:${port}"' % (MyDriver['namespace'], MyDriver['protocol'])]
|
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 += [' makesctcontroller sct_${name} %s ${IP}:${port}' % MyDriver['protocol']]
|
||||||
txt += [' }']
|
txt += [' }']
|
||||||
|
txt += [' } else {']
|
||||||
|
txt += [' %s::sics_log 9 "[%s] => No sctcontroller for %s"' % (MyDriver['namespace'], MyDriver['simulation_group'], MyDriver['name'])]
|
||||||
txt += [' }']
|
txt += [' }']
|
||||||
if 'make_args' in MyDriver:
|
if 'make_args' in MyDriver:
|
||||||
make_args = ' '.join(["${%s}"%arg for arg in MyDriver['make_args'].split()])
|
make_args = ' '.join(["${%s}"%arg for arg in MyDriver['make_args'].split()])
|
||||||
@ -1399,7 +1403,10 @@ def put_read_config(MyDriver):
|
|||||||
txt += [' if { [dict get $v "driver"] == "%s" } {' % MyDriver['name']]
|
txt += [' if { [dict get $v "driver"] == "%s" } {' % MyDriver['name']]
|
||||||
txt += [' if { [dict get $v enabled] } {']
|
txt += [' if { [dict get $v enabled] } {']
|
||||||
txt += [' set name [dict get $v name]']
|
txt += [' set name [dict get $v name]']
|
||||||
txt += [' if { [dict exists $v "asyncqueue"] } {']
|
txt += [' if { ![string equal -nocase [SplitReply [%s]] "false"] } {' % MyDriver['simulation_group']]
|
||||||
|
txt += [' set asyncqueue "null"']
|
||||||
|
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 += [' set asyncqueue [dict get $v "asyncqueue"]']
|
||||||
txt += [' } else {']
|
txt += [' } else {']
|
||||||
txt += [' if { [dict exists $v "asyncprotocol"] } {']
|
txt += [' if { [dict exists $v "asyncprotocol"] } {']
|
||||||
|
Reference in New Issue
Block a user