Merged configuration from release 2.0P1

Added appropriate defaults for frame source for each instrument.

r2619 | ffr | 2008-06-10 14:40:30 +1000 (Tue, 10 Jun 2008) | 3 lines
This commit is contained in:
Ferdi Franceschini
2008-06-10 14:40:30 +10:00
committed by Douglas Clowes
parent d495c3b43a
commit 3d3ecdd83e

View File

@@ -1,5 +1,5 @@
# $Revision: 1.30 $ # $Revision: 1.31 $
# $Date: 2008-05-30 00:26:54 $ # $Date: 2008-06-10 04:40:30 $
# Author: Ferdi Franceschini # Author: Ferdi Franceschini
# Based on the examples in the hs_test.tcl sample configuration by Mark Lesha. # 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 # http://gumtree.ansto.gov.au:9080/nbicms/bragg-systems/histogram-server/hs_test.tcl/view
@@ -59,6 +59,30 @@ hmm_t configure rank 1
namespace eval histogram_memory { namespace eval histogram_memory {
# Frame source for each instrument if freq = 0, this can happen when automatically
# setting frequencies from choppers.
array set default_frame_source_when_there_is_no_frame_signal {
echidna INTERNAL
koala INTERNAL
kowari EXTERNAL
pelican INTERNAL
platypus EXTERNAL
quokka INTERNAL
taipan INTERNAL
wombat INTERNAL
}
array set default_frame_source_always_internal {
echidna "true"
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 ::utility::mkVar detector_active_height_mm Float user active_height true detector true true
sicslist setatt detector_active_height_mm units mm sicslist setatt detector_active_height_mm units mm
::utility::mkVar detector_active_width_mm Float user active_width true detector true true ::utility::mkVar detector_active_width_mm Float user active_width true detector true true
@@ -1093,7 +1117,7 @@ proc OAT_TABLE {args} {
# Only one element, ie SPLIT with no content just attributes. # Only one element, ie SPLIT with no content just attributes.
proc SAT_TABLE {args} { proc SAT_TABLE {args} {
if [ catch { if [ catch {
set attributes { APPLY MIDPOINT } set attributes { APPLY MIDPOINT DIRECTION WRAP SWAP}
set elements {{ SPLIT }} set elements {{ SPLIT }}
set tag SAT set tag SAT
@@ -1108,7 +1132,7 @@ proc SAT_TABLE {args} {
HISTMEM_TABLE $attpath -allowed_attributes [concat $attributes $arglist] HISTMEM_TABLE $attpath -allowed_attributes [concat $attributes $arglist]
} }
"-set" { "-set" {
set allowed_atts [HISTMEM_TABLE $tag -allowed_attributes] set allowed_atts [HISTMEM_TABLE $attpath -allowed_attributes]
set allowed_els [HISTMEM_TABLE $tag -allowed_elements] set allowed_els [HISTMEM_TABLE $tag -allowed_elements]
foreach {arg val} $arglist { foreach {arg val} $arglist {
set index [lsearch -exact $allowed_els $arg] set index [lsearch -exact $allowed_els $arg]
@@ -1120,13 +1144,13 @@ proc SAT_TABLE {args} {
set index [lsearch -exact $allowed_atts $attname] set index [lsearch -exact $allowed_atts $attname]
if {$index >= 0} { if {$index >= 0} {
incr index incr index
HISTMEM_TABLE $tag -setatt $attname $val HISTMEM_TABLE $attpath -setatt $attname $val
} }
} }
} }
} }
"-get" { "-get" {
set allowed_atts [HISTMEM_TABLE $tag -allowed_attributes] set allowed_atts [HISTMEM_TABLE $attpath -allowed_attributes]
set allowed_els [HISTMEM_TABLE $tag -allowed_elements] set allowed_els [HISTMEM_TABLE $tag -allowed_elements]
foreach arg $arglist { foreach arg $arglist {
set index [lsearch -exact $allowed_els $arg] set index [lsearch -exact $allowed_els $arg]
@@ -1458,27 +1482,16 @@ proc ::histogram_memory::get_frame_freq {} {
# if you are setting the frequency from a chopper which is stopped. # if you are setting the frequency from a chopper which is stopped.
proc ::histogram_memory::set_frame_freq {freq {frame_source EXTERNAL}} { proc ::histogram_memory::set_frame_freq {freq {frame_source EXTERNAL}} {
variable state variable state
variable default_frame_source_when_there_is_no_frame_signal
if [ catch { if [ catch {
if {[string is double $freq] == 0 || $freq < 0} { if {[string is double $freq] == 0 || $freq < 0} {
error "ERROR: Frequency must be a non-negative floating point number" error "ERROR: Frequency must be a non-negative floating point number"
} }
# Frame source for each instrument if freq = 0, this can happen when automatically
# setting frequencies from choppers.
array set frame_source_on_zero_freq {
echidna INTERNAL
koala INTERNAL
kowari EXTERNAL
pelican INTERNAL
platypus EXTERNAL
quokka INTERNAL
taipan INTERNAL
wombat INTERNAL
}
#TODO Add tolerance parameters to choppercontroller #TODO Add tolerance parameters to choppercontroller
if {abs($freq - 0) <= [expr {2.0/60.0}]} { if {abs($freq - 0) <= [expr {2.0/60.0}]} {
set zf_frame_source $frame_source_on_zero_freq([instname]) set zf_frame_source $default_frame_source_when_there_is_no_frame_signal([instname])
if {$zf_frame_source == "INTERNAL"} { if {$zf_frame_source == "INTERNAL"} {
clientput "WARNING: A histmem frame frequency of zero was requested, setting frequency to 50Hz instead" value clientput "WARNING: A histmem frame frequency of zero was requested, setting frequency to 50Hz instead" value
} else { } else {
@@ -1514,6 +1527,9 @@ proc ::histogram_memory::t_max {} {
# @brief Sets histogram server to default configuration, initialises SICS histogram memory # @brief Sets histogram server to default configuration, initialises SICS histogram memory
# dictionary values and clears SICS OAT BAT CAT FAT ... tables # dictionary values and clears SICS OAT BAT CAT FAT ... tables
proc ::histogram_memory::_initialize {} { proc ::histogram_memory::_initialize {} {
variable default_frame_source_when_there_is_no_frame_signal
variable default_frame_source_always_internal
set ::errorInfo "" set ::errorInfo ""
if [ catch { if [ catch {
set configuration "::histogram_memory::returnconfigfile config/hmm/anstohm_linked.xml" set configuration "::histogram_memory::returnconfigfile config/hmm/anstohm_linked.xml"
@@ -1536,8 +1552,9 @@ proc ::histogram_memory::_initialize {} {
hmm configure statuscheck true hmm configure statuscheck true
hmm stop hmm stop
hmm configure statuscheck false hmm configure statuscheck false
::histogram_memory::frame_source_always_internal false ::histogram_memory::frame_source_always_internal $default_frame_source_always_internal([instname])
::histogram_memory::set_frame_freq 50 ::histogram_memory::set_frame_freq 50
::histogram_memory::set_frame_source $default_frame_source_when_there_is_no_frame_signal([instname])
::histogram_memory::count_method unlimited ::histogram_memory::count_method unlimited
::histogram_memory::count_size 0 ::histogram_memory::count_size 0
hmm configure hmDataPath ../HMData hmm configure hmDataPath ../HMData