Merge changes from RELEASE-3_1 in gen_sct.py
Now the only difference is sct defauly of before/after
This commit is contained in:
@ -1310,7 +1310,7 @@ def put_checkstatus_function(MyDriver, func):
|
|||||||
txt += [' set sp "[sct target]"']
|
txt += [' set sp "[sct target]"']
|
||||||
txt += [' if {[hpropexists [sct] simulated] && [sct simulated] == "true"} {']
|
txt += [' if {[hpropexists [sct] simulated] && [sct simulated] == "true"} {']
|
||||||
txt += [' set pv "${sp}"']
|
txt += [' set pv "${sp}"']
|
||||||
txt += [' hset ${tc_root}/[sct driveable] ${sp}']
|
txt += [' hupdateif ${tc_root}/[sct driveable] ${sp}']
|
||||||
txt += [' }']
|
txt += [' }']
|
||||||
txt += [' set pv "[hval ${tc_root}/[sct driveable]]"']
|
txt += [' set pv "[hval ${tc_root}/[sct driveable]]"']
|
||||||
txt += [' }']
|
txt += [' }']
|
||||||
@ -1396,7 +1396,7 @@ def put_pid_function(MyDriver, func):
|
|||||||
|
|
||||||
def put_var(MyDriver, MyGroup, MyVar):
|
def put_var(MyDriver, MyGroup, MyVar):
|
||||||
readable_or_writeable = False
|
readable_or_writeable = False
|
||||||
txt = [' # Start of var: ' + MyVar['name']]
|
txt = []
|
||||||
postfix = []
|
postfix = []
|
||||||
if MyGroup['name']:
|
if MyGroup['name']:
|
||||||
nodename = MyGroup['path'] + '/' + MyVar['name']
|
nodename = MyGroup['path'] + '/' + MyVar['name']
|
||||||
@ -1553,10 +1553,9 @@ def put_group(MyDriver, MyGroup):
|
|||||||
dfr = []
|
dfr = []
|
||||||
if MyGroup['name']:
|
if MyGroup['name']:
|
||||||
txt += ['']
|
txt += ['']
|
||||||
txt += [' # Start of named group: ' + MyGroup['path']]
|
|
||||||
txt += [' hfactory ${scobj_hpath}/%s plain spy none' % MyGroup['path']]
|
txt += [' hfactory ${scobj_hpath}/%s plain spy none' % MyGroup['path']]
|
||||||
else:
|
else:
|
||||||
txt += [' # Start of unnamed group']
|
pass
|
||||||
|
|
||||||
for var in sorted(MyGroup['Vars']):
|
for var in sorted(MyGroup['Vars']):
|
||||||
txt += ['']
|
txt += ['']
|
||||||
@ -1569,13 +1568,11 @@ def put_group(MyDriver, MyGroup):
|
|||||||
if 'GroupProperty' in MyGroup:
|
if 'GroupProperty' in MyGroup:
|
||||||
for key in sorted(MyGroup['GroupProperty']):
|
for key in sorted(MyGroup['GroupProperty']):
|
||||||
txt += [' hsetprop ${scobj_hpath}/%s %s "%s"' % (MyGroup['path'], key, MyGroup['GroupProperty'][key])]
|
txt += [' hsetprop ${scobj_hpath}/%s %s "%s"' % (MyGroup['path'], key, MyGroup['GroupProperty'][key])]
|
||||||
txt += [' # End of named group: ' + MyGroup['path']]
|
|
||||||
else:
|
else:
|
||||||
if 'GroupProperty' in MyGroup:
|
if 'GroupProperty' in MyGroup:
|
||||||
txt += ['']
|
txt += ['']
|
||||||
for key in sorted(MyGroup['GroupProperty']):
|
for key in sorted(MyGroup['GroupProperty']):
|
||||||
txt += [' hsetprop ${scobj_hpath} %s "%s"' % (key, MyGroup['GroupProperty'][key])]
|
txt += [' hsetprop ${scobj_hpath} %s "%s"' % (key, MyGroup['GroupProperty'][key])]
|
||||||
txt += [' # End of unnamed group']
|
|
||||||
|
|
||||||
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])
|
||||||
@ -1879,7 +1876,7 @@ def put_read_config(MyDriver):
|
|||||||
make_args = ' {*}$arg_list'
|
make_args = ' {*}$arg_list'
|
||||||
else:
|
else:
|
||||||
make_args = ''
|
make_args = ''
|
||||||
txt += [' ${ns}::mkDriver sct_${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}' + make_args]
|
txt += [' ${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}' + make_args]
|
||||||
txt += [' }']
|
txt += [' }']
|
||||||
txt += [' }']
|
txt += [' }']
|
||||||
txt += [' }']
|
txt += [' }']
|
||||||
@ -2077,6 +2074,8 @@ def main():
|
|||||||
global args
|
global args
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
|
# RELEASE-3_1="before", RELEASE-3_2="after"
|
||||||
|
default_sct = "after"
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("-c", "--code", help="dump code",
|
parser.add_argument("-c", "--code", help="dump code",
|
||||||
action="store_true")
|
action="store_true")
|
||||||
@ -2086,8 +2085,9 @@ def main():
|
|||||||
action="store_true")
|
action="store_true")
|
||||||
parser.add_argument("-m", "--move", help="generate move commands",
|
parser.add_argument("-m", "--move", help="generate move commands",
|
||||||
action="store_true")
|
action="store_true")
|
||||||
parser.add_argument("--sct", help="where to put the sct in the filename",
|
parser.add_argument("--sct",
|
||||||
choices=["before", "after"], default="after")
|
help="where to put the sct in the filename [%s]" % default_sct,
|
||||||
|
choices=["before", "after"], default=default_sct)
|
||||||
parser.add_argument("-v", "--verbose", help="verbose output",
|
parser.add_argument("-v", "--verbose", help="verbose output",
|
||||||
action="store_true")
|
action="store_true")
|
||||||
parser.add_argument("driver_source", help="driver source file", nargs="*")
|
parser.add_argument("driver_source", help="driver source file", nargs="*")
|
||||||
|
Reference in New Issue
Block a user