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