driveable=nxalias, add make_args to debug_log, don't suppress unreferenced
we might want to use unreferenced functions in hook code
This commit is contained in:
@ -1162,14 +1162,14 @@ def put_group(MyDriver, MyGroup):
|
|||||||
txt += [' hsetprop ${scobj_hpath}/%s oldval UNKNOWN' % nodename]
|
txt += [' hsetprop ${scobj_hpath}/%s oldval UNKNOWN' % nodename]
|
||||||
for key in sorted(MyVar['Property']):
|
for key in sorted(MyVar['Property']):
|
||||||
txt += [' hsetprop ${scobj_hpath}/%s %s "%s"' % (nodename, key, MyVar['Property'][key])]
|
txt += [' hsetprop ${scobj_hpath}/%s %s "%s"' % (nodename, key, MyVar['Property'][key])]
|
||||||
|
# Generated at runtime <dev>_<group...>_<name> for nxalias and driveable
|
||||||
|
path = MyVar['path']
|
||||||
|
if len(path) > 0:
|
||||||
|
path = path.replace('/', '_') + '_'
|
||||||
|
path += MyVar['name']
|
||||||
|
#print "Path: %s" % MyVar['path']
|
||||||
|
nxalias = '${name}_' + path
|
||||||
if 'nxalias' not in MyVar['Property']:
|
if 'nxalias' not in MyVar['Property']:
|
||||||
# TODO: generated at runtime <dev>_<group...>_<name>
|
|
||||||
path = MyVar['path']
|
|
||||||
if len(path) > 0:
|
|
||||||
path = path.replace('/', '_') + '_'
|
|
||||||
path += MyVar['name']
|
|
||||||
#print "Path: %s" % MyVar['path']
|
|
||||||
nxalias = '${name}_' + path
|
|
||||||
txt += [' hsetprop ${scobj_hpath}/%s nxalias "%s"' % (nodename, nxalias)]
|
txt += [' hsetprop ${scobj_hpath}/%s nxalias "%s"' % (nodename, nxalias)]
|
||||||
if not MyGroup['name']:
|
if not MyGroup['name']:
|
||||||
if 'GroupProperty' in MyGroup:
|
if 'GroupProperty' in MyGroup:
|
||||||
@ -1193,7 +1193,7 @@ def put_group(MyDriver, MyGroup):
|
|||||||
if MyVar['writeable'] > 0 or MyVar['driveable']:
|
if MyVar['writeable'] > 0 or MyVar['driveable']:
|
||||||
txt += [' ${sct_controller} write ${scobj_hpath}/%s' % nodename]
|
txt += [' ${sct_controller} write ${scobj_hpath}/%s' % nodename]
|
||||||
if MyVar['driveable']:
|
if MyVar['driveable']:
|
||||||
txt += [' ansto_makesctdrive ${name}_%s ${scobj_hpath}/%s ${scobj_hpath}/%s ${sct_controller}' % (MyVar['name'], nodename, MyVar['driveable'])]
|
txt += [' ansto_makesctdrive %s ${scobj_hpath}/%s ${scobj_hpath}/%s ${sct_controller}' % (nxalias, nodename, MyVar['driveable'])]
|
||||||
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])
|
||||||
@ -1206,7 +1206,15 @@ def put_mk_sct_driver(MyDriver):
|
|||||||
else:
|
else:
|
||||||
line = 'proc %s::mk_sct_%s { sct_controller name } {' % (MyDriver['namespace'], MyDriver['name'])
|
line = 'proc %s::mk_sct_%s { sct_controller name } {' % (MyDriver['namespace'], MyDriver['name'])
|
||||||
txt += [line]
|
txt += [line]
|
||||||
txt += [' debug_log 1 "mk_sct_%s for ${name}"' % MyDriver['name']]
|
if 'make_args' in MyDriver:
|
||||||
|
make_args = ''
|
||||||
|
for arg in MyDriver['make_args'].split():
|
||||||
|
if len(make_args) > 0:
|
||||||
|
make_args += ' '
|
||||||
|
make_args += '${' + arg + '}'
|
||||||
|
txt += [' debug_log 1 "mk_sct_%s ${sct_controller} ${name} %s"' % (MyDriver['name'], make_args)]
|
||||||
|
else:
|
||||||
|
txt += [' debug_log 1 "mk_sct_%s for ${name}"' % MyDriver['name']]
|
||||||
txt += [' set ns "[namespace current]"']
|
txt += [' set ns "[namespace current]"']
|
||||||
txt += [' set catch_status [ catch {']
|
txt += [' set catch_status [ catch {']
|
||||||
txt += ['']
|
txt += ['']
|
||||||
@ -1249,7 +1257,15 @@ def put_postamble(MyDriver):
|
|||||||
txt += [line]
|
txt += [line]
|
||||||
txt += [' set catch_status [ catch {']
|
txt += [' set catch_status [ catch {']
|
||||||
txt += [' set ns "%s"' % MyDriver['namespace']]
|
txt += [' set ns "%s"' % MyDriver['namespace']]
|
||||||
txt += [' ${ns}::debug_log 1 "add_%s ${name} ${IP} ${port}"' % MyDriver['name']]
|
if 'make_args' in MyDriver:
|
||||||
|
make_args = ''
|
||||||
|
for arg in MyDriver['make_args'].split():
|
||||||
|
if len(make_args) > 0:
|
||||||
|
make_args += ' '
|
||||||
|
make_args += '${' + arg + '}'
|
||||||
|
txt += [' ${ns}::debug_log 1 "add_%s ${name} ${IP} ${port} %s"' % (MyDriver['name'], make_args)]
|
||||||
|
else:
|
||||||
|
txt += [' ${ns}::debug_log 1 "add_%s ${name} ${IP} ${port}"' % MyDriver['name']]
|
||||||
txt += [' if {[SplitReply [%s]]=="false"} {' % MyDriver['simulation_group']]
|
txt += [' if {[SplitReply [%s]]=="false"} {' % MyDriver['simulation_group']]
|
||||||
txt += [' if {[string equal -nocase "aqadapter" "${IP}"]} {']
|
txt += [' if {[string equal -nocase "aqadapter" "${IP}"]} {']
|
||||||
txt += [' ${ns}::debug_log 1 "makesctcontroller sct_${name} aqadapter ${port}"']
|
txt += [' ${ns}::debug_log 1 "makesctcontroller sct_${name} aqadapter ${port}"']
|
||||||
@ -1264,8 +1280,8 @@ def put_postamble(MyDriver):
|
|||||||
txt += [' makesctcontroller sct_${name} %s ${IP}:${port}' % MyDriver['protocol']]
|
txt += [' makesctcontroller sct_${name} %s ${IP}:${port}' % MyDriver['protocol']]
|
||||||
txt += [' }']
|
txt += [' }']
|
||||||
txt += [' }']
|
txt += [' }']
|
||||||
make_args = ''
|
|
||||||
if 'make_args' in MyDriver:
|
if 'make_args' in MyDriver:
|
||||||
|
make_args = ''
|
||||||
for arg in MyDriver['make_args'].split():
|
for arg in MyDriver['make_args'].split():
|
||||||
if len(make_args) > 0:
|
if len(make_args) > 0:
|
||||||
make_args += ' '
|
make_args += ' '
|
||||||
@ -1291,8 +1307,8 @@ def put_standard_code(MyDriver):
|
|||||||
for func in sorted(MyDriver['Funcs']):
|
for func in sorted(MyDriver['Funcs']):
|
||||||
theFunc = MyDriver['Funcs'][func]
|
theFunc = MyDriver['Funcs'][func]
|
||||||
# Don't generate functions which are not referenced
|
# Don't generate functions which are not referenced
|
||||||
if theFunc['reference_count'] == 0:
|
#if theFunc['reference_count'] == 0:
|
||||||
continue
|
# continue
|
||||||
if theFunc['type'] == 'read_function':
|
if theFunc['type'] == 'read_function':
|
||||||
put_read_function(MyDriver, func);
|
put_read_function(MyDriver, func);
|
||||||
elif theFunc['type'] == 'write_function':
|
elif theFunc['type'] == 'write_function':
|
||||||
|
Reference in New Issue
Block a user