Merge branch 'RELEASE-3_1'
Conflicts: sics/site_ansto/instrument/config/environment/hiden_xcs_sct.tcl sics/site_ansto/instrument/config/environment/temperature/sct_lakeshore_m370.tcl sics/site_ansto/instrument/hipd/wombat_configuration.tcl sics/site_ansto/instrument/kookaburra/kookaburra_configuration.tcl sics/site_ansto/instrument/pelican/pelican_configuration.tcl sics/site_ansto/instrument/reflectometer/platypus_configuration.tcl sics/site_ansto/instrument/util/gen_sct.py
This commit is contained in:
@@ -181,6 +181,35 @@ proc ::scobj::hiden_xcs::fetch_flow {tc_root nextState cmd_str} {
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
# function to request the read of a parameter on a device
|
||||
proc ::scobj::hiden_xcs::getTarget {tc_root nextState cmd_str} {
|
||||
set catch_status [ catch {
|
||||
debug_log ${tc_root} 1 "getTarget tc_root=${tc_root} sct=[sct] cmd=${cmd_str}"
|
||||
if { [hpropexists [sct] geterror] } {
|
||||
hdelprop [sct] geterror
|
||||
}
|
||||
set cmd "${cmd_str}"
|
||||
# getTarget hook code starts
|
||||
if { [hpropexists [sct] target] } {
|
||||
sct result [sct target]
|
||||
} else {
|
||||
sct result [hval [sct]]
|
||||
}
|
||||
set cmd "@@NOSEND@@"
|
||||
# getTarget hook code ends
|
||||
if { [hpropexists [sct] geterror] } {
|
||||
debug_log ${tc_root} 9 "[sct] error: [sct geterror]"
|
||||
error "[sct geterror]"
|
||||
}
|
||||
debug_log ${tc_root} 1 "getTarget sct send ${cmd}"
|
||||
if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} {
|
||||
sct send "${cmd}"
|
||||
}
|
||||
return ${nextState}
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
# function to request the read of a parameter on a device
|
||||
proc ::scobj::hiden_xcs::getValue {tc_root nextState cmd_str} {
|
||||
set catch_status [ catch {
|
||||
@@ -269,6 +298,10 @@ proc ::scobj::hiden_xcs::pid_flow {tc_root sp pv} {
|
||||
set i_value [expr {[sct pid_ivalue] * [sct pid_integ]}]
|
||||
set pid [expr {${p_value} + ${i_value} + ${d_value}}]
|
||||
# pid_flow hook code starts
|
||||
if { ![hval ${tc_root}/auto] } {
|
||||
set pid 0.0
|
||||
sct pid_integ 0.0
|
||||
}
|
||||
foreach node [list ${tc_root}/analog/sp1 ${tc_root}/analog/sp2] {
|
||||
if { !([hpropexists ${node} bias_flow] && [hgetpropval ${node} bias_flow] == ${pid}) } {
|
||||
hsetprop ${node} bias_flow ${pid}
|
||||
@@ -304,6 +337,10 @@ proc ::scobj::hiden_xcs::pid_humidity {tc_root sp pv} {
|
||||
set i_value [expr {[sct pid_ivalue] * [sct pid_integ]}]
|
||||
set pid [expr {${p_value} + ${i_value} + ${d_value}}]
|
||||
# pid_humidity hook code starts
|
||||
if { ![hval ${tc_root}/auto] } {
|
||||
set pid 0.0
|
||||
sct pid_integ 0.0
|
||||
}
|
||||
set sign 1
|
||||
foreach node [list ${tc_root}/analog/sp1 ${tc_root}/analog/sp2] {
|
||||
set sign [expr -${sign}]
|
||||
@@ -763,6 +800,20 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
set scobj_hpath /sics/${name}
|
||||
# Start of unnamed group
|
||||
|
||||
# Start of var: auto
|
||||
hfactory ${scobj_hpath}/auto plain user int
|
||||
hsetprop ${scobj_hpath}/auto control true
|
||||
hsetprop ${scobj_hpath}/auto data true
|
||||
hsetprop ${scobj_hpath}/auto mutable true
|
||||
hsetprop ${scobj_hpath}/auto nxsave true
|
||||
hsetprop ${scobj_hpath}/auto values 0,1
|
||||
hsetprop ${scobj_hpath}/auto oldval 0
|
||||
hset ${scobj_hpath}/auto 0
|
||||
hsetprop ${scobj_hpath}/auto klass "environment"
|
||||
hsetprop ${scobj_hpath}/auto sdsinfo "::nexus::scobj::sdsinfo"
|
||||
hsetprop ${scobj_hpath}/auto type "part"
|
||||
hsetprop ${scobj_hpath}/auto nxalias "${name}_auto"
|
||||
|
||||
# Start of var: enabled
|
||||
hfactory ${scobj_hpath}/enabled plain user int
|
||||
hsetprop ${scobj_hpath}/enabled read ${ns}::getValue ${scobj_hpath} read_digital {?DOUT,2}
|
||||
@@ -1103,10 +1154,10 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/flow/sensor pid_deriv "0"
|
||||
hsetprop ${scobj_hpath}/flow/sensor pid_dvalue "0.0"
|
||||
hsetprop ${scobj_hpath}/flow/sensor pid_error "0"
|
||||
hsetprop ${scobj_hpath}/flow/sensor pid_imax "30"
|
||||
hsetprop ${scobj_hpath}/flow/sensor pid_imax "50"
|
||||
hsetprop ${scobj_hpath}/flow/sensor pid_integ "0"
|
||||
hsetprop ${scobj_hpath}/flow/sensor pid_ivalue "0.1"
|
||||
hsetprop ${scobj_hpath}/flow/sensor pid_pvalue "0.2"
|
||||
hsetprop ${scobj_hpath}/flow/sensor pid_pvalue "0.1"
|
||||
hsetprop ${scobj_hpath}/flow/sensor sdsinfo "::nexus::scobj::sdsinfo"
|
||||
hsetprop ${scobj_hpath}/flow/sensor type "part"
|
||||
hsetprop ${scobj_hpath}/flow/sensor nxalias "${name}_flow_sensor"
|
||||
@@ -1121,6 +1172,8 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
|
||||
# Start of var: setpoint
|
||||
hfactory ${scobj_hpath}/flow/setpoint plain user float
|
||||
hsetprop ${scobj_hpath}/flow/setpoint read ${ns}::getTarget ${scobj_hpath} rdValue {@}
|
||||
hsetprop ${scobj_hpath}/flow/setpoint rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
hsetprop ${scobj_hpath}/flow/setpoint write ${ns}::write_flow ${scobj_hpath} noResponse {}
|
||||
hsetprop ${scobj_hpath}/flow/setpoint noResponse ${ns}::noResponse ${scobj_hpath}
|
||||
hsetprop ${scobj_hpath}/flow/setpoint check ${ns}::checkrange ${scobj_hpath}
|
||||
@@ -1146,6 +1199,7 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/flow/setpoint nxalias "${name}_flow_setpoint"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/flow/setpoint 1
|
||||
${sct_controller} write ${scobj_hpath}/flow/setpoint
|
||||
hsetprop ${scobj_hpath}/flow/setpoint simulated false
|
||||
} else {
|
||||
@@ -1177,10 +1231,10 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/humidity/sensor pid_deriv "0"
|
||||
hsetprop ${scobj_hpath}/humidity/sensor pid_dvalue "0.0"
|
||||
hsetprop ${scobj_hpath}/humidity/sensor pid_error "0"
|
||||
hsetprop ${scobj_hpath}/humidity/sensor pid_imax "30"
|
||||
hsetprop ${scobj_hpath}/humidity/sensor pid_imax "20"
|
||||
hsetprop ${scobj_hpath}/humidity/sensor pid_integ "0"
|
||||
hsetprop ${scobj_hpath}/humidity/sensor pid_ivalue "0.1"
|
||||
hsetprop ${scobj_hpath}/humidity/sensor pid_pvalue "0.2"
|
||||
hsetprop ${scobj_hpath}/humidity/sensor pid_pvalue "1.0"
|
||||
hsetprop ${scobj_hpath}/humidity/sensor sdsinfo "::nexus::scobj::sdsinfo"
|
||||
hsetprop ${scobj_hpath}/humidity/sensor type "part"
|
||||
hsetprop ${scobj_hpath}/humidity/sensor nxalias "${name}_humidity_sensor"
|
||||
@@ -1195,6 +1249,8 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
|
||||
# Start of var: setpoint
|
||||
hfactory ${scobj_hpath}/humidity/setpoint plain user float
|
||||
hsetprop ${scobj_hpath}/humidity/setpoint read ${ns}::getTarget ${scobj_hpath} rdValue {@}
|
||||
hsetprop ${scobj_hpath}/humidity/setpoint rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
hsetprop ${scobj_hpath}/humidity/setpoint write ${ns}::write_humidity ${scobj_hpath} noResponse {}
|
||||
hsetprop ${scobj_hpath}/humidity/setpoint noResponse ${ns}::noResponse ${scobj_hpath}
|
||||
hsetprop ${scobj_hpath}/humidity/setpoint check ${ns}::chkrange_function ${scobj_hpath}
|
||||
@@ -1207,8 +1263,8 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/humidity/setpoint data true
|
||||
hsetprop ${scobj_hpath}/humidity/setpoint mutable true
|
||||
hsetprop ${scobj_hpath}/humidity/setpoint nxsave true
|
||||
hsetprop ${scobj_hpath}/humidity/setpoint lowerlimit 10
|
||||
hsetprop ${scobj_hpath}/humidity/setpoint upperlimit 90
|
||||
hsetprop ${scobj_hpath}/humidity/setpoint lowerlimit 0
|
||||
hsetprop ${scobj_hpath}/humidity/setpoint upperlimit 100
|
||||
hsetprop ${scobj_hpath}/humidity/setpoint tolerance 1
|
||||
hsetprop ${scobj_hpath}/humidity/setpoint permlink data_set "G[format "%02d" ${id}]SP02"
|
||||
hsetprop ${scobj_hpath}/humidity/setpoint @description "G[format "%02d" ${id}]SP02"
|
||||
@@ -1220,6 +1276,7 @@ proc ::scobj::hiden_xcs::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/humidity/setpoint nxalias "${name}_humidity_setpoint"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/humidity/setpoint 1
|
||||
${sct_controller} write ${scobj_hpath}/humidity/setpoint
|
||||
hsetprop ${scobj_hpath}/humidity/setpoint simulated false
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user