Merged changes made in-situ

r2768 | ffr | 2009-03-31 17:25:20 +1100 (Tue, 31 Mar 2009) | 2 lines
This commit is contained in:
Ferdi Franceschini
2009-03-31 17:25:20 +11:00
committed by Douglas Clowes
parent d2f57e4615
commit 8e5b7842e3
17 changed files with 471 additions and 229 deletions

View File

@@ -0,0 +1,95 @@
# Test script for multi period acquisition and saving.
set nos_periods 1
proc histmem_period_single { } {
# Because bugs may not yet have been corrected in hmm_configuration_common_1.tcl,
# apply the default settings before attempting del/clear.
global nos_periods
set nos_periods 1
FAT_TABLE -set NOS_PERIODS 1
FAT_TABLE -del NOS_PERIODS
BAT_TABLE -set PERIOD_INDICES { 0 } NO_BAT_ENTRIES 1 NO_BAT_PERIODS 1 NO_REPEAT_ENTRY 0 NO_REPEAT_TABLE 0 NO_EXECUTE_TABLE 0
BAT_TABLE -clear
}
Publish histmem_period_single User
proc histmem_period_sequence { Np Nf } {
# Note - sequence needs to be at least 2 periods.
global nos_periods
set nos_periods $Np
FAT_TABLE -set NOS_PERIODS $Np
BAT_TABLE -set PERIOD_INDICES { 0 1 } NO_BAT_ENTRIES $Np NO_BAT_PERIODS $Np NO_REPEAT_ENTRY $Nf NO_REPEAT_TABLE 1 NO_EXECUTE_TABLE 1
}
Publish histmem_period_sequence User
proc histmem_save_period_sequence { } {
global nos_periods
newfile HISTOGRAM_XYT
for { set i 0 } { $i < $nos_periods } { incr i } {
hmm configure read_data_period_number $i
save $i
}
}
Publish histmem_save_period_sequence User
proc histmem_period_strobo {Freq Bins} {
global nos_bins
set nos_bins $Bins
set bintime [expr int(1000000./($Freq*$Bins))]
histmem fsrce EXTERNAL
set oatstr "OAT_TABLE -set T {0 $bintime} NTC $Bins"
# OAT_TABLE -set T { 0 $bintime } NTC $Bins
eval $oatstr
histmem loadconf
}
Publish histmem_period_strobo User
proc histmem_strobo_off {} {
histmem fsrce INTERNAL
OAT_TABLE -set T { 0 200000 } NTC 1
histmem loadconf
}
Publish histmem_strobo_off User
proc histmem_acquire_period_sequence { Np Nf } {
newfile HISTOGRAM_XYT
histmem stop
histmem_period_sequence $Np $Nf
histmem loadconf
histmem start
set dlytime [ expr int( 1000 * $Nf / 50. ) ]
# clientput "Waiting for" $dlytime "ms..."
after $dlytime
# clientput "tc1 reading is: " [tc1 get]
global nos_periods
for { set i 0 } { $i < $nos_periods } { incr i } {
# after $dlytime
# set current_period -1
# while { $current_period < $i } {
# update
# after 500
# # hmm count
# # hmm init 2
# clientput [hmm configure current_period]
# set current_period [lindex [split [hmm configure current_period] " "] 2]
# clientput "i = " $i " and the current period is " $current_period
# }
hmm configure read_data_period_number $i
save [expr $i]
}
clientput "Acquisition completed."
}
Publish histmem_acquire_period_sequence User