From 0c6e24747f80a07a8f71c2cc93f2f981e47a082f Mon Sep 17 00:00:00 2001 From: Ferdi Franceschini Date: Wed, 7 Nov 2007 15:47:34 +1100 Subject: [PATCH] Make the default frame source setting instrument specific r2240 | ffr | 2007-11-07 15:47:34 +1100 (Wed, 07 Nov 2007) | 2 lines --- .../config/hmm/hmm_configuration_common_1.tcl | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/site_ansto/instrument/config/hmm/hmm_configuration_common_1.tcl b/site_ansto/instrument/config/hmm/hmm_configuration_common_1.tcl index 835ea747..dab851a9 100644 --- a/site_ansto/instrument/config/hmm/hmm_configuration_common_1.tcl +++ b/site_ansto/instrument/config/hmm/hmm_configuration_common_1.tcl @@ -1,5 +1,5 @@ -# $Revision: 1.24 $ -# $Date: 2007-11-06 03:43:46 $ +# $Revision: 1.25 $ +# $Date: 2007-11-07 04:47:34 $ # 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 @@ -949,12 +949,31 @@ proc ::histogram_memory::get_frame_freq {} { # if you are setting the frequency from a chopper which is stopped. proc ::histogram_memory::set_frame_freq {freq {frame_source INTERNAL}} { variable state + # 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 + } if {[string is double $freq] == 0 || $freq < 0} { return -code error "Frequency must be a non-negative floating point number" } #TODO Add tolerance parameters to choppercontroller if {abs($freq - 0) <= [expr {2.0/60.0}]} { - hmm configure fat_frame_source INTERNAL + set zf_frame_source $frame_source_on_zero_freq([instname]) + if {$zf_frame_source == "INTERNAL"} { + clientput "WARNING: A histmem frame frequency of zero was requested, setting frequency to 50Hz instead" value + } else { + clientput "WARNING: A histmem frame frequency of zero was requested, setting frequency to 50Hz instead" value + clientput "WARNING: You must provide an external oscillator" value + } + hmm configure fat_frame_source $zf_frame_source set newfreq 50 } else { hmm configure fat_frame_source [string toupper $frame_source]