From 2076c0a5fc813805035a74f7ad5288edb1dad769 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Thu, 6 Nov 2014 13:40:06 +1100 Subject: [PATCH] New generated SCT drivers for knauer, sr630 and epson robot wrapper --- .../config/environment/knauer_pump_sct.tcl | 2557 +++++++++++++++++ .../environment/temperature/srs_sr630_sct.tcl | 538 ++++ .../config/robots/epson_pandp_sct.tcl | 127 + 3 files changed, 3222 insertions(+) create mode 100644 site_ansto/instrument/config/environment/knauer_pump_sct.tcl create mode 100644 site_ansto/instrument/config/environment/temperature/srs_sr630_sct.tcl create mode 100644 site_ansto/instrument/config/robots/epson_pandp_sct.tcl diff --git a/site_ansto/instrument/config/environment/knauer_pump_sct.tcl b/site_ansto/instrument/config/environment/knauer_pump_sct.tcl new file mode 100644 index 00000000..1feb4037 --- /dev/null +++ b/site_ansto/instrument/config/environment/knauer_pump_sct.tcl @@ -0,0 +1,2557 @@ +# Generated driver for knauer_pump +# vim: ft=tcl tabstop=8 softtabstop=2 shiftwidth=2 nocindent smartindent +# + +namespace eval ::scobj::knauer_pump { + set debug_threshold 0 +} + +proc ::scobj::knauer_pump::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 fd [open "../log/knauer_pump_[basename ${tc_root}].log" "a"] + set line "[clock format [clock seconds] -format "%T"] ${debug_string}" + puts ${fd} "${line}" + close ${fd} + } + } catch_message ] +} + +proc ::scobj::knauer_pump::sics_log {debug_level debug_string} { + set catch_status [ catch { + set debug_threshold ${::scobj::knauer_pump::debug_threshold} + if {${debug_level} >= ${debug_threshold}} { + sicslog "::scobj::knauer_pump::${debug_string}" + } + } catch_message ] +} + +# checklimits function for driveable interface +proc ::scobj::knauer_pump::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::knauer_pump::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} +} + +# function to request the read of a parameter on a device +proc ::scobj::knauer_pump::fetch_from_glp {tc_root nextState cmd_str} { + set catch_status [ catch { + debug_log ${tc_root} 1 "fetch_from_glp tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set cmd "${cmd_str}" +# fetch_from_glp hook code starts + set index ${cmd_str} + set data [hgetpropval ${tc_root}/dummy/glp real_data] + set dlist [split ${data} ","] + if { [llength ${dlist}] > ${index} } { + sct result [lindex ${dlist} ${index}] + } else { + sct result "" + } + set cmd "@@NOSEND@@" +# fetch_from_glp hook code ends + if { [hpropexists [sct] geterror] } { + debug_log ${tc_root} 9 "[sct] error: [sct geterror]" + error "[sct geterror]" + } + debug_log ${tc_root} 1 "fetch_from_glp 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 request the read of a parameter on a device +proc ::scobj::knauer_pump::fetch_from_status {tc_root nextState cmd_str} { + set catch_status [ catch { + debug_log ${tc_root} 1 "fetch_from_status tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set cmd "${cmd_str}" +# fetch_from_status hook code starts + set index ${cmd_str} + set data [hgetpropval ${tc_root}/dummy/status real_data] + set dlist [split ${data} ","] + if { [llength ${dlist}] > ${index} } { + sct result [lindex ${dlist} ${index}] + } else { + sct result "" + } + set cmd "@@NOSEND@@" +# fetch_from_status hook code ends + if { [hpropexists [sct] geterror] } { + debug_log ${tc_root} 9 "[sct] error: [sct geterror]" + error "[sct geterror]" + } + debug_log ${tc_root} 1 "fetch_from_status 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 request the read of a parameter on a device +proc ::scobj::knauer_pump::flow_fetch {tc_root nextState cmd_str} { + set catch_status [ catch { + debug_log ${tc_root} 1 "flow_fetch tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set cmd "${cmd_str}" +# flow_fetch hook code starts + set data [hgetpropval ${tc_root}/dummy/status real_data] + set dlist [split ${data} ","] + set flow_pv [lindex ${dlist} 4] + sct result [expr {0.001 * ${flow_pv}}] + set cmd "@@NOSEND@@" +# flow_fetch hook code ends + if { [hpropexists [sct] geterror] } { + debug_log ${tc_root} 9 "[sct] error: [sct geterror]" + error "[sct geterror]" + } + debug_log ${tc_root} 1 "flow_fetch 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::knauer_pump::flow_write {tc_root nextState cmd_str} { + set catch_status [ catch { + debug_log ${tc_root} 1 "flow_write 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}" +# flow_write hook code starts + set data [sct target] + set cmd "@@NOSEND@@" + set nextState idle + 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 + } +# flow_write hook code ends + if { [hpropexists [sct] geterror] } { + debug_log ${tc_root} 9 "[sct] error: [sct geterror]" + error "[sct geterror]" + } + if { [hpropexists [sct] driving] } { + if { [hpropexists [sct] writestatus] && [sct writestatus] == "start" } { + sct driving 1 + } + } + debug_log ${tc_root} 1 "flow_write 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 request the read of a parameter on a device +proc ::scobj::knauer_pump::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} +} + +# function to check the write parameter on a device +proc ::scobj::knauer_pump::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} +} + +# check function for hset change +proc ::scobj::knauer_pump::ratios_check {tc_root} { + set catch_status [ catch { + debug_log ${tc_root} 1 "ratios_check 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] + } +# ratios_check hook code starts + set rlist [split ${setpoint} /] + if { [llength ${rlist}] != 4 } { + sct geterror "${setpoint} has [llength ${rlist}] components, needs 4" + error [sct geterror] + } + set sum [expr [lindex ${rlist} 0] + [lindex ${rlist} 1] + [lindex ${rlist} 2] + [lindex ${rlist} 3]] + if { ${sum} != 100 } { + sct geterror "sum is ${sum}, must be 100" + error [sct geterror] + } +# ratios_check hook code ends + if { ${setpoint} < ${lolimit} || ${setpoint} > ${hilimit} } { + error "setpoint ${setpoint} violates limits (${lolimit}..${hilimit}) on [sct]" + } + return OK + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# function to request the read of a parameter on a device +proc ::scobj::knauer_pump::ratios_fetch {tc_root nextState cmd_str} { + set catch_status [ catch { + debug_log ${tc_root} 1 "ratios_fetch tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set cmd "${cmd_str}" +# ratios_fetch hook code starts + set data [hgetpropval ${tc_root}/dummy/status real_data] + set dlist [split ${data} ","] + set ratio_vals "[lindex ${dlist} 5]/[lindex ${dlist} 6]/[lindex ${dlist} 7]/[lindex ${dlist} 8]" + sct result ${ratio_vals} + set cmd "@@NOSEND@@" +# ratios_fetch hook code ends + if { [hpropexists [sct] geterror] } { + debug_log ${tc_root} 9 "[sct] error: [sct geterror]" + error "[sct geterror]" + } + debug_log ${tc_root} 1 "ratios_fetch 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::knauer_pump::ratios_write {tc_root nextState cmd_str} { + set catch_status [ catch { + debug_log ${tc_root} 1 "ratios_write 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}" +# ratios_write hook code starts + set data [sct target] + set cmd "@@NOSEND@@" + set nextState idle + 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 + } +# ratios_write hook code ends + if { [hpropexists [sct] geterror] } { + debug_log ${tc_root} 9 "[sct] error: [sct geterror]" + error "[sct geterror]" + } + if { [hpropexists [sct] driving] } { + if { [hpropexists [sct] writestatus] && [sct writestatus] == "start" } { + sct driving 1 + } + } + debug_log ${tc_root} 1 "ratios_write 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 parse the read of a parameter on a device +proc ::scobj::knauer_pump::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 goes here + 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::knauer_pump::read_glp {tc_root} { + set catch_status [ catch { + debug_log ${tc_root} 1 "read_glp 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]" + } +# read_glp hook code starts + if { [string equal -nocase -length 6 ${data} "ERROR:"] } { + } else { + set dlist [split [lindex [split ${data} ":"] 1] ","] + sct real_data "[join [lrange ${dlist} 0 end] ,]" + set data "Hidden in real_data property" + } +# read_glp 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::knauer_pump::read_status {tc_root} { + set catch_status [ catch { + debug_log ${tc_root} 1 "read_status 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]" + } +# read_status hook code starts + set dlist [split [lindex [split ${data} ":"] 1] ","] + sct real_data "[join [lrange ${dlist} 0 end] ,]" + set data "Hidden in real_data property" +# read_status 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::knauer_pump::remote_read {tc_root} { + set catch_status [ catch { + debug_log ${tc_root} 1 "remote_read 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]" + } +# remote_read hook code starts + if { [string equal -length 7 ${data} "REMOTE:"] } { + set data [lindex [split ${data} :] 1] + } else { + sct geterror "bad response" + error "[sct geterror]" + } +# remote_read 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::knauer_pump::remote_write {tc_root nextState cmd_str} { + set catch_status [ catch { + debug_log ${tc_root} 1 "remote_write 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}" +# remote_write hook code starts + if { ${par} == 0 } { + set cmd "LOCAL" + } else { + set cmd "REMOTE" + } +# remote_write hook code ends + if { [hpropexists [sct] geterror] } { + debug_log ${tc_root} 9 "[sct] error: [sct geterror]" + error "[sct geterror]" + } + if { [hpropexists [sct] driving] } { + if { [hpropexists [sct] writestatus] && [sct writestatus] == "start" } { + sct driving 1 + } + } + debug_log ${tc_root} 1 "remote_write 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::knauer_pump::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 request the read of a parameter on a device +proc ::scobj::knauer_pump::state_fetch {tc_root nextState cmd_str} { + set catch_status [ catch { + debug_log ${tc_root} 1 "state_fetch tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set cmd "${cmd_str}" +# state_fetch hook code starts + set index 1 + set data [hgetpropval ${tc_root}/dummy/status real_data] + set dlist [split ${data} ","] + set state_code [lindex ${dlist} ${index}] + set cmd "@@NOSEND@@" + if { ${state_code} < 0 || ${state_code} > 9 } { + sct geterror "Invalid device_state ${state_code}" + error "[sct geterror]" + } + set slist [list "SYS_ST_INITIALIZING" \ + "SYS_ST_OFF" \ + "SYS_ST_IDLE" \ + "SYS_ST_RUN" \ + "SYS_ST_HOLD" \ + "SYS_ST_PURGE" \ + "SYS_ST_STANDBY" \ + "SYS_ST_FAILED" \ + "SYS_ST_RUNATEND" \ + ] + sct result [lindex ${slist} ${state_code}] +# state_fetch hook code ends + if { [hpropexists [sct] geterror] } { + debug_log ${tc_root} 9 "[sct] error: [sct geterror]" + error "[sct geterror]" + } + debug_log ${tc_root} 1 "state_fetch 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 request the read of a parameter on a device +proc ::scobj::knauer_pump::status_fetch {tc_root nextState cmd_str} { + set catch_status [ catch { + debug_log ${tc_root} 1 "status_fetch tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set cmd "${cmd_str}" +# status_fetch hook code starts + set index 1 + set data [hgetpropval ${tc_root}/dummy/status real_data] + set dlist [split ${data} ","] + set status_code [lindex ${dlist} ${index}] + set cmd "@@NOSEND@@" + if { ${status_code} == 3 } { + sct result "PUMPING" + } else { + sct result "IDLE" + } +# status_fetch hook code ends + if { [hpropexists [sct] geterror] } { + debug_log ${tc_root} 9 "[sct] error: [sct geterror]" + error "[sct geterror]" + } + debug_log ${tc_root} 1 "status_fetch 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 request the read of a parameter on a device +proc ::scobj::knauer_pump::volume_checkpumping {tc_root nextState cmd_str} { + set catch_status [ catch { + debug_log ${tc_root} 1 "volume_checkpumping tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set cmd "${cmd_str}" +# volume_checkpumping hook code starts + set cmd "@@NOSEND@@" + set nextState idle + if { [hpropexists [sct] pumping] && [sct pumping] } { + if { [hpropexists [sct] driving] && [sct driving] } { + volume_checkstatus "${tc_root}" + } + set sp "[sct target]" + set pv "[hval ${tc_root}/[sct driveable]]" + if { (${sp} - ${pv}) <= [sct tolerance] } { + set flow_tgt 0 + set ratio_tgt [join [split [hval ${tc_root}/pump/ratio_sp] /] ,] + set cmd "RAMP:0,${flow_tgt},${ratio_tgt},0,0,0,0,0,0,0,0,2" + set nextState noResponse + sct driving 0 + sct pumping 0 + } + } +# volume_checkpumping hook code ends + if { [hpropexists [sct] geterror] } { + debug_log ${tc_root} 9 "[sct] error: [sct geterror]" + error "[sct geterror]" + } + debug_log ${tc_root} 1 "volume_checkpumping sct send ${cmd}" + if {![string equal -nocase -length 10 ${cmd} "@@NOSEND@@"]} { + sct send "${cmd}" + } + return ${nextState} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# checkstatus function for driveable interface +proc ::scobj::knauer_pump::volume_checkstatus {tc_root} { + set catch_status [ catch { +# volume_checkstatus hook code goes here + if {[sct driving]} { + set sp "[sct target]" + if {[hpropexists [sct] simulated] && [sct simulated] == "true"} { + set pv "${sp}" + hset ${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] } { + 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::knauer_pump::volume_fetch {tc_root nextState cmd_str} { + set catch_status [ catch { + debug_log ${tc_root} 1 "volume_fetch tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set cmd "${cmd_str}" +# volume_fetch hook code starts + set data [hgetpropval ${tc_root}/dummy/glp real_data] + set dlist [split ${data} ","] + if { [llength ${dlist}] > 11 } { + set pump_volm [lindex ${dlist} 10] + set pump_voln [lindex ${dlist} 11] + set pump_volume [expr {${pump_volm} + 0.000001 * ${pump_voln}}] + } else { + set pump_volume 0.0 + } + sct raw_volume ${pump_volume} + if { [hpropexists [sct] base_volume] } { + set pump_volume [expr {${pump_volume} - [sct base_volume]}] + } elseif { [hpropexists [sct] raw_volume] } { + sct base_volume [sct raw_volume] + } + sct result [format "%.2f" ${pump_volume}] + set cmd "@@NOSEND@@" +# volume_fetch hook code ends + if { [hpropexists [sct] geterror] } { + debug_log ${tc_root} 9 "[sct] error: [sct geterror]" + error "[sct geterror]" + } + debug_log ${tc_root} 1 "volume_fetch 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::knauer_pump::volume_halt {tc_root} { + set catch_status [ catch { + debug_log ${tc_root} 1 "volume_halt tc_root=${tc_root} sct=[sct] driving=[sct driving]" + ### TODO hset [sct] [hval [sct]] +# volume_halt hook code starts + set flow_tgt 0 + set ratio_tgt [join [split [hval ${tc_root}/pump/ratio_sp] /] ,] + set cmd "RAMP:0,${flow_tgt},${ratio_tgt},0,0,0,0,0,0,0,0,2" + sct send ${cmd} +# volume_halt hook code ends + sct driving 0 + return "idle" + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +# function to write a parameter value on a device +proc ::scobj::knauer_pump::volume_write {tc_root nextState cmd_str} { + set catch_status [ catch { + debug_log ${tc_root} 1 "volume_write 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}" +# volume_write hook code starts + hsetprop ${tc_root}/[sct driveable] base_volume [hgetpropval ${tc_root}/[sct driveable] raw_volume] + hset ${tc_root}/[sct driveable] 0.0 + set flow_tgt [expr {int(1000.0 * [hval ${tc_root}/pump/flow_sp])}] + set ratio_tgt [join [split [hval ${tc_root}/pump/ratio_sp] /] ,] + set cmd "RAMP:0,${flow_tgt},${ratio_tgt},0,0,0,0,0,0,0,0,3" + sct pumping 1 + set data ${par} + 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 + } +# volume_write hook code ends + if { [hpropexists [sct] geterror] } { + debug_log ${tc_root} 9 "[sct] error: [sct geterror]" + error "[sct geterror]" + } + if { [hpropexists [sct] driving] } { + if { [hpropexists [sct] writestatus] && [sct writestatus] == "start" } { + sct driving 1 + } + } + debug_log ${tc_root} 1 "volume_write 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::knauer_pump::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port } { + ::scobj::knauer_pump::sics_log 9 "::scobj::knauer_pump::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}" + set ns "[namespace current]" + set catch_status [ catch { + + MakeSICSObj ${name} SCT_OBJECT + + sicslist setatt ${name} klass ${device_class} + sicslist setatt ${name} long_name ${name} + + set scobj_hpath /sics/${name} + + # Start of named group: dummy + hfactory ${scobj_hpath}/dummy plain spy none + + # Start of var: glp + hfactory ${scobj_hpath}/dummy/glp plain user text + hsetprop ${scobj_hpath}/dummy/glp read ${ns}::getValue ${scobj_hpath} read_glp {GLP?} + hsetprop ${scobj_hpath}/dummy/glp read_glp ${ns}::read_glp ${scobj_hpath} + hsetprop ${scobj_hpath}/dummy/glp control false + hsetprop ${scobj_hpath}/dummy/glp data false + hsetprop ${scobj_hpath}/dummy/glp mutable true + hsetprop ${scobj_hpath}/dummy/glp nxsave false + hsetprop ${scobj_hpath}/dummy/glp oldval UNKNOWN + hsetprop ${scobj_hpath}/dummy/glp real_data " " + hsetprop ${scobj_hpath}/dummy/glp sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/dummy/glp type "part" + hsetprop ${scobj_hpath}/dummy/glp nxalias "${name}_dummy_glp" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/dummy/glp 1 + hsetprop ${scobj_hpath}/dummy/glp simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/dummy/glp simulated true + } + + # Start of var: status + hfactory ${scobj_hpath}/dummy/status plain user text + hsetprop ${scobj_hpath}/dummy/status read ${ns}::getValue ${scobj_hpath} read_status {STATUS?} + hsetprop ${scobj_hpath}/dummy/status read_status ${ns}::read_status ${scobj_hpath} + hsetprop ${scobj_hpath}/dummy/status control false + hsetprop ${scobj_hpath}/dummy/status data false + hsetprop ${scobj_hpath}/dummy/status mutable true + hsetprop ${scobj_hpath}/dummy/status nxsave false + hsetprop ${scobj_hpath}/dummy/status oldval UNKNOWN + hsetprop ${scobj_hpath}/dummy/status sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/dummy/status type "part" + hsetprop ${scobj_hpath}/dummy/status nxalias "${name}_dummy_status" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/dummy/status 1 + hsetprop ${scobj_hpath}/dummy/status simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/dummy/status simulated true + } + hsetprop ${scobj_hpath}/dummy data "false" + hsetprop ${scobj_hpath}/dummy klass "@none" + hsetprop ${scobj_hpath}/dummy type "part" + # End of named group: dummy + + # Start of named group: glp + hfactory ${scobj_hpath}/glp plain spy none + + # Start of var: board_time + hfactory ${scobj_hpath}/glp/board_time plain user text + hsetprop ${scobj_hpath}/glp/board_time read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {0} + hsetprop ${scobj_hpath}/glp/board_time rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/glp/board_time control true + hsetprop ${scobj_hpath}/glp/board_time data true + hsetprop ${scobj_hpath}/glp/board_time mutable true + hsetprop ${scobj_hpath}/glp/board_time nxsave true + hsetprop ${scobj_hpath}/glp/board_time oldval UNKNOWN + hsetprop ${scobj_hpath}/glp/board_time klass "parameter" + hsetprop ${scobj_hpath}/glp/board_time sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/glp/board_time type "part" + hsetprop ${scobj_hpath}/glp/board_time nxalias "${name}_glp_board_time" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/glp/board_time 1 + hsetprop ${scobj_hpath}/glp/board_time simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/glp/board_time simulated true + } + + # Start of var: head_count + hfactory ${scobj_hpath}/glp/head_count plain user text + hsetprop ${scobj_hpath}/glp/head_count read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {3} + hsetprop ${scobj_hpath}/glp/head_count rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/glp/head_count control true + hsetprop ${scobj_hpath}/glp/head_count data true + hsetprop ${scobj_hpath}/glp/head_count mutable true + hsetprop ${scobj_hpath}/glp/head_count nxsave true + hsetprop ${scobj_hpath}/glp/head_count oldval UNKNOWN + hsetprop ${scobj_hpath}/glp/head_count klass "parameter" + hsetprop ${scobj_hpath}/glp/head_count sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/glp/head_count type "part" + hsetprop ${scobj_hpath}/glp/head_count nxalias "${name}_glp_head_count" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/glp/head_count 1 + hsetprop ${scobj_hpath}/glp/head_count simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/glp/head_count simulated true + } + + # Start of var: head_pwrhi + hfactory ${scobj_hpath}/glp/head_pwrhi plain user text + hsetprop ${scobj_hpath}/glp/head_pwrhi read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {7} + hsetprop ${scobj_hpath}/glp/head_pwrhi rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/glp/head_pwrhi control true + hsetprop ${scobj_hpath}/glp/head_pwrhi data true + hsetprop ${scobj_hpath}/glp/head_pwrhi mutable true + hsetprop ${scobj_hpath}/glp/head_pwrhi nxsave true + hsetprop ${scobj_hpath}/glp/head_pwrhi oldval UNKNOWN + hsetprop ${scobj_hpath}/glp/head_pwrhi klass "parameter" + hsetprop ${scobj_hpath}/glp/head_pwrhi sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/glp/head_pwrhi type "part" + hsetprop ${scobj_hpath}/glp/head_pwrhi nxalias "${name}_glp_head_pwrhi" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/glp/head_pwrhi 1 + hsetprop ${scobj_hpath}/glp/head_pwrhi simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/glp/head_pwrhi simulated true + } + + # Start of var: head_pwrlo + hfactory ${scobj_hpath}/glp/head_pwrlo plain user text + hsetprop ${scobj_hpath}/glp/head_pwrlo read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {8} + hsetprop ${scobj_hpath}/glp/head_pwrlo rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/glp/head_pwrlo control true + hsetprop ${scobj_hpath}/glp/head_pwrlo data true + hsetprop ${scobj_hpath}/glp/head_pwrlo mutable true + hsetprop ${scobj_hpath}/glp/head_pwrlo nxsave true + hsetprop ${scobj_hpath}/glp/head_pwrlo oldval UNKNOWN + hsetprop ${scobj_hpath}/glp/head_pwrlo klass "parameter" + hsetprop ${scobj_hpath}/glp/head_pwrlo sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/glp/head_pwrlo type "part" + hsetprop ${scobj_hpath}/glp/head_pwrlo nxalias "${name}_glp_head_pwrlo" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/glp/head_pwrlo 1 + hsetprop ${scobj_hpath}/glp/head_pwrlo simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/glp/head_pwrlo simulated true + } + + # Start of var: head_time + hfactory ${scobj_hpath}/glp/head_time plain user text + hsetprop ${scobj_hpath}/glp/head_time read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {4} + hsetprop ${scobj_hpath}/glp/head_time rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/glp/head_time control true + hsetprop ${scobj_hpath}/glp/head_time data true + hsetprop ${scobj_hpath}/glp/head_time mutable true + hsetprop ${scobj_hpath}/glp/head_time nxsave true + hsetprop ${scobj_hpath}/glp/head_time oldval UNKNOWN + hsetprop ${scobj_hpath}/glp/head_time klass "parameter" + hsetprop ${scobj_hpath}/glp/head_time sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/glp/head_time type "part" + hsetprop ${scobj_hpath}/glp/head_time nxalias "${name}_glp_head_time" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/glp/head_time 1 + hsetprop ${scobj_hpath}/glp/head_time simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/glp/head_time simulated true + } + + # Start of var: head_volm + hfactory ${scobj_hpath}/glp/head_volm plain user text + hsetprop ${scobj_hpath}/glp/head_volm read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {5} + hsetprop ${scobj_hpath}/glp/head_volm rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/glp/head_volm control true + hsetprop ${scobj_hpath}/glp/head_volm data true + hsetprop ${scobj_hpath}/glp/head_volm mutable true + hsetprop ${scobj_hpath}/glp/head_volm nxsave true + hsetprop ${scobj_hpath}/glp/head_volm oldval UNKNOWN + hsetprop ${scobj_hpath}/glp/head_volm klass "parameter" + hsetprop ${scobj_hpath}/glp/head_volm sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/glp/head_volm type "part" + hsetprop ${scobj_hpath}/glp/head_volm nxalias "${name}_glp_head_volm" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/glp/head_volm 1 + hsetprop ${scobj_hpath}/glp/head_volm simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/glp/head_volm simulated true + } + + # Start of var: head_voln + hfactory ${scobj_hpath}/glp/head_voln plain user text + hsetprop ${scobj_hpath}/glp/head_voln read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {6} + hsetprop ${scobj_hpath}/glp/head_voln rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/glp/head_voln control true + hsetprop ${scobj_hpath}/glp/head_voln data true + hsetprop ${scobj_hpath}/glp/head_voln mutable true + hsetprop ${scobj_hpath}/glp/head_voln nxsave true + hsetprop ${scobj_hpath}/glp/head_voln oldval UNKNOWN + hsetprop ${scobj_hpath}/glp/head_voln klass "parameter" + hsetprop ${scobj_hpath}/glp/head_voln sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/glp/head_voln type "part" + hsetprop ${scobj_hpath}/glp/head_voln nxalias "${name}_glp_head_voln" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/glp/head_voln 1 + hsetprop ${scobj_hpath}/glp/head_voln simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/glp/head_voln simulated true + } + + # Start of var: motor_time + hfactory ${scobj_hpath}/glp/motor_time plain user text + hsetprop ${scobj_hpath}/glp/motor_time read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {1} + hsetprop ${scobj_hpath}/glp/motor_time rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/glp/motor_time control true + hsetprop ${scobj_hpath}/glp/motor_time data true + hsetprop ${scobj_hpath}/glp/motor_time mutable true + hsetprop ${scobj_hpath}/glp/motor_time nxsave true + hsetprop ${scobj_hpath}/glp/motor_time oldval UNKNOWN + hsetprop ${scobj_hpath}/glp/motor_time klass "parameter" + hsetprop ${scobj_hpath}/glp/motor_time sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/glp/motor_time type "part" + hsetprop ${scobj_hpath}/glp/motor_time nxalias "${name}_glp_motor_time" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/glp/motor_time 1 + hsetprop ${scobj_hpath}/glp/motor_time simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/glp/motor_time simulated true + } + + # Start of var: pump_pwrhi + hfactory ${scobj_hpath}/glp/pump_pwrhi plain user text + hsetprop ${scobj_hpath}/glp/pump_pwrhi read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {12} + hsetprop ${scobj_hpath}/glp/pump_pwrhi rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/glp/pump_pwrhi control true + hsetprop ${scobj_hpath}/glp/pump_pwrhi data true + hsetprop ${scobj_hpath}/glp/pump_pwrhi mutable true + hsetprop ${scobj_hpath}/glp/pump_pwrhi nxsave true + hsetprop ${scobj_hpath}/glp/pump_pwrhi oldval UNKNOWN + hsetprop ${scobj_hpath}/glp/pump_pwrhi klass "parameter" + hsetprop ${scobj_hpath}/glp/pump_pwrhi sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/glp/pump_pwrhi type "part" + hsetprop ${scobj_hpath}/glp/pump_pwrhi nxalias "${name}_glp_pump_pwrhi" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/glp/pump_pwrhi 1 + hsetprop ${scobj_hpath}/glp/pump_pwrhi simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/glp/pump_pwrhi simulated true + } + + # Start of var: pump_pwrlo + hfactory ${scobj_hpath}/glp/pump_pwrlo plain user text + hsetprop ${scobj_hpath}/glp/pump_pwrlo read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {13} + hsetprop ${scobj_hpath}/glp/pump_pwrlo rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/glp/pump_pwrlo control true + hsetprop ${scobj_hpath}/glp/pump_pwrlo data true + hsetprop ${scobj_hpath}/glp/pump_pwrlo mutable true + hsetprop ${scobj_hpath}/glp/pump_pwrlo nxsave true + hsetprop ${scobj_hpath}/glp/pump_pwrlo oldval UNKNOWN + hsetprop ${scobj_hpath}/glp/pump_pwrlo klass "parameter" + hsetprop ${scobj_hpath}/glp/pump_pwrlo sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/glp/pump_pwrlo type "part" + hsetprop ${scobj_hpath}/glp/pump_pwrlo nxalias "${name}_glp_pump_pwrlo" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/glp/pump_pwrlo 1 + hsetprop ${scobj_hpath}/glp/pump_pwrlo simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/glp/pump_pwrlo simulated true + } + + # Start of var: pump_revs + hfactory ${scobj_hpath}/glp/pump_revs plain user text + hsetprop ${scobj_hpath}/glp/pump_revs read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {9} + hsetprop ${scobj_hpath}/glp/pump_revs rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/glp/pump_revs control true + hsetprop ${scobj_hpath}/glp/pump_revs data true + hsetprop ${scobj_hpath}/glp/pump_revs mutable true + hsetprop ${scobj_hpath}/glp/pump_revs nxsave true + hsetprop ${scobj_hpath}/glp/pump_revs oldval UNKNOWN + hsetprop ${scobj_hpath}/glp/pump_revs klass "parameter" + hsetprop ${scobj_hpath}/glp/pump_revs sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/glp/pump_revs type "part" + hsetprop ${scobj_hpath}/glp/pump_revs nxalias "${name}_glp_pump_revs" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/glp/pump_revs 1 + hsetprop ${scobj_hpath}/glp/pump_revs simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/glp/pump_revs simulated true + } + + # Start of var: pump_volm + hfactory ${scobj_hpath}/glp/pump_volm plain user text + hsetprop ${scobj_hpath}/glp/pump_volm read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {10} + hsetprop ${scobj_hpath}/glp/pump_volm rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/glp/pump_volm control true + hsetprop ${scobj_hpath}/glp/pump_volm data true + hsetprop ${scobj_hpath}/glp/pump_volm mutable true + hsetprop ${scobj_hpath}/glp/pump_volm nxsave true + hsetprop ${scobj_hpath}/glp/pump_volm oldval UNKNOWN + hsetprop ${scobj_hpath}/glp/pump_volm klass "parameter" + hsetprop ${scobj_hpath}/glp/pump_volm sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/glp/pump_volm type "part" + hsetprop ${scobj_hpath}/glp/pump_volm nxalias "${name}_glp_pump_volm" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/glp/pump_volm 1 + hsetprop ${scobj_hpath}/glp/pump_volm simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/glp/pump_volm simulated true + } + + # Start of var: pump_voln + hfactory ${scobj_hpath}/glp/pump_voln plain user text + hsetprop ${scobj_hpath}/glp/pump_voln read ${ns}::fetch_from_glp ${scobj_hpath} rdValue {11} + hsetprop ${scobj_hpath}/glp/pump_voln rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/glp/pump_voln control true + hsetprop ${scobj_hpath}/glp/pump_voln data true + hsetprop ${scobj_hpath}/glp/pump_voln mutable true + hsetprop ${scobj_hpath}/glp/pump_voln nxsave true + hsetprop ${scobj_hpath}/glp/pump_voln oldval UNKNOWN + hsetprop ${scobj_hpath}/glp/pump_voln klass "parameter" + hsetprop ${scobj_hpath}/glp/pump_voln sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/glp/pump_voln type "part" + hsetprop ${scobj_hpath}/glp/pump_voln nxalias "${name}_glp_pump_voln" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/glp/pump_voln 1 + hsetprop ${scobj_hpath}/glp/pump_voln simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/glp/pump_voln simulated true + } + hsetprop ${scobj_hpath}/glp data "true" + hsetprop ${scobj_hpath}/glp klass "@none" + hsetprop ${scobj_hpath}/glp type "part" + # End of named group: glp + + # Start of named group: prog + hfactory ${scobj_hpath}/prog plain spy none + + # Start of var: line_01 + hfactory ${scobj_hpath}/prog/line_01 plain user text + hsetprop ${scobj_hpath}/prog/line_01 read ${ns}::getValue ${scobj_hpath} rdValue {TT_GET:1,1} + hsetprop ${scobj_hpath}/prog/line_01 rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/prog/line_01 control true + hsetprop ${scobj_hpath}/prog/line_01 data true + hsetprop ${scobj_hpath}/prog/line_01 mutable true + hsetprop ${scobj_hpath}/prog/line_01 nxsave true + hsetprop ${scobj_hpath}/prog/line_01 oldval UNKNOWN + hsetprop ${scobj_hpath}/prog/line_01 klass "parameter" + hsetprop ${scobj_hpath}/prog/line_01 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/prog/line_01 type "part" + hsetprop ${scobj_hpath}/prog/line_01 nxalias "${name}_prog_line_01" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/prog/line_01 30 + hsetprop ${scobj_hpath}/prog/line_01 simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/prog/line_01 simulated true + } + + # Start of var: line_02 + hfactory ${scobj_hpath}/prog/line_02 plain user text + hsetprop ${scobj_hpath}/prog/line_02 read ${ns}::getValue ${scobj_hpath} rdValue {TT_GET:1,2} + hsetprop ${scobj_hpath}/prog/line_02 rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/prog/line_02 control true + hsetprop ${scobj_hpath}/prog/line_02 data true + hsetprop ${scobj_hpath}/prog/line_02 mutable true + hsetprop ${scobj_hpath}/prog/line_02 nxsave true + hsetprop ${scobj_hpath}/prog/line_02 oldval UNKNOWN + hsetprop ${scobj_hpath}/prog/line_02 klass "parameter" + hsetprop ${scobj_hpath}/prog/line_02 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/prog/line_02 type "part" + hsetprop ${scobj_hpath}/prog/line_02 nxalias "${name}_prog_line_02" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/prog/line_02 30 + hsetprop ${scobj_hpath}/prog/line_02 simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/prog/line_02 simulated true + } + + # Start of var: line_03 + hfactory ${scobj_hpath}/prog/line_03 plain user text + hsetprop ${scobj_hpath}/prog/line_03 read ${ns}::getValue ${scobj_hpath} rdValue {TT_GET:1,3} + hsetprop ${scobj_hpath}/prog/line_03 rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/prog/line_03 control true + hsetprop ${scobj_hpath}/prog/line_03 data true + hsetprop ${scobj_hpath}/prog/line_03 mutable true + hsetprop ${scobj_hpath}/prog/line_03 nxsave true + hsetprop ${scobj_hpath}/prog/line_03 oldval UNKNOWN + hsetprop ${scobj_hpath}/prog/line_03 klass "parameter" + hsetprop ${scobj_hpath}/prog/line_03 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/prog/line_03 type "part" + hsetprop ${scobj_hpath}/prog/line_03 nxalias "${name}_prog_line_03" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/prog/line_03 30 + hsetprop ${scobj_hpath}/prog/line_03 simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/prog/line_03 simulated true + } + + # Start of var: line_04 + hfactory ${scobj_hpath}/prog/line_04 plain user text + hsetprop ${scobj_hpath}/prog/line_04 read ${ns}::getValue ${scobj_hpath} rdValue {TT_GET:1,4} + hsetprop ${scobj_hpath}/prog/line_04 rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/prog/line_04 control true + hsetprop ${scobj_hpath}/prog/line_04 data true + hsetprop ${scobj_hpath}/prog/line_04 mutable true + hsetprop ${scobj_hpath}/prog/line_04 nxsave true + hsetprop ${scobj_hpath}/prog/line_04 oldval UNKNOWN + hsetprop ${scobj_hpath}/prog/line_04 klass "parameter" + hsetprop ${scobj_hpath}/prog/line_04 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/prog/line_04 type "part" + hsetprop ${scobj_hpath}/prog/line_04 nxalias "${name}_prog_line_04" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/prog/line_04 30 + hsetprop ${scobj_hpath}/prog/line_04 simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/prog/line_04 simulated true + } + + # Start of var: line_05 + hfactory ${scobj_hpath}/prog/line_05 plain user text + hsetprop ${scobj_hpath}/prog/line_05 read ${ns}::getValue ${scobj_hpath} rdValue {TT_GET:1,5} + hsetprop ${scobj_hpath}/prog/line_05 rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/prog/line_05 control true + hsetprop ${scobj_hpath}/prog/line_05 data true + hsetprop ${scobj_hpath}/prog/line_05 mutable true + hsetprop ${scobj_hpath}/prog/line_05 nxsave true + hsetprop ${scobj_hpath}/prog/line_05 oldval UNKNOWN + hsetprop ${scobj_hpath}/prog/line_05 klass "parameter" + hsetprop ${scobj_hpath}/prog/line_05 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/prog/line_05 type "part" + hsetprop ${scobj_hpath}/prog/line_05 nxalias "${name}_prog_line_05" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/prog/line_05 30 + hsetprop ${scobj_hpath}/prog/line_05 simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/prog/line_05 simulated true + } + hsetprop ${scobj_hpath}/prog data "true" + hsetprop ${scobj_hpath}/prog klass "@none" + hsetprop ${scobj_hpath}/prog type "part" + # End of named group: prog + + # Start of named group: pump + hfactory ${scobj_hpath}/pump plain spy none + + # Start of var: flow_pv + hfactory ${scobj_hpath}/pump/flow_pv plain user float + hsetprop ${scobj_hpath}/pump/flow_pv read ${ns}::flow_fetch ${scobj_hpath} rdValue { } + hsetprop ${scobj_hpath}/pump/flow_pv rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/flow_pv control true + hsetprop ${scobj_hpath}/pump/flow_pv data true + hsetprop ${scobj_hpath}/pump/flow_pv mutable true + hsetprop ${scobj_hpath}/pump/flow_pv nxsave true + hsetprop ${scobj_hpath}/pump/flow_pv oldval 0.0 + hsetprop ${scobj_hpath}/pump/flow_pv klass "parameter" + hsetprop ${scobj_hpath}/pump/flow_pv sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/pump/flow_pv type "part" + hsetprop ${scobj_hpath}/pump/flow_pv units "mL/min" + hsetprop ${scobj_hpath}/pump/flow_pv nxalias "${name}_pump_flow_pv" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/pump/flow_pv 1 + hsetprop ${scobj_hpath}/pump/flow_pv simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/pump/flow_pv simulated true + } + + # Start of var: flow_sp + hfactory ${scobj_hpath}/pump/flow_sp plain user float + hsetprop ${scobj_hpath}/pump/flow_sp write ${ns}::flow_write ${scobj_hpath} noResponse { } + hsetprop ${scobj_hpath}/pump/flow_sp noResponse ${ns}::noResponse ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/flow_sp check ${ns}::checkrange ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/flow_sp control true + hsetprop ${scobj_hpath}/pump/flow_sp data true + hsetprop ${scobj_hpath}/pump/flow_sp mutable true + hsetprop ${scobj_hpath}/pump/flow_sp nxsave true + hsetprop ${scobj_hpath}/pump/flow_sp lowerlimit 0 + hsetprop ${scobj_hpath}/pump/flow_sp upperlimit 10 + hsetprop ${scobj_hpath}/pump/flow_sp oldval 0.0 + hsetprop ${scobj_hpath}/pump/flow_sp klass "parameter" + hsetprop ${scobj_hpath}/pump/flow_sp sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/pump/flow_sp type "part" + hsetprop ${scobj_hpath}/pump/flow_sp units "mL/min" + hsetprop ${scobj_hpath}/pump/flow_sp nxalias "${name}_pump_flow_sp" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} write ${scobj_hpath}/pump/flow_sp + hsetprop ${scobj_hpath}/pump/flow_sp simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/pump/flow_sp simulated true + } + + # Start of var: ratio_pv + hfactory ${scobj_hpath}/pump/ratio_pv plain user text + hsetprop ${scobj_hpath}/pump/ratio_pv read ${ns}::ratios_fetch ${scobj_hpath} rdValue { } + hsetprop ${scobj_hpath}/pump/ratio_pv rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/ratio_pv control true + hsetprop ${scobj_hpath}/pump/ratio_pv data true + hsetprop ${scobj_hpath}/pump/ratio_pv mutable true + hsetprop ${scobj_hpath}/pump/ratio_pv nxsave true + hsetprop ${scobj_hpath}/pump/ratio_pv oldval UNKNOWN + hsetprop ${scobj_hpath}/pump/ratio_pv klass "parameter" + hsetprop ${scobj_hpath}/pump/ratio_pv sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/pump/ratio_pv type "part" + hsetprop ${scobj_hpath}/pump/ratio_pv units "percent" + hsetprop ${scobj_hpath}/pump/ratio_pv nxalias "${name}_pump_ratio_pv" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/pump/ratio_pv 1 + hsetprop ${scobj_hpath}/pump/ratio_pv simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/pump/ratio_pv simulated true + } + + # Start of var: ratio_sp + hfactory ${scobj_hpath}/pump/ratio_sp plain user text + hsetprop ${scobj_hpath}/pump/ratio_sp write ${ns}::ratios_write ${scobj_hpath} noResponse { } + hsetprop ${scobj_hpath}/pump/ratio_sp noResponse ${ns}::noResponse ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/ratio_sp check ${ns}::ratios_check ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/ratio_sp control true + hsetprop ${scobj_hpath}/pump/ratio_sp data true + hsetprop ${scobj_hpath}/pump/ratio_sp mutable true + hsetprop ${scobj_hpath}/pump/ratio_sp nxsave true + hsetprop ${scobj_hpath}/pump/ratio_sp oldval UNKNOWN + hsetprop ${scobj_hpath}/pump/ratio_sp klass "parameter" + hsetprop ${scobj_hpath}/pump/ratio_sp sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/pump/ratio_sp type "part" + hsetprop ${scobj_hpath}/pump/ratio_sp units "percent" + hsetprop ${scobj_hpath}/pump/ratio_sp nxalias "${name}_pump_ratio_sp" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} write ${scobj_hpath}/pump/ratio_sp + hsetprop ${scobj_hpath}/pump/ratio_sp simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/pump/ratio_sp simulated true + } + + # Start of var: remote + hfactory ${scobj_hpath}/pump/remote plain user int + hsetprop ${scobj_hpath}/pump/remote read ${ns}::getValue ${scobj_hpath} remote_read {REMOTE?} + hsetprop ${scobj_hpath}/pump/remote remote_read ${ns}::remote_read ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/remote write ${ns}::remote_write ${scobj_hpath} noResponse {} + hsetprop ${scobj_hpath}/pump/remote noResponse ${ns}::noResponse ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/remote check ${ns}::checkrange ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/remote control true + hsetprop ${scobj_hpath}/pump/remote data true + hsetprop ${scobj_hpath}/pump/remote mutable true + hsetprop ${scobj_hpath}/pump/remote nxsave true + hsetprop ${scobj_hpath}/pump/remote oldval 0 + hsetprop ${scobj_hpath}/pump/remote klass "parameter" + hsetprop ${scobj_hpath}/pump/remote sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/pump/remote type "part" + hsetprop ${scobj_hpath}/pump/remote nxalias "${name}_pump_remote" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/pump/remote 1 + ${sct_controller} write ${scobj_hpath}/pump/remote + hsetprop ${scobj_hpath}/pump/remote simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/pump/remote simulated true + } + + # Start of var: state + hfactory ${scobj_hpath}/pump/state plain user text + hsetprop ${scobj_hpath}/pump/state read ${ns}::state_fetch ${scobj_hpath} rdValue { } + hsetprop ${scobj_hpath}/pump/state rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/state control true + hsetprop ${scobj_hpath}/pump/state data true + hsetprop ${scobj_hpath}/pump/state mutable true + hsetprop ${scobj_hpath}/pump/state nxsave true + hsetprop ${scobj_hpath}/pump/state oldval UNKNOWN + hsetprop ${scobj_hpath}/pump/state klass "parameter" + hsetprop ${scobj_hpath}/pump/state sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/pump/state type "part" + hsetprop ${scobj_hpath}/pump/state nxalias "${name}_pump_state" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/pump/state 1 + hsetprop ${scobj_hpath}/pump/state simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/pump/state simulated true + } + + # Start of var: status + hfactory ${scobj_hpath}/pump/status plain user text + hsetprop ${scobj_hpath}/pump/status read ${ns}::status_fetch ${scobj_hpath} rdValue { } + hsetprop ${scobj_hpath}/pump/status rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/status control true + hsetprop ${scobj_hpath}/pump/status data true + hsetprop ${scobj_hpath}/pump/status mutable true + hsetprop ${scobj_hpath}/pump/status nxsave true + hsetprop ${scobj_hpath}/pump/status oldval UNKNOWN + hsetprop ${scobj_hpath}/pump/status klass "parameter" + hsetprop ${scobj_hpath}/pump/status sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/pump/status type "part" + hsetprop ${scobj_hpath}/pump/status nxalias "${name}_pump_status" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/pump/status 1 + hsetprop ${scobj_hpath}/pump/status simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/pump/status simulated true + } + + # Start of var: volume_pv + hfactory ${scobj_hpath}/pump/volume_pv plain user float + hsetprop ${scobj_hpath}/pump/volume_pv read ${ns}::volume_fetch ${scobj_hpath} rdValue { } + hsetprop ${scobj_hpath}/pump/volume_pv rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/volume_pv control true + hsetprop ${scobj_hpath}/pump/volume_pv data true + hsetprop ${scobj_hpath}/pump/volume_pv mutable true + hsetprop ${scobj_hpath}/pump/volume_pv nxsave true + hsetprop ${scobj_hpath}/pump/volume_pv oldval 0.0 + hsetprop ${scobj_hpath}/pump/volume_pv klass "parameter" + hsetprop ${scobj_hpath}/pump/volume_pv sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/pump/volume_pv type "part" + hsetprop ${scobj_hpath}/pump/volume_pv units "mL" + hsetprop ${scobj_hpath}/pump/volume_pv nxalias "${name}_pump_volume_pv" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/pump/volume_pv 1 + hsetprop ${scobj_hpath}/pump/volume_pv simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/pump/volume_pv simulated true + } + + # Start of var: volume_sp + hfactory ${scobj_hpath}/pump/volume_sp plain user float + hsetprop ${scobj_hpath}/pump/volume_sp read ${ns}::volume_checkpumping ${scobj_hpath} rdValue { } + hsetprop ${scobj_hpath}/pump/volume_sp rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/volume_sp write ${ns}::volume_write ${scobj_hpath} noResponse { } + hsetprop ${scobj_hpath}/pump/volume_sp noResponse ${ns}::noResponse ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/volume_sp check ${ns}::checkrange ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/volume_sp driving 0 + hsetprop ${scobj_hpath}/pump/volume_sp checklimits ${ns}::checklimits ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/volume_sp checkstatus ${ns}::volume_checkstatus ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/volume_sp halt ${ns}::volume_halt ${scobj_hpath} + hsetprop ${scobj_hpath}/pump/volume_sp driveable pump/volume_pv + hsetprop ${scobj_hpath}/pump/volume_sp control true + hsetprop ${scobj_hpath}/pump/volume_sp data true + hsetprop ${scobj_hpath}/pump/volume_sp mutable true + hsetprop ${scobj_hpath}/pump/volume_sp nxsave true + hsetprop ${scobj_hpath}/pump/volume_sp lowerlimit 0 + hsetprop ${scobj_hpath}/pump/volume_sp upperlimit 100 + hsetprop ${scobj_hpath}/pump/volume_sp tolerance 0.01 + hsetprop ${scobj_hpath}/pump/volume_sp oldval 0.0 + hsetprop ${scobj_hpath}/pump/volume_sp klass "parameter" + hsetprop ${scobj_hpath}/pump/volume_sp sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/pump/volume_sp type "drivable" + hsetprop ${scobj_hpath}/pump/volume_sp units "mL" + hsetprop ${scobj_hpath}/pump/volume_sp nxalias "${name}_pump_volume_sp" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/pump/volume_sp 1 + ${sct_controller} write ${scobj_hpath}/pump/volume_sp + hsetprop ${scobj_hpath}/pump/volume_sp simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/pump/volume_sp simulated true + } + hsetprop ${scobj_hpath}/pump data "true" + hsetprop ${scobj_hpath}/pump klass "@none" + hsetprop ${scobj_hpath}/pump type "part" + # End of named group: pump + ansto_makesctdrive ${name}_pump_volume_sp ${scobj_hpath}/pump/volume_sp ${scobj_hpath}/pump/volume_pv ${sct_controller} + + # Start of named group: status + hfactory ${scobj_hpath}/status plain spy none + + # Start of var: cur_error + hfactory ${scobj_hpath}/status/cur_error plain user text + hsetprop ${scobj_hpath}/status/cur_error read ${ns}::fetch_from_status ${scobj_hpath} rdValue {2} + hsetprop ${scobj_hpath}/status/cur_error rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/status/cur_error control true + hsetprop ${scobj_hpath}/status/cur_error data true + hsetprop ${scobj_hpath}/status/cur_error mutable true + hsetprop ${scobj_hpath}/status/cur_error nxsave true + hsetprop ${scobj_hpath}/status/cur_error oldval UNKNOWN + hsetprop ${scobj_hpath}/status/cur_error klass "parameter" + hsetprop ${scobj_hpath}/status/cur_error sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/status/cur_error type "part" + hsetprop ${scobj_hpath}/status/cur_error nxalias "${name}_status_cur_error" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/status/cur_error 1 + hsetprop ${scobj_hpath}/status/cur_error simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/status/cur_error simulated true + } + + # Start of var: cur_pres + hfactory ${scobj_hpath}/status/cur_pres plain user text + hsetprop ${scobj_hpath}/status/cur_pres read ${ns}::fetch_from_status ${scobj_hpath} rdValue {17} + hsetprop ${scobj_hpath}/status/cur_pres rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/status/cur_pres control true + hsetprop ${scobj_hpath}/status/cur_pres data true + hsetprop ${scobj_hpath}/status/cur_pres mutable true + hsetprop ${scobj_hpath}/status/cur_pres nxsave true + hsetprop ${scobj_hpath}/status/cur_pres oldval UNKNOWN + hsetprop ${scobj_hpath}/status/cur_pres klass "parameter" + hsetprop ${scobj_hpath}/status/cur_pres sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/status/cur_pres type "part" + hsetprop ${scobj_hpath}/status/cur_pres nxalias "${name}_status_cur_pres" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/status/cur_pres 1 + hsetprop ${scobj_hpath}/status/cur_pres simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/status/cur_pres simulated true + } + + # Start of var: cur_run_time + hfactory ${scobj_hpath}/status/cur_run_time plain user text + hsetprop ${scobj_hpath}/status/cur_run_time read ${ns}::fetch_from_status ${scobj_hpath} rdValue {3} + hsetprop ${scobj_hpath}/status/cur_run_time rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/status/cur_run_time control true + hsetprop ${scobj_hpath}/status/cur_run_time data true + hsetprop ${scobj_hpath}/status/cur_run_time mutable true + hsetprop ${scobj_hpath}/status/cur_run_time nxsave true + hsetprop ${scobj_hpath}/status/cur_run_time oldval UNKNOWN + hsetprop ${scobj_hpath}/status/cur_run_time klass "parameter" + hsetprop ${scobj_hpath}/status/cur_run_time sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/status/cur_run_time type "part" + hsetprop ${scobj_hpath}/status/cur_run_time nxalias "${name}_status_cur_run_time" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/status/cur_run_time 1 + hsetprop ${scobj_hpath}/status/cur_run_time simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/status/cur_run_time simulated true + } + + # Start of var: error_in + hfactory ${scobj_hpath}/status/error_in plain user text + hsetprop ${scobj_hpath}/status/error_in read ${ns}::fetch_from_status ${scobj_hpath} rdValue {19} + hsetprop ${scobj_hpath}/status/error_in rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/status/error_in control true + hsetprop ${scobj_hpath}/status/error_in data true + hsetprop ${scobj_hpath}/status/error_in mutable true + hsetprop ${scobj_hpath}/status/error_in nxsave true + hsetprop ${scobj_hpath}/status/error_in oldval UNKNOWN + hsetprop ${scobj_hpath}/status/error_in klass "parameter" + hsetprop ${scobj_hpath}/status/error_in sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/status/error_in type "part" + hsetprop ${scobj_hpath}/status/error_in nxalias "${name}_status_error_in" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/status/error_in 1 + hsetprop ${scobj_hpath}/status/error_in simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/status/error_in simulated true + } + + # Start of var: evt_0 + hfactory ${scobj_hpath}/status/evt_0 plain user text + hsetprop ${scobj_hpath}/status/evt_0 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {9} + hsetprop ${scobj_hpath}/status/evt_0 rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/status/evt_0 control true + hsetprop ${scobj_hpath}/status/evt_0 data true + hsetprop ${scobj_hpath}/status/evt_0 mutable true + hsetprop ${scobj_hpath}/status/evt_0 nxsave true + hsetprop ${scobj_hpath}/status/evt_0 oldval UNKNOWN + hsetprop ${scobj_hpath}/status/evt_0 klass "parameter" + hsetprop ${scobj_hpath}/status/evt_0 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/status/evt_0 type "part" + hsetprop ${scobj_hpath}/status/evt_0 nxalias "${name}_status_evt_0" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/status/evt_0 1 + hsetprop ${scobj_hpath}/status/evt_0 simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/status/evt_0 simulated true + } + + # Start of var: evt_1 + hfactory ${scobj_hpath}/status/evt_1 plain user text + hsetprop ${scobj_hpath}/status/evt_1 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {10} + hsetprop ${scobj_hpath}/status/evt_1 rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/status/evt_1 control true + hsetprop ${scobj_hpath}/status/evt_1 data true + hsetprop ${scobj_hpath}/status/evt_1 mutable true + hsetprop ${scobj_hpath}/status/evt_1 nxsave true + hsetprop ${scobj_hpath}/status/evt_1 oldval UNKNOWN + hsetprop ${scobj_hpath}/status/evt_1 klass "parameter" + hsetprop ${scobj_hpath}/status/evt_1 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/status/evt_1 type "part" + hsetprop ${scobj_hpath}/status/evt_1 nxalias "${name}_status_evt_1" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/status/evt_1 1 + hsetprop ${scobj_hpath}/status/evt_1 simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/status/evt_1 simulated true + } + + # Start of var: evt_2 + hfactory ${scobj_hpath}/status/evt_2 plain user text + hsetprop ${scobj_hpath}/status/evt_2 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {11} + hsetprop ${scobj_hpath}/status/evt_2 rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/status/evt_2 control true + hsetprop ${scobj_hpath}/status/evt_2 data true + hsetprop ${scobj_hpath}/status/evt_2 mutable true + hsetprop ${scobj_hpath}/status/evt_2 nxsave true + hsetprop ${scobj_hpath}/status/evt_2 oldval UNKNOWN + hsetprop ${scobj_hpath}/status/evt_2 klass "parameter" + hsetprop ${scobj_hpath}/status/evt_2 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/status/evt_2 type "part" + hsetprop ${scobj_hpath}/status/evt_2 nxalias "${name}_status_evt_2" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/status/evt_2 1 + hsetprop ${scobj_hpath}/status/evt_2 simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/status/evt_2 simulated true + } + + # Start of var: evt_3 + hfactory ${scobj_hpath}/status/evt_3 plain user text + hsetprop ${scobj_hpath}/status/evt_3 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {12} + hsetprop ${scobj_hpath}/status/evt_3 rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/status/evt_3 control true + hsetprop ${scobj_hpath}/status/evt_3 data true + hsetprop ${scobj_hpath}/status/evt_3 mutable true + hsetprop ${scobj_hpath}/status/evt_3 nxsave true + hsetprop ${scobj_hpath}/status/evt_3 oldval UNKNOWN + hsetprop ${scobj_hpath}/status/evt_3 klass "parameter" + hsetprop ${scobj_hpath}/status/evt_3 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/status/evt_3 type "part" + hsetprop ${scobj_hpath}/status/evt_3 nxalias "${name}_status_evt_3" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/status/evt_3 1 + hsetprop ${scobj_hpath}/status/evt_3 simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/status/evt_3 simulated true + } + + # Start of var: evt_4 + hfactory ${scobj_hpath}/status/evt_4 plain user text + hsetprop ${scobj_hpath}/status/evt_4 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {13} + hsetprop ${scobj_hpath}/status/evt_4 rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/status/evt_4 control true + hsetprop ${scobj_hpath}/status/evt_4 data true + hsetprop ${scobj_hpath}/status/evt_4 mutable true + hsetprop ${scobj_hpath}/status/evt_4 nxsave true + hsetprop ${scobj_hpath}/status/evt_4 oldval UNKNOWN + hsetprop ${scobj_hpath}/status/evt_4 klass "parameter" + hsetprop ${scobj_hpath}/status/evt_4 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/status/evt_4 type "part" + hsetprop ${scobj_hpath}/status/evt_4 nxalias "${name}_status_evt_4" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/status/evt_4 1 + hsetprop ${scobj_hpath}/status/evt_4 simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/status/evt_4 simulated true + } + + # Start of var: evt_5 + hfactory ${scobj_hpath}/status/evt_5 plain user text + hsetprop ${scobj_hpath}/status/evt_5 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {14} + hsetprop ${scobj_hpath}/status/evt_5 rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/status/evt_5 control true + hsetprop ${scobj_hpath}/status/evt_5 data true + hsetprop ${scobj_hpath}/status/evt_5 mutable true + hsetprop ${scobj_hpath}/status/evt_5 nxsave true + hsetprop ${scobj_hpath}/status/evt_5 oldval UNKNOWN + hsetprop ${scobj_hpath}/status/evt_5 klass "parameter" + hsetprop ${scobj_hpath}/status/evt_5 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/status/evt_5 type "part" + hsetprop ${scobj_hpath}/status/evt_5 nxalias "${name}_status_evt_5" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/status/evt_5 1 + hsetprop ${scobj_hpath}/status/evt_5 simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/status/evt_5 simulated true + } + + # Start of var: evt_6 + hfactory ${scobj_hpath}/status/evt_6 plain user text + hsetprop ${scobj_hpath}/status/evt_6 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {15} + hsetprop ${scobj_hpath}/status/evt_6 rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/status/evt_6 control true + hsetprop ${scobj_hpath}/status/evt_6 data true + hsetprop ${scobj_hpath}/status/evt_6 mutable true + hsetprop ${scobj_hpath}/status/evt_6 nxsave true + hsetprop ${scobj_hpath}/status/evt_6 oldval UNKNOWN + hsetprop ${scobj_hpath}/status/evt_6 klass "parameter" + hsetprop ${scobj_hpath}/status/evt_6 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/status/evt_6 type "part" + hsetprop ${scobj_hpath}/status/evt_6 nxalias "${name}_status_evt_6" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/status/evt_6 1 + hsetprop ${scobj_hpath}/status/evt_6 simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/status/evt_6 simulated true + } + + # Start of var: evt_7 + hfactory ${scobj_hpath}/status/evt_7 plain user text + hsetprop ${scobj_hpath}/status/evt_7 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {16} + hsetprop ${scobj_hpath}/status/evt_7 rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/status/evt_7 control true + hsetprop ${scobj_hpath}/status/evt_7 data true + hsetprop ${scobj_hpath}/status/evt_7 mutable true + hsetprop ${scobj_hpath}/status/evt_7 nxsave true + hsetprop ${scobj_hpath}/status/evt_7 oldval UNKNOWN + hsetprop ${scobj_hpath}/status/evt_7 klass "parameter" + hsetprop ${scobj_hpath}/status/evt_7 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/status/evt_7 type "part" + hsetprop ${scobj_hpath}/status/evt_7 nxalias "${name}_status_evt_7" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/status/evt_7 1 + hsetprop ${scobj_hpath}/status/evt_7 simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/status/evt_7 simulated true + } + + # Start of var: flow_rate + hfactory ${scobj_hpath}/status/flow_rate plain user text + hsetprop ${scobj_hpath}/status/flow_rate read ${ns}::fetch_from_status ${scobj_hpath} rdValue {4} + hsetprop ${scobj_hpath}/status/flow_rate rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/status/flow_rate control true + hsetprop ${scobj_hpath}/status/flow_rate data true + hsetprop ${scobj_hpath}/status/flow_rate mutable true + hsetprop ${scobj_hpath}/status/flow_rate nxsave true + hsetprop ${scobj_hpath}/status/flow_rate oldval UNKNOWN + hsetprop ${scobj_hpath}/status/flow_rate klass "parameter" + hsetprop ${scobj_hpath}/status/flow_rate sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/status/flow_rate type "part" + hsetprop ${scobj_hpath}/status/flow_rate nxalias "${name}_status_flow_rate" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/status/flow_rate 1 + hsetprop ${scobj_hpath}/status/flow_rate simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/status/flow_rate simulated true + } + + # Start of var: lpg_0 + hfactory ${scobj_hpath}/status/lpg_0 plain user text + hsetprop ${scobj_hpath}/status/lpg_0 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {5} + hsetprop ${scobj_hpath}/status/lpg_0 rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/status/lpg_0 control true + hsetprop ${scobj_hpath}/status/lpg_0 data true + hsetprop ${scobj_hpath}/status/lpg_0 mutable true + hsetprop ${scobj_hpath}/status/lpg_0 nxsave true + hsetprop ${scobj_hpath}/status/lpg_0 oldval UNKNOWN + hsetprop ${scobj_hpath}/status/lpg_0 klass "parameter" + hsetprop ${scobj_hpath}/status/lpg_0 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/status/lpg_0 type "part" + hsetprop ${scobj_hpath}/status/lpg_0 nxalias "${name}_status_lpg_0" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/status/lpg_0 1 + hsetprop ${scobj_hpath}/status/lpg_0 simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/status/lpg_0 simulated true + } + + # Start of var: lpg_1 + hfactory ${scobj_hpath}/status/lpg_1 plain user text + hsetprop ${scobj_hpath}/status/lpg_1 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {6} + hsetprop ${scobj_hpath}/status/lpg_1 rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/status/lpg_1 control true + hsetprop ${scobj_hpath}/status/lpg_1 data true + hsetprop ${scobj_hpath}/status/lpg_1 mutable true + hsetprop ${scobj_hpath}/status/lpg_1 nxsave true + hsetprop ${scobj_hpath}/status/lpg_1 oldval UNKNOWN + hsetprop ${scobj_hpath}/status/lpg_1 klass "parameter" + hsetprop ${scobj_hpath}/status/lpg_1 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/status/lpg_1 type "part" + hsetprop ${scobj_hpath}/status/lpg_1 nxalias "${name}_status_lpg_1" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/status/lpg_1 1 + hsetprop ${scobj_hpath}/status/lpg_1 simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/status/lpg_1 simulated true + } + + # Start of var: lpg_2 + hfactory ${scobj_hpath}/status/lpg_2 plain user text + hsetprop ${scobj_hpath}/status/lpg_2 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {7} + hsetprop ${scobj_hpath}/status/lpg_2 rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/status/lpg_2 control true + hsetprop ${scobj_hpath}/status/lpg_2 data true + hsetprop ${scobj_hpath}/status/lpg_2 mutable true + hsetprop ${scobj_hpath}/status/lpg_2 nxsave true + hsetprop ${scobj_hpath}/status/lpg_2 oldval UNKNOWN + hsetprop ${scobj_hpath}/status/lpg_2 klass "parameter" + hsetprop ${scobj_hpath}/status/lpg_2 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/status/lpg_2 type "part" + hsetprop ${scobj_hpath}/status/lpg_2 nxalias "${name}_status_lpg_2" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/status/lpg_2 1 + hsetprop ${scobj_hpath}/status/lpg_2 simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/status/lpg_2 simulated true + } + + # Start of var: lpg_3 + hfactory ${scobj_hpath}/status/lpg_3 plain user text + hsetprop ${scobj_hpath}/status/lpg_3 read ${ns}::fetch_from_status ${scobj_hpath} rdValue {8} + hsetprop ${scobj_hpath}/status/lpg_3 rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/status/lpg_3 control true + hsetprop ${scobj_hpath}/status/lpg_3 data true + hsetprop ${scobj_hpath}/status/lpg_3 mutable true + hsetprop ${scobj_hpath}/status/lpg_3 nxsave true + hsetprop ${scobj_hpath}/status/lpg_3 oldval UNKNOWN + hsetprop ${scobj_hpath}/status/lpg_3 klass "parameter" + hsetprop ${scobj_hpath}/status/lpg_3 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/status/lpg_3 type "part" + hsetprop ${scobj_hpath}/status/lpg_3 nxalias "${name}_status_lpg_3" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/status/lpg_3 1 + hsetprop ${scobj_hpath}/status/lpg_3 simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/status/lpg_3 simulated true + } + + # Start of var: start_in + hfactory ${scobj_hpath}/status/start_in plain user text + hsetprop ${scobj_hpath}/status/start_in read ${ns}::fetch_from_status ${scobj_hpath} rdValue {18} + hsetprop ${scobj_hpath}/status/start_in rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/status/start_in control true + hsetprop ${scobj_hpath}/status/start_in data true + hsetprop ${scobj_hpath}/status/start_in mutable true + hsetprop ${scobj_hpath}/status/start_in nxsave true + hsetprop ${scobj_hpath}/status/start_in oldval UNKNOWN + hsetprop ${scobj_hpath}/status/start_in klass "parameter" + hsetprop ${scobj_hpath}/status/start_in sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/status/start_in type "part" + hsetprop ${scobj_hpath}/status/start_in nxalias "${name}_status_start_in" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/status/start_in 1 + hsetprop ${scobj_hpath}/status/start_in simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/status/start_in simulated true + } + + # Start of var: state + hfactory ${scobj_hpath}/status/state plain user text + hsetprop ${scobj_hpath}/status/state read ${ns}::fetch_from_status ${scobj_hpath} rdValue {1} + hsetprop ${scobj_hpath}/status/state rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/status/state control true + hsetprop ${scobj_hpath}/status/state data true + hsetprop ${scobj_hpath}/status/state mutable true + hsetprop ${scobj_hpath}/status/state nxsave true + hsetprop ${scobj_hpath}/status/state oldval UNKNOWN + hsetprop ${scobj_hpath}/status/state klass "parameter" + hsetprop ${scobj_hpath}/status/state sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/status/state type "part" + hsetprop ${scobj_hpath}/status/state nxalias "${name}_status_state" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/status/state 1 + hsetprop ${scobj_hpath}/status/state simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/status/state simulated true + } + hsetprop ${scobj_hpath}/status data "true" + hsetprop ${scobj_hpath}/status klass "@none" + hsetprop ${scobj_hpath}/status type "part" + # End of named group: status + + # Start of named group: stuff + hfactory ${scobj_hpath}/stuff plain spy none + + # Start of var: an_out + hfactory ${scobj_hpath}/stuff/an_out plain user text + hsetprop ${scobj_hpath}/stuff/an_out read ${ns}::getValue ${scobj_hpath} rdValue {AN_OUT?} + hsetprop ${scobj_hpath}/stuff/an_out rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/stuff/an_out control false + hsetprop ${scobj_hpath}/stuff/an_out data false + hsetprop ${scobj_hpath}/stuff/an_out mutable true + hsetprop ${scobj_hpath}/stuff/an_out nxsave false + hsetprop ${scobj_hpath}/stuff/an_out oldval UNKNOWN + hsetprop ${scobj_hpath}/stuff/an_out sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/stuff/an_out type "part" + hsetprop ${scobj_hpath}/stuff/an_out nxalias "${name}_stuff_an_out" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/stuff/an_out 60 + hsetprop ${scobj_hpath}/stuff/an_out simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/stuff/an_out simulated true + } + + # Start of var: boardinfo + hfactory ${scobj_hpath}/stuff/boardinfo plain user text + hsetprop ${scobj_hpath}/stuff/boardinfo read ${ns}::getValue ${scobj_hpath} rdValue {BOARDINFO?} + hsetprop ${scobj_hpath}/stuff/boardinfo rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/stuff/boardinfo control false + hsetprop ${scobj_hpath}/stuff/boardinfo data false + hsetprop ${scobj_hpath}/stuff/boardinfo mutable true + hsetprop ${scobj_hpath}/stuff/boardinfo nxsave false + hsetprop ${scobj_hpath}/stuff/boardinfo oldval UNKNOWN + hsetprop ${scobj_hpath}/stuff/boardinfo sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/stuff/boardinfo type "part" + hsetprop ${scobj_hpath}/stuff/boardinfo nxalias "${name}_stuff_boardinfo" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/stuff/boardinfo 60 + hsetprop ${scobj_hpath}/stuff/boardinfo simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/stuff/boardinfo simulated true + } + + # Start of var: config + hfactory ${scobj_hpath}/stuff/config plain user text + hsetprop ${scobj_hpath}/stuff/config read ${ns}::getValue ${scobj_hpath} rdValue {CONFIG?} + hsetprop ${scobj_hpath}/stuff/config rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/stuff/config control false + hsetprop ${scobj_hpath}/stuff/config data false + hsetprop ${scobj_hpath}/stuff/config mutable true + hsetprop ${scobj_hpath}/stuff/config nxsave false + hsetprop ${scobj_hpath}/stuff/config oldval UNKNOWN + hsetprop ${scobj_hpath}/stuff/config sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/stuff/config type "part" + hsetprop ${scobj_hpath}/stuff/config nxalias "${name}_stuff_config" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/stuff/config 60 + hsetprop ${scobj_hpath}/stuff/config simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/stuff/config simulated true + } + + # Start of var: cprofinfo + hfactory ${scobj_hpath}/stuff/cprofinfo plain user text + hsetprop ${scobj_hpath}/stuff/cprofinfo read ${ns}::getValue ${scobj_hpath} rdValue {CPROFINFO?} + hsetprop ${scobj_hpath}/stuff/cprofinfo rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/stuff/cprofinfo control false + hsetprop ${scobj_hpath}/stuff/cprofinfo data false + hsetprop ${scobj_hpath}/stuff/cprofinfo mutable true + hsetprop ${scobj_hpath}/stuff/cprofinfo nxsave false + hsetprop ${scobj_hpath}/stuff/cprofinfo oldval UNKNOWN + hsetprop ${scobj_hpath}/stuff/cprofinfo sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/stuff/cprofinfo type "part" + hsetprop ${scobj_hpath}/stuff/cprofinfo nxalias "${name}_stuff_cprofinfo" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/stuff/cprofinfo 60 + hsetprop ${scobj_hpath}/stuff/cprofinfo simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/stuff/cprofinfo simulated true + } + + # Start of var: dout + hfactory ${scobj_hpath}/stuff/dout plain user text + hsetprop ${scobj_hpath}/stuff/dout read ${ns}::getValue ${scobj_hpath} rdValue {DOUT?} + hsetprop ${scobj_hpath}/stuff/dout rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/stuff/dout control false + hsetprop ${scobj_hpath}/stuff/dout data false + hsetprop ${scobj_hpath}/stuff/dout mutable true + hsetprop ${scobj_hpath}/stuff/dout nxsave false + hsetprop ${scobj_hpath}/stuff/dout oldval UNKNOWN + hsetprop ${scobj_hpath}/stuff/dout sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/stuff/dout type "part" + hsetprop ${scobj_hpath}/stuff/dout nxalias "${name}_stuff_dout" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/stuff/dout 60 + hsetprop ${scobj_hpath}/stuff/dout simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/stuff/dout simulated true + } + + # Start of var: error + hfactory ${scobj_hpath}/stuff/error plain user text + hsetprop ${scobj_hpath}/stuff/error read ${ns}::getValue ${scobj_hpath} rdValue {ERROR?} + hsetprop ${scobj_hpath}/stuff/error rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/stuff/error control false + hsetprop ${scobj_hpath}/stuff/error data false + hsetprop ${scobj_hpath}/stuff/error mutable true + hsetprop ${scobj_hpath}/stuff/error nxsave false + hsetprop ${scobj_hpath}/stuff/error oldval UNKNOWN + hsetprop ${scobj_hpath}/stuff/error sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/stuff/error type "part" + hsetprop ${scobj_hpath}/stuff/error nxalias "${name}_stuff_error" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/stuff/error 60 + hsetprop ${scobj_hpath}/stuff/error simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/stuff/error simulated true + } + + # Start of var: errors + hfactory ${scobj_hpath}/stuff/errors plain user text + hsetprop ${scobj_hpath}/stuff/errors read ${ns}::getValue ${scobj_hpath} rdValue {ERRORS?} + hsetprop ${scobj_hpath}/stuff/errors rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/stuff/errors control false + hsetprop ${scobj_hpath}/stuff/errors data false + hsetprop ${scobj_hpath}/stuff/errors mutable true + hsetprop ${scobj_hpath}/stuff/errors nxsave false + hsetprop ${scobj_hpath}/stuff/errors oldval UNKNOWN + hsetprop ${scobj_hpath}/stuff/errors sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/stuff/errors type "part" + hsetprop ${scobj_hpath}/stuff/errors nxalias "${name}_stuff_errors" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/stuff/errors 60 + hsetprop ${scobj_hpath}/stuff/errors simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/stuff/errors simulated true + } + + # Start of var: flushpmp + hfactory ${scobj_hpath}/stuff/flushpmp plain user text + hsetprop ${scobj_hpath}/stuff/flushpmp read ${ns}::getValue ${scobj_hpath} rdValue {FLUSHPMP?} + hsetprop ${scobj_hpath}/stuff/flushpmp rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/stuff/flushpmp control false + hsetprop ${scobj_hpath}/stuff/flushpmp data false + hsetprop ${scobj_hpath}/stuff/flushpmp mutable true + hsetprop ${scobj_hpath}/stuff/flushpmp nxsave false + hsetprop ${scobj_hpath}/stuff/flushpmp oldval UNKNOWN + hsetprop ${scobj_hpath}/stuff/flushpmp sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/stuff/flushpmp type "part" + hsetprop ${scobj_hpath}/stuff/flushpmp nxalias "${name}_stuff_flushpmp" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/stuff/flushpmp 60 + hsetprop ${scobj_hpath}/stuff/flushpmp simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/stuff/flushpmp simulated true + } + + # Start of var: head + hfactory ${scobj_hpath}/stuff/head plain user text + hsetprop ${scobj_hpath}/stuff/head read ${ns}::getValue ${scobj_hpath} rdValue {HEAD?} + hsetprop ${scobj_hpath}/stuff/head rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/stuff/head control false + hsetprop ${scobj_hpath}/stuff/head data false + hsetprop ${scobj_hpath}/stuff/head mutable true + hsetprop ${scobj_hpath}/stuff/head nxsave false + hsetprop ${scobj_hpath}/stuff/head oldval UNKNOWN + hsetprop ${scobj_hpath}/stuff/head sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/stuff/head type "part" + hsetprop ${scobj_hpath}/stuff/head nxalias "${name}_stuff_head" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/stuff/head 60 + hsetprop ${scobj_hpath}/stuff/head simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/stuff/head simulated true + } + + # Start of var: head_par + hfactory ${scobj_hpath}/stuff/head_par plain user text + hsetprop ${scobj_hpath}/stuff/head_par read ${ns}::getValue ${scobj_hpath} rdValue {HEAD_PAR?} + hsetprop ${scobj_hpath}/stuff/head_par rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/stuff/head_par control false + hsetprop ${scobj_hpath}/stuff/head_par data false + hsetprop ${scobj_hpath}/stuff/head_par mutable true + hsetprop ${scobj_hpath}/stuff/head_par nxsave false + hsetprop ${scobj_hpath}/stuff/head_par oldval UNKNOWN + hsetprop ${scobj_hpath}/stuff/head_par sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/stuff/head_par type "part" + hsetprop ${scobj_hpath}/stuff/head_par nxalias "${name}_stuff_head_par" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/stuff/head_par 60 + hsetprop ${scobj_hpath}/stuff/head_par simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/stuff/head_par simulated true + } + + # Start of var: identify + hfactory ${scobj_hpath}/stuff/identify plain user text + hsetprop ${scobj_hpath}/stuff/identify read ${ns}::getValue ${scobj_hpath} rdValue {IDENTIFY?} + hsetprop ${scobj_hpath}/stuff/identify rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/stuff/identify control false + hsetprop ${scobj_hpath}/stuff/identify data false + hsetprop ${scobj_hpath}/stuff/identify mutable true + hsetprop ${scobj_hpath}/stuff/identify nxsave false + hsetprop ${scobj_hpath}/stuff/identify oldval UNKNOWN + hsetprop ${scobj_hpath}/stuff/identify sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/stuff/identify type "part" + hsetprop ${scobj_hpath}/stuff/identify nxalias "${name}_stuff_identify" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/stuff/identify 60 + hsetprop ${scobj_hpath}/stuff/identify simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/stuff/identify simulated true + } + + # Start of var: lpg + hfactory ${scobj_hpath}/stuff/lpg plain user text + hsetprop ${scobj_hpath}/stuff/lpg read ${ns}::getValue ${scobj_hpath} rdValue {LPG?} + hsetprop ${scobj_hpath}/stuff/lpg rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/stuff/lpg control false + hsetprop ${scobj_hpath}/stuff/lpg data false + hsetprop ${scobj_hpath}/stuff/lpg mutable true + hsetprop ${scobj_hpath}/stuff/lpg nxsave false + hsetprop ${scobj_hpath}/stuff/lpg oldval UNKNOWN + hsetprop ${scobj_hpath}/stuff/lpg sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/stuff/lpg type "part" + hsetprop ${scobj_hpath}/stuff/lpg nxalias "${name}_stuff_lpg" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/stuff/lpg 60 + hsetprop ${scobj_hpath}/stuff/lpg simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/stuff/lpg simulated true + } + + # Start of var: oem + hfactory ${scobj_hpath}/stuff/oem plain user text + hsetprop ${scobj_hpath}/stuff/oem read ${ns}::getValue ${scobj_hpath} rdValue {OEM?} + hsetprop ${scobj_hpath}/stuff/oem rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/stuff/oem control false + hsetprop ${scobj_hpath}/stuff/oem data false + hsetprop ${scobj_hpath}/stuff/oem mutable true + hsetprop ${scobj_hpath}/stuff/oem nxsave false + hsetprop ${scobj_hpath}/stuff/oem oldval UNKNOWN + hsetprop ${scobj_hpath}/stuff/oem sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/stuff/oem type "part" + hsetprop ${scobj_hpath}/stuff/oem nxalias "${name}_stuff_oem" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/stuff/oem 60 + hsetprop ${scobj_hpath}/stuff/oem simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/stuff/oem simulated true + } + + # Start of var: opt + hfactory ${scobj_hpath}/stuff/opt plain user text + hsetprop ${scobj_hpath}/stuff/opt read ${ns}::getValue ${scobj_hpath} rdValue {OPT?} + hsetprop ${scobj_hpath}/stuff/opt rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/stuff/opt control false + hsetprop ${scobj_hpath}/stuff/opt data false + hsetprop ${scobj_hpath}/stuff/opt mutable true + hsetprop ${scobj_hpath}/stuff/opt nxsave false + hsetprop ${scobj_hpath}/stuff/opt oldval UNKNOWN + hsetprop ${scobj_hpath}/stuff/opt sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/stuff/opt type "part" + hsetprop ${scobj_hpath}/stuff/opt nxalias "${name}_stuff_opt" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/stuff/opt 60 + hsetprop ${scobj_hpath}/stuff/opt simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/stuff/opt simulated true + } + + # Start of var: plim + hfactory ${scobj_hpath}/stuff/plim plain user text + hsetprop ${scobj_hpath}/stuff/plim read ${ns}::getValue ${scobj_hpath} rdValue {PLIM?} + hsetprop ${scobj_hpath}/stuff/plim rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/stuff/plim control false + hsetprop ${scobj_hpath}/stuff/plim data false + hsetprop ${scobj_hpath}/stuff/plim mutable true + hsetprop ${scobj_hpath}/stuff/plim nxsave false + hsetprop ${scobj_hpath}/stuff/plim oldval UNKNOWN + hsetprop ${scobj_hpath}/stuff/plim sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/stuff/plim type "part" + hsetprop ${scobj_hpath}/stuff/plim nxalias "${name}_stuff_plim" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/stuff/plim 60 + hsetprop ${scobj_hpath}/stuff/plim simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/stuff/plim simulated true + } + + # Start of var: pressure + hfactory ${scobj_hpath}/stuff/pressure plain user text + hsetprop ${scobj_hpath}/stuff/pressure read ${ns}::getValue ${scobj_hpath} rdValue {PRESSURE?} + hsetprop ${scobj_hpath}/stuff/pressure rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/stuff/pressure control false + hsetprop ${scobj_hpath}/stuff/pressure data false + hsetprop ${scobj_hpath}/stuff/pressure mutable true + hsetprop ${scobj_hpath}/stuff/pressure nxsave false + hsetprop ${scobj_hpath}/stuff/pressure oldval UNKNOWN + hsetprop ${scobj_hpath}/stuff/pressure sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/stuff/pressure type "part" + hsetprop ${scobj_hpath}/stuff/pressure nxalias "${name}_stuff_pressure" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/stuff/pressure 60 + hsetprop ${scobj_hpath}/stuff/pressure simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/stuff/pressure simulated true + } + + # Start of var: prfastacq + hfactory ${scobj_hpath}/stuff/prfastacq plain user text + hsetprop ${scobj_hpath}/stuff/prfastacq read ${ns}::getValue ${scobj_hpath} rdValue {PRFASTACQ?} + hsetprop ${scobj_hpath}/stuff/prfastacq rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/stuff/prfastacq control false + hsetprop ${scobj_hpath}/stuff/prfastacq data false + hsetprop ${scobj_hpath}/stuff/prfastacq mutable true + hsetprop ${scobj_hpath}/stuff/prfastacq nxsave false + hsetprop ${scobj_hpath}/stuff/prfastacq oldval UNKNOWN + hsetprop ${scobj_hpath}/stuff/prfastacq sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/stuff/prfastacq type "part" + hsetprop ${scobj_hpath}/stuff/prfastacq nxalias "${name}_stuff_prfastacq" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/stuff/prfastacq 60 + hsetprop ${scobj_hpath}/stuff/prfastacq simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/stuff/prfastacq simulated true + } + + # Start of var: purge + hfactory ${scobj_hpath}/stuff/purge plain user text + hsetprop ${scobj_hpath}/stuff/purge read ${ns}::getValue ${scobj_hpath} rdValue {PURGE?} + hsetprop ${scobj_hpath}/stuff/purge rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/stuff/purge control false + hsetprop ${scobj_hpath}/stuff/purge data false + hsetprop ${scobj_hpath}/stuff/purge mutable true + hsetprop ${scobj_hpath}/stuff/purge nxsave false + hsetprop ${scobj_hpath}/stuff/purge oldval UNKNOWN + hsetprop ${scobj_hpath}/stuff/purge sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/stuff/purge type "part" + hsetprop ${scobj_hpath}/stuff/purge nxalias "${name}_stuff_purge" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/stuff/purge 60 + hsetprop ${scobj_hpath}/stuff/purge simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/stuff/purge simulated true + } + + # Start of var: remote + hfactory ${scobj_hpath}/stuff/remote plain user text + hsetprop ${scobj_hpath}/stuff/remote read ${ns}::getValue ${scobj_hpath} rdValue {REMOTE?} + hsetprop ${scobj_hpath}/stuff/remote rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/stuff/remote control false + hsetprop ${scobj_hpath}/stuff/remote data false + hsetprop ${scobj_hpath}/stuff/remote mutable true + hsetprop ${scobj_hpath}/stuff/remote nxsave false + hsetprop ${scobj_hpath}/stuff/remote oldval UNKNOWN + hsetprop ${scobj_hpath}/stuff/remote sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/stuff/remote type "part" + hsetprop ${scobj_hpath}/stuff/remote nxalias "${name}_stuff_remote" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/stuff/remote 60 + hsetprop ${scobj_hpath}/stuff/remote simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/stuff/remote simulated true + } + + # Start of var: rfid + hfactory ${scobj_hpath}/stuff/rfid plain user text + hsetprop ${scobj_hpath}/stuff/rfid read ${ns}::getValue ${scobj_hpath} rdValue {RFID?} + hsetprop ${scobj_hpath}/stuff/rfid rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/stuff/rfid control false + hsetprop ${scobj_hpath}/stuff/rfid data false + hsetprop ${scobj_hpath}/stuff/rfid mutable true + hsetprop ${scobj_hpath}/stuff/rfid nxsave false + hsetprop ${scobj_hpath}/stuff/rfid oldval UNKNOWN + hsetprop ${scobj_hpath}/stuff/rfid sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/stuff/rfid type "part" + hsetprop ${scobj_hpath}/stuff/rfid nxalias "${name}_stuff_rfid" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/stuff/rfid 60 + hsetprop ${scobj_hpath}/stuff/rfid simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/stuff/rfid simulated true + } + + # Start of var: service + hfactory ${scobj_hpath}/stuff/service plain user text + hsetprop ${scobj_hpath}/stuff/service read ${ns}::getValue ${scobj_hpath} rdValue {SERVICE?} + hsetprop ${scobj_hpath}/stuff/service rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/stuff/service control false + hsetprop ${scobj_hpath}/stuff/service data false + hsetprop ${scobj_hpath}/stuff/service mutable true + hsetprop ${scobj_hpath}/stuff/service nxsave false + hsetprop ${scobj_hpath}/stuff/service oldval UNKNOWN + hsetprop ${scobj_hpath}/stuff/service sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/stuff/service type "part" + hsetprop ${scobj_hpath}/stuff/service nxalias "${name}_stuff_service" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/stuff/service 60 + hsetprop ${scobj_hpath}/stuff/service simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/stuff/service simulated true + } + + # Start of var: sysinfo + hfactory ${scobj_hpath}/stuff/sysinfo plain user text + hsetprop ${scobj_hpath}/stuff/sysinfo read ${ns}::getValue ${scobj_hpath} rdValue {SYSINFO?} + hsetprop ${scobj_hpath}/stuff/sysinfo rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/stuff/sysinfo control false + hsetprop ${scobj_hpath}/stuff/sysinfo data false + hsetprop ${scobj_hpath}/stuff/sysinfo mutable true + hsetprop ${scobj_hpath}/stuff/sysinfo nxsave false + hsetprop ${scobj_hpath}/stuff/sysinfo oldval UNKNOWN + hsetprop ${scobj_hpath}/stuff/sysinfo sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/stuff/sysinfo type "part" + hsetprop ${scobj_hpath}/stuff/sysinfo nxalias "${name}_stuff_sysinfo" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/stuff/sysinfo 60 + hsetprop ${scobj_hpath}/stuff/sysinfo simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/stuff/sysinfo simulated true + } + + # Start of var: units + hfactory ${scobj_hpath}/stuff/units plain user text + hsetprop ${scobj_hpath}/stuff/units read ${ns}::getValue ${scobj_hpath} rdValue {UNITS?} + hsetprop ${scobj_hpath}/stuff/units rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/stuff/units control false + hsetprop ${scobj_hpath}/stuff/units data false + hsetprop ${scobj_hpath}/stuff/units mutable true + hsetprop ${scobj_hpath}/stuff/units nxsave false + hsetprop ${scobj_hpath}/stuff/units oldval UNKNOWN + hsetprop ${scobj_hpath}/stuff/units sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/stuff/units type "part" + hsetprop ${scobj_hpath}/stuff/units nxalias "${name}_stuff_units" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/stuff/units 60 + hsetprop ${scobj_hpath}/stuff/units simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/stuff/units simulated true + } + + # Start of var: valves + hfactory ${scobj_hpath}/stuff/valves plain user text + hsetprop ${scobj_hpath}/stuff/valves read ${ns}::getValue ${scobj_hpath} rdValue {VALVES?} + hsetprop ${scobj_hpath}/stuff/valves rdValue ${ns}::rdValue ${scobj_hpath} + hsetprop ${scobj_hpath}/stuff/valves control false + hsetprop ${scobj_hpath}/stuff/valves data false + hsetprop ${scobj_hpath}/stuff/valves mutable true + hsetprop ${scobj_hpath}/stuff/valves nxsave false + hsetprop ${scobj_hpath}/stuff/valves oldval UNKNOWN + hsetprop ${scobj_hpath}/stuff/valves sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/stuff/valves type "part" + hsetprop ${scobj_hpath}/stuff/valves nxalias "${name}_stuff_valves" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/stuff/valves 60 + hsetprop ${scobj_hpath}/stuff/valves simulated false + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for knauer_pump" + hsetprop ${scobj_hpath}/stuff/valves simulated true + } + hsetprop ${scobj_hpath}/stuff data "false" + hsetprop ${scobj_hpath}/stuff klass "@none" + hsetprop ${scobj_hpath}/stuff type "part" + # End of named group: stuff + hsetprop ${scobj_hpath} klass ${device_class} + hsetprop ${scobj_hpath} data true + hsetprop ${scobj_hpath} debug_threshold 0 +# mkDriver hook code goes here + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +proc ::scobj::knauer_pump::add_driver {name device_class simulation_flag ip_address tcp_port} { + set catch_status [ catch { + ::scobj::knauer_pump::sics_log 9 "::scobj::knauer_pump::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}" + if {[string equal -nocase "${simulation_flag}" "false"]} { + if {[string equal -nocase "aqadapter" "${ip_address}"]} { + ::scobj::knauer_pump::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}" + makesctcontroller sct_${name} aqadapter ${tcp_port} + } else { + ::scobj::knauer_pump::sics_log 9 "makesctcontroller sct_${name} knauer_ap ${ip_address}:${tcp_port}" + makesctcontroller sct_${name} knauer_ap ${ip_address}:${tcp_port} + } + } else { + ::scobj::knauer_pump::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for knauer_pump" + ::scobj::knauer_pump::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL" + makesctcontroller sct_${name} aqadapter NULL + } + ::scobj::knauer_pump::sics_log 1 "::scobj::knauer_pump::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}" + ::scobj::knauer_pump::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +namespace eval ::scobj::knauer_pump { + namespace export debug_threshold + namespace export debug_log + namespace export sics_log + namespace export mkDriver + namespace export add_driver +} + +proc add_knauer_pump {name ip_address tcp_port} { + set simulation_flag "[string tolower [SplitReply [environment_simulation]]]" + ::scobj::knauer_pump::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} +} + +clientput "file evaluation of sct_knauer_pump.tcl" +::scobj::knauer_pump::sics_log 9 "file evaluation of sct_knauer_pump.tcl" + +proc ::scobj::knauer_pump::read_config {} { + set catch_status [ catch { + set ns "::scobj::knauer_pump" + 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"] "knauer_pump"] } { + 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} knauer_ap ${ip_address}:${tcp_port} + } else { + makesctcontroller sct_${name} aqadapter ${asyncqueue} + } + } else { + if { [dict exists $v "asyncprotocol"] } { + set asyncprotocol [dict get $v "asyncprotocol"] + } else { + set asyncprotocol ${name}_protocol + MakeAsyncProtocol ${asyncprotocol} + if { [dict exists $v "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} + } + ${ns}::mkDriver sct_${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} + } + } + } + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +if { [info exists ::config_dict] } { + ::scobj::knauer_pump::read_config +} else { + ::scobj::knauer_pump::sics_log 5 "No config dict" +} diff --git a/site_ansto/instrument/config/environment/temperature/srs_sr630_sct.tcl b/site_ansto/instrument/config/environment/temperature/srs_sr630_sct.tcl new file mode 100644 index 00000000..63b1cd34 --- /dev/null +++ b/site_ansto/instrument/config/environment/temperature/srs_sr630_sct.tcl @@ -0,0 +1,538 @@ +# Generated driver for srs_sr630 +# vim: ft=tcl tabstop=8 softtabstop=2 shiftwidth=2 nocindent smartindent +# + +namespace eval ::scobj::srs_sr630 { + set debug_threshold 5 +} + +proc ::scobj::srs_sr630::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 fd [open "../log/srs_sr630_[basename ${tc_root}].log" "a"] + set line "[clock format [clock seconds] -format "%T"] ${debug_string}" + puts ${fd} "${line}" + close ${fd} + } + } catch_message ] +} + +proc ::scobj::srs_sr630::sics_log {debug_level debug_string} { + set catch_status [ catch { + set debug_threshold ${::scobj::srs_sr630::debug_threshold} + if {${debug_level} >= ${debug_threshold}} { + sicslog "::scobj::srs_sr630::${debug_string}" + } + } catch_message ] +} + +# check function for hset change +proc ::scobj::srs_sr630::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} +} + +# function to request the read of a parameter on a device +proc ::scobj::srs_sr630::fetch_id {tc_root nextState cmd_str} { + set catch_status [ catch { + debug_log ${tc_root} 1 "fetch_id tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set cmd "${cmd_str}" +# fetch_id hook code starts + if {[hval [sct]] == "UNKNOWN"} { + set cmd "[clock format [clock seconds] -format "DATE %m,%d,%Y;TIME %H,%M,%S;*IDN?"]" + } else { + set cmd "*IDN?" + } +# fetch_id hook code ends + if { [hpropexists [sct] geterror] } { + debug_log ${tc_root} 9 "[sct] error: [sct geterror]" + error "[sct geterror]" + } + debug_log ${tc_root} 1 "fetch_id 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 request the read of a parameter on a device +proc ::scobj::srs_sr630::getSensor {tc_root nextState cmd_str} { + set catch_status [ catch { + debug_log ${tc_root} 1 "getSensor tc_root=${tc_root} sct=[sct] cmd=${cmd_str}" + if { [hpropexists [sct] geterror] } { + hdelprop [sct] geterror + } + set cmd "${cmd_str}" +# getSensor hook code starts + set cmd "UNIT ${cmd_str},ABS;MEAS? ${cmd_str}" +# getSensor hook code ends + if { [hpropexists [sct] geterror] } { + debug_log ${tc_root} 9 "[sct] error: [sct geterror]" + error "[sct geterror]" + } + debug_log ${tc_root} 1 "getSensor 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 check the write parameter on a device +proc ::scobj::srs_sr630::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::srs_sr630::readSensor {tc_root} { + set catch_status [ catch { + debug_log ${tc_root} 1 "readSensor 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]" + } +# readSensor hook code goes here + 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::srs_sr630::read_id {tc_root} { + set catch_status [ catch { + debug_log ${tc_root} 1 "read_id 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]" + } +# read_id hook code goes here + 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::srs_sr630::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} +} + +proc ::scobj::srs_sr630::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port } { + ::scobj::srs_sr630::sics_log 9 "::scobj::srs_sr630::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}" + set ns "[namespace current]" + set catch_status [ catch { + + MakeSICSObj ${name} SCT_OBJECT + + sicslist setatt ${name} klass ${device_class} + sicslist setatt ${name} long_name ${name} + + set scobj_hpath /sics/${name} + # Start of unnamed group + + # Start of var: id + hfactory ${scobj_hpath}/id plain user text + hsetprop ${scobj_hpath}/id read ${ns}::fetch_id ${scobj_hpath} read_id {@} + hsetprop ${scobj_hpath}/id read_id ${ns}::read_id ${scobj_hpath} + hsetprop ${scobj_hpath}/id control true + hsetprop ${scobj_hpath}/id data true + hsetprop ${scobj_hpath}/id mutable true + hsetprop ${scobj_hpath}/id nxsave true + hsetprop ${scobj_hpath}/id oldval UNKNOWN + hset ${scobj_hpath}/id UNKNOWN + hsetprop ${scobj_hpath}/id klass "parameter" + hsetprop ${scobj_hpath}/id sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/id type "part" + hsetprop ${scobj_hpath}/id nxalias "${name}_id" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/id 600 + hsetprop ${scobj_hpath}/id simulated false + } else { + ::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for srs_sr630" + hsetprop ${scobj_hpath}/id simulated true + } + + # Start of var: sensor_01 + hfactory ${scobj_hpath}/sensor_01 plain user float + hsetprop ${scobj_hpath}/sensor_01 read ${ns}::getSensor ${scobj_hpath} readSensor {1} + hsetprop ${scobj_hpath}/sensor_01 readSensor ${ns}::readSensor ${scobj_hpath} + hsetprop ${scobj_hpath}/sensor_01 control true + hsetprop ${scobj_hpath}/sensor_01 data true + hsetprop ${scobj_hpath}/sensor_01 mutable true + hsetprop ${scobj_hpath}/sensor_01 nxsave true + hsetprop ${scobj_hpath}/sensor_01 oldval 0.0 + hsetprop ${scobj_hpath}/sensor_01 klass "parameter" + hsetprop ${scobj_hpath}/sensor_01 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/sensor_01 type "part" + hsetprop ${scobj_hpath}/sensor_01 nxalias "${name}_sensor_01" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/sensor_01 60 + hsetprop ${scobj_hpath}/sensor_01 simulated false + } else { + ::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for srs_sr630" + hsetprop ${scobj_hpath}/sensor_01 simulated true + } + + # Start of var: sensor_02 + hfactory ${scobj_hpath}/sensor_02 plain user float + hsetprop ${scobj_hpath}/sensor_02 read ${ns}::getSensor ${scobj_hpath} readSensor {2} + hsetprop ${scobj_hpath}/sensor_02 readSensor ${ns}::readSensor ${scobj_hpath} + hsetprop ${scobj_hpath}/sensor_02 control true + hsetprop ${scobj_hpath}/sensor_02 data true + hsetprop ${scobj_hpath}/sensor_02 mutable true + hsetprop ${scobj_hpath}/sensor_02 nxsave true + hsetprop ${scobj_hpath}/sensor_02 oldval 0.0 + hsetprop ${scobj_hpath}/sensor_02 klass "parameter" + hsetprop ${scobj_hpath}/sensor_02 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/sensor_02 type "part" + hsetprop ${scobj_hpath}/sensor_02 nxalias "${name}_sensor_02" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/sensor_02 600 + hsetprop ${scobj_hpath}/sensor_02 simulated false + } else { + ::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for srs_sr630" + hsetprop ${scobj_hpath}/sensor_02 simulated true + } + + # Start of var: sensor_03 + hfactory ${scobj_hpath}/sensor_03 plain user float + hsetprop ${scobj_hpath}/sensor_03 read ${ns}::getSensor ${scobj_hpath} readSensor {3} + hsetprop ${scobj_hpath}/sensor_03 readSensor ${ns}::readSensor ${scobj_hpath} + hsetprop ${scobj_hpath}/sensor_03 control true + hsetprop ${scobj_hpath}/sensor_03 data true + hsetprop ${scobj_hpath}/sensor_03 mutable true + hsetprop ${scobj_hpath}/sensor_03 nxsave true + hsetprop ${scobj_hpath}/sensor_03 oldval 0.0 + hsetprop ${scobj_hpath}/sensor_03 klass "parameter" + hsetprop ${scobj_hpath}/sensor_03 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/sensor_03 type "part" + hsetprop ${scobj_hpath}/sensor_03 nxalias "${name}_sensor_03" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/sensor_03 600 + hsetprop ${scobj_hpath}/sensor_03 simulated false + } else { + ::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for srs_sr630" + hsetprop ${scobj_hpath}/sensor_03 simulated true + } + + # Start of var: sensor_04 + hfactory ${scobj_hpath}/sensor_04 plain user float + hsetprop ${scobj_hpath}/sensor_04 read ${ns}::getSensor ${scobj_hpath} readSensor {4} + hsetprop ${scobj_hpath}/sensor_04 readSensor ${ns}::readSensor ${scobj_hpath} + hsetprop ${scobj_hpath}/sensor_04 control true + hsetprop ${scobj_hpath}/sensor_04 data true + hsetprop ${scobj_hpath}/sensor_04 mutable true + hsetprop ${scobj_hpath}/sensor_04 nxsave true + hsetprop ${scobj_hpath}/sensor_04 oldval 0.0 + hsetprop ${scobj_hpath}/sensor_04 klass "parameter" + hsetprop ${scobj_hpath}/sensor_04 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/sensor_04 type "part" + hsetprop ${scobj_hpath}/sensor_04 nxalias "${name}_sensor_04" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/sensor_04 600 + hsetprop ${scobj_hpath}/sensor_04 simulated false + } else { + ::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for srs_sr630" + hsetprop ${scobj_hpath}/sensor_04 simulated true + } + + # Start of var: sensor_05 + hfactory ${scobj_hpath}/sensor_05 plain user float + hsetprop ${scobj_hpath}/sensor_05 read ${ns}::getSensor ${scobj_hpath} readSensor {5} + hsetprop ${scobj_hpath}/sensor_05 readSensor ${ns}::readSensor ${scobj_hpath} + hsetprop ${scobj_hpath}/sensor_05 control true + hsetprop ${scobj_hpath}/sensor_05 data true + hsetprop ${scobj_hpath}/sensor_05 mutable true + hsetprop ${scobj_hpath}/sensor_05 nxsave true + hsetprop ${scobj_hpath}/sensor_05 oldval 0.0 + hsetprop ${scobj_hpath}/sensor_05 klass "parameter" + hsetprop ${scobj_hpath}/sensor_05 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/sensor_05 type "part" + hsetprop ${scobj_hpath}/sensor_05 nxalias "${name}_sensor_05" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/sensor_05 600 + hsetprop ${scobj_hpath}/sensor_05 simulated false + } else { + ::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for srs_sr630" + hsetprop ${scobj_hpath}/sensor_05 simulated true + } + + # Start of var: sensor_06 + hfactory ${scobj_hpath}/sensor_06 plain user float + hsetprop ${scobj_hpath}/sensor_06 read ${ns}::getSensor ${scobj_hpath} readSensor {6} + hsetprop ${scobj_hpath}/sensor_06 readSensor ${ns}::readSensor ${scobj_hpath} + hsetprop ${scobj_hpath}/sensor_06 control true + hsetprop ${scobj_hpath}/sensor_06 data true + hsetprop ${scobj_hpath}/sensor_06 mutable true + hsetprop ${scobj_hpath}/sensor_06 nxsave true + hsetprop ${scobj_hpath}/sensor_06 oldval 0.0 + hsetprop ${scobj_hpath}/sensor_06 klass "parameter" + hsetprop ${scobj_hpath}/sensor_06 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/sensor_06 type "part" + hsetprop ${scobj_hpath}/sensor_06 nxalias "${name}_sensor_06" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/sensor_06 600 + hsetprop ${scobj_hpath}/sensor_06 simulated false + } else { + ::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for srs_sr630" + hsetprop ${scobj_hpath}/sensor_06 simulated true + } + + # Start of var: sensor_07 + hfactory ${scobj_hpath}/sensor_07 plain user float + hsetprop ${scobj_hpath}/sensor_07 read ${ns}::getSensor ${scobj_hpath} readSensor {7} + hsetprop ${scobj_hpath}/sensor_07 readSensor ${ns}::readSensor ${scobj_hpath} + hsetprop ${scobj_hpath}/sensor_07 control true + hsetprop ${scobj_hpath}/sensor_07 data true + hsetprop ${scobj_hpath}/sensor_07 mutable true + hsetprop ${scobj_hpath}/sensor_07 nxsave true + hsetprop ${scobj_hpath}/sensor_07 oldval 0.0 + hsetprop ${scobj_hpath}/sensor_07 klass "parameter" + hsetprop ${scobj_hpath}/sensor_07 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/sensor_07 type "part" + hsetprop ${scobj_hpath}/sensor_07 nxalias "${name}_sensor_07" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/sensor_07 600 + hsetprop ${scobj_hpath}/sensor_07 simulated false + } else { + ::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for srs_sr630" + hsetprop ${scobj_hpath}/sensor_07 simulated true + } + + # Start of var: sensor_08 + hfactory ${scobj_hpath}/sensor_08 plain user float + hsetprop ${scobj_hpath}/sensor_08 read ${ns}::getSensor ${scobj_hpath} readSensor {8} + hsetprop ${scobj_hpath}/sensor_08 readSensor ${ns}::readSensor ${scobj_hpath} + hsetprop ${scobj_hpath}/sensor_08 control true + hsetprop ${scobj_hpath}/sensor_08 data true + hsetprop ${scobj_hpath}/sensor_08 mutable true + hsetprop ${scobj_hpath}/sensor_08 nxsave true + hsetprop ${scobj_hpath}/sensor_08 oldval 0.0 + hsetprop ${scobj_hpath}/sensor_08 klass "parameter" + hsetprop ${scobj_hpath}/sensor_08 sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/sensor_08 type "part" + hsetprop ${scobj_hpath}/sensor_08 nxalias "${name}_sensor_08" + + if {[string equal -nocase "${simulation_flag}" "false"]} { + ${sct_controller} poll ${scobj_hpath}/sensor_08 600 + hsetprop ${scobj_hpath}/sensor_08 simulated false + } else { + ::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => No poll/write for srs_sr630" + hsetprop ${scobj_hpath}/sensor_08 simulated true + } + + hsetprop ${scobj_hpath} data "true" + hsetprop ${scobj_hpath} klass "@none" + hsetprop ${scobj_hpath} type "part" + # End of unnamed group + 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::srs_sr630::add_driver {name device_class simulation_flag ip_address tcp_port} { + set catch_status [ catch { + ::scobj::srs_sr630::sics_log 9 "::scobj::srs_sr630::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}" + if {[string equal -nocase "${simulation_flag}" "false"]} { + if {[string equal -nocase "aqadapter" "${ip_address}"]} { + ::scobj::srs_sr630::sics_log 9 "makesctcontroller sct_${name} aqadapter ${tcp_port}" + makesctcontroller sct_${name} aqadapter ${tcp_port} + } else { + ::scobj::srs_sr630::sics_log 9 "makesctcontroller sct_${name} std ${ip_address}:${tcp_port}" + makesctcontroller sct_${name} std ${ip_address}:${tcp_port} + } + } else { + ::scobj::srs_sr630::sics_log 9 "simulation_flag=${simulation_flag} => Null sctcontroller for srs_sr630" + ::scobj::srs_sr630::sics_log 9 "makesctcontroller sct_${name} aqadapter NULL" + makesctcontroller sct_${name} aqadapter NULL + } + ::scobj::srs_sr630::sics_log 1 "::scobj::srs_sr630::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port}" + ::scobj::srs_sr630::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +namespace eval ::scobj::srs_sr630 { + namespace export debug_threshold + namespace export debug_log + namespace export sics_log + namespace export mkDriver + namespace export add_driver +} + +proc add_srs_sr630 {name ip_address tcp_port} { + set simulation_flag "[string tolower [SplitReply [detector_simulation]]]" + ::scobj::srs_sr630::add_driver ${name} "NXdetector" ${simulation_flag} ${ip_address} ${tcp_port} +} + +clientput "file evaluation of sct_srs_sr630.tcl" +::scobj::srs_sr630::sics_log 9 "file evaluation of sct_srs_sr630.tcl" + +proc ::scobj::srs_sr630::read_config {} { + set catch_status [ catch { + set ns "::scobj::srs_sr630" + dict for {k u} $::config_dict { + if { [dict exists $u "implementation"] } { + set simulation_flag "[string tolower [SplitReply [detector_simulation]]]" + set device_class "NXdetector" + if { !([dict exists $u "name"] && [dict exists $u "enabled"]) } { + continue + } + 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"] "srs_sr630"] } { + 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} + } + ${ns}::mkDriver sct_${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} + } + } + } + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +if { [info exists ::config_dict] } { + ::scobj::srs_sr630::read_config +} else { + ::scobj::srs_sr630::sics_log 5 "No config dict" +} diff --git a/site_ansto/instrument/config/robots/epson_pandp_sct.tcl b/site_ansto/instrument/config/robots/epson_pandp_sct.tcl new file mode 100644 index 00000000..2b2c167a --- /dev/null +++ b/site_ansto/instrument/config/robots/epson_pandp_sct.tcl @@ -0,0 +1,127 @@ +# Generated driver for epson_pandp +# vim: ft=tcl tabstop=8 softtabstop=2 shiftwidth=2 nocindent smartindent +# + +namespace eval ::scobj::epson_pandp { + set debug_threshold 5 +} + +proc ::scobj::epson_pandp::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 fd [open "../log/epson_pandp_[basename ${tc_root}].log" "a"] + set line "[clock format [clock seconds] -format "%T"] ${debug_string}" + puts ${fd} "${line}" + close ${fd} + } + } catch_message ] +} + +proc ::scobj::epson_pandp::sics_log {debug_level debug_string} { + set catch_status [ catch { + set debug_threshold ${::scobj::epson_pandp::debug_threshold} + if {${debug_level} >= ${debug_threshold}} { + sicslog "::scobj::epson_pandp::${debug_string}" + } + } catch_message ] +} + +proc ::scobj::epson_pandp::mkDriver { sct_controller name device_class simulation_flag ip_address tcp_port robot_name } { + ::scobj::epson_pandp::sics_log 9 "::scobj::epson_pandp::mkDriver ${sct_controller} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${robot_name}" + set ns "[namespace current]" + set catch_status [ catch { + +# mkWrapper hook code starts + clientput "add_robot ${robot_name} ${ip_address} ${tcp_port}" + add_robot ${robot_name} ${ip_address} ${tcp_port} +# mkWrapper hook code ends + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +proc ::scobj::epson_pandp::add_driver {name device_class simulation_flag ip_address tcp_port robot_name} { + set catch_status [ catch { + ::scobj::epson_pandp::sics_log 9 "::scobj::epson_pandp::add_driver ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${robot_name}" + ::scobj::epson_pandp::sics_log 9 "No sctcontroller for epson_pandp" + ::scobj::epson_pandp::sics_log 1 "::scobj::epson_pandp::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${robot_name}" + ::scobj::epson_pandp::mkDriver sct_${name} ${name} ${device_class} ${simulation_flag} ${ip_address} ${tcp_port} ${robot_name} + } catch_message ] + handle_exception ${catch_status} ${catch_message} +} + +namespace eval ::scobj::epson_pandp { + namespace export debug_threshold + namespace export debug_log + namespace export sics_log + namespace export mkDriver + namespace export add_driver +} + +proc add_epson_pandp {name ip_address tcp_port robot_name} { + set simulation_flag "[string tolower [SplitReply [environment_simulation]]]" + ::scobj::epson_pandp::add_driver ${name} "environment" ${simulation_flag} ${ip_address} ${tcp_port} ${robot_name} +} + +clientput "file evaluation of sct_epson_pandp.tcl" +::scobj::epson_pandp::sics_log 9 "file evaluation of sct_epson_pandp.tcl" + +proc ::scobj::epson_pandp::read_config {} { + set catch_status [ catch { + set ns "::scobj::epson_pandp" + 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"] "epson_pandp"] } { + ::scobj::epson_pandp::sics_log 9 "No sctcontroller for epson_pandp" + set arg_list [list] + set missing_list [list] + foreach arg {robot_name} { + if {[dict exists $u $arg]} { + lappend arg_list "[dict get $u $arg]" + } elseif {[dict exists $v $arg]} { + lappend arg_list "[dict get $v $arg]" + } else { + ${ns}::sics_log 9 "Missing configuration value $arg" + lappend missing_list $arg + } + } + if { [llength $missing_list] > 0 } { + error "$name is missing configuration values $missing_list" + } + ${ns}::mkDriver sct_${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::epson_pandp::read_config +} else { + ::scobj::epson_pandp::sics_log 5 "No config dict" +}