# GMS.txt, an Acquisifier script. # Copyright (C) 2006 Raphael Tieulent, Institut de Physique NuclÂŽaire de Lyon # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # This acquisifier step declares the name of a results # file and over-writes any existing file of that name with # and empty file. acquisifier: post_processing: { if { [array names info -exact "cycle_num"] == "" } { set info(cycle_num) 0 } if { [array names info -exact "num_cycles"] == "" } { set info(num_cycles) 1 } if { [array names config -exact "run_num"] == "" } { set config(run_num) 1 } if {$info(control) == "Run"} { incr config(run_num) set config(run_results) [file join [file dirname $config(run_results)] Acquisifier_Run_[format %04d $config(run_num)].dat] } if {($info(control) == "Repeat_Run") && ($info(cycle_num) == 0) } { incr config(run_num) set config(run_results) [file join [file dirname $config(run_results)] Acquisifier_Run_[format %04d $config(run_num)].dat] } if {$info(control) == "Repeat_Run"} { incr info(cycle_num) if {$info(cycle_num) > $info(num_cycles)} { set info(cycle_num) 1 incr config(run_num) set config(run_results) [file join [file dirname $config(run_results)] Acquisifier_Run_[format %04d $config(run_num)].dat] } } set w $info(window)_control if {[winfo exists $w]} { } { toplevel $w wm title $w "$info(name) Version $info(version) Control" set f $w.setup2 frame $f pack $f -side top -fill x label $f.l1 -text "Run Number" -width 10 entry $f.l2 -textvariable $info(name)_config(run_num) -width 5 label $f.l3 -text "Cycle" -width 5 entry $f.l4 -textvariable $info(name)_info(cycle_num) -width 4 label $f.l5 -text "of" -width 2 entry $f.l6 -textvariable $info(name)_info(num_cycles) -width 4 pack $f.l1 $f.l2 $f.l3 $f.l4 $f.l5 $f.l6 -side left } } config: cycle_period_seconds 20 end. # This default step declares default post-processing for the BCAM # instrument. This default post-processing creates its own results # string, which it stores to the run results file created by the # preceeding acquisifier step's post-processing. The post-processing # stores the BCAM image in the same directory as the run results, # under the name of the BCAM instrument with ".lwdaq" as an extension. # The previously-stored image will be over-written. The run results # directory will contain the most recently-taken image from each BCAM # instrument. The post-processing over-writes the Acquisifier's # result variable with contents extracted from that variable. If # the Acquisifier is set to upload its step results, it will upload # this modified result instead of its original result. default: instrument: BCAM default_post_processing: { if {![LWDAQ_is_error_result $result]} { set result "$name \ [clock seconds] \ [lrange $result 1 2] \ [lrange [lwdaq_image_characteristics $iconfig(memory_name)] 4 7] \ $iconfig(daq_flash_seconds)" } { set result "$name \ [clock seconds] \ $result" } set f [open $config(run_results) a] puts $f $result close $f LWDAQ_print $info(text) "Appended modified result to [file tail $config(run_results)]." blue set fn [file join [file dirname $config(run_results)] $name\.lwdaq] LWDAQ_write_image_file $iconfig(memory_name) $fn LWDAQ_print $info(text) "Saved raw image to [file tail $fn]" } config: image_source daq analysis_enable 1 analysis_num_spots 2 daq_adjust_flash 1 daq_ip_addr 129.64.37.79 daq_source_ip_addr * ambient_exposure_seconds 0 intensify exact daq_mux_socket 1 daq_source_mux_socket 1 end. default: instrument: Rasnik config: image_source daq analysis_enable 1 daq_ip_addr 129.64.37.79 daq_source_ip_addr * intensify exact analysis_square_size 120 daq_mux_socket 1 daq_source_mux_socket 1 daq_device_type 2 daq_source_device_type 1 end. default: instrument: Thermometer config: image_source daq analysis_enable 1 daq_ip_addr 129.64.37.79 daq_mux_socket 1 end. acquire: name: Thermometer_1 instrument: Thermometer result: None time: 0 config: daq_driver_socket 4 daq_device_element "1 2 3 4 5 6 7" daq_device_name A2053 end. acquire: name: BCAM_1_2 instrument: BCAM result: None time: 0 config: daq_flash_seconds 0.001 daq_driver_socket 5 daq_device_element 2 daq_source_device_element "3 4" daq_source_driver_socket 8 daq_image_left 20 daq_image_top 1 daq_image_right 343 daq_image_bottom 243 end. acquire: name: Rasnik_1 instrument: Rasnik result: None time: 0 config: daq_flash_seconds 0.01 daq_driver_socket 6 daq_device_element 2 daq_source_device_element 1 daq_source_driver_socket 7 end. acquire: name: BCAM_2_1 instrument: BCAM result: None time: 0 config: daq_flash_seconds 0 daq_driver_socket 8 daq_device_element 2 daq_source_device_element "3 4" daq_source_driver_socket 5 daq_image_left 20 daq_image_top 1 daq_image_right 343 daq_image_bottom 243 end. acquire: name: Rasnik_2 instrument: Rasnik result: None time: 0 config: daq_flash_seconds 0.001 daq_driver_socket 6 daq_device_element 2 daq_source_device_element 1 daq_source_driver_socket 7 end. acquire: name: Power_Cycle instrument: Diagnostic result: None time: 0 config: daq_actions "off 1000 on 1000" end. extract: script_file: Acquisifier_Extractor.tcl output_file: Acquisifier_Extracted.txt output_type: write config: end. acquisifier: post_processing: { if { $info(control) == "Repeat_Run" } { if {$info(cycle_num) == $info(num_cycles)} { Acquisifier_save LWDAQ_print $info(text) "\nEnd" $config(title_color) set info(control) "Stop" set info(cycle_num) 0 } } } config: end.