-
Notifications
You must be signed in to change notification settings - Fork 1
/
limaimxpad.mac
208 lines (171 loc) · 6.29 KB
/
limaimxpad.mac
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
204
205
206
207
208
#%NAME%
# Specific macros for Lima imXPAD detector
#%CATEGORY% Detection, Ccd
#%LOG%
#
def limaimxpadsetup(ccdname) '{
# --- common control init
_limapar_controlinit(ccdname, 0)
# --- callback macro on parameter set
_limapar_addconfig_cb(ccdname, "_limaimxpad_setpar")
# --- parameter definition
_limapar_addconfig(ccdname, "Acquisition_Mode", LP_RW|LP_LIST, 1)
_limapar_addconfig(ccdname, "Output_Signal", LP_RW|LP_LIST, 1)
_limapar_addconfig(ccdname, "Flat_Field_Correction_Flag", LP_RW|LP_LIST, 1)
_limapar_addconfig(ccdname, "Image_Transfer_Flag", LP_RW|LP_LIST, 1)
_limapar_addconfig(ccdname, "Geometrical_Correction_Flag", LP_RW|LP_LIST, 1)
_limapar_addconfig(ccdname, "Image_File_Format", LP_RW|LP_LIST, 1)
_limapar_addconfig(ccdname, "Over_Flow_Time", LP_RW, 1)
_limapar_addconfig(ccdname, "config_name", LP_RW|LP_LIST, 1)
_limapar_addconfig(ccdname, "ITHL_offset", LP_RW, 1)
# --- parameter description
_limapar_addtext(ccdname, "Acquisition_Mode", "Acquisition mode")
_limapar_addtext(ccdname, "Output_Signal", "Output signal")
_limapar_addtext(ccdname, "Flat_Field_Correction_Flag", "Flat field correction")
_limapar_addtext(ccdname, "Image_Transfer_Flag", "Image transfer")
_limapar_addtext(ccdname, "Geometrical_Correction_Flag", "Geometrical correction")
_limapar_addtext(ccdname, "Image_File_Format", "Image file format")
_limapar_addtext(ccdname, "Over_Flow_Time", "Over flow time")
_limapar_addtext(ccdname, "config_name", "Configuration name")
_limapar_addtext(ccdname, "ITHL_offset", "ITHL offset")
# --- timeout
tango_io(LIMA_DEV[ccdname]["config"],"timeout",60)
}'
lima_addlimatype("imXPAD", "limaimxpadsetup", "limaimxpadmenu")
def _limaimxpad_setpar(ccdname, parname, value) '{
if (parname == "Geometrical_Correction_Flag") {
#need to inform SPEC about possible image type change
local unit
unit = LIMA_DEV[ccdname]["unit"]
sleep(1)
# need to call twice "resize" otherwise spec does update
# the image_par() parameters (row_end,row_beg,col_end,col_beg)
image_par(unit, "resize")
image_par(unit, "resize")
ccd_createarray unit
}
}'
def _limaimxapad_wait '{
sleep(1)
while( (s=_limapar_get(ccdname, "acq_status")) == "Running"){ printf("+"); sleep(5);}
}'
def limaimxpadmenu(ccdname) '{
local items[] parname
local nl option
items["Acquisition_Mode"] = ""
items["Output_Signal"] = ""
items["Flat_Field_Correction_Flag"] = ""
items["Image_Transfer_Flag"] = ""
items["Geometrical_Correction_Flag"] = ""
items["Image_File_Format"] = ""
items["Over_Flow_Time"] = ""
items["config_name"] = ""
items["ITHL_offset"] = ""
option= 1
while (option) {
for (parname in items) {
items[parname]= _limapar_get(ccdname, parname)
}
nl = _limamenu_printtitle(ccdname,"Configuration","config")
tty_move(0,nl++,"(1) Configuration :")
_limamenu_printitem(ccdname, "Acquisition_Mode", items["Acquisition_Mode"], nl++, 11)
_limamenu_printitem(ccdname, "Flat_Field_Correction_Flag", items["Flat_Field_Correction_Flag"], nl++, 12)
_limamenu_printitem(ccdname, "Image_Transfer_Flag", items["Image_Transfer_Flag"], nl++, 13)
_limamenu_printitem(ccdname, "Geometrical_Correction_Flag", items["Geometrical_Correction_Flag"], nl++, 14)
_limamenu_printitem(ccdname, "Image_File_Format", items["Image_File_Format"], nl++, 15)
_limamenu_printitem(ccdname, "Over_Flow_Time", items["Over_Flow_Time"], nl++, 16)
_limamenu_printitem(ccdname, "Output_Signal", items["Output_Signal"], nl++, 17)
tty_move(0,++nl,"(2) Calibration :")
++nl
_limamenu_printitem(ccdname, "config_name", items["config_name"], nl++, 21)
_limamenu_printitem(ccdname, "ITHL_offset", items["ITHL_offset"], nl++, 22)
option= getval("\n\n\tOption ---> ", 0)
printf("\n\n")
if ((option==1)||(option==11))
_limapar_ask(ccdname, "Acquisition_Mode", items["Acquisition_Mode"])
if ((option==1)||(option==12))
_limapar_ask(ccdname, "Flat_Field_Correction_Flag", items["Flat_Field_Correction_Flag"])
if ((option==1)||(option==13))
_limapar_ask(ccdname, "Image_Transfer_Flag", items["Image_Transfer_Flag"])
if ((option==1)||(option==14))
_limapar_ask(ccdname, "Geometrical_Correction_Flag", items["Geometrical_Correction_Flag"])
if ((option==1)||(option==15))
_limapar_ask(ccdname, "Image_File_Format", items["Image_File_Format"])
if ((option==1)||(option==16))
_limapar_ask(ccdname, "Over_Flow_Time", items["Over_Flow_Time"])
if ((option==1)||(option==17))
_limapar_ask(ccdname, "Output_Signal", items["Output_Signal"])
if ((option==2)||(option==21))
_limapar_ask(ccdname, "config_name", items["config_name"])
if ((option==2)||(option==22))
_limapar_ask(ccdname, "ITHL_offset", items["ITHL_offset"])
}
}'
def limaimxpadCalibrationOTH '{
if ($# < 2) {
print "Usage: $0 <ccdname> mode(0:SLOW,1:MEDIUM,2:FAST)"
exit
}
local ccdname mode
ccdname = "$1"
mode = $2
tango_io(LIMA_DEV[ccdname]["config"],"calibrationOTN",mode)
_limaimxapad_wait
}'
def limaimxpadCalibrationOTHPulse '{
if ($# < 2) {
print "Usage: $0 <ccdname> mode(0:SLOW,1:MEDIUM,2:FAST)"
exit
}
local ccdname mode
ccdname = "$1"
mode = $2
tango_io(LIMA_DEV[ccdname]["config"],"calibrationOTNPulse",mode)
_limaimxapad_wait
}'
def limaimxpadCalibrationBeam '{
if ($# < 4) {
print "Usage: $0 <ccdname> time ITHLmax mode(0:SLOW,1:MEDIUM,2:FAST)"
exit
}
local ccdname
local long array params[3]
ccdname = "$1"
params[0] = int($2 * 1e6)
params[1] = $3
params[2] = $4
tango_io(LIMA_DEV[ccdname]["config"],"calibrationBEAM",params)
_limaimxapad_wait
}'
def limaimxpadITHLIncrease '{
if ($# < 1) {
print "Usage: $0 <ccdname>"
exit
}
local ccdname
ccdname = "$1"
tango_io(LIMA_DEV[ccdname]["config"],"ITHLIncrease")
}'
def limaimxpadITHLDecrease '{
if ($# < 1) {
print "Usage: $0 <ccdname>"
exit
}
local ccdname
ccdname = "$1"
tango_io(LIMA_DEV[ccdname]["config"],"ITHLDecrease")
}'
def limaimxpadSaveConfig '{
if ($# < 2) {
print "Usage: $0 <ccdname> config_name"
exit
}
local ccdname config_name
ccdname = "$1"
config_name = "$2"
tango_io(LIMA_DEV[ccdname]["config"],"saveConfig",config_name)
}'
#%MACROS%
#%IMACROS%
#%TOC%
#%AUTHOR% S.Petitdemange