Regenerate all the SCT drivers with new generator
This commit is contained in:
@@ -86,7 +86,12 @@ proc ::scobj::eurotherm_3200::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}"
|
||||
hupdateif ${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] } {
|
||||
@@ -237,9 +242,6 @@ proc ::scobj::eurotherm_3200::mkDriver { sct_controller name device_class simula
|
||||
set scobj_hpath /sics/${name}
|
||||
|
||||
hfactory ${scobj_hpath}/loop1 plain spy none
|
||||
hsetprop ${scobj_hpath}/loop1 data "true"
|
||||
hsetprop ${scobj_hpath}/loop1 klass "@none"
|
||||
hsetprop ${scobj_hpath}/loop1 type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/loop1/sensor plain user float
|
||||
hsetprop ${scobj_hpath}/loop1/sensor read ${ns}::getValue ${scobj_hpath} rdValue {1}
|
||||
@@ -256,6 +258,14 @@ proc ::scobj::eurotherm_3200::mkDriver { sct_controller name device_class simula
|
||||
hsetprop ${scobj_hpath}/loop1/sensor type "part"
|
||||
hsetprop ${scobj_hpath}/loop1/sensor nxalias "${name}_loop1_sensor"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/loop1/sensor 1
|
||||
hsetprop ${scobj_hpath}/loop1/sensor simulated false
|
||||
} else {
|
||||
::scobj::eurotherm_3200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for eurotherm_3200"
|
||||
hsetprop ${scobj_hpath}/loop1/sensor simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/loop1/setpoint plain user float
|
||||
hsetprop ${scobj_hpath}/loop1/setpoint read ${ns}::getValue ${scobj_hpath} rdValue {2}
|
||||
hsetprop ${scobj_hpath}/loop1/setpoint rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -283,17 +293,19 @@ proc ::scobj::eurotherm_3200::mkDriver { sct_controller name device_class simula
|
||||
hsetprop ${scobj_hpath}/loop1/setpoint nxalias "${name}_loop1_setpoint"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/loop1/sensor 1
|
||||
${sct_controller} poll ${scobj_hpath}/loop1/setpoint 1
|
||||
${sct_controller} write ${scobj_hpath}/loop1/setpoint
|
||||
hsetprop ${scobj_hpath}/loop1/setpoint simulated false
|
||||
} else {
|
||||
::scobj::eurotherm_3200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for eurotherm_3200"
|
||||
hsetprop ${scobj_hpath}/loop1/setpoint simulated true
|
||||
}
|
||||
hsetprop ${scobj_hpath}/loop1 data "true"
|
||||
hsetprop ${scobj_hpath}/loop1 klass "@none"
|
||||
hsetprop ${scobj_hpath}/loop1 type "part"
|
||||
ansto_makesctdrive ${name}_loop1_setpoint ${scobj_hpath}/loop1/setpoint ${scobj_hpath}/loop1/sensor ${sct_controller}
|
||||
|
||||
hfactory ${scobj_hpath}/loop1_extra plain spy none
|
||||
hsetprop ${scobj_hpath}/loop1_extra data "false"
|
||||
hsetprop ${scobj_hpath}/loop1_extra klass "@none"
|
||||
hsetprop ${scobj_hpath}/loop1_extra type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/loop1_extra/active_setpoint plain user float
|
||||
hsetprop ${scobj_hpath}/loop1_extra/active_setpoint read ${ns}::getValue ${scobj_hpath} rdValue {15}
|
||||
@@ -307,6 +319,14 @@ proc ::scobj::eurotherm_3200::mkDriver { sct_controller name device_class simula
|
||||
hsetprop ${scobj_hpath}/loop1_extra/active_setpoint type "part"
|
||||
hsetprop ${scobj_hpath}/loop1_extra/active_setpoint nxalias "${name}_loop1_extra_active_setpoint"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/loop1_extra/active_setpoint 1
|
||||
hsetprop ${scobj_hpath}/loop1_extra/active_setpoint simulated false
|
||||
} else {
|
||||
::scobj::eurotherm_3200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for eurotherm_3200"
|
||||
hsetprop ${scobj_hpath}/loop1_extra/active_setpoint simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/loop1_extra/alarm1_thresh plain user float
|
||||
hsetprop ${scobj_hpath}/loop1_extra/alarm1_thresh read ${ns}::getValue ${scobj_hpath} rdValue {13}
|
||||
hsetprop ${scobj_hpath}/loop1_extra/alarm1_thresh rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -322,6 +342,15 @@ proc ::scobj::eurotherm_3200::mkDriver { sct_controller name device_class simula
|
||||
hsetprop ${scobj_hpath}/loop1_extra/alarm1_thresh type "part"
|
||||
hsetprop ${scobj_hpath}/loop1_extra/alarm1_thresh nxalias "${name}_loop1_extra_alarm1_thresh"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/loop1_extra/alarm1_thresh 1
|
||||
${sct_controller} write ${scobj_hpath}/loop1_extra/alarm1_thresh
|
||||
hsetprop ${scobj_hpath}/loop1_extra/alarm1_thresh simulated false
|
||||
} else {
|
||||
::scobj::eurotherm_3200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for eurotherm_3200"
|
||||
hsetprop ${scobj_hpath}/loop1_extra/alarm1_thresh simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/loop1_extra/alarm2_thresh plain user float
|
||||
hsetprop ${scobj_hpath}/loop1_extra/alarm2_thresh read ${ns}::getValue ${scobj_hpath} rdValue {14}
|
||||
hsetprop ${scobj_hpath}/loop1_extra/alarm2_thresh rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -337,6 +366,15 @@ proc ::scobj::eurotherm_3200::mkDriver { sct_controller name device_class simula
|
||||
hsetprop ${scobj_hpath}/loop1_extra/alarm2_thresh type "part"
|
||||
hsetprop ${scobj_hpath}/loop1_extra/alarm2_thresh nxalias "${name}_loop1_extra_alarm2_thresh"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/loop1_extra/alarm2_thresh 1
|
||||
${sct_controller} write ${scobj_hpath}/loop1_extra/alarm2_thresh
|
||||
hsetprop ${scobj_hpath}/loop1_extra/alarm2_thresh simulated false
|
||||
} else {
|
||||
::scobj::eurotherm_3200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for eurotherm_3200"
|
||||
hsetprop ${scobj_hpath}/loop1_extra/alarm2_thresh simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/loop1_extra/manual_output plain user float
|
||||
hsetprop ${scobj_hpath}/loop1_extra/manual_output read ${ns}::getValue ${scobj_hpath} rdValue {3}
|
||||
hsetprop ${scobj_hpath}/loop1_extra/manual_output rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -349,6 +387,14 @@ proc ::scobj::eurotherm_3200::mkDriver { sct_controller name device_class simula
|
||||
hsetprop ${scobj_hpath}/loop1_extra/manual_output type "part"
|
||||
hsetprop ${scobj_hpath}/loop1_extra/manual_output nxalias "${name}_loop1_extra_manual_output"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/loop1_extra/manual_output 1
|
||||
hsetprop ${scobj_hpath}/loop1_extra/manual_output simulated false
|
||||
} else {
|
||||
::scobj::eurotherm_3200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for eurotherm_3200"
|
||||
hsetprop ${scobj_hpath}/loop1_extra/manual_output simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/loop1_extra/power_limit_high plain user float
|
||||
hsetprop ${scobj_hpath}/loop1_extra/power_limit_high read ${ns}::getValue ${scobj_hpath} rdValue {30}
|
||||
hsetprop ${scobj_hpath}/loop1_extra/power_limit_high rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -364,6 +410,15 @@ proc ::scobj::eurotherm_3200::mkDriver { sct_controller name device_class simula
|
||||
hsetprop ${scobj_hpath}/loop1_extra/power_limit_high type "part"
|
||||
hsetprop ${scobj_hpath}/loop1_extra/power_limit_high nxalias "${name}_loop1_extra_power_limit_high"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/loop1_extra/power_limit_high 1
|
||||
${sct_controller} write ${scobj_hpath}/loop1_extra/power_limit_high
|
||||
hsetprop ${scobj_hpath}/loop1_extra/power_limit_high simulated false
|
||||
} else {
|
||||
::scobj::eurotherm_3200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for eurotherm_3200"
|
||||
hsetprop ${scobj_hpath}/loop1_extra/power_limit_high simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/loop1_extra/power_limit_low plain user float
|
||||
hsetprop ${scobj_hpath}/loop1_extra/power_limit_low read ${ns}::getValue ${scobj_hpath} rdValue {31}
|
||||
hsetprop ${scobj_hpath}/loop1_extra/power_limit_low rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -379,6 +434,15 @@ proc ::scobj::eurotherm_3200::mkDriver { sct_controller name device_class simula
|
||||
hsetprop ${scobj_hpath}/loop1_extra/power_limit_low type "part"
|
||||
hsetprop ${scobj_hpath}/loop1_extra/power_limit_low nxalias "${name}_loop1_extra_power_limit_low"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/loop1_extra/power_limit_low 1
|
||||
${sct_controller} write ${scobj_hpath}/loop1_extra/power_limit_low
|
||||
hsetprop ${scobj_hpath}/loop1_extra/power_limit_low simulated false
|
||||
} else {
|
||||
::scobj::eurotherm_3200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for eurotherm_3200"
|
||||
hsetprop ${scobj_hpath}/loop1_extra/power_limit_low simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/loop1_extra/power_slew_rate plain user float
|
||||
hsetprop ${scobj_hpath}/loop1_extra/power_slew_rate read ${ns}::getValue ${scobj_hpath} rdValue {37}
|
||||
hsetprop ${scobj_hpath}/loop1_extra/power_slew_rate rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -394,6 +458,15 @@ proc ::scobj::eurotherm_3200::mkDriver { sct_controller name device_class simula
|
||||
hsetprop ${scobj_hpath}/loop1_extra/power_slew_rate type "part"
|
||||
hsetprop ${scobj_hpath}/loop1_extra/power_slew_rate nxalias "${name}_loop1_extra_power_slew_rate"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/loop1_extra/power_slew_rate 1
|
||||
${sct_controller} write ${scobj_hpath}/loop1_extra/power_slew_rate
|
||||
hsetprop ${scobj_hpath}/loop1_extra/power_slew_rate simulated false
|
||||
} else {
|
||||
::scobj::eurotherm_3200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for eurotherm_3200"
|
||||
hsetprop ${scobj_hpath}/loop1_extra/power_slew_rate simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/loop1_extra/setpoint_slew_rate plain user float
|
||||
hsetprop ${scobj_hpath}/loop1_extra/setpoint_slew_rate read ${ns}::getValue ${scobj_hpath} rdValue {35}
|
||||
hsetprop ${scobj_hpath}/loop1_extra/setpoint_slew_rate rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -409,6 +482,15 @@ proc ::scobj::eurotherm_3200::mkDriver { sct_controller name device_class simula
|
||||
hsetprop ${scobj_hpath}/loop1_extra/setpoint_slew_rate type "part"
|
||||
hsetprop ${scobj_hpath}/loop1_extra/setpoint_slew_rate nxalias "${name}_loop1_extra_setpoint_slew_rate"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/loop1_extra/setpoint_slew_rate 1
|
||||
${sct_controller} write ${scobj_hpath}/loop1_extra/setpoint_slew_rate
|
||||
hsetprop ${scobj_hpath}/loop1_extra/setpoint_slew_rate simulated false
|
||||
} else {
|
||||
::scobj::eurotherm_3200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for eurotherm_3200"
|
||||
hsetprop ${scobj_hpath}/loop1_extra/setpoint_slew_rate simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/loop1_extra/working_output plain user float
|
||||
hsetprop ${scobj_hpath}/loop1_extra/working_output read ${ns}::getValue ${scobj_hpath} rdValue {4}
|
||||
hsetprop ${scobj_hpath}/loop1_extra/working_output rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -421,6 +503,14 @@ proc ::scobj::eurotherm_3200::mkDriver { sct_controller name device_class simula
|
||||
hsetprop ${scobj_hpath}/loop1_extra/working_output type "part"
|
||||
hsetprop ${scobj_hpath}/loop1_extra/working_output nxalias "${name}_loop1_extra_working_output"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/loop1_extra/working_output 1
|
||||
hsetprop ${scobj_hpath}/loop1_extra/working_output simulated false
|
||||
} else {
|
||||
::scobj::eurotherm_3200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for eurotherm_3200"
|
||||
hsetprop ${scobj_hpath}/loop1_extra/working_output simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/loop1_extra/working_setpoint plain user float
|
||||
hsetprop ${scobj_hpath}/loop1_extra/working_setpoint read ${ns}::getValue ${scobj_hpath} rdValue {5}
|
||||
hsetprop ${scobj_hpath}/loop1_extra/working_setpoint rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -434,30 +524,17 @@ proc ::scobj::eurotherm_3200::mkDriver { sct_controller name device_class simula
|
||||
hsetprop ${scobj_hpath}/loop1_extra/working_setpoint nxalias "${name}_loop1_extra_working_setpoint"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/loop1_extra/active_setpoint 1
|
||||
${sct_controller} poll ${scobj_hpath}/loop1_extra/alarm1_thresh 1
|
||||
${sct_controller} poll ${scobj_hpath}/loop1_extra/alarm2_thresh 1
|
||||
${sct_controller} poll ${scobj_hpath}/loop1_extra/manual_output 1
|
||||
${sct_controller} poll ${scobj_hpath}/loop1_extra/power_limit_high 1
|
||||
${sct_controller} poll ${scobj_hpath}/loop1_extra/power_limit_low 1
|
||||
${sct_controller} poll ${scobj_hpath}/loop1_extra/power_slew_rate 1
|
||||
${sct_controller} poll ${scobj_hpath}/loop1_extra/setpoint_slew_rate 1
|
||||
${sct_controller} poll ${scobj_hpath}/loop1_extra/working_output 1
|
||||
${sct_controller} poll ${scobj_hpath}/loop1_extra/working_setpoint 1
|
||||
${sct_controller} write ${scobj_hpath}/loop1_extra/alarm1_thresh
|
||||
${sct_controller} write ${scobj_hpath}/loop1_extra/alarm2_thresh
|
||||
${sct_controller} write ${scobj_hpath}/loop1_extra/power_limit_high
|
||||
${sct_controller} write ${scobj_hpath}/loop1_extra/power_limit_low
|
||||
${sct_controller} write ${scobj_hpath}/loop1_extra/power_slew_rate
|
||||
${sct_controller} write ${scobj_hpath}/loop1_extra/setpoint_slew_rate
|
||||
hsetprop ${scobj_hpath}/loop1_extra/working_setpoint simulated false
|
||||
} else {
|
||||
::scobj::eurotherm_3200::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for eurotherm_3200"
|
||||
hsetprop ${scobj_hpath}/loop1_extra/working_setpoint simulated true
|
||||
}
|
||||
hsetprop ${scobj_hpath}/loop1_extra data "false"
|
||||
hsetprop ${scobj_hpath}/loop1_extra klass "@none"
|
||||
hsetprop ${scobj_hpath}/loop1_extra type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/util plain spy none
|
||||
hsetprop ${scobj_hpath}/util data "false"
|
||||
hsetprop ${scobj_hpath}/util klass "@none"
|
||||
hsetprop ${scobj_hpath}/util type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/util/mode plain user text
|
||||
hsetprop ${scobj_hpath}/util/mode control false
|
||||
@@ -481,12 +558,12 @@ proc ::scobj::eurotherm_3200::mkDriver { sct_controller name device_class simula
|
||||
hsetprop ${scobj_hpath}/util/unit sdsinfo "::nexus::scobj::sdsinfo"
|
||||
hsetprop ${scobj_hpath}/util/unit type "part"
|
||||
hsetprop ${scobj_hpath}/util/unit nxalias "${name}_util_unit"
|
||||
hsetprop ${scobj_hpath}/util data "false"
|
||||
hsetprop ${scobj_hpath}/util klass "@none"
|
||||
hsetprop ${scobj_hpath}/util type "part"
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
hsetprop ${scobj_hpath} debug_threshold 5
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
ansto_makesctdrive ${name}_loop1_setpoint ${scobj_hpath}/loop1/setpoint ${scobj_hpath}/loop1/sensor ${sct_controller}
|
||||
}
|
||||
# mkDriver hook code goes here
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
@@ -504,7 +581,9 @@ proc ::scobj::eurotherm_3200::add_driver {name device_class simulation_flag ip_a
|
||||
makesctcontroller sct_${name} modbus_ap ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::eurotherm_3200::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for eurotherm_3200"
|
||||
::scobj::eurotherm_3200::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for eurotherm_3200"
|
||||
::scobj::eurotherm_3200::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
}
|
||||
::scobj::eurotherm_3200::sics_log 1 "::scobj::eurotherm_3200::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
|
||||
::scobj::eurotherm_3200::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}
|
||||
@@ -522,7 +601,7 @@ namespace eval ::scobj::eurotherm_3200 {
|
||||
|
||||
proc add_eurotherm_3200 {name ip_address tcp_port id datype dev_id tol} {
|
||||
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
|
||||
::scobj::eurotherm_3200::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${id}" "${datype}" "${dev_id}" "${tol}"
|
||||
::scobj::eurotherm_3200::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_eurotherm_3200.tcl"
|
||||
@@ -561,20 +640,31 @@ proc ::scobj::eurotherm_3200::read_config {} {
|
||||
if { ![string equal -nocase "${simulation_flag}" "false"] } {
|
||||
set asyncqueue "null"
|
||||
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
|
||||
${ns}::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
} elseif { [dict exists $v "asyncqueue"] } {
|
||||
set asyncqueue [dict get $v "asyncqueue"]
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
set ip_address [dict get $v ip]
|
||||
set tcp_port [dict get $v port]
|
||||
}
|
||||
makesctcontroller sct_${name} modbus_ap ${ip_address}:${tcp_port}
|
||||
} else {
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
} else {
|
||||
if { [dict exists $v "asyncprotocol"] } {
|
||||
set asyncprotocol [dict get $v "asyncprotocol"]
|
||||
} else {
|
||||
set asyncprotocol ${name}_protocol
|
||||
MakeAsyncProtocol ${asyncprotocol}
|
||||
if { [dict exists $v "terminator"] } {
|
||||
if { [dict exists $v "sendterminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "sendterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
if { [dict exists $v "replyterminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "replyterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
}
|
||||
@@ -585,6 +675,7 @@ proc ::scobj::eurotherm_3200::read_config {} {
|
||||
if { [dict exists $v "timeout"] } {
|
||||
${asyncqueue} timeout "[dict get $v "timeout"]"
|
||||
}
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
set arg_list [list]
|
||||
set missing_list [list]
|
||||
@@ -601,11 +692,7 @@ proc ::scobj::eurotherm_3200::read_config {} {
|
||||
if { [llength $missing_list] > 0 } {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,9 @@ proc ::scobj::eurotherm_m2000::add_driver {name device_class simulation_flag ip_
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::eurotherm_m2000::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for eurotherm_m2000"
|
||||
::scobj::eurotherm_m2000::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for eurotherm_m2000"
|
||||
::scobj::eurotherm_m2000::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
}
|
||||
::scobj::eurotherm_m2000::sics_log 1 "::scobj::eurotherm_m2000::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
|
||||
::scobj::eurotherm_m2000::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}
|
||||
@@ -78,7 +80,7 @@ namespace eval ::scobj::eurotherm_m2000 {
|
||||
|
||||
proc add_eurotherm_m2000 {name ip_address tcp_port id datype dev_id tol} {
|
||||
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
|
||||
::scobj::eurotherm_m2000::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${id}" "${datype}" "${dev_id}" "${tol}"
|
||||
::scobj::eurotherm_m2000::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_eurotherm_m2000.tcl"
|
||||
@@ -117,20 +119,31 @@ proc ::scobj::eurotherm_m2000::read_config {} {
|
||||
if { ![string equal -nocase "${simulation_flag}" "false"] } {
|
||||
set asyncqueue "null"
|
||||
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
|
||||
${ns}::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
} elseif { [dict exists $v "asyncqueue"] } {
|
||||
set asyncqueue [dict get $v "asyncqueue"]
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
set ip_address [dict get $v ip]
|
||||
set tcp_port [dict get $v port]
|
||||
}
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
} else {
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
} else {
|
||||
if { [dict exists $v "asyncprotocol"] } {
|
||||
set asyncprotocol [dict get $v "asyncprotocol"]
|
||||
} else {
|
||||
set asyncprotocol ${name}_protocol
|
||||
MakeAsyncProtocol ${asyncprotocol}
|
||||
if { [dict exists $v "terminator"] } {
|
||||
if { [dict exists $v "sendterminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "sendterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
if { [dict exists $v "replyterminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "replyterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
}
|
||||
@@ -141,6 +154,7 @@ proc ::scobj::eurotherm_m2000::read_config {} {
|
||||
if { [dict exists $v "timeout"] } {
|
||||
${asyncqueue} timeout "[dict get $v "timeout"]"
|
||||
}
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
set arg_list [list]
|
||||
set missing_list [list]
|
||||
@@ -157,11 +171,7 @@ proc ::scobj::eurotherm_m2000::read_config {} {
|
||||
if { [llength $missing_list] > 0 } {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,12 @@ proc ::scobj::julabo_lh45_gen::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}"
|
||||
hupdateif ${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] } {
|
||||
@@ -389,6 +394,14 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name device_class simul
|
||||
hsetprop ${scobj_hpath}/heating_power_percent type "part"
|
||||
hsetprop ${scobj_hpath}/heating_power_percent nxalias "${name}_heating_power_percent"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/heating_power_percent 1
|
||||
hsetprop ${scobj_hpath}/heating_power_percent simulated false
|
||||
} else {
|
||||
::scobj::julabo_lh45_gen::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for julabo_lh45_gen"
|
||||
hsetprop ${scobj_hpath}/heating_power_percent simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/lh45_lasterror plain user text
|
||||
hsetprop ${scobj_hpath}/lh45_lasterror control true
|
||||
hsetprop ${scobj_hpath}/lh45_lasterror data true
|
||||
@@ -413,6 +426,14 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name device_class simul
|
||||
hsetprop ${scobj_hpath}/lh45_state type "part"
|
||||
hsetprop ${scobj_hpath}/lh45_state nxalias "${name}_lh45_state"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/lh45_state 1
|
||||
hsetprop ${scobj_hpath}/lh45_state simulated false
|
||||
} else {
|
||||
::scobj::julabo_lh45_gen::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for julabo_lh45_gen"
|
||||
hsetprop ${scobj_hpath}/lh45_state simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/overtemp_warnlimit plain user float
|
||||
hsetprop ${scobj_hpath}/overtemp_warnlimit read ${ns}::getValue ${scobj_hpath} rdValue {in_sp_03}
|
||||
hsetprop ${scobj_hpath}/overtemp_warnlimit rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -426,6 +447,14 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name device_class simul
|
||||
hsetprop ${scobj_hpath}/overtemp_warnlimit type "part"
|
||||
hsetprop ${scobj_hpath}/overtemp_warnlimit nxalias "${name}_overtemp_warnlimit"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/overtemp_warnlimit 1
|
||||
hsetprop ${scobj_hpath}/overtemp_warnlimit simulated false
|
||||
} else {
|
||||
::scobj::julabo_lh45_gen::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for julabo_lh45_gen"
|
||||
hsetprop ${scobj_hpath}/overtemp_warnlimit simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/remote_ctrl plain spy text
|
||||
hsetprop ${scobj_hpath}/remote_ctrl control true
|
||||
hsetprop ${scobj_hpath}/remote_ctrl data true
|
||||
@@ -464,6 +493,15 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name device_class simul
|
||||
hsetprop ${scobj_hpath}/setpoint units "C"
|
||||
hsetprop ${scobj_hpath}/setpoint nxalias "${name}_setpoint"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/setpoint 1
|
||||
${sct_controller} write ${scobj_hpath}/setpoint
|
||||
hsetprop ${scobj_hpath}/setpoint simulated false
|
||||
} else {
|
||||
::scobj::julabo_lh45_gen::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for julabo_lh45_gen"
|
||||
hsetprop ${scobj_hpath}/setpoint simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/subtemp_warnlimit plain user float
|
||||
hsetprop ${scobj_hpath}/subtemp_warnlimit read ${ns}::getValue ${scobj_hpath} rdValue {in_sp_04}
|
||||
hsetprop ${scobj_hpath}/subtemp_warnlimit rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -477,25 +515,20 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name device_class simul
|
||||
hsetprop ${scobj_hpath}/subtemp_warnlimit type "part"
|
||||
hsetprop ${scobj_hpath}/subtemp_warnlimit nxalias "${name}_subtemp_warnlimit"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/subtemp_warnlimit 1
|
||||
hsetprop ${scobj_hpath}/subtemp_warnlimit simulated false
|
||||
} else {
|
||||
::scobj::julabo_lh45_gen::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for julabo_lh45_gen"
|
||||
hsetprop ${scobj_hpath}/subtemp_warnlimit simulated true
|
||||
}
|
||||
|
||||
hsetprop ${scobj_hpath} data "true"
|
||||
hsetprop ${scobj_hpath} klass "@none"
|
||||
hsetprop ${scobj_hpath} type "part"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/heating_power_percent 1
|
||||
${sct_controller} poll ${scobj_hpath}/lh45_state 1
|
||||
${sct_controller} poll ${scobj_hpath}/overtemp_warnlimit 1
|
||||
${sct_controller} poll ${scobj_hpath}/setpoint 1
|
||||
${sct_controller} poll ${scobj_hpath}/subtemp_warnlimit 1
|
||||
${sct_controller} write ${scobj_hpath}/setpoint
|
||||
} else {
|
||||
::scobj::julabo_lh45_gen::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for julabo_lh45_gen"
|
||||
}
|
||||
ansto_makesctdrive ${name}_setpoint ${scobj_hpath}/setpoint ${scobj_hpath}/sensor/value ${sct_controller}
|
||||
|
||||
hfactory ${scobj_hpath}/mode plain spy none
|
||||
hsetprop ${scobj_hpath}/mode data "true"
|
||||
hsetprop ${scobj_hpath}/mode klass "@none"
|
||||
hsetprop ${scobj_hpath}/mode type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/mode/ext_else_bath plain user int
|
||||
hsetprop ${scobj_hpath}/mode/ext_else_bath read ${ns}::getValue ${scobj_hpath} rdValue {in_mode_04}
|
||||
@@ -513,6 +546,15 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name device_class simul
|
||||
hsetprop ${scobj_hpath}/mode/ext_else_bath type "part"
|
||||
hsetprop ${scobj_hpath}/mode/ext_else_bath nxalias "${name}_mode_ext_else_bath"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/mode/ext_else_bath 1
|
||||
${sct_controller} write ${scobj_hpath}/mode/ext_else_bath
|
||||
hsetprop ${scobj_hpath}/mode/ext_else_bath simulated false
|
||||
} else {
|
||||
::scobj::julabo_lh45_gen::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for julabo_lh45_gen"
|
||||
hsetprop ${scobj_hpath}/mode/ext_else_bath simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/mode/on_else_off plain user int
|
||||
hsetprop ${scobj_hpath}/mode/on_else_off read ${ns}::getValue ${scobj_hpath} rdValue {in_mode_05}
|
||||
hsetprop ${scobj_hpath}/mode/on_else_off rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -530,18 +572,18 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name device_class simul
|
||||
hsetprop ${scobj_hpath}/mode/on_else_off nxalias "${name}_mode_on_else_off"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/mode/ext_else_bath 1
|
||||
${sct_controller} poll ${scobj_hpath}/mode/on_else_off 1
|
||||
${sct_controller} write ${scobj_hpath}/mode/ext_else_bath
|
||||
${sct_controller} write ${scobj_hpath}/mode/on_else_off
|
||||
hsetprop ${scobj_hpath}/mode/on_else_off simulated false
|
||||
} else {
|
||||
::scobj::julabo_lh45_gen::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for julabo_lh45_gen"
|
||||
hsetprop ${scobj_hpath}/mode/on_else_off simulated true
|
||||
}
|
||||
hsetprop ${scobj_hpath}/mode data "true"
|
||||
hsetprop ${scobj_hpath}/mode klass "@none"
|
||||
hsetprop ${scobj_hpath}/mode type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/sensor plain spy none
|
||||
hsetprop ${scobj_hpath}/sensor data "true"
|
||||
hsetprop ${scobj_hpath}/sensor klass "@none"
|
||||
hsetprop ${scobj_hpath}/sensor type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/sensor/bathtemp plain internal float
|
||||
hsetprop ${scobj_hpath}/sensor/bathtemp read ${ns}::getValue ${scobj_hpath} rdSensor {in_pv_00}
|
||||
@@ -558,6 +600,14 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name device_class simul
|
||||
hsetprop ${scobj_hpath}/sensor/bathtemp units "C"
|
||||
hsetprop ${scobj_hpath}/sensor/bathtemp nxalias "${name}_sensor_bathtemp"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/sensor/bathtemp 1
|
||||
hsetprop ${scobj_hpath}/sensor/bathtemp simulated false
|
||||
} else {
|
||||
::scobj::julabo_lh45_gen::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for julabo_lh45_gen"
|
||||
hsetprop ${scobj_hpath}/sensor/bathtemp simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/sensor/end_temperature plain internal float
|
||||
hsetprop ${scobj_hpath}/sensor/end_temperature control true
|
||||
hsetprop ${scobj_hpath}/sensor/end_temperature data true
|
||||
@@ -585,6 +635,14 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name device_class simul
|
||||
hsetprop ${scobj_hpath}/sensor/external units "C"
|
||||
hsetprop ${scobj_hpath}/sensor/external nxalias "${name}_sensor_external"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/sensor/external 1
|
||||
hsetprop ${scobj_hpath}/sensor/external simulated false
|
||||
} else {
|
||||
::scobj::julabo_lh45_gen::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for julabo_lh45_gen"
|
||||
hsetprop ${scobj_hpath}/sensor/external simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/sensor/start_temperature plain internal float
|
||||
hsetprop ${scobj_hpath}/sensor/start_temperature control true
|
||||
hsetprop ${scobj_hpath}/sensor/start_temperature data true
|
||||
@@ -610,19 +668,12 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name device_class simul
|
||||
hsetprop ${scobj_hpath}/sensor/value type "part"
|
||||
hsetprop ${scobj_hpath}/sensor/value units "C"
|
||||
hsetprop ${scobj_hpath}/sensor/value nxalias "${name}_sensor_value"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/sensor/bathtemp 1
|
||||
${sct_controller} poll ${scobj_hpath}/sensor/external 1
|
||||
} else {
|
||||
::scobj::julabo_lh45_gen::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for julabo_lh45_gen"
|
||||
}
|
||||
hsetprop ${scobj_hpath}/sensor data "true"
|
||||
hsetprop ${scobj_hpath}/sensor klass "@none"
|
||||
hsetprop ${scobj_hpath}/sensor type "part"
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
hsetprop ${scobj_hpath} debug_threshold 5
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
ansto_makesctdrive ${name}_setpoint ${scobj_hpath}/setpoint ${scobj_hpath}/sensor/value ${sct_controller}
|
||||
}
|
||||
# mkDriver hook code starts
|
||||
if { ${ctrl_sensor} == "external" } {
|
||||
hset ${scobj_hpath}/mode/ext_else_bath 1
|
||||
@@ -647,7 +698,9 @@ proc ::scobj::julabo_lh45_gen::add_driver {name device_class simulation_flag ip_
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port} "\r"
|
||||
}
|
||||
} else {
|
||||
::scobj::julabo_lh45_gen::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for julabo_lh45_gen"
|
||||
::scobj::julabo_lh45_gen::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for julabo_lh45_gen"
|
||||
::scobj::julabo_lh45_gen::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
}
|
||||
::scobj::julabo_lh45_gen::sics_log 1 "::scobj::julabo_lh45_gen::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${ctrl_sensor} ${tol}"
|
||||
::scobj::julabo_lh45_gen::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${ctrl_sensor} ${tol}
|
||||
@@ -665,7 +718,7 @@ namespace eval ::scobj::julabo_lh45_gen {
|
||||
|
||||
proc add_julabo_lh45_gen {name ip_address tcp_port {id 1} {ctrl_sensor "bath"} {tol 5.0}} {
|
||||
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
|
||||
::scobj::julabo_lh45_gen::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${{id}" "${1}}" "${{ctrl_sensor}" "${"bath"}}" "${{tol}" "${5.0}}"
|
||||
::scobj::julabo_lh45_gen::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${ctrl_sensor} ${tol}
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_julabo_lh45_gen.tcl"
|
||||
@@ -704,20 +757,50 @@ proc ::scobj::julabo_lh45_gen::read_config {} {
|
||||
if { ![string equal -nocase "${simulation_flag}" "false"] } {
|
||||
set asyncqueue "null"
|
||||
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
|
||||
${ns}::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
} elseif { [dict exists $v "asyncqueue"] } {
|
||||
set asyncqueue [dict get $v "asyncqueue"]
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
set ip_address [dict get $v ip]
|
||||
set tcp_port [dict get $v port]
|
||||
set arg_list [list]
|
||||
set missing_list [list]
|
||||
array unset default_map
|
||||
array set default_map [list terminator "\r"]
|
||||
foreach arg {terminator} {
|
||||
if {[dict exists $u $arg]} {
|
||||
lappend arg_list "[dict get $u $arg]"
|
||||
} elseif {[dict exists $v $arg]} {
|
||||
lappend arg_list "[dict get $v $arg]"
|
||||
} elseif {[info exists default_map($arg)]} {
|
||||
lappend arg_list $default_map($arg)
|
||||
} else {
|
||||
${ns}::sics_log 9 "Missing configuration value $arg"
|
||||
lappend missing_list $arg
|
||||
}
|
||||
}
|
||||
if { [llength $missing_list] > 0 } {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
} else {
|
||||
if { [dict exists $v "asyncprotocol"] } {
|
||||
set asyncprotocol [dict get $v "asyncprotocol"]
|
||||
} else {
|
||||
set asyncprotocol ${name}_protocol
|
||||
MakeAsyncProtocol ${asyncprotocol}
|
||||
if { [dict exists $v "terminator"] } {
|
||||
if { [dict exists $v "sendterminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "sendterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
if { [dict exists $v "replyterminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "replyterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
}
|
||||
@@ -728,6 +811,7 @@ proc ::scobj::julabo_lh45_gen::read_config {} {
|
||||
if { [dict exists $v "timeout"] } {
|
||||
${asyncqueue} timeout "[dict get $v "timeout"]"
|
||||
}
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
set arg_list [list]
|
||||
set missing_list [list]
|
||||
@@ -744,11 +828,7 @@ proc ::scobj::julabo_lh45_gen::read_config {} {
|
||||
if { [llength $missing_list] > 0 } {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,20 +182,19 @@ proc ::scobj::lakeshore_218::mkDriver { sct_controller name device_class simulat
|
||||
hsetprop ${scobj_hpath}/krdg type "part"
|
||||
hsetprop ${scobj_hpath}/krdg nxalias "${name}_krdg"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/krdg 1
|
||||
hsetprop ${scobj_hpath}/krdg simulated false
|
||||
} else {
|
||||
::scobj::lakeshore_218::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for lakeshore_218"
|
||||
hsetprop ${scobj_hpath}/krdg simulated true
|
||||
}
|
||||
|
||||
hsetprop ${scobj_hpath} data "false"
|
||||
hsetprop ${scobj_hpath} klass "@none"
|
||||
hsetprop ${scobj_hpath} type "part"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/krdg 1
|
||||
} else {
|
||||
::scobj::lakeshore_218::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for lakeshore_218"
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/sensor plain spy none
|
||||
hsetprop ${scobj_hpath}/sensor data "true"
|
||||
hsetprop ${scobj_hpath}/sensor klass "@none"
|
||||
hsetprop ${scobj_hpath}/sensor type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/sensor/ch1 plain user float
|
||||
hsetprop ${scobj_hpath}/sensor/ch1 read ${ns}::getTemp ${scobj_hpath} rdValue {0}
|
||||
@@ -210,6 +209,14 @@ proc ::scobj::lakeshore_218::mkDriver { sct_controller name device_class simulat
|
||||
hsetprop ${scobj_hpath}/sensor/ch1 type "part"
|
||||
hsetprop ${scobj_hpath}/sensor/ch1 nxalias "${name}_sensor_ch1"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/sensor/ch1 1
|
||||
hsetprop ${scobj_hpath}/sensor/ch1 simulated false
|
||||
} else {
|
||||
::scobj::lakeshore_218::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for lakeshore_218"
|
||||
hsetprop ${scobj_hpath}/sensor/ch1 simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/sensor/ch2 plain user float
|
||||
hsetprop ${scobj_hpath}/sensor/ch2 read ${ns}::getTemp ${scobj_hpath} rdValue {1}
|
||||
hsetprop ${scobj_hpath}/sensor/ch2 rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -223,6 +230,14 @@ proc ::scobj::lakeshore_218::mkDriver { sct_controller name device_class simulat
|
||||
hsetprop ${scobj_hpath}/sensor/ch2 type "part"
|
||||
hsetprop ${scobj_hpath}/sensor/ch2 nxalias "${name}_sensor_ch2"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/sensor/ch2 1
|
||||
hsetprop ${scobj_hpath}/sensor/ch2 simulated false
|
||||
} else {
|
||||
::scobj::lakeshore_218::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for lakeshore_218"
|
||||
hsetprop ${scobj_hpath}/sensor/ch2 simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/sensor/ch3 plain user float
|
||||
hsetprop ${scobj_hpath}/sensor/ch3 read ${ns}::getTemp ${scobj_hpath} rdValue {2}
|
||||
hsetprop ${scobj_hpath}/sensor/ch3 rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -236,6 +251,14 @@ proc ::scobj::lakeshore_218::mkDriver { sct_controller name device_class simulat
|
||||
hsetprop ${scobj_hpath}/sensor/ch3 type "part"
|
||||
hsetprop ${scobj_hpath}/sensor/ch3 nxalias "${name}_sensor_ch3"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/sensor/ch3 1
|
||||
hsetprop ${scobj_hpath}/sensor/ch3 simulated false
|
||||
} else {
|
||||
::scobj::lakeshore_218::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for lakeshore_218"
|
||||
hsetprop ${scobj_hpath}/sensor/ch3 simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/sensor/ch4 plain user float
|
||||
hsetprop ${scobj_hpath}/sensor/ch4 read ${ns}::getTemp ${scobj_hpath} rdValue {3}
|
||||
hsetprop ${scobj_hpath}/sensor/ch4 rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -249,6 +272,14 @@ proc ::scobj::lakeshore_218::mkDriver { sct_controller name device_class simulat
|
||||
hsetprop ${scobj_hpath}/sensor/ch4 type "part"
|
||||
hsetprop ${scobj_hpath}/sensor/ch4 nxalias "${name}_sensor_ch4"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/sensor/ch4 1
|
||||
hsetprop ${scobj_hpath}/sensor/ch4 simulated false
|
||||
} else {
|
||||
::scobj::lakeshore_218::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for lakeshore_218"
|
||||
hsetprop ${scobj_hpath}/sensor/ch4 simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/sensor/ch5 plain user float
|
||||
hsetprop ${scobj_hpath}/sensor/ch5 read ${ns}::getTemp ${scobj_hpath} rdValue {4}
|
||||
hsetprop ${scobj_hpath}/sensor/ch5 rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -262,6 +293,14 @@ proc ::scobj::lakeshore_218::mkDriver { sct_controller name device_class simulat
|
||||
hsetprop ${scobj_hpath}/sensor/ch5 type "part"
|
||||
hsetprop ${scobj_hpath}/sensor/ch5 nxalias "${name}_sensor_ch5"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/sensor/ch5 1
|
||||
hsetprop ${scobj_hpath}/sensor/ch5 simulated false
|
||||
} else {
|
||||
::scobj::lakeshore_218::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for lakeshore_218"
|
||||
hsetprop ${scobj_hpath}/sensor/ch5 simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/sensor/ch6 plain user float
|
||||
hsetprop ${scobj_hpath}/sensor/ch6 read ${ns}::getTemp ${scobj_hpath} rdValue {5}
|
||||
hsetprop ${scobj_hpath}/sensor/ch6 rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -275,6 +314,14 @@ proc ::scobj::lakeshore_218::mkDriver { sct_controller name device_class simulat
|
||||
hsetprop ${scobj_hpath}/sensor/ch6 type "part"
|
||||
hsetprop ${scobj_hpath}/sensor/ch6 nxalias "${name}_sensor_ch6"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/sensor/ch6 1
|
||||
hsetprop ${scobj_hpath}/sensor/ch6 simulated false
|
||||
} else {
|
||||
::scobj::lakeshore_218::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for lakeshore_218"
|
||||
hsetprop ${scobj_hpath}/sensor/ch6 simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/sensor/ch7 plain user float
|
||||
hsetprop ${scobj_hpath}/sensor/ch7 read ${ns}::getTemp ${scobj_hpath} rdValue {6}
|
||||
hsetprop ${scobj_hpath}/sensor/ch7 rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -288,6 +335,14 @@ proc ::scobj::lakeshore_218::mkDriver { sct_controller name device_class simulat
|
||||
hsetprop ${scobj_hpath}/sensor/ch7 type "part"
|
||||
hsetprop ${scobj_hpath}/sensor/ch7 nxalias "${name}_sensor_ch7"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/sensor/ch7 1
|
||||
hsetprop ${scobj_hpath}/sensor/ch7 simulated false
|
||||
} else {
|
||||
::scobj::lakeshore_218::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for lakeshore_218"
|
||||
hsetprop ${scobj_hpath}/sensor/ch7 simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/sensor/ch8 plain user float
|
||||
hsetprop ${scobj_hpath}/sensor/ch8 read ${ns}::getTemp ${scobj_hpath} rdValue {7}
|
||||
hsetprop ${scobj_hpath}/sensor/ch8 rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -302,17 +357,15 @@ proc ::scobj::lakeshore_218::mkDriver { sct_controller name device_class simulat
|
||||
hsetprop ${scobj_hpath}/sensor/ch8 nxalias "${name}_sensor_ch8"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/sensor/ch1 1
|
||||
${sct_controller} poll ${scobj_hpath}/sensor/ch2 1
|
||||
${sct_controller} poll ${scobj_hpath}/sensor/ch3 1
|
||||
${sct_controller} poll ${scobj_hpath}/sensor/ch4 1
|
||||
${sct_controller} poll ${scobj_hpath}/sensor/ch5 1
|
||||
${sct_controller} poll ${scobj_hpath}/sensor/ch6 1
|
||||
${sct_controller} poll ${scobj_hpath}/sensor/ch7 1
|
||||
${sct_controller} poll ${scobj_hpath}/sensor/ch8 1
|
||||
hsetprop ${scobj_hpath}/sensor/ch8 simulated false
|
||||
} else {
|
||||
::scobj::lakeshore_218::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for lakeshore_218"
|
||||
hsetprop ${scobj_hpath}/sensor/ch8 simulated true
|
||||
}
|
||||
hsetprop ${scobj_hpath}/sensor data "true"
|
||||
hsetprop ${scobj_hpath}/sensor klass "@none"
|
||||
hsetprop ${scobj_hpath}/sensor type "part"
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
hsetprop ${scobj_hpath} debug_threshold 5
|
||||
@@ -333,7 +386,9 @@ proc ::scobj::lakeshore_218::add_driver {name device_class simulation_flag ip_ad
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::lakeshore_218::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for lakeshore_218"
|
||||
::scobj::lakeshore_218::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for lakeshore_218"
|
||||
::scobj::lakeshore_218::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
}
|
||||
::scobj::lakeshore_218::sics_log 1 "::scobj::lakeshore_218::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}"
|
||||
::scobj::lakeshore_218::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}
|
||||
@@ -351,7 +406,7 @@ namespace eval ::scobj::lakeshore_218 {
|
||||
|
||||
proc add_lakeshore_218 {name ip_address tcp_port} {
|
||||
set simulation_flag "[string tolower [SplitReply [detector_simulation]]]"
|
||||
::scobj::lakeshore_218::add_driver ${name} "NXdetector" "${simulation_flag}" ${ip_address} ${tcp_port}
|
||||
::scobj::lakeshore_218::add_driver ${name} "NXdetector" ${simulation_flag} ${ip_address} ${tcp_port}
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_lakeshore_218.tcl"
|
||||
@@ -390,20 +445,31 @@ proc ::scobj::lakeshore_218::read_config {} {
|
||||
if { ![string equal -nocase "${simulation_flag}" "false"] } {
|
||||
set asyncqueue "null"
|
||||
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
|
||||
${ns}::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
} elseif { [dict exists $v "asyncqueue"] } {
|
||||
set asyncqueue [dict get $v "asyncqueue"]
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
set ip_address [dict get $v ip]
|
||||
set tcp_port [dict get $v port]
|
||||
}
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
} else {
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
} else {
|
||||
if { [dict exists $v "asyncprotocol"] } {
|
||||
set asyncprotocol [dict get $v "asyncprotocol"]
|
||||
} else {
|
||||
set asyncprotocol ${name}_protocol
|
||||
MakeAsyncProtocol ${asyncprotocol}
|
||||
if { [dict exists $v "terminator"] } {
|
||||
if { [dict exists $v "sendterminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "sendterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
if { [dict exists $v "replyterminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "replyterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
}
|
||||
@@ -414,12 +480,9 @@ proc ::scobj::lakeshore_218::read_config {} {
|
||||
if { [dict exists $v "timeout"] } {
|
||||
${asyncqueue} timeout "[dict get $v "timeout"]"
|
||||
}
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}
|
||||
} else {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue}
|
||||
}
|
||||
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,9 @@ proc ::scobj::lakeshore_m370::add_driver {name device_class simulation_flag ip_a
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::lakeshore_m370::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for lakeshore_m370"
|
||||
::scobj::lakeshore_m370::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for lakeshore_m370"
|
||||
::scobj::lakeshore_m370::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
}
|
||||
::scobj::lakeshore_m370::sics_log 1 "::scobj::lakeshore_m370::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${tol}"
|
||||
::scobj::lakeshore_m370::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${tol}
|
||||
@@ -82,7 +84,7 @@ namespace eval ::scobj::lakeshore_m370 {
|
||||
|
||||
proc add_lakeshore_m370 {name ip_address tcp_port id tol} {
|
||||
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
|
||||
::scobj::lakeshore_m370::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${id}" "${tol}"
|
||||
::scobj::lakeshore_m370::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${tol}
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_lakeshore_m370.tcl"
|
||||
@@ -121,20 +123,31 @@ proc ::scobj::lakeshore_m370::read_config {} {
|
||||
if { ![string equal -nocase "${simulation_flag}" "false"] } {
|
||||
set asyncqueue "null"
|
||||
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
|
||||
${ns}::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
} elseif { [dict exists $v "asyncqueue"] } {
|
||||
set asyncqueue [dict get $v "asyncqueue"]
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
set ip_address [dict get $v ip]
|
||||
set tcp_port [dict get $v port]
|
||||
}
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
} else {
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
} else {
|
||||
if { [dict exists $v "asyncprotocol"] } {
|
||||
set asyncprotocol [dict get $v "asyncprotocol"]
|
||||
} else {
|
||||
set asyncprotocol ${name}_protocol
|
||||
MakeAsyncProtocol ${asyncprotocol}
|
||||
if { [dict exists $v "terminator"] } {
|
||||
if { [dict exists $v "sendterminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "sendterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
if { [dict exists $v "replyterminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "replyterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
}
|
||||
@@ -145,6 +158,7 @@ proc ::scobj::lakeshore_m370::read_config {} {
|
||||
if { [dict exists $v "timeout"] } {
|
||||
${asyncqueue} timeout "[dict get $v "timeout"]"
|
||||
}
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
set arg_list [list]
|
||||
set missing_list [list]
|
||||
@@ -161,11 +175,7 @@ proc ::scobj::lakeshore_m370::read_config {} {
|
||||
if { [llength $missing_list] > 0 } {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,9 @@ proc ::scobj::ls336::add_driver {name device_class simulation_flag ip_address tc
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::ls336::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for ls336"
|
||||
::scobj::ls336::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for ls336"
|
||||
::scobj::ls336::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
}
|
||||
::scobj::ls336::sics_log 1 "::scobj::ls336::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${tol1} ${tol2}"
|
||||
::scobj::ls336::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${tol1} ${tol2}
|
||||
@@ -78,7 +80,7 @@ namespace eval ::scobj::ls336 {
|
||||
|
||||
proc add_ls336 {name ip_address tcp_port id datype {tol1 1.0} {tol2 1.0}} {
|
||||
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
|
||||
::scobj::ls336::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${id}" "${datype}" "${{tol1}" "${1.0}}" "${{tol2}" "${1.0}}"
|
||||
::scobj::ls336::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${tol1} ${tol2}
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_ls336.tcl"
|
||||
@@ -117,20 +119,31 @@ proc ::scobj::ls336::read_config {} {
|
||||
if { ![string equal -nocase "${simulation_flag}" "false"] } {
|
||||
set asyncqueue "null"
|
||||
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
|
||||
${ns}::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
} elseif { [dict exists $v "asyncqueue"] } {
|
||||
set asyncqueue [dict get $v "asyncqueue"]
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
set ip_address [dict get $v ip]
|
||||
set tcp_port [dict get $v port]
|
||||
}
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
} else {
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
} else {
|
||||
if { [dict exists $v "asyncprotocol"] } {
|
||||
set asyncprotocol [dict get $v "asyncprotocol"]
|
||||
} else {
|
||||
set asyncprotocol ${name}_protocol
|
||||
MakeAsyncProtocol ${asyncprotocol}
|
||||
if { [dict exists $v "terminator"] } {
|
||||
if { [dict exists $v "sendterminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "sendterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
if { [dict exists $v "replyterminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "replyterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
}
|
||||
@@ -141,6 +154,7 @@ proc ::scobj::ls336::read_config {} {
|
||||
if { [dict exists $v "timeout"] } {
|
||||
${asyncqueue} timeout "[dict get $v "timeout"]"
|
||||
}
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
set arg_list [list]
|
||||
set missing_list [list]
|
||||
@@ -157,11 +171,7 @@ proc ::scobj::ls336::read_config {} {
|
||||
if { [llength $missing_list] > 0 } {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,9 @@ proc ::scobj::ls340::add_driver {name device_class simulation_flag ip_address tc
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::ls340::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for ls340"
|
||||
::scobj::ls340::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for ls340"
|
||||
::scobj::ls340::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
}
|
||||
::scobj::ls340::sics_log 1 "::scobj::ls340::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${tol1} ${tol2}"
|
||||
::scobj::ls340::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${tol1} ${tol2}
|
||||
@@ -78,7 +80,7 @@ namespace eval ::scobj::ls340 {
|
||||
|
||||
proc add_ls340 {name ip_address tcp_port id datype {tol1 1.0} {tol2 1.0}} {
|
||||
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
|
||||
::scobj::ls340::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${id}" "${datype}" "${{tol1}" "${1.0}}" "${{tol2}" "${1.0}}"
|
||||
::scobj::ls340::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${tol1} ${tol2}
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_ls340.tcl"
|
||||
@@ -117,20 +119,31 @@ proc ::scobj::ls340::read_config {} {
|
||||
if { ![string equal -nocase "${simulation_flag}" "false"] } {
|
||||
set asyncqueue "null"
|
||||
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
|
||||
${ns}::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
} elseif { [dict exists $v "asyncqueue"] } {
|
||||
set asyncqueue [dict get $v "asyncqueue"]
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
set ip_address [dict get $v ip]
|
||||
set tcp_port [dict get $v port]
|
||||
}
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
} else {
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
} else {
|
||||
if { [dict exists $v "asyncprotocol"] } {
|
||||
set asyncprotocol [dict get $v "asyncprotocol"]
|
||||
} else {
|
||||
set asyncprotocol ${name}_protocol
|
||||
MakeAsyncProtocol ${asyncprotocol}
|
||||
if { [dict exists $v "terminator"] } {
|
||||
if { [dict exists $v "sendterminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "sendterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
if { [dict exists $v "replyterminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "replyterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
}
|
||||
@@ -141,6 +154,7 @@ proc ::scobj::ls340::read_config {} {
|
||||
if { [dict exists $v "timeout"] } {
|
||||
${asyncqueue} timeout "[dict get $v "timeout"]"
|
||||
}
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
set arg_list [list]
|
||||
set missing_list [list]
|
||||
@@ -157,11 +171,7 @@ proc ::scobj::ls340::read_config {} {
|
||||
if { [llength $missing_list] > 0 } {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,12 @@ proc ::scobj::mercury_base::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}"
|
||||
hupdateif ${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] } {
|
||||
@@ -279,9 +284,6 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name device_class simulati
|
||||
set scobj_hpath /sics/${name}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop1 plain spy none
|
||||
hsetprop ${scobj_hpath}/Loop1 data "true"
|
||||
hsetprop ${scobj_hpath}/Loop1 klass "@none"
|
||||
hsetprop ${scobj_hpath}/Loop1 type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/Loop1/nick plain user text
|
||||
hsetprop ${scobj_hpath}/Loop1/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:MB1.T1:TEMP:NICK}
|
||||
@@ -296,6 +298,14 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop1/nick type "part"
|
||||
hsetprop ${scobj_hpath}/Loop1/nick nxalias "${name}_Loop1_nick"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop1/nick 15
|
||||
hsetprop ${scobj_hpath}/Loop1/nick simulated false
|
||||
} else {
|
||||
::scobj::mercury_base::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_base"
|
||||
hsetprop ${scobj_hpath}/Loop1/nick simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop1/power plain user float
|
||||
hsetprop ${scobj_hpath}/Loop1/power read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:MB0.H1:HTR:SIG:POWR}
|
||||
hsetprop ${scobj_hpath}/Loop1/power rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -309,6 +319,14 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop1/power type "part"
|
||||
hsetprop ${scobj_hpath}/Loop1/power nxalias "${name}_Loop1_power"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop1/power 5
|
||||
hsetprop ${scobj_hpath}/Loop1/power simulated false
|
||||
} else {
|
||||
::scobj::mercury_base::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_base"
|
||||
hsetprop ${scobj_hpath}/Loop1/power simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop1/sensor plain user float
|
||||
hsetprop ${scobj_hpath}/Loop1/sensor read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:MB1.T1:TEMP:SIG:TEMP}
|
||||
hsetprop ${scobj_hpath}/Loop1/sensor rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -324,6 +342,14 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop1/sensor type "part"
|
||||
hsetprop ${scobj_hpath}/Loop1/sensor nxalias "${name}_Loop1_sensor"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop1/sensor 1
|
||||
hsetprop ${scobj_hpath}/Loop1/sensor simulated false
|
||||
} else {
|
||||
::scobj::mercury_base::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_base"
|
||||
hsetprop ${scobj_hpath}/Loop1/sensor simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop1/setpoint plain user float
|
||||
hsetprop ${scobj_hpath}/Loop1/setpoint read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:MB1.T1:TEMP:LOOP:TSET}
|
||||
hsetprop ${scobj_hpath}/Loop1/setpoint rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -352,19 +378,19 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop1/setpoint nxalias "${name}_Loop1_setpoint"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop1/nick 15
|
||||
${sct_controller} poll ${scobj_hpath}/Loop1/power 5
|
||||
${sct_controller} poll ${scobj_hpath}/Loop1/sensor 1
|
||||
${sct_controller} poll ${scobj_hpath}/Loop1/setpoint 5
|
||||
${sct_controller} write ${scobj_hpath}/Loop1/setpoint
|
||||
hsetprop ${scobj_hpath}/Loop1/setpoint simulated false
|
||||
} else {
|
||||
::scobj::mercury_base::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_base"
|
||||
hsetprop ${scobj_hpath}/Loop1/setpoint simulated true
|
||||
}
|
||||
hsetprop ${scobj_hpath}/Loop1 data "true"
|
||||
hsetprop ${scobj_hpath}/Loop1 klass "@none"
|
||||
hsetprop ${scobj_hpath}/Loop1 type "part"
|
||||
ansto_makesctdrive ${name}_Loop1_setpoint ${scobj_hpath}/Loop1/setpoint ${scobj_hpath}/Loop1/sensor ${sct_controller}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop2 plain spy none
|
||||
hsetprop ${scobj_hpath}/Loop2 data "true"
|
||||
hsetprop ${scobj_hpath}/Loop2 klass "@none"
|
||||
hsetprop ${scobj_hpath}/Loop2 type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/Loop2/nick plain user text
|
||||
hsetprop ${scobj_hpath}/Loop2/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:DB6.T1:TEMP:NICK}
|
||||
@@ -379,6 +405,14 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop2/nick type "part"
|
||||
hsetprop ${scobj_hpath}/Loop2/nick nxalias "${name}_Loop2_nick"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop2/nick 15
|
||||
hsetprop ${scobj_hpath}/Loop2/nick simulated false
|
||||
} else {
|
||||
::scobj::mercury_base::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_base"
|
||||
hsetprop ${scobj_hpath}/Loop2/nick simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop2/power plain user float
|
||||
hsetprop ${scobj_hpath}/Loop2/power read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB1.H1:HTR:SIG:POWR}
|
||||
hsetprop ${scobj_hpath}/Loop2/power rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -392,6 +426,14 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop2/power type "part"
|
||||
hsetprop ${scobj_hpath}/Loop2/power nxalias "${name}_Loop2_power"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop2/power 5
|
||||
hsetprop ${scobj_hpath}/Loop2/power simulated false
|
||||
} else {
|
||||
::scobj::mercury_base::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_base"
|
||||
hsetprop ${scobj_hpath}/Loop2/power simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop2/sensor plain user float
|
||||
hsetprop ${scobj_hpath}/Loop2/sensor read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB6.T1:TEMP:SIG:TEMP}
|
||||
hsetprop ${scobj_hpath}/Loop2/sensor rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -407,6 +449,14 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop2/sensor type "part"
|
||||
hsetprop ${scobj_hpath}/Loop2/sensor nxalias "${name}_Loop2_sensor"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop2/sensor 1
|
||||
hsetprop ${scobj_hpath}/Loop2/sensor simulated false
|
||||
} else {
|
||||
::scobj::mercury_base::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_base"
|
||||
hsetprop ${scobj_hpath}/Loop2/sensor simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop2/setpoint plain user float
|
||||
hsetprop ${scobj_hpath}/Loop2/setpoint read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB6.T1:TEMP:LOOP:TSET}
|
||||
hsetprop ${scobj_hpath}/Loop2/setpoint rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -435,19 +485,19 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop2/setpoint nxalias "${name}_Loop2_setpoint"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop2/nick 15
|
||||
${sct_controller} poll ${scobj_hpath}/Loop2/power 5
|
||||
${sct_controller} poll ${scobj_hpath}/Loop2/sensor 1
|
||||
${sct_controller} poll ${scobj_hpath}/Loop2/setpoint 5
|
||||
${sct_controller} write ${scobj_hpath}/Loop2/setpoint
|
||||
hsetprop ${scobj_hpath}/Loop2/setpoint simulated false
|
||||
} else {
|
||||
::scobj::mercury_base::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_base"
|
||||
hsetprop ${scobj_hpath}/Loop2/setpoint simulated true
|
||||
}
|
||||
hsetprop ${scobj_hpath}/Loop2 data "true"
|
||||
hsetprop ${scobj_hpath}/Loop2 klass "@none"
|
||||
hsetprop ${scobj_hpath}/Loop2 type "part"
|
||||
ansto_makesctdrive ${name}_Loop2_setpoint ${scobj_hpath}/Loop2/setpoint ${scobj_hpath}/Loop2/sensor ${sct_controller}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop3 plain spy none
|
||||
hsetprop ${scobj_hpath}/Loop3 data "true"
|
||||
hsetprop ${scobj_hpath}/Loop3 klass "@none"
|
||||
hsetprop ${scobj_hpath}/Loop3 type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/Loop3/nick plain user text
|
||||
hsetprop ${scobj_hpath}/Loop3/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:DB7.T1:TEMP:NICK}
|
||||
@@ -462,6 +512,14 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop3/nick type "part"
|
||||
hsetprop ${scobj_hpath}/Loop3/nick nxalias "${name}_Loop3_nick"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop3/nick 15
|
||||
hsetprop ${scobj_hpath}/Loop3/nick simulated false
|
||||
} else {
|
||||
::scobj::mercury_base::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_base"
|
||||
hsetprop ${scobj_hpath}/Loop3/nick simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop3/power plain user float
|
||||
hsetprop ${scobj_hpath}/Loop3/power read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB2.H1:HTR:SIG:POWR}
|
||||
hsetprop ${scobj_hpath}/Loop3/power rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -475,6 +533,14 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop3/power type "part"
|
||||
hsetprop ${scobj_hpath}/Loop3/power nxalias "${name}_Loop3_power"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop3/power 5
|
||||
hsetprop ${scobj_hpath}/Loop3/power simulated false
|
||||
} else {
|
||||
::scobj::mercury_base::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_base"
|
||||
hsetprop ${scobj_hpath}/Loop3/power simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop3/sensor plain user float
|
||||
hsetprop ${scobj_hpath}/Loop3/sensor read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB7.T1:TEMP:SIG:TEMP}
|
||||
hsetprop ${scobj_hpath}/Loop3/sensor rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -490,6 +556,14 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop3/sensor type "part"
|
||||
hsetprop ${scobj_hpath}/Loop3/sensor nxalias "${name}_Loop3_sensor"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop3/sensor 1
|
||||
hsetprop ${scobj_hpath}/Loop3/sensor simulated false
|
||||
} else {
|
||||
::scobj::mercury_base::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_base"
|
||||
hsetprop ${scobj_hpath}/Loop3/sensor simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop3/setpoint plain user float
|
||||
hsetprop ${scobj_hpath}/Loop3/setpoint read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB7.T1:TEMP:LOOP:TSET}
|
||||
hsetprop ${scobj_hpath}/Loop3/setpoint rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -518,22 +592,20 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop3/setpoint nxalias "${name}_Loop3_setpoint"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop3/nick 15
|
||||
${sct_controller} poll ${scobj_hpath}/Loop3/power 5
|
||||
${sct_controller} poll ${scobj_hpath}/Loop3/sensor 1
|
||||
${sct_controller} poll ${scobj_hpath}/Loop3/setpoint 5
|
||||
${sct_controller} write ${scobj_hpath}/Loop3/setpoint
|
||||
hsetprop ${scobj_hpath}/Loop3/setpoint simulated false
|
||||
} else {
|
||||
::scobj::mercury_base::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_base"
|
||||
hsetprop ${scobj_hpath}/Loop3/setpoint simulated true
|
||||
}
|
||||
hsetprop ${scobj_hpath}/Loop3 data "true"
|
||||
hsetprop ${scobj_hpath}/Loop3 klass "@none"
|
||||
hsetprop ${scobj_hpath}/Loop3 type "part"
|
||||
ansto_makesctdrive ${name}_Loop3_setpoint ${scobj_hpath}/Loop3/setpoint ${scobj_hpath}/Loop3/sensor ${sct_controller}
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
hsetprop ${scobj_hpath} debug_threshold 5
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
ansto_makesctdrive ${name}_Loop1_setpoint ${scobj_hpath}/Loop1/setpoint ${scobj_hpath}/Loop1/sensor ${sct_controller}
|
||||
ansto_makesctdrive ${name}_Loop2_setpoint ${scobj_hpath}/Loop2/setpoint ${scobj_hpath}/Loop2/sensor ${sct_controller}
|
||||
ansto_makesctdrive ${name}_Loop3_setpoint ${scobj_hpath}/Loop3/setpoint ${scobj_hpath}/Loop3/sensor ${sct_controller}
|
||||
}
|
||||
# mkDriver hook code goes here
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
@@ -551,7 +623,9 @@ proc ::scobj::mercury_base::add_driver {name device_class simulation_flag ip_add
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::mercury_base::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for mercury_base"
|
||||
::scobj::mercury_base::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for mercury_base"
|
||||
::scobj::mercury_base::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
}
|
||||
::scobj::mercury_base::sics_log 1 "::scobj::mercury_base::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${tol}"
|
||||
::scobj::mercury_base::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${tol}
|
||||
@@ -569,7 +643,7 @@ namespace eval ::scobj::mercury_base {
|
||||
|
||||
proc add_mercury_base {name ip_address tcp_port {id 99} {tol 1}} {
|
||||
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
|
||||
::scobj::mercury_base::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${{id}" "${99}}" "${{tol}" "${1}}"
|
||||
::scobj::mercury_base::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${tol}
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_mercury_base.tcl"
|
||||
@@ -608,20 +682,31 @@ proc ::scobj::mercury_base::read_config {} {
|
||||
if { ![string equal -nocase "${simulation_flag}" "false"] } {
|
||||
set asyncqueue "null"
|
||||
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
|
||||
${ns}::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
} elseif { [dict exists $v "asyncqueue"] } {
|
||||
set asyncqueue [dict get $v "asyncqueue"]
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
set ip_address [dict get $v ip]
|
||||
set tcp_port [dict get $v port]
|
||||
}
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
} else {
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
} else {
|
||||
if { [dict exists $v "asyncprotocol"] } {
|
||||
set asyncprotocol [dict get $v "asyncprotocol"]
|
||||
} else {
|
||||
set asyncprotocol ${name}_protocol
|
||||
MakeAsyncProtocol ${asyncprotocol}
|
||||
if { [dict exists $v "terminator"] } {
|
||||
if { [dict exists $v "sendterminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "sendterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
if { [dict exists $v "replyterminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "replyterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
}
|
||||
@@ -632,6 +717,7 @@ proc ::scobj::mercury_base::read_config {} {
|
||||
if { [dict exists $v "timeout"] } {
|
||||
${asyncqueue} timeout "[dict get $v "timeout"]"
|
||||
}
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
set arg_list [list]
|
||||
set missing_list [list]
|
||||
@@ -648,11 +734,7 @@ proc ::scobj::mercury_base::read_config {} {
|
||||
if { [llength $missing_list] > 0 } {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,9 +150,6 @@ proc ::scobj::mercury_level::mkDriver { sct_controller name device_class simulat
|
||||
set scobj_hpath /sics/${name}
|
||||
|
||||
hfactory ${scobj_hpath}/Level plain spy none
|
||||
hsetprop ${scobj_hpath}/Level data "true"
|
||||
hsetprop ${scobj_hpath}/Level klass "@none"
|
||||
hsetprop ${scobj_hpath}/Level type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/Level/Helium plain user float
|
||||
hsetprop ${scobj_hpath}/Level/Helium read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB5.L1:LVL:SIG:HEL:LEV}
|
||||
@@ -169,6 +166,14 @@ proc ::scobj::mercury_level::mkDriver { sct_controller name device_class simulat
|
||||
hsetprop ${scobj_hpath}/Level/Helium type "part"
|
||||
hsetprop ${scobj_hpath}/Level/Helium nxalias "${name}_Level_Helium"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Level/Helium 15
|
||||
hsetprop ${scobj_hpath}/Level/Helium simulated false
|
||||
} else {
|
||||
::scobj::mercury_level::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_level"
|
||||
hsetprop ${scobj_hpath}/Level/Helium simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Level/Nitrogen plain user float
|
||||
hsetprop ${scobj_hpath}/Level/Nitrogen read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB5.L1:LVL:SIG:NIT:LEV}
|
||||
hsetprop ${scobj_hpath}/Level/Nitrogen rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -185,11 +190,15 @@ proc ::scobj::mercury_level::mkDriver { sct_controller name device_class simulat
|
||||
hsetprop ${scobj_hpath}/Level/Nitrogen nxalias "${name}_Level_Nitrogen"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Level/Helium 15
|
||||
${sct_controller} poll ${scobj_hpath}/Level/Nitrogen 15
|
||||
hsetprop ${scobj_hpath}/Level/Nitrogen simulated false
|
||||
} else {
|
||||
::scobj::mercury_level::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_level"
|
||||
hsetprop ${scobj_hpath}/Level/Nitrogen simulated true
|
||||
}
|
||||
hsetprop ${scobj_hpath}/Level data "true"
|
||||
hsetprop ${scobj_hpath}/Level klass "@none"
|
||||
hsetprop ${scobj_hpath}/Level type "part"
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
hsetprop ${scobj_hpath} debug_threshold 5
|
||||
@@ -210,7 +219,9 @@ proc ::scobj::mercury_level::add_driver {name device_class simulation_flag ip_ad
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::mercury_level::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for mercury_level"
|
||||
::scobj::mercury_level::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for mercury_level"
|
||||
::scobj::mercury_level::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
}
|
||||
::scobj::mercury_level::sics_log 1 "::scobj::mercury_level::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id}"
|
||||
::scobj::mercury_level::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id}
|
||||
@@ -228,7 +239,7 @@ namespace eval ::scobj::mercury_level {
|
||||
|
||||
proc add_mercury_level {name ip_address tcp_port {id 99}} {
|
||||
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
|
||||
::scobj::mercury_level::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${{id}" "${99}}"
|
||||
::scobj::mercury_level::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} ${id}
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_mercury_level.tcl"
|
||||
@@ -267,20 +278,31 @@ proc ::scobj::mercury_level::read_config {} {
|
||||
if { ![string equal -nocase "${simulation_flag}" "false"] } {
|
||||
set asyncqueue "null"
|
||||
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
|
||||
${ns}::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
} elseif { [dict exists $v "asyncqueue"] } {
|
||||
set asyncqueue [dict get $v "asyncqueue"]
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
set ip_address [dict get $v ip]
|
||||
set tcp_port [dict get $v port]
|
||||
}
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
} else {
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
} else {
|
||||
if { [dict exists $v "asyncprotocol"] } {
|
||||
set asyncprotocol [dict get $v "asyncprotocol"]
|
||||
} else {
|
||||
set asyncprotocol ${name}_protocol
|
||||
MakeAsyncProtocol ${asyncprotocol}
|
||||
if { [dict exists $v "terminator"] } {
|
||||
if { [dict exists $v "sendterminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "sendterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
if { [dict exists $v "replyterminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "replyterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
}
|
||||
@@ -291,6 +313,7 @@ proc ::scobj::mercury_level::read_config {} {
|
||||
if { [dict exists $v "timeout"] } {
|
||||
${asyncqueue} timeout "[dict get $v "timeout"]"
|
||||
}
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
set arg_list [list]
|
||||
set missing_list [list]
|
||||
@@ -307,11 +330,7 @@ proc ::scobj::mercury_level::read_config {} {
|
||||
if { [llength $missing_list] > 0 } {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,12 @@ proc ::scobj::mercury_pres::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}"
|
||||
hupdateif ${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] } {
|
||||
@@ -285,9 +290,6 @@ proc ::scobj::mercury_pres::mkDriver { sct_controller name device_class simulati
|
||||
set scobj_hpath /sics/${name}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop8 plain spy none
|
||||
hsetprop ${scobj_hpath}/Loop8 data "true"
|
||||
hsetprop ${scobj_hpath}/Loop8 klass "@none"
|
||||
hsetprop ${scobj_hpath}/Loop8 type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/Loop8/nick plain user text
|
||||
hsetprop ${scobj_hpath}/Loop8/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:DB8.P1:PRES:NICK}
|
||||
@@ -302,6 +304,14 @@ proc ::scobj::mercury_pres::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop8/nick type "part"
|
||||
hsetprop ${scobj_hpath}/Loop8/nick nxalias "${name}_Loop8_nick"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop8/nick 15
|
||||
hsetprop ${scobj_hpath}/Loop8/nick simulated false
|
||||
} else {
|
||||
::scobj::mercury_pres::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_pres"
|
||||
hsetprop ${scobj_hpath}/Loop8/nick simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop8/sensor plain user float
|
||||
hsetprop ${scobj_hpath}/Loop8/sensor read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB8.P1:PRES:SIG:PRES}
|
||||
hsetprop ${scobj_hpath}/Loop8/sensor rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -318,6 +328,14 @@ proc ::scobj::mercury_pres::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop8/sensor type "part"
|
||||
hsetprop ${scobj_hpath}/Loop8/sensor nxalias "${name}_Loop8_sensor"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop8/sensor 1
|
||||
hsetprop ${scobj_hpath}/Loop8/sensor simulated false
|
||||
} else {
|
||||
::scobj::mercury_pres::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_pres"
|
||||
hsetprop ${scobj_hpath}/Loop8/sensor simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop8/setpoint plain user float
|
||||
hsetprop ${scobj_hpath}/Loop8/setpoint read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB8.P1:PRES:LOOP:TSET}
|
||||
hsetprop ${scobj_hpath}/Loop8/setpoint rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -347,19 +365,20 @@ proc ::scobj::mercury_pres::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop8/setpoint nxalias "${name}_Loop8_setpoint"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop8/nick 15
|
||||
${sct_controller} poll ${scobj_hpath}/Loop8/sensor 1
|
||||
${sct_controller} poll ${scobj_hpath}/Loop8/setpoint 5
|
||||
${sct_controller} write ${scobj_hpath}/Loop8/setpoint
|
||||
hsetprop ${scobj_hpath}/Loop8/setpoint simulated false
|
||||
} else {
|
||||
::scobj::mercury_pres::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_pres"
|
||||
hsetprop ${scobj_hpath}/Loop8/setpoint simulated true
|
||||
}
|
||||
hsetprop ${scobj_hpath}/Loop8 data "true"
|
||||
hsetprop ${scobj_hpath}/Loop8 klass "@none"
|
||||
hsetprop ${scobj_hpath}/Loop8 type "part"
|
||||
ansto_makesctdrive ${name}_Loop8_setpoint ${scobj_hpath}/Loop8/setpoint ${scobj_hpath}/Loop8/sensor ${sct_controller}
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
hsetprop ${scobj_hpath} debug_threshold 5
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
ansto_makesctdrive ${name}_Loop8_setpoint ${scobj_hpath}/Loop8/setpoint ${scobj_hpath}/Loop8/sensor ${sct_controller}
|
||||
}
|
||||
# mkDriver hook code goes here
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
@@ -377,7 +396,9 @@ proc ::scobj::mercury_pres::add_driver {name device_class simulation_flag ip_add
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::mercury_pres::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for mercury_pres"
|
||||
::scobj::mercury_pres::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for mercury_pres"
|
||||
::scobj::mercury_pres::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
}
|
||||
::scobj::mercury_pres::sics_log 1 "::scobj::mercury_pres::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${tol}"
|
||||
::scobj::mercury_pres::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${tol}
|
||||
@@ -395,7 +416,7 @@ namespace eval ::scobj::mercury_pres {
|
||||
|
||||
proc add_mercury_pres {name ip_address tcp_port {id 99} {tol 1}} {
|
||||
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
|
||||
::scobj::mercury_pres::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${{id}" "${99}}" "${{tol}" "${1}}"
|
||||
::scobj::mercury_pres::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${tol}
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_mercury_pres.tcl"
|
||||
@@ -434,20 +455,31 @@ proc ::scobj::mercury_pres::read_config {} {
|
||||
if { ![string equal -nocase "${simulation_flag}" "false"] } {
|
||||
set asyncqueue "null"
|
||||
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
|
||||
${ns}::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
} elseif { [dict exists $v "asyncqueue"] } {
|
||||
set asyncqueue [dict get $v "asyncqueue"]
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
set ip_address [dict get $v ip]
|
||||
set tcp_port [dict get $v port]
|
||||
}
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
} else {
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
} else {
|
||||
if { [dict exists $v "asyncprotocol"] } {
|
||||
set asyncprotocol [dict get $v "asyncprotocol"]
|
||||
} else {
|
||||
set asyncprotocol ${name}_protocol
|
||||
MakeAsyncProtocol ${asyncprotocol}
|
||||
if { [dict exists $v "terminator"] } {
|
||||
if { [dict exists $v "sendterminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "sendterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
if { [dict exists $v "replyterminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "replyterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
}
|
||||
@@ -458,6 +490,7 @@ proc ::scobj::mercury_pres::read_config {} {
|
||||
if { [dict exists $v "timeout"] } {
|
||||
${asyncqueue} timeout "[dict get $v "timeout"]"
|
||||
}
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
set arg_list [list]
|
||||
set missing_list [list]
|
||||
@@ -474,11 +507,7 @@ proc ::scobj::mercury_pres::read_config {} {
|
||||
if { [llength $missing_list] > 0 } {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,12 @@ proc ::scobj::mercury_scpi::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}"
|
||||
hupdateif ${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] } {
|
||||
@@ -313,9 +318,6 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name device_class simulati
|
||||
set scobj_hpath /sics/${name}
|
||||
|
||||
hfactory ${scobj_hpath}/Level plain spy none
|
||||
hsetprop ${scobj_hpath}/Level data "true"
|
||||
hsetprop ${scobj_hpath}/Level klass "@none"
|
||||
hsetprop ${scobj_hpath}/Level type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/Level/Helium plain user float
|
||||
hsetprop ${scobj_hpath}/Level/Helium read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB5.L1:LVL:SIG:HEL:LEV}
|
||||
@@ -332,6 +334,14 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Level/Helium type "part"
|
||||
hsetprop ${scobj_hpath}/Level/Helium nxalias "${name}_Level_Helium"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Level/Helium 15
|
||||
hsetprop ${scobj_hpath}/Level/Helium simulated false
|
||||
} else {
|
||||
::scobj::mercury_scpi::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_scpi"
|
||||
hsetprop ${scobj_hpath}/Level/Helium simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Level/Nitrogen plain user float
|
||||
hsetprop ${scobj_hpath}/Level/Nitrogen read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB5.L1:LVL:SIG:NIT:LEV}
|
||||
hsetprop ${scobj_hpath}/Level/Nitrogen rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -348,16 +358,17 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Level/Nitrogen nxalias "${name}_Level_Nitrogen"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Level/Helium 15
|
||||
${sct_controller} poll ${scobj_hpath}/Level/Nitrogen 15
|
||||
hsetprop ${scobj_hpath}/Level/Nitrogen simulated false
|
||||
} else {
|
||||
::scobj::mercury_scpi::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_scpi"
|
||||
hsetprop ${scobj_hpath}/Level/Nitrogen simulated true
|
||||
}
|
||||
hsetprop ${scobj_hpath}/Level data "true"
|
||||
hsetprop ${scobj_hpath}/Level klass "@none"
|
||||
hsetprop ${scobj_hpath}/Level type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/Loop1 plain spy none
|
||||
hsetprop ${scobj_hpath}/Loop1 data "true"
|
||||
hsetprop ${scobj_hpath}/Loop1 klass "@none"
|
||||
hsetprop ${scobj_hpath}/Loop1 type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/Loop1/nick plain user text
|
||||
hsetprop ${scobj_hpath}/Loop1/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:MB1.T1:TEMP:NICK}
|
||||
@@ -372,6 +383,14 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop1/nick type "part"
|
||||
hsetprop ${scobj_hpath}/Loop1/nick nxalias "${name}_Loop1_nick"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop1/nick 15
|
||||
hsetprop ${scobj_hpath}/Loop1/nick simulated false
|
||||
} else {
|
||||
::scobj::mercury_scpi::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_scpi"
|
||||
hsetprop ${scobj_hpath}/Loop1/nick simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop1/power plain user float
|
||||
hsetprop ${scobj_hpath}/Loop1/power read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:MB0.H1:HTR:SIG:POWR}
|
||||
hsetprop ${scobj_hpath}/Loop1/power rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -385,6 +404,14 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop1/power type "part"
|
||||
hsetprop ${scobj_hpath}/Loop1/power nxalias "${name}_Loop1_power"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop1/power 5
|
||||
hsetprop ${scobj_hpath}/Loop1/power simulated false
|
||||
} else {
|
||||
::scobj::mercury_scpi::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_scpi"
|
||||
hsetprop ${scobj_hpath}/Loop1/power simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop1/sensor plain user float
|
||||
hsetprop ${scobj_hpath}/Loop1/sensor read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:MB1.T1:TEMP:SIG:TEMP}
|
||||
hsetprop ${scobj_hpath}/Loop1/sensor rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -400,6 +427,14 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop1/sensor type "part"
|
||||
hsetprop ${scobj_hpath}/Loop1/sensor nxalias "${name}_Loop1_sensor"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop1/sensor 1
|
||||
hsetprop ${scobj_hpath}/Loop1/sensor simulated false
|
||||
} else {
|
||||
::scobj::mercury_scpi::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_scpi"
|
||||
hsetprop ${scobj_hpath}/Loop1/sensor simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop1/setpoint plain user float
|
||||
hsetprop ${scobj_hpath}/Loop1/setpoint read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:MB1.T1:TEMP:LOOP:TSET}
|
||||
hsetprop ${scobj_hpath}/Loop1/setpoint rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -428,19 +463,19 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop1/setpoint nxalias "${name}_Loop1_setpoint"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop1/nick 15
|
||||
${sct_controller} poll ${scobj_hpath}/Loop1/power 5
|
||||
${sct_controller} poll ${scobj_hpath}/Loop1/sensor 1
|
||||
${sct_controller} poll ${scobj_hpath}/Loop1/setpoint 5
|
||||
${sct_controller} write ${scobj_hpath}/Loop1/setpoint
|
||||
hsetprop ${scobj_hpath}/Loop1/setpoint simulated false
|
||||
} else {
|
||||
::scobj::mercury_scpi::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_scpi"
|
||||
hsetprop ${scobj_hpath}/Loop1/setpoint simulated true
|
||||
}
|
||||
hsetprop ${scobj_hpath}/Loop1 data "true"
|
||||
hsetprop ${scobj_hpath}/Loop1 klass "@none"
|
||||
hsetprop ${scobj_hpath}/Loop1 type "part"
|
||||
ansto_makesctdrive ${name}_Loop1_setpoint ${scobj_hpath}/Loop1/setpoint ${scobj_hpath}/Loop1/sensor ${sct_controller}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop2 plain spy none
|
||||
hsetprop ${scobj_hpath}/Loop2 data "true"
|
||||
hsetprop ${scobj_hpath}/Loop2 klass "@none"
|
||||
hsetprop ${scobj_hpath}/Loop2 type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/Loop2/nick plain user text
|
||||
hsetprop ${scobj_hpath}/Loop2/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:DB6.T1:TEMP:NICK}
|
||||
@@ -455,6 +490,14 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop2/nick type "part"
|
||||
hsetprop ${scobj_hpath}/Loop2/nick nxalias "${name}_Loop2_nick"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop2/nick 15
|
||||
hsetprop ${scobj_hpath}/Loop2/nick simulated false
|
||||
} else {
|
||||
::scobj::mercury_scpi::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_scpi"
|
||||
hsetprop ${scobj_hpath}/Loop2/nick simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop2/power plain user float
|
||||
hsetprop ${scobj_hpath}/Loop2/power read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB1.H1:HTR:SIG:POWR}
|
||||
hsetprop ${scobj_hpath}/Loop2/power rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -468,6 +511,14 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop2/power type "part"
|
||||
hsetprop ${scobj_hpath}/Loop2/power nxalias "${name}_Loop2_power"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop2/power 5
|
||||
hsetprop ${scobj_hpath}/Loop2/power simulated false
|
||||
} else {
|
||||
::scobj::mercury_scpi::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_scpi"
|
||||
hsetprop ${scobj_hpath}/Loop2/power simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop2/sensor plain user float
|
||||
hsetprop ${scobj_hpath}/Loop2/sensor read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB6.T1:TEMP:SIG:TEMP}
|
||||
hsetprop ${scobj_hpath}/Loop2/sensor rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -483,6 +534,14 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop2/sensor type "part"
|
||||
hsetprop ${scobj_hpath}/Loop2/sensor nxalias "${name}_Loop2_sensor"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop2/sensor 1
|
||||
hsetprop ${scobj_hpath}/Loop2/sensor simulated false
|
||||
} else {
|
||||
::scobj::mercury_scpi::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_scpi"
|
||||
hsetprop ${scobj_hpath}/Loop2/sensor simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop2/setpoint plain user float
|
||||
hsetprop ${scobj_hpath}/Loop2/setpoint read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB6.T1:TEMP:LOOP:TSET}
|
||||
hsetprop ${scobj_hpath}/Loop2/setpoint rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -511,19 +570,19 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop2/setpoint nxalias "${name}_Loop2_setpoint"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop2/nick 15
|
||||
${sct_controller} poll ${scobj_hpath}/Loop2/power 5
|
||||
${sct_controller} poll ${scobj_hpath}/Loop2/sensor 1
|
||||
${sct_controller} poll ${scobj_hpath}/Loop2/setpoint 5
|
||||
${sct_controller} write ${scobj_hpath}/Loop2/setpoint
|
||||
hsetprop ${scobj_hpath}/Loop2/setpoint simulated false
|
||||
} else {
|
||||
::scobj::mercury_scpi::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_scpi"
|
||||
hsetprop ${scobj_hpath}/Loop2/setpoint simulated true
|
||||
}
|
||||
hsetprop ${scobj_hpath}/Loop2 data "true"
|
||||
hsetprop ${scobj_hpath}/Loop2 klass "@none"
|
||||
hsetprop ${scobj_hpath}/Loop2 type "part"
|
||||
ansto_makesctdrive ${name}_Loop2_setpoint ${scobj_hpath}/Loop2/setpoint ${scobj_hpath}/Loop2/sensor ${sct_controller}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop3 plain spy none
|
||||
hsetprop ${scobj_hpath}/Loop3 data "true"
|
||||
hsetprop ${scobj_hpath}/Loop3 klass "@none"
|
||||
hsetprop ${scobj_hpath}/Loop3 type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/Loop3/nick plain user text
|
||||
hsetprop ${scobj_hpath}/Loop3/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:DB7.T1:TEMP:NICK}
|
||||
@@ -538,6 +597,14 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop3/nick type "part"
|
||||
hsetprop ${scobj_hpath}/Loop3/nick nxalias "${name}_Loop3_nick"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop3/nick 15
|
||||
hsetprop ${scobj_hpath}/Loop3/nick simulated false
|
||||
} else {
|
||||
::scobj::mercury_scpi::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_scpi"
|
||||
hsetprop ${scobj_hpath}/Loop3/nick simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop3/power plain user float
|
||||
hsetprop ${scobj_hpath}/Loop3/power read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB2.H1:HTR:SIG:POWR}
|
||||
hsetprop ${scobj_hpath}/Loop3/power rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -551,6 +618,14 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop3/power type "part"
|
||||
hsetprop ${scobj_hpath}/Loop3/power nxalias "${name}_Loop3_power"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop3/power 5
|
||||
hsetprop ${scobj_hpath}/Loop3/power simulated false
|
||||
} else {
|
||||
::scobj::mercury_scpi::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_scpi"
|
||||
hsetprop ${scobj_hpath}/Loop3/power simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop3/sensor plain user float
|
||||
hsetprop ${scobj_hpath}/Loop3/sensor read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB7.T1:TEMP:SIG:TEMP}
|
||||
hsetprop ${scobj_hpath}/Loop3/sensor rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -566,6 +641,14 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop3/sensor type "part"
|
||||
hsetprop ${scobj_hpath}/Loop3/sensor nxalias "${name}_Loop3_sensor"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop3/sensor 1
|
||||
hsetprop ${scobj_hpath}/Loop3/sensor simulated false
|
||||
} else {
|
||||
::scobj::mercury_scpi::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_scpi"
|
||||
hsetprop ${scobj_hpath}/Loop3/sensor simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop3/setpoint plain user float
|
||||
hsetprop ${scobj_hpath}/Loop3/setpoint read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB7.T1:TEMP:LOOP:TSET}
|
||||
hsetprop ${scobj_hpath}/Loop3/setpoint rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -594,19 +677,19 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop3/setpoint nxalias "${name}_Loop3_setpoint"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop3/nick 15
|
||||
${sct_controller} poll ${scobj_hpath}/Loop3/power 5
|
||||
${sct_controller} poll ${scobj_hpath}/Loop3/sensor 1
|
||||
${sct_controller} poll ${scobj_hpath}/Loop3/setpoint 5
|
||||
${sct_controller} write ${scobj_hpath}/Loop3/setpoint
|
||||
hsetprop ${scobj_hpath}/Loop3/setpoint simulated false
|
||||
} else {
|
||||
::scobj::mercury_scpi::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_scpi"
|
||||
hsetprop ${scobj_hpath}/Loop3/setpoint simulated true
|
||||
}
|
||||
hsetprop ${scobj_hpath}/Loop3 data "true"
|
||||
hsetprop ${scobj_hpath}/Loop3 klass "@none"
|
||||
hsetprop ${scobj_hpath}/Loop3 type "part"
|
||||
ansto_makesctdrive ${name}_Loop3_setpoint ${scobj_hpath}/Loop3/setpoint ${scobj_hpath}/Loop3/sensor ${sct_controller}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop4 plain spy none
|
||||
hsetprop ${scobj_hpath}/Loop4 data "true"
|
||||
hsetprop ${scobj_hpath}/Loop4 klass "@none"
|
||||
hsetprop ${scobj_hpath}/Loop4 type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/Loop4/nick plain user text
|
||||
hsetprop ${scobj_hpath}/Loop4/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:DB8.T1:TEMP:NICK}
|
||||
@@ -621,6 +704,14 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop4/nick type "part"
|
||||
hsetprop ${scobj_hpath}/Loop4/nick nxalias "${name}_Loop4_nick"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop4/nick 15
|
||||
hsetprop ${scobj_hpath}/Loop4/nick simulated false
|
||||
} else {
|
||||
::scobj::mercury_scpi::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_scpi"
|
||||
hsetprop ${scobj_hpath}/Loop4/nick simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop4/power plain user float
|
||||
hsetprop ${scobj_hpath}/Loop4/power read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB3.H1:HTR:SIG:POWR}
|
||||
hsetprop ${scobj_hpath}/Loop4/power rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -634,6 +725,14 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop4/power type "part"
|
||||
hsetprop ${scobj_hpath}/Loop4/power nxalias "${name}_Loop4_power"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop4/power 5
|
||||
hsetprop ${scobj_hpath}/Loop4/power simulated false
|
||||
} else {
|
||||
::scobj::mercury_scpi::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_scpi"
|
||||
hsetprop ${scobj_hpath}/Loop4/power simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop4/sensor plain user float
|
||||
hsetprop ${scobj_hpath}/Loop4/sensor read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB8.T1:TEMP:SIG:TEMP}
|
||||
hsetprop ${scobj_hpath}/Loop4/sensor rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -649,6 +748,14 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop4/sensor type "part"
|
||||
hsetprop ${scobj_hpath}/Loop4/sensor nxalias "${name}_Loop4_sensor"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop4/sensor 1
|
||||
hsetprop ${scobj_hpath}/Loop4/sensor simulated false
|
||||
} else {
|
||||
::scobj::mercury_scpi::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_scpi"
|
||||
hsetprop ${scobj_hpath}/Loop4/sensor simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop4/setpoint plain user float
|
||||
hsetprop ${scobj_hpath}/Loop4/setpoint read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB8.T1:TEMP:LOOP:TSET}
|
||||
hsetprop ${scobj_hpath}/Loop4/setpoint rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -677,19 +784,19 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop4/setpoint nxalias "${name}_Loop4_setpoint"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop4/nick 15
|
||||
${sct_controller} poll ${scobj_hpath}/Loop4/power 5
|
||||
${sct_controller} poll ${scobj_hpath}/Loop4/sensor 1
|
||||
${sct_controller} poll ${scobj_hpath}/Loop4/setpoint 5
|
||||
${sct_controller} write ${scobj_hpath}/Loop4/setpoint
|
||||
hsetprop ${scobj_hpath}/Loop4/setpoint simulated false
|
||||
} else {
|
||||
::scobj::mercury_scpi::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_scpi"
|
||||
hsetprop ${scobj_hpath}/Loop4/setpoint simulated true
|
||||
}
|
||||
hsetprop ${scobj_hpath}/Loop4 data "true"
|
||||
hsetprop ${scobj_hpath}/Loop4 klass "@none"
|
||||
hsetprop ${scobj_hpath}/Loop4 type "part"
|
||||
ansto_makesctdrive ${name}_Loop4_setpoint ${scobj_hpath}/Loop4/setpoint ${scobj_hpath}/Loop4/sensor ${sct_controller}
|
||||
|
||||
hfactory ${scobj_hpath}/Valve plain spy none
|
||||
hsetprop ${scobj_hpath}/Valve data "true"
|
||||
hsetprop ${scobj_hpath}/Valve klass "@none"
|
||||
hsetprop ${scobj_hpath}/Valve type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/Valve/sensor plain user float
|
||||
hsetprop ${scobj_hpath}/Valve/sensor read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB4.G1:AUX:SIG:OPEN}
|
||||
@@ -706,6 +813,14 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Valve/sensor type "part"
|
||||
hsetprop ${scobj_hpath}/Valve/sensor nxalias "${name}_Valve_sensor"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Valve/sensor 5
|
||||
hsetprop ${scobj_hpath}/Valve/sensor simulated false
|
||||
} else {
|
||||
::scobj::mercury_scpi::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_scpi"
|
||||
hsetprop ${scobj_hpath}/Valve/sensor simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Valve/setpoint plain user float
|
||||
hsetprop ${scobj_hpath}/Valve/setpoint write ${ns}::setValve ${scobj_hpath} noResponse {SET:DEV:DB4.G1:AUX:SIG:OPEN:}
|
||||
hsetprop ${scobj_hpath}/Valve/setpoint noResponse ${ns}::noResponse ${scobj_hpath}
|
||||
@@ -732,21 +847,19 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Valve/setpoint nxalias "${name}_Valve_setpoint"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Valve/sensor 5
|
||||
${sct_controller} write ${scobj_hpath}/Valve/setpoint
|
||||
hsetprop ${scobj_hpath}/Valve/setpoint simulated false
|
||||
} else {
|
||||
::scobj::mercury_scpi::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_scpi"
|
||||
hsetprop ${scobj_hpath}/Valve/setpoint simulated true
|
||||
}
|
||||
hsetprop ${scobj_hpath}/Valve data "true"
|
||||
hsetprop ${scobj_hpath}/Valve klass "@none"
|
||||
hsetprop ${scobj_hpath}/Valve type "part"
|
||||
ansto_makesctdrive ${name}_Valve_setpoint ${scobj_hpath}/Valve/setpoint ${scobj_hpath}/Valve/sensor ${sct_controller}
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
hsetprop ${scobj_hpath} debug_threshold 5
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
ansto_makesctdrive ${name}_Loop1_setpoint ${scobj_hpath}/Loop1/setpoint ${scobj_hpath}/Loop1/sensor ${sct_controller}
|
||||
ansto_makesctdrive ${name}_Loop2_setpoint ${scobj_hpath}/Loop2/setpoint ${scobj_hpath}/Loop2/sensor ${sct_controller}
|
||||
ansto_makesctdrive ${name}_Loop3_setpoint ${scobj_hpath}/Loop3/setpoint ${scobj_hpath}/Loop3/sensor ${sct_controller}
|
||||
ansto_makesctdrive ${name}_Loop4_setpoint ${scobj_hpath}/Loop4/setpoint ${scobj_hpath}/Loop4/sensor ${sct_controller}
|
||||
ansto_makesctdrive ${name}_Valve_setpoint ${scobj_hpath}/Valve/setpoint ${scobj_hpath}/Valve/sensor ${sct_controller}
|
||||
}
|
||||
# mkDriver hook code goes here
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
@@ -764,7 +877,9 @@ proc ::scobj::mercury_scpi::add_driver {name device_class simulation_flag ip_add
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::mercury_scpi::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for mercury_scpi"
|
||||
::scobj::mercury_scpi::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for mercury_scpi"
|
||||
::scobj::mercury_scpi::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
}
|
||||
::scobj::mercury_scpi::sics_log 1 "::scobj::mercury_scpi::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${permlink} ${tol} ${valve_tol}"
|
||||
::scobj::mercury_scpi::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${permlink} ${tol} ${valve_tol}
|
||||
@@ -782,7 +897,7 @@ namespace eval ::scobj::mercury_scpi {
|
||||
|
||||
proc add_mercury_scpi {name ip_address tcp_port {id 99} {permlink LT} {tol 1} {valve_tol 2}} {
|
||||
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
|
||||
::scobj::mercury_scpi::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${{id}" "${99}}" "${{permlink}" "${LT}}" "${{tol}" "${1}}" "${{valve_tol}" "${2}}"
|
||||
::scobj::mercury_scpi::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${permlink} ${tol} ${valve_tol}
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_mercury_scpi.tcl"
|
||||
@@ -821,20 +936,31 @@ proc ::scobj::mercury_scpi::read_config {} {
|
||||
if { ![string equal -nocase "${simulation_flag}" "false"] } {
|
||||
set asyncqueue "null"
|
||||
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
|
||||
${ns}::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
} elseif { [dict exists $v "asyncqueue"] } {
|
||||
set asyncqueue [dict get $v "asyncqueue"]
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
set ip_address [dict get $v ip]
|
||||
set tcp_port [dict get $v port]
|
||||
}
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
} else {
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
} else {
|
||||
if { [dict exists $v "asyncprotocol"] } {
|
||||
set asyncprotocol [dict get $v "asyncprotocol"]
|
||||
} else {
|
||||
set asyncprotocol ${name}_protocol
|
||||
MakeAsyncProtocol ${asyncprotocol}
|
||||
if { [dict exists $v "terminator"] } {
|
||||
if { [dict exists $v "sendterminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "sendterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
if { [dict exists $v "replyterminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "replyterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
}
|
||||
@@ -845,6 +971,7 @@ proc ::scobj::mercury_scpi::read_config {} {
|
||||
if { [dict exists $v "timeout"] } {
|
||||
${asyncqueue} timeout "[dict get $v "timeout"]"
|
||||
}
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
set arg_list [list]
|
||||
set missing_list [list]
|
||||
@@ -861,11 +988,7 @@ proc ::scobj::mercury_scpi::read_config {} {
|
||||
if { [llength $missing_list] > 0 } {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,12 @@ proc ::scobj::mercury_temp::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}"
|
||||
hupdateif ${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] } {
|
||||
@@ -279,9 +284,6 @@ proc ::scobj::mercury_temp::mkDriver { sct_controller name device_class simulati
|
||||
set scobj_hpath /sics/${name}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop4 plain spy none
|
||||
hsetprop ${scobj_hpath}/Loop4 data "true"
|
||||
hsetprop ${scobj_hpath}/Loop4 klass "@none"
|
||||
hsetprop ${scobj_hpath}/Loop4 type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/Loop4/nick plain user text
|
||||
hsetprop ${scobj_hpath}/Loop4/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:DB8.T1:TEMP:NICK}
|
||||
@@ -296,6 +298,14 @@ proc ::scobj::mercury_temp::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop4/nick type "part"
|
||||
hsetprop ${scobj_hpath}/Loop4/nick nxalias "${name}_Loop4_nick"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop4/nick 15
|
||||
hsetprop ${scobj_hpath}/Loop4/nick simulated false
|
||||
} else {
|
||||
::scobj::mercury_temp::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_temp"
|
||||
hsetprop ${scobj_hpath}/Loop4/nick simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop4/power plain user float
|
||||
hsetprop ${scobj_hpath}/Loop4/power read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB3.H1:HTR:SIG:POWR}
|
||||
hsetprop ${scobj_hpath}/Loop4/power rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -309,6 +319,14 @@ proc ::scobj::mercury_temp::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop4/power type "part"
|
||||
hsetprop ${scobj_hpath}/Loop4/power nxalias "${name}_Loop4_power"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop4/power 5
|
||||
hsetprop ${scobj_hpath}/Loop4/power simulated false
|
||||
} else {
|
||||
::scobj::mercury_temp::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_temp"
|
||||
hsetprop ${scobj_hpath}/Loop4/power simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop4/sensor plain user float
|
||||
hsetprop ${scobj_hpath}/Loop4/sensor read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB8.T1:TEMP:SIG:TEMP}
|
||||
hsetprop ${scobj_hpath}/Loop4/sensor rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -324,6 +342,14 @@ proc ::scobj::mercury_temp::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop4/sensor type "part"
|
||||
hsetprop ${scobj_hpath}/Loop4/sensor nxalias "${name}_Loop4_sensor"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop4/sensor 1
|
||||
hsetprop ${scobj_hpath}/Loop4/sensor simulated false
|
||||
} else {
|
||||
::scobj::mercury_temp::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_temp"
|
||||
hsetprop ${scobj_hpath}/Loop4/sensor simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop4/setpoint plain user float
|
||||
hsetprop ${scobj_hpath}/Loop4/setpoint read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB8.T1:TEMP:LOOP:TSET}
|
||||
hsetprop ${scobj_hpath}/Loop4/setpoint rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -352,20 +378,20 @@ proc ::scobj::mercury_temp::mkDriver { sct_controller name device_class simulati
|
||||
hsetprop ${scobj_hpath}/Loop4/setpoint nxalias "${name}_Loop4_setpoint"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Loop4/nick 15
|
||||
${sct_controller} poll ${scobj_hpath}/Loop4/power 5
|
||||
${sct_controller} poll ${scobj_hpath}/Loop4/sensor 1
|
||||
${sct_controller} poll ${scobj_hpath}/Loop4/setpoint 5
|
||||
${sct_controller} write ${scobj_hpath}/Loop4/setpoint
|
||||
hsetprop ${scobj_hpath}/Loop4/setpoint simulated false
|
||||
} else {
|
||||
::scobj::mercury_temp::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_temp"
|
||||
hsetprop ${scobj_hpath}/Loop4/setpoint simulated true
|
||||
}
|
||||
hsetprop ${scobj_hpath}/Loop4 data "true"
|
||||
hsetprop ${scobj_hpath}/Loop4 klass "@none"
|
||||
hsetprop ${scobj_hpath}/Loop4 type "part"
|
||||
ansto_makesctdrive ${name}_Loop4_setpoint ${scobj_hpath}/Loop4/setpoint ${scobj_hpath}/Loop4/sensor ${sct_controller}
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
hsetprop ${scobj_hpath} debug_threshold 5
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
ansto_makesctdrive ${name}_Loop4_setpoint ${scobj_hpath}/Loop4/setpoint ${scobj_hpath}/Loop4/sensor ${sct_controller}
|
||||
}
|
||||
# mkDriver hook code goes here
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
@@ -383,7 +409,9 @@ proc ::scobj::mercury_temp::add_driver {name device_class simulation_flag ip_add
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::mercury_temp::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for mercury_temp"
|
||||
::scobj::mercury_temp::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for mercury_temp"
|
||||
::scobj::mercury_temp::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
}
|
||||
::scobj::mercury_temp::sics_log 1 "::scobj::mercury_temp::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${tol}"
|
||||
::scobj::mercury_temp::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${tol}
|
||||
@@ -401,7 +429,7 @@ namespace eval ::scobj::mercury_temp {
|
||||
|
||||
proc add_mercury_temp {name ip_address tcp_port {id 99} {tol 1}} {
|
||||
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
|
||||
::scobj::mercury_temp::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${{id}" "${99}}" "${{tol}" "${1}}"
|
||||
::scobj::mercury_temp::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${tol}
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_mercury_temp.tcl"
|
||||
@@ -440,20 +468,31 @@ proc ::scobj::mercury_temp::read_config {} {
|
||||
if { ![string equal -nocase "${simulation_flag}" "false"] } {
|
||||
set asyncqueue "null"
|
||||
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
|
||||
${ns}::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
} elseif { [dict exists $v "asyncqueue"] } {
|
||||
set asyncqueue [dict get $v "asyncqueue"]
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
set ip_address [dict get $v ip]
|
||||
set tcp_port [dict get $v port]
|
||||
}
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
} else {
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
} else {
|
||||
if { [dict exists $v "asyncprotocol"] } {
|
||||
set asyncprotocol [dict get $v "asyncprotocol"]
|
||||
} else {
|
||||
set asyncprotocol ${name}_protocol
|
||||
MakeAsyncProtocol ${asyncprotocol}
|
||||
if { [dict exists $v "terminator"] } {
|
||||
if { [dict exists $v "sendterminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "sendterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
if { [dict exists $v "replyterminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "replyterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
}
|
||||
@@ -464,6 +503,7 @@ proc ::scobj::mercury_temp::read_config {} {
|
||||
if { [dict exists $v "timeout"] } {
|
||||
${asyncqueue} timeout "[dict get $v "timeout"]"
|
||||
}
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
set arg_list [list]
|
||||
set missing_list [list]
|
||||
@@ -480,11 +520,7 @@ proc ::scobj::mercury_temp::read_config {} {
|
||||
if { [llength $missing_list] > 0 } {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,12 @@ proc ::scobj::mercury_valve::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}"
|
||||
hupdateif ${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] } {
|
||||
@@ -257,9 +262,6 @@ proc ::scobj::mercury_valve::mkDriver { sct_controller name device_class simulat
|
||||
set scobj_hpath /sics/${name}
|
||||
|
||||
hfactory ${scobj_hpath}/Valve plain spy none
|
||||
hsetprop ${scobj_hpath}/Valve data "true"
|
||||
hsetprop ${scobj_hpath}/Valve klass "@none"
|
||||
hsetprop ${scobj_hpath}/Valve type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/Valve/sensor plain user float
|
||||
hsetprop ${scobj_hpath}/Valve/sensor read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB4.G1:AUX:SIG:OPEN}
|
||||
@@ -276,6 +278,14 @@ proc ::scobj::mercury_valve::mkDriver { sct_controller name device_class simulat
|
||||
hsetprop ${scobj_hpath}/Valve/sensor type "part"
|
||||
hsetprop ${scobj_hpath}/Valve/sensor nxalias "${name}_Valve_sensor"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Valve/sensor 5
|
||||
hsetprop ${scobj_hpath}/Valve/sensor simulated false
|
||||
} else {
|
||||
::scobj::mercury_valve::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_valve"
|
||||
hsetprop ${scobj_hpath}/Valve/sensor simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Valve/setpoint plain user float
|
||||
hsetprop ${scobj_hpath}/Valve/setpoint write ${ns}::setValve ${scobj_hpath} noResponse {SET:DEV:DB4.G1:AUX:SIG:OPEN:}
|
||||
hsetprop ${scobj_hpath}/Valve/setpoint noResponse ${ns}::noResponse ${scobj_hpath}
|
||||
@@ -302,17 +312,19 @@ proc ::scobj::mercury_valve::mkDriver { sct_controller name device_class simulat
|
||||
hsetprop ${scobj_hpath}/Valve/setpoint nxalias "${name}_Valve_setpoint"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Valve/sensor 5
|
||||
${sct_controller} write ${scobj_hpath}/Valve/setpoint
|
||||
hsetprop ${scobj_hpath}/Valve/setpoint simulated false
|
||||
} else {
|
||||
::scobj::mercury_valve::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_valve"
|
||||
hsetprop ${scobj_hpath}/Valve/setpoint simulated true
|
||||
}
|
||||
hsetprop ${scobj_hpath}/Valve data "true"
|
||||
hsetprop ${scobj_hpath}/Valve klass "@none"
|
||||
hsetprop ${scobj_hpath}/Valve type "part"
|
||||
ansto_makesctdrive ${name}_Valve_setpoint ${scobj_hpath}/Valve/setpoint ${scobj_hpath}/Valve/sensor ${sct_controller}
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
hsetprop ${scobj_hpath} debug_threshold 5
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
ansto_makesctdrive ${name}_Valve_setpoint ${scobj_hpath}/Valve/setpoint ${scobj_hpath}/Valve/sensor ${sct_controller}
|
||||
}
|
||||
# mkDriver hook code goes here
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
@@ -330,7 +342,9 @@ proc ::scobj::mercury_valve::add_driver {name device_class simulation_flag ip_ad
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::mercury_valve::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for mercury_valve"
|
||||
::scobj::mercury_valve::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for mercury_valve"
|
||||
::scobj::mercury_valve::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
}
|
||||
::scobj::mercury_valve::sics_log 1 "::scobj::mercury_valve::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${valve_tol}"
|
||||
::scobj::mercury_valve::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${valve_tol}
|
||||
@@ -348,7 +362,7 @@ namespace eval ::scobj::mercury_valve {
|
||||
|
||||
proc add_mercury_valve {name ip_address tcp_port {id 99} {valve_tol 2}} {
|
||||
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
|
||||
::scobj::mercury_valve::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${{id}" "${99}}" "${{valve_tol}" "${2}}"
|
||||
::scobj::mercury_valve::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${valve_tol}
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_mercury_valve.tcl"
|
||||
@@ -387,20 +401,31 @@ proc ::scobj::mercury_valve::read_config {} {
|
||||
if { ![string equal -nocase "${simulation_flag}" "false"] } {
|
||||
set asyncqueue "null"
|
||||
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
|
||||
${ns}::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
} elseif { [dict exists $v "asyncqueue"] } {
|
||||
set asyncqueue [dict get $v "asyncqueue"]
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
set ip_address [dict get $v ip]
|
||||
set tcp_port [dict get $v port]
|
||||
}
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
} else {
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
} else {
|
||||
if { [dict exists $v "asyncprotocol"] } {
|
||||
set asyncprotocol [dict get $v "asyncprotocol"]
|
||||
} else {
|
||||
set asyncprotocol ${name}_protocol
|
||||
MakeAsyncProtocol ${asyncprotocol}
|
||||
if { [dict exists $v "terminator"] } {
|
||||
if { [dict exists $v "sendterminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "sendterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
if { [dict exists $v "replyterminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "replyterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
}
|
||||
@@ -411,6 +436,7 @@ proc ::scobj::mercury_valve::read_config {} {
|
||||
if { [dict exists $v "timeout"] } {
|
||||
${asyncqueue} timeout "[dict get $v "timeout"]"
|
||||
}
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
set arg_list [list]
|
||||
set missing_list [list]
|
||||
@@ -427,11 +453,7 @@ proc ::scobj::mercury_valve::read_config {} {
|
||||
if { [llength $missing_list] > 0 } {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,9 @@ proc ::scobj::nprvasm2::add_driver {name device_class simulation_flag ip_address
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::nprvasm2::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for nprvasm2"
|
||||
::scobj::nprvasm2::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for nprvasm2"
|
||||
::scobj::nprvasm2::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
}
|
||||
::scobj::nprvasm2::sics_log 1 "::scobj::nprvasm2::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${tol}"
|
||||
::scobj::nprvasm2::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${tol}
|
||||
@@ -78,7 +80,7 @@ namespace eval ::scobj::nprvasm2 {
|
||||
|
||||
proc add_nprvasm2 {name ip_address tcp_port {tol 1.0}} {
|
||||
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
|
||||
::scobj::nprvasm2::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${{tol}" "${1.0}}"
|
||||
::scobj::nprvasm2::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} ${tol}
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_nprvasm2.tcl"
|
||||
@@ -117,20 +119,31 @@ proc ::scobj::nprvasm2::read_config {} {
|
||||
if { ![string equal -nocase "${simulation_flag}" "false"] } {
|
||||
set asyncqueue "null"
|
||||
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
|
||||
${ns}::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
} elseif { [dict exists $v "asyncqueue"] } {
|
||||
set asyncqueue [dict get $v "asyncqueue"]
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
set ip_address [dict get $v ip]
|
||||
set tcp_port [dict get $v port]
|
||||
}
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
} else {
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
} else {
|
||||
if { [dict exists $v "asyncprotocol"] } {
|
||||
set asyncprotocol [dict get $v "asyncprotocol"]
|
||||
} else {
|
||||
set asyncprotocol ${name}_protocol
|
||||
MakeAsyncProtocol ${asyncprotocol}
|
||||
if { [dict exists $v "terminator"] } {
|
||||
if { [dict exists $v "sendterminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "sendterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
if { [dict exists $v "replyterminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "replyterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
}
|
||||
@@ -141,6 +154,7 @@ proc ::scobj::nprvasm2::read_config {} {
|
||||
if { [dict exists $v "timeout"] } {
|
||||
${asyncqueue} timeout "[dict get $v "timeout"]"
|
||||
}
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
set arg_list [list]
|
||||
set missing_list [list]
|
||||
@@ -157,11 +171,7 @@ proc ::scobj::nprvasm2::read_config {} {
|
||||
if { [llength $missing_list] > 0 } {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,7 +125,12 @@ proc ::scobj::pfeiffer_hg::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}"
|
||||
hupdateif ${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] } {
|
||||
@@ -400,9 +405,6 @@ proc ::scobj::pfeiffer_hg::mkDriver { sct_controller name device_class simulatio
|
||||
hsetprop ${scobj_hpath} type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/pressure plain spy none
|
||||
hsetprop ${scobj_hpath}/pressure data "true"
|
||||
hsetprop ${scobj_hpath}/pressure klass "@none"
|
||||
hsetprop ${scobj_hpath}/pressure type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/pressure/sensor plain user float
|
||||
hsetprop ${scobj_hpath}/pressure/sensor read ${ns}::sendPR1 ${scobj_hpath} readPR1 {PR1}
|
||||
@@ -428,6 +430,14 @@ proc ::scobj::pfeiffer_hg::mkDriver { sct_controller name device_class simulatio
|
||||
hsetprop ${scobj_hpath}/pressure/sensor type "part"
|
||||
hsetprop ${scobj_hpath}/pressure/sensor nxalias "${name}_pressure_sensor"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/pressure/sensor 1
|
||||
hsetprop ${scobj_hpath}/pressure/sensor simulated false
|
||||
} else {
|
||||
::scobj::pfeiffer_hg::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for pfeiffer_hg"
|
||||
hsetprop ${scobj_hpath}/pressure/sensor simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/pressure/setpoint plain user float
|
||||
hsetprop ${scobj_hpath}/pressure/setpoint write ${ns}::setPoint ${scobj_hpath} noResponse {@}
|
||||
hsetprop ${scobj_hpath}/pressure/setpoint noResponse ${ns}::noResponse ${scobj_hpath}
|
||||
@@ -454,17 +464,19 @@ proc ::scobj::pfeiffer_hg::mkDriver { sct_controller name device_class simulatio
|
||||
hsetprop ${scobj_hpath}/pressure/setpoint nxalias "${name}_pressure_setpoint"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/pressure/sensor 1
|
||||
${sct_controller} write ${scobj_hpath}/pressure/setpoint
|
||||
hsetprop ${scobj_hpath}/pressure/setpoint simulated false
|
||||
} else {
|
||||
::scobj::pfeiffer_hg::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for pfeiffer_hg"
|
||||
hsetprop ${scobj_hpath}/pressure/setpoint simulated true
|
||||
}
|
||||
hsetprop ${scobj_hpath}/pressure data "true"
|
||||
hsetprop ${scobj_hpath}/pressure klass "@none"
|
||||
hsetprop ${scobj_hpath}/pressure type "part"
|
||||
ansto_makesctdrive ${name}_pressure_setpoint ${scobj_hpath}/pressure/setpoint ${scobj_hpath}/pressure/sensor ${sct_controller}
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
hsetprop ${scobj_hpath} debug_threshold 5
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
ansto_makesctdrive ${name}_pressure_setpoint ${scobj_hpath}/pressure/setpoint ${scobj_hpath}/pressure/sensor ${sct_controller}
|
||||
}
|
||||
# mkDriver hook code starts
|
||||
hsetprop ${scobj_hpath}/pressure/sensor read ${ns}::sendPR1 ${scobj_hpath} ack_enq {PR1}
|
||||
hsetprop ${scobj_hpath}/pressure/sensor ack_enq ${ns}::ack_enq ${scobj_hpath}
|
||||
@@ -485,7 +497,9 @@ proc ::scobj::pfeiffer_hg::add_driver {name device_class simulation_flag ip_addr
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::pfeiffer_hg::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for pfeiffer_hg"
|
||||
::scobj::pfeiffer_hg::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for pfeiffer_hg"
|
||||
::scobj::pfeiffer_hg::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
}
|
||||
::scobj::pfeiffer_hg::sics_log 1 "::scobj::pfeiffer_hg::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}"
|
||||
::scobj::pfeiffer_hg::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}
|
||||
@@ -503,7 +517,7 @@ namespace eval ::scobj::pfeiffer_hg {
|
||||
|
||||
proc add_pfeiffer_hg {name ip_address tcp_port} {
|
||||
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
|
||||
::scobj::pfeiffer_hg::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port}
|
||||
::scobj::pfeiffer_hg::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port}
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_pfeiffer_hg.tcl"
|
||||
@@ -542,20 +556,31 @@ proc ::scobj::pfeiffer_hg::read_config {} {
|
||||
if { ![string equal -nocase "${simulation_flag}" "false"] } {
|
||||
set asyncqueue "null"
|
||||
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
|
||||
${ns}::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
} elseif { [dict exists $v "asyncqueue"] } {
|
||||
set asyncqueue [dict get $v "asyncqueue"]
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
set ip_address [dict get $v ip]
|
||||
set tcp_port [dict get $v port]
|
||||
}
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
} else {
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
} else {
|
||||
if { [dict exists $v "asyncprotocol"] } {
|
||||
set asyncprotocol [dict get $v "asyncprotocol"]
|
||||
} else {
|
||||
set asyncprotocol ${name}_protocol
|
||||
MakeAsyncProtocol ${asyncprotocol}
|
||||
if { [dict exists $v "terminator"] } {
|
||||
if { [dict exists $v "sendterminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "sendterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
if { [dict exists $v "replyterminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "replyterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
}
|
||||
@@ -566,12 +591,9 @@ proc ::scobj::pfeiffer_hg::read_config {} {
|
||||
if { [dict exists $v "timeout"] } {
|
||||
${asyncqueue} timeout "[dict get $v "timeout"]"
|
||||
}
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}
|
||||
} else {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue}
|
||||
}
|
||||
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,6 +217,14 @@ proc ::scobj::srs_sr630::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/id type "part"
|
||||
hsetprop ${scobj_hpath}/id nxalias "${name}_id"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/id 600
|
||||
hsetprop ${scobj_hpath}/id simulated false
|
||||
} else {
|
||||
::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for srs_sr630"
|
||||
hsetprop ${scobj_hpath}/id simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/sensor_01 plain user float
|
||||
hsetprop ${scobj_hpath}/sensor_01 read ${ns}::getSensor ${scobj_hpath} readSensor {1}
|
||||
hsetprop ${scobj_hpath}/sensor_01 readSensor ${ns}::readSensor ${scobj_hpath}
|
||||
@@ -230,6 +238,14 @@ proc ::scobj::srs_sr630::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/sensor_01 type "part"
|
||||
hsetprop ${scobj_hpath}/sensor_01 nxalias "${name}_sensor_01"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_01 60
|
||||
hsetprop ${scobj_hpath}/sensor_01 simulated false
|
||||
} else {
|
||||
::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for srs_sr630"
|
||||
hsetprop ${scobj_hpath}/sensor_01 simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/sensor_02 plain user float
|
||||
hsetprop ${scobj_hpath}/sensor_02 read ${ns}::getSensor ${scobj_hpath} readSensor {2}
|
||||
hsetprop ${scobj_hpath}/sensor_02 readSensor ${ns}::readSensor ${scobj_hpath}
|
||||
@@ -243,6 +259,14 @@ proc ::scobj::srs_sr630::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/sensor_02 type "part"
|
||||
hsetprop ${scobj_hpath}/sensor_02 nxalias "${name}_sensor_02"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_02 600
|
||||
hsetprop ${scobj_hpath}/sensor_02 simulated false
|
||||
} else {
|
||||
::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for srs_sr630"
|
||||
hsetprop ${scobj_hpath}/sensor_02 simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/sensor_03 plain user float
|
||||
hsetprop ${scobj_hpath}/sensor_03 read ${ns}::getSensor ${scobj_hpath} readSensor {3}
|
||||
hsetprop ${scobj_hpath}/sensor_03 readSensor ${ns}::readSensor ${scobj_hpath}
|
||||
@@ -256,6 +280,14 @@ proc ::scobj::srs_sr630::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/sensor_03 type "part"
|
||||
hsetprop ${scobj_hpath}/sensor_03 nxalias "${name}_sensor_03"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_03 600
|
||||
hsetprop ${scobj_hpath}/sensor_03 simulated false
|
||||
} else {
|
||||
::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for srs_sr630"
|
||||
hsetprop ${scobj_hpath}/sensor_03 simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/sensor_04 plain user float
|
||||
hsetprop ${scobj_hpath}/sensor_04 read ${ns}::getSensor ${scobj_hpath} readSensor {4}
|
||||
hsetprop ${scobj_hpath}/sensor_04 readSensor ${ns}::readSensor ${scobj_hpath}
|
||||
@@ -269,6 +301,14 @@ proc ::scobj::srs_sr630::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/sensor_04 type "part"
|
||||
hsetprop ${scobj_hpath}/sensor_04 nxalias "${name}_sensor_04"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_04 600
|
||||
hsetprop ${scobj_hpath}/sensor_04 simulated false
|
||||
} else {
|
||||
::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for srs_sr630"
|
||||
hsetprop ${scobj_hpath}/sensor_04 simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/sensor_05 plain user float
|
||||
hsetprop ${scobj_hpath}/sensor_05 read ${ns}::getSensor ${scobj_hpath} readSensor {5}
|
||||
hsetprop ${scobj_hpath}/sensor_05 readSensor ${ns}::readSensor ${scobj_hpath}
|
||||
@@ -282,6 +322,14 @@ proc ::scobj::srs_sr630::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/sensor_05 type "part"
|
||||
hsetprop ${scobj_hpath}/sensor_05 nxalias "${name}_sensor_05"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_05 600
|
||||
hsetprop ${scobj_hpath}/sensor_05 simulated false
|
||||
} else {
|
||||
::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for srs_sr630"
|
||||
hsetprop ${scobj_hpath}/sensor_05 simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/sensor_06 plain user float
|
||||
hsetprop ${scobj_hpath}/sensor_06 read ${ns}::getSensor ${scobj_hpath} readSensor {6}
|
||||
hsetprop ${scobj_hpath}/sensor_06 readSensor ${ns}::readSensor ${scobj_hpath}
|
||||
@@ -295,6 +343,14 @@ proc ::scobj::srs_sr630::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/sensor_06 type "part"
|
||||
hsetprop ${scobj_hpath}/sensor_06 nxalias "${name}_sensor_06"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_06 600
|
||||
hsetprop ${scobj_hpath}/sensor_06 simulated false
|
||||
} else {
|
||||
::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for srs_sr630"
|
||||
hsetprop ${scobj_hpath}/sensor_06 simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/sensor_07 plain user float
|
||||
hsetprop ${scobj_hpath}/sensor_07 read ${ns}::getSensor ${scobj_hpath} readSensor {7}
|
||||
hsetprop ${scobj_hpath}/sensor_07 readSensor ${ns}::readSensor ${scobj_hpath}
|
||||
@@ -308,6 +364,14 @@ proc ::scobj::srs_sr630::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/sensor_07 type "part"
|
||||
hsetprop ${scobj_hpath}/sensor_07 nxalias "${name}_sensor_07"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_07 600
|
||||
hsetprop ${scobj_hpath}/sensor_07 simulated false
|
||||
} else {
|
||||
::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for srs_sr630"
|
||||
hsetprop ${scobj_hpath}/sensor_07 simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/sensor_08 plain user float
|
||||
hsetprop ${scobj_hpath}/sensor_08 read ${ns}::getSensor ${scobj_hpath} readSensor {8}
|
||||
hsetprop ${scobj_hpath}/sensor_08 readSensor ${ns}::readSensor ${scobj_hpath}
|
||||
@@ -321,23 +385,17 @@ proc ::scobj::srs_sr630::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/sensor_08 type "part"
|
||||
hsetprop ${scobj_hpath}/sensor_08 nxalias "${name}_sensor_08"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_08 600
|
||||
hsetprop ${scobj_hpath}/sensor_08 simulated false
|
||||
} else {
|
||||
::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for srs_sr630"
|
||||
hsetprop ${scobj_hpath}/sensor_08 simulated true
|
||||
}
|
||||
|
||||
hsetprop ${scobj_hpath} data "true"
|
||||
hsetprop ${scobj_hpath} klass "@none"
|
||||
hsetprop ${scobj_hpath} type "part"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/id 600
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_01 60
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_02 600
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_03 600
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_04 600
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_05 600
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_06 600
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_07 600
|
||||
${sct_controller} poll ${scobj_hpath}/sensor_08 600
|
||||
} else {
|
||||
::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for srs_sr630"
|
||||
}
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
hsetprop ${scobj_hpath} debug_threshold 5
|
||||
@@ -358,7 +416,9 @@ proc ::scobj::srs_sr630::add_driver {name device_class simulation_flag ip_addres
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::srs_sr630::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for srs_sr630"
|
||||
::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for srs_sr630"
|
||||
::scobj::srs_sr630::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
}
|
||||
::scobj::srs_sr630::sics_log 1 "::scobj::srs_sr630::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}"
|
||||
::scobj::srs_sr630::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}
|
||||
@@ -376,7 +436,7 @@ namespace eval ::scobj::srs_sr630 {
|
||||
|
||||
proc add_srs_sr630 {name ip_address tcp_port} {
|
||||
set simulation_flag "[string tolower [SplitReply [detector_simulation]]]"
|
||||
::scobj::srs_sr630::add_driver ${name} "NXdetector" "${simulation_flag}" ${ip_address} ${tcp_port}
|
||||
::scobj::srs_sr630::add_driver ${name} "NXdetector" ${simulation_flag} ${ip_address} ${tcp_port}
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_srs_sr630.tcl"
|
||||
@@ -415,20 +475,31 @@ proc ::scobj::srs_sr630::read_config {} {
|
||||
if { ![string equal -nocase "${simulation_flag}" "false"] } {
|
||||
set asyncqueue "null"
|
||||
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
|
||||
${ns}::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
} elseif { [dict exists $v "asyncqueue"] } {
|
||||
set asyncqueue [dict get $v "asyncqueue"]
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
set ip_address [dict get $v ip]
|
||||
set tcp_port [dict get $v port]
|
||||
}
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
} else {
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
} else {
|
||||
if { [dict exists $v "asyncprotocol"] } {
|
||||
set asyncprotocol [dict get $v "asyncprotocol"]
|
||||
} else {
|
||||
set asyncprotocol ${name}_protocol
|
||||
MakeAsyncProtocol ${asyncprotocol}
|
||||
if { [dict exists $v "terminator"] } {
|
||||
if { [dict exists $v "sendterminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "sendterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
if { [dict exists $v "replyterminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "replyterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
}
|
||||
@@ -439,12 +510,9 @@ proc ::scobj::srs_sr630::read_config {} {
|
||||
if { [dict exists $v "timeout"] } {
|
||||
${asyncqueue} timeout "[dict get $v "timeout"]"
|
||||
}
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}
|
||||
} else {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue}
|
||||
}
|
||||
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,9 @@ proc ::scobj::watlow_mpm::add_driver {name device_class simulation_flag ip_addre
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::watlow_mpm::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for watlow_mpm"
|
||||
::scobj::watlow_mpm::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for watlow_mpm"
|
||||
::scobj::watlow_mpm::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
}
|
||||
::scobj::watlow_mpm::sics_log 1 "::scobj::watlow_mpm::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
|
||||
::scobj::watlow_mpm::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}
|
||||
@@ -78,7 +80,7 @@ namespace eval ::scobj::watlow_mpm {
|
||||
|
||||
proc add_watlow_mpm {name ip_address tcp_port id datype dev_id tol} {
|
||||
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
|
||||
::scobj::watlow_mpm::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${id}" "${datype}" "${dev_id}" "${tol}"
|
||||
::scobj::watlow_mpm::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_watlow_mpm.tcl"
|
||||
@@ -117,20 +119,31 @@ proc ::scobj::watlow_mpm::read_config {} {
|
||||
if { ![string equal -nocase "${simulation_flag}" "false"] } {
|
||||
set asyncqueue "null"
|
||||
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
|
||||
${ns}::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
} elseif { [dict exists $v "asyncqueue"] } {
|
||||
set asyncqueue [dict get $v "asyncqueue"]
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
set ip_address [dict get $v ip]
|
||||
set tcp_port [dict get $v port]
|
||||
}
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
} else {
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
} else {
|
||||
if { [dict exists $v "asyncprotocol"] } {
|
||||
set asyncprotocol [dict get $v "asyncprotocol"]
|
||||
} else {
|
||||
set asyncprotocol ${name}_protocol
|
||||
MakeAsyncProtocol ${asyncprotocol}
|
||||
if { [dict exists $v "terminator"] } {
|
||||
if { [dict exists $v "sendterminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "sendterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
if { [dict exists $v "replyterminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "replyterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
}
|
||||
@@ -141,6 +154,7 @@ proc ::scobj::watlow_mpm::read_config {} {
|
||||
if { [dict exists $v "timeout"] } {
|
||||
${asyncqueue} timeout "[dict get $v "timeout"]"
|
||||
}
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
set arg_list [list]
|
||||
set missing_list [list]
|
||||
@@ -157,11 +171,7 @@ proc ::scobj::watlow_mpm::read_config {} {
|
||||
if { [llength $missing_list] > 0 } {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,9 @@ proc ::scobj::watlow_mrm::add_driver {name device_class simulation_flag ip_addre
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::watlow_mrm::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for watlow_mrm"
|
||||
::scobj::watlow_mrm::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for watlow_mrm"
|
||||
::scobj::watlow_mrm::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
}
|
||||
::scobj::watlow_mrm::sics_log 1 "::scobj::watlow_mrm::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
|
||||
::scobj::watlow_mrm::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}
|
||||
@@ -78,7 +80,7 @@ namespace eval ::scobj::watlow_mrm {
|
||||
|
||||
proc add_watlow_mrm {name ip_address tcp_port id datype dev_id tol} {
|
||||
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
|
||||
::scobj::watlow_mrm::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${id}" "${datype}" "${dev_id}" "${tol}"
|
||||
::scobj::watlow_mrm::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_watlow_mrm.tcl"
|
||||
@@ -117,20 +119,31 @@ proc ::scobj::watlow_mrm::read_config {} {
|
||||
if { ![string equal -nocase "${simulation_flag}" "false"] } {
|
||||
set asyncqueue "null"
|
||||
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
|
||||
${ns}::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
} elseif { [dict exists $v "asyncqueue"] } {
|
||||
set asyncqueue [dict get $v "asyncqueue"]
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
set ip_address [dict get $v ip]
|
||||
set tcp_port [dict get $v port]
|
||||
}
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
} else {
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
} else {
|
||||
if { [dict exists $v "asyncprotocol"] } {
|
||||
set asyncprotocol [dict get $v "asyncprotocol"]
|
||||
} else {
|
||||
set asyncprotocol ${name}_protocol
|
||||
MakeAsyncProtocol ${asyncprotocol}
|
||||
if { [dict exists $v "terminator"] } {
|
||||
if { [dict exists $v "sendterminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "sendterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
if { [dict exists $v "replyterminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "replyterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
}
|
||||
@@ -141,6 +154,7 @@ proc ::scobj::watlow_mrm::read_config {} {
|
||||
if { [dict exists $v "timeout"] } {
|
||||
${asyncqueue} timeout "[dict get $v "timeout"]"
|
||||
}
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
set arg_list [list]
|
||||
set missing_list [list]
|
||||
@@ -157,11 +171,7 @@ proc ::scobj::watlow_mrm::read_config {} {
|
||||
if { [llength $missing_list] > 0 } {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,9 @@ proc ::scobj::watlow_mst4::add_driver {name device_class simulation_flag ip_addr
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::watlow_mst4::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for watlow_mst4"
|
||||
::scobj::watlow_mst4::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for watlow_mst4"
|
||||
::scobj::watlow_mst4::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
}
|
||||
::scobj::watlow_mst4::sics_log 1 "::scobj::watlow_mst4::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
|
||||
::scobj::watlow_mst4::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}
|
||||
@@ -78,7 +80,7 @@ namespace eval ::scobj::watlow_mst4 {
|
||||
|
||||
proc add_watlow_mst4 {name ip_address tcp_port id datype dev_id tol} {
|
||||
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
|
||||
::scobj::watlow_mst4::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${id}" "${datype}" "${dev_id}" "${tol}"
|
||||
::scobj::watlow_mst4::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_watlow_mst4.tcl"
|
||||
@@ -117,20 +119,31 @@ proc ::scobj::watlow_mst4::read_config {} {
|
||||
if { ![string equal -nocase "${simulation_flag}" "false"] } {
|
||||
set asyncqueue "null"
|
||||
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
|
||||
${ns}::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
} elseif { [dict exists $v "asyncqueue"] } {
|
||||
set asyncqueue [dict get $v "asyncqueue"]
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
set ip_address [dict get $v ip]
|
||||
set tcp_port [dict get $v port]
|
||||
}
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
} else {
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
} else {
|
||||
if { [dict exists $v "asyncprotocol"] } {
|
||||
set asyncprotocol [dict get $v "asyncprotocol"]
|
||||
} else {
|
||||
set asyncprotocol ${name}_protocol
|
||||
MakeAsyncProtocol ${asyncprotocol}
|
||||
if { [dict exists $v "terminator"] } {
|
||||
if { [dict exists $v "sendterminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "sendterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
if { [dict exists $v "replyterminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "replyterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
}
|
||||
@@ -141,6 +154,7 @@ proc ::scobj::watlow_mst4::read_config {} {
|
||||
if { [dict exists $v "timeout"] } {
|
||||
${asyncqueue} timeout "[dict get $v "timeout"]"
|
||||
}
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
set arg_list [list]
|
||||
set missing_list [list]
|
||||
@@ -157,11 +171,7 @@ proc ::scobj::watlow_mst4::read_config {} {
|
||||
if { [llength $missing_list] > 0 } {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace eval ::scobj::west4100 {
|
||||
|
||||
proc add_west4100 {name ip_address tcp_port dev_id} {
|
||||
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
|
||||
::scobj::west4100::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${dev_id}"
|
||||
::scobj::west4100::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} ${dev_id}
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_west4100.tcl"
|
||||
@@ -95,34 +95,7 @@ proc ::scobj::west4100::read_config {} {
|
||||
continue
|
||||
}
|
||||
if { [string equal -nocase [dict get $v "driver"] "west4100"] } {
|
||||
if { ![string equal -nocase "${simulation_flag}" "false"] } {
|
||||
set asyncqueue "null"
|
||||
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
|
||||
} elseif { [dict exists $v "asyncqueue"] } {
|
||||
set asyncqueue [dict get $v "asyncqueue"]
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
set ip_address [dict get $v ip]
|
||||
set tcp_port [dict get $v port]
|
||||
}
|
||||
} else {
|
||||
if { [dict exists $v "asyncprotocol"] } {
|
||||
set asyncprotocol [dict get $v "asyncprotocol"]
|
||||
} else {
|
||||
set asyncprotocol ${name}_protocol
|
||||
MakeAsyncProtocol ${asyncprotocol}
|
||||
if { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
|
||||
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
}
|
||||
set asyncqueue ${name}_queue
|
||||
set ip_address [dict get $v ip]
|
||||
set tcp_port [dict get $v port]
|
||||
MakeAsyncQueue ${asyncqueue} ${asyncprotocol} ${ip_address} ${tcp_port}
|
||||
if { [dict exists $v "timeout"] } {
|
||||
${asyncqueue} timeout "[dict get $v "timeout"]"
|
||||
}
|
||||
}
|
||||
::scobj::west4100::sics_log 9 "No sctcontroller for west4100"
|
||||
set arg_list [list]
|
||||
set missing_list [list]
|
||||
foreach arg {dev_id} {
|
||||
@@ -138,11 +111,7 @@ proc ::scobj::west4100::read_config {} {
|
||||
if { [llength $missing_list] > 0 } {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,12 @@ proc ::scobj::west_6100::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}"
|
||||
hupdateif ${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] } {
|
||||
@@ -363,6 +368,15 @@ proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/alarm1 type "part"
|
||||
hsetprop ${scobj_hpath}/alarm1 nxalias "${name}_alarm1"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/alarm1 1
|
||||
${sct_controller} write ${scobj_hpath}/alarm1
|
||||
hsetprop ${scobj_hpath}/alarm1 simulated false
|
||||
} else {
|
||||
::scobj::west_6100::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for west_6100"
|
||||
hsetprop ${scobj_hpath}/alarm1 simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/alarm2 plain user float
|
||||
hsetprop ${scobj_hpath}/alarm2 read ${ns}::getDecimal ${scobj_hpath} rdDecimal {14}
|
||||
hsetprop ${scobj_hpath}/alarm2 rdDecimal ${ns}::rdDecimal ${scobj_hpath}
|
||||
@@ -379,6 +393,15 @@ proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/alarm2 type "part"
|
||||
hsetprop ${scobj_hpath}/alarm2 nxalias "${name}_alarm2"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/alarm2 1
|
||||
${sct_controller} write ${scobj_hpath}/alarm2
|
||||
hsetprop ${scobj_hpath}/alarm2 simulated false
|
||||
} else {
|
||||
::scobj::west_6100::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for west_6100"
|
||||
hsetprop ${scobj_hpath}/alarm2 simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/power plain user int
|
||||
hsetprop ${scobj_hpath}/power read ${ns}::getInteger ${scobj_hpath} rdInteger {3}
|
||||
hsetprop ${scobj_hpath}/power rdInteger ${ns}::rdInteger ${scobj_hpath}
|
||||
@@ -392,6 +415,14 @@ proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/power type "part"
|
||||
hsetprop ${scobj_hpath}/power nxalias "${name}_power"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/power 1
|
||||
hsetprop ${scobj_hpath}/power simulated false
|
||||
} else {
|
||||
::scobj::west_6100::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for west_6100"
|
||||
hsetprop ${scobj_hpath}/power simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/powermax plain user int
|
||||
hsetprop ${scobj_hpath}/powermax read ${ns}::getInteger ${scobj_hpath} rdInteger {20}
|
||||
hsetprop ${scobj_hpath}/powermax rdInteger ${ns}::rdInteger ${scobj_hpath}
|
||||
@@ -408,6 +439,15 @@ proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/powermax type "part"
|
||||
hsetprop ${scobj_hpath}/powermax nxalias "${name}_powermax"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/powermax 1
|
||||
${sct_controller} write ${scobj_hpath}/powermax
|
||||
hsetprop ${scobj_hpath}/powermax simulated false
|
||||
} else {
|
||||
::scobj::west_6100::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for west_6100"
|
||||
hsetprop ${scobj_hpath}/powermax simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/ramprate plain user float
|
||||
hsetprop ${scobj_hpath}/ramprate read ${ns}::getDecimal ${scobj_hpath} rdDecimal {24}
|
||||
hsetprop ${scobj_hpath}/ramprate rdDecimal ${ns}::rdDecimal ${scobj_hpath}
|
||||
@@ -424,6 +464,15 @@ proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/ramprate type "part"
|
||||
hsetprop ${scobj_hpath}/ramprate nxalias "${name}_ramprate"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/ramprate 1
|
||||
${sct_controller} write ${scobj_hpath}/ramprate
|
||||
hsetprop ${scobj_hpath}/ramprate simulated false
|
||||
} else {
|
||||
::scobj::west_6100::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for west_6100"
|
||||
hsetprop ${scobj_hpath}/ramprate simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/sensor plain user float
|
||||
hsetprop ${scobj_hpath}/sensor read ${ns}::getDecimal ${scobj_hpath} rdDecimal {1}
|
||||
hsetprop ${scobj_hpath}/sensor rdDecimal ${ns}::rdDecimal ${scobj_hpath}
|
||||
@@ -439,6 +488,14 @@ proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/sensor type "part"
|
||||
hsetprop ${scobj_hpath}/sensor nxalias "${name}_sensor"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/sensor 1
|
||||
hsetprop ${scobj_hpath}/sensor simulated false
|
||||
} else {
|
||||
::scobj::west_6100::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for west_6100"
|
||||
hsetprop ${scobj_hpath}/sensor simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/setpoint plain user float
|
||||
hsetprop ${scobj_hpath}/setpoint read ${ns}::getDecimal ${scobj_hpath} rdDecimal {2}
|
||||
hsetprop ${scobj_hpath}/setpoint rdDecimal ${ns}::rdDecimal ${scobj_hpath}
|
||||
@@ -466,6 +523,15 @@ proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/setpoint type "drivable"
|
||||
hsetprop ${scobj_hpath}/setpoint nxalias "${name}_setpoint"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/setpoint 1
|
||||
${sct_controller} write ${scobj_hpath}/setpoint
|
||||
hsetprop ${scobj_hpath}/setpoint simulated false
|
||||
} else {
|
||||
::scobj::west_6100::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for west_6100"
|
||||
hsetprop ${scobj_hpath}/setpoint simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/w_sp plain user float
|
||||
hsetprop ${scobj_hpath}/w_sp read ${ns}::getDecimal ${scobj_hpath} rdDecimal {21}
|
||||
hsetprop ${scobj_hpath}/w_sp rdDecimal ${ns}::rdDecimal ${scobj_hpath}
|
||||
@@ -482,33 +548,21 @@ proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/w_sp type "part"
|
||||
hsetprop ${scobj_hpath}/w_sp nxalias "${name}_w_sp"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/w_sp 1
|
||||
${sct_controller} write ${scobj_hpath}/w_sp
|
||||
hsetprop ${scobj_hpath}/w_sp simulated false
|
||||
} else {
|
||||
::scobj::west_6100::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for west_6100"
|
||||
hsetprop ${scobj_hpath}/w_sp simulated true
|
||||
}
|
||||
|
||||
hsetprop ${scobj_hpath} data "true"
|
||||
hsetprop ${scobj_hpath} klass "@none"
|
||||
hsetprop ${scobj_hpath} type "part"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/alarm1 1
|
||||
${sct_controller} poll ${scobj_hpath}/alarm2 1
|
||||
${sct_controller} poll ${scobj_hpath}/power 1
|
||||
${sct_controller} poll ${scobj_hpath}/powermax 1
|
||||
${sct_controller} poll ${scobj_hpath}/ramprate 1
|
||||
${sct_controller} poll ${scobj_hpath}/sensor 1
|
||||
${sct_controller} poll ${scobj_hpath}/setpoint 1
|
||||
${sct_controller} poll ${scobj_hpath}/w_sp 1
|
||||
${sct_controller} write ${scobj_hpath}/alarm1
|
||||
${sct_controller} write ${scobj_hpath}/alarm2
|
||||
${sct_controller} write ${scobj_hpath}/powermax
|
||||
${sct_controller} write ${scobj_hpath}/ramprate
|
||||
${sct_controller} write ${scobj_hpath}/setpoint
|
||||
${sct_controller} write ${scobj_hpath}/w_sp
|
||||
} else {
|
||||
::scobj::west_6100::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for west_6100"
|
||||
}
|
||||
ansto_makesctdrive ${name}_setpoint ${scobj_hpath}/setpoint ${scobj_hpath}/sensor ${sct_controller}
|
||||
|
||||
hfactory ${scobj_hpath}/aux plain spy none
|
||||
hsetprop ${scobj_hpath}/aux data "false"
|
||||
hsetprop ${scobj_hpath}/aux klass "@none"
|
||||
hsetprop ${scobj_hpath}/aux type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/aux/decimal plain user int
|
||||
hsetprop ${scobj_hpath}/aux/decimal read ${ns}::getInteger ${scobj_hpath} rdInteger {18}
|
||||
@@ -523,6 +577,14 @@ proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/aux/decimal type "part"
|
||||
hsetprop ${scobj_hpath}/aux/decimal nxalias "${name}_aux_decimal"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/aux/decimal 2
|
||||
hsetprop ${scobj_hpath}/aux/decimal simulated false
|
||||
} else {
|
||||
::scobj::west_6100::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for west_6100"
|
||||
hsetprop ${scobj_hpath}/aux/decimal simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/aux/instatus plain user int
|
||||
hsetprop ${scobj_hpath}/aux/instatus read ${ns}::getInteger ${scobj_hpath} rdInteger {133}
|
||||
hsetprop ${scobj_hpath}/aux/instatus rdInteger ${ns}::rdInteger ${scobj_hpath}
|
||||
@@ -535,6 +597,14 @@ proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/aux/instatus type "part"
|
||||
hsetprop ${scobj_hpath}/aux/instatus nxalias "${name}_aux_instatus"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/aux/instatus 2
|
||||
hsetprop ${scobj_hpath}/aux/instatus simulated false
|
||||
} else {
|
||||
::scobj::west_6100::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for west_6100"
|
||||
hsetprop ${scobj_hpath}/aux/instatus simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/aux/model plain user int
|
||||
hsetprop ${scobj_hpath}/aux/model read ${ns}::getInteger ${scobj_hpath} rdInteger {122}
|
||||
hsetprop ${scobj_hpath}/aux/model rdInteger ${ns}::rdInteger ${scobj_hpath}
|
||||
@@ -548,18 +618,18 @@ proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_
|
||||
hsetprop ${scobj_hpath}/aux/model nxalias "${name}_aux_model"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/aux/decimal 2
|
||||
${sct_controller} poll ${scobj_hpath}/aux/instatus 2
|
||||
${sct_controller} poll ${scobj_hpath}/aux/model 2
|
||||
hsetprop ${scobj_hpath}/aux/model simulated false
|
||||
} else {
|
||||
::scobj::west_6100::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for west_6100"
|
||||
hsetprop ${scobj_hpath}/aux/model simulated true
|
||||
}
|
||||
hsetprop ${scobj_hpath}/aux data "false"
|
||||
hsetprop ${scobj_hpath}/aux klass "@none"
|
||||
hsetprop ${scobj_hpath}/aux type "part"
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
hsetprop ${scobj_hpath} debug_threshold 5
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
ansto_makesctdrive ${name}_setpoint ${scobj_hpath}/setpoint ${scobj_hpath}/sensor ${sct_controller}
|
||||
}
|
||||
# mkDriver hook code goes here
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
@@ -577,7 +647,9 @@ proc ::scobj::west_6100::add_driver {name device_class simulation_flag ip_addres
|
||||
makesctcontroller sct_${name} modbus_ap ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::west_6100::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for west_6100"
|
||||
::scobj::west_6100::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for west_6100"
|
||||
::scobj::west_6100::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
}
|
||||
::scobj::west_6100::sics_log 1 "::scobj::west_6100::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id}"
|
||||
::scobj::west_6100::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id}
|
||||
@@ -595,7 +667,7 @@ namespace eval ::scobj::west_6100 {
|
||||
|
||||
proc add_west_6100 {name ip_address tcp_port id} {
|
||||
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
|
||||
::scobj::west_6100::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${id}"
|
||||
::scobj::west_6100::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} ${id}
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_west_6100.tcl"
|
||||
@@ -634,20 +706,31 @@ proc ::scobj::west_6100::read_config {} {
|
||||
if { ![string equal -nocase "${simulation_flag}" "false"] } {
|
||||
set asyncqueue "null"
|
||||
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
|
||||
${ns}::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
} elseif { [dict exists $v "asyncqueue"] } {
|
||||
set asyncqueue [dict get $v "asyncqueue"]
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
set ip_address [dict get $v ip]
|
||||
set tcp_port [dict get $v port]
|
||||
}
|
||||
makesctcontroller sct_${name} modbus_ap ${ip_address}:${tcp_port}
|
||||
} else {
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
} else {
|
||||
if { [dict exists $v "asyncprotocol"] } {
|
||||
set asyncprotocol [dict get $v "asyncprotocol"]
|
||||
} else {
|
||||
set asyncprotocol ${name}_protocol
|
||||
MakeAsyncProtocol ${asyncprotocol}
|
||||
if { [dict exists $v "terminator"] } {
|
||||
if { [dict exists $v "sendterminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "sendterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
if { [dict exists $v "replyterminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "replyterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
}
|
||||
@@ -658,6 +741,7 @@ proc ::scobj::west_6100::read_config {} {
|
||||
if { [dict exists $v "timeout"] } {
|
||||
${asyncqueue} timeout "[dict get $v "timeout"]"
|
||||
}
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
set arg_list [list]
|
||||
set missing_list [list]
|
||||
@@ -674,11 +758,7 @@ proc ::scobj::west_6100::read_config {} {
|
||||
if { [llength $missing_list] > 0 } {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user