Regenerated drivers
This commit is contained in:
@@ -266,14 +266,14 @@ proc ::scobj::mercury_temp::setValue {tc_root nextState cmd_str} {
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
proc ::scobj::mercury_temp::mkDriver { sct_controller name ip_address tcp_port id tol } {
|
||||
::scobj::mercury_temp::sics_log 9 "::scobj::mercury_temp::mkDriver ${sct_controller} ${name} ${ip_address} ${tcp_port} ${id} ${tol}"
|
||||
proc ::scobj::mercury_temp::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port id tol } {
|
||||
::scobj::mercury_temp::sics_log 9 "::scobj::mercury_temp::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${tol}"
|
||||
set ns "[namespace current]"
|
||||
set catch_status [ catch {
|
||||
|
||||
MakeSICSObj ${name} SCT_OBJECT
|
||||
|
||||
sicslist setatt ${name} klass environment
|
||||
sicslist setatt ${name} klass ${device_class}
|
||||
sicslist setatt ${name} long_name ${name}
|
||||
|
||||
set scobj_hpath /sics/${name}
|
||||
@@ -351,19 +351,19 @@ proc ::scobj::mercury_temp::mkDriver { sct_controller name ip_address tcp_port i
|
||||
hsetprop ${scobj_hpath}/Loop4/setpoint type "drivable"
|
||||
hsetprop ${scobj_hpath}/Loop4/setpoint nxalias "${name}_Loop4_setpoint"
|
||||
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
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
|
||||
} else {
|
||||
::scobj::mercury_temp::sics_log 9 "[environment_simulation] => No poll/write for mercury_temp"
|
||||
::scobj::mercury_temp::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_temp"
|
||||
}
|
||||
hsetprop ${scobj_hpath} klass environment
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
hsetprop ${scobj_hpath} debug_threshold 5
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
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
|
||||
@@ -371,31 +371,37 @@ proc ::scobj::mercury_temp::mkDriver { sct_controller name ip_address tcp_port i
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
proc ::scobj::mercury_temp::add_driver {name device_class simulation_flag ip_address tcp_port {id 99} {tol 1}} {
|
||||
set catch_status [ catch {
|
||||
::scobj::mercury_temp::sics_log 9 "::scobj::mercury_temp::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${tol}"
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
|
||||
::scobj::mercury_temp::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
|
||||
makesctcontroller sct_${name} aqadapter ${tcp_port}
|
||||
} else {
|
||||
::scobj::mercury_temp::sics_log 9 "makesctcontroller sct_${name} std ${ip_address}:${tcp_port}"
|
||||
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 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}
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
namespace eval ::scobj::mercury_temp {
|
||||
namespace export debug_threshold
|
||||
namespace export debug_log
|
||||
namespace export sics_log
|
||||
namespace export mkDriver
|
||||
namespace export add_driver
|
||||
}
|
||||
|
||||
proc add_mercury_temp {name ip_address tcp_port {id 99} {tol 1}} {
|
||||
set catch_status [ catch {
|
||||
::scobj::mercury_temp::sics_log 9 "add_mercury_temp ${name} ${ip_address} ${tcp_port} ${id} ${tol}"
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
|
||||
::scobj::mercury_temp::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
|
||||
makesctcontroller sct_${name} aqadapter ${tcp_port}
|
||||
} else {
|
||||
::scobj::mercury_temp::sics_log 9 "makesctcontroller sct_${name} std ${ip_address}:${tcp_port}"
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::mercury_temp::sics_log 9 "[environment_simulation] => No sctcontroller for mercury_temp"
|
||||
}
|
||||
::scobj::mercury_temp::sics_log 1 "::scobj::mercury_temp::mkDriver sct_${name} ${name} ${ip_address} ${tcp_port} ${id} ${tol}"
|
||||
::scobj::mercury_temp::mkDriver sct_${name} ${name} ${ip_address} ${tcp_port} ${id} ${tol}
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
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}}"
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_mercury_temp.tcl"
|
||||
@@ -406,6 +412,8 @@ proc ::scobj::mercury_temp::read_config {} {
|
||||
set ns "::scobj::mercury_temp"
|
||||
dict for {k u} $::config_dict {
|
||||
if { [dict exists $u "implementation"] } {
|
||||
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
|
||||
set device_class "environment"
|
||||
if { !([dict exists $u "name"] && [dict exists $u "enabled"]) } {
|
||||
continue
|
||||
}
|
||||
@@ -413,6 +421,12 @@ proc ::scobj::mercury_temp::read_config {} {
|
||||
if { ! ([string equal -nocase $enabled "true" ] || [string equal -nocase $enabled "always"]) } {
|
||||
continue
|
||||
}
|
||||
if { [dict exists $u "simulation_group"] } {
|
||||
set simulation_flag [SplitReply [[string tolower [dict get $u "simulation_group"]]]]
|
||||
}
|
||||
if { [dict exists $u "device_class"] } {
|
||||
set device_class "[dict get $u "device_class"]"
|
||||
}
|
||||
set name [dict get $u name]
|
||||
set implementation [dict get $u "implementation"]
|
||||
if { !([dict exists $::config_dict $implementation]) } {
|
||||
@@ -423,9 +437,9 @@ proc ::scobj::mercury_temp::read_config {} {
|
||||
continue
|
||||
}
|
||||
if { [string equal -nocase [dict get $v "driver"] "mercury_temp"] } {
|
||||
if { ![string equal -nocase [SplitReply [environment_simulation]] "false"] } {
|
||||
if { ![string equal -nocase "${simulation_flag}" "false"] } {
|
||||
set asyncqueue "null"
|
||||
${ns}::sics_log 9 "[environment_simulation] => using null asyncqueue"
|
||||
${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"] } {
|
||||
@@ -467,9 +481,9 @@ proc ::scobj::mercury_temp::read_config {} {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
add_mercury_temp ${name} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
add_mercury_temp ${name} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user