-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlimampx.mac
138 lines (111 loc) · 4.66 KB
/
limampx.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
#%NAME%
# Specific macros for Lima Maxipix detector
# %BR%
#
#%CATEGORY% Detection, Ccd
#
#%END%
def limampxsetup(ccdname) '{
# --- common control init
_limapar_controlinit(ccdname, 0)
# --- parameter definition
_limapar_addconfig(ccdname, "config_name", LP_RW|LP_LIST|LP_CB, 1)
_limapar_addconfig(ccdname, "config_path", LP_RW, 1)
_limapar_addconfig(ccdname, "fill_mode", LP_RW|LP_LIST, 1)
_limapar_addconfig(ccdname, "energy_threshold", LP_RW|LP_MOT, 1, "double")
_limapar_addconfig(ccdname, "gate_level", LP_RW|LP_LIST, 1)
_limapar_addconfig(ccdname, "gate_mode", LP_RW|LP_LIST, 1)
_limapar_addconfig(ccdname, "ready_level", LP_RW|LP_LIST, 1)
_limapar_addconfig(ccdname, "ready_mode", LP_RW|LP_LIST, 1)
_limapar_addconfig(ccdname, "trigger_level", LP_RW|LP_LIST, 1)
_limapar_addconfig(ccdname, "shutter_level", LP_RW|LP_LIST, 1)
# --- callback macro on parameter set
_limapar_addconfig_cb(ccdname, "_limampx_setpar")
# --- parameter description
_limapar_addtext(ccdname, "config_name", "Configuration File")
_limapar_addtext(ccdname, "config_path", "Configuration Path")
_limapar_addtext(ccdname, "fill_mode", "Pixel Gap Filling Mode")
_limapar_addtext(ccdname, "energy_threshold", "Energy Threshold (KeV)")
_limapar_addtext(ccdname, "gate_mode", "Gate Input Mode")
_limapar_addtext(ccdname, "gate_level", "Gate Input Level")
_limapar_addtext(ccdname, "trigger_level", "Trigger Input Level")
_limapar_addtext(ccdname, "shutter_level", "Shutter Output Level")
_limapar_addtext(ccdname, "ready_mode", "Ready Output Mode")
_limapar_addtext(ccdname, "ready_level", "Ready Output Level")
}'
lima_addlimatype("Maxipix", "limampxsetup", "limampxmenu")
def _limampx_setpar(ccdname, parname, value) '{
if (parname == "config_name") {
#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 limampxmenu(ccdname) '{
local items[] parname
local nl option
items["config_name"]= ""
items["config_path"]= ""
items["fill_mode"]= ""
items["energy_threshold"]= -1
items["gate_mode"]= ""
items["gate_level"]= ""
items["trigger_level"]= ""
items["shutter_level"]= ""
items["ready_mode"]= ""
items["ready_level"]= ""
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, "config_name", items["config_name"], nl++, 11)
_limamenu_printitem(ccdname, "config_path", items["config_path"], nl++, 12)
_limamenu_printitem(ccdname, "fill_mode", items["fill_mode"], nl++, 13)
nl++
tty_move(0, nl++, "(2) Calibration :")
_limamenu_printitem(ccdname, "energy_threshold", items["energy_threshold"], nl++, 21)
nl++
tty_move(0, nl++, "(3) Input/Output Signals :")
_limamenu_printitem(ccdname, "gate_mode", items["gate_mode"], nl++, 31)
_limamenu_printitem(ccdname, "gate_level", items["gate_level"], nl++, 32)
_limamenu_printitem(ccdname, "trigger_level", items["trigger_level"], nl++, 33)
_limamenu_printitem(ccdname, "shutter_level", items["shutter_level"], nl++, 34)
_limamenu_printitem(ccdname, "ready_mode", items["ready_mode"], nl++, 35)
_limamenu_printitem(ccdname, "ready_level", items["ready_level"], nl++, 36)
option= getval("\n\n\tOption ---> ", 0)
printf("\n\n")
if ((option==1)||(option==11))
_limapar_ask(ccdname, "config_name", items["config_name"])
if ((option==1)||(option==12))
_limapar_ask(ccdname, "config_path", items["config_path"])
if ((option==1)||(option==13))
_limapar_ask(ccdname, "fill_mode", items["fill_mode"])
if ((option==2)||(option==21))
_limapar_ask(ccdname, "energy_threshold", items["energy_threshold"])
if ((option==3)||(option==31))
_limapar_ask(ccdname, "gate_mode", items["gate_mode"])
if ((option==3)||(option==32))
_limapar_ask(ccdname, "gate_level", items["gate_level"])
if ((option==3)||(option==33))
_limapar_ask(ccdname, "trigger_level", items["trigger_level"])
if ((option==3)||(option==34))
_limapar_ask(ccdname, "shutter_level", items["shutter_level"])
if ((option==3)||(option==35))
_limapar_ask(ccdname, "ready_mode", items["ready_mode"])
if ((option==3)||(option==36))
_limapar_ask(ccdname, "ready_level", items["ready_level"])
}
}'
#%MACROS%
#%IMACROS%
#%TOC%
#%AUTHOR% E.Papillon