Implicit setting type to part/drivable if not set explicitly
This commit is contained in:
@@ -160,6 +160,7 @@ proc ::scobj::tank::mk_sct_tank { sct_controller name } {
|
||||
hsetprop ${scobj_hpath}/limits/forward mutable false
|
||||
hsetprop ${scobj_hpath}/limits/forward nxsave true
|
||||
hsetprop ${scobj_hpath}/limits/forward oldval UNKNOWN
|
||||
hsetprop ${scobj_hpath}/limits/forward type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/limits/reverse plain user text
|
||||
hsetprop ${scobj_hpath}/limits/reverse read ${ns}::getValue ${scobj_hpath} read_switch {MG _LRH}
|
||||
@@ -169,6 +170,7 @@ proc ::scobj::tank::mk_sct_tank { sct_controller name } {
|
||||
hsetprop ${scobj_hpath}/limits/reverse mutable false
|
||||
hsetprop ${scobj_hpath}/limits/reverse nxsave true
|
||||
hsetprop ${scobj_hpath}/limits/reverse oldval UNKNOWN
|
||||
hsetprop ${scobj_hpath}/limits/reverse type "part"
|
||||
|
||||
if {[SplitReply [motor_simulation]]=="false"} {
|
||||
${sct_controller} poll ${scobj_hpath}/limits/forward 1
|
||||
@@ -185,6 +187,7 @@ proc ::scobj::tank::mk_sct_tank { sct_controller name } {
|
||||
hsetprop ${scobj_hpath}/switches/forward mutable false
|
||||
hsetprop ${scobj_hpath}/switches/forward nxsave true
|
||||
hsetprop ${scobj_hpath}/switches/forward oldval UNKNOWN
|
||||
hsetprop ${scobj_hpath}/switches/forward type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/switches/reverse plain user text
|
||||
hsetprop ${scobj_hpath}/switches/reverse read ${ns}::getValue ${scobj_hpath} read_switch {MG @IN[6]}
|
||||
@@ -194,6 +197,7 @@ proc ::scobj::tank::mk_sct_tank { sct_controller name } {
|
||||
hsetprop ${scobj_hpath}/switches/reverse mutable false
|
||||
hsetprop ${scobj_hpath}/switches/reverse nxsave true
|
||||
hsetprop ${scobj_hpath}/switches/reverse oldval UNKNOWN
|
||||
hsetprop ${scobj_hpath}/switches/reverse type "part"
|
||||
|
||||
if {[SplitReply [motor_simulation]]=="false"} {
|
||||
${sct_controller} poll ${scobj_hpath}/switches/forward 1
|
||||
|
||||
@@ -19,7 +19,6 @@ driver hiden_xcs = {
|
||||
priv = user
|
||||
group_property 'data' = 'true'
|
||||
group_property 'nxsave' = 'true'
|
||||
property 'type' = 'part'
|
||||
property 'klass' = 'environment'
|
||||
property 'sdsinfo' = '::nexus::scobj::sdsinfo'
|
||||
var enabled = {
|
||||
@@ -37,7 +36,6 @@ driver hiden_xcs = {
|
||||
}
|
||||
var flow = {
|
||||
driveable = flow
|
||||
property 'type' = 'drivable'
|
||||
mutable = true
|
||||
readable = 1
|
||||
read_command = 'None'
|
||||
@@ -58,7 +56,6 @@ driver hiden_xcs = {
|
||||
}
|
||||
var humidity = {
|
||||
driveable = humidity
|
||||
property 'type' = 'drivable'
|
||||
mutable = true
|
||||
readable = 1
|
||||
read_command = '?ALL DATA'
|
||||
|
||||
@@ -833,6 +833,7 @@ proc ::scobj::hiden_xcs::mk_sct_hiden_xcs { sct_controller name tol } {
|
||||
hsetprop ${scobj_hpath}/analog/ansto_temp oldval 0.0
|
||||
hsetprop ${scobj_hpath}/analog/ansto_temp base "0"
|
||||
hsetprop ${scobj_hpath}/analog/ansto_temp span "100"
|
||||
hsetprop ${scobj_hpath}/analog/ansto_temp type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/analog/pv1 plain user float
|
||||
hsetprop ${scobj_hpath}/analog/pv1 read ${ns}::getValue ${scobj_hpath} read_sixteen {?AIN,0}
|
||||
@@ -844,6 +845,7 @@ proc ::scobj::hiden_xcs::mk_sct_hiden_xcs { sct_controller name tol } {
|
||||
hsetprop ${scobj_hpath}/analog/pv1 oldval 0.0
|
||||
hsetprop ${scobj_hpath}/analog/pv1 base "0"
|
||||
hsetprop ${scobj_hpath}/analog/pv1 span "500"
|
||||
hsetprop ${scobj_hpath}/analog/pv1 type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/analog/pv2 plain user float
|
||||
hsetprop ${scobj_hpath}/analog/pv2 read ${ns}::getValue ${scobj_hpath} read_sixteen {?AIN,1}
|
||||
@@ -855,6 +857,7 @@ proc ::scobj::hiden_xcs::mk_sct_hiden_xcs { sct_controller name tol } {
|
||||
hsetprop ${scobj_hpath}/analog/pv2 oldval 0.0
|
||||
hsetprop ${scobj_hpath}/analog/pv2 base "0"
|
||||
hsetprop ${scobj_hpath}/analog/pv2 span "500"
|
||||
hsetprop ${scobj_hpath}/analog/pv2 type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/analog/pv3 plain user float
|
||||
hsetprop ${scobj_hpath}/analog/pv3 read ${ns}::getValue ${scobj_hpath} read_sixteen {?AIN,2}
|
||||
@@ -866,6 +869,7 @@ proc ::scobj::hiden_xcs::mk_sct_hiden_xcs { sct_controller name tol } {
|
||||
hsetprop ${scobj_hpath}/analog/pv3 oldval 0.0
|
||||
hsetprop ${scobj_hpath}/analog/pv3 base "0"
|
||||
hsetprop ${scobj_hpath}/analog/pv3 span "500"
|
||||
hsetprop ${scobj_hpath}/analog/pv3 type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/analog/rhsense plain user float
|
||||
hsetprop ${scobj_hpath}/analog/rhsense read ${ns}::getValue ${scobj_hpath} read_sixteen {?AIN,9}
|
||||
@@ -877,6 +881,7 @@ proc ::scobj::hiden_xcs::mk_sct_hiden_xcs { sct_controller name tol } {
|
||||
hsetprop ${scobj_hpath}/analog/rhsense oldval 0.0
|
||||
hsetprop ${scobj_hpath}/analog/rhsense base "0"
|
||||
hsetprop ${scobj_hpath}/analog/rhsense span "100"
|
||||
hsetprop ${scobj_hpath}/analog/rhsense type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/analog/rhtemp plain user float
|
||||
hsetprop ${scobj_hpath}/analog/rhtemp read ${ns}::getValue ${scobj_hpath} read_sixteen {?AIN,8}
|
||||
@@ -888,6 +893,7 @@ proc ::scobj::hiden_xcs::mk_sct_hiden_xcs { sct_controller name tol } {
|
||||
hsetprop ${scobj_hpath}/analog/rhtemp oldval 0.0
|
||||
hsetprop ${scobj_hpath}/analog/rhtemp base "0"
|
||||
hsetprop ${scobj_hpath}/analog/rhtemp span "100"
|
||||
hsetprop ${scobj_hpath}/analog/rhtemp type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/analog/sp1 plain user float
|
||||
hsetprop ${scobj_hpath}/analog/sp1 read ${ns}::getValue ${scobj_hpath} read_twelve {?AOUT,0}
|
||||
@@ -902,6 +908,7 @@ proc ::scobj::hiden_xcs::mk_sct_hiden_xcs { sct_controller name tol } {
|
||||
hsetprop ${scobj_hpath}/analog/sp1 oldval 0.0
|
||||
hsetprop ${scobj_hpath}/analog/sp1 base "0"
|
||||
hsetprop ${scobj_hpath}/analog/sp1 span "500"
|
||||
hsetprop ${scobj_hpath}/analog/sp1 type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/analog/sp2 plain user float
|
||||
hsetprop ${scobj_hpath}/analog/sp2 read ${ns}::getValue ${scobj_hpath} read_twelve {?AOUT,1}
|
||||
@@ -916,6 +923,7 @@ proc ::scobj::hiden_xcs::mk_sct_hiden_xcs { sct_controller name tol } {
|
||||
hsetprop ${scobj_hpath}/analog/sp2 oldval 0.0
|
||||
hsetprop ${scobj_hpath}/analog/sp2 base "0"
|
||||
hsetprop ${scobj_hpath}/analog/sp2 span "500"
|
||||
hsetprop ${scobj_hpath}/analog/sp2 type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/analog/sp3 plain user float
|
||||
hsetprop ${scobj_hpath}/analog/sp3 read ${ns}::getValue ${scobj_hpath} read_twelve {?AOUT,2}
|
||||
@@ -930,6 +938,7 @@ proc ::scobj::hiden_xcs::mk_sct_hiden_xcs { sct_controller name tol } {
|
||||
hsetprop ${scobj_hpath}/analog/sp3 oldval 0.0
|
||||
hsetprop ${scobj_hpath}/analog/sp3 base "0"
|
||||
hsetprop ${scobj_hpath}/analog/sp3 span "500"
|
||||
hsetprop ${scobj_hpath}/analog/sp3 type "part"
|
||||
|
||||
if {[SplitReply [environment_simulation]]=="false"} {
|
||||
${sct_controller} poll ${scobj_hpath}/analog/ansto_temp 5
|
||||
|
||||
@@ -245,6 +245,7 @@ proc ::scobj::isotech_ps::mk_sct_isotech_ps { sct_controller name } {
|
||||
hsetprop ${scobj_hpath}/amps nxsave true
|
||||
hsetprop ${scobj_hpath}/amps units A
|
||||
hsetprop ${scobj_hpath}/amps oldval 0.0
|
||||
hsetprop ${scobj_hpath}/amps type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/relay plain user int
|
||||
hsetprop ${scobj_hpath}/relay read ${ns}::getValue ${scobj_hpath} read_relay {F}
|
||||
@@ -257,6 +258,7 @@ proc ::scobj::isotech_ps::mk_sct_isotech_ps { sct_controller name } {
|
||||
hsetprop ${scobj_hpath}/relay mutable true
|
||||
hsetprop ${scobj_hpath}/relay nxsave true
|
||||
hsetprop ${scobj_hpath}/relay oldval 0
|
||||
hsetprop ${scobj_hpath}/relay type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/volts plain user float
|
||||
hsetprop ${scobj_hpath}/volts read ${ns}::getValue ${scobj_hpath} rdValue {V}
|
||||
@@ -270,6 +272,7 @@ proc ::scobj::isotech_ps::mk_sct_isotech_ps { sct_controller name } {
|
||||
hsetprop ${scobj_hpath}/volts nxsave true
|
||||
hsetprop ${scobj_hpath}/volts units V
|
||||
hsetprop ${scobj_hpath}/volts oldval 0.0
|
||||
hsetprop ${scobj_hpath}/volts type "part"
|
||||
|
||||
if {[SplitReply [environment_simulation]]=="false"} {
|
||||
${sct_controller} poll ${scobj_hpath}/amps 5
|
||||
|
||||
@@ -17,10 +17,6 @@
|
||||
# - type part ???
|
||||
# - nxalias xxxxx
|
||||
# - sdsinfo
|
||||
# fix code for driving
|
||||
# - make each node driveable
|
||||
# - use [sct] in place of ${tc_root}
|
||||
# - associate sensor and call ansto_makesctdrive
|
||||
# check simulation works
|
||||
# handle environmental monitoring (emon)
|
||||
# - figure out how to do it
|
||||
@@ -559,27 +555,30 @@ def build_variable(MyDriver, p):
|
||||
if Verbose:
|
||||
print 'Variable:', p
|
||||
MyVar = {}
|
||||
MyVar['Property'] = {}
|
||||
# Copy items for this variable
|
||||
for item in p:
|
||||
if Verbose:
|
||||
print "Variable Item:", item
|
||||
for key in item.keys():
|
||||
if key == 'Property':
|
||||
if not 'Property' in MyVar:
|
||||
MyVar['Property'] = {}
|
||||
MyVar['Property'][item[key][0]] = item[key][1]
|
||||
else:
|
||||
MyVar[key] = item[key]
|
||||
# copy the defaults for missing items
|
||||
for key in ContextStack[ContextIndex]:
|
||||
if key == 'Property':
|
||||
if 'Property' not in MyVar:
|
||||
MyVar['Property'] = {}
|
||||
for key2 in ContextStack[ContextIndex][key]:
|
||||
if key2 not in MyVar['Property']:
|
||||
MyVar['Property'][key2] = ContextStack[ContextIndex][key][key2]
|
||||
elif not key in MyVar:
|
||||
MyVar[key] = ContextStack[ContextIndex][key]
|
||||
# set the type if not explicitly set
|
||||
if 'type' not in MyVar['Property']:
|
||||
if 'driveable' in MyVar and MyVar['driveable']:
|
||||
MyVar['Property']['type'] = 'drivable'
|
||||
else:
|
||||
MyVar['Property']['type'] = 'part'
|
||||
# if this variable is driveable
|
||||
if 'driveable' in MyVar and MyVar['driveable']:
|
||||
# insert defaults for missing driveable functions
|
||||
|
||||
Reference in New Issue
Block a user