pelican
Create pas/config/source/source.tcl config/source/source_common.tcl pelican_configuration.tcl deploySICS.sh Don't deploy script validator configs, they are obsolete server_config.tcl Source config has been moved to config/source and is specialised for each instrument by calling the instrument specific initialiser ::source:isc_initalize commands_common_1.tcl The monitor mode and preset are recorded when running the count command counter_common_1.tcl Report and record the counts and time for the multicounter and each monitor. Also record the mode and preset for the multicounter. hmm_configuration_common_1.tcl Cleanup, remove obsolete code. Report and record the hmm total counts and time. Allow monitor controlled acquisition from the histogram server nxscripts_common_1.tcl Add DataType to NXdata section, preserve case in text attributes. scan_common_1.tcl Provide sensible feedback for our bmonscan and hmscan objects. Set run_mode when doing a scan. Allow users to select the datatype for histmem scans and to force a scan wombat_configuration.tcl echidna_configuration.tcl platypus_configuration.tcl kowari_configuration.tcl quokka_configuration.tcl Load source config. quokka_configuration.tcl SICS-198 HACK, Add AttrotDeg and RotApDeg status feedback. sans/commands/commands.tcl Add status feedback for quokka "guide" command. sans/parameters/parameters.tcl Make sure data can be saved as xml (replace % with _percent) SICS-198 HACK, add AttRotDeg and RotApDeg status feedback. utility.tcl Fix nasty "params array generator" bug. SICS commands execute at runlevel 0 which means that the params anonymous array must be made at this level. Provide the normalattlist command to enable creating attribute lists with the case preserved. Added the runsics, runtestsics and sicsclient scripts to CVS. Added source configurations for echidna, wombat, kowari, quokka, platypus, and pelican to CVS r2644 | ffr | 2008-07-11 11:09:57 +1000 (Fri, 11 Jul 2008) | 53 lines
This commit is contained in:
committed by
Douglas Clowes
parent
b4fb916018
commit
01be487c52
@@ -1,5 +1,5 @@
|
||||
# $Revision: 1.33 $
|
||||
# $Date: 2008-07-01 07:02:26 $
|
||||
# $Revision: 1.34 $
|
||||
# $Date: 2008-07-11 01:09:56 $
|
||||
# Author: Ferdi Franceschini
|
||||
# Based on the examples in the hs_test.tcl sample configuration by Mark Lesha.
|
||||
# http://gumtree.ansto.gov.au:9080/nbicms/bragg-systems/histogram-server/hs_test.tcl/view
|
||||
@@ -18,6 +18,8 @@ namespace eval histogram_memory {
|
||||
# Common config variables
|
||||
variable histmem_simulation
|
||||
variable ic_count_methods
|
||||
variable preset_mult
|
||||
variable monitor_controlled
|
||||
|
||||
# Instrument Specific Config variables
|
||||
|
||||
@@ -95,13 +97,13 @@ namespace eval histogram_memory {
|
||||
|
||||
array set default_frame_source_always_internal {
|
||||
echidna "true"
|
||||
koala "false"
|
||||
kowari "false"
|
||||
pelican "false"
|
||||
platypus "false"
|
||||
quokka "false"
|
||||
taipan "false"
|
||||
wombat "false"
|
||||
koala "false"
|
||||
kowari "false"
|
||||
pelican "false"
|
||||
platypus "false"
|
||||
quokka "false"
|
||||
taipan "false"
|
||||
wombat "false"
|
||||
}
|
||||
|
||||
::utility::mkVar detector_active_height_mm Float user active_height true detector true true
|
||||
@@ -112,16 +114,7 @@ namespace eval histogram_memory {
|
||||
::utility::mkVar hmm_user_configpath Text manager user_configpath false detector false false
|
||||
hmm_user_configpath ../user_config/hmm
|
||||
::utility::mkVar hmm_mode Text user mode true detector true true
|
||||
::utility::mkVar _hmm_vert_axis Text user vert_axis true detector false true
|
||||
::utility::mkVar _hmm_hor_axis Text user hor_axis true detector false true
|
||||
::utility::mkVar _hmm_hor_axis_alias Text user hor_axis_alias true detector false true
|
||||
::utility::mkVar _hmm_vert_axis_alias Text user vert_axis_alias true detector false true
|
||||
::utility::mkVar _hmm_hor_channel_name Text user hor_channel_name true detector false true
|
||||
_hmm_vert_axis y_pixel_offset
|
||||
_hmm_vert_axis_alias dvaxis
|
||||
_hmm_hor_axis polar_angle
|
||||
_hmm_hor_axis_alias dtheta
|
||||
_hmm_hor_channel_name horizontal_channel_number
|
||||
::utility::mkVar hmm_preset Float user preset true detector true true
|
||||
} message ] {
|
||||
if {$::errorCode=="NONE"} {return $message}
|
||||
return -code error $message
|
||||
@@ -1549,6 +1542,33 @@ proc ::histogram_memory::t_max {} {
|
||||
return -code error $message
|
||||
}
|
||||
}
|
||||
|
||||
##
|
||||
# @brief Total counts in histogram defined by the OAT table.
|
||||
::utility::macro::getset int ::histogram_memory::total_counts {} {
|
||||
return "total_counts = [SplitReply [hmm configure num_events_filled_to_histo]]"
|
||||
}
|
||||
sicslist setatt ::histogram_memory::total_counts klass detector
|
||||
sicslist setatt ::histogram_memory::total_counts long_name total_counts
|
||||
sicslist setatt ::histogram_memory::total_counts mutable true
|
||||
|
||||
##
|
||||
# @brief Histogram memory acquisition time
|
||||
::utility::macro::getset float ::histogram_memory::time {} {
|
||||
return "time = [SplitReply [hmm configure acq_dataset_active_sec]]"
|
||||
}
|
||||
sicslist setatt ::histogram_memory::time klass detector
|
||||
sicslist setatt ::histogram_memory::time long_name time
|
||||
sicslist setatt ::histogram_memory::time mutable true
|
||||
sicslist setatt ::histogram_memory::time units seconds
|
||||
|
||||
##
|
||||
# @brief Update the beam monitors when the histmem has finished counting.
|
||||
proc ::histogram_memory::update_bm {} {
|
||||
bm status
|
||||
}
|
||||
publish ::histogram_memory::update_bm user
|
||||
|
||||
##
|
||||
# @brief Sets histogram server to default configuration, initialises SICS histogram memory
|
||||
# dictionary values and clears SICS OAT BAT CAT FAT ... tables
|
||||
@@ -1570,14 +1590,6 @@ proc ::histogram_memory::ic_initialize {} {
|
||||
sicslist setatt $bm_status long_name $bm_status
|
||||
sicslist setatt $bm_status mutable false
|
||||
|
||||
set bm_counts bm${bm_num}_counts
|
||||
::utility::macro::getset int $bm_counts {} [subst -nocommands {
|
||||
return "$bm_counts = [lindex [hmm configure $bm_counts] 2]"
|
||||
}]
|
||||
sicslist setatt $bm_counts klass monitor
|
||||
sicslist setatt $bm_counts long_name $bm_counts
|
||||
sicslist setatt $bm_counts mutable true
|
||||
|
||||
set bm_event_rate bm${bm_num}_event_rate
|
||||
::utility::macro::getset float $bm_event_rate {} [subst -nocommands {
|
||||
return "$bm_event_rate = [lindex [hmm configure $bm_event_rate] 2]"
|
||||
@@ -1618,6 +1630,7 @@ proc ::histogram_memory::ic_initialize {} {
|
||||
hmm configure hmDataPath ../HMData
|
||||
hmm configure hmconfigscript $configuration
|
||||
::histogram_memory::configure_dims
|
||||
scriptcallback connect hmm COUNTEND ::histogram_memory::update_bm
|
||||
} message ] {
|
||||
if {$::errorCode=="NONE"} {return $message}
|
||||
return -code error $message
|
||||
@@ -1644,6 +1657,8 @@ proc ::histogram_memory::post_count {} {}
|
||||
# @param block (optional) default="noblock"
|
||||
proc ::histogram_memory::start {{blocking "noblock"}} {
|
||||
variable histmem_simulation
|
||||
variable monitor_controlled
|
||||
|
||||
if [ catch {
|
||||
set options [list block noblock]
|
||||
if {[lsearch $options $blocking] == -1} {
|
||||
@@ -1651,7 +1666,11 @@ proc ::histogram_memory::post_count {} {}
|
||||
}
|
||||
::histogram_memory::pre_count
|
||||
hmm init
|
||||
hmc start 1000000000 timer pause 1
|
||||
if {$monitor_controlled == "true"} {
|
||||
hmm count
|
||||
} else {
|
||||
hmc start 1000000000 timer pause 1
|
||||
}
|
||||
set reply [SplitReply [hmm configure daq]]
|
||||
if {$histmem_simulation==false && $reply != "Started"} {
|
||||
error "ERROR: Histogram server failed to start"
|
||||
@@ -1659,7 +1678,7 @@ proc ::histogram_memory::post_count {} {}
|
||||
clientput "histmem started" value
|
||||
if {$blocking == "block"} {
|
||||
blockctr count 0
|
||||
::histogram_memory::pause
|
||||
::histogram_memory::pause
|
||||
}
|
||||
} message ] {
|
||||
if {$::errorCode=="NONE"} {return $message}
|
||||
@@ -1717,6 +1736,8 @@ proc ::histogram_memory::post_count {} {}
|
||||
# @param method Set histmem mode or return current mode if blank
|
||||
proc ::histogram_memory::count_method {{method ""}} {
|
||||
variable ic_count_methods
|
||||
variable preset_mult
|
||||
variable monitor_controlled
|
||||
|
||||
if [ catch {
|
||||
set modes $ic_count_methods
|
||||
@@ -1726,10 +1747,21 @@ proc ::histogram_memory::post_count {} {}
|
||||
if {[lsearch $modes $method] == -1} {
|
||||
error "ERROR: Count mode, $method, must be one of $modes"
|
||||
}
|
||||
if {$method == "time"} {
|
||||
set preset_mult 100
|
||||
} else {
|
||||
set preset_mult 1
|
||||
}
|
||||
hmm configure FAT_COUNT_METHOD $method
|
||||
if {[string range $method 0 [string first "R_" $method]] == "MONITOR"} {
|
||||
hmm configure FAT_${method}_CONTROL ENABLE
|
||||
set bmchan [expr [string index $method end] - 1]
|
||||
bm setchannel $bmchan
|
||||
set monitor_controlled "true"
|
||||
} else {
|
||||
set monitor_controlled "false"
|
||||
}
|
||||
hmm stop
|
||||
hmm init
|
||||
hmm_mode $method
|
||||
}
|
||||
@@ -1746,6 +1778,8 @@ proc ::histogram_memory::post_count {} {}
|
||||
# @see count_method
|
||||
proc ::histogram_memory::count_size {{preset ""}} {
|
||||
variable state
|
||||
variable preset_mult
|
||||
|
||||
if [ catch {
|
||||
if {$preset == ""} {
|
||||
return $state(preset)
|
||||
@@ -1753,9 +1787,10 @@ proc ::histogram_memory::post_count {} {}
|
||||
if {[string is double $preset] == 0 || $preset < 0} {
|
||||
error "ERROR: The preset must be a non-negative floating point number"
|
||||
}
|
||||
hmm configure FAT_COUNT_SIZE [expr {100.0 * $preset}]
|
||||
hmm configure FAT_COUNT_SIZE [expr {$preset_mult * $preset}]
|
||||
hmm init
|
||||
set state(preset) $preset
|
||||
hmm_preset $preset
|
||||
}
|
||||
} message ] {
|
||||
if {$::errorCode=="NONE"} {return $message}
|
||||
|
||||
Reference in New Issue
Block a user