Regen SCT drivers
This commit is contained in:
@@ -27,18 +27,18 @@ proc ::scobj::eurotherm_m2000::sics_log {debug_level debug_string} {
|
||||
} catch_message ]
|
||||
}
|
||||
|
||||
proc ::scobj::eurotherm_m2000::mkDriver { sct_controller name ip_address tcp_port id datype dev_id tol } {
|
||||
::scobj::eurotherm_m2000::sics_log 9 "::scobj::eurotherm_m2000::mkDriver ${sct_controller} ${name} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
|
||||
proc ::scobj::eurotherm_m2000::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port id datype dev_id tol } {
|
||||
::scobj::eurotherm_m2000::sics_log 9 "::scobj::eurotherm_m2000::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
|
||||
set ns "[namespace current]"
|
||||
set catch_status [ catch {
|
||||
|
||||
MakeSICSObj ${name} SCT_OBJECT user float
|
||||
|
||||
sicslist setatt ${name} klass environment
|
||||
sicslist setatt ${name} klass ${device_class}
|
||||
sicslist setatt ${name} long_name ${name}
|
||||
|
||||
set scobj_hpath /sics/${name}
|
||||
hsetprop ${scobj_hpath} klass environment
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
hsetprop ${scobj_hpath} debug_threshold 5
|
||||
# mkDriver hook code starts
|
||||
@@ -48,17 +48,10 @@ proc ::scobj::eurotherm_m2000::mkDriver { sct_controller name ip_address tcp_por
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
namespace eval ::scobj::eurotherm_m2000 {
|
||||
namespace export debug_threshold
|
||||
namespace export debug_log
|
||||
namespace export sics_log
|
||||
namespace export mkDriver
|
||||
}
|
||||
|
||||
proc add_eurotherm_m2000 {name ip_address tcp_port id datype dev_id tol} {
|
||||
proc ::scobj::eurotherm_m2000::add_driver {name device_class simulation_flag ip_address tcp_port id datype dev_id tol} {
|
||||
set catch_status [ catch {
|
||||
::scobj::eurotherm_m2000::sics_log 9 "add_eurotherm_m2000 ${name} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
::scobj::eurotherm_m2000::sics_log 9 "::scobj::eurotherm_m2000::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
|
||||
::scobj::eurotherm_m2000::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
|
||||
makesctcontroller sct_${name} aqadapter ${tcp_port}
|
||||
@@ -67,24 +60,39 @@ proc add_eurotherm_m2000 {name ip_address tcp_port id datype dev_id tol} {
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::eurotherm_m2000::sics_log 9 "[environment_simulation] => Null 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} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
|
||||
::scobj::eurotherm_m2000::mkDriver sct_${name} ${name} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}
|
||||
::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}
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
clientput "file evaluation of eurotherm_m2000_sct.tcl"
|
||||
::scobj::eurotherm_m2000::sics_log 9 "file evaluation of eurotherm_m2000_sct.tcl"
|
||||
namespace eval ::scobj::eurotherm_m2000 {
|
||||
namespace export debug_threshold
|
||||
namespace export debug_log
|
||||
namespace export sics_log
|
||||
namespace export mkDriver
|
||||
namespace export add_driver
|
||||
}
|
||||
|
||||
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}"
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_eurotherm_m2000.tcl"
|
||||
::scobj::eurotherm_m2000::sics_log 9 "file evaluation of sct_eurotherm_m2000.tcl"
|
||||
|
||||
proc ::scobj::eurotherm_m2000::read_config {} {
|
||||
set catch_status [ catch {
|
||||
set ns "::scobj::eurotherm_m2000"
|
||||
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
|
||||
}
|
||||
@@ -92,6 +100,12 @@ proc ::scobj::eurotherm_m2000::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]) } {
|
||||
@@ -102,9 +116,9 @@ proc ::scobj::eurotherm_m2000::read_config {} {
|
||||
continue
|
||||
}
|
||||
if { [string equal -nocase [dict get $v "driver"] "eurotherm_m2000"] } {
|
||||
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"] } {
|
||||
@@ -146,9 +160,9 @@ proc ::scobj::eurotherm_m2000::read_config {} {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
add_eurotherm_m2000 ${name} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
add_eurotherm_m2000 ${name} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -364,14 +364,14 @@ proc ::scobj::julabo_lh45_gen::setValue {tc_root nextState cmd_str} {
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name ip_address tcp_port id ctrl_sensor tol } {
|
||||
::scobj::julabo_lh45_gen::sics_log 9 "::scobj::julabo_lh45_gen::mkDriver ${sct_controller} ${name} ${ip_address} ${tcp_port} ${id} ${ctrl_sensor} ${tol}"
|
||||
proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port id ctrl_sensor tol } {
|
||||
::scobj::julabo_lh45_gen::sics_log 9 "::scobj::julabo_lh45_gen::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${ctrl_sensor} ${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}
|
||||
@@ -481,7 +481,7 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name ip_address tcp_por
|
||||
hsetprop ${scobj_hpath} klass "@none"
|
||||
hsetprop ${scobj_hpath} type "part"
|
||||
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
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
|
||||
@@ -489,7 +489,7 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name ip_address tcp_por
|
||||
${sct_controller} poll ${scobj_hpath}/subtemp_warnlimit 1
|
||||
${sct_controller} write ${scobj_hpath}/setpoint
|
||||
} else {
|
||||
::scobj::julabo_lh45_gen::sics_log 9 "[environment_simulation] => No poll/write for julabo_lh45_gen"
|
||||
::scobj::julabo_lh45_gen::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for julabo_lh45_gen"
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/mode plain spy none
|
||||
@@ -529,13 +529,13 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name ip_address tcp_por
|
||||
hsetprop ${scobj_hpath}/mode/on_else_off type "part"
|
||||
hsetprop ${scobj_hpath}/mode/on_else_off nxalias "${name}_mode_on_else_off"
|
||||
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
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
|
||||
} else {
|
||||
::scobj::julabo_lh45_gen::sics_log 9 "[environment_simulation] => No poll/write for julabo_lh45_gen"
|
||||
::scobj::julabo_lh45_gen::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for julabo_lh45_gen"
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/sensor plain spy none
|
||||
@@ -611,16 +611,16 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name ip_address tcp_por
|
||||
hsetprop ${scobj_hpath}/sensor/value units "C"
|
||||
hsetprop ${scobj_hpath}/sensor/value nxalias "${name}_sensor_value"
|
||||
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
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 "[environment_simulation] => No poll/write for julabo_lh45_gen"
|
||||
::scobj::julabo_lh45_gen::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for julabo_lh45_gen"
|
||||
}
|
||||
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}_setpoint ${scobj_hpath}/setpoint ${scobj_hpath}/sensor/value ${sct_controller}
|
||||
}
|
||||
# mkDriver hook code starts
|
||||
@@ -635,17 +635,10 @@ proc ::scobj::julabo_lh45_gen::mkDriver { sct_controller name ip_address tcp_por
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
namespace eval ::scobj::julabo_lh45_gen {
|
||||
namespace export debug_threshold
|
||||
namespace export debug_log
|
||||
namespace export sics_log
|
||||
namespace export mkDriver
|
||||
}
|
||||
|
||||
proc add_julabo_lh45_gen {name ip_address tcp_port {id 1} {ctrl_sensor "bath"} {tol 5.0}} {
|
||||
proc ::scobj::julabo_lh45_gen::add_driver {name device_class simulation_flag ip_address tcp_port {id 1} {ctrl_sensor "bath"} {tol 5.0}} {
|
||||
set catch_status [ catch {
|
||||
::scobj::julabo_lh45_gen::sics_log 9 "add_julabo_lh45_gen ${name} ${ip_address} ${tcp_port} ${id} ${ctrl_sensor} ${tol}"
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
::scobj::julabo_lh45_gen::sics_log 9 "::scobj::julabo_lh45_gen::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${ctrl_sensor} ${tol}"
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
|
||||
::scobj::julabo_lh45_gen::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
|
||||
makesctcontroller sct_${name} aqadapter ${tcp_port}
|
||||
@@ -654,24 +647,39 @@ proc add_julabo_lh45_gen {name ip_address tcp_port {id 1} {ctrl_sensor "bath"} {
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port} "\r"
|
||||
}
|
||||
} else {
|
||||
::scobj::julabo_lh45_gen::sics_log 9 "[environment_simulation] => Null 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} ${ip_address} ${tcp_port} ${id} ${ctrl_sensor} ${tol}"
|
||||
::scobj::julabo_lh45_gen::mkDriver sct_${name} ${name} ${ip_address} ${tcp_port} ${id} ${ctrl_sensor} ${tol}
|
||||
::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}
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
clientput "file evaluation of julabo_lh45_gen_sct.tcl"
|
||||
::scobj::julabo_lh45_gen::sics_log 9 "file evaluation of julabo_lh45_gen_sct.tcl"
|
||||
namespace eval ::scobj::julabo_lh45_gen {
|
||||
namespace export debug_threshold
|
||||
namespace export debug_log
|
||||
namespace export sics_log
|
||||
namespace export mkDriver
|
||||
namespace export add_driver
|
||||
}
|
||||
|
||||
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}}"
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_julabo_lh45_gen.tcl"
|
||||
::scobj::julabo_lh45_gen::sics_log 9 "file evaluation of sct_julabo_lh45_gen.tcl"
|
||||
|
||||
proc ::scobj::julabo_lh45_gen::read_config {} {
|
||||
set catch_status [ catch {
|
||||
set ns "::scobj::julabo_lh45_gen"
|
||||
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
|
||||
}
|
||||
@@ -679,6 +687,12 @@ proc ::scobj::julabo_lh45_gen::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]) } {
|
||||
@@ -689,9 +703,9 @@ proc ::scobj::julabo_lh45_gen::read_config {} {
|
||||
continue
|
||||
}
|
||||
if { [string equal -nocase [dict get $v "driver"] "julabo_lh45_gen"] } {
|
||||
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"] } {
|
||||
@@ -733,9 +747,9 @@ proc ::scobj::julabo_lh45_gen::read_config {} {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
add_julabo_lh45_gen ${name} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
add_julabo_lh45_gen ${name} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,14 +157,14 @@ proc ::scobj::lakeshore_218::setValue {tc_root nextState cmd_str} {
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
proc ::scobj::lakeshore_218::mkDriver { sct_controller name ip_address tcp_port } {
|
||||
::scobj::lakeshore_218::sics_log 9 "::scobj::lakeshore_218::mkDriver ${sct_controller} ${name} ${ip_address} ${tcp_port}"
|
||||
proc ::scobj::lakeshore_218::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port } {
|
||||
::scobj::lakeshore_218::sics_log 9 "::scobj::lakeshore_218::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}"
|
||||
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}
|
||||
@@ -186,10 +186,10 @@ proc ::scobj::lakeshore_218::mkDriver { sct_controller name ip_address tcp_port
|
||||
hsetprop ${scobj_hpath} klass "@none"
|
||||
hsetprop ${scobj_hpath} type "part"
|
||||
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/krdg 1
|
||||
} else {
|
||||
::scobj::lakeshore_218::sics_log 9 "[environment_simulation] => No poll/write for lakeshore_218"
|
||||
::scobj::lakeshore_218::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for lakeshore_218"
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/sensor plain spy none
|
||||
@@ -301,7 +301,7 @@ proc ::scobj::lakeshore_218::mkDriver { sct_controller name ip_address tcp_port
|
||||
hsetprop ${scobj_hpath}/sensor/ch8 type "part"
|
||||
hsetprop ${scobj_hpath}/sensor/ch8 nxalias "${name}_sensor_ch8"
|
||||
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
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
|
||||
@@ -311,9 +311,9 @@ proc ::scobj::lakeshore_218::mkDriver { sct_controller name ip_address tcp_port
|
||||
${sct_controller} poll ${scobj_hpath}/sensor/ch7 1
|
||||
${sct_controller} poll ${scobj_hpath}/sensor/ch8 1
|
||||
} else {
|
||||
::scobj::lakeshore_218::sics_log 9 "[environment_simulation] => No poll/write for lakeshore_218"
|
||||
::scobj::lakeshore_218::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for lakeshore_218"
|
||||
}
|
||||
hsetprop ${scobj_hpath} klass environment
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
hsetprop ${scobj_hpath} debug_threshold 5
|
||||
# mkDriver hook code goes here
|
||||
@@ -321,43 +321,51 @@ proc ::scobj::lakeshore_218::mkDriver { sct_controller name ip_address tcp_port
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
proc ::scobj::lakeshore_218::add_driver {name device_class simulation_flag ip_address tcp_port} {
|
||||
set catch_status [ catch {
|
||||
::scobj::lakeshore_218::sics_log 9 "::scobj::lakeshore_218::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}"
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
|
||||
::scobj::lakeshore_218::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
|
||||
makesctcontroller sct_${name} aqadapter ${tcp_port}
|
||||
} else {
|
||||
::scobj::lakeshore_218::sics_log 9 "makesctcontroller sct_${name} std ${ip_address}:${tcp_port}"
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::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}
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
namespace eval ::scobj::lakeshore_218 {
|
||||
namespace export debug_threshold
|
||||
namespace export debug_log
|
||||
namespace export sics_log
|
||||
namespace export mkDriver
|
||||
namespace export add_driver
|
||||
}
|
||||
|
||||
proc add_lakeshore_218 {name ip_address tcp_port} {
|
||||
set catch_status [ catch {
|
||||
::scobj::lakeshore_218::sics_log 9 "add_lakeshore_218 ${name} ${ip_address} ${tcp_port}"
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
|
||||
::scobj::lakeshore_218::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
|
||||
makesctcontroller sct_${name} aqadapter ${tcp_port}
|
||||
} else {
|
||||
::scobj::lakeshore_218::sics_log 9 "makesctcontroller sct_${name} std ${ip_address}:${tcp_port}"
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::lakeshore_218::sics_log 9 "[environment_simulation] => 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} ${ip_address} ${tcp_port}"
|
||||
::scobj::lakeshore_218::mkDriver sct_${name} ${name} ${ip_address} ${tcp_port}
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
set simulation_flag "[string tolower [SplitReply [detector_simulation]]]"
|
||||
::scobj::lakeshore_218::add_driver ${name} "NXdetector" "${simulation_flag}" ${ip_address} ${tcp_port}
|
||||
}
|
||||
|
||||
clientput "file evaluation of lakeshore_218_sct.tcl"
|
||||
::scobj::lakeshore_218::sics_log 9 "file evaluation of lakeshore_218_sct.tcl"
|
||||
clientput "file evaluation of sct_lakeshore_218.tcl"
|
||||
::scobj::lakeshore_218::sics_log 9 "file evaluation of sct_lakeshore_218.tcl"
|
||||
|
||||
proc ::scobj::lakeshore_218::read_config {} {
|
||||
set catch_status [ catch {
|
||||
set ns "::scobj::lakeshore_218"
|
||||
dict for {k u} $::config_dict {
|
||||
if { [dict exists $u "implementation"] } {
|
||||
set simulation_flag "[string tolower [SplitReply [detector_simulation]]]"
|
||||
set device_class "NXdetector"
|
||||
if { !([dict exists $u "name"] && [dict exists $u "enabled"]) } {
|
||||
continue
|
||||
}
|
||||
@@ -365,6 +373,12 @@ proc ::scobj::lakeshore_218::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]) } {
|
||||
@@ -375,9 +389,9 @@ proc ::scobj::lakeshore_218::read_config {} {
|
||||
continue
|
||||
}
|
||||
if { [string equal -nocase [dict get $v "driver"] "lakeshore_218"] } {
|
||||
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"] } {
|
||||
@@ -404,9 +418,9 @@ proc ::scobj::lakeshore_218::read_config {} {
|
||||
}
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
add_lakeshore_218 ${name} ${ip_address} ${tcp_port}
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}
|
||||
} else {
|
||||
add_lakeshore_218 ${name} "aqadapter" ${asyncqueue}
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,18 +27,19 @@ proc ::scobj::lakeshore_m370::sics_log {debug_level debug_string} {
|
||||
} catch_message ]
|
||||
}
|
||||
|
||||
proc ::scobj::lakeshore_m370::mkDriver { sct_controller name id tol} {
|
||||
::scobj::lakeshore_m370::sics_log 9 "::scobj::lakeshore_m370::mkDriver ${sct_controller} ${name} ${id} ${tol}"
|
||||
proc ::scobj::lakeshore_m370::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port id tol } {
|
||||
::scobj::lakeshore_m370::sics_log 9 "::scobj::lakeshore_m370::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 user none
|
||||
|
||||
sicslist setatt ${name} klass environment
|
||||
sicslist setatt ${name} klass ${device_class}
|
||||
sicslist setatt ${name} long_name ${name}
|
||||
|
||||
set scobj_hpath /sics/${name}
|
||||
hsetprop ${scobj_hpath} klass environment
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
hsetprop ${scobj_hpath} debug_threshold 5
|
||||
# mkDriver hook code starts
|
||||
::scobj::lakeshore_370::mk_sct_driver $sct_controller environment $name $tol
|
||||
@@ -51,77 +52,82 @@ proc ::scobj::lakeshore_m370::mkDriver { sct_controller name id tol} {
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
proc ::scobj::lakeshore_m370::add_driver {name device_class simulation_flag ip_address tcp_port id tol} {
|
||||
set catch_status [ catch {
|
||||
::scobj::lakeshore_m370::sics_log 9 "::scobj::lakeshore_m370::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::lakeshore_m370::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
|
||||
makesctcontroller sct_${name} aqadapter ${tcp_port}
|
||||
} else {
|
||||
::scobj::lakeshore_m370::sics_log 9 "makesctcontroller sct_${name} std ${ip_address}:${tcp_port}"
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::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}
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
namespace eval ::scobj::lakeshore_m370 {
|
||||
namespace export debug_threshold
|
||||
namespace export debug_log
|
||||
namespace export sics_log
|
||||
namespace export mkDriver
|
||||
namespace export add_driver
|
||||
}
|
||||
|
||||
proc add_lakeshore_m370 {name IP port id tol} {
|
||||
set catch_status [ catch {
|
||||
::scobj::lakeshore_m370::sics_log 9 "add_lakeshore_m370 ${name} ${IP} ${port} ${tol}"
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
if {[string equal -nocase "aqadapter" "${IP}"]} {
|
||||
::scobj::lakeshore_m370::sics_log 9 "makesctcontroller sct_${name} aqadapter ${port}"
|
||||
makesctcontroller sct_${name} aqadapter ${port}
|
||||
} else {
|
||||
::scobj::lakeshore_m370::sics_log 9 "makesctcontroller sct_${name} std ${IP}:${port}"
|
||||
makesctcontroller sct_${name} std ${IP}:${port}
|
||||
}
|
||||
} else {
|
||||
::scobj::lakeshore_m370::sics_log 9 "[environment_simulation] => 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} ${id} ${tol}"
|
||||
::scobj::lakeshore_m370::mkDriver sct_${name} ${name} ${id} ${tol}
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
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}"
|
||||
}
|
||||
|
||||
clientput "file evaluation of lakeshore_m370_sct.tcl"
|
||||
::scobj::lakeshore_m370::sics_log 9 "file evaluation of lakeshore_m370_sct.tcl"
|
||||
clientput "file evaluation of sct_lakeshore_m370.tcl"
|
||||
::scobj::lakeshore_m370::sics_log 9 "file evaluation of sct_lakeshore_m370.tcl"
|
||||
|
||||
proc ::scobj::lakeshore_m370::read_config {} {
|
||||
set catch_status [ catch {
|
||||
set ns "::scobj::lakeshore_m370"
|
||||
dict for {k v} $::config_dict {
|
||||
if { [dict exists $v "implementation"] } {
|
||||
if { !([dict exists $v "name"] && [dict exists $v "enabled"]) } {
|
||||
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
|
||||
}
|
||||
set enabled [string tolower [dict get $v "enabled"]]
|
||||
set enabled [string tolower [dict get $u "enabled"]]
|
||||
if { ! ([string equal -nocase $enabled "true" ] || [string equal -nocase $enabled "always"]) } {
|
||||
continue
|
||||
}
|
||||
set name [dict get $v name]
|
||||
set implementation [dict get $v "implementation"]
|
||||
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]) } {
|
||||
continue
|
||||
}
|
||||
set arg_list [list]
|
||||
foreach arg {id} {
|
||||
if {[dict exists $v $arg]} {
|
||||
lappend arg_list "[dict get $v $arg]"
|
||||
} else {
|
||||
${ns}::sics_log 9 "Missing configuration value $arg"
|
||||
error "Missing configuration value $arg"
|
||||
}
|
||||
}
|
||||
set v [dict get $::config_dict $implementation]
|
||||
if { !([dict exists $v "driver"]) } {
|
||||
continue
|
||||
}
|
||||
if { [string equal -nocase [dict get $v "driver"] "lakeshore_m370"] } {
|
||||
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"] } {
|
||||
set IP [dict get $v ip]
|
||||
set PORT [dict get $v port]
|
||||
set ip_address [dict get $v ip]
|
||||
set tcp_port [dict get $v port]
|
||||
}
|
||||
} else {
|
||||
if { [dict exists $v "asyncprotocol"] } {
|
||||
@@ -135,25 +141,32 @@ proc ::scobj::lakeshore_m370::read_config {} {
|
||||
}
|
||||
}
|
||||
set asyncqueue ${name}_queue
|
||||
set IP [dict get $v ip]
|
||||
set PORT [dict get $v port]
|
||||
MakeAsyncQueue ${asyncqueue} ${asyncprotocol} ${IP} ${PORT}
|
||||
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"]"
|
||||
}
|
||||
}
|
||||
foreach arg {tol} {
|
||||
if {[dict exists $v $arg]} {
|
||||
set arg_list [list]
|
||||
set missing_list [list]
|
||||
foreach arg {id tol} {
|
||||
if {[dict exists $u $arg]} {
|
||||
lappend arg_list "[dict get $u $arg]"
|
||||
} elseif {[dict exists $v $arg]} {
|
||||
lappend arg_list "[dict get $v $arg]"
|
||||
} else {
|
||||
${ns}::sics_log 9 "Missing configuration value $arg"
|
||||
error "Missing configuration value $arg"
|
||||
lappend missing_list $arg
|
||||
}
|
||||
}
|
||||
if { [llength $missing_list] > 0 } {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
add_lakeshore_m370 ${name} ${IP} ${PORT} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
add_lakeshore_m370 ${name} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,18 +27,18 @@ proc ::scobj::ls336::sics_log {debug_level debug_string} {
|
||||
} catch_message ]
|
||||
}
|
||||
|
||||
proc ::scobj::ls336::mkDriver { sct_controller name ip_address tcp_port id datype tol1 tol2 } {
|
||||
::scobj::ls336::sics_log 9 "::scobj::ls336::mkDriver ${sct_controller} ${name} ${ip_address} ${tcp_port} ${id} ${datype} ${tol1} ${tol2}"
|
||||
proc ::scobj::ls336::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port id datype tol1 tol2 } {
|
||||
::scobj::ls336::sics_log 9 "::scobj::ls336::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${tol1} ${tol2}"
|
||||
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}
|
||||
hsetprop ${scobj_hpath} klass environment
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
hsetprop ${scobj_hpath} debug_threshold 5
|
||||
# mkDriver hook code starts
|
||||
@@ -48,17 +48,10 @@ proc ::scobj::ls336::mkDriver { sct_controller name ip_address tcp_port id datyp
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
namespace eval ::scobj::ls336 {
|
||||
namespace export debug_threshold
|
||||
namespace export debug_log
|
||||
namespace export sics_log
|
||||
namespace export mkDriver
|
||||
}
|
||||
|
||||
proc add_ls336 {name ip_address tcp_port id datype {tol1 1.0} {tol2 1.0}} {
|
||||
proc ::scobj::ls336::add_driver {name device_class simulation_flag ip_address tcp_port id datype {tol1 1.0} {tol2 1.0}} {
|
||||
set catch_status [ catch {
|
||||
::scobj::ls336::sics_log 9 "add_ls336 ${name} ${ip_address} ${tcp_port} ${id} ${datype} ${tol1} ${tol2}"
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
::scobj::ls336::sics_log 9 "::scobj::ls336::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${tol1} ${tol2}"
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
|
||||
::scobj::ls336::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
|
||||
makesctcontroller sct_${name} aqadapter ${tcp_port}
|
||||
@@ -67,24 +60,39 @@ proc add_ls336 {name ip_address tcp_port id datype {tol1 1.0} {tol2 1.0}} {
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::ls336::sics_log 9 "[environment_simulation] => Null 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} ${ip_address} ${tcp_port} ${id} ${datype} ${tol1} ${tol2}"
|
||||
::scobj::ls336::mkDriver sct_${name} ${name} ${ip_address} ${tcp_port} ${id} ${datype} ${tol1} ${tol2}
|
||||
::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}
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
clientput "file evaluation of ls336_sct.tcl"
|
||||
::scobj::ls336::sics_log 9 "file evaluation of ls336_sct.tcl"
|
||||
namespace eval ::scobj::ls336 {
|
||||
namespace export debug_threshold
|
||||
namespace export debug_log
|
||||
namespace export sics_log
|
||||
namespace export mkDriver
|
||||
namespace export add_driver
|
||||
}
|
||||
|
||||
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}}"
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_ls336.tcl"
|
||||
::scobj::ls336::sics_log 9 "file evaluation of sct_ls336.tcl"
|
||||
|
||||
proc ::scobj::ls336::read_config {} {
|
||||
set catch_status [ catch {
|
||||
set ns "::scobj::ls336"
|
||||
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
|
||||
}
|
||||
@@ -92,6 +100,12 @@ proc ::scobj::ls336::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]) } {
|
||||
@@ -102,9 +116,9 @@ proc ::scobj::ls336::read_config {} {
|
||||
continue
|
||||
}
|
||||
if { [string equal -nocase [dict get $v "driver"] "ls336"] } {
|
||||
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"] } {
|
||||
@@ -146,9 +160,9 @@ proc ::scobj::ls336::read_config {} {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
add_ls336 ${name} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
add_ls336 ${name} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,18 +27,18 @@ proc ::scobj::ls340::sics_log {debug_level debug_string} {
|
||||
} catch_message ]
|
||||
}
|
||||
|
||||
proc ::scobj::ls340::mkDriver { sct_controller name ip_address tcp_port id datype tol1 tol2 } {
|
||||
::scobj::ls340::sics_log 9 "::scobj::ls340::mkDriver ${sct_controller} ${name} ${ip_address} ${tcp_port} ${id} ${datype} ${tol1} ${tol2}"
|
||||
proc ::scobj::ls340::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port id datype tol1 tol2 } {
|
||||
::scobj::ls340::sics_log 9 "::scobj::ls340::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${tol1} ${tol2}"
|
||||
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}
|
||||
hsetprop ${scobj_hpath} klass environment
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
hsetprop ${scobj_hpath} debug_threshold 5
|
||||
# mkDriver hook code starts
|
||||
@@ -48,17 +48,10 @@ proc ::scobj::ls340::mkDriver { sct_controller name ip_address tcp_port id datyp
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
namespace eval ::scobj::ls340 {
|
||||
namespace export debug_threshold
|
||||
namespace export debug_log
|
||||
namespace export sics_log
|
||||
namespace export mkDriver
|
||||
}
|
||||
|
||||
proc add_ls340 {name ip_address tcp_port id datype {tol1 1.0} {tol2 1.0}} {
|
||||
proc ::scobj::ls340::add_driver {name device_class simulation_flag ip_address tcp_port id datype {tol1 1.0} {tol2 1.0}} {
|
||||
set catch_status [ catch {
|
||||
::scobj::ls340::sics_log 9 "add_ls340 ${name} ${ip_address} ${tcp_port} ${id} ${datype} ${tol1} ${tol2}"
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
::scobj::ls340::sics_log 9 "::scobj::ls340::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${tol1} ${tol2}"
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
|
||||
::scobj::ls340::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
|
||||
makesctcontroller sct_${name} aqadapter ${tcp_port}
|
||||
@@ -67,24 +60,39 @@ proc add_ls340 {name ip_address tcp_port id datype {tol1 1.0} {tol2 1.0}} {
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::ls340::sics_log 9 "[environment_simulation] => Null 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} ${ip_address} ${tcp_port} ${id} ${datype} ${tol1} ${tol2}"
|
||||
::scobj::ls340::mkDriver sct_${name} ${name} ${ip_address} ${tcp_port} ${id} ${datype} ${tol1} ${tol2}
|
||||
::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}
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
clientput "file evaluation of ls340_sct.tcl"
|
||||
::scobj::ls340::sics_log 9 "file evaluation of ls340_sct.tcl"
|
||||
namespace eval ::scobj::ls340 {
|
||||
namespace export debug_threshold
|
||||
namespace export debug_log
|
||||
namespace export sics_log
|
||||
namespace export mkDriver
|
||||
namespace export add_driver
|
||||
}
|
||||
|
||||
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}}"
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_ls340.tcl"
|
||||
::scobj::ls340::sics_log 9 "file evaluation of sct_ls340.tcl"
|
||||
|
||||
proc ::scobj::ls340::read_config {} {
|
||||
set catch_status [ catch {
|
||||
set ns "::scobj::ls340"
|
||||
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
|
||||
}
|
||||
@@ -92,6 +100,12 @@ proc ::scobj::ls340::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]) } {
|
||||
@@ -102,9 +116,9 @@ proc ::scobj::ls340::read_config {} {
|
||||
continue
|
||||
}
|
||||
if { [string equal -nocase [dict get $v "driver"] "ls340"] } {
|
||||
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"] } {
|
||||
@@ -146,9 +160,9 @@ proc ::scobj::ls340::read_config {} {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
add_ls340 ${name} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
add_ls340 ${name} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -266,14 +266,14 @@ proc ::scobj::mercury_base::setValue {tc_root nextState cmd_str} {
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
proc ::scobj::mercury_base::mkDriver { sct_controller name ip_address tcp_port id tol } {
|
||||
::scobj::mercury_base::sics_log 9 "::scobj::mercury_base::mkDriver ${sct_controller} ${name} ${ip_address} ${tcp_port} ${id} ${tol}"
|
||||
proc ::scobj::mercury_base::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port id tol } {
|
||||
::scobj::mercury_base::sics_log 9 "::scobj::mercury_base::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,14 +351,14 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name ip_address tcp_port i
|
||||
hsetprop ${scobj_hpath}/Loop1/setpoint type "drivable"
|
||||
hsetprop ${scobj_hpath}/Loop1/setpoint nxalias "${name}_Loop1_setpoint"
|
||||
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
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
|
||||
} else {
|
||||
::scobj::mercury_base::sics_log 9 "[environment_simulation] => No poll/write for mercury_base"
|
||||
::scobj::mercury_base::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_base"
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop2 plain spy none
|
||||
@@ -434,14 +434,14 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name ip_address tcp_port i
|
||||
hsetprop ${scobj_hpath}/Loop2/setpoint type "drivable"
|
||||
hsetprop ${scobj_hpath}/Loop2/setpoint nxalias "${name}_Loop2_setpoint"
|
||||
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
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
|
||||
} else {
|
||||
::scobj::mercury_base::sics_log 9 "[environment_simulation] => No poll/write for mercury_base"
|
||||
::scobj::mercury_base::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_base"
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop3 plain spy none
|
||||
@@ -517,19 +517,19 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name ip_address tcp_port i
|
||||
hsetprop ${scobj_hpath}/Loop3/setpoint type "drivable"
|
||||
hsetprop ${scobj_hpath}/Loop3/setpoint nxalias "${name}_Loop3_setpoint"
|
||||
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
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
|
||||
} else {
|
||||
::scobj::mercury_base::sics_log 9 "[environment_simulation] => No poll/write for mercury_base"
|
||||
::scobj::mercury_base::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_base"
|
||||
}
|
||||
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}_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}
|
||||
@@ -539,17 +539,10 @@ proc ::scobj::mercury_base::mkDriver { sct_controller name ip_address tcp_port i
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
namespace eval ::scobj::mercury_base {
|
||||
namespace export debug_threshold
|
||||
namespace export debug_log
|
||||
namespace export sics_log
|
||||
namespace export mkDriver
|
||||
}
|
||||
|
||||
proc add_mercury_base {name ip_address tcp_port {id 99} {tol 1}} {
|
||||
proc ::scobj::mercury_base::add_driver {name device_class simulation_flag ip_address tcp_port {id 99} {tol 1}} {
|
||||
set catch_status [ catch {
|
||||
::scobj::mercury_base::sics_log 9 "add_mercury_base ${name} ${ip_address} ${tcp_port} ${id} ${tol}"
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
::scobj::mercury_base::sics_log 9 "::scobj::mercury_base::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_base::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
|
||||
makesctcontroller sct_${name} aqadapter ${tcp_port}
|
||||
@@ -558,24 +551,39 @@ proc add_mercury_base {name ip_address tcp_port {id 99} {tol 1}} {
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::mercury_base::sics_log 9 "[environment_simulation] => Null 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} ${ip_address} ${tcp_port} ${id} ${tol}"
|
||||
::scobj::mercury_base::mkDriver sct_${name} ${name} ${ip_address} ${tcp_port} ${id} ${tol}
|
||||
::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}
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
clientput "file evaluation of mercury_base_sct.tcl"
|
||||
::scobj::mercury_base::sics_log 9 "file evaluation of mercury_base_sct.tcl"
|
||||
namespace eval ::scobj::mercury_base {
|
||||
namespace export debug_threshold
|
||||
namespace export debug_log
|
||||
namespace export sics_log
|
||||
namespace export mkDriver
|
||||
namespace export add_driver
|
||||
}
|
||||
|
||||
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}}"
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_mercury_base.tcl"
|
||||
::scobj::mercury_base::sics_log 9 "file evaluation of sct_mercury_base.tcl"
|
||||
|
||||
proc ::scobj::mercury_base::read_config {} {
|
||||
set catch_status [ catch {
|
||||
set ns "::scobj::mercury_base"
|
||||
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
|
||||
}
|
||||
@@ -583,6 +591,12 @@ proc ::scobj::mercury_base::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]) } {
|
||||
@@ -593,9 +607,9 @@ proc ::scobj::mercury_base::read_config {} {
|
||||
continue
|
||||
}
|
||||
if { [string equal -nocase [dict get $v "driver"] "mercury_base"] } {
|
||||
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"] } {
|
||||
@@ -637,9 +651,9 @@ proc ::scobj::mercury_base::read_config {} {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
add_mercury_base ${name} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
add_mercury_base ${name} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,14 +137,14 @@ proc ::scobj::mercury_level::setValue {tc_root nextState cmd_str} {
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
proc ::scobj::mercury_level::mkDriver { sct_controller name ip_address tcp_port id } {
|
||||
::scobj::mercury_level::sics_log 9 "::scobj::mercury_level::mkDriver ${sct_controller} ${name} ${ip_address} ${tcp_port} ${id}"
|
||||
proc ::scobj::mercury_level::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port id } {
|
||||
::scobj::mercury_level::sics_log 9 "::scobj::mercury_level::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id}"
|
||||
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}
|
||||
@@ -184,13 +184,13 @@ proc ::scobj::mercury_level::mkDriver { sct_controller name ip_address tcp_port
|
||||
hsetprop ${scobj_hpath}/Level/Nitrogen type "part"
|
||||
hsetprop ${scobj_hpath}/Level/Nitrogen nxalias "${name}_Level_Nitrogen"
|
||||
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Level/Helium 15
|
||||
${sct_controller} poll ${scobj_hpath}/Level/Nitrogen 15
|
||||
} else {
|
||||
::scobj::mercury_level::sics_log 9 "[environment_simulation] => No poll/write for mercury_level"
|
||||
::scobj::mercury_level::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_level"
|
||||
}
|
||||
hsetprop ${scobj_hpath} klass environment
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
hsetprop ${scobj_hpath} debug_threshold 5
|
||||
# mkDriver hook code goes here
|
||||
@@ -198,43 +198,51 @@ proc ::scobj::mercury_level::mkDriver { sct_controller name ip_address tcp_port
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
proc ::scobj::mercury_level::add_driver {name device_class simulation_flag ip_address tcp_port {id 99}} {
|
||||
set catch_status [ catch {
|
||||
::scobj::mercury_level::sics_log 9 "::scobj::mercury_level::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id}"
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
|
||||
::scobj::mercury_level::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
|
||||
makesctcontroller sct_${name} aqadapter ${tcp_port}
|
||||
} else {
|
||||
::scobj::mercury_level::sics_log 9 "makesctcontroller sct_${name} std ${ip_address}:${tcp_port}"
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::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}
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
namespace eval ::scobj::mercury_level {
|
||||
namespace export debug_threshold
|
||||
namespace export debug_log
|
||||
namespace export sics_log
|
||||
namespace export mkDriver
|
||||
namespace export add_driver
|
||||
}
|
||||
|
||||
proc add_mercury_level {name ip_address tcp_port {id 99}} {
|
||||
set catch_status [ catch {
|
||||
::scobj::mercury_level::sics_log 9 "add_mercury_level ${name} ${ip_address} ${tcp_port} ${id}"
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
|
||||
::scobj::mercury_level::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
|
||||
makesctcontroller sct_${name} aqadapter ${tcp_port}
|
||||
} else {
|
||||
::scobj::mercury_level::sics_log 9 "makesctcontroller sct_${name} std ${ip_address}:${tcp_port}"
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::mercury_level::sics_log 9 "[environment_simulation] => 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} ${ip_address} ${tcp_port} ${id}"
|
||||
::scobj::mercury_level::mkDriver sct_${name} ${name} ${ip_address} ${tcp_port} ${id}
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
|
||||
::scobj::mercury_level::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${{id}" "${99}}"
|
||||
}
|
||||
|
||||
clientput "file evaluation of mercury_level_sct.tcl"
|
||||
::scobj::mercury_level::sics_log 9 "file evaluation of mercury_level_sct.tcl"
|
||||
clientput "file evaluation of sct_mercury_level.tcl"
|
||||
::scobj::mercury_level::sics_log 9 "file evaluation of sct_mercury_level.tcl"
|
||||
|
||||
proc ::scobj::mercury_level::read_config {} {
|
||||
set catch_status [ catch {
|
||||
set ns "::scobj::mercury_level"
|
||||
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
|
||||
}
|
||||
@@ -242,6 +250,12 @@ proc ::scobj::mercury_level::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]) } {
|
||||
@@ -252,9 +266,9 @@ proc ::scobj::mercury_level::read_config {} {
|
||||
continue
|
||||
}
|
||||
if { [string equal -nocase [dict get $v "driver"] "mercury_level"] } {
|
||||
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"] } {
|
||||
@@ -296,9 +310,9 @@ proc ::scobj::mercury_level::read_config {} {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
add_mercury_level ${name} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
add_mercury_level ${name} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -272,14 +272,14 @@ proc ::scobj::mercury_pres::setValue {tc_root nextState cmd_str} {
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
proc ::scobj::mercury_pres::mkDriver { sct_controller name ip_address tcp_port id tol } {
|
||||
::scobj::mercury_pres::sics_log 9 "::scobj::mercury_pres::mkDriver ${sct_controller} ${name} ${ip_address} ${tcp_port} ${id} ${tol}"
|
||||
proc ::scobj::mercury_pres::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port id tol } {
|
||||
::scobj::mercury_pres::sics_log 9 "::scobj::mercury_pres::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}
|
||||
@@ -346,18 +346,18 @@ proc ::scobj::mercury_pres::mkDriver { sct_controller name ip_address tcp_port i
|
||||
hsetprop ${scobj_hpath}/Loop8/setpoint type "drivable"
|
||||
hsetprop ${scobj_hpath}/Loop8/setpoint nxalias "${name}_Loop8_setpoint"
|
||||
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
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
|
||||
} else {
|
||||
::scobj::mercury_pres::sics_log 9 "[environment_simulation] => No poll/write for mercury_pres"
|
||||
::scobj::mercury_pres::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_pres"
|
||||
}
|
||||
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}_Loop8_setpoint ${scobj_hpath}/Loop8/setpoint ${scobj_hpath}/Loop8/sensor ${sct_controller}
|
||||
}
|
||||
# mkDriver hook code goes here
|
||||
@@ -365,43 +365,51 @@ proc ::scobj::mercury_pres::mkDriver { sct_controller name ip_address tcp_port i
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
proc ::scobj::mercury_pres::add_driver {name device_class simulation_flag ip_address tcp_port {id 99} {tol 1}} {
|
||||
set catch_status [ catch {
|
||||
::scobj::mercury_pres::sics_log 9 "::scobj::mercury_pres::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_pres::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
|
||||
makesctcontroller sct_${name} aqadapter ${tcp_port}
|
||||
} else {
|
||||
::scobj::mercury_pres::sics_log 9 "makesctcontroller sct_${name} std ${ip_address}:${tcp_port}"
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::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}
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
namespace eval ::scobj::mercury_pres {
|
||||
namespace export debug_threshold
|
||||
namespace export debug_log
|
||||
namespace export sics_log
|
||||
namespace export mkDriver
|
||||
namespace export add_driver
|
||||
}
|
||||
|
||||
proc add_mercury_pres {name ip_address tcp_port {id 99} {tol 1}} {
|
||||
set catch_status [ catch {
|
||||
::scobj::mercury_pres::sics_log 9 "add_mercury_pres ${name} ${ip_address} ${tcp_port} ${id} ${tol}"
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
|
||||
::scobj::mercury_pres::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
|
||||
makesctcontroller sct_${name} aqadapter ${tcp_port}
|
||||
} else {
|
||||
::scobj::mercury_pres::sics_log 9 "makesctcontroller sct_${name} std ${ip_address}:${tcp_port}"
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::mercury_pres::sics_log 9 "[environment_simulation] => 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} ${ip_address} ${tcp_port} ${id} ${tol}"
|
||||
::scobj::mercury_pres::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_pres::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${{id}" "${99}}" "${{tol}" "${1}}"
|
||||
}
|
||||
|
||||
clientput "file evaluation of mercury_pres_sct.tcl"
|
||||
::scobj::mercury_pres::sics_log 9 "file evaluation of mercury_pres_sct.tcl"
|
||||
clientput "file evaluation of sct_mercury_pres.tcl"
|
||||
::scobj::mercury_pres::sics_log 9 "file evaluation of sct_mercury_pres.tcl"
|
||||
|
||||
proc ::scobj::mercury_pres::read_config {} {
|
||||
set catch_status [ catch {
|
||||
set ns "::scobj::mercury_pres"
|
||||
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
|
||||
}
|
||||
@@ -409,6 +417,12 @@ proc ::scobj::mercury_pres::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]) } {
|
||||
@@ -419,9 +433,9 @@ proc ::scobj::mercury_pres::read_config {} {
|
||||
continue
|
||||
}
|
||||
if { [string equal -nocase [dict get $v "driver"] "mercury_pres"] } {
|
||||
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"] } {
|
||||
@@ -463,9 +477,9 @@ proc ::scobj::mercury_pres::read_config {} {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
add_mercury_pres ${name} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
add_mercury_pres ${name} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -300,14 +300,14 @@ proc ::scobj::mercury_scpi::setValve {tc_root nextState cmd_str} {
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
proc ::scobj::mercury_scpi::mkDriver { sct_controller name ip_address tcp_port id permlink tol valve_tol } {
|
||||
::scobj::mercury_scpi::sics_log 9 "::scobj::mercury_scpi::mkDriver ${sct_controller} ${name} ${ip_address} ${tcp_port} ${id} ${permlink} ${tol} ${valve_tol}"
|
||||
proc ::scobj::mercury_scpi::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port id permlink tol valve_tol } {
|
||||
::scobj::mercury_scpi::sics_log 9 "::scobj::mercury_scpi::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${permlink} ${tol} ${valve_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}
|
||||
@@ -347,11 +347,11 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name ip_address tcp_port i
|
||||
hsetprop ${scobj_hpath}/Level/Nitrogen type "part"
|
||||
hsetprop ${scobj_hpath}/Level/Nitrogen nxalias "${name}_Level_Nitrogen"
|
||||
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Level/Helium 15
|
||||
${sct_controller} poll ${scobj_hpath}/Level/Nitrogen 15
|
||||
} else {
|
||||
::scobj::mercury_scpi::sics_log 9 "[environment_simulation] => No poll/write for mercury_scpi"
|
||||
::scobj::mercury_scpi::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_scpi"
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop1 plain spy none
|
||||
@@ -427,14 +427,14 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name ip_address tcp_port i
|
||||
hsetprop ${scobj_hpath}/Loop1/setpoint type "drivable"
|
||||
hsetprop ${scobj_hpath}/Loop1/setpoint nxalias "${name}_Loop1_setpoint"
|
||||
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
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
|
||||
} else {
|
||||
::scobj::mercury_scpi::sics_log 9 "[environment_simulation] => No poll/write for mercury_scpi"
|
||||
::scobj::mercury_scpi::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_scpi"
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop2 plain spy none
|
||||
@@ -510,14 +510,14 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name ip_address tcp_port i
|
||||
hsetprop ${scobj_hpath}/Loop2/setpoint type "drivable"
|
||||
hsetprop ${scobj_hpath}/Loop2/setpoint nxalias "${name}_Loop2_setpoint"
|
||||
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
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
|
||||
} else {
|
||||
::scobj::mercury_scpi::sics_log 9 "[environment_simulation] => No poll/write for mercury_scpi"
|
||||
::scobj::mercury_scpi::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_scpi"
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop3 plain spy none
|
||||
@@ -593,14 +593,14 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name ip_address tcp_port i
|
||||
hsetprop ${scobj_hpath}/Loop3/setpoint type "drivable"
|
||||
hsetprop ${scobj_hpath}/Loop3/setpoint nxalias "${name}_Loop3_setpoint"
|
||||
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
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
|
||||
} else {
|
||||
::scobj::mercury_scpi::sics_log 9 "[environment_simulation] => No poll/write for mercury_scpi"
|
||||
::scobj::mercury_scpi::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_scpi"
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Loop4 plain spy none
|
||||
@@ -676,14 +676,14 @@ proc ::scobj::mercury_scpi::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_scpi::sics_log 9 "[environment_simulation] => No poll/write for mercury_scpi"
|
||||
::scobj::mercury_scpi::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_scpi"
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/Valve plain spy none
|
||||
@@ -731,16 +731,16 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name ip_address tcp_port i
|
||||
hsetprop ${scobj_hpath}/Valve/setpoint type "drivable"
|
||||
hsetprop ${scobj_hpath}/Valve/setpoint nxalias "${name}_Valve_setpoint"
|
||||
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Valve/sensor 5
|
||||
${sct_controller} write ${scobj_hpath}/Valve/setpoint
|
||||
} else {
|
||||
::scobj::mercury_scpi::sics_log 9 "[environment_simulation] => No poll/write for mercury_scpi"
|
||||
::scobj::mercury_scpi::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_scpi"
|
||||
}
|
||||
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}_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}
|
||||
@@ -752,17 +752,10 @@ proc ::scobj::mercury_scpi::mkDriver { sct_controller name ip_address tcp_port i
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
namespace eval ::scobj::mercury_scpi {
|
||||
namespace export debug_threshold
|
||||
namespace export debug_log
|
||||
namespace export sics_log
|
||||
namespace export mkDriver
|
||||
}
|
||||
|
||||
proc add_mercury_scpi {name ip_address tcp_port {id 99} {permlink LT} {tol 1} {valve_tol 2}} {
|
||||
proc ::scobj::mercury_scpi::add_driver {name device_class simulation_flag ip_address tcp_port {id 99} {permlink LT} {tol 1} {valve_tol 2}} {
|
||||
set catch_status [ catch {
|
||||
::scobj::mercury_scpi::sics_log 9 "add_mercury_scpi ${name} ${ip_address} ${tcp_port} ${id} ${permlink} ${tol} ${valve_tol}"
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
::scobj::mercury_scpi::sics_log 9 "::scobj::mercury_scpi::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${permlink} ${tol} ${valve_tol}"
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
|
||||
::scobj::mercury_scpi::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
|
||||
makesctcontroller sct_${name} aqadapter ${tcp_port}
|
||||
@@ -771,24 +764,39 @@ proc add_mercury_scpi {name ip_address tcp_port {id 99} {permlink LT} {tol 1} {v
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::mercury_scpi::sics_log 9 "[environment_simulation] => Null 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} ${ip_address} ${tcp_port} ${id} ${permlink} ${tol} ${valve_tol}"
|
||||
::scobj::mercury_scpi::mkDriver sct_${name} ${name} ${ip_address} ${tcp_port} ${id} ${permlink} ${tol} ${valve_tol}
|
||||
::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}
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
clientput "file evaluation of mercury_scpi_sct.tcl"
|
||||
::scobj::mercury_scpi::sics_log 9 "file evaluation of mercury_scpi_sct.tcl"
|
||||
namespace eval ::scobj::mercury_scpi {
|
||||
namespace export debug_threshold
|
||||
namespace export debug_log
|
||||
namespace export sics_log
|
||||
namespace export mkDriver
|
||||
namespace export add_driver
|
||||
}
|
||||
|
||||
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}}"
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_mercury_scpi.tcl"
|
||||
::scobj::mercury_scpi::sics_log 9 "file evaluation of sct_mercury_scpi.tcl"
|
||||
|
||||
proc ::scobj::mercury_scpi::read_config {} {
|
||||
set catch_status [ catch {
|
||||
set ns "::scobj::mercury_scpi"
|
||||
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
|
||||
}
|
||||
@@ -796,6 +804,12 @@ proc ::scobj::mercury_scpi::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]) } {
|
||||
@@ -806,9 +820,9 @@ proc ::scobj::mercury_scpi::read_config {} {
|
||||
continue
|
||||
}
|
||||
if { [string equal -nocase [dict get $v "driver"] "mercury_scpi"] } {
|
||||
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"] } {
|
||||
@@ -850,9 +864,9 @@ proc ::scobj::mercury_scpi::read_config {} {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
add_mercury_scpi ${name} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
add_mercury_scpi ${name} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,43 +371,51 @@ 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} => 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}
|
||||
} 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] => 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} ${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 mercury_temp_sct.tcl"
|
||||
::scobj::mercury_temp::sics_log 9 "file evaluation of mercury_temp_sct.tcl"
|
||||
clientput "file evaluation of sct_mercury_temp.tcl"
|
||||
::scobj::mercury_temp::sics_log 9 "file evaluation of sct_mercury_temp.tcl"
|
||||
|
||||
proc ::scobj::mercury_temp::read_config {} {
|
||||
set catch_status [ catch {
|
||||
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
|
||||
}
|
||||
@@ -415,6 +423,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]) } {
|
||||
@@ -425,9 +439,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"] } {
|
||||
@@ -469,9 +483,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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,14 +244,14 @@ proc ::scobj::mercury_valve::setValve {tc_root nextState cmd_str} {
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
proc ::scobj::mercury_valve::mkDriver { sct_controller name ip_address tcp_port id valve_tol } {
|
||||
::scobj::mercury_valve::sics_log 9 "::scobj::mercury_valve::mkDriver ${sct_controller} ${name} ${ip_address} ${tcp_port} ${id} ${valve_tol}"
|
||||
proc ::scobj::mercury_valve::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port id valve_tol } {
|
||||
::scobj::mercury_valve::sics_log 9 "::scobj::mercury_valve::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${valve_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}
|
||||
@@ -301,16 +301,16 @@ proc ::scobj::mercury_valve::mkDriver { sct_controller name ip_address tcp_port
|
||||
hsetprop ${scobj_hpath}/Valve/setpoint type "drivable"
|
||||
hsetprop ${scobj_hpath}/Valve/setpoint nxalias "${name}_Valve_setpoint"
|
||||
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/Valve/sensor 5
|
||||
${sct_controller} write ${scobj_hpath}/Valve/setpoint
|
||||
} else {
|
||||
::scobj::mercury_valve::sics_log 9 "[environment_simulation] => No poll/write for mercury_valve"
|
||||
::scobj::mercury_valve::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for mercury_valve"
|
||||
}
|
||||
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}_Valve_setpoint ${scobj_hpath}/Valve/setpoint ${scobj_hpath}/Valve/sensor ${sct_controller}
|
||||
}
|
||||
# mkDriver hook code goes here
|
||||
@@ -318,43 +318,51 @@ proc ::scobj::mercury_valve::mkDriver { sct_controller name ip_address tcp_port
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
proc ::scobj::mercury_valve::add_driver {name device_class simulation_flag ip_address tcp_port {id 99} {valve_tol 2}} {
|
||||
set catch_status [ catch {
|
||||
::scobj::mercury_valve::sics_log 9 "::scobj::mercury_valve::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${valve_tol}"
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
|
||||
::scobj::mercury_valve::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
|
||||
makesctcontroller sct_${name} aqadapter ${tcp_port}
|
||||
} else {
|
||||
::scobj::mercury_valve::sics_log 9 "makesctcontroller sct_${name} std ${ip_address}:${tcp_port}"
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::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}
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
namespace eval ::scobj::mercury_valve {
|
||||
namespace export debug_threshold
|
||||
namespace export debug_log
|
||||
namespace export sics_log
|
||||
namespace export mkDriver
|
||||
namespace export add_driver
|
||||
}
|
||||
|
||||
proc add_mercury_valve {name ip_address tcp_port {id 99} {valve_tol 2}} {
|
||||
set catch_status [ catch {
|
||||
::scobj::mercury_valve::sics_log 9 "add_mercury_valve ${name} ${ip_address} ${tcp_port} ${id} ${valve_tol}"
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
|
||||
::scobj::mercury_valve::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
|
||||
makesctcontroller sct_${name} aqadapter ${tcp_port}
|
||||
} else {
|
||||
::scobj::mercury_valve::sics_log 9 "makesctcontroller sct_${name} std ${ip_address}:${tcp_port}"
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::mercury_valve::sics_log 9 "[environment_simulation] => 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} ${ip_address} ${tcp_port} ${id} ${valve_tol}"
|
||||
::scobj::mercury_valve::mkDriver sct_${name} ${name} ${ip_address} ${tcp_port} ${id} ${valve_tol}
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
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}}"
|
||||
}
|
||||
|
||||
clientput "file evaluation of mercury_valve_sct.tcl"
|
||||
::scobj::mercury_valve::sics_log 9 "file evaluation of mercury_valve_sct.tcl"
|
||||
clientput "file evaluation of sct_mercury_valve.tcl"
|
||||
::scobj::mercury_valve::sics_log 9 "file evaluation of sct_mercury_valve.tcl"
|
||||
|
||||
proc ::scobj::mercury_valve::read_config {} {
|
||||
set catch_status [ catch {
|
||||
set ns "::scobj::mercury_valve"
|
||||
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
|
||||
}
|
||||
@@ -362,6 +370,12 @@ proc ::scobj::mercury_valve::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]) } {
|
||||
@@ -372,9 +386,9 @@ proc ::scobj::mercury_valve::read_config {} {
|
||||
continue
|
||||
}
|
||||
if { [string equal -nocase [dict get $v "driver"] "mercury_valve"] } {
|
||||
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"] } {
|
||||
@@ -416,9 +430,9 @@ proc ::scobj::mercury_valve::read_config {} {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
add_mercury_valve ${name} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
add_mercury_valve ${name} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,18 +27,18 @@ proc ::scobj::nprvasm2::sics_log {debug_level debug_string} {
|
||||
} catch_message ]
|
||||
}
|
||||
|
||||
proc ::scobj::nprvasm2::mkDriver { sct_controller name ip_address tcp_port tol } {
|
||||
::scobj::nprvasm2::sics_log 9 "::scobj::nprvasm2::mkDriver ${sct_controller} ${name} ${ip_address} ${tcp_port} ${tol}"
|
||||
proc ::scobj::nprvasm2::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port tol } {
|
||||
::scobj::nprvasm2::sics_log 9 "::scobj::nprvasm2::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${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}
|
||||
hsetprop ${scobj_hpath} klass environment
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
hsetprop ${scobj_hpath} debug_threshold 5
|
||||
# mkDriver hook code starts
|
||||
@@ -48,17 +48,10 @@ proc ::scobj::nprvasm2::mkDriver { sct_controller name ip_address tcp_port tol }
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
namespace eval ::scobj::nprvasm2 {
|
||||
namespace export debug_threshold
|
||||
namespace export debug_log
|
||||
namespace export sics_log
|
||||
namespace export mkDriver
|
||||
}
|
||||
|
||||
proc add_nprvasm2 {name ip_address tcp_port {tol 1.0}} {
|
||||
proc ::scobj::nprvasm2::add_driver {name device_class simulation_flag ip_address tcp_port {tol 1.0}} {
|
||||
set catch_status [ catch {
|
||||
::scobj::nprvasm2::sics_log 9 "add_nprvasm2 ${name} ${ip_address} ${tcp_port} ${tol}"
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
::scobj::nprvasm2::sics_log 9 "::scobj::nprvasm2::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${tol}"
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
|
||||
::scobj::nprvasm2::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
|
||||
makesctcontroller sct_${name} aqadapter ${tcp_port}
|
||||
@@ -67,24 +60,39 @@ proc add_nprvasm2 {name ip_address tcp_port {tol 1.0}} {
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::nprvasm2::sics_log 9 "[environment_simulation] => Null 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} ${ip_address} ${tcp_port} ${tol}"
|
||||
::scobj::nprvasm2::mkDriver sct_${name} ${name} ${ip_address} ${tcp_port} ${tol}
|
||||
::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}
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
clientput "file evaluation of nprvasm2_sct.tcl"
|
||||
::scobj::nprvasm2::sics_log 9 "file evaluation of nprvasm2_sct.tcl"
|
||||
namespace eval ::scobj::nprvasm2 {
|
||||
namespace export debug_threshold
|
||||
namespace export debug_log
|
||||
namespace export sics_log
|
||||
namespace export mkDriver
|
||||
namespace export add_driver
|
||||
}
|
||||
|
||||
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}}"
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_nprvasm2.tcl"
|
||||
::scobj::nprvasm2::sics_log 9 "file evaluation of sct_nprvasm2.tcl"
|
||||
|
||||
proc ::scobj::nprvasm2::read_config {} {
|
||||
set catch_status [ catch {
|
||||
set ns "::scobj::nprvasm2"
|
||||
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
|
||||
}
|
||||
@@ -92,6 +100,12 @@ proc ::scobj::nprvasm2::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]) } {
|
||||
@@ -102,9 +116,9 @@ proc ::scobj::nprvasm2::read_config {} {
|
||||
continue
|
||||
}
|
||||
if { [string equal -nocase [dict get $v "driver"] "nprvasm2"] } {
|
||||
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"] } {
|
||||
@@ -146,9 +160,9 @@ proc ::scobj::nprvasm2::read_config {} {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
add_nprvasm2 ${name} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
add_nprvasm2 ${name} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -370,8 +370,8 @@ proc ::scobj::pfeiffer_hg::setValue {tc_root nextState cmd_str} {
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
proc ::scobj::pfeiffer_hg::mkDriver { sct_controller name ip_address tcp_port } {
|
||||
::scobj::pfeiffer_hg::sics_log 9 "::scobj::pfeiffer_hg::mkDriver ${sct_controller} ${name} ${ip_address} ${tcp_port}"
|
||||
proc ::scobj::pfeiffer_hg::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port } {
|
||||
::scobj::pfeiffer_hg::sics_log 9 "::scobj::pfeiffer_hg::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}"
|
||||
set ns "[namespace current]"
|
||||
set catch_status [ catch {
|
||||
|
||||
@@ -379,7 +379,7 @@ proc ::scobj::pfeiffer_hg::mkDriver { sct_controller name ip_address tcp_port }
|
||||
|
||||
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}
|
||||
@@ -453,16 +453,16 @@ proc ::scobj::pfeiffer_hg::mkDriver { sct_controller name ip_address tcp_port }
|
||||
hsetprop ${scobj_hpath}/pressure/setpoint type "drivable"
|
||||
hsetprop ${scobj_hpath}/pressure/setpoint nxalias "${name}_pressure_setpoint"
|
||||
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/pressure/sensor 1
|
||||
${sct_controller} write ${scobj_hpath}/pressure/setpoint
|
||||
} else {
|
||||
::scobj::pfeiffer_hg::sics_log 9 "[environment_simulation] => No poll/write for pfeiffer_hg"
|
||||
::scobj::pfeiffer_hg::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for pfeiffer_hg"
|
||||
}
|
||||
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}_pressure_setpoint ${scobj_hpath}/pressure/setpoint ${scobj_hpath}/pressure/sensor ${sct_controller}
|
||||
}
|
||||
# mkDriver hook code starts
|
||||
@@ -473,17 +473,10 @@ proc ::scobj::pfeiffer_hg::mkDriver { sct_controller name ip_address tcp_port }
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
namespace eval ::scobj::pfeiffer_hg {
|
||||
namespace export debug_threshold
|
||||
namespace export debug_log
|
||||
namespace export sics_log
|
||||
namespace export mkDriver
|
||||
}
|
||||
|
||||
proc add_pfeiffer_hg {name ip_address tcp_port} {
|
||||
proc ::scobj::pfeiffer_hg::add_driver {name device_class simulation_flag ip_address tcp_port} {
|
||||
set catch_status [ catch {
|
||||
::scobj::pfeiffer_hg::sics_log 9 "add_pfeiffer_hg ${name} ${ip_address} ${tcp_port}"
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
::scobj::pfeiffer_hg::sics_log 9 "::scobj::pfeiffer_hg::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}"
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
|
||||
::scobj::pfeiffer_hg::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
|
||||
makesctcontroller sct_${name} aqadapter ${tcp_port}
|
||||
@@ -492,24 +485,39 @@ proc add_pfeiffer_hg {name ip_address tcp_port} {
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::pfeiffer_hg::sics_log 9 "[environment_simulation] => Null 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} ${ip_address} ${tcp_port}"
|
||||
::scobj::pfeiffer_hg::mkDriver sct_${name} ${name} ${ip_address} ${tcp_port}
|
||||
::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}
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
clientput "file evaluation of pfeiffer_hg_sct.tcl"
|
||||
::scobj::pfeiffer_hg::sics_log 9 "file evaluation of pfeiffer_hg_sct.tcl"
|
||||
namespace eval ::scobj::pfeiffer_hg {
|
||||
namespace export debug_threshold
|
||||
namespace export debug_log
|
||||
namespace export sics_log
|
||||
namespace export mkDriver
|
||||
namespace export add_driver
|
||||
}
|
||||
|
||||
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}
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_pfeiffer_hg.tcl"
|
||||
::scobj::pfeiffer_hg::sics_log 9 "file evaluation of sct_pfeiffer_hg.tcl"
|
||||
|
||||
proc ::scobj::pfeiffer_hg::read_config {} {
|
||||
set catch_status [ catch {
|
||||
set ns "::scobj::pfeiffer_hg"
|
||||
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
|
||||
}
|
||||
@@ -517,6 +525,12 @@ proc ::scobj::pfeiffer_hg::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]) } {
|
||||
@@ -527,9 +541,9 @@ proc ::scobj::pfeiffer_hg::read_config {} {
|
||||
continue
|
||||
}
|
||||
if { [string equal -nocase [dict get $v "driver"] "pfeiffer_hg"] } {
|
||||
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"] } {
|
||||
@@ -556,9 +570,9 @@ proc ::scobj::pfeiffer_hg::read_config {} {
|
||||
}
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
add_pfeiffer_hg ${name} ${ip_address} ${tcp_port}
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}
|
||||
} else {
|
||||
add_pfeiffer_hg ${name} "aqadapter" ${asyncqueue}
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,18 +27,18 @@ proc ::scobj::watlow_mpm::sics_log {debug_level debug_string} {
|
||||
} catch_message ]
|
||||
}
|
||||
|
||||
proc ::scobj::watlow_mpm::mkDriver { sct_controller name ip_address tcp_port id datype dev_id tol } {
|
||||
::scobj::watlow_mpm::sics_log 9 "::scobj::watlow_mpm::mkDriver ${sct_controller} ${name} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
|
||||
proc ::scobj::watlow_mpm::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port id datype dev_id tol } {
|
||||
::scobj::watlow_mpm::sics_log 9 "::scobj::watlow_mpm::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
|
||||
set ns "[namespace current]"
|
||||
set catch_status [ catch {
|
||||
|
||||
MakeSICSObj ${name} SCT_OBJECT user float
|
||||
|
||||
sicslist setatt ${name} klass environment
|
||||
sicslist setatt ${name} klass ${device_class}
|
||||
sicslist setatt ${name} long_name ${name}
|
||||
|
||||
set scobj_hpath /sics/${name}
|
||||
hsetprop ${scobj_hpath} klass environment
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
hsetprop ${scobj_hpath} debug_threshold 5
|
||||
# mkDriver hook code starts
|
||||
@@ -48,17 +48,10 @@ proc ::scobj::watlow_mpm::mkDriver { sct_controller name ip_address tcp_port id
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
namespace eval ::scobj::watlow_mpm {
|
||||
namespace export debug_threshold
|
||||
namespace export debug_log
|
||||
namespace export sics_log
|
||||
namespace export mkDriver
|
||||
}
|
||||
|
||||
proc add_watlow_mpm {name ip_address tcp_port id datype dev_id tol} {
|
||||
proc ::scobj::watlow_mpm::add_driver {name device_class simulation_flag ip_address tcp_port id datype dev_id tol} {
|
||||
set catch_status [ catch {
|
||||
::scobj::watlow_mpm::sics_log 9 "add_watlow_mpm ${name} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
::scobj::watlow_mpm::sics_log 9 "::scobj::watlow_mpm::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
|
||||
::scobj::watlow_mpm::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
|
||||
makesctcontroller sct_${name} aqadapter ${tcp_port}
|
||||
@@ -67,24 +60,39 @@ proc add_watlow_mpm {name ip_address tcp_port id datype dev_id tol} {
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::watlow_mpm::sics_log 9 "[environment_simulation] => Null 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} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
|
||||
::scobj::watlow_mpm::mkDriver sct_${name} ${name} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}
|
||||
::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}
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
clientput "file evaluation of watlow_mpm_sct.tcl"
|
||||
::scobj::watlow_mpm::sics_log 9 "file evaluation of watlow_mpm_sct.tcl"
|
||||
namespace eval ::scobj::watlow_mpm {
|
||||
namespace export debug_threshold
|
||||
namespace export debug_log
|
||||
namespace export sics_log
|
||||
namespace export mkDriver
|
||||
namespace export add_driver
|
||||
}
|
||||
|
||||
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}"
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_watlow_mpm.tcl"
|
||||
::scobj::watlow_mpm::sics_log 9 "file evaluation of sct_watlow_mpm.tcl"
|
||||
|
||||
proc ::scobj::watlow_mpm::read_config {} {
|
||||
set catch_status [ catch {
|
||||
set ns "::scobj::watlow_mpm"
|
||||
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
|
||||
}
|
||||
@@ -92,6 +100,12 @@ proc ::scobj::watlow_mpm::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]) } {
|
||||
@@ -102,9 +116,9 @@ proc ::scobj::watlow_mpm::read_config {} {
|
||||
continue
|
||||
}
|
||||
if { [string equal -nocase [dict get $v "driver"] "watlow_mpm"] } {
|
||||
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"] } {
|
||||
@@ -146,9 +160,9 @@ proc ::scobj::watlow_mpm::read_config {} {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
add_watlow_mpm ${name} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
add_watlow_mpm ${name} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,18 +27,18 @@ proc ::scobj::watlow_mrm::sics_log {debug_level debug_string} {
|
||||
} catch_message ]
|
||||
}
|
||||
|
||||
proc ::scobj::watlow_mrm::mkDriver { sct_controller name ip_address tcp_port id datype dev_id tol } {
|
||||
::scobj::watlow_mrm::sics_log 9 "::scobj::watlow_mrm::mkDriver ${sct_controller} ${name} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
|
||||
proc ::scobj::watlow_mrm::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port id datype dev_id tol } {
|
||||
::scobj::watlow_mrm::sics_log 9 "::scobj::watlow_mrm::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
|
||||
set ns "[namespace current]"
|
||||
set catch_status [ catch {
|
||||
|
||||
MakeSICSObj ${name} SCT_OBJECT user float
|
||||
|
||||
sicslist setatt ${name} klass environment
|
||||
sicslist setatt ${name} klass ${device_class}
|
||||
sicslist setatt ${name} long_name ${name}
|
||||
|
||||
set scobj_hpath /sics/${name}
|
||||
hsetprop ${scobj_hpath} klass environment
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
hsetprop ${scobj_hpath} debug_threshold 5
|
||||
# mkDriver hook code starts
|
||||
@@ -48,17 +48,10 @@ proc ::scobj::watlow_mrm::mkDriver { sct_controller name ip_address tcp_port id
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
namespace eval ::scobj::watlow_mrm {
|
||||
namespace export debug_threshold
|
||||
namespace export debug_log
|
||||
namespace export sics_log
|
||||
namespace export mkDriver
|
||||
}
|
||||
|
||||
proc add_watlow_mrm {name ip_address tcp_port id datype dev_id tol} {
|
||||
proc ::scobj::watlow_mrm::add_driver {name device_class simulation_flag ip_address tcp_port id datype dev_id tol} {
|
||||
set catch_status [ catch {
|
||||
::scobj::watlow_mrm::sics_log 9 "add_watlow_mrm ${name} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
::scobj::watlow_mrm::sics_log 9 "::scobj::watlow_mrm::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
|
||||
::scobj::watlow_mrm::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
|
||||
makesctcontroller sct_${name} aqadapter ${tcp_port}
|
||||
@@ -67,24 +60,39 @@ proc add_watlow_mrm {name ip_address tcp_port id datype dev_id tol} {
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::watlow_mrm::sics_log 9 "[environment_simulation] => Null 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} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
|
||||
::scobj::watlow_mrm::mkDriver sct_${name} ${name} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}
|
||||
::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}
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
clientput "file evaluation of watlow_mrm_sct.tcl"
|
||||
::scobj::watlow_mrm::sics_log 9 "file evaluation of watlow_mrm_sct.tcl"
|
||||
namespace eval ::scobj::watlow_mrm {
|
||||
namespace export debug_threshold
|
||||
namespace export debug_log
|
||||
namespace export sics_log
|
||||
namespace export mkDriver
|
||||
namespace export add_driver
|
||||
}
|
||||
|
||||
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}"
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_watlow_mrm.tcl"
|
||||
::scobj::watlow_mrm::sics_log 9 "file evaluation of sct_watlow_mrm.tcl"
|
||||
|
||||
proc ::scobj::watlow_mrm::read_config {} {
|
||||
set catch_status [ catch {
|
||||
set ns "::scobj::watlow_mrm"
|
||||
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
|
||||
}
|
||||
@@ -92,6 +100,12 @@ proc ::scobj::watlow_mrm::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]) } {
|
||||
@@ -102,9 +116,9 @@ proc ::scobj::watlow_mrm::read_config {} {
|
||||
continue
|
||||
}
|
||||
if { [string equal -nocase [dict get $v "driver"] "watlow_mrm"] } {
|
||||
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"] } {
|
||||
@@ -146,9 +160,9 @@ proc ::scobj::watlow_mrm::read_config {} {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
add_watlow_mrm ${name} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
add_watlow_mrm ${name} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,18 +27,18 @@ proc ::scobj::watlow_mst4::sics_log {debug_level debug_string} {
|
||||
} catch_message ]
|
||||
}
|
||||
|
||||
proc ::scobj::watlow_mst4::mkDriver { sct_controller name ip_address tcp_port id datype dev_id tol } {
|
||||
::scobj::watlow_mst4::sics_log 9 "::scobj::watlow_mst4::mkDriver ${sct_controller} ${name} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
|
||||
proc ::scobj::watlow_mst4::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port id datype dev_id tol } {
|
||||
::scobj::watlow_mst4::sics_log 9 "::scobj::watlow_mst4::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
|
||||
set ns "[namespace current]"
|
||||
set catch_status [ catch {
|
||||
|
||||
MakeSICSObj ${name} SCT_OBJECT user float
|
||||
|
||||
sicslist setatt ${name} klass environment
|
||||
sicslist setatt ${name} klass ${device_class}
|
||||
sicslist setatt ${name} long_name ${name}
|
||||
|
||||
set scobj_hpath /sics/${name}
|
||||
hsetprop ${scobj_hpath} klass environment
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
hsetprop ${scobj_hpath} debug_threshold 5
|
||||
# mkDriver hook code starts
|
||||
@@ -48,17 +48,10 @@ proc ::scobj::watlow_mst4::mkDriver { sct_controller name ip_address tcp_port id
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
namespace eval ::scobj::watlow_mst4 {
|
||||
namespace export debug_threshold
|
||||
namespace export debug_log
|
||||
namespace export sics_log
|
||||
namespace export mkDriver
|
||||
}
|
||||
|
||||
proc add_watlow_mst4 {name ip_address tcp_port id datype dev_id tol} {
|
||||
proc ::scobj::watlow_mst4::add_driver {name device_class simulation_flag ip_address tcp_port id datype dev_id tol} {
|
||||
set catch_status [ catch {
|
||||
::scobj::watlow_mst4::sics_log 9 "add_watlow_mst4 ${name} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
::scobj::watlow_mst4::sics_log 9 "::scobj::watlow_mst4::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
|
||||
::scobj::watlow_mst4::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
|
||||
makesctcontroller sct_${name} aqadapter ${tcp_port}
|
||||
@@ -67,24 +60,39 @@ proc add_watlow_mst4 {name ip_address tcp_port id datype dev_id tol} {
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::watlow_mst4::sics_log 9 "[environment_simulation] => Null 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} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}"
|
||||
::scobj::watlow_mst4::mkDriver sct_${name} ${name} ${ip_address} ${tcp_port} ${id} ${datype} ${dev_id} ${tol}
|
||||
::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}
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
clientput "file evaluation of watlow_mst4_sct.tcl"
|
||||
::scobj::watlow_mst4::sics_log 9 "file evaluation of watlow_mst4_sct.tcl"
|
||||
namespace eval ::scobj::watlow_mst4 {
|
||||
namespace export debug_threshold
|
||||
namespace export debug_log
|
||||
namespace export sics_log
|
||||
namespace export mkDriver
|
||||
namespace export add_driver
|
||||
}
|
||||
|
||||
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}"
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_watlow_mst4.tcl"
|
||||
::scobj::watlow_mst4::sics_log 9 "file evaluation of sct_watlow_mst4.tcl"
|
||||
|
||||
proc ::scobj::watlow_mst4::read_config {} {
|
||||
set catch_status [ catch {
|
||||
set ns "::scobj::watlow_mst4"
|
||||
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
|
||||
}
|
||||
@@ -92,6 +100,12 @@ proc ::scobj::watlow_mst4::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]) } {
|
||||
@@ -102,9 +116,9 @@ proc ::scobj::watlow_mst4::read_config {} {
|
||||
continue
|
||||
}
|
||||
if { [string equal -nocase [dict get $v "driver"] "watlow_mst4"] } {
|
||||
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"] } {
|
||||
@@ -146,9 +160,9 @@ proc ::scobj::watlow_mst4::read_config {} {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
add_watlow_mst4 ${name} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
add_watlow_mst4 ${name} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,8 +62,8 @@ proc add_west4100 {name ip_address tcp_port dev_id} {
|
||||
::scobj::west4100::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${dev_id}"
|
||||
}
|
||||
|
||||
clientput "file evaluation of west4100_sct.tcl"
|
||||
::scobj::west4100::sics_log 9 "file evaluation of west4100_sct.tcl"
|
||||
clientput "file evaluation of sct_west4100.tcl"
|
||||
::scobj::west4100::sics_log 9 "file evaluation of sct_west4100.tcl"
|
||||
|
||||
proc ::scobj::west4100::read_config {} {
|
||||
set catch_status [ catch {
|
||||
|
||||
@@ -126,7 +126,10 @@ proc ::scobj::west_6100::rdDecimal {tc_root} {
|
||||
error "[sct geterror]"
|
||||
}
|
||||
# rdDecimal hook code starts
|
||||
set data [expr {0.10 * ${data}}]
|
||||
set decimal [hval ${tc_root}/aux/decimal]
|
||||
if { ${decimal} > 0 } {
|
||||
set data [expr {pow(10, -${decimal}) * ${data}}]
|
||||
}
|
||||
# rdDecimal hook code ends
|
||||
if { [hpropexists [sct] geterror] } {
|
||||
debug_log ${tc_root} 9 "[sct] error: [sct geterror]"
|
||||
@@ -203,7 +206,12 @@ proc ::scobj::west_6100::wrDecimal {tc_root nextState cmd_str} {
|
||||
set par [sct target]
|
||||
set cmd "${cmd_str}${par}"
|
||||
# wrDecimal hook code starts
|
||||
set par [expr {round(10.0 * [sct target])}]
|
||||
set decimal [hval ${tc_root}/aux/decimal]
|
||||
set par [sct target]
|
||||
if { ${decimal} > 0 } {
|
||||
set par [expr {pow(10, ${decimal}) * ${par}}]
|
||||
}
|
||||
set par [expr {round(${par})}]
|
||||
set cmd "1:16:${cmd_str}:1:U16:${par}"
|
||||
# wrDecimal hook code ends
|
||||
if { [hpropexists [sct] geterror] } {
|
||||
@@ -254,14 +262,14 @@ proc ::scobj::west_6100::wrInteger {tc_root nextState cmd_str} {
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
proc ::scobj::west_6100::mkDriver { sct_controller name ip_address tcp_port dev_id } {
|
||||
::scobj::west_6100::sics_log 9 "::scobj::west_6100::mkDriver ${sct_controller} ${name} ${ip_address} ${tcp_port} ${dev_id}"
|
||||
proc ::scobj::west_6100::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port dev_id } {
|
||||
::scobj::west_6100::sics_log 9 "::scobj::west_6100::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${dev_id}"
|
||||
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}
|
||||
@@ -392,7 +400,7 @@ proc ::scobj::west_6100::mkDriver { sct_controller name ip_address tcp_port dev_
|
||||
hsetprop ${scobj_hpath} klass "@none"
|
||||
hsetprop ${scobj_hpath} type "part"
|
||||
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
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
|
||||
@@ -408,7 +416,7 @@ proc ::scobj::west_6100::mkDriver { sct_controller name ip_address tcp_port dev_
|
||||
${sct_controller} write ${scobj_hpath}/setpoint
|
||||
${sct_controller} write ${scobj_hpath}/w_sp
|
||||
} else {
|
||||
::scobj::west_6100::sics_log 9 "[environment_simulation] => No poll/write for west_6100"
|
||||
::scobj::west_6100::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for west_6100"
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/aux plain spy none
|
||||
@@ -424,6 +432,7 @@ proc ::scobj::west_6100::mkDriver { sct_controller name ip_address tcp_port dev_
|
||||
hsetprop ${scobj_hpath}/aux/decimal mutable false
|
||||
hsetprop ${scobj_hpath}/aux/decimal nxsave false
|
||||
hsetprop ${scobj_hpath}/aux/decimal oldval 0
|
||||
hset ${scobj_hpath}/aux/decimal 0
|
||||
hsetprop ${scobj_hpath}/aux/decimal sdsinfo "::nexus::scobj::sdsinfo"
|
||||
hsetprop ${scobj_hpath}/aux/decimal type "part"
|
||||
hsetprop ${scobj_hpath}/aux/decimal nxalias "${name}_aux_decimal"
|
||||
@@ -452,14 +461,14 @@ proc ::scobj::west_6100::mkDriver { sct_controller name ip_address tcp_port dev_
|
||||
hsetprop ${scobj_hpath}/aux/model type "part"
|
||||
hsetprop ${scobj_hpath}/aux/model nxalias "${name}_aux_model"
|
||||
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
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
|
||||
} else {
|
||||
::scobj::west_6100::sics_log 9 "[environment_simulation] => No poll/write for west_6100"
|
||||
::scobj::west_6100::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for west_6100"
|
||||
}
|
||||
hsetprop ${scobj_hpath} klass environment
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
hsetprop ${scobj_hpath} debug_threshold 5
|
||||
# mkDriver hook code goes here
|
||||
@@ -467,43 +476,51 @@ proc ::scobj::west_6100::mkDriver { sct_controller name ip_address tcp_port dev_
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
proc ::scobj::west_6100::add_driver {name device_class simulation_flag ip_address tcp_port dev_id} {
|
||||
set catch_status [ catch {
|
||||
::scobj::west_6100::sics_log 9 "::scobj::west_6100::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${dev_id}"
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
|
||||
::scobj::west_6100::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
|
||||
makesctcontroller sct_${name} aqadapter ${tcp_port}
|
||||
} else {
|
||||
::scobj::west_6100::sics_log 9 "makesctcontroller sct_${name} modbus_ap ${ip_address}:${tcp_port}"
|
||||
makesctcontroller sct_${name} modbus_ap ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::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} ${dev_id}"
|
||||
::scobj::west_6100::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${dev_id}
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
}
|
||||
|
||||
namespace eval ::scobj::west_6100 {
|
||||
namespace export debug_threshold
|
||||
namespace export debug_log
|
||||
namespace export sics_log
|
||||
namespace export mkDriver
|
||||
namespace export add_driver
|
||||
}
|
||||
|
||||
proc add_west_6100 {name ip_address tcp_port dev_id} {
|
||||
set catch_status [ catch {
|
||||
::scobj::west_6100::sics_log 9 "add_west_6100 ${name} ${ip_address} ${tcp_port} ${dev_id}"
|
||||
if {[string equal -nocase [SplitReply [environment_simulation]] "false"]} {
|
||||
if {[string equal -nocase "aqadapter" "${ip_address}"]} {
|
||||
::scobj::west_6100::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}"
|
||||
makesctcontroller sct_${name} aqadapter ${tcp_port}
|
||||
} else {
|
||||
::scobj::west_6100::sics_log 9 "makesctcontroller sct_${name} modbus_ap ${ip_address}:${tcp_port}"
|
||||
makesctcontroller sct_${name} modbus_ap ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::west_6100::sics_log 9 "[environment_simulation] => 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} ${ip_address} ${tcp_port} ${dev_id}"
|
||||
::scobj::west_6100::mkDriver sct_${name} ${name} ${ip_address} ${tcp_port} ${dev_id}
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
|
||||
::scobj::west_6100::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${dev_id}"
|
||||
}
|
||||
|
||||
clientput "file evaluation of west_6100_sct.tcl"
|
||||
::scobj::west_6100::sics_log 9 "file evaluation of west_6100_sct.tcl"
|
||||
clientput "file evaluation of sct_west_6100.tcl"
|
||||
::scobj::west_6100::sics_log 9 "file evaluation of sct_west_6100.tcl"
|
||||
|
||||
proc ::scobj::west_6100::read_config {} {
|
||||
set catch_status [ catch {
|
||||
set ns "::scobj::west_6100"
|
||||
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
|
||||
}
|
||||
@@ -511,6 +528,12 @@ proc ::scobj::west_6100::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]) } {
|
||||
@@ -521,9 +544,9 @@ proc ::scobj::west_6100::read_config {} {
|
||||
continue
|
||||
}
|
||||
if { [string equal -nocase [dict get $v "driver"] "west_6100"] } {
|
||||
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"] } {
|
||||
@@ -565,9 +588,9 @@ proc ::scobj::west_6100::read_config {} {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
add_west_6100 ${name} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
add_west_6100 ${name} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user