Merge branch 'RELEASE-3_1' into RELEASE-3_2
Conflicts: sics/site_ansto/instrument/bilby/config/chopper/sct_astrium_chopper.tcl sics/site_ansto/instrument/hipd/wombat_configuration.tcl sics/site_ansto/instrument/pelican/pelican_configuration.tcl
This commit is contained in:
@@ -583,7 +583,7 @@ def init_context():
|
||||
ContextStack[ContextIndex]['driveable'] = None
|
||||
ContextStack[ContextIndex]['control'] = 'true'
|
||||
ContextStack[ContextIndex]['data'] = 'true'
|
||||
ContextStack[ContextIndex]['mutable'] = 'false'
|
||||
ContextStack[ContextIndex]['mutable'] = 'true'
|
||||
ContextStack[ContextIndex]['nxsave'] = 'true'
|
||||
ContextStack[ContextIndex]['read_function'] = 'rdValue'
|
||||
ContextStack[ContextIndex]['write_function'] = 'setValue'
|
||||
@@ -730,8 +730,47 @@ def build_group(MyDriver, p):
|
||||
if key in ContextStack[ContextIndex]:
|
||||
ContextStack[ContextIndex][key] = item[key]
|
||||
pop_context()
|
||||
adjust_group(MyGroup)
|
||||
return MyGroup
|
||||
|
||||
def adjust_group(MyGroup):
|
||||
if Verbose:
|
||||
print 'ante adjust_group', MyGroup
|
||||
MyData = None
|
||||
for var in MyGroup['Vars']:
|
||||
if Verbose:
|
||||
print "Var:", MyGroup['Vars'][var]
|
||||
if 'data' in MyGroup['Vars'][var]:
|
||||
if MyGroup['Vars'][var]['data'] == 'true':
|
||||
MyData = 'true'
|
||||
if 'klass' not in MyGroup['Vars'][var]['Property']:
|
||||
MyGroup['Vars'][var]['Property']['klass'] = 'parameter'
|
||||
else:
|
||||
MyData = 'false'
|
||||
if MyData is None:
|
||||
for grp in MyGroup['Groups']:
|
||||
if Verbose:
|
||||
print "Grp:", MyGroup['Groups'][grp]
|
||||
adjust_group(MyGroup['Groups'][grp])
|
||||
if 'data' in MyGroup['Groups'][grp]['GroupProperty']:
|
||||
if MyGroup['Groups'][grp]['GroupProperty']['data'] == 'true':
|
||||
MyData = 'true'
|
||||
else:
|
||||
MyData = 'false'
|
||||
break
|
||||
if MyData is not None:
|
||||
if 'GroupProperty' not in MyGroup:
|
||||
MyGroup['GroupProperty'] = {}
|
||||
if 'data' not in MyGroup['GroupProperty']:
|
||||
MyGroup['GroupProperty']['data'] = MyData
|
||||
if MyData:
|
||||
if 'klass' not in MyGroup['GroupProperty']:
|
||||
MyGroup['GroupProperty']['klass'] = '@none'
|
||||
if 'type' not in MyGroup['GroupProperty']:
|
||||
MyGroup['GroupProperty']['type'] = 'part'
|
||||
if Verbose:
|
||||
print 'post adjust_group', MyGroup
|
||||
|
||||
def build_driver(MyDriver, TheTree):
|
||||
if Verbose:
|
||||
print "TheTree:", TheTree
|
||||
@@ -770,12 +809,19 @@ def dump_driver_vars(vars, indent):
|
||||
global DriveableFunctionTypes
|
||||
for item in sorted(vars):
|
||||
print indent + ' VAR %s = {' % item
|
||||
for subitem in sorted([i for i in vars[item] if i not in FunctionTypes + DriveableFunctionTypes]):
|
||||
print indent + ' %s =' % subitem, vars[item][subitem]
|
||||
Comments = ['name', 'path']
|
||||
Deferred = ['Property'] + Comments + FunctionTypes + DriveableFunctionTypes
|
||||
for Comment in sorted(Comments):
|
||||
if Comment in vars[item]:
|
||||
print indent + ' # %s = \'%s\'' % (Comment, vars[item][Comment])
|
||||
for subitem in sorted([i for i in vars[item] if i not in Deferred]):
|
||||
print indent + ' %s = \'%s\'' % (subitem, vars[item][subitem])
|
||||
for subitem in sorted([i for i in vars[item] if i in FunctionTypes]):
|
||||
print indent + ' %s =' % subitem, vars[item][subitem]
|
||||
print indent + ' %s = \'%s\'' % (subitem, vars[item][subitem])
|
||||
for subitem in sorted([i for i in vars[item] if i in DriveableFunctionTypes]):
|
||||
print indent + ' %s =' % subitem, vars[item][subitem]
|
||||
print indent + ' %s = \'%s\'' % (subitem, vars[item][subitem])
|
||||
for subitem in sorted([i for i in vars[item]['Property']]):
|
||||
print indent + ' Property \'%s\' = \'%s\'' % (subitem, vars[item]['Property'][subitem])
|
||||
print indent + ' }'
|
||||
|
||||
def dump_driver_groups(groups, indent):
|
||||
@@ -784,8 +830,16 @@ def dump_driver_groups(groups, indent):
|
||||
print indent + 'GROUP ' + item + ' = {'
|
||||
else:
|
||||
print indent + 'GROUP = {'
|
||||
for subitem in sorted([x for x in groups[item] if not x in ['Groups', 'Vars']]):
|
||||
Comments = ['name', 'path']
|
||||
Deferred = ['Groups', 'Vars', 'GroupProperty'] + Comments
|
||||
for Comment in sorted(Comments):
|
||||
if Comment in groups[item]:
|
||||
print indent + ' # %s = \'%s\'' % (Comment, groups[item][Comment])
|
||||
for subitem in sorted([x for x in groups[item] if not x in Deferred]):
|
||||
print indent + ' ', subitem, '=', groups[item][subitem]
|
||||
if 'GroupProperty' in groups[item]:
|
||||
for subitem in groups[item]['GroupProperty']:
|
||||
print indent + ' GroupProperty', subitem, '=', groups[item]['GroupProperty'][subitem]
|
||||
dump_driver_vars(groups[item]['Vars'], indent)
|
||||
dump_driver_groups(groups[item]['Groups'], indent + ' ')
|
||||
print indent + '}'
|
||||
@@ -802,8 +856,13 @@ def dump_driver_funcs(funcs):
|
||||
|
||||
def dump_driver(MyDriver):
|
||||
print 'DRIVER ' + MyDriver['name'] + ' = {'
|
||||
for item in sorted([x for x in MyDriver if x not in ['Groups', 'Funcs']]):
|
||||
print ' ' + item + ' =', MyDriver[item]
|
||||
Comments = ['PathName', 'Permlink']
|
||||
Deferred = ['Groups', 'Funcs', 'Deferred', 'name'] + Comments
|
||||
for Comment in sorted(Comments):
|
||||
if Comment in MyDriver:
|
||||
print '# %s = \'%s\'' % (Comment, MyDriver[Comment])
|
||||
for item in sorted([x for x in MyDriver if x not in Deferred]):
|
||||
print ' ' + item + ' =', '\'%s\'' % MyDriver[item]
|
||||
#print 'Groups:', MyDriver['Groups']
|
||||
dump_driver_groups(MyDriver['Groups'], ' ')
|
||||
#print 'Funcs:', MyDriver['Funcs']
|
||||
@@ -1334,6 +1393,7 @@ def put_mkDriver(MyDriver):
|
||||
txt += put_group(MyDriver, MyDriver['Groups'][group])
|
||||
|
||||
txt += [' hsetprop ${scobj_hpath} klass %s' % MyDriver['class']]
|
||||
txt += [' hsetprop ${scobj_hpath} data true']
|
||||
txt += [' hsetprop ${scobj_hpath} debug_threshold %s' % str(MyDriver['debug_threshold'])]
|
||||
if len(MyDriver['Deferred']) > 0:
|
||||
txt += [' if {[string equal -nocase [SplitReply [%s]] "false"]} {' % MyDriver['simulation_group']]
|
||||
|
||||
Reference in New Issue
Block a user