75 lines
2.0 KiB
Tcl
75 lines
2.0 KiB
Tcl
# 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_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 + 1]
|
|
}
|
|
|
|
clientput "Acquisition completed."
|
|
|
|
}
|
|
Publish histmem_acquire_period_sequence User
|
|
|
|
|