diff --git a/site_ansto/instrument/config/environment/temperature/oxford_mercury_sct.tcl b/site_ansto/instrument/config/environment/temperature/oxford_mercury_sct.tcl new file mode 100644 index 00000000..b0a2408a --- /dev/null +++ b/site_ansto/instrument/config/environment/temperature/oxford_mercury_sct.tcl @@ -0,0 +1,1589 @@ +# Generated driver for oxford_mercury +# vim: ft=tcl tabstop=8 softtabstop=2 shiftwidth=2 nocindent smartindent +# + +namespace eval ::scobj::oxford_mercury { + set debug_threshold 5 +# preamble hook code starts + proc make_config {sct_controller} { + set syscat [${sct_controller} transact READ:SYS:CAT] + set result "" + set devs [regexp -inline -all {DEV:D[[:alnum:]\.]*:[[:alnum:]]*} ${syscat}] + foreach dev [lsort ${devs}] { + set typ [string index [lindex [split ${dev} :] end] 0] + set typ [string map {A V} ${typ}] + clientput "${dev} ${typ}" + set result "${result}${typ}" + } + clientput "Result: ${result}" + return ${result} + } +# preamble hook code ends +} + +proc ::scobj::oxford_mercury::debug_log {tc_root debug_level debug_string} { + set catch_status [ catch { + set debug_threshold [hgetpropval ${tc_root} debug_threshold] + if {${debug_level} >= ${debug_threshold}} { + set now [clock seconds] + set ts [clock format ${now} -format "%Y%m%d"] + set log_file_name "../log/oxford_mercury_[basename ${tc_root}]_${ts}.log" + set fd [open "${log_file_name}" "a"] + set ts [clock format ${now} -format "%T"] + puts ${fd} "${ts} ${debug_string}" + close ${fd} + } + } catch_message ] +} + +proc ::scobj::oxford_mercury::sics_log {debug_level debug_string} { + set catch_status [ catch { + set debug_threshold ${::scobj::oxford_mercury::debug_threshold} + if {${debug_level} >= ${debug_threshold}} { + sicslog "::scobj::oxford_mercury::${debug_string}" + } + } catch_message ] +} + +# checklimits function for driveable interface +proc ::scobj::oxford_mercury::checklimits {tc_root} { + set catch_status [ catch { + debug_log ${tc_root} 1 "checklimits tc_root=${tc_root} sct=[sct] target=[sct target]" + set setpoint [sct target] + if { [hpropexists [sct] lowerlimit] } { + set lolimit [sct lowerlimit] + } else { + # lowerlimit not set, use target + set lolimit [sct target] + } + if { [hpropexists [sct] upperlimit] } { + set hilimit [sct upperlimit] + } else { + # upperlimit not set, use target + set hilimit [sct target] + } +# checklimits hook code goes here + if { ${setpoint} < ${lolimit} || ${setpoint} > ${hilimit} } { + sct driving 0 + error "setpoint ${setpoint} violates limits (${lolimit}..${hilimit}) on [sct]" + } + return OK + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# check function for hset change +proc ::scobj::oxford_mercury::checkrange {tc_root} { + set catch_status [ catch { + debug_log ${tc_root} 1 "checkrange tc_root=${tc_root} sct=[sct] target=[sct target]" + set setpoint [sct target] + if { [hpropexists [sct] lowerlimit] } { + set lolimit [sct lowerlimit] + } else { + # lowerlimit not set, use target + set lolimit [sct target] + } + if { [hpropexists [sct] upperlimit] } { + set hilimit [sct upperlimit] + } else { + # upperlimit not set, use target + set hilimit [sct target] + } +# checkrange hook code goes here + if { ${setpoint} < ${lolimit} || ${setpoint} > ${hilimit} } { + error "setpoint ${setpoint} violates limits (${lolimit}..${hilimit}) on [sct]" + } + return OK + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# checkstatus function for driveable interface +proc ::scobj::oxford_mercury::checkstatus {tc_root} { + set catch_status [ catch { +# checkstatus hook code goes here + if {[sct driving]} { + set sp "[sct target]" + if {[hpropexists [sct] simulated] && [sct simulated] == "true"} { + set pv "${sp}" + hupdateif ${tc_root}/[sct driveable] ${sp} + } else { + set pv "[hval ${tc_root}/[sct driveable]]" + } + if { abs(${pv} - ${sp}) <= [sct tolerance] } { + if { [hpropexists [sct] settle_time] } { + if { [hpropexists [sct] settle_time_start] } { + if { [sct utime] - [sct settle_time_start] >= [sct settle_time]} { + sct driving 0 + return "idle" + } + return "busy" + } else { + sct utime settle_time_start + return "busy" + } + } + sct driving 0 + return "idle" + } + if { [hpropexists [sct] settle_time_start] } { + hdelprop [sct] settle_time_start + } + return "busy" + } else { + return "idle" + } + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# function to request the read of a parameter on a device +proc ::scobj::oxford_mercury::getValue {tc_root nextState cmd_str} { + set catch_status [ catch { + debug_log ${tc_root} 1 "getValue tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set cmd "${cmd_str}" +# getValue hook code goes here + debug_log ${tc_root} 1 "getValue sct send ${cmd}" + if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} { + sct send "${cmd}" + } + return ${nextState} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# halt function for driveable interface +proc ::scobj::oxford_mercury::halt {tc_root} { + set catch_status [ catch { + debug_log ${tc_root} 1 "halt tc_root=${tc_root} sct=[sct] driving=[sct driving]" + ### TODO hset [sct] [hval [sct]] +# halt hook code goes here + sct driving 0 + return "idle" + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# function to check the write parameter on a device +proc ::scobj::oxford_mercury::noResponse {tc_root} { + set catch_status [ catch { + debug_log ${tc_root} 1 "noResponse tc_root=${tc_root} sct=[sct] resp=[sct result]" +# noResponse hook code goes here + return "idle" + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# function to parse the read of a parameter on a device +proc ::scobj::oxford_mercury::rdText {tc_root} { + set catch_status [ catch { + debug_log ${tc_root} 1 "rdText tc_root=${tc_root} sct=[sct] result=[sct result]" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set data [sct result] + set nextState "idle" + if {[string equal -nocase -length 7 ${data} "ASCERR:"]} { + # the protocol driver has reported an error + sct geterror "${data}" + error "[sct geterror]" + } +# rdText hook code starts + scan [lindex [split "$data" ":"] end] "%s" data +# rdText hook code ends + if { [hpropexists [sct] geterror] } { + debug_log ${tc_root} 9 "[sct] error: [sct geterror]" + error "[sct geterror]" + } + if { ${data} != [sct oldval] } { + debug_log ${tc_root} 1 "[sct] changed to new:${data}, from old:[sct oldval]" + sct oldval ${data} + sct update ${data} + sct utime readtime + } + return ${nextState} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# function to parse the read of a parameter on a device +proc ::scobj::oxford_mercury::rdValue {tc_root} { + set catch_status [ catch { + debug_log ${tc_root} 1 "rdValue tc_root=${tc_root} sct=[sct] result=[sct result]" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set data [sct result] + set nextState "idle" + if {[string equal -nocase -length 7 ${data} "ASCERR:"]} { + # the protocol driver has reported an error + sct geterror "${data}" + error "[sct geterror]" + } +# rdValue hook code starts + set value [lindex [split "${data}" ":"] end] + if {[string equal -nocase [string index ${value} end] K]} { + set value [string range ${value} 0 end-1] + } + if {[string equal -nocase ${value} NaN]} { + set value 0 + } + if {[string equal -nocase ${value} inf] || [string equal -nocase ${value} -inf]} { + set value 0 + } + if {![string is double ${value}]} { + set value 0 + } + scan ${value} "%g" data +# rdValue hook code ends + if { [hpropexists [sct] geterror] } { + debug_log ${tc_root} 9 "[sct] error: [sct geterror]" + error "[sct geterror]" + } + if { ${data} != [sct oldval] } { + debug_log ${tc_root} 1 "[sct] changed to new:${data}, from old:[sct oldval]" + sct oldval ${data} + sct update ${data} + sct utime readtime + } + return ${nextState} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# function to write a parameter value on a device +proc ::scobj::oxford_mercury::setPoint {tc_root nextState cmd_str} { + set catch_status [ catch { + debug_log ${tc_root} 1 "setPoint tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set par [sct target] + set cmd "${cmd_str}${par}" +# setPoint hook code goes here + if { [hpropexists [sct] driving] } { + if { [hpropexists [sct] writestatus] && [sct writestatus] == "start" } { + sct driving 1 + } + } + debug_log ${tc_root} 1 "setPoint sct send ${cmd}" + if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} { + sct send "${cmd}" + } + return ${nextState} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# function to write a parameter value on a device +proc ::scobj::oxford_mercury::setValue {tc_root nextState cmd_str} { + set catch_status [ catch { + debug_log ${tc_root} 1 "setValue tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set par [sct target] + set cmd "${cmd_str}${par}" +# setValue hook code goes here + if { [hpropexists [sct] driving] } { + if { [hpropexists [sct] writestatus] && [sct writestatus] == "start" } { + sct driving 1 + } + } + debug_log ${tc_root} 1 "setValue sct send ${cmd}" + if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} { + sct send "${cmd}" + } + return ${nextState} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# function to write a parameter value on a device +proc ::scobj::oxford_mercury::setValve {tc_root nextState cmd_str} { + set catch_status [ catch { + debug_log ${tc_root} 1 "setValve tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set par [sct target] + set cmd "${cmd_str}${par}" +# setValve hook code goes here + if { [hpropexists [sct] driving] } { + if { [hpropexists [sct] writestatus] && [sct writestatus] == "start" } { + sct driving 1 + } + } + debug_log ${tc_root} 1 "setValve sct send ${cmd}" + if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} { + sct send "${cmd}" + } + return ${nextState} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +proc ::scobj::oxford_mercury::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port id {cards NNNNNNNN} {assoc 00000000} {ttol 1} {ptol 5} {vtol 5} } { + ::scobj::oxford_mercury::sics_log 9 "::scobj::oxford_mercury::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${cards} ${assoc} ${ttol} ${ptol} ${vtol}" + set ns "[namespace current]" + set catch_status [ catch { + + MakeSICSObj ${name} SCT_OBJECT + + sicslist setatt ${name} klass ${device_class} + sicslist setatt ${name} long_name ${name} + + set scobj_hpath /sics/${name} + + hsetprop ${scobj_hpath} assoc "${assoc}" + hsetprop ${scobj_hpath} cards "${cards}" + hsetprop ${scobj_hpath} data "true" + hsetprop ${scobj_hpath} klass "@none" + hsetprop ${scobj_hpath} type "part" + + if {[string equal -nocase [string index ${cards} 4] L]} { + hfactory ${scobj_hpath}/Level plain spy none + + hfactory ${scobj_hpath}/Level/Helium plain user float + hsetprop ${scobj_hpath}/Level/Helium read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB5.L1:LVL:SIG:HEL:LEV} + hsetprop ${scobj_hpath}/Level/Helium rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/Level/Helium control true + hsetprop ${scobj_hpath}/Level/Helium data true + hsetprop ${scobj_hpath}/Level/Helium mutable true + hsetprop ${scobj_hpath}/Level/Helium nxsave true + hsetprop ${scobj_hpath}/Level/Helium permlink data_set "T[format "%02d" ${id}]He" + hsetprop ${scobj_hpath}/Level/Helium @description "T[format "%02d" ${id}]He" + hsetprop ${scobj_hpath}/Level/Helium oldval 0.0 + hsetprop ${scobj_hpath}/Level/Helium klass "parameter" + hsetprop ${scobj_hpath}/Level/Helium sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Level/Helium type "part" + hsetprop ${scobj_hpath}/Level/Helium nxalias "${name}_Level_Helium" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Level/Helium 15 + hsetprop ${scobj_hpath}/Level/Helium simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Level/Helium simulated true + } + + hfactory ${scobj_hpath}/Level/Nitrogen plain user float + hsetprop ${scobj_hpath}/Level/Nitrogen read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB5.L1:LVL:SIG:NIT:LEV} + hsetprop ${scobj_hpath}/Level/Nitrogen rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/Level/Nitrogen control true + hsetprop ${scobj_hpath}/Level/Nitrogen data true + hsetprop ${scobj_hpath}/Level/Nitrogen mutable true + hsetprop ${scobj_hpath}/Level/Nitrogen nxsave true + hsetprop ${scobj_hpath}/Level/Nitrogen permlink data_set "T[format "%02d" ${id}]N2" + hsetprop ${scobj_hpath}/Level/Nitrogen @description "T[format "%02d" ${id}]N2" + hsetprop ${scobj_hpath}/Level/Nitrogen oldval 0.0 + hsetprop ${scobj_hpath}/Level/Nitrogen klass "parameter" + hsetprop ${scobj_hpath}/Level/Nitrogen sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Level/Nitrogen type "part" + hsetprop ${scobj_hpath}/Level/Nitrogen nxalias "${name}_Level_Nitrogen" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Level/Nitrogen 15 + hsetprop ${scobj_hpath}/Level/Nitrogen simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Level/Nitrogen simulated true + } + + hfactory ${scobj_hpath}/Level/nick plain user text + hsetprop ${scobj_hpath}/Level/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:DB5.L1:LVL:NICK} + hsetprop ${scobj_hpath}/Level/nick rdText ${ns}::rdText ${scobj_hpath} + hsetprop ${scobj_hpath}/Level/nick control true + hsetprop ${scobj_hpath}/Level/nick data true + hsetprop ${scobj_hpath}/Level/nick mutable true + hsetprop ${scobj_hpath}/Level/nick nxsave true + hsetprop ${scobj_hpath}/Level/nick oldval UNKNOWN + hsetprop ${scobj_hpath}/Level/nick klass "parameter" + hsetprop ${scobj_hpath}/Level/nick sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Level/nick type "part" + hsetprop ${scobj_hpath}/Level/nick nxalias "${name}_Level_nick" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Level/nick 15 + hsetprop ${scobj_hpath}/Level/nick simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Level/nick simulated true + } + hsetprop ${scobj_hpath}/Level data "true" + hsetprop ${scobj_hpath}/Level klass "@none" + hsetprop ${scobj_hpath}/Level type "part" + } + + if {[string equal -nocase [string index ${cards} 4] P]} { + hfactory ${scobj_hpath}/Pres5 plain spy none + + hfactory ${scobj_hpath}/Pres5/nick plain user text + hsetprop ${scobj_hpath}/Pres5/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:DB5.P1:PRES:NICK} + hsetprop ${scobj_hpath}/Pres5/nick rdText ${ns}::rdText ${scobj_hpath} + hsetprop ${scobj_hpath}/Pres5/nick control true + hsetprop ${scobj_hpath}/Pres5/nick data true + hsetprop ${scobj_hpath}/Pres5/nick mutable true + hsetprop ${scobj_hpath}/Pres5/nick nxsave true + hsetprop ${scobj_hpath}/Pres5/nick oldval UNKNOWN + hsetprop ${scobj_hpath}/Pres5/nick klass "parameter" + hsetprop ${scobj_hpath}/Pres5/nick sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Pres5/nick type "part" + hsetprop ${scobj_hpath}/Pres5/nick nxalias "${name}_Pres5_nick" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Pres5/nick 15 + hsetprop ${scobj_hpath}/Pres5/nick simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Pres5/nick simulated true + } + + hfactory ${scobj_hpath}/Pres5/sensor plain user float + hsetprop ${scobj_hpath}/Pres5/sensor read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB5.P1:PRES:SIG:PRES} + hsetprop ${scobj_hpath}/Pres5/sensor rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/Pres5/sensor control true + hsetprop ${scobj_hpath}/Pres5/sensor data true + hsetprop ${scobj_hpath}/Pres5/sensor mutable true + hsetprop ${scobj_hpath}/Pres5/sensor nxsave true + hsetprop ${scobj_hpath}/Pres5/sensor units mB + hsetprop ${scobj_hpath}/Pres5/sensor permlink data_set "P[format "%02d" ${id}]PS05" + hsetprop ${scobj_hpath}/Pres5/sensor @description "P[format "%02d" ${id}]PS05" + hsetprop ${scobj_hpath}/Pres5/sensor oldval 0.0 + hsetprop ${scobj_hpath}/Pres5/sensor klass "parameter" + hsetprop ${scobj_hpath}/Pres5/sensor sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Pres5/sensor type "part" + hsetprop ${scobj_hpath}/Pres5/sensor nxalias "${name}_Pres5_sensor" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Pres5/sensor 1 + hsetprop ${scobj_hpath}/Pres5/sensor simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Pres5/sensor simulated true + } + + if {[string equal -nocase [string index ${cards} 3] V] && [string equal -nocase [string index ${assoc} 4] 4]} { + hfactory ${scobj_hpath}/Pres5/setpoint plain user float + hsetprop ${scobj_hpath}/Pres5/setpoint read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB5.P1:PRES:LOOP:TSET} + hsetprop ${scobj_hpath}/Pres5/setpoint rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/Pres5/setpoint write ${ns}::setPoint ${scobj_hpath} noResponse {SET:DEV:DB8.P1:PRES:LOOP:TSET:} + hsetprop ${scobj_hpath}/Pres5/setpoint noResponse ${ns}::noResponse ${scobj_hpath} + hsetprop ${scobj_hpath}/Pres5/setpoint check ${ns}::checkrange ${scobj_hpath} + hsetprop ${scobj_hpath}/Pres5/setpoint driving 0 + hsetprop ${scobj_hpath}/Pres5/setpoint checklimits ${ns}::checklimits ${scobj_hpath} + hsetprop ${scobj_hpath}/Pres5/setpoint checkstatus ${ns}::checkstatus ${scobj_hpath} + hsetprop ${scobj_hpath}/Pres5/setpoint halt ${ns}::halt ${scobj_hpath} + hsetprop ${scobj_hpath}/Pres5/setpoint driveable Pres5/sensor + hsetprop ${scobj_hpath}/Pres5/setpoint control true + hsetprop ${scobj_hpath}/Pres5/setpoint data true + hsetprop ${scobj_hpath}/Pres5/setpoint mutable true + hsetprop ${scobj_hpath}/Pres5/setpoint nxsave true + hsetprop ${scobj_hpath}/Pres5/setpoint lowerlimit 0 + hsetprop ${scobj_hpath}/Pres5/setpoint upperlimit 333 + hsetprop ${scobj_hpath}/Pres5/setpoint tolerance ${ptol} + hsetprop ${scobj_hpath}/Pres5/setpoint units mB + hsetprop ${scobj_hpath}/Pres5/setpoint permlink data_set "P[format "%02d" ${id}]PSP05" + hsetprop ${scobj_hpath}/Pres5/setpoint @description "P[format "%02d" ${id}]PSP05" + hsetprop ${scobj_hpath}/Pres5/setpoint oldval 0.0 + hsetprop ${scobj_hpath}/Pres5/setpoint klass "parameter" + hsetprop ${scobj_hpath}/Pres5/setpoint sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Pres5/setpoint settle_time "15" + hsetprop ${scobj_hpath}/Pres5/setpoint type "drivable" + hsetprop ${scobj_hpath}/Pres5/setpoint nxalias "${name}_Pres5_setpoint" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Pres5/setpoint 5 + ${sct_controller} write ${scobj_hpath}/Pres5/setpoint + hsetprop ${scobj_hpath}/Pres5/setpoint simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Pres5/setpoint simulated true + } + } + + if {[string equal -nocase [string index ${cards} 3] V] && [string equal -nocase [string index ${assoc} 4] 4]} { + hfactory ${scobj_hpath}/Pres5/valve plain user float + hsetprop ${scobj_hpath}/Pres5/valve read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB4.G1:AUX:SIG:OPEN} + hsetprop ${scobj_hpath}/Pres5/valve rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/Pres5/valve control true + hsetprop ${scobj_hpath}/Pres5/valve data true + hsetprop ${scobj_hpath}/Pres5/valve mutable true + hsetprop ${scobj_hpath}/Pres5/valve nxsave true + hsetprop ${scobj_hpath}/Pres5/valve oldval 0.0 + hsetprop ${scobj_hpath}/Pres5/valve klass "parameter" + hsetprop ${scobj_hpath}/Pres5/valve sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Pres5/valve type "part" + hsetprop ${scobj_hpath}/Pres5/valve nxalias "${name}_Pres5_valve" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Pres5/valve 5 + hsetprop ${scobj_hpath}/Pres5/valve simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Pres5/valve simulated true + } + } + hsetprop ${scobj_hpath}/Pres5 data "true" + hsetprop ${scobj_hpath}/Pres5 klass "@none" + hsetprop ${scobj_hpath}/Pres5 type "part" + if {[string equal -nocase [string index ${cards} 3] V] && [string equal -nocase [string index ${assoc} 4] 4]} { + ansto_makesctdrive ${name}_Pres5_setpoint ${scobj_hpath}/Pres5/setpoint ${scobj_hpath}/Pres5/sensor ${sct_controller} + } + } + + if {[string equal -nocase [string index ${cards} 7] P]} { + hfactory ${scobj_hpath}/Pres8 plain spy none + + hfactory ${scobj_hpath}/Pres8/nick plain user text + hsetprop ${scobj_hpath}/Pres8/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:DB8.P1:PRES:NICK} + hsetprop ${scobj_hpath}/Pres8/nick rdText ${ns}::rdText ${scobj_hpath} + hsetprop ${scobj_hpath}/Pres8/nick control true + hsetprop ${scobj_hpath}/Pres8/nick data true + hsetprop ${scobj_hpath}/Pres8/nick mutable true + hsetprop ${scobj_hpath}/Pres8/nick nxsave true + hsetprop ${scobj_hpath}/Pres8/nick oldval UNKNOWN + hsetprop ${scobj_hpath}/Pres8/nick klass "parameter" + hsetprop ${scobj_hpath}/Pres8/nick sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Pres8/nick type "part" + hsetprop ${scobj_hpath}/Pres8/nick nxalias "${name}_Pres8_nick" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Pres8/nick 15 + hsetprop ${scobj_hpath}/Pres8/nick simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Pres8/nick simulated true + } + + hfactory ${scobj_hpath}/Pres8/sensor plain user float + hsetprop ${scobj_hpath}/Pres8/sensor read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB8.P1:PRES:SIG:PRES} + hsetprop ${scobj_hpath}/Pres8/sensor rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/Pres8/sensor control true + hsetprop ${scobj_hpath}/Pres8/sensor data true + hsetprop ${scobj_hpath}/Pres8/sensor mutable true + hsetprop ${scobj_hpath}/Pres8/sensor nxsave true + hsetprop ${scobj_hpath}/Pres8/sensor units mB + hsetprop ${scobj_hpath}/Pres8/sensor permlink data_set "P[format "%02d" ${id}]PS08" + hsetprop ${scobj_hpath}/Pres8/sensor @description "P[format "%02d" ${id}]PS08" + hsetprop ${scobj_hpath}/Pres8/sensor oldval 0.0 + hsetprop ${scobj_hpath}/Pres8/sensor klass "parameter" + hsetprop ${scobj_hpath}/Pres8/sensor sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Pres8/sensor type "part" + hsetprop ${scobj_hpath}/Pres8/sensor nxalias "${name}_Pres8_sensor" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Pres8/sensor 1 + hsetprop ${scobj_hpath}/Pres8/sensor simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Pres8/sensor simulated true + } + + if {[string equal -nocase [string index ${cards} 3] V] && [string equal -nocase [string index ${assoc} 7] 4]} { + hfactory ${scobj_hpath}/Pres8/setpoint plain user float + hsetprop ${scobj_hpath}/Pres8/setpoint read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB8.P1:PRES:LOOP:TSET} + hsetprop ${scobj_hpath}/Pres8/setpoint rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/Pres8/setpoint write ${ns}::setPoint ${scobj_hpath} noResponse {SET:DEV:DB8.P1:PRES:LOOP:TSET:} + hsetprop ${scobj_hpath}/Pres8/setpoint noResponse ${ns}::noResponse ${scobj_hpath} + hsetprop ${scobj_hpath}/Pres8/setpoint check ${ns}::checkrange ${scobj_hpath} + hsetprop ${scobj_hpath}/Pres8/setpoint driving 0 + hsetprop ${scobj_hpath}/Pres8/setpoint checklimits ${ns}::checklimits ${scobj_hpath} + hsetprop ${scobj_hpath}/Pres8/setpoint checkstatus ${ns}::checkstatus ${scobj_hpath} + hsetprop ${scobj_hpath}/Pres8/setpoint halt ${ns}::halt ${scobj_hpath} + hsetprop ${scobj_hpath}/Pres8/setpoint driveable Pres8/sensor + hsetprop ${scobj_hpath}/Pres8/setpoint control true + hsetprop ${scobj_hpath}/Pres8/setpoint data true + hsetprop ${scobj_hpath}/Pres8/setpoint mutable true + hsetprop ${scobj_hpath}/Pres8/setpoint nxsave true + hsetprop ${scobj_hpath}/Pres8/setpoint lowerlimit 0 + hsetprop ${scobj_hpath}/Pres8/setpoint upperlimit 333 + hsetprop ${scobj_hpath}/Pres8/setpoint tolerance ${ptol} + hsetprop ${scobj_hpath}/Pres8/setpoint units mB + hsetprop ${scobj_hpath}/Pres8/setpoint permlink data_set "P[format "%02d" ${id}]PSP08" + hsetprop ${scobj_hpath}/Pres8/setpoint @description "P[format "%02d" ${id}]PSP08" + hsetprop ${scobj_hpath}/Pres8/setpoint oldval 0.0 + hsetprop ${scobj_hpath}/Pres8/setpoint klass "parameter" + hsetprop ${scobj_hpath}/Pres8/setpoint sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Pres8/setpoint settle_time "15" + hsetprop ${scobj_hpath}/Pres8/setpoint type "drivable" + hsetprop ${scobj_hpath}/Pres8/setpoint nxalias "${name}_Pres8_setpoint" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Pres8/setpoint 5 + ${sct_controller} write ${scobj_hpath}/Pres8/setpoint + hsetprop ${scobj_hpath}/Pres8/setpoint simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Pres8/setpoint simulated true + } + } + + if {[string equal -nocase [string index ${cards} 3] V] && [string equal -nocase [string index ${assoc} 7] 4]} { + hfactory ${scobj_hpath}/Pres8/valve plain user float + hsetprop ${scobj_hpath}/Pres8/valve read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB4.G1:AUX:SIG:OPEN} + hsetprop ${scobj_hpath}/Pres8/valve rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/Pres8/valve control true + hsetprop ${scobj_hpath}/Pres8/valve data true + hsetprop ${scobj_hpath}/Pres8/valve mutable true + hsetprop ${scobj_hpath}/Pres8/valve nxsave true + hsetprop ${scobj_hpath}/Pres8/valve oldval 0.0 + hsetprop ${scobj_hpath}/Pres8/valve klass "parameter" + hsetprop ${scobj_hpath}/Pres8/valve sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Pres8/valve type "part" + hsetprop ${scobj_hpath}/Pres8/valve nxalias "${name}_Pres8_valve" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Pres8/valve 5 + hsetprop ${scobj_hpath}/Pres8/valve simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Pres8/valve simulated true + } + } + hsetprop ${scobj_hpath}/Pres8 data "true" + hsetprop ${scobj_hpath}/Pres8 klass "@none" + hsetprop ${scobj_hpath}/Pres8 type "part" + if {[string equal -nocase [string index ${cards} 3] V] && [string equal -nocase [string index ${assoc} 7] 4]} { + ansto_makesctdrive ${name}_Pres8_setpoint ${scobj_hpath}/Pres8/setpoint ${scobj_hpath}/Pres8/sensor ${sct_controller} + } + } + + hfactory ${scobj_hpath}/Temp0 plain spy none + + hfactory ${scobj_hpath}/Temp0/nick plain user text + hsetprop ${scobj_hpath}/Temp0/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:MB1.T1:TEMP:NICK} + hsetprop ${scobj_hpath}/Temp0/nick rdText ${ns}::rdText ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp0/nick control true + hsetprop ${scobj_hpath}/Temp0/nick data true + hsetprop ${scobj_hpath}/Temp0/nick mutable true + hsetprop ${scobj_hpath}/Temp0/nick nxsave true + hsetprop ${scobj_hpath}/Temp0/nick oldval UNKNOWN + hsetprop ${scobj_hpath}/Temp0/nick klass "parameter" + hsetprop ${scobj_hpath}/Temp0/nick sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Temp0/nick type "part" + hsetprop ${scobj_hpath}/Temp0/nick nxalias "${name}_Temp0_nick" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Temp0/nick 15 + hsetprop ${scobj_hpath}/Temp0/nick simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Temp0/nick simulated true + } + + hfactory ${scobj_hpath}/Temp0/power plain user float + hsetprop ${scobj_hpath}/Temp0/power read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:MB0.H1:HTR:SIG:POWR} + hsetprop ${scobj_hpath}/Temp0/power rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp0/power control true + hsetprop ${scobj_hpath}/Temp0/power data true + hsetprop ${scobj_hpath}/Temp0/power mutable true + hsetprop ${scobj_hpath}/Temp0/power nxsave true + hsetprop ${scobj_hpath}/Temp0/power oldval 0.0 + hsetprop ${scobj_hpath}/Temp0/power klass "parameter" + hsetprop ${scobj_hpath}/Temp0/power sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Temp0/power type "part" + hsetprop ${scobj_hpath}/Temp0/power nxalias "${name}_Temp0_power" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Temp0/power 5 + hsetprop ${scobj_hpath}/Temp0/power simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Temp0/power simulated true + } + + hfactory ${scobj_hpath}/Temp0/sensor plain user float + hsetprop ${scobj_hpath}/Temp0/sensor read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:MB1.T1:TEMP:SIG:TEMP} + hsetprop ${scobj_hpath}/Temp0/sensor rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp0/sensor control true + hsetprop ${scobj_hpath}/Temp0/sensor data true + hsetprop ${scobj_hpath}/Temp0/sensor mutable true + hsetprop ${scobj_hpath}/Temp0/sensor nxsave true + hsetprop ${scobj_hpath}/Temp0/sensor permlink data_set "T[format "%02d" ${id}]S00" + hsetprop ${scobj_hpath}/Temp0/sensor @description "T[format "%02d" ${id}]S00" + hsetprop ${scobj_hpath}/Temp0/sensor oldval 0.0 + hsetprop ${scobj_hpath}/Temp0/sensor klass "parameter" + hsetprop ${scobj_hpath}/Temp0/sensor sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Temp0/sensor type "part" + hsetprop ${scobj_hpath}/Temp0/sensor nxalias "${name}_Temp0_sensor" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Temp0/sensor 1 + hsetprop ${scobj_hpath}/Temp0/sensor simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Temp0/sensor simulated true + } + + hfactory ${scobj_hpath}/Temp0/setpoint plain user float + hsetprop ${scobj_hpath}/Temp0/setpoint read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:MB1.T1:TEMP:LOOP:TSET} + hsetprop ${scobj_hpath}/Temp0/setpoint rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp0/setpoint write ${ns}::setPoint ${scobj_hpath} noResponse {SET:DEV:MB1.T1:TEMP:LOOP:TSET:} + hsetprop ${scobj_hpath}/Temp0/setpoint noResponse ${ns}::noResponse ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp0/setpoint check ${ns}::checkrange ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp0/setpoint driving 0 + hsetprop ${scobj_hpath}/Temp0/setpoint checklimits ${ns}::checklimits ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp0/setpoint checkstatus ${ns}::checkstatus ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp0/setpoint halt ${ns}::halt ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp0/setpoint driveable Temp0/sensor + hsetprop ${scobj_hpath}/Temp0/setpoint control true + hsetprop ${scobj_hpath}/Temp0/setpoint data true + hsetprop ${scobj_hpath}/Temp0/setpoint mutable true + hsetprop ${scobj_hpath}/Temp0/setpoint nxsave true + hsetprop ${scobj_hpath}/Temp0/setpoint lowerlimit 0 + hsetprop ${scobj_hpath}/Temp0/setpoint upperlimit 333 + hsetprop ${scobj_hpath}/Temp0/setpoint tolerance ${ttol} + hsetprop ${scobj_hpath}/Temp0/setpoint permlink data_set "T[format "%02d" ${id}]SP00" + hsetprop ${scobj_hpath}/Temp0/setpoint @description "T[format "%02d" ${id}]SP00" + hsetprop ${scobj_hpath}/Temp0/setpoint oldval 0.0 + hsetprop ${scobj_hpath}/Temp0/setpoint klass "parameter" + hsetprop ${scobj_hpath}/Temp0/setpoint sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Temp0/setpoint settle_time "15" + hsetprop ${scobj_hpath}/Temp0/setpoint type "drivable" + hsetprop ${scobj_hpath}/Temp0/setpoint nxalias "${name}_Temp0_setpoint" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Temp0/setpoint 5 + ${sct_controller} write ${scobj_hpath}/Temp0/setpoint + hsetprop ${scobj_hpath}/Temp0/setpoint simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Temp0/setpoint simulated true + } + hsetprop ${scobj_hpath}/Temp0 data "true" + hsetprop ${scobj_hpath}/Temp0 klass "@none" + hsetprop ${scobj_hpath}/Temp0 type "part" + ansto_makesctdrive ${name}_Temp0_setpoint ${scobj_hpath}/Temp0/setpoint ${scobj_hpath}/Temp0/sensor ${sct_controller} + + if {[string equal -nocase [string index ${cards} 0] T]} { + hfactory ${scobj_hpath}/Temp1 plain spy none + + hfactory ${scobj_hpath}/Temp1/nick plain user text + hsetprop ${scobj_hpath}/Temp1/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:DB1.T1:TEMP:NICK} + hsetprop ${scobj_hpath}/Temp1/nick rdText ${ns}::rdText ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp1/nick control true + hsetprop ${scobj_hpath}/Temp1/nick data true + hsetprop ${scobj_hpath}/Temp1/nick mutable true + hsetprop ${scobj_hpath}/Temp1/nick nxsave true + hsetprop ${scobj_hpath}/Temp1/nick oldval UNKNOWN + hsetprop ${scobj_hpath}/Temp1/nick klass "parameter" + hsetprop ${scobj_hpath}/Temp1/nick sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Temp1/nick type "part" + hsetprop ${scobj_hpath}/Temp1/nick nxalias "${name}_Temp1_nick" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Temp1/nick 15 + hsetprop ${scobj_hpath}/Temp1/nick simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Temp1/nick simulated true + } + + hfactory ${scobj_hpath}/Temp1/sensor plain user float + hsetprop ${scobj_hpath}/Temp1/sensor read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB1.T1:TEMP:SIG:TEMP} + hsetprop ${scobj_hpath}/Temp1/sensor rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp1/sensor control true + hsetprop ${scobj_hpath}/Temp1/sensor data true + hsetprop ${scobj_hpath}/Temp1/sensor mutable true + hsetprop ${scobj_hpath}/Temp1/sensor nxsave true + hsetprop ${scobj_hpath}/Temp1/sensor permlink data_set "T[format "%02d" ${id}]S01" + hsetprop ${scobj_hpath}/Temp1/sensor @description "T[format "%02d" ${id}]S01" + hsetprop ${scobj_hpath}/Temp1/sensor oldval 0.0 + hsetprop ${scobj_hpath}/Temp1/sensor klass "parameter" + hsetprop ${scobj_hpath}/Temp1/sensor sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Temp1/sensor type "part" + hsetprop ${scobj_hpath}/Temp1/sensor nxalias "${name}_Temp1_sensor" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Temp1/sensor 1 + hsetprop ${scobj_hpath}/Temp1/sensor simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Temp1/sensor simulated true + } + hsetprop ${scobj_hpath}/Temp1 data "true" + hsetprop ${scobj_hpath}/Temp1 klass "@none" + hsetprop ${scobj_hpath}/Temp1 type "part" + } + + if {[string equal -nocase [string index ${cards} 1] T]} { + hfactory ${scobj_hpath}/Temp2 plain spy none + + hfactory ${scobj_hpath}/Temp2/nick plain user text + hsetprop ${scobj_hpath}/Temp2/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:DB2.T1:TEMP:NICK} + hsetprop ${scobj_hpath}/Temp2/nick rdText ${ns}::rdText ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp2/nick control true + hsetprop ${scobj_hpath}/Temp2/nick data true + hsetprop ${scobj_hpath}/Temp2/nick mutable true + hsetprop ${scobj_hpath}/Temp2/nick nxsave true + hsetprop ${scobj_hpath}/Temp2/nick oldval UNKNOWN + hsetprop ${scobj_hpath}/Temp2/nick klass "parameter" + hsetprop ${scobj_hpath}/Temp2/nick sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Temp2/nick type "part" + hsetprop ${scobj_hpath}/Temp2/nick nxalias "${name}_Temp2_nick" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Temp2/nick 15 + hsetprop ${scobj_hpath}/Temp2/nick simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Temp2/nick simulated true + } + + hfactory ${scobj_hpath}/Temp2/sensor plain user float + hsetprop ${scobj_hpath}/Temp2/sensor read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB2.T1:TEMP:SIG:TEMP} + hsetprop ${scobj_hpath}/Temp2/sensor rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp2/sensor control true + hsetprop ${scobj_hpath}/Temp2/sensor data true + hsetprop ${scobj_hpath}/Temp2/sensor mutable true + hsetprop ${scobj_hpath}/Temp2/sensor nxsave true + hsetprop ${scobj_hpath}/Temp2/sensor permlink data_set "T[format "%02d" ${id}]S02" + hsetprop ${scobj_hpath}/Temp2/sensor @description "T[format "%02d" ${id}]S02" + hsetprop ${scobj_hpath}/Temp2/sensor oldval 0.0 + hsetprop ${scobj_hpath}/Temp2/sensor klass "parameter" + hsetprop ${scobj_hpath}/Temp2/sensor sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Temp2/sensor type "part" + hsetprop ${scobj_hpath}/Temp2/sensor nxalias "${name}_Temp2_sensor" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Temp2/sensor 1 + hsetprop ${scobj_hpath}/Temp2/sensor simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Temp2/sensor simulated true + } + hsetprop ${scobj_hpath}/Temp2 data "true" + hsetprop ${scobj_hpath}/Temp2 klass "@none" + hsetprop ${scobj_hpath}/Temp2 type "part" + } + + if {[string equal -nocase [string index ${cards} 2] T]} { + hfactory ${scobj_hpath}/Temp3 plain spy none + + hfactory ${scobj_hpath}/Temp3/nick plain user text + hsetprop ${scobj_hpath}/Temp3/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:DB3.T1:TEMP:NICK} + hsetprop ${scobj_hpath}/Temp3/nick rdText ${ns}::rdText ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp3/nick control true + hsetprop ${scobj_hpath}/Temp3/nick data true + hsetprop ${scobj_hpath}/Temp3/nick mutable true + hsetprop ${scobj_hpath}/Temp3/nick nxsave true + hsetprop ${scobj_hpath}/Temp3/nick oldval UNKNOWN + hsetprop ${scobj_hpath}/Temp3/nick klass "parameter" + hsetprop ${scobj_hpath}/Temp3/nick sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Temp3/nick type "part" + hsetprop ${scobj_hpath}/Temp3/nick nxalias "${name}_Temp3_nick" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Temp3/nick 15 + hsetprop ${scobj_hpath}/Temp3/nick simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Temp3/nick simulated true + } + + hfactory ${scobj_hpath}/Temp3/sensor plain user float + hsetprop ${scobj_hpath}/Temp3/sensor read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB3.T1:TEMP:SIG:TEMP} + hsetprop ${scobj_hpath}/Temp3/sensor rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp3/sensor control true + hsetprop ${scobj_hpath}/Temp3/sensor data true + hsetprop ${scobj_hpath}/Temp3/sensor mutable true + hsetprop ${scobj_hpath}/Temp3/sensor nxsave true + hsetprop ${scobj_hpath}/Temp3/sensor permlink data_set "T[format "%02d" ${id}]S03" + hsetprop ${scobj_hpath}/Temp3/sensor @description "T[format "%02d" ${id}]S03" + hsetprop ${scobj_hpath}/Temp3/sensor oldval 0.0 + hsetprop ${scobj_hpath}/Temp3/sensor klass "parameter" + hsetprop ${scobj_hpath}/Temp3/sensor sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Temp3/sensor type "part" + hsetprop ${scobj_hpath}/Temp3/sensor nxalias "${name}_Temp3_sensor" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Temp3/sensor 1 + hsetprop ${scobj_hpath}/Temp3/sensor simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Temp3/sensor simulated true + } + hsetprop ${scobj_hpath}/Temp3 data "true" + hsetprop ${scobj_hpath}/Temp3 klass "@none" + hsetprop ${scobj_hpath}/Temp3 type "part" + } + + if {[string equal -nocase [string index ${cards} 3] T]} { + hfactory ${scobj_hpath}/Temp4 plain spy none + + hfactory ${scobj_hpath}/Temp4/nick plain user text + hsetprop ${scobj_hpath}/Temp4/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:DB4.T1:TEMP:NICK} + hsetprop ${scobj_hpath}/Temp4/nick rdText ${ns}::rdText ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp4/nick control true + hsetprop ${scobj_hpath}/Temp4/nick data true + hsetprop ${scobj_hpath}/Temp4/nick mutable true + hsetprop ${scobj_hpath}/Temp4/nick nxsave true + hsetprop ${scobj_hpath}/Temp4/nick oldval UNKNOWN + hsetprop ${scobj_hpath}/Temp4/nick klass "parameter" + hsetprop ${scobj_hpath}/Temp4/nick sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Temp4/nick type "part" + hsetprop ${scobj_hpath}/Temp4/nick nxalias "${name}_Temp4_nick" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Temp4/nick 15 + hsetprop ${scobj_hpath}/Temp4/nick simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Temp4/nick simulated true + } + + hfactory ${scobj_hpath}/Temp4/sensor plain user float + hsetprop ${scobj_hpath}/Temp4/sensor read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB4.T1:TEMP:SIG:TEMP} + hsetprop ${scobj_hpath}/Temp4/sensor rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp4/sensor control true + hsetprop ${scobj_hpath}/Temp4/sensor data true + hsetprop ${scobj_hpath}/Temp4/sensor mutable true + hsetprop ${scobj_hpath}/Temp4/sensor nxsave true + hsetprop ${scobj_hpath}/Temp4/sensor permlink data_set "T[format "%02d" ${id}]S04" + hsetprop ${scobj_hpath}/Temp4/sensor @description "T[format "%02d" ${id}]S04" + hsetprop ${scobj_hpath}/Temp4/sensor oldval 0.0 + hsetprop ${scobj_hpath}/Temp4/sensor klass "parameter" + hsetprop ${scobj_hpath}/Temp4/sensor sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Temp4/sensor type "part" + hsetprop ${scobj_hpath}/Temp4/sensor nxalias "${name}_Temp4_sensor" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Temp4/sensor 1 + hsetprop ${scobj_hpath}/Temp4/sensor simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Temp4/sensor simulated true + } + hsetprop ${scobj_hpath}/Temp4 data "true" + hsetprop ${scobj_hpath}/Temp4 klass "@none" + hsetprop ${scobj_hpath}/Temp4 type "part" + } + + if {[string equal -nocase [string index ${cards} 4] T]} { + hfactory ${scobj_hpath}/Temp5 plain spy none + + hfactory ${scobj_hpath}/Temp5/nick plain user text + hsetprop ${scobj_hpath}/Temp5/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:DB5.T1:TEMP:NICK} + hsetprop ${scobj_hpath}/Temp5/nick rdText ${ns}::rdText ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp5/nick control true + hsetprop ${scobj_hpath}/Temp5/nick data true + hsetprop ${scobj_hpath}/Temp5/nick mutable true + hsetprop ${scobj_hpath}/Temp5/nick nxsave true + hsetprop ${scobj_hpath}/Temp5/nick oldval UNKNOWN + hsetprop ${scobj_hpath}/Temp5/nick klass "parameter" + hsetprop ${scobj_hpath}/Temp5/nick sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Temp5/nick type "part" + hsetprop ${scobj_hpath}/Temp5/nick nxalias "${name}_Temp5_nick" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Temp5/nick 15 + hsetprop ${scobj_hpath}/Temp5/nick simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Temp5/nick simulated true + } + + hfactory ${scobj_hpath}/Temp5/sensor plain user float + hsetprop ${scobj_hpath}/Temp5/sensor read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB5.T1:TEMP:SIG:TEMP} + hsetprop ${scobj_hpath}/Temp5/sensor rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp5/sensor control true + hsetprop ${scobj_hpath}/Temp5/sensor data true + hsetprop ${scobj_hpath}/Temp5/sensor mutable true + hsetprop ${scobj_hpath}/Temp5/sensor nxsave true + hsetprop ${scobj_hpath}/Temp5/sensor permlink data_set "T[format "%02d" ${id}]S05" + hsetprop ${scobj_hpath}/Temp5/sensor @description "T[format "%02d" ${id}]S05" + hsetprop ${scobj_hpath}/Temp5/sensor oldval 0.0 + hsetprop ${scobj_hpath}/Temp5/sensor klass "parameter" + hsetprop ${scobj_hpath}/Temp5/sensor sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Temp5/sensor type "part" + hsetprop ${scobj_hpath}/Temp5/sensor nxalias "${name}_Temp5_sensor" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Temp5/sensor 1 + hsetprop ${scobj_hpath}/Temp5/sensor simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Temp5/sensor simulated true + } + hsetprop ${scobj_hpath}/Temp5 data "true" + hsetprop ${scobj_hpath}/Temp5 klass "@none" + hsetprop ${scobj_hpath}/Temp5 type "part" + } + + if {[string equal -nocase [string index ${cards} 5] T]} { + hfactory ${scobj_hpath}/Temp6 plain spy none + + hfactory ${scobj_hpath}/Temp6/nick plain user text + hsetprop ${scobj_hpath}/Temp6/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:DB6.T1:TEMP:NICK} + hsetprop ${scobj_hpath}/Temp6/nick rdText ${ns}::rdText ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp6/nick control true + hsetprop ${scobj_hpath}/Temp6/nick data true + hsetprop ${scobj_hpath}/Temp6/nick mutable true + hsetprop ${scobj_hpath}/Temp6/nick nxsave true + hsetprop ${scobj_hpath}/Temp6/nick oldval UNKNOWN + hsetprop ${scobj_hpath}/Temp6/nick klass "parameter" + hsetprop ${scobj_hpath}/Temp6/nick sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Temp6/nick type "part" + hsetprop ${scobj_hpath}/Temp6/nick nxalias "${name}_Temp6_nick" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Temp6/nick 15 + hsetprop ${scobj_hpath}/Temp6/nick simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Temp6/nick simulated true + } + + if {[string equal -nocase [string index ${cards} 0] H] && [string equal -nocase [string index ${assoc} 5] 1]} { + hfactory ${scobj_hpath}/Temp6/power plain user float + hsetprop ${scobj_hpath}/Temp6/power read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB1.H1:HTR:SIG:POWR} + hsetprop ${scobj_hpath}/Temp6/power rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp6/power control true + hsetprop ${scobj_hpath}/Temp6/power data true + hsetprop ${scobj_hpath}/Temp6/power mutable true + hsetprop ${scobj_hpath}/Temp6/power nxsave true + hsetprop ${scobj_hpath}/Temp6/power oldval 0.0 + hsetprop ${scobj_hpath}/Temp6/power klass "parameter" + hsetprop ${scobj_hpath}/Temp6/power sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Temp6/power type "part" + hsetprop ${scobj_hpath}/Temp6/power nxalias "${name}_Temp6_power" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Temp6/power 5 + hsetprop ${scobj_hpath}/Temp6/power simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Temp6/power simulated true + } + } + + hfactory ${scobj_hpath}/Temp6/sensor plain user float + hsetprop ${scobj_hpath}/Temp6/sensor read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB6.T1:TEMP:SIG:TEMP} + hsetprop ${scobj_hpath}/Temp6/sensor rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp6/sensor control true + hsetprop ${scobj_hpath}/Temp6/sensor data true + hsetprop ${scobj_hpath}/Temp6/sensor mutable true + hsetprop ${scobj_hpath}/Temp6/sensor nxsave true + hsetprop ${scobj_hpath}/Temp6/sensor permlink data_set "T[format "%02d" ${id}]S06" + hsetprop ${scobj_hpath}/Temp6/sensor @description "T[format "%02d" ${id}]S06" + hsetprop ${scobj_hpath}/Temp6/sensor oldval 0.0 + hsetprop ${scobj_hpath}/Temp6/sensor klass "parameter" + hsetprop ${scobj_hpath}/Temp6/sensor sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Temp6/sensor type "part" + hsetprop ${scobj_hpath}/Temp6/sensor nxalias "${name}_Temp6_sensor" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Temp6/sensor 1 + hsetprop ${scobj_hpath}/Temp6/sensor simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Temp6/sensor simulated true + } + + if {[string equal -nocase [string index ${cards} 0] H] && [string equal -nocase [string index ${assoc} 5] 1]} { + hfactory ${scobj_hpath}/Temp6/setpoint plain user float + hsetprop ${scobj_hpath}/Temp6/setpoint read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB6.T1:TEMP:LOOP:TSET} + hsetprop ${scobj_hpath}/Temp6/setpoint rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp6/setpoint write ${ns}::setPoint ${scobj_hpath} noResponse {SET:DEV:DB6.T1:TEMP:LOOP:TSET:} + hsetprop ${scobj_hpath}/Temp6/setpoint noResponse ${ns}::noResponse ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp6/setpoint check ${ns}::checkrange ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp6/setpoint driving 0 + hsetprop ${scobj_hpath}/Temp6/setpoint checklimits ${ns}::checklimits ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp6/setpoint checkstatus ${ns}::checkstatus ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp6/setpoint halt ${ns}::halt ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp6/setpoint driveable Temp6/sensor + hsetprop ${scobj_hpath}/Temp6/setpoint control true + hsetprop ${scobj_hpath}/Temp6/setpoint data true + hsetprop ${scobj_hpath}/Temp6/setpoint mutable true + hsetprop ${scobj_hpath}/Temp6/setpoint nxsave true + hsetprop ${scobj_hpath}/Temp6/setpoint lowerlimit 0 + hsetprop ${scobj_hpath}/Temp6/setpoint upperlimit 333 + hsetprop ${scobj_hpath}/Temp6/setpoint tolerance ${ttol} + hsetprop ${scobj_hpath}/Temp6/setpoint permlink data_set "T[format "%02d" ${id}]SP06" + hsetprop ${scobj_hpath}/Temp6/setpoint @description "T[format "%02d" ${id}]SP06" + hsetprop ${scobj_hpath}/Temp6/setpoint oldval 0.0 + hsetprop ${scobj_hpath}/Temp6/setpoint klass "parameter" + hsetprop ${scobj_hpath}/Temp6/setpoint sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Temp6/setpoint settle_time "15" + hsetprop ${scobj_hpath}/Temp6/setpoint type "drivable" + hsetprop ${scobj_hpath}/Temp6/setpoint nxalias "${name}_Temp6_setpoint" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Temp6/setpoint 5 + ${sct_controller} write ${scobj_hpath}/Temp6/setpoint + hsetprop ${scobj_hpath}/Temp6/setpoint simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Temp6/setpoint simulated true + } + } + hsetprop ${scobj_hpath}/Temp6 data "true" + hsetprop ${scobj_hpath}/Temp6 klass "@none" + hsetprop ${scobj_hpath}/Temp6 type "part" + if {[string equal -nocase [string index ${cards} 0] H] && [string equal -nocase [string index ${assoc} 5] 1]} { + ansto_makesctdrive ${name}_Temp6_setpoint ${scobj_hpath}/Temp6/setpoint ${scobj_hpath}/Temp6/sensor ${sct_controller} + } + } + + if {[string equal -nocase [string index ${cards} 6] T]} { + hfactory ${scobj_hpath}/Temp7 plain spy none + + hfactory ${scobj_hpath}/Temp7/nick plain user text + hsetprop ${scobj_hpath}/Temp7/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:DB7.T1:TEMP:NICK} + hsetprop ${scobj_hpath}/Temp7/nick rdText ${ns}::rdText ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp7/nick control true + hsetprop ${scobj_hpath}/Temp7/nick data true + hsetprop ${scobj_hpath}/Temp7/nick mutable true + hsetprop ${scobj_hpath}/Temp7/nick nxsave true + hsetprop ${scobj_hpath}/Temp7/nick oldval UNKNOWN + hsetprop ${scobj_hpath}/Temp7/nick klass "parameter" + hsetprop ${scobj_hpath}/Temp7/nick sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Temp7/nick type "part" + hsetprop ${scobj_hpath}/Temp7/nick nxalias "${name}_Temp7_nick" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Temp7/nick 15 + hsetprop ${scobj_hpath}/Temp7/nick simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Temp7/nick simulated true + } + + if {[string equal -nocase [string index ${cards} 1] H] && [string equal -nocase [string index ${assoc} 6] 2]} { + hfactory ${scobj_hpath}/Temp7/power plain user float + hsetprop ${scobj_hpath}/Temp7/power read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB2.H1:HTR:SIG:POWR} + hsetprop ${scobj_hpath}/Temp7/power rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp7/power control true + hsetprop ${scobj_hpath}/Temp7/power data true + hsetprop ${scobj_hpath}/Temp7/power mutable true + hsetprop ${scobj_hpath}/Temp7/power nxsave true + hsetprop ${scobj_hpath}/Temp7/power oldval 0.0 + hsetprop ${scobj_hpath}/Temp7/power klass "parameter" + hsetprop ${scobj_hpath}/Temp7/power sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Temp7/power type "part" + hsetprop ${scobj_hpath}/Temp7/power nxalias "${name}_Temp7_power" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Temp7/power 5 + hsetprop ${scobj_hpath}/Temp7/power simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Temp7/power simulated true + } + } + + hfactory ${scobj_hpath}/Temp7/sensor plain user float + hsetprop ${scobj_hpath}/Temp7/sensor read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB7.T1:TEMP:SIG:TEMP} + hsetprop ${scobj_hpath}/Temp7/sensor rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp7/sensor control true + hsetprop ${scobj_hpath}/Temp7/sensor data true + hsetprop ${scobj_hpath}/Temp7/sensor mutable true + hsetprop ${scobj_hpath}/Temp7/sensor nxsave true + hsetprop ${scobj_hpath}/Temp7/sensor permlink data_set "T[format "%02d" ${id}]S07" + hsetprop ${scobj_hpath}/Temp7/sensor @description "T[format "%02d" ${id}]S07" + hsetprop ${scobj_hpath}/Temp7/sensor oldval 0.0 + hsetprop ${scobj_hpath}/Temp7/sensor klass "parameter" + hsetprop ${scobj_hpath}/Temp7/sensor sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Temp7/sensor type "part" + hsetprop ${scobj_hpath}/Temp7/sensor nxalias "${name}_Temp7_sensor" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Temp7/sensor 1 + hsetprop ${scobj_hpath}/Temp7/sensor simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Temp7/sensor simulated true + } + + if {[string equal -nocase [string index ${cards} 1] H] && [string equal -nocase [string index ${assoc} 6] 2]} { + hfactory ${scobj_hpath}/Temp7/setpoint plain user float + hsetprop ${scobj_hpath}/Temp7/setpoint read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB7.T1:TEMP:LOOP:TSET} + hsetprop ${scobj_hpath}/Temp7/setpoint rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp7/setpoint write ${ns}::setPoint ${scobj_hpath} noResponse {SET:DEV:DB7.T1:TEMP:LOOP:TSET:} + hsetprop ${scobj_hpath}/Temp7/setpoint noResponse ${ns}::noResponse ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp7/setpoint check ${ns}::checkrange ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp7/setpoint driving 0 + hsetprop ${scobj_hpath}/Temp7/setpoint checklimits ${ns}::checklimits ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp7/setpoint checkstatus ${ns}::checkstatus ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp7/setpoint halt ${ns}::halt ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp7/setpoint driveable Temp7/sensor + hsetprop ${scobj_hpath}/Temp7/setpoint control true + hsetprop ${scobj_hpath}/Temp7/setpoint data true + hsetprop ${scobj_hpath}/Temp7/setpoint mutable true + hsetprop ${scobj_hpath}/Temp7/setpoint nxsave true + hsetprop ${scobj_hpath}/Temp7/setpoint lowerlimit 0 + hsetprop ${scobj_hpath}/Temp7/setpoint upperlimit 333 + hsetprop ${scobj_hpath}/Temp7/setpoint tolerance ${ttol} + hsetprop ${scobj_hpath}/Temp7/setpoint permlink data_set "T[format "%02d" ${id}]SP07" + hsetprop ${scobj_hpath}/Temp7/setpoint @description "T[format "%02d" ${id}]SP07" + hsetprop ${scobj_hpath}/Temp7/setpoint oldval 0.0 + hsetprop ${scobj_hpath}/Temp7/setpoint klass "parameter" + hsetprop ${scobj_hpath}/Temp7/setpoint sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Temp7/setpoint settle_time "15" + hsetprop ${scobj_hpath}/Temp7/setpoint type "drivable" + hsetprop ${scobj_hpath}/Temp7/setpoint nxalias "${name}_Temp7_setpoint" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Temp7/setpoint 5 + ${sct_controller} write ${scobj_hpath}/Temp7/setpoint + hsetprop ${scobj_hpath}/Temp7/setpoint simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Temp7/setpoint simulated true + } + } + hsetprop ${scobj_hpath}/Temp7 data "true" + hsetprop ${scobj_hpath}/Temp7 klass "@none" + hsetprop ${scobj_hpath}/Temp7 type "part" + if {[string equal -nocase [string index ${cards} 1] H] && [string equal -nocase [string index ${assoc} 6] 2]} { + ansto_makesctdrive ${name}_Temp7_setpoint ${scobj_hpath}/Temp7/setpoint ${scobj_hpath}/Temp7/sensor ${sct_controller} + } + } + + if {[string equal -nocase [string index ${cards} 7] T]} { + hfactory ${scobj_hpath}/Temp8 plain spy none + + hfactory ${scobj_hpath}/Temp8/nick plain user text + hsetprop ${scobj_hpath}/Temp8/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:DB8.T1:TEMP:NICK} + hsetprop ${scobj_hpath}/Temp8/nick rdText ${ns}::rdText ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp8/nick control true + hsetprop ${scobj_hpath}/Temp8/nick data true + hsetprop ${scobj_hpath}/Temp8/nick mutable true + hsetprop ${scobj_hpath}/Temp8/nick nxsave true + hsetprop ${scobj_hpath}/Temp8/nick oldval UNKNOWN + hsetprop ${scobj_hpath}/Temp8/nick klass "parameter" + hsetprop ${scobj_hpath}/Temp8/nick sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Temp8/nick type "part" + hsetprop ${scobj_hpath}/Temp8/nick nxalias "${name}_Temp8_nick" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Temp8/nick 15 + hsetprop ${scobj_hpath}/Temp8/nick simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Temp8/nick simulated true + } + + if {[string equal -nocase [string index ${cards} 2] H] && [string equal -nocase [string index ${assoc} 7] 3]} { + hfactory ${scobj_hpath}/Temp8/power plain user float + hsetprop ${scobj_hpath}/Temp8/power read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB3.H1:HTR:SIG:POWR} + hsetprop ${scobj_hpath}/Temp8/power rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp8/power control true + hsetprop ${scobj_hpath}/Temp8/power data true + hsetprop ${scobj_hpath}/Temp8/power mutable true + hsetprop ${scobj_hpath}/Temp8/power nxsave true + hsetprop ${scobj_hpath}/Temp8/power oldval 0.0 + hsetprop ${scobj_hpath}/Temp8/power klass "parameter" + hsetprop ${scobj_hpath}/Temp8/power sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Temp8/power type "part" + hsetprop ${scobj_hpath}/Temp8/power nxalias "${name}_Temp8_power" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Temp8/power 5 + hsetprop ${scobj_hpath}/Temp8/power simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Temp8/power simulated true + } + } + + hfactory ${scobj_hpath}/Temp8/sensor plain user float + hsetprop ${scobj_hpath}/Temp8/sensor read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB8.T1:TEMP:SIG:TEMP} + hsetprop ${scobj_hpath}/Temp8/sensor rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp8/sensor control true + hsetprop ${scobj_hpath}/Temp8/sensor data true + hsetprop ${scobj_hpath}/Temp8/sensor mutable true + hsetprop ${scobj_hpath}/Temp8/sensor nxsave true + hsetprop ${scobj_hpath}/Temp8/sensor permlink data_set "T[format "%02d" ${id}]S08" + hsetprop ${scobj_hpath}/Temp8/sensor @description "T[format "%02d" ${id}]S08" + hsetprop ${scobj_hpath}/Temp8/sensor oldval 0.0 + hsetprop ${scobj_hpath}/Temp8/sensor klass "parameter" + hsetprop ${scobj_hpath}/Temp8/sensor sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Temp8/sensor type "part" + hsetprop ${scobj_hpath}/Temp8/sensor nxalias "${name}_Temp8_sensor" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Temp8/sensor 1 + hsetprop ${scobj_hpath}/Temp8/sensor simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Temp8/sensor simulated true + } + + if {[string equal -nocase [string index ${cards} 2] H] && [string equal -nocase [string index ${assoc} 7] 3]} { + hfactory ${scobj_hpath}/Temp8/setpoint plain user float + hsetprop ${scobj_hpath}/Temp8/setpoint read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB8.T1:TEMP:LOOP:TSET} + hsetprop ${scobj_hpath}/Temp8/setpoint rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp8/setpoint write ${ns}::setPoint ${scobj_hpath} noResponse {SET:DEV:DB8.T1:TEMP:LOOP:TSET:} + hsetprop ${scobj_hpath}/Temp8/setpoint noResponse ${ns}::noResponse ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp8/setpoint check ${ns}::checkrange ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp8/setpoint driving 0 + hsetprop ${scobj_hpath}/Temp8/setpoint checklimits ${ns}::checklimits ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp8/setpoint checkstatus ${ns}::checkstatus ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp8/setpoint halt ${ns}::halt ${scobj_hpath} + hsetprop ${scobj_hpath}/Temp8/setpoint driveable Temp8/sensor + hsetprop ${scobj_hpath}/Temp8/setpoint control true + hsetprop ${scobj_hpath}/Temp8/setpoint data true + hsetprop ${scobj_hpath}/Temp8/setpoint mutable true + hsetprop ${scobj_hpath}/Temp8/setpoint nxsave true + hsetprop ${scobj_hpath}/Temp8/setpoint lowerlimit 0 + hsetprop ${scobj_hpath}/Temp8/setpoint upperlimit 333 + hsetprop ${scobj_hpath}/Temp8/setpoint tolerance ${ttol} + hsetprop ${scobj_hpath}/Temp8/setpoint permlink data_set "T[format "%02d" ${id}]SP08" + hsetprop ${scobj_hpath}/Temp8/setpoint @description "T[format "%02d" ${id}]SP08" + hsetprop ${scobj_hpath}/Temp8/setpoint oldval 0.0 + hsetprop ${scobj_hpath}/Temp8/setpoint klass "parameter" + hsetprop ${scobj_hpath}/Temp8/setpoint sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Temp8/setpoint settle_time "15" + hsetprop ${scobj_hpath}/Temp8/setpoint type "drivable" + hsetprop ${scobj_hpath}/Temp8/setpoint nxalias "${name}_Temp8_setpoint" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Temp8/setpoint 5 + ${sct_controller} write ${scobj_hpath}/Temp8/setpoint + hsetprop ${scobj_hpath}/Temp8/setpoint simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Temp8/setpoint simulated true + } + } + hsetprop ${scobj_hpath}/Temp8 data "true" + hsetprop ${scobj_hpath}/Temp8 klass "@none" + hsetprop ${scobj_hpath}/Temp8 type "part" + if {[string equal -nocase [string index ${cards} 2] H] && [string equal -nocase [string index ${assoc} 7] 3]} { + ansto_makesctdrive ${name}_Temp8_setpoint ${scobj_hpath}/Temp8/setpoint ${scobj_hpath}/Temp8/sensor ${sct_controller} + } + } + + if {[string equal -nocase [string index ${cards} 3] V]} { + hfactory ${scobj_hpath}/Valve plain spy none + + hfactory ${scobj_hpath}/Valve/nick plain user text + hsetprop ${scobj_hpath}/Valve/nick read ${ns}::getValue ${scobj_hpath} rdText {READ:DEV:DB4.G1:AUX:NICK} + hsetprop ${scobj_hpath}/Valve/nick rdText ${ns}::rdText ${scobj_hpath} + hsetprop ${scobj_hpath}/Valve/nick control true + hsetprop ${scobj_hpath}/Valve/nick data true + hsetprop ${scobj_hpath}/Valve/nick mutable true + hsetprop ${scobj_hpath}/Valve/nick nxsave true + hsetprop ${scobj_hpath}/Valve/nick oldval UNKNOWN + hsetprop ${scobj_hpath}/Valve/nick klass "parameter" + hsetprop ${scobj_hpath}/Valve/nick sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Valve/nick type "part" + hsetprop ${scobj_hpath}/Valve/nick nxalias "${name}_Valve_nick" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Valve/nick 15 + hsetprop ${scobj_hpath}/Valve/nick simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Valve/nick simulated true + } + + hfactory ${scobj_hpath}/Valve/sensor plain user float + hsetprop ${scobj_hpath}/Valve/sensor read ${ns}::getValue ${scobj_hpath} rdValue {READ:DEV:DB4.G1:AUX:SIG:OPEN} + hsetprop ${scobj_hpath}/Valve/sensor rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/Valve/sensor control true + hsetprop ${scobj_hpath}/Valve/sensor data true + hsetprop ${scobj_hpath}/Valve/sensor mutable true + hsetprop ${scobj_hpath}/Valve/sensor nxsave true + hsetprop ${scobj_hpath}/Valve/sensor oldval 0.0 + hsetprop ${scobj_hpath}/Valve/sensor klass "parameter" + hsetprop ${scobj_hpath}/Valve/sensor sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Valve/sensor type "part" + hsetprop ${scobj_hpath}/Valve/sensor nxalias "${name}_Valve_sensor" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/Valve/sensor 5 + hsetprop ${scobj_hpath}/Valve/sensor simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Valve/sensor simulated true + } + + hfactory ${scobj_hpath}/Valve/setpoint plain user float + hsetprop ${scobj_hpath}/Valve/setpoint write ${ns}::setValve ${scobj_hpath} noResponse {SET:DEV:DB4.G1:AUX:SIG:OPEN:} + hsetprop ${scobj_hpath}/Valve/setpoint noResponse ${ns}::noResponse ${scobj_hpath} + hsetprop ${scobj_hpath}/Valve/setpoint check ${ns}::checkrange ${scobj_hpath} + hsetprop ${scobj_hpath}/Valve/setpoint driving 0 + hsetprop ${scobj_hpath}/Valve/setpoint checklimits ${ns}::checklimits ${scobj_hpath} + hsetprop ${scobj_hpath}/Valve/setpoint checkstatus ${ns}::checkstatus ${scobj_hpath} + hsetprop ${scobj_hpath}/Valve/setpoint halt ${ns}::halt ${scobj_hpath} + hsetprop ${scobj_hpath}/Valve/setpoint driveable Valve/sensor + hsetprop ${scobj_hpath}/Valve/setpoint control true + hsetprop ${scobj_hpath}/Valve/setpoint data true + hsetprop ${scobj_hpath}/Valve/setpoint mutable true + hsetprop ${scobj_hpath}/Valve/setpoint nxsave true + hsetprop ${scobj_hpath}/Valve/setpoint lowerlimit 0 + hsetprop ${scobj_hpath}/Valve/setpoint upperlimit 100 + hsetprop ${scobj_hpath}/Valve/setpoint tolerance ${vtol} + hsetprop ${scobj_hpath}/Valve/setpoint oldval 0.0 + hsetprop ${scobj_hpath}/Valve/setpoint klass "parameter" + hsetprop ${scobj_hpath}/Valve/setpoint sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/Valve/setpoint settle_time "30" + hsetprop ${scobj_hpath}/Valve/setpoint type "drivable" + hsetprop ${scobj_hpath}/Valve/setpoint nxalias "${name}_Valve_setpoint" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} write ${scobj_hpath}/Valve/setpoint + hsetprop ${scobj_hpath}/Valve/setpoint simulated false + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for oxford_mercury" + hsetprop ${scobj_hpath}/Valve/setpoint simulated true + } + hsetprop ${scobj_hpath}/Valve data "true" + hsetprop ${scobj_hpath}/Valve klass "@none" + hsetprop ${scobj_hpath}/Valve type "part" + ansto_makesctdrive ${name}_Valve_setpoint ${scobj_hpath}/Valve/setpoint ${scobj_hpath}/Valve/sensor ${sct_controller} + } + hsetprop ${scobj_hpath} klass ${device_class} + hsetprop ${scobj_hpath} data true + hsetprop ${scobj_hpath} debug_threshold 5 +# mkDriver hook code goes here + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +proc ::scobj::oxford_mercury::add_driver {name device_class simulation_flag ip_address tcp_port id {cards NNNNNNNN} {assoc 00000000} {ttol 1} {ptol 5} {vtol 5}} { + set catch_status [ catch { + ::scobj::oxford_mercury::sics_log 9 "::scobj::oxford_mercury::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${cards} ${assoc} ${ttol} ${ptol} ${vtol}" + if {[string equal -nocase "${simulation_flag}" "false"]} { + if {[string equal -nocase "aqadapter" "${ip_address}"]} { + ::scobj::oxford_mercury::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}" + makesctcontroller sct_${name} aqadapter ${tcp_port} + } else { + ::scobj::oxford_mercury::sics_log 9 "makesctcontroller sct_${name} std ${ip_address}:${tcp_port}" + makesctcontroller sct_${name} std ${ip_address}:${tcp_port} + } + } else { + ::scobj::oxford_mercury::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for oxford_mercury" + ::scobj::oxford_mercury::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL" + makesctcontroller sct_${name} aqadapter NULL + } + ::scobj::oxford_mercury::sics_log 1 "::scobj::oxford_mercury::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${cards} ${assoc} ${ttol} ${ptol} ${vtol}" + ::scobj::oxford_mercury::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${cards} ${assoc} ${ttol} ${ptol} ${vtol} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +namespace eval ::scobj::oxford_mercury { + namespace export debug_threshold + namespace export debug_log + namespace export sics_log + namespace export mkDriver + namespace export add_driver +} + +proc add_oxford_mercury {name ip_address tcp_port id {cards NNNNNNNN} {assoc 00000000} {ttol 1} {ptol 5} {vtol 5}} { + set simulation_flag "[string tolower [SplitReply [environment_simulation]]]" + ::scobj::oxford_mercury::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} ${id} ${cards} ${assoc} ${ttol} ${ptol} ${vtol} +} + +clientput "file evaluation of oxford_mercury_sct.tcl" +::scobj::oxford_mercury::sics_log 9 "file evaluation of oxford_mercury_sct.tcl" + +proc ::scobj::oxford_mercury::read_config {} { + set catch_status [ catch { + set ns "::scobj::oxford_mercury" + 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 $u "enabled"]] + 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]) } { + continue + } + set v [dict get $::config_dict $implementation] + if { !([dict exists $v "driver"]) } { + continue + } + if { [string equal -nocase [dict get $v "driver"] "oxford_mercury"] } { + 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 "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"]" + } + } + 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"]" + } + makesctcontroller sct_${name} aqadapter ${asyncqueue} + } + set arg_list [list] + set missing_list [list] + array unset default_map + array set default_map [list cards NNNNNNNN assoc 00000000 ttol 1 ptol 5 vtol 5] + foreach arg {id cards assoc ttol ptol vtol} { + if {[dict exists $u $arg]} { + lappend arg_list "[dict get $u $arg]" + } elseif {[dict exists $v $arg]} { + lappend arg_list "[dict get $v $arg]" + } elseif {[info exists default_map($arg)]} { + lappend arg_list $default_map($arg) + } else { + ${ns}::sics_log 9 "Missing configuration value $arg" + lappend missing_list $arg + } + } + if { [llength $missing_list] > 0 } { + error "$name is missing configuration values $missing_list" + } + ${ns}::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} {*}$arg_list + } + } + } + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +if { [info exists ::config_dict] } { + ::scobj::oxford_mercury::read_config +} else { + ::scobj::oxford_mercury::sics_log 5 "No config dict" +}