From ad50eaca6a33e7d3adc69e56a853127a91ff76c5 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Thu, 17 Apr 2014 13:45:35 +1000 Subject: [PATCH] Regenerate all of the generated driver code --- .../bilby/config/motors/sct_shutters.tcl | 7 + .../bilby/config/motors/sct_tank.tcl | 7 + .../config/environment/sct_hiden_xcs.tcl | 302 +++++++++++------- .../config/environment/sct_isotech_ps.tcl | 13 +- .../temperature/sct_mercury_scpi.tcl | 7 + .../temperature/sct_pfeiffer_hg.tcl | 9 +- .../config/source/sct_reactor_status.tcl | 7 + 7 files changed, 227 insertions(+), 125 deletions(-) diff --git a/site_ansto/instrument/bilby/config/motors/sct_shutters.tcl b/site_ansto/instrument/bilby/config/motors/sct_shutters.tcl index 17829270..7ba6a2bd 100644 --- a/site_ansto/instrument/bilby/config/motors/sct_shutters.tcl +++ b/site_ansto/instrument/bilby/config/motors/sct_shutters.tcl @@ -301,7 +301,14 @@ proc ::scobj::shutters::read_config {} { set PORT [dict get $v port] set name [dict get $v name] MakeAsyncProtocol ${name}_protocol + if { [dict exists $v "terminator"] } { + ${name}_protocol sendterminator "[dict get $v "terminator"]" + ${name}_protocol replyterminator "[dict get $v "terminator"]" + } MakeAsyncQueue ${name}_queue ${name}_protocol ${IP} ${PORT} + if { [dict exists $v "timeout"] } { + ${name}_queue timeout "[dict get $v "timeout"]" + } add_shutters ${name} "aqadapter" ${name}_queue } } diff --git a/site_ansto/instrument/bilby/config/motors/sct_tank.tcl b/site_ansto/instrument/bilby/config/motors/sct_tank.tcl index ac65b618..6c4ac897 100644 --- a/site_ansto/instrument/bilby/config/motors/sct_tank.tcl +++ b/site_ansto/instrument/bilby/config/motors/sct_tank.tcl @@ -266,7 +266,14 @@ proc ::scobj::tank::read_config {} { set PORT [dict get $v port] set name [dict get $v name] MakeAsyncProtocol ${name}_protocol + if { [dict exists $v "terminator"] } { + ${name}_protocol sendterminator "[dict get $v "terminator"]" + ${name}_protocol replyterminator "[dict get $v "terminator"]" + } MakeAsyncQueue ${name}_queue ${name}_protocol ${IP} ${PORT} + if { [dict exists $v "timeout"] } { + ${name}_queue timeout "[dict get $v "timeout"]" + } add_tank ${name} "aqadapter" ${name}_queue } } diff --git a/site_ansto/instrument/config/environment/sct_hiden_xcs.tcl b/site_ansto/instrument/config/environment/sct_hiden_xcs.tcl index da744348..bb793b8e 100644 --- a/site_ansto/instrument/config/environment/sct_hiden_xcs.tcl +++ b/site_ansto/instrument/config/environment/sct_hiden_xcs.tcl @@ -141,10 +141,17 @@ proc ::scobj::hiden_xcs::fetch_flow {tc_root nextState cmd_str} { } set cmd "${cmd_str}" # hook code starts - if { [hpropexists [sct] target] } { - set pid [pid_flow ${tc_root} [sct target] ${data}] + set data 0.0 + foreach node [list flow1 flow2] { + set data [expr ${data} + [hval ${tc_root}/${node}]] } - set cmd "@@NOSEND@@" + sct result ${data} + set sp [pathname [sct]]/setpoint + if { [hpropexists ${sp} target] } { + set sp [hgetpropval ${sp} target] + pid_flow ${tc_root} ${sp} ${data} + } + set cmd "@@NOSEND@@" # hook code ends if { [hpropexists [sct] geterror] } { debug_log 1 "[sct] error: [sct geterror]" @@ -247,16 +254,14 @@ proc ::scobj::hiden_xcs::pid_flow {tc_root sp pv} { set i_value [expr [sct pid_ivalue] * [sct pid_integ]] set pid [expr ${p_value} + ${i_value} + ${d_value}] # hook code starts - set path [pathname [sct]] foreach node [list analog/sp1 analog/sp2] { - hsetprop ${path}/${node} bias_flow ${pid} - if { [hpropexists ${path}/${node} target] } { - hset ${path}/${node} [hgetpropval ${path}/${node} target] + hsetprop ${tc_root}/${node} bias_flow ${pid} + if { [hpropexists ${tc_root}/${node} target] } { + hset ${tc_root}/${node} [hgetpropval ${tc_root}/${node} target] } else { - hset ${path}/${node} [hval ${path}/${node}] + hset ${tc_root}/${node} [hval ${tc_root}/${node}] } } - } # hook code ends sct pid_output ${pid} } catch_message ] @@ -282,19 +287,17 @@ proc ::scobj::hiden_xcs::pid_humidity {tc_root sp pv} { set i_value [expr [sct pid_ivalue] * [sct pid_integ]] set pid [expr ${p_value} + ${i_value} + ${d_value}] # hook code starts - set path [pathname [sct]] set sign 1 foreach node [list analog/sp1 analog/sp2] { set sign [expr -${sign}] set signed_pid [expr ${sign} * ${pid}] - hsetprop ${path}/${node} bias_humidity ${signed_pid} - if { [hpropexists ${path}/${node} target] } { - hset ${path}/${node} [hgetpropval ${path}/${node} target] + hsetprop ${tc_root}/${node} bias_humidity ${signed_pid} + if { [hpropexists ${tc_root}/${node} target] } { + hset ${tc_root}/${node} [hgetpropval ${tc_root}/${node} target] } else { - hset ${path}/${node} [hval ${path}/${node}] + hset ${tc_root}/${node} [hval ${tc_root}/${node}] } } - } # hook code ends sct pid_output ${pid} } catch_message ] @@ -343,23 +346,25 @@ proc ::scobj::hiden_xcs::read_all_data {tc_root} { error "[sct geterror]" } # hook code starts - if { [string equal -nocase -length 2 "${data}" "A "] } { - set data_list [split [string range "${data}" 2 end-3] ','] - if { [llength ${data_list}] == 8 } { - set data [expr [lindex ${data_list} 0]] - hupdate ${tc_root}/temperature [expr [lindex ${data_list} 1]] - hupdate ${tc_root}/flow1 [expr [lindex ${data_list} 3] / [hval ${tc_root}/gas_factor]] - hupdate ${tc_root}/flow2 [expr [lindex ${data_list} 4] / [hval ${tc_root}/gas_factor]] - hupdate ${tc_root}/flow3 [expr [lindex ${data_list} 5] / [hval ${tc_root}/gas_factor]] + if { [string equal -nocase -length 2 "${data}" "A "] } { + set data_list [split [string range "${data}" 2 end-3] ','] + if { [llength ${data_list}] == 8 } { + set data [expr [lindex ${data_list} 0]] + hupdate ${tc_root}/temperature [expr [lindex ${data_list} 1]] + hupdate ${tc_root}/flow1 [expr [lindex ${data_list} 3] / [hval ${tc_root}/gas_factor]] + hupdate ${tc_root}/flow2 [expr [lindex ${data_list} 4] / [hval ${tc_root}/gas_factor]] + hupdate ${tc_root}/flow3 [expr [lindex ${data_list} 5] / [hval ${tc_root}/gas_factor]] + } else { + sct geterror "Syntax error (not 8) for read_all_data in: '${data}'" + } } else { - sct geterror "Syntax error (not 8) for read_all_data in: '${data}'" + sct geterror "Syntax error (not A) for read_all_data in: '${data}'" + } + set sp [pathname [sct]]/setpoint + if { [hpropexists ${sp} target] } { + set sp [hgetpropval ${sp} target] + pid_humidity ${tc_root} ${sp} ${data} } - } else { - sct geterror "Syntax error (not A) for read_all_data in: '${data}'" - } - if { [hpropexists [sct] target] } { - set pid [pid_humidity ${tc_root} [sct target] ${data}] - } # hook code ends if { [hpropexists [sct] geterror] } { debug_log 1 "[sct] error: [sct geterror]" @@ -603,15 +608,16 @@ proc ::scobj::hiden_xcs::write_flow {tc_root nextState cmd_str} { set par [sct target] set cmd "${cmd_str}${par}" # hook code starts - if { [hpropexists ${tc_root}/humidity target] } { - set humidity_target [hgetpropval ${tc_root}/humidity target] + if { [hpropexists ${tc_root}/humidity/setpoint target] } { + set humidity_target [hgetpropval ${tc_root}/humidity/setpoint target] } else { - set humidity_target [hval ${tc_root}/humidity] + set humidity_target [hval ${tc_root}/humidity/setpoint] } set flow1_target [expr (0.01 * (100.0 - ${humidity_target})) * [sct target]] set flow2_target [expr (0.01 * ( ${humidity_target})) * [sct target]] hset ${tc_root}/analog/sp1 ${flow1_target} hset ${tc_root}/analog/sp2 ${flow2_target} + set nextState "idle" set cmd "@@NOSEND@@" # hook code ends if { [hpropexists [sct] geterror] } { @@ -642,15 +648,16 @@ proc ::scobj::hiden_xcs::write_humidity {tc_root nextState cmd_str} { set par [sct target] set cmd "${cmd_str}${par}" # hook code starts - if { [hpropexists ${tc_root}/flow target] } { - set flow_target [hgetpropval ${tc_root}/flow target] + if { [hpropexists ${tc_root}/flow/setpoint target] } { + set flow_target [hgetpropval ${tc_root}/flow/setpoint target] } else { - set flow_target [hval ${tc_root}/flow] + set flow_target [hval ${tc_root}/flow/setpoint] } set flow1_target [expr (0.01 * (100.0 - [sct target])) * ${flow_target}] set flow2_target [expr (0.01 * ( [sct target])) * ${flow_target}] hset ${tc_root}/analog/sp1 ${flow1_target} hset ${tc_root}/analog/sp2 ${flow2_target} + set nextState "idle" set cmd "@@NOSEND@@" # hook code ends if { [hpropexists [sct] geterror] } { @@ -724,8 +731,8 @@ proc ::scobj::hiden_xcs::write_twelve {tc_root nextState cmd_str} { handle_exception ${catch_status} ${catch_message} } -proc ::scobj::hiden_xcs::mk_sct_hiden_xcs { sct_controller name tol } { - debug_log 1 "mk_sct_hiden_xcs ${sct_controller} ${name} ${tol}" +proc ::scobj::hiden_xcs::mk_sct_hiden_xcs { sct_controller name id } { + debug_log 1 "mk_sct_hiden_xcs ${sct_controller} ${name} ${id}" set ns "[namespace current]" set catch_status [ catch { @@ -747,42 +754,13 @@ proc ::scobj::hiden_xcs::mk_sct_hiden_xcs { sct_controller name tol } { hsetprop ${scobj_hpath}/enabled mutable false hsetprop ${scobj_hpath}/enabled nxsave true hsetprop ${scobj_hpath}/enabled values 0,1 + hsetprop ${scobj_hpath}/enabled permlink data_set "G[format "%02d" ${id}]X02" + hsetprop ${scobj_hpath}/enabled @description "G[format "%02d" ${id}]X02" hsetprop ${scobj_hpath}/enabled oldval 0 hsetprop ${scobj_hpath}/enabled klass "environment" hsetprop ${scobj_hpath}/enabled sdsinfo "::nexus::scobj::sdsinfo" hsetprop ${scobj_hpath}/enabled type "part" - hsetprop ${scobj_hpath}/enabled nxalias "${name}__enabled" - - hfactory ${scobj_hpath}/flow plain user float - hsetprop ${scobj_hpath}/flow read ${ns}::fetch_flow ${scobj_hpath} read_flow {None} - hsetprop ${scobj_hpath}/flow read_flow ${ns}::read_flow ${scobj_hpath} - hsetprop ${scobj_hpath}/flow write ${ns}::write_flow ${scobj_hpath} noResponse {} - hsetprop ${scobj_hpath}/flow noResponse ${ns}::noResponse ${scobj_hpath} - hsetprop ${scobj_hpath}/flow check ${ns}::checkrange ${scobj_hpath} - hsetprop ${scobj_hpath}/flow driving 0 - hsetprop ${scobj_hpath}/flow checklimits ${ns}::checklimits ${scobj_hpath} - hsetprop ${scobj_hpath}/flow checkstatus ${ns}::checkstatus ${scobj_hpath} - hsetprop ${scobj_hpath}/flow halt ${ns}::halt ${scobj_hpath} - hsetprop ${scobj_hpath}/flow driveable flow - hsetprop ${scobj_hpath}/flow control true - hsetprop ${scobj_hpath}/flow data true - hsetprop ${scobj_hpath}/flow mutable true - hsetprop ${scobj_hpath}/flow nxsave true - hsetprop ${scobj_hpath}/flow lowerlimit 0 - hsetprop ${scobj_hpath}/flow upperlimit 500 - hsetprop ${scobj_hpath}/flow tolerance 1 - hsetprop ${scobj_hpath}/flow oldval 0.0 - hsetprop ${scobj_hpath}/flow klass "environment" - hsetprop ${scobj_hpath}/flow pid_deriv "0" - hsetprop ${scobj_hpath}/flow pid_dvalue "0.0" - hsetprop ${scobj_hpath}/flow pid_error "0" - hsetprop ${scobj_hpath}/flow pid_imax "30" - hsetprop ${scobj_hpath}/flow pid_integ "0" - hsetprop ${scobj_hpath}/flow pid_ivalue "0.1" - hsetprop ${scobj_hpath}/flow pid_pvalue "0.2" - hsetprop ${scobj_hpath}/flow sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/flow type "drivable" - hsetprop ${scobj_hpath}/flow nxalias "${name}__flow" + hsetprop ${scobj_hpath}/enabled nxalias "${name}_enabled" hfactory ${scobj_hpath}/flow1 plain user float hsetprop ${scobj_hpath}/flow1 control false @@ -793,7 +771,7 @@ proc ::scobj::hiden_xcs::mk_sct_hiden_xcs { sct_controller name tol } { hsetprop ${scobj_hpath}/flow1 klass "environment" hsetprop ${scobj_hpath}/flow1 sdsinfo "::nexus::scobj::sdsinfo" hsetprop ${scobj_hpath}/flow1 type "part" - hsetprop ${scobj_hpath}/flow1 nxalias "${name}__flow1" + hsetprop ${scobj_hpath}/flow1 nxalias "${name}_flow1" hfactory ${scobj_hpath}/flow2 plain user float hsetprop ${scobj_hpath}/flow2 control false @@ -804,7 +782,7 @@ proc ::scobj::hiden_xcs::mk_sct_hiden_xcs { sct_controller name tol } { hsetprop ${scobj_hpath}/flow2 klass "environment" hsetprop ${scobj_hpath}/flow2 sdsinfo "::nexus::scobj::sdsinfo" hsetprop ${scobj_hpath}/flow2 type "part" - hsetprop ${scobj_hpath}/flow2 nxalias "${name}__flow2" + hsetprop ${scobj_hpath}/flow2 nxalias "${name}_flow2" hfactory ${scobj_hpath}/flow3 plain user float hsetprop ${scobj_hpath}/flow3 control false @@ -815,7 +793,7 @@ proc ::scobj::hiden_xcs::mk_sct_hiden_xcs { sct_controller name tol } { hsetprop ${scobj_hpath}/flow3 klass "environment" hsetprop ${scobj_hpath}/flow3 sdsinfo "::nexus::scobj::sdsinfo" hsetprop ${scobj_hpath}/flow3 type "part" - hsetprop ${scobj_hpath}/flow3 nxalias "${name}__flow3" + hsetprop ${scobj_hpath}/flow3 nxalias "${name}_flow3" hfactory ${scobj_hpath}/gas_factor plain user float hsetprop ${scobj_hpath}/gas_factor control true @@ -827,40 +805,7 @@ proc ::scobj::hiden_xcs::mk_sct_hiden_xcs { sct_controller name tol } { hsetprop ${scobj_hpath}/gas_factor klass "environment" hsetprop ${scobj_hpath}/gas_factor sdsinfo "::nexus::scobj::sdsinfo" hsetprop ${scobj_hpath}/gas_factor type "part" - hsetprop ${scobj_hpath}/gas_factor nxalias "${name}__gas_factor" - - hfactory ${scobj_hpath}/humidity plain user float - hsetprop ${scobj_hpath}/humidity read ${ns}::getValue ${scobj_hpath} read_all_data {?ALL DATA} - hsetprop ${scobj_hpath}/humidity read_all_data ${ns}::read_all_data ${scobj_hpath} - hsetprop ${scobj_hpath}/humidity write ${ns}::write_humidity ${scobj_hpath} noResponse {} - hsetprop ${scobj_hpath}/humidity noResponse ${ns}::noResponse ${scobj_hpath} - hsetprop ${scobj_hpath}/humidity check ${ns}::chkrange_function ${scobj_hpath} - hsetprop ${scobj_hpath}/humidity driving 0 - hsetprop ${scobj_hpath}/humidity checklimits ${ns}::checklimits ${scobj_hpath} - hsetprop ${scobj_hpath}/humidity checkstatus ${ns}::checkstatus ${scobj_hpath} - hsetprop ${scobj_hpath}/humidity halt ${ns}::halt ${scobj_hpath} - hsetprop ${scobj_hpath}/humidity driveable humidity - hsetprop ${scobj_hpath}/humidity control true - hsetprop ${scobj_hpath}/humidity data true - hsetprop ${scobj_hpath}/humidity mutable true - hsetprop ${scobj_hpath}/humidity nxsave true - hsetprop ${scobj_hpath}/humidity lowerlimit 10 - hsetprop ${scobj_hpath}/humidity upperlimit 90 - hsetprop ${scobj_hpath}/humidity tolerance 1 - hsetprop ${scobj_hpath}/humidity oldval 50 - hset ${scobj_hpath}/humidity 50 - hsetprop ${scobj_hpath}/humidity klass "environment" - hsetprop ${scobj_hpath}/humidity pid_deriv "0" - hsetprop ${scobj_hpath}/humidity pid_dvalue "0.0" - hsetprop ${scobj_hpath}/humidity pid_error "0" - hsetprop ${scobj_hpath}/humidity pid_imax "30" - hsetprop ${scobj_hpath}/humidity pid_integ "0" - hsetprop ${scobj_hpath}/humidity pid_ivalue "0.1" - hsetprop ${scobj_hpath}/humidity pid_pvalue "0.2" - hsetprop ${scobj_hpath}/humidity sdsinfo "::nexus::scobj::sdsinfo" - hsetprop ${scobj_hpath}/humidity settle_time "5.25" - hsetprop ${scobj_hpath}/humidity type "drivable" - hsetprop ${scobj_hpath}/humidity nxalias "${name}__humidity" + hsetprop ${scobj_hpath}/gas_factor nxalias "${name}_gas_factor" hfactory ${scobj_hpath}/temperature plain user float hsetprop ${scobj_hpath}/temperature control false @@ -871,20 +816,14 @@ proc ::scobj::hiden_xcs::mk_sct_hiden_xcs { sct_controller name tol } { hsetprop ${scobj_hpath}/temperature klass "environment" hsetprop ${scobj_hpath}/temperature sdsinfo "::nexus::scobj::sdsinfo" hsetprop ${scobj_hpath}/temperature type "part" - hsetprop ${scobj_hpath}/temperature nxalias "${name}__temperature" + hsetprop ${scobj_hpath}/temperature nxalias "${name}_temperature" hsetprop ${scobj_hpath} data "true" hsetprop ${scobj_hpath} nxsave "true" if {[SplitReply [environment_simulation]]=="false"} { ${sct_controller} poll ${scobj_hpath}/enabled 10 - ${sct_controller} poll ${scobj_hpath}/flow 1 - ${sct_controller} poll ${scobj_hpath}/humidity 1 ${sct_controller} write ${scobj_hpath}/enabled - ${sct_controller} write ${scobj_hpath}/flow - ansto_makesctdrive ${name}__flow ${scobj_hpath}/flow ${scobj_hpath}/flow ${sct_controller} - ${sct_controller} write ${scobj_hpath}/humidity - ansto_makesctdrive ${name}__humidity ${scobj_hpath}/humidity ${scobj_hpath}/humidity ${sct_controller} } hfactory ${scobj_hpath}/analog plain spy none @@ -1038,6 +977,120 @@ proc ::scobj::hiden_xcs::mk_sct_hiden_xcs { sct_controller name tol } { ${sct_controller} write ${scobj_hpath}/analog/sp2 ${sct_controller} write ${scobj_hpath}/analog/sp3 } + + hfactory ${scobj_hpath}/flow plain spy none + hsetprop ${scobj_hpath}/flow data "true" + hsetprop ${scobj_hpath}/flow nxsave "true" + + hfactory ${scobj_hpath}/flow/sensor plain user float + hsetprop ${scobj_hpath}/flow/sensor read ${ns}::fetch_flow ${scobj_hpath} read_flow {None} + hsetprop ${scobj_hpath}/flow/sensor read_flow ${ns}::read_flow ${scobj_hpath} + hsetprop ${scobj_hpath}/flow/sensor control true + hsetprop ${scobj_hpath}/flow/sensor data true + hsetprop ${scobj_hpath}/flow/sensor mutable true + hsetprop ${scobj_hpath}/flow/sensor nxsave true + hsetprop ${scobj_hpath}/flow/sensor permlink data_set "G[format "%02d" ${id}]S01" + hsetprop ${scobj_hpath}/flow/sensor @description "G[format "%02d" ${id}]S01" + hsetprop ${scobj_hpath}/flow/sensor oldval 0.0 + hsetprop ${scobj_hpath}/flow/sensor klass "environment" + hsetprop ${scobj_hpath}/flow/sensor pid_deriv "0" + hsetprop ${scobj_hpath}/flow/sensor pid_dvalue "0.0" + hsetprop ${scobj_hpath}/flow/sensor pid_error "0" + hsetprop ${scobj_hpath}/flow/sensor pid_imax "30" + hsetprop ${scobj_hpath}/flow/sensor pid_integ "0" + hsetprop ${scobj_hpath}/flow/sensor pid_ivalue "0.1" + hsetprop ${scobj_hpath}/flow/sensor pid_pvalue "0.2" + hsetprop ${scobj_hpath}/flow/sensor sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/flow/sensor type "part" + hsetprop ${scobj_hpath}/flow/sensor nxalias "${name}_flow_sensor" + + hfactory ${scobj_hpath}/flow/setpoint plain user float + hsetprop ${scobj_hpath}/flow/setpoint write ${ns}::write_flow ${scobj_hpath} noResponse {} + hsetprop ${scobj_hpath}/flow/setpoint noResponse ${ns}::noResponse ${scobj_hpath} + hsetprop ${scobj_hpath}/flow/setpoint check ${ns}::checkrange ${scobj_hpath} + hsetprop ${scobj_hpath}/flow/setpoint driving 0 + hsetprop ${scobj_hpath}/flow/setpoint checklimits ${ns}::checklimits ${scobj_hpath} + hsetprop ${scobj_hpath}/flow/setpoint checkstatus ${ns}::checkstatus ${scobj_hpath} + hsetprop ${scobj_hpath}/flow/setpoint halt ${ns}::halt ${scobj_hpath} + hsetprop ${scobj_hpath}/flow/setpoint driveable flow/sensor + hsetprop ${scobj_hpath}/flow/setpoint control true + hsetprop ${scobj_hpath}/flow/setpoint data true + hsetprop ${scobj_hpath}/flow/setpoint mutable true + hsetprop ${scobj_hpath}/flow/setpoint nxsave true + hsetprop ${scobj_hpath}/flow/setpoint lowerlimit 0 + hsetprop ${scobj_hpath}/flow/setpoint upperlimit 500 + hsetprop ${scobj_hpath}/flow/setpoint tolerance 1 + hsetprop ${scobj_hpath}/flow/setpoint permlink data_set "G[format "%02d" ${id}]SP01" + hsetprop ${scobj_hpath}/flow/setpoint @description "G[format "%02d" ${id}]SP01" + hsetprop ${scobj_hpath}/flow/setpoint oldval 100 + hset ${scobj_hpath}/flow/setpoint 100 + hsetprop ${scobj_hpath}/flow/setpoint klass "environment" + hsetprop ${scobj_hpath}/flow/setpoint sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/flow/setpoint type "drivable" + hsetprop ${scobj_hpath}/flow/setpoint nxalias "${name}_flow_setpoint" + + if {[SplitReply [environment_simulation]]=="false"} { + ${sct_controller} poll ${scobj_hpath}/flow/sensor 1 + ${sct_controller} write ${scobj_hpath}/flow/setpoint + ansto_makesctdrive ${name}_flow_setpoint ${scobj_hpath}/flow/setpoint ${scobj_hpath}/flow/sensor ${sct_controller} + } + + hfactory ${scobj_hpath}/humidity plain spy none + hsetprop ${scobj_hpath}/humidity data "true" + hsetprop ${scobj_hpath}/humidity nxsave "true" + + hfactory ${scobj_hpath}/humidity/sensor plain user float + hsetprop ${scobj_hpath}/humidity/sensor read ${ns}::getValue ${scobj_hpath} read_all_data {?ALL DATA} + hsetprop ${scobj_hpath}/humidity/sensor read_all_data ${ns}::read_all_data ${scobj_hpath} + hsetprop ${scobj_hpath}/humidity/sensor control true + hsetprop ${scobj_hpath}/humidity/sensor data true + hsetprop ${scobj_hpath}/humidity/sensor mutable true + hsetprop ${scobj_hpath}/humidity/sensor nxsave true + hsetprop ${scobj_hpath}/humidity/sensor permlink data_set "G[format "%02d" ${id}]S02" + hsetprop ${scobj_hpath}/humidity/sensor @description "G[format "%02d" ${id}]S02" + hsetprop ${scobj_hpath}/humidity/sensor oldval 0.0 + hsetprop ${scobj_hpath}/humidity/sensor klass "environment" + hsetprop ${scobj_hpath}/humidity/sensor pid_deriv "0" + hsetprop ${scobj_hpath}/humidity/sensor pid_dvalue "0.0" + hsetprop ${scobj_hpath}/humidity/sensor pid_error "0" + hsetprop ${scobj_hpath}/humidity/sensor pid_imax "30" + hsetprop ${scobj_hpath}/humidity/sensor pid_integ "0" + hsetprop ${scobj_hpath}/humidity/sensor pid_ivalue "0.1" + hsetprop ${scobj_hpath}/humidity/sensor pid_pvalue "0.2" + hsetprop ${scobj_hpath}/humidity/sensor sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/humidity/sensor type "part" + hsetprop ${scobj_hpath}/humidity/sensor nxalias "${name}_humidity_sensor" + + hfactory ${scobj_hpath}/humidity/setpoint plain user float + hsetprop ${scobj_hpath}/humidity/setpoint write ${ns}::write_humidity ${scobj_hpath} noResponse {} + hsetprop ${scobj_hpath}/humidity/setpoint noResponse ${ns}::noResponse ${scobj_hpath} + hsetprop ${scobj_hpath}/humidity/setpoint check ${ns}::chkrange_function ${scobj_hpath} + hsetprop ${scobj_hpath}/humidity/setpoint driving 0 + hsetprop ${scobj_hpath}/humidity/setpoint checklimits ${ns}::checklimits ${scobj_hpath} + hsetprop ${scobj_hpath}/humidity/setpoint checkstatus ${ns}::checkstatus ${scobj_hpath} + hsetprop ${scobj_hpath}/humidity/setpoint halt ${ns}::halt ${scobj_hpath} + hsetprop ${scobj_hpath}/humidity/setpoint driveable humidity/sensor + hsetprop ${scobj_hpath}/humidity/setpoint control true + hsetprop ${scobj_hpath}/humidity/setpoint data true + hsetprop ${scobj_hpath}/humidity/setpoint mutable true + hsetprop ${scobj_hpath}/humidity/setpoint nxsave true + hsetprop ${scobj_hpath}/humidity/setpoint lowerlimit 10 + hsetprop ${scobj_hpath}/humidity/setpoint upperlimit 90 + hsetprop ${scobj_hpath}/humidity/setpoint tolerance 1 + hsetprop ${scobj_hpath}/humidity/setpoint permlink data_set "G[format "%02d" ${id}]SP02" + hsetprop ${scobj_hpath}/humidity/setpoint @description "G[format "%02d" ${id}]SP02" + hsetprop ${scobj_hpath}/humidity/setpoint oldval 50 + hset ${scobj_hpath}/humidity/setpoint 50 + hsetprop ${scobj_hpath}/humidity/setpoint klass "environment" + hsetprop ${scobj_hpath}/humidity/setpoint sdsinfo "::nexus::scobj::sdsinfo" + hsetprop ${scobj_hpath}/humidity/setpoint type "drivable" + hsetprop ${scobj_hpath}/humidity/setpoint nxalias "${name}_humidity_setpoint" + + if {[SplitReply [environment_simulation]]=="false"} { + ${sct_controller} poll ${scobj_hpath}/humidity/sensor 1 + ${sct_controller} write ${scobj_hpath}/humidity/setpoint + ansto_makesctdrive ${name}_humidity_setpoint ${scobj_hpath}/humidity/setpoint ${scobj_hpath}/humidity/sensor ${sct_controller} + } hsetprop ${scobj_hpath} klass environment # hook code starts # hook code ends @@ -1050,21 +1103,21 @@ namespace eval ::scobj::hiden_xcs { namespace export mk_sct_hiden_xcs } -proc add_hiden_xcs {name IP port terminator {tol 0.5}} { +proc add_hiden_xcs {name IP port id} { set catch_status [ catch { set ns "::scobj::hiden_xcs" - ${ns}::debug_log 1 "add_hiden_xcs ${name} ${IP} ${port} ${tol}" + ${ns}::debug_log 1 "add_hiden_xcs ${name} ${IP} ${port} ${id}" if {[SplitReply [environment_simulation]]=="false"} { if {[string equal -nocase "aqadapter" "${IP}"]} { ${ns}::debug_log 1 "makesctcontroller sct_${name} aqadapter ${port}" makesctcontroller sct_${name} aqadapter ${port} } else { - ${ns}::debug_log 1 "makesctcontroller sct_${name} std ${IP}:${port} ${terminator}" - makesctcontroller sct_${name} std ${IP}:${port} ${terminator} + ${ns}::debug_log 1 "makesctcontroller sct_${name} std ${IP}:${port}" + makesctcontroller sct_${name} std ${IP}:${port} } } - ${ns}::debug_log 1 "mk_sct_hiden_xcs sct_${name} ${name} ${tol}" - ${ns}::mk_sct_hiden_xcs sct_${name} ${name} ${tol} + ${ns}::debug_log 1 "mk_sct_hiden_xcs sct_${name} ${name} ${id}" + ${ns}::mk_sct_hiden_xcs sct_${name} ${name} ${id} } catch_message ] handle_exception ${catch_status} ${catch_message} } @@ -1087,9 +1140,16 @@ proc ::scobj::hiden_xcs::read_config {} { set PORT [dict get $v port] set name [dict get $v name] MakeAsyncProtocol ${name}_protocol + if { [dict exists $v "terminator"] } { + ${name}_protocol sendterminator "[dict get $v "terminator"]" + ${name}_protocol replyterminator "[dict get $v "terminator"]" + } MakeAsyncQueue ${name}_queue ${name}_protocol ${IP} ${PORT} + if { [dict exists $v "timeout"] } { + ${name}_queue timeout "[dict get $v "timeout"]" + } set arg_list [list] - foreach arg {tol} { + foreach arg {id} { if {[dict exists $v $arg]} { lappend arg_list "[dict get $v $arg]" } else { diff --git a/site_ansto/instrument/config/environment/sct_isotech_ps.tcl b/site_ansto/instrument/config/environment/sct_isotech_ps.tcl index 45f5848f..1323cc67 100644 --- a/site_ansto/instrument/config/environment/sct_isotech_ps.tcl +++ b/site_ansto/instrument/config/environment/sct_isotech_ps.tcl @@ -253,7 +253,7 @@ proc ::scobj::isotech_ps::mk_sct_isotech_ps { sct_controller name } { hsetprop ${scobj_hpath}/amps oldval 0.0 hsetprop ${scobj_hpath}/amps sdsinfo "::nexus::scobj::sdsinfo" hsetprop ${scobj_hpath}/amps type "part" - hsetprop ${scobj_hpath}/amps nxalias "${name}__amps" + hsetprop ${scobj_hpath}/amps nxalias "${name}_amps" hfactory ${scobj_hpath}/relay plain user int hsetprop ${scobj_hpath}/relay read ${ns}::getValue ${scobj_hpath} read_relay {F} @@ -268,7 +268,7 @@ proc ::scobj::isotech_ps::mk_sct_isotech_ps { sct_controller name } { hsetprop ${scobj_hpath}/relay oldval 0 hsetprop ${scobj_hpath}/relay sdsinfo "::nexus::scobj::sdsinfo" hsetprop ${scobj_hpath}/relay type "part" - hsetprop ${scobj_hpath}/relay nxalias "${name}__relay" + hsetprop ${scobj_hpath}/relay nxalias "${name}_relay" hfactory ${scobj_hpath}/volts plain user float hsetprop ${scobj_hpath}/volts read ${ns}::getValue ${scobj_hpath} rdValue {V} @@ -284,7 +284,7 @@ proc ::scobj::isotech_ps::mk_sct_isotech_ps { sct_controller name } { hsetprop ${scobj_hpath}/volts oldval 0.0 hsetprop ${scobj_hpath}/volts sdsinfo "::nexus::scobj::sdsinfo" hsetprop ${scobj_hpath}/volts type "part" - hsetprop ${scobj_hpath}/volts nxalias "${name}__volts" + hsetprop ${scobj_hpath}/volts nxalias "${name}_volts" if {[SplitReply [environment_simulation]]=="false"} { ${sct_controller} poll ${scobj_hpath}/amps 5 @@ -341,7 +341,14 @@ proc ::scobj::isotech_ps::read_config {} { set PORT [dict get $v port] set name [dict get $v name] MakeAsyncProtocol ${name}_protocol + if { [dict exists $v "terminator"] } { + ${name}_protocol sendterminator "[dict get $v "terminator"]" + ${name}_protocol replyterminator "[dict get $v "terminator"]" + } MakeAsyncQueue ${name}_queue ${name}_protocol ${IP} ${PORT} + if { [dict exists $v "timeout"] } { + ${name}_queue timeout "[dict get $v "timeout"]" + } add_isotech_ps ${name} "aqadapter" ${name}_queue } } diff --git a/site_ansto/instrument/config/environment/temperature/sct_mercury_scpi.tcl b/site_ansto/instrument/config/environment/temperature/sct_mercury_scpi.tcl index 1d6d3fd3..fd474a24 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_mercury_scpi.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_mercury_scpi.tcl @@ -729,7 +729,14 @@ proc ::scobj::mercury_scpi::read_config {} { set PORT [dict get $v port] set name [dict get $v name] MakeAsyncProtocol ${name}_protocol + if { [dict exists $v "terminator"] } { + ${name}_protocol sendterminator "[dict get $v "terminator"]" + ${name}_protocol replyterminator "[dict get $v "terminator"]" + } MakeAsyncQueue ${name}_queue ${name}_protocol ${IP} ${PORT} + if { [dict exists $v "timeout"] } { + ${name}_queue timeout "[dict get $v "timeout"]" + } set arg_list [list] foreach arg {id permlink tol valve_tol} { if {[dict exists $v $arg]} { diff --git a/site_ansto/instrument/config/environment/temperature/sct_pfeiffer_hg.tcl b/site_ansto/instrument/config/environment/temperature/sct_pfeiffer_hg.tcl index 3eb24931..2781ce7b 100644 --- a/site_ansto/instrument/config/environment/temperature/sct_pfeiffer_hg.tcl +++ b/site_ansto/instrument/config/environment/temperature/sct_pfeiffer_hg.tcl @@ -376,7 +376,7 @@ proc ::scobj::pfeiffer_hg::mk_sct_pfeiffer_hg { sct_controller name } { hsetprop ${scobj_hpath}/status oldval 0 hsetprop ${scobj_hpath}/status sdsinfo "::nexus::scobj::sdsinfo" hsetprop ${scobj_hpath}/status type "part" - hsetprop ${scobj_hpath}/status nxalias "${name}__status" + hsetprop ${scobj_hpath}/status nxalias "${name}_status" hfactory ${scobj_hpath}/pressure plain spy none @@ -483,7 +483,14 @@ proc ::scobj::pfeiffer_hg::read_config {} { set PORT [dict get $v port] set name [dict get $v name] MakeAsyncProtocol ${name}_protocol + if { [dict exists $v "terminator"] } { + ${name}_protocol sendterminator "[dict get $v "terminator"]" + ${name}_protocol replyterminator "[dict get $v "terminator"]" + } MakeAsyncQueue ${name}_queue ${name}_protocol ${IP} ${PORT} + if { [dict exists $v "timeout"] } { + ${name}_queue timeout "[dict get $v "timeout"]" + } add_pfeiffer_hg ${name} "aqadapter" ${name}_queue } } diff --git a/site_ansto/instrument/config/source/sct_reactor_status.tcl b/site_ansto/instrument/config/source/sct_reactor_status.tcl index a1225cb5..5fdbc749 100644 --- a/site_ansto/instrument/config/source/sct_reactor_status.tcl +++ b/site_ansto/instrument/config/source/sct_reactor_status.tcl @@ -340,7 +340,14 @@ proc ::scobj::reactor_status::read_config {} { set PORT [dict get $v port] set name [dict get $v name] MakeAsyncProtocol ${name}_protocol + if { [dict exists $v "terminator"] } { + ${name}_protocol sendterminator "[dict get $v "terminator"]" + ${name}_protocol replyterminator "[dict get $v "terminator"]" + } MakeAsyncQueue ${name}_queue ${name}_protocol ${IP} ${PORT} + if { [dict exists $v "timeout"] } { + ${name}_queue timeout "[dict get $v "timeout"]" + } add_reactor_status ${name} "aqadapter" ${name}_queue } }