Quokka environment.tcl
Don't make the temperature getset-macro or select the control sensor for the script validator instance of SICS. (fixed in-situ) Use new ls340 and ls336 controllers. script_context_util.tcl Modified hinitprops so that it can take sub-paths nxscripts_common_1.tcl Added ::nexus::OnFirstsave ::nexus:OnLastSave to register commands which will be executed on the first and last save of a data file. sct_julabo_lh45.tcl Added start_temperature and end_temperature parameters to record the initial and final temperature readings in the data files. Also only set the setpoint if the Julabo is in remote mode. sct_positmotor_common.tcl Report 99999 if a posit motor table is out of range. quokka guide_configuration.tcl Updated aperture size for p1, p1lp, p1lens in the guide configuration table. r2969 | ffr | 2010-07-01 22:09:09 +1000 (Thu, 01 Jul 2010) | 20 lines
This commit is contained in:
committed by
Douglas Clowes
parent
d94cf7b011
commit
bbc133dab9
@@ -18,6 +18,9 @@ namespace eval ::scobj::lh45 {
|
||||
}
|
||||
|
||||
proc setPoint {tc_root nextState cmd} {
|
||||
if {[hval $tc_root/remote_ctrl] == "False"} {
|
||||
return idle
|
||||
}
|
||||
set par [sct target]
|
||||
|
||||
if {[hval $tc_root/apply_tolerance]} {
|
||||
@@ -236,10 +239,21 @@ namespace eval ::scobj::lh45 {
|
||||
|
||||
hfactory $scobj_hpath/sensor plain spy none
|
||||
hfactory $scobj_hpath/sensor/value plain internal float
|
||||
hsetprop $scobj_hpath/sensor/value read ${ns}::getValue rdValue "in_pv_00"
|
||||
hsetprop $scobj_hpath/sensor/value read ${ns}::getValue rdValue "in_pv_02"
|
||||
hsetprop $scobj_hpath/sensor/value rdValue ${ns}::rdValue
|
||||
hsetprop $scobj_hpath/sensor/value oldval UNKNOWN
|
||||
hsetprop $scobj_hpath/sensor/value units "C"
|
||||
hfactory $scobj_hpath/sensor/start_temperature plain user float
|
||||
hfactory $scobj_hpath/sensor/end_temperature plain user float
|
||||
proc ${ns}::OnFirstSave {} [subst -nocommands {
|
||||
hset $scobj_hpath/sensor/start_temperature [hval $scobj_hpath/sensor/value]
|
||||
hset $scobj_hpath/sensor/end_temperature [hval $scobj_hpath/sensor/value]
|
||||
}]
|
||||
proc ${ns}::OnLastSave {} [subst -nocommands {
|
||||
hset $scobj_hpath/sensor/end_temperature [hval $scobj_hpath/sensor/value]
|
||||
}]
|
||||
::nexus::OnFirstSave ${ns}::OnFirstSave
|
||||
::nexus::OnLastSave ${ns}::OnLastSave
|
||||
|
||||
hfactory $scobj_hpath/heating_power_percent plain internal float
|
||||
hsetprop $scobj_hpath/heating_power_percent read ${ns}::getValue rdValue "in_pv_01"
|
||||
@@ -328,7 +342,7 @@ namespace eval ::scobj::lh45 {
|
||||
hsetprop $scobj_hpath/sensor/value sdsinfo ::nexus::scobj::sdsinfo
|
||||
|
||||
hsetprop $scobj_hpath privilege spy
|
||||
::scobj::hinitprops $tempobj setpoint
|
||||
::scobj::hinitprops $tempobj setpoint sensor/start_temperature sensor/end_temperature
|
||||
if {[SplitReply [environment_simulation]]=="false"} {
|
||||
ansto_makesctdrive ${tempobj}_driveable $scobj_hpath/setpoint $scobj_hpath/sensor/value $sct_controller
|
||||
}
|
||||
|
||||
@@ -8,7 +8,11 @@ namespace eval ::scobj::positmotor { }
|
||||
##
|
||||
# @brief Translate and report the current motor reading.
|
||||
proc ::scobj::positmotor::rptVal {val2IDXfn table precision_node} {
|
||||
if [ catch {
|
||||
set newVal [$val2IDXfn [sct result] [hval $precision_node] $table]
|
||||
} msg ] {
|
||||
set newVal 99999
|
||||
}
|
||||
if {[sct oldval] != $newVal} {
|
||||
sct update $newVal
|
||||
sct oldval $newVal
|
||||
|
||||
@@ -23,6 +23,10 @@ sicslist setatt nexus_datatype mutable false
|
||||
namespace eval nexus {
|
||||
nexus_datatype "UNKNOWN"
|
||||
set exports [list newfile closefile save data newfile_collection save_collection]
|
||||
proc estartSetVal {} { estart [sicstime] }
|
||||
proc eendSetVal {} { eend [sicstime] }
|
||||
set FirstSaveList [list estartSetVal eendSetVal]
|
||||
set LastSaveList {list eendSetVal}
|
||||
eval namespace export $exports
|
||||
if 0 {datafilename}
|
||||
|
||||
@@ -74,6 +78,33 @@ proc getVal {cmd_output} {
|
||||
return [string trim [lindex [split $cmd_output =] 1 ] ]
|
||||
}
|
||||
|
||||
##
|
||||
# @brief Registers a list of procs/commands to call on the first save to a data file
|
||||
proc ::nexus::OnFirstSave {args} {
|
||||
lappend ::nexus::FirstSaveList $args
|
||||
}
|
||||
|
||||
##
|
||||
# @brief Registers a list of procs/commands to call on the last save to a data file
|
||||
proc ::nexus::OnLastSave {args} {
|
||||
lappend ::nexus::LastSaveList $args
|
||||
}
|
||||
|
||||
##
|
||||
# @brief Executes the list of procs registered with OnFirstSave
|
||||
proc ::nexus::CallSSProcs {} {
|
||||
foreach cmd $::nexus::FirstSaveList {
|
||||
eval $cmd
|
||||
}
|
||||
}
|
||||
|
||||
##
|
||||
# @brief Executes the list of procs registered with OnLastSave
|
||||
proc ::nexus::CallESProcs {} {
|
||||
foreach cmd $::nexus::LastSaveList {
|
||||
eval $cmd
|
||||
}
|
||||
}
|
||||
proc ::nexus::datapath {} {
|
||||
return [SplitReply [sicsdatapath]]
|
||||
}
|
||||
@@ -443,8 +474,8 @@ proc ::nexus::save {{point 0}} {
|
||||
set isNewFile($data_label) "false"
|
||||
::nexus::createfile $currFilename($data_label)
|
||||
dataFileName $currFilename($data_label)
|
||||
estart [sicstime]
|
||||
eend [sicstime]
|
||||
|
||||
::nexus::CallSSProcs
|
||||
array unset start_seconds_array
|
||||
set start_seconds [clock seconds]
|
||||
# set start_seconds_array($data_label) $start_seconds
|
||||
@@ -457,7 +488,8 @@ proc ::nexus::save {{point 0}} {
|
||||
nxscript updatedictvar pa_entryName $entryName
|
||||
::nexus::save_data $point newfile
|
||||
} else {
|
||||
eend [sicstime]
|
||||
|
||||
::nexus::CallESProcs
|
||||
# timestamp [expr {[clock seconds] - $start_seconds_array($data_label)}]
|
||||
timestamp [expr {[clock seconds] - $start_seconds}]
|
||||
dataFileName $currFilename($data_label)
|
||||
@@ -1250,7 +1282,7 @@ set nx_content_release_tag [lindex $tmpstr [expr [llength $tmpstr] - 1]]
|
||||
sics_release $nx_content_release_tag
|
||||
sics_release lock
|
||||
|
||||
set tmpstr [string map {"$" ""} {$Revision: 1.51.2.13 $}]
|
||||
set tmpstr [string map {"$" ""} {$Revision: 1.51.2.14 $}]
|
||||
set nx_content_revision_num [lindex $tmpstr [expr [llength $tmpstr] - 1]]
|
||||
|
||||
#namespace eval data {
|
||||
|
||||
@@ -2,6 +2,7 @@ config/source/source_common.tcl
|
||||
config/anticollider/anticollider_common.tcl
|
||||
config/plc/plc_common_1.tcl
|
||||
config/counter/counter_common_1.tcl
|
||||
config/environment/temperature/sct_eurotherm_2000.tcl
|
||||
config/environment/temperature/lakeshore340_common.tcl
|
||||
config/environment/temperature/sct_lakeshore_3xx.tcl
|
||||
config/environment/temperature/west400.tcl
|
||||
|
||||
@@ -7,27 +7,34 @@ switch $envtemp {
|
||||
}
|
||||
"rhqc" {
|
||||
puts "Configuring RHQC"
|
||||
::environment::temperature::add_ls340 tc1 137.157.202.85 1
|
||||
tc1 controlsensor sensorB
|
||||
add_sct_ls340 tc1 ca5-[instname] 4001 "\r" 0.5 5.0
|
||||
|
||||
if { [SplitReply [environment_simulation]] == "false"} {
|
||||
tc1 controlsensor sensorB
|
||||
}
|
||||
puts "Added tc1 with [tc1 controlsensor]"
|
||||
::environment::temperature::add_ls340 tc2 137.157.202.85 2
|
||||
tc2 controlsensor sensorD
|
||||
add_sct_ls340 tc2 ca5-[instname] 4002 "\r" 0.5 5.0
|
||||
if { [SplitReply [environment_simulation]] == "false"} {
|
||||
tc2 controlsensor sensorD
|
||||
}
|
||||
puts "Added tc2 with [tc2 controlsensor]"
|
||||
}
|
||||
"11TMagnet" {
|
||||
puts "Configuring 11TMagnet"
|
||||
::environment::temperature::add_ls340 tc1 137.157.202.85 1
|
||||
::utility::macro::getset float temperature {} {
|
||||
return [sicsmsgfmt [hval /sample/tc1_cntrl/sensora/value]]
|
||||
add_sct_ls340 tc1 ca5-[instname] 4001 "\r" 0.5 5.0
|
||||
if { [SplitReply [environment_simulation]] == "false"} {
|
||||
::utility::macro::getset float temperature {} {
|
||||
return [sicsmsgfmt [hval /sample/tc1_cntrl/sensora/value]]
|
||||
}
|
||||
sicslist setatt temperature long_name temperature
|
||||
sicslist setatt temperature klass sample
|
||||
sicslist setatt temperature units K
|
||||
tc1 controlsensor sensorA
|
||||
}
|
||||
sicslist setatt temperature long_name temperature
|
||||
sicslist setatt temperature klass sample
|
||||
sicslist setatt temperature units K
|
||||
tc1 controlsensor sensorA
|
||||
|
||||
}
|
||||
default {
|
||||
clientput "No temperature controller configured"
|
||||
clientput "Unknown environment controller $envtemp"
|
||||
}
|
||||
}
|
||||
} msg ] {
|
||||
|
||||
@@ -30,9 +30,9 @@ array set guide_configuration {
|
||||
mt {{MT MT MT MT MT MT MT MT MT} 675}
|
||||
lp {{MT MT MT MT MT MT MT MT LP} 675}
|
||||
lens {{MT MT MT MT MT MT MT MT L } 675}
|
||||
p1 {{P A MT MT MT MT MT MT MT} 675}
|
||||
p1lp {{P A MT MT MT MT MT MT LP} 675}
|
||||
p1lens {{P A MT MT MT MT MT MT L } 675}
|
||||
p1 {{P A MT MT MT MT MT MT MT} 4621}
|
||||
p1lp {{P A MT MT MT MT MT MT LP} 4621}
|
||||
p1lens {{P A MT MT MT MT MT MT L } 4621}
|
||||
g1 {{G A A A A A A A A } 4929}
|
||||
p2 {{P G A A A A A A A } 6934}
|
||||
g2 {{G G A A A A A A A } 6934}
|
||||
|
||||
@@ -54,7 +54,8 @@ proc ::scobj::hinitprops {scobj args} {
|
||||
::scobj::hinit_scobjprops $scobj $hpath
|
||||
foreach p $args {
|
||||
set hpath /sics/$scobj/$p
|
||||
::scobj::hinit_nodeprops ${scobj}_$p $hpath
|
||||
set idPath [string map {/ _} $p]
|
||||
::scobj::hinit_nodeprops ${scobj}_$idPath $hpath
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user