Regen SCT drivers
This commit is contained in:
@@ -86,7 +86,12 @@ proc ::scobj::hiden_xcs::checkstatus {tc_root} {
|
||||
# checkstatus hook code goes here
|
||||
if {[sct driving]} {
|
||||
set sp "[sct target]"
|
||||
set pv "[hval ${tc_root}/[sct driveable]]"
|
||||
if {[hpropexists [sct] simulated] && [sct simulated] == "true"} {
|
||||
set pv "${sp}"
|
||||
hset ${tc_root}/[sct driveable] ${sp}
|
||||
}
|
||||
set pv "[hval ${tc_root}/[sct driveable]]"
|
||||
}
|
||||
if { abs(${pv} - ${sp}) <= [sct tolerance] } {
|
||||
if { [hpropexists [sct] settle_time] } {
|
||||
if { [hpropexists [sct] settle_time_start] } {
|
||||
@@ -756,8 +761,9 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
sicslist setatt ${name} long_name ${name}
|
||||
|
||||
set scobj_hpath /sics/${name}
|
||||
# Start of unnamed group
|
||||
|
||||
|
||||
# Start of var: enabled
|
||||
hfactory ${scobj_hpath}/enabled plain user int
|
||||
hsetprop ${scobj_hpath}/enabled read ${ns}::getValue ${scobj_hpath} read_digital {?DOUT,2}
|
||||
hsetprop ${scobj_hpath}/enabled read_digital ${ns}::read_digital ${scobj_hpath}
|
||||
@@ -780,11 +786,13 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/enabled 10
|
||||
${sct_controller} write ${scobj_hpath}/enabled
|
||||
hsetprop ${scobj_hpath}/%s simulated false
|
||||
} else {
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs"
|
||||
hsetprop ${scobj_hpath}/%s simulated true
|
||||
}
|
||||
|
||||
|
||||
# Start of var: flow1
|
||||
hfactory ${scobj_hpath}/flow1 plain user float
|
||||
hsetprop ${scobj_hpath}/flow1 control false
|
||||
hsetprop ${scobj_hpath}/flow1 data false
|
||||
@@ -796,7 +804,7 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/flow1 type "part"
|
||||
hsetprop ${scobj_hpath}/flow1 nxalias "${name}_flow1"
|
||||
|
||||
|
||||
# Start of var: flow2
|
||||
hfactory ${scobj_hpath}/flow2 plain user float
|
||||
hsetprop ${scobj_hpath}/flow2 control false
|
||||
hsetprop ${scobj_hpath}/flow2 data false
|
||||
@@ -808,7 +816,7 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/flow2 type "part"
|
||||
hsetprop ${scobj_hpath}/flow2 nxalias "${name}_flow2"
|
||||
|
||||
|
||||
# Start of var: flow3
|
||||
hfactory ${scobj_hpath}/flow3 plain user float
|
||||
hsetprop ${scobj_hpath}/flow3 control false
|
||||
hsetprop ${scobj_hpath}/flow3 data false
|
||||
@@ -820,7 +828,7 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/flow3 type "part"
|
||||
hsetprop ${scobj_hpath}/flow3 nxalias "${name}_flow3"
|
||||
|
||||
|
||||
# Start of var: gas_factor
|
||||
hfactory ${scobj_hpath}/gas_factor plain user float
|
||||
hsetprop ${scobj_hpath}/gas_factor control true
|
||||
hsetprop ${scobj_hpath}/gas_factor data true
|
||||
@@ -833,7 +841,7 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/gas_factor type "part"
|
||||
hsetprop ${scobj_hpath}/gas_factor nxalias "${name}_gas_factor"
|
||||
|
||||
|
||||
# Start of var: temperature
|
||||
hfactory ${scobj_hpath}/temperature plain user float
|
||||
hsetprop ${scobj_hpath}/temperature control false
|
||||
hsetprop ${scobj_hpath}/temperature data false
|
||||
@@ -849,10 +857,12 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath} klass "@none"
|
||||
hsetprop ${scobj_hpath} nxsave "true"
|
||||
hsetprop ${scobj_hpath} type "part"
|
||||
# End of unnamed group
|
||||
|
||||
# Start of named group: analog
|
||||
hfactory ${scobj_hpath}/analog plain spy none
|
||||
|
||||
|
||||
# Start of var: ansto_temp
|
||||
hfactory ${scobj_hpath}/analog/ansto_temp plain user float
|
||||
hsetprop ${scobj_hpath}/analog/ansto_temp read ${ns}::getValue ${scobj_hpath} read_sixteen {?AIN,12}
|
||||
hsetprop ${scobj_hpath}/analog/ansto_temp read_sixteen ${ns}::read_sixteen ${scobj_hpath}
|
||||
@@ -869,11 +879,13 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/analog/ansto_temp 5
|
||||
hsetprop ${scobj_hpath}/%s simulated false
|
||||
} else {
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs"
|
||||
hsetprop ${scobj_hpath}/%s simulated true
|
||||
}
|
||||
|
||||
|
||||
# Start of var: pv1
|
||||
hfactory ${scobj_hpath}/analog/pv1 plain user float
|
||||
hsetprop ${scobj_hpath}/analog/pv1 read ${ns}::getValue ${scobj_hpath} read_sixteen {?AIN,0}
|
||||
hsetprop ${scobj_hpath}/analog/pv1 read_sixteen ${ns}::read_sixteen ${scobj_hpath}
|
||||
@@ -890,11 +902,13 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/analog/pv1 5
|
||||
hsetprop ${scobj_hpath}/%s simulated false
|
||||
} else {
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs"
|
||||
hsetprop ${scobj_hpath}/%s simulated true
|
||||
}
|
||||
|
||||
|
||||
# Start of var: pv2
|
||||
hfactory ${scobj_hpath}/analog/pv2 plain user float
|
||||
hsetprop ${scobj_hpath}/analog/pv2 read ${ns}::getValue ${scobj_hpath} read_sixteen {?AIN,1}
|
||||
hsetprop ${scobj_hpath}/analog/pv2 read_sixteen ${ns}::read_sixteen ${scobj_hpath}
|
||||
@@ -911,11 +925,13 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/analog/pv2 5
|
||||
hsetprop ${scobj_hpath}/%s simulated false
|
||||
} else {
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs"
|
||||
hsetprop ${scobj_hpath}/%s simulated true
|
||||
}
|
||||
|
||||
|
||||
# Start of var: pv3
|
||||
hfactory ${scobj_hpath}/analog/pv3 plain user float
|
||||
hsetprop ${scobj_hpath}/analog/pv3 read ${ns}::getValue ${scobj_hpath} read_sixteen {?AIN,2}
|
||||
hsetprop ${scobj_hpath}/analog/pv3 read_sixteen ${ns}::read_sixteen ${scobj_hpath}
|
||||
@@ -932,11 +948,13 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/analog/pv3 5
|
||||
hsetprop ${scobj_hpath}/%s simulated false
|
||||
} else {
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs"
|
||||
hsetprop ${scobj_hpath}/%s simulated true
|
||||
}
|
||||
|
||||
|
||||
# Start of var: rhsense
|
||||
hfactory ${scobj_hpath}/analog/rhsense plain user float
|
||||
hsetprop ${scobj_hpath}/analog/rhsense read ${ns}::getValue ${scobj_hpath} read_sixteen {?AIN,9}
|
||||
hsetprop ${scobj_hpath}/analog/rhsense read_sixteen ${ns}::read_sixteen ${scobj_hpath}
|
||||
@@ -953,11 +971,13 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/analog/rhsense 5
|
||||
hsetprop ${scobj_hpath}/%s simulated false
|
||||
} else {
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs"
|
||||
hsetprop ${scobj_hpath}/%s simulated true
|
||||
}
|
||||
|
||||
|
||||
# Start of var: rhtemp
|
||||
hfactory ${scobj_hpath}/analog/rhtemp plain user float
|
||||
hsetprop ${scobj_hpath}/analog/rhtemp read ${ns}::getValue ${scobj_hpath} read_sixteen {?AIN,8}
|
||||
hsetprop ${scobj_hpath}/analog/rhtemp read_sixteen ${ns}::read_sixteen ${scobj_hpath}
|
||||
@@ -974,11 +994,13 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/analog/rhtemp 5
|
||||
hsetprop ${scobj_hpath}/%s simulated false
|
||||
} else {
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs"
|
||||
hsetprop ${scobj_hpath}/%s simulated true
|
||||
}
|
||||
|
||||
|
||||
# Start of var: sp1
|
||||
hfactory ${scobj_hpath}/analog/sp1 plain user float
|
||||
hsetprop ${scobj_hpath}/analog/sp1 read ${ns}::getValue ${scobj_hpath} read_twelve {?AOUT,0}
|
||||
hsetprop ${scobj_hpath}/analog/sp1 read_twelve ${ns}::read_twelve ${scobj_hpath}
|
||||
@@ -999,11 +1021,13 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/analog/sp1 5
|
||||
${sct_controller} write ${scobj_hpath}/analog/sp1
|
||||
hsetprop ${scobj_hpath}/%s simulated false
|
||||
} else {
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs"
|
||||
hsetprop ${scobj_hpath}/%s simulated true
|
||||
}
|
||||
|
||||
|
||||
# Start of var: sp2
|
||||
hfactory ${scobj_hpath}/analog/sp2 plain user float
|
||||
hsetprop ${scobj_hpath}/analog/sp2 read ${ns}::getValue ${scobj_hpath} read_twelve {?AOUT,1}
|
||||
hsetprop ${scobj_hpath}/analog/sp2 read_twelve ${ns}::read_twelve ${scobj_hpath}
|
||||
@@ -1024,11 +1048,13 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/analog/sp2 5
|
||||
${sct_controller} write ${scobj_hpath}/analog/sp2
|
||||
hsetprop ${scobj_hpath}/%s simulated false
|
||||
} else {
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs"
|
||||
hsetprop ${scobj_hpath}/%s simulated true
|
||||
}
|
||||
|
||||
|
||||
# Start of var: sp3
|
||||
hfactory ${scobj_hpath}/analog/sp3 plain user float
|
||||
hsetprop ${scobj_hpath}/analog/sp3 read ${ns}::getValue ${scobj_hpath} read_twelve {?AOUT,2}
|
||||
hsetprop ${scobj_hpath}/analog/sp3 read_twelve ${ns}::read_twelve ${scobj_hpath}
|
||||
@@ -1049,16 +1075,20 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/analog/sp3 5
|
||||
${sct_controller} write ${scobj_hpath}/analog/sp3
|
||||
hsetprop ${scobj_hpath}/%s simulated false
|
||||
} else {
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs"
|
||||
hsetprop ${scobj_hpath}/%s simulated true
|
||||
}
|
||||
hsetprop ${scobj_hpath}/analog data "false"
|
||||
hsetprop ${scobj_hpath}/analog klass "@none"
|
||||
hsetprop ${scobj_hpath}/analog type "part"
|
||||
# End of named group: analog
|
||||
|
||||
# Start of named group: flow
|
||||
hfactory ${scobj_hpath}/flow plain spy none
|
||||
|
||||
|
||||
# Start of var: sensor
|
||||
hfactory ${scobj_hpath}/flow/sensor plain user float
|
||||
hsetprop ${scobj_hpath}/flow/sensor read ${ns}::fetch_flow ${scobj_hpath} read_flow {None}
|
||||
hsetprop ${scobj_hpath}/flow/sensor read_flow ${ns}::read_flow ${scobj_hpath}
|
||||
@@ -1083,11 +1113,13 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/flow/sensor 1
|
||||
hsetprop ${scobj_hpath}/%s simulated false
|
||||
} else {
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs"
|
||||
hsetprop ${scobj_hpath}/%s simulated true
|
||||
}
|
||||
|
||||
|
||||
# Start of var: setpoint
|
||||
hfactory ${scobj_hpath}/flow/setpoint plain user float
|
||||
hsetprop ${scobj_hpath}/flow/setpoint write ${ns}::write_flow ${scobj_hpath} noResponse {}
|
||||
hsetprop ${scobj_hpath}/flow/setpoint noResponse ${ns}::noResponse ${scobj_hpath}
|
||||
@@ -1115,18 +1147,22 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} write ${scobj_hpath}/flow/setpoint
|
||||
hsetprop ${scobj_hpath}/%s simulated false
|
||||
} else {
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs"
|
||||
hsetprop ${scobj_hpath}/%s simulated true
|
||||
}
|
||||
hsetprop ${scobj_hpath}/flow data "true"
|
||||
hsetprop ${scobj_hpath}/flow klass "@none"
|
||||
hsetprop ${scobj_hpath}/flow nxsave "true"
|
||||
hsetprop ${scobj_hpath}/flow type "part"
|
||||
# End of named group: flow
|
||||
ansto_makesctdrive ${name}_flow_setpoint ${scobj_hpath}/flow/setpoint ${scobj_hpath}/flow/sensor ${sct_controller}
|
||||
|
||||
# Start of named group: humidity
|
||||
hfactory ${scobj_hpath}/humidity plain spy none
|
||||
|
||||
|
||||
# Start of var: sensor
|
||||
hfactory ${scobj_hpath}/humidity/sensor plain user float
|
||||
hsetprop ${scobj_hpath}/humidity/sensor read ${ns}::getValue ${scobj_hpath} read_all_data {?ALL DATA}
|
||||
hsetprop ${scobj_hpath}/humidity/sensor read_all_data ${ns}::read_all_data ${scobj_hpath}
|
||||
@@ -1151,11 +1187,13 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/humidity/sensor 1
|
||||
hsetprop ${scobj_hpath}/%s simulated false
|
||||
} else {
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs"
|
||||
hsetprop ${scobj_hpath}/%s simulated true
|
||||
}
|
||||
|
||||
|
||||
# Start of var: setpoint
|
||||
hfactory ${scobj_hpath}/humidity/setpoint plain user float
|
||||
hsetprop ${scobj_hpath}/humidity/setpoint write ${ns}::write_humidity ${scobj_hpath} noResponse {}
|
||||
hsetprop ${scobj_hpath}/humidity/setpoint noResponse ${ns}::noResponse ${scobj_hpath}
|
||||
@@ -1183,13 +1221,16 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} write ${scobj_hpath}/humidity/setpoint
|
||||
hsetprop ${scobj_hpath}/%s simulated false
|
||||
} else {
|
||||
::scobj::hiden_xcs::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for hiden_xcs"
|
||||
hsetprop ${scobj_hpath}/%s simulated true
|
||||
}
|
||||
hsetprop ${scobj_hpath}/humidity data "true"
|
||||
hsetprop ${scobj_hpath}/humidity klass "@none"
|
||||
hsetprop ${scobj_hpath}/humidity nxsave "true"
|
||||
hsetprop ${scobj_hpath}/humidity type "part"
|
||||
# End of named group: humidity
|
||||
ansto_makesctdrive ${name}_humidity_setpoint ${scobj_hpath}/humidity/setpoint ${scobj_hpath}/humidity/sensor ${sct_controller}
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
|
||||
Reference in New Issue
Block a user