Regenerate all the SCT drivers with new generator
This commit is contained in:
@@ -51,7 +51,9 @@ proc ::scobj::bruker::add_driver {name device_class simulation_flag ip_address t
|
||||
makesctcontroller sct_${name} astvelsel ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::bruker::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for bruker"
|
||||
::scobj::bruker::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for bruker"
|
||||
::scobj::bruker::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
}
|
||||
::scobj::bruker::sics_log 1 "::scobj::bruker::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${tol}"
|
||||
::scobj::bruker::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${tol}
|
||||
@@ -69,7 +71,7 @@ namespace eval ::scobj::bruker {
|
||||
|
||||
proc add_bruker {name ip_address tcp_port id datype {tol 0.1}} {
|
||||
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
|
||||
::scobj::bruker::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${id}" "${datype}" "${{tol}" "${0.1}}"
|
||||
::scobj::bruker::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${tol}
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_bruker.tcl"
|
||||
@@ -108,20 +110,31 @@ proc ::scobj::bruker::read_config {} {
|
||||
if { ![string equal -nocase "${simulation_flag}" "false"] } {
|
||||
set asyncqueue "null"
|
||||
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
|
||||
${ns}::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
} elseif { [dict exists $v "asyncqueue"] } {
|
||||
set asyncqueue [dict get $v "asyncqueue"]
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
set ip_address [dict get $v ip]
|
||||
set tcp_port [dict get $v port]
|
||||
}
|
||||
makesctcontroller sct_${name} astvelsel ${ip_address}:${tcp_port}
|
||||
} else {
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
} else {
|
||||
if { [dict exists $v "asyncprotocol"] } {
|
||||
set asyncprotocol [dict get $v "asyncprotocol"]
|
||||
} else {
|
||||
set asyncprotocol ${name}_protocol
|
||||
MakeAsyncProtocol ${asyncprotocol}
|
||||
if { [dict exists $v "terminator"] } {
|
||||
if { [dict exists $v "sendterminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "sendterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
if { [dict exists $v "replyterminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "replyterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
}
|
||||
@@ -132,6 +145,7 @@ proc ::scobj::bruker::read_config {} {
|
||||
if { [dict exists $v "timeout"] } {
|
||||
${asyncqueue} timeout "[dict get $v "timeout"]"
|
||||
}
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
set arg_list [list]
|
||||
set missing_list [list]
|
||||
@@ -148,11 +162,7 @@ proc ::scobj::bruker::read_config {} {
|
||||
if { [llength $missing_list] > 0 } {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace eval ::scobj::green_magnet_labview {
|
||||
|
||||
proc add_green_magnet_labview {name ip_address tcp_port} {
|
||||
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
|
||||
::scobj::green_magnet_labview::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port}
|
||||
::scobj::green_magnet_labview::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port}
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_green_magnet_labview.tcl"
|
||||
@@ -102,39 +102,8 @@ proc ::scobj::green_magnet_labview::read_config {} {
|
||||
continue
|
||||
}
|
||||
if { [string equal -nocase [dict get $v "driver"] "green_magnet_labview"] } {
|
||||
if { ![string equal -nocase "${simulation_flag}" "false"] } {
|
||||
set asyncqueue "null"
|
||||
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
|
||||
} elseif { [dict exists $v "asyncqueue"] } {
|
||||
set asyncqueue [dict get $v "asyncqueue"]
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
set ip_address [dict get $v ip]
|
||||
set tcp_port [dict get $v port]
|
||||
}
|
||||
} else {
|
||||
if { [dict exists $v "asyncprotocol"] } {
|
||||
set asyncprotocol [dict get $v "asyncprotocol"]
|
||||
} else {
|
||||
set asyncprotocol ${name}_protocol
|
||||
MakeAsyncProtocol ${asyncprotocol}
|
||||
if { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
|
||||
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
}
|
||||
set asyncqueue ${name}_queue
|
||||
set ip_address [dict get $v ip]
|
||||
set tcp_port [dict get $v port]
|
||||
MakeAsyncQueue ${asyncqueue} ${asyncprotocol} ${ip_address} ${tcp_port}
|
||||
if { [dict exists $v "timeout"] } {
|
||||
${asyncqueue} timeout "[dict get $v "timeout"]"
|
||||
}
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}
|
||||
} else {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue}
|
||||
}
|
||||
::scobj::green_magnet_labview::sics_log 9 "No sctcontroller for green_magnet_labview"
|
||||
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,9 @@ proc ::scobj::oxford12tlv::add_driver {name device_class simulation_flag ip_addr
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::oxford12tlv::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for oxford12tlv"
|
||||
::scobj::oxford12tlv::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for oxford12tlv"
|
||||
::scobj::oxford12tlv::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
}
|
||||
::scobj::oxford12tlv::sics_log 1 "::scobj::oxford12tlv::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${interval}"
|
||||
::scobj::oxford12tlv::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${interval}
|
||||
@@ -83,7 +85,7 @@ namespace eval ::scobj::oxford12tlv {
|
||||
|
||||
proc add_oxford12tlv {name ip_address tcp_port id datype interval} {
|
||||
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
|
||||
::scobj::oxford12tlv::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${id}" "${datype}" "${interval}"
|
||||
::scobj::oxford12tlv::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${datype} ${interval}
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_oxford12tlv.tcl"
|
||||
@@ -122,20 +124,31 @@ proc ::scobj::oxford12tlv::read_config {} {
|
||||
if { ![string equal -nocase "${simulation_flag}" "false"] } {
|
||||
set asyncqueue "null"
|
||||
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
|
||||
${ns}::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
} elseif { [dict exists $v "asyncqueue"] } {
|
||||
set asyncqueue [dict get $v "asyncqueue"]
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
set ip_address [dict get $v ip]
|
||||
set tcp_port [dict get $v port]
|
||||
}
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
} else {
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
} else {
|
||||
if { [dict exists $v "asyncprotocol"] } {
|
||||
set asyncprotocol [dict get $v "asyncprotocol"]
|
||||
} else {
|
||||
set asyncprotocol ${name}_protocol
|
||||
MakeAsyncProtocol ${asyncprotocol}
|
||||
if { [dict exists $v "terminator"] } {
|
||||
if { [dict exists $v "sendterminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "sendterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
if { [dict exists $v "replyterminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "replyterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
}
|
||||
@@ -146,6 +159,7 @@ proc ::scobj::oxford12tlv::read_config {} {
|
||||
if { [dict exists $v "timeout"] } {
|
||||
${asyncqueue} timeout "[dict get $v "timeout"]"
|
||||
}
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
set arg_list [list]
|
||||
set missing_list [list]
|
||||
@@ -162,11 +176,7 @@ proc ::scobj::oxford12tlv::read_config {} {
|
||||
if { [llength $missing_list] > 0 } {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,12 @@ proc ::scobj::tsi_smc::checkstatus {tc_root} {
|
||||
# checkstatus hook code goes here
|
||||
if {[sct driving]} {
|
||||
set sp "[sct target]"
|
||||
set pv "[hval ${tc_root}/[sct driveable]]"
|
||||
if {[hpropexists [sct] simulated] && [sct simulated] == "true"} {
|
||||
set pv "${sp}"
|
||||
hupdateif ${tc_root}/[sct driveable] ${sp}
|
||||
}
|
||||
set pv "[hval ${tc_root}/[sct driveable]]"
|
||||
}
|
||||
if { abs(${pv} - ${sp}) <= [sct tolerance] } {
|
||||
if { [hpropexists [sct] settle_time] } {
|
||||
if { [hpropexists [sct] settle_time_start] } {
|
||||
@@ -301,6 +306,14 @@ proc ::scobj::tsi_smc::mkDriver { sct_controller name device_class simulation_fl
|
||||
hsetprop ${scobj_hpath}/setpoint units "G"
|
||||
hsetprop ${scobj_hpath}/setpoint nxalias "${name}_setpoint"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} write ${scobj_hpath}/setpoint
|
||||
hsetprop ${scobj_hpath}/setpoint simulated false
|
||||
} else {
|
||||
::scobj::tsi_smc::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for tsi_smc"
|
||||
hsetprop ${scobj_hpath}/setpoint simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/value plain user float
|
||||
hsetprop ${scobj_hpath}/value control true
|
||||
hsetprop ${scobj_hpath}/value data true
|
||||
@@ -319,17 +332,9 @@ proc ::scobj::tsi_smc::mkDriver { sct_controller name device_class simulation_fl
|
||||
hsetprop ${scobj_hpath} data "true"
|
||||
hsetprop ${scobj_hpath} klass "@none"
|
||||
hsetprop ${scobj_hpath} type "part"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} write ${scobj_hpath}/setpoint
|
||||
} else {
|
||||
::scobj::tsi_smc::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for tsi_smc"
|
||||
}
|
||||
ansto_makesctdrive ${name}_setpoint ${scobj_hpath}/setpoint ${scobj_hpath}/value ${sct_controller}
|
||||
|
||||
hfactory ${scobj_hpath}/a plain spy none
|
||||
hsetprop ${scobj_hpath}/a data "false"
|
||||
hsetprop ${scobj_hpath}/a klass "@none"
|
||||
hsetprop ${scobj_hpath}/a type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/a/G plain user text
|
||||
hsetprop ${scobj_hpath}/a/G read ${ns}::getValue ${scobj_hpath} rdValue {G}
|
||||
@@ -344,6 +349,14 @@ proc ::scobj::tsi_smc::mkDriver { sct_controller name device_class simulation_fl
|
||||
hsetprop ${scobj_hpath}/a/G type "part"
|
||||
hsetprop ${scobj_hpath}/a/G nxalias "${name}_a_G"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/a/G 1
|
||||
hsetprop ${scobj_hpath}/a/G simulated false
|
||||
} else {
|
||||
::scobj::tsi_smc::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for tsi_smc"
|
||||
hsetprop ${scobj_hpath}/a/G simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/a/J plain user text
|
||||
hsetprop ${scobj_hpath}/a/J read ${ns}::getValue ${scobj_hpath} rdValue {J}
|
||||
hsetprop ${scobj_hpath}/a/J rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -356,6 +369,14 @@ proc ::scobj::tsi_smc::mkDriver { sct_controller name device_class simulation_fl
|
||||
hsetprop ${scobj_hpath}/a/J type "part"
|
||||
hsetprop ${scobj_hpath}/a/J nxalias "${name}_a_J"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/a/J 1
|
||||
hsetprop ${scobj_hpath}/a/J simulated false
|
||||
} else {
|
||||
::scobj::tsi_smc::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for tsi_smc"
|
||||
hsetprop ${scobj_hpath}/a/J simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/a/K plain user text
|
||||
hsetprop ${scobj_hpath}/a/K read ${ns}::getValue ${scobj_hpath} rdValue {K}
|
||||
hsetprop ${scobj_hpath}/a/K rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -368,6 +389,14 @@ proc ::scobj::tsi_smc::mkDriver { sct_controller name device_class simulation_fl
|
||||
hsetprop ${scobj_hpath}/a/K type "part"
|
||||
hsetprop ${scobj_hpath}/a/K nxalias "${name}_a_K"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/a/K 1
|
||||
hsetprop ${scobj_hpath}/a/K simulated false
|
||||
} else {
|
||||
::scobj::tsi_smc::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for tsi_smc"
|
||||
hsetprop ${scobj_hpath}/a/K simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/a/N plain user text
|
||||
hsetprop ${scobj_hpath}/a/N read ${ns}::getValue ${scobj_hpath} rdValue {N}
|
||||
hsetprop ${scobj_hpath}/a/N rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -380,6 +409,14 @@ proc ::scobj::tsi_smc::mkDriver { sct_controller name device_class simulation_fl
|
||||
hsetprop ${scobj_hpath}/a/N type "part"
|
||||
hsetprop ${scobj_hpath}/a/N nxalias "${name}_a_N"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/a/N 1
|
||||
hsetprop ${scobj_hpath}/a/N simulated false
|
||||
} else {
|
||||
::scobj::tsi_smc::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for tsi_smc"
|
||||
hsetprop ${scobj_hpath}/a/N simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/a/O plain user text
|
||||
hsetprop ${scobj_hpath}/a/O read ${ns}::getValue ${scobj_hpath} rdValue {O}
|
||||
hsetprop ${scobj_hpath}/a/O rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -392,6 +429,14 @@ proc ::scobj::tsi_smc::mkDriver { sct_controller name device_class simulation_fl
|
||||
hsetprop ${scobj_hpath}/a/O type "part"
|
||||
hsetprop ${scobj_hpath}/a/O nxalias "${name}_a_O"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/a/O 1
|
||||
hsetprop ${scobj_hpath}/a/O simulated false
|
||||
} else {
|
||||
::scobj::tsi_smc::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for tsi_smc"
|
||||
hsetprop ${scobj_hpath}/a/O simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/a/S plain user text
|
||||
hsetprop ${scobj_hpath}/a/S read ${ns}::getValue ${scobj_hpath} rdValue {S}
|
||||
hsetprop ${scobj_hpath}/a/S rdValue ${ns}::rdValue ${scobj_hpath}
|
||||
@@ -405,20 +450,17 @@ proc ::scobj::tsi_smc::mkDriver { sct_controller name device_class simulation_fl
|
||||
hsetprop ${scobj_hpath}/a/S nxalias "${name}_a_S"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} poll ${scobj_hpath}/a/G 1
|
||||
${sct_controller} poll ${scobj_hpath}/a/J 1
|
||||
${sct_controller} poll ${scobj_hpath}/a/K 1
|
||||
${sct_controller} poll ${scobj_hpath}/a/N 1
|
||||
${sct_controller} poll ${scobj_hpath}/a/O 1
|
||||
${sct_controller} poll ${scobj_hpath}/a/S 1
|
||||
hsetprop ${scobj_hpath}/a/S simulated false
|
||||
} else {
|
||||
::scobj::tsi_smc::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for tsi_smc"
|
||||
hsetprop ${scobj_hpath}/a/S simulated true
|
||||
}
|
||||
hsetprop ${scobj_hpath}/a data "false"
|
||||
hsetprop ${scobj_hpath}/a klass "@none"
|
||||
hsetprop ${scobj_hpath}/a type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/b plain spy none
|
||||
hsetprop ${scobj_hpath}/b data "true"
|
||||
hsetprop ${scobj_hpath}/b klass "@none"
|
||||
hsetprop ${scobj_hpath}/b type "part"
|
||||
|
||||
hfactory ${scobj_hpath}/b/Lower plain user float
|
||||
hsetprop ${scobj_hpath}/b/Lower write ${ns}::setValue ${scobj_hpath} noResponse {L}
|
||||
@@ -437,6 +479,14 @@ proc ::scobj::tsi_smc::mkDriver { sct_controller name device_class simulation_fl
|
||||
hsetprop ${scobj_hpath}/b/Lower units "A"
|
||||
hsetprop ${scobj_hpath}/b/Lower nxalias "${name}_b_Lower"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} write ${scobj_hpath}/b/Lower
|
||||
hsetprop ${scobj_hpath}/b/Lower simulated false
|
||||
} else {
|
||||
::scobj::tsi_smc::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for tsi_smc"
|
||||
hsetprop ${scobj_hpath}/b/Lower simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/b/Pause plain user int
|
||||
hsetprop ${scobj_hpath}/b/Pause write ${ns}::setValue ${scobj_hpath} noResponse {P}
|
||||
hsetprop ${scobj_hpath}/b/Pause noResponse ${ns}::noResponse ${scobj_hpath}
|
||||
@@ -454,6 +504,14 @@ proc ::scobj::tsi_smc::mkDriver { sct_controller name device_class simulation_fl
|
||||
hsetprop ${scobj_hpath}/b/Pause type "part"
|
||||
hsetprop ${scobj_hpath}/b/Pause nxalias "${name}_b_Pause"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} write ${scobj_hpath}/b/Pause
|
||||
hsetprop ${scobj_hpath}/b/Pause simulated false
|
||||
} else {
|
||||
::scobj::tsi_smc::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for tsi_smc"
|
||||
hsetprop ${scobj_hpath}/b/Pause simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/b/Ramp plain user int
|
||||
hsetprop ${scobj_hpath}/b/Ramp write ${ns}::setValue ${scobj_hpath} noResponse {R}
|
||||
hsetprop ${scobj_hpath}/b/Ramp noResponse ${ns}::noResponse ${scobj_hpath}
|
||||
@@ -471,6 +529,14 @@ proc ::scobj::tsi_smc::mkDriver { sct_controller name device_class simulation_fl
|
||||
hsetprop ${scobj_hpath}/b/Ramp type "part"
|
||||
hsetprop ${scobj_hpath}/b/Ramp nxalias "${name}_b_Ramp"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} write ${scobj_hpath}/b/Ramp
|
||||
hsetprop ${scobj_hpath}/b/Ramp simulated false
|
||||
} else {
|
||||
::scobj::tsi_smc::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for tsi_smc"
|
||||
hsetprop ${scobj_hpath}/b/Ramp simulated true
|
||||
}
|
||||
|
||||
hfactory ${scobj_hpath}/b/Rate plain user float
|
||||
hsetprop ${scobj_hpath}/b/Rate write ${ns}::setValue ${scobj_hpath} noResponse {A}
|
||||
hsetprop ${scobj_hpath}/b/Rate noResponse ${ns}::noResponse ${scobj_hpath}
|
||||
@@ -486,19 +552,18 @@ proc ::scobj::tsi_smc::mkDriver { sct_controller name device_class simulation_fl
|
||||
hsetprop ${scobj_hpath}/b/Rate nxalias "${name}_b_Rate"
|
||||
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
${sct_controller} write ${scobj_hpath}/b/Lower
|
||||
${sct_controller} write ${scobj_hpath}/b/Pause
|
||||
${sct_controller} write ${scobj_hpath}/b/Ramp
|
||||
${sct_controller} write ${scobj_hpath}/b/Rate
|
||||
hsetprop ${scobj_hpath}/b/Rate simulated false
|
||||
} else {
|
||||
::scobj::tsi_smc::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for tsi_smc"
|
||||
hsetprop ${scobj_hpath}/b/Rate simulated true
|
||||
}
|
||||
hsetprop ${scobj_hpath}/b data "true"
|
||||
hsetprop ${scobj_hpath}/b klass "@none"
|
||||
hsetprop ${scobj_hpath}/b type "part"
|
||||
hsetprop ${scobj_hpath} klass ${device_class}
|
||||
hsetprop ${scobj_hpath} data true
|
||||
hsetprop ${scobj_hpath} debug_threshold 5
|
||||
if {[string equal -nocase "${simulation_flag}" "false"]} {
|
||||
ansto_makesctdrive ${name}_setpoint ${scobj_hpath}/setpoint ${scobj_hpath}/value ${sct_controller}
|
||||
}
|
||||
# mkDriver hook code goes here
|
||||
} catch_message ]
|
||||
handle_exception ${catch_status} ${catch_message}
|
||||
@@ -516,7 +581,9 @@ proc ::scobj::tsi_smc::add_driver {name device_class simulation_flag ip_address
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
}
|
||||
} else {
|
||||
::scobj::tsi_smc::sics_log 9 "simulation_flag={simulation_flag} => No sctcontroller for tsi_smc"
|
||||
::scobj::tsi_smc::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for tsi_smc"
|
||||
::scobj::tsi_smc::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
}
|
||||
::scobj::tsi_smc::sics_log 1 "::scobj::tsi_smc::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id}"
|
||||
::scobj::tsi_smc::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id}
|
||||
@@ -534,7 +601,7 @@ namespace eval ::scobj::tsi_smc {
|
||||
|
||||
proc add_tsi_smc {name ip_address tcp_port {id 1}} {
|
||||
set simulation_flag "[string tolower [SplitReply [environment_simulation]]]"
|
||||
::scobj::tsi_smc::add_driver ${name} "environment" "${simulation_flag}" ${ip_address} ${tcp_port} "${{id}" "${1}}"
|
||||
::scobj::tsi_smc::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} ${id}
|
||||
}
|
||||
|
||||
clientput "file evaluation of sct_tsi_smc.tcl"
|
||||
@@ -573,20 +640,31 @@ proc ::scobj::tsi_smc::read_config {} {
|
||||
if { ![string equal -nocase "${simulation_flag}" "false"] } {
|
||||
set asyncqueue "null"
|
||||
${ns}::sics_log 9 "simulation_flag=${simulation_flag} => using null asyncqueue"
|
||||
${ns}::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL"
|
||||
makesctcontroller sct_${name} aqadapter NULL
|
||||
} elseif { [dict exists $v "asyncqueue"] } {
|
||||
set asyncqueue [dict get $v "asyncqueue"]
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
set ip_address [dict get $v ip]
|
||||
set tcp_port [dict get $v port]
|
||||
}
|
||||
makesctcontroller sct_${name} std ${ip_address}:${tcp_port}
|
||||
} else {
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
} else {
|
||||
if { [dict exists $v "asyncprotocol"] } {
|
||||
set asyncprotocol [dict get $v "asyncprotocol"]
|
||||
} else {
|
||||
set asyncprotocol ${name}_protocol
|
||||
MakeAsyncProtocol ${asyncprotocol}
|
||||
if { [dict exists $v "terminator"] } {
|
||||
if { [dict exists $v "sendterminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "sendterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} sendterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
if { [dict exists $v "replyterminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "replyterminator"]"
|
||||
} elseif { [dict exists $v "terminator"] } {
|
||||
${asyncprotocol} replyterminator "[dict get $v "terminator"]"
|
||||
}
|
||||
}
|
||||
@@ -597,6 +675,7 @@ proc ::scobj::tsi_smc::read_config {} {
|
||||
if { [dict exists $v "timeout"] } {
|
||||
${asyncqueue} timeout "[dict get $v "timeout"]"
|
||||
}
|
||||
makesctcontroller sct_${name} aqadapter ${asyncqueue}
|
||||
}
|
||||
set arg_list [list]
|
||||
set missing_list [list]
|
||||
@@ -613,11 +692,7 @@ proc ::scobj::tsi_smc::read_config {} {
|
||||
if { [llength $missing_list] > 0 } {
|
||||
error "$name is missing configuration values $missing_list"
|
||||
}
|
||||
if { [string equal -nocase ${asyncqueue} "sct"] } {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
} else {
|
||||
${ns}::add_driver ${name} ${device_class} ${simulation_flag} "aqadapter" ${asyncqueue} {*}$arg_list
|
||||
}
|
||||
${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user