-
Notifications
You must be signed in to change notification settings - Fork 0
/
catcher4
executable file
·203 lines (188 loc) · 6.44 KB
/
catcher4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
#!/bin/csh -f
#*************************************************************************
# Copyright (c) 2002 The University of Chicago, as Operator of Argonne
# National Laboratory.
# Copyright (c) 2002 The Regents of the University of California, as
# Operator of Los Alamos National Laboratory.
# This file is distributed subject to a Software License Agreement found
# in the file LICENSE that is included with this distribution.
#*************************************************************************
#
# usage: catcher [-h -v -n -D -c test.config -d test.trashcan -e test.env ]
#
# Author: Ben-chin Cha
#
if ("$1" == "-h" | "$1" == "-help") then
goto help:
endif
set x = "" ; set y = ""; set z=""; set w=""; set v=""
set xf=""; set yf=""; set zf=""; set wf=""; set vf=""
set HOST_ARCH = `/usr/local/epics/startup/HostArch`
if ${?EPICS_EXTENSIONS_PVT} == 1 then
source $EPICS_EXTENSIONS_PVT/bin/$HOST_ARCH/ezcaidl_setup
else
source $EPICS_EXTENSIONS/bin/$HOST_ARCH/ezcaidl_setup
endif
source /usr/local/rsi/idl_5.4/bin/idl_setup
set exe = "-rt=$EPICS_EXTENSIONS/bin/$HOST_ARCH/catcher.exe2.idl53"
if ${?EPICS_EXTENSIONS_PVT} == 1 then
set exe = "-rt=$EPICS_EXTENSIONS_PVT/bin/$HOST_ARCH/catcher.exe2.idl53"
endif
if -e catcher.exe2.idl53 then
set exe = "-rt=catcher.exe2.idl53"
endif
# echo $exe
if -e catch1d.config then
cp catch1d.config catch1d.config.tmp
endif
while ( "$1" != "" )
if ( "$1" == "-n" | "$1" == "-N" | "$1" == "-Nosave" ) then
set w = 'nosave=1'
set wf = "scanData.nosave='1'"
shift
else if ( "$1" == "-v" | "$1" == "-V" | "$1" == "-ViewOnly" ) then
set v = 'viewonly=1'
set vf = "scanData.option='0'"
shift
else if ( "$1" == "-D" ) then
set exe =''
shift
else if ( "$1" == "-c" | "$1" == "-d" | "$1" == "-e" ) then
if ( "$2" == "") then
echo "Usage: catcher [-h] [-v] [-n] [-D] [-c config_file] [-d data_file] [-e env_file]"
echo ""
exit
endif
if ("$2" != "") then
switch("$1")
case -config:
case -c:
set x = 'config''="'$2'"'
set xf = "scanData.config=""'"$2"'"
if -e $2 then
cp $2 catch1d.config.tmp
else
echo "; New configuration file '" $2 "' will be created." >! catch1d.config.tmp
endif
breaksw
case -envfile:
case -e:
set y = 'envfile''="'$2'"'
set yf = "scanData.envfile=""'"$2"'"
breaksw
case -data:
case -d:
set z = 'data''="'$2'"'
set zf = "scanData.trashcan=""'"$2"'"
breaksw
default:
breaksw
endsw
shift; shift
endif
else
echo "Usage: catcher [-h] [-v] [-n] [-D] [-c config_file] [-d data_file] [-e env_file]"
echo ""
exit
endif
end
set xyz = "catcher_v1"
echo "" >! go_catcher
if ("$x" != "") then
set xyz = $xyz','$x
echo $xf >>! go_catcher
endif
if ("$y" != "") then
set xyz = $xyz','$y
echo $yf >>! go_catcher
endif
if ("$z" != "") then
set xyz = $xyz','$z
echo $zf >>! go_catcher
endif
if ("$w" != "") then
set xyz = $xyz','$w
echo $wf >>! go_catcher
echo "scanData.y_handshake=' '" >>! go_catcher
endif
if ("$v" != "") then
set xyz = $xyz','$v
echo $vf >>! go_catcher
endif
echo ".run catcher_v1" >! go_catcher
echo ".run catch1d_user" >>! go_catcher
echo $xyz >>! go_catcher
echo exe $exe
idl -32 $exe go_catcher
rm go_catcher
exit
help::
echo ""
echo NAME
echo " catcher - run the EPICS IDL data catcher with runtime license"
echo ""
echo SYNOPSIS
echo " catcher [-c file.config] [-d file.data] [-e file.env] [-h] [-n] [-v] [-D]"
echo ""
echo DESCRIPTION
echo " catcher provides the user with very flexible file specification"
echo " feature to startup the IDL data catcher program. The data"
echo " catcher program is written in IDL 5.3, and ezcaIDL CA interface "
echo " routines which in terms uses EPICS 3.13.x channel access "
echo " library routines. "
echo ""
echo " Currently, the data catcher can capture both 1D and 2D scan data"
echo " through setting monitor on the EPICS scan record. During data"
echo " acquisition it also provides real-time plotting. Post acquisition"
echo " it also provides simple 1D and 2D post data plot and analysis. "
echo " Each scan record can support up-to four positioners and fifteen"
echo " detectors."
echo ""
echo OPTIONS
echo " -c fn Assign the configuration file to be used. The file name"
echo " should begin with alphabetic character and must separate"
echo " with the option with a blank space. "
echo ""
echo " If this option is not specified, the default file"
echo " 'catch1d.config' will be used. At the normal completion"
echo " a new version of configuration will be saved or updated"
echo " in the directory where the data catcher was invoked."
echo ""
echo " -d fn Assign the acquisition data file to be used. The file name"
echo " should begin with alphabetic character and must separate"
echo " with the option with a blank space."
echo ""
echo " If this option is not specified, the default file "
echo " 'catch1d.trashcan' will be used."
echo ""
echo " -e fn Assign the environment file to be used. The file name"
echo " should begin with alphabetic character and must separate"
echo " with the option with a blank space. This file allows"
echo " additional environment variables to be saved with the "
echo " acquired scan data."
echo ""
echo " If this option not specified, the default file"
echo " 'catch1d.env' will be used. The default location of the"
echo " environment file is where the data catcher is invoked."
echo " If the same named environment file is found in the data"
echo " directory then that version overrides the default."
echo ""
echo " -h Generate this online help page."
echo ""
echo " -n Start the data catcher in no save mode, new scan data will"
echo " be captured in this mode but they will not be saved in file."
echo " Configuration file will not be updated."
echo ""
echo " -v Start the data catcher as view only mode, no new scan data"
echo " will be captured for this mode."
echo " Configuration file will not be updated."
echo ""
echo " -D This option overrides the using of default IDL run time license "
echo " by the developer IDL license at APS."
echo ""
echo EXAMPLES
echo " catcher -c test.config -d test.data -e test.env "
echo " catcher -c test.config "
echo " catcher -d test.dat"
echo " catcher -v "
echo ""