1 | function varargout = Config_Dserver_BPM(varargin) |
---|
2 | % CONFIG_DSERVER_BPM M-file for Config_Dserver_BPM.fig |
---|
3 | % CONFIG_DSERVER_BPM, by itself, creates a new CONFIG_DSERVER_BPM or raises the existing |
---|
4 | % singleton*. |
---|
5 | % |
---|
6 | % H = CONFIG_DSERVER_BPM returns the handle to a new CONFIG_DSERVER_BPM or the handle to |
---|
7 | % the existing singleton*. |
---|
8 | % |
---|
9 | % CONFIG_DSERVER_BPM('CALLBACK',hObject,eventData,handles,...) calls the local |
---|
10 | % function named CALLBACK in CONFIG_DSERVER_BPM.M with the given input arguments. |
---|
11 | % |
---|
12 | % CONFIG_DSERVER_BPM('Property','Value',...) creates a new CONFIG_DSERVER_BPM or raises the |
---|
13 | % existing singleton*. Starting from the left, property value pairs are |
---|
14 | % applied to the GUI before Config_Dserver_BPM_OpeningFunction gets called. An |
---|
15 | % unrecognized property name or invalid value makes property application |
---|
16 | % stop. All inputs are passed to Config_Dserver_BPM_OpeningFcn via varargin. |
---|
17 | % |
---|
18 | % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one |
---|
19 | % instance to run (singleton)". |
---|
20 | % |
---|
21 | % See also: GUIDE, GUIDATA, GUIHANDLES |
---|
22 | |
---|
23 | % Edit the above text to modify the response to help Config_Dserver_BPM |
---|
24 | |
---|
25 | % Last Modified by GUIDE v2.5 01-Dec-2006 16:56:56 |
---|
26 | |
---|
27 | % Begin initialization code - DO NOT EDIT |
---|
28 | gui_Singleton = 1; |
---|
29 | gui_State = struct('gui_Name', mfilename, ... |
---|
30 | 'gui_Singleton', gui_Singleton, ... |
---|
31 | 'gui_OpeningFcn', @Config_Dserver_BPM_OpeningFcn, ... |
---|
32 | 'gui_OutputFcn', @Config_Dserver_BPM_OutputFcn, ... |
---|
33 | 'gui_LayoutFcn', [] , ... |
---|
34 | 'gui_Callback', []); |
---|
35 | if nargin && ischar(varargin{1}) |
---|
36 | gui_State.gui_Callback = str2func(varargin{1}); |
---|
37 | end |
---|
38 | |
---|
39 | if nargout |
---|
40 | [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); |
---|
41 | else |
---|
42 | gui_mainfcn(gui_State, varargin{:}); |
---|
43 | end |
---|
44 | % End initialization code - DO NOT EDIT |
---|
45 | |
---|
46 | |
---|
47 | % --- Executes just before Config_Dserver_BPM is made visible. |
---|
48 | function Config_Dserver_BPM_OpeningFcn(hObject, eventdata, handles, varargin) |
---|
49 | % This function has no output args, see OutputFcn. |
---|
50 | % hObject handle to figure |
---|
51 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
52 | % handles structure with handles and user data (see GUIDATA) |
---|
53 | for i=1:1:16 |
---|
54 | handles.table(i)=0; |
---|
55 | end |
---|
56 | % varargin command line arguments to Config_Dserver_BPM (see VARARGIN) |
---|
57 | |
---|
58 | % Choose default command line output for Config_Dserver_BPM |
---|
59 | handles.output = hObject; |
---|
60 | |
---|
61 | % Update handles structure |
---|
62 | guidata(hObject, handles); |
---|
63 | |
---|
64 | % UIWAIT makes Config_Dserver_BPM wait for user response (see UIRESUME) |
---|
65 | % uiwait(handles.figure1); |
---|
66 | |
---|
67 | |
---|
68 | % --- Outputs from this function are returned to the command line. |
---|
69 | function varargout = Config_Dserver_BPM_OutputFcn(hObject, eventdata, handles) |
---|
70 | % varargout cell array for returning output args (see VARARGOUT); |
---|
71 | % hObject handle to figure |
---|
72 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
73 | % handles structure with handles and user data (see GUIDATA) |
---|
74 | |
---|
75 | % Get default command line output from handles structure |
---|
76 | varargout{1} = handles.output; |
---|
77 | |
---|
78 | % --- Executes on button press in Booster. |
---|
79 | function Booster_Callback(hObject, eventdata, handles) |
---|
80 | % hObject handle to Booster (see GCBO) |
---|
81 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
82 | % handles structure with handles and user data (see GUIDATA) |
---|
83 | |
---|
84 | % Hint: get(hObject,'Value') returns toggle state of Booster |
---|
85 | set(handles.Tune_BPM,'value',0); |
---|
86 | set(handles.LT2,'value',0); |
---|
87 | set(handles.Baie_test,'value',0); |
---|
88 | set(handles.All,'value',0); |
---|
89 | set(handles.Baie1,'value',0); |
---|
90 | set(handles.Baie2,'value',0); |
---|
91 | set(handles.Baie3,'value',0); |
---|
92 | set(handles.Baie4,'value',0); |
---|
93 | set(handles.Baie5,'value',0); |
---|
94 | set(handles.Baie6,'value',0); |
---|
95 | set(handles.Baie7,'value',0); |
---|
96 | set(handles.Baie8,'value',0); |
---|
97 | set(handles.Baie9,'value',0); |
---|
98 | set(handles.Baie10,'value',0); |
---|
99 | set(handles.Baie11,'value',0); |
---|
100 | set(handles.Baie12,'value',0); |
---|
101 | set(handles.Baie13,'value',0); |
---|
102 | set(handles.Baie14,'value',0); |
---|
103 | set(handles.Baie15,'value',0); |
---|
104 | set(handles.Baie16,'value',0); |
---|
105 | for i=1:1:16 |
---|
106 | handles.table(i)=0; |
---|
107 | guidata(hObject, handles); |
---|
108 | end |
---|
109 | List=0; |
---|
110 | Index=0; |
---|
111 | handles.table |
---|
112 | set(handles.Devices_list,'value',1) |
---|
113 | List=Get_Dev_List('Booster'); |
---|
114 | for j=1:1:size(List,1) |
---|
115 | Dev_List(Index+j,:)=List(j,:); |
---|
116 | end |
---|
117 | set(handles.Devices_list,'string',Dev_List); |
---|
118 | current_list=get(handles.Devices_list,'string'); |
---|
119 | Index=size(current_list,1); |
---|
120 | |
---|
121 | % --- Executes on button press in LT2. |
---|
122 | function LT2_Callback(hObject, eventdata, handles) |
---|
123 | % hObject handle to LT2 (see GCBO) |
---|
124 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
125 | % handles structure with handles and user data (see GUIDATA) |
---|
126 | |
---|
127 | % Hint: get(hObject,'Value') returns toggle state of LT2 |
---|
128 | set(handles.Tune_BPM,'value',0); |
---|
129 | set(handles.Booster,'value',0); |
---|
130 | set(handles.Baie_test,'value',0); |
---|
131 | set(handles.All,'value',0); |
---|
132 | set(handles.Baie1,'value',0); |
---|
133 | set(handles.Baie2,'value',0); |
---|
134 | set(handles.Baie3,'value',0); |
---|
135 | set(handles.Baie4,'value',0); |
---|
136 | set(handles.Baie5,'value',0); |
---|
137 | set(handles.Baie6,'value',0); |
---|
138 | set(handles.Baie7,'value',0); |
---|
139 | set(handles.Baie8,'value',0); |
---|
140 | set(handles.Baie9,'value',0); |
---|
141 | set(handles.Baie10,'value',0); |
---|
142 | set(handles.Baie11,'value',0); |
---|
143 | set(handles.Baie12,'value',0); |
---|
144 | set(handles.Baie13,'value',0); |
---|
145 | set(handles.Baie14,'value',0); |
---|
146 | set(handles.Baie15,'value',0); |
---|
147 | set(handles.Baie16,'value',0); |
---|
148 | for i=1:1:16 |
---|
149 | handles.table(i)=0; |
---|
150 | guidata(hObject, handles); |
---|
151 | end |
---|
152 | List=0; |
---|
153 | Index=0; |
---|
154 | handles.table |
---|
155 | set(handles.Devices_list,'value',1) |
---|
156 | List=Get_Dev_List('LT2'); |
---|
157 | for j=1:1:size(List,1) |
---|
158 | Dev_List(Index+j,:)=List(j,:); |
---|
159 | end |
---|
160 | set(handles.Devices_list,'string',Dev_List); |
---|
161 | current_list=get(handles.Devices_list,'string'); |
---|
162 | Index=size(current_list,1); |
---|
163 | |
---|
164 | % --- Executes on button press in Baie_test. |
---|
165 | function Baie_test_Callback(hObject, eventdata, handles) |
---|
166 | % hObject handle to Baie_test (see GCBO) |
---|
167 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
168 | % handles structure with handles and user data (see GUIDATA) |
---|
169 | |
---|
170 | % Hint: get(hObject,'Value') returns toggle state of Baie_test |
---|
171 | set(handles.Tune_BPM,'value',0); |
---|
172 | set(handles.LT2,'value',0); |
---|
173 | set(handles.Booster,'value',0); |
---|
174 | set(handles.All,'value',0); |
---|
175 | set(handles.Baie1,'value',0); |
---|
176 | set(handles.Baie2,'value',0); |
---|
177 | set(handles.Baie3,'value',0); |
---|
178 | set(handles.Baie4,'value',0); |
---|
179 | set(handles.Baie5,'value',0); |
---|
180 | set(handles.Baie6,'value',0); |
---|
181 | set(handles.Baie7,'value',0); |
---|
182 | set(handles.Baie8,'value',0); |
---|
183 | set(handles.Baie9,'value',0); |
---|
184 | set(handles.Baie10,'value',0); |
---|
185 | set(handles.Baie11,'value',0); |
---|
186 | set(handles.Baie12,'value',0); |
---|
187 | set(handles.Baie13,'value',0); |
---|
188 | set(handles.Baie14,'value',0); |
---|
189 | set(handles.Baie15,'value',0); |
---|
190 | set(handles.Baie16,'value',0); |
---|
191 | for i=1:1:16 |
---|
192 | handles.table(i)=0; |
---|
193 | guidata(hObject, handles); |
---|
194 | end |
---|
195 | List=0; |
---|
196 | Index=0; |
---|
197 | handles.table |
---|
198 | set(handles.Devices_list,'value',1) |
---|
199 | List=Get_Dev_List('test'); |
---|
200 | for j=1:1:size(List,1) |
---|
201 | Dev_List(Index+j,:)=List(j,:); |
---|
202 | end |
---|
203 | set(handles.Devices_list,'string',Dev_List); |
---|
204 | current_list=get(handles.Devices_list,'string'); |
---|
205 | Index=size(current_list,1); |
---|
206 | |
---|
207 | % --- Executes on button press in Tune_BPM. |
---|
208 | function Tune_BPM_Callback(hObject, eventdata, handles) |
---|
209 | % hObject handle to Tune_BPM (see GCBO) |
---|
210 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
211 | % handles structure with handles and user data (see GUIDATA) |
---|
212 | |
---|
213 | % Hint: get(hObject,'Value') returns toggle state of Tune_BPM |
---|
214 | set(handles.LT2,'value',0); |
---|
215 | set(handles.Booster,'value',0); |
---|
216 | set(handles.Baie_test,'value',0); |
---|
217 | set(handles.All,'value',0); |
---|
218 | set(handles.Baie1,'value',0); |
---|
219 | set(handles.Baie2,'value',0); |
---|
220 | set(handles.Baie3,'value',0); |
---|
221 | set(handles.Baie4,'value',0); |
---|
222 | set(handles.Baie5,'value',0); |
---|
223 | set(handles.Baie6,'value',0); |
---|
224 | set(handles.Baie7,'value',0); |
---|
225 | set(handles.Baie8,'value',0); |
---|
226 | set(handles.Baie9,'value',0); |
---|
227 | set(handles.Baie10,'value',0); |
---|
228 | set(handles.Baie11,'value',0); |
---|
229 | set(handles.Baie12,'value',0); |
---|
230 | set(handles.Baie13,'value',0); |
---|
231 | set(handles.Baie14,'value',0); |
---|
232 | set(handles.Baie15,'value',0); |
---|
233 | set(handles.Baie16,'value',0); |
---|
234 | for i=1:1:16 |
---|
235 | handles.table(i)=0; |
---|
236 | guidata(hObject, handles); |
---|
237 | end |
---|
238 | List=0; |
---|
239 | Index=0; |
---|
240 | handles.table |
---|
241 | set(handles.Devices_list,'value',1) |
---|
242 | List=Get_Dev_List('Tune_BPM'); |
---|
243 | for j=1:1:size(List,1) |
---|
244 | Dev_List(Index+j,:)=List(j,:); |
---|
245 | end |
---|
246 | set(handles.Devices_list,'string',Dev_List); |
---|
247 | current_list=get(handles.Devices_list,'string'); |
---|
248 | Index=size(current_list,1); |
---|
249 | |
---|
250 | |
---|
251 | % --- Executes on button press in All. |
---|
252 | function All_Callback(hObject, eventdata, handles) |
---|
253 | % hObject handle to All (see GCBO) |
---|
254 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
255 | % handles structure with handles and user data (see GUIDATA) |
---|
256 | |
---|
257 | % Hint: get(hObject,'Value') returns toggle state of All |
---|
258 | |
---|
259 | set(handles.LT2,'value',0); |
---|
260 | set(handles.Tune_BPM,'value',0); |
---|
261 | set(handles.Booster,'value',0); |
---|
262 | all=get(handles.All,'value'); |
---|
263 | set(handles.Baie_test,'value',0); |
---|
264 | set(handles.Baie1,'value',all); |
---|
265 | set(handles.Baie2,'value',all); |
---|
266 | set(handles.Baie3,'value',all); |
---|
267 | set(handles.Baie4,'value',all); |
---|
268 | set(handles.Baie5,'value',all); |
---|
269 | set(handles.Baie6,'value',all); |
---|
270 | set(handles.Baie7,'value',all); |
---|
271 | set(handles.Baie8,'value',all); |
---|
272 | set(handles.Baie9,'value',all); |
---|
273 | set(handles.Baie10,'value',all); |
---|
274 | set(handles.Baie11,'value',all); |
---|
275 | set(handles.Baie12,'value',all); |
---|
276 | set(handles.Baie13,'value',all); |
---|
277 | set(handles.Baie14,'value',all); |
---|
278 | set(handles.Baie15,'value',all); |
---|
279 | set(handles.Baie16,'value',all); |
---|
280 | for i=1:1:16 |
---|
281 | handles.table(i)=all; |
---|
282 | guidata(hObject, handles); |
---|
283 | end |
---|
284 | List=0; |
---|
285 | Index=0; |
---|
286 | handles.table |
---|
287 | set(handles.Devices_list,'value',1) |
---|
288 | |
---|
289 | |
---|
290 | if all |
---|
291 | List=Get_Dev_List('ANS'); |
---|
292 | for j=1:1:size(List,1) |
---|
293 | Dev_List(Index+j,:)=List(j,:); |
---|
294 | end |
---|
295 | set(handles.Devices_list,'string',Dev_List); |
---|
296 | current_list=get(handles.Devices_list,'string'); |
---|
297 | Index=size(current_list,1); |
---|
298 | end |
---|
299 | |
---|
300 | if all==0 |
---|
301 | set(handles.Devices_list,'string',''); |
---|
302 | end |
---|
303 | |
---|
304 | |
---|
305 | % --- Executes on button press in Baie1. |
---|
306 | function Baie1_Callback(hObject, eventdata, handles) |
---|
307 | % hObject handle to Baie1 (see GCBO) |
---|
308 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
309 | % handles structure with handles and user data (see GUIDATA) |
---|
310 | set(handles.LT2,'value',0); |
---|
311 | set(handles.Tune_BPM,'value',0); |
---|
312 | set(handles.Booster,'value',0); |
---|
313 | set(handles.Baie_test,'value',0); |
---|
314 | handles.table(1)=get(handles.Baie1,'value'); |
---|
315 | val=handles.table |
---|
316 | guidata(hObject, handles); |
---|
317 | % Hint: get(hObject,'Value') returns toggle state of Baie1 |
---|
318 | List=0; |
---|
319 | Index=0; |
---|
320 | handles.table |
---|
321 | set(handles.Devices_list,'value',1) |
---|
322 | for i=1:1:16 |
---|
323 | if handles.table(i)==1 |
---|
324 | List=Get_Dev_List(num2str(i)) |
---|
325 | for j=1:1:size(List,1) |
---|
326 | Dev_List(Index+j,:)=List(j,:); |
---|
327 | end |
---|
328 | set(handles.Devices_list,'string',Dev_List) |
---|
329 | current_list=get(handles.Devices_list,'string'); |
---|
330 | Index=size(current_list,1); |
---|
331 | end |
---|
332 | end |
---|
333 | |
---|
334 | % --- Executes on button press in Baie2. |
---|
335 | function Baie2_Callback(hObject, eventdata, handles) |
---|
336 | % hObject handle to Baie2 (see GCBO) |
---|
337 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
338 | % handles structure with handles and user data (see GUIDATA) |
---|
339 | set(handles.LT2,'value',0); |
---|
340 | set(handles.Tune_BPM,'value',0); |
---|
341 | set(handles.Booster,'value',0); |
---|
342 | set(handles.Baie_test,'value',0); |
---|
343 | handles.table(2)=get(handles.Baie2,'value'); |
---|
344 | guidata(hObject, handles); |
---|
345 | % Hint: get(hObject,'Value') returns toggle state of Baie2 |
---|
346 | List=0; |
---|
347 | Index=0; |
---|
348 | handles.table |
---|
349 | set(handles.Devices_list,'value',1) |
---|
350 | for i=1:1:16 |
---|
351 | if handles.table(i)==1 |
---|
352 | List=Get_Dev_List(num2str(i)); |
---|
353 | for j=1:1:size(List,1) |
---|
354 | Dev_List(Index+j,:)=List(j,:); |
---|
355 | end |
---|
356 | set(handles.Devices_list,'string',Dev_List); |
---|
357 | current_list=get(handles.Devices_list,'string'); |
---|
358 | Index=size(current_list,1); |
---|
359 | end |
---|
360 | end |
---|
361 | |
---|
362 | % --- Executes on button press in Baie3. |
---|
363 | function Baie3_Callback(hObject, eventdata, handles) |
---|
364 | % hObject handle to Baie3 (see GCBO) |
---|
365 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
366 | % handles structure with handles and user data (see GUIDATA) |
---|
367 | set(handles.LT2,'value',0); |
---|
368 | set(handles.Tune_BPM,'value',0); |
---|
369 | set(handles.Booster,'value',0); |
---|
370 | set(handles.Baie_test,'value',0); |
---|
371 | handles.table(3)=get(handles.Baie3,'value'); |
---|
372 | guidata(hObject, handles); |
---|
373 | |
---|
374 | % Hint: get(hObject,'Value') returns toggle state of Baie3 |
---|
375 | List=0; |
---|
376 | Index=0; |
---|
377 | handles.table |
---|
378 | set(handles.Devices_list,'value',1) |
---|
379 | for i=1:1:16 |
---|
380 | if handles.table(i)==1 |
---|
381 | List=Get_Dev_List(num2str(i)); |
---|
382 | for j=1:1:size(List,1) |
---|
383 | Dev_List(Index+j,:)=List(j,:); |
---|
384 | end |
---|
385 | set(handles.Devices_list,'string',Dev_List); |
---|
386 | current_list=get(handles.Devices_list,'string'); |
---|
387 | Index=size(current_list,1); |
---|
388 | end |
---|
389 | end |
---|
390 | |
---|
391 | % --- Executes on button press in Baie4. |
---|
392 | function Baie4_Callback(hObject, eventdata, handles) |
---|
393 | % hObject handle to Baie4 (see GCBO) |
---|
394 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
395 | % handles structure with handles and user data (see GUIDATA) |
---|
396 | set(handles.LT2,'value',0); |
---|
397 | set(handles.Tune_BPM,'value',0); |
---|
398 | set(handles.Booster,'value',0); |
---|
399 | set(handles.Baie_test,'value',0); |
---|
400 | handles.table(4)=get(handles.Baie4,'value'); |
---|
401 | guidata(hObject, handles); |
---|
402 | |
---|
403 | % Hint: get(hObject,'Value') returns toggle state of Baie4 |
---|
404 | List=0; |
---|
405 | Index=0; |
---|
406 | handles.table |
---|
407 | set(handles.Devices_list,'value',1) |
---|
408 | for i=1:1:16 |
---|
409 | if handles.table(i)==1 |
---|
410 | List=Get_Dev_List(num2str(i)); |
---|
411 | for j=1:1:size(List,1) |
---|
412 | Dev_List(Index+j,:)=List(j,:); |
---|
413 | end |
---|
414 | set(handles.Devices_list,'string',Dev_List); |
---|
415 | current_list=get(handles.Devices_list,'string'); |
---|
416 | Index=size(current_list,1); |
---|
417 | end |
---|
418 | end |
---|
419 | |
---|
420 | % --- Executes on button press in Baie5. |
---|
421 | function Baie5_Callback(hObject, eventdata, handles) |
---|
422 | % hObject handle to Baie5 (see GCBO) |
---|
423 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
424 | % handles structure with handles and user data (see GUIDATA) |
---|
425 | set(handles.LT2,'value',0); |
---|
426 | set(handles.Tune_BPM,'value',0); |
---|
427 | set(handles.Booster,'value',0); |
---|
428 | set(handles.Baie_test,'value',0); |
---|
429 | handles.table(5)=get(handles.Baie5,'value'); |
---|
430 | guidata(hObject, handles); |
---|
431 | |
---|
432 | % Hint: get(hObject,'Value') returns toggle state of Baie5 |
---|
433 | List=0; |
---|
434 | Index=0; |
---|
435 | handles.table |
---|
436 | set(handles.Devices_list,'value',1) |
---|
437 | for i=1:1:16 |
---|
438 | if handles.table(i)==1 |
---|
439 | List=Get_Dev_List(num2str(i)); |
---|
440 | for j=1:1:size(List,1) |
---|
441 | Dev_List(Index+j,:)=List(j,:); |
---|
442 | end |
---|
443 | set(handles.Devices_list,'string',Dev_List); |
---|
444 | current_list=get(handles.Devices_list,'string'); |
---|
445 | Index=size(current_list,1); |
---|
446 | end |
---|
447 | end |
---|
448 | |
---|
449 | % --- Executes on button press in Baie6. |
---|
450 | function Baie6_Callback(hObject, eventdata, handles) |
---|
451 | % hObject handle to Baie6 (see GCBO) |
---|
452 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
453 | % handles structure with handles and user data (see GUIDATA) |
---|
454 | set(handles.LT2,'value',0); |
---|
455 | set(handles.Tune_BPM,'value',0); |
---|
456 | set(handles.Booster,'value',0); |
---|
457 | set(handles.Baie_test,'value',0); |
---|
458 | handles.table(6)=get(handles.Baie6,'value'); |
---|
459 | guidata(hObject, handles); |
---|
460 | |
---|
461 | % Hint: get(hObject,'Value') returns toggle state of Baie6 |
---|
462 | List=0; |
---|
463 | Index=0; |
---|
464 | handles.table |
---|
465 | set(handles.Devices_list,'value',1) |
---|
466 | for i=1:1:16 |
---|
467 | if handles.table(i)==1 |
---|
468 | List=Get_Dev_List(num2str(i)); |
---|
469 | for j=1:1:size(List,1) |
---|
470 | Dev_List(Index+j,:)=List(j,:); |
---|
471 | end |
---|
472 | set(handles.Devices_list,'string',Dev_List); |
---|
473 | current_list=get(handles.Devices_list,'string'); |
---|
474 | Index=size(current_list,1); |
---|
475 | end |
---|
476 | end |
---|
477 | |
---|
478 | % --- Executes on button press in Baie7. |
---|
479 | function Baie7_Callback(hObject, eventdata, handles) |
---|
480 | % hObject handle to Baie7 (see GCBO) |
---|
481 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
482 | % handles structure with handles and user data (see GUIDATA) |
---|
483 | set(handles.LT2,'value',0); |
---|
484 | set(handles.Tune_BPM,'value',0); |
---|
485 | set(handles.Booster,'value',0); |
---|
486 | set(handles.Baie_test,'value',0); |
---|
487 | handles.table(7)=get(handles.Baie7,'value'); |
---|
488 | guidata(hObject, handles); |
---|
489 | |
---|
490 | % Hint: get(hObject,'Value') returns toggle state of Baie7 |
---|
491 | List=0; |
---|
492 | Index=0; |
---|
493 | handles.table |
---|
494 | set(handles.Devices_list,'value',1) |
---|
495 | for i=1:1:16 |
---|
496 | if handles.table(i)==1 |
---|
497 | List=Get_Dev_List(num2str(i)); |
---|
498 | for j=1:1:size(List,1) |
---|
499 | Dev_List(Index+j,:)=List(j,:); |
---|
500 | end |
---|
501 | set(handles.Devices_list,'string',Dev_List); |
---|
502 | current_list=get(handles.Devices_list,'string'); |
---|
503 | Index=size(current_list,1); |
---|
504 | end |
---|
505 | end |
---|
506 | |
---|
507 | % --- Executes on button press in Baie8. |
---|
508 | function Baie8_Callback(hObject, eventdata, handles) |
---|
509 | % hObject handle to Baie8 (see GCBO) |
---|
510 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
511 | % handles structure with handles and user data (see GUIDATA) |
---|
512 | set(handles.LT2,'value',0); |
---|
513 | set(handles.Tune_BPM,'value',0); |
---|
514 | set(handles.Booster,'value',0); |
---|
515 | set(handles.Baie_test,'value',0); |
---|
516 | handles.table(8)=get(handles.Baie8,'value'); |
---|
517 | guidata(hObject, handles); |
---|
518 | |
---|
519 | % Hint: get(hObject,'Value') returns toggle state of Baie8 |
---|
520 | List=0; |
---|
521 | Index=0; |
---|
522 | handles.table |
---|
523 | set(handles.Devices_list,'value',1) |
---|
524 | for i=1:1:16 |
---|
525 | if handles.table(i)==1 |
---|
526 | List=Get_Dev_List(num2str(i)); |
---|
527 | for j=1:1:size(List,1) |
---|
528 | Dev_List(Index+j,:)=List(j,:); |
---|
529 | end |
---|
530 | set(handles.Devices_list,'string',Dev_List); |
---|
531 | current_list=get(handles.Devices_list,'string'); |
---|
532 | Index=size(current_list,1); |
---|
533 | end |
---|
534 | end |
---|
535 | |
---|
536 | % --- Executes on button press in Baie9. |
---|
537 | function Baie9_Callback(hObject, eventdata, handles) |
---|
538 | % hObject handle to Baie9 (see GCBO) |
---|
539 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
540 | % handles structure with handles and user data (see GUIDATA) |
---|
541 | set(handles.LT2,'value',0); |
---|
542 | set(handles.Tune_BPM,'value',0); |
---|
543 | set(handles.Booster,'value',0); |
---|
544 | set(handles.Baie_test,'value',0); |
---|
545 | handles.table(9)=get(handles.Baie9,'value'); |
---|
546 | guidata(hObject, handles); |
---|
547 | |
---|
548 | % Hint: get(hObject,'Value') returns toggle state of Baie9 |
---|
549 | List=0; |
---|
550 | Index=0; |
---|
551 | handles.table |
---|
552 | set(handles.Devices_list,'value',1) |
---|
553 | for i=1:1:16 |
---|
554 | if handles.table(i)==1 |
---|
555 | List=Get_Dev_List(num2str(i)); |
---|
556 | for j=1:1:size(List,1) |
---|
557 | Dev_List(Index+j,:)=List(j,:); |
---|
558 | end |
---|
559 | set(handles.Devices_list,'string',Dev_List); |
---|
560 | current_list=get(handles.Devices_list,'string'); |
---|
561 | Index=size(current_list,1); |
---|
562 | end |
---|
563 | end |
---|
564 | |
---|
565 | % --- Executes on button press in Baie10. |
---|
566 | function Baie10_Callback(hObject, eventdata, handles) |
---|
567 | % hObject handle to Baie10 (see GCBO) |
---|
568 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
569 | % handles structure with handles and user data (see GUIDATA) |
---|
570 | set(handles.LT2,'value',0); |
---|
571 | set(handles.Tune_BPM,'value',0); |
---|
572 | set(handles.Booster,'value',0); |
---|
573 | set(handles.Baie_test,'value',0); |
---|
574 | handles.table(10)=get(handles.Baie10,'value'); |
---|
575 | guidata(hObject, handles); |
---|
576 | |
---|
577 | % Hint: get(hObject,'Value') returns toggle state of Baie10 |
---|
578 | List=0; |
---|
579 | Index=0; |
---|
580 | handles.table |
---|
581 | set(handles.Devices_list,'value',1) |
---|
582 | for i=1:1:16 |
---|
583 | if handles.table(i)==1 |
---|
584 | List=Get_Dev_List(num2str(i)); |
---|
585 | for j=1:1:size(List,1) |
---|
586 | Dev_List(Index+j,:)=List(j,:); |
---|
587 | end |
---|
588 | set(handles.Devices_list,'string',Dev_List); |
---|
589 | current_list=get(handles.Devices_list,'string'); |
---|
590 | Index=size(current_list,1); |
---|
591 | end |
---|
592 | end |
---|
593 | |
---|
594 | % --- Executes on button press in Baie11. |
---|
595 | function Baie11_Callback(hObject, eventdata, handles) |
---|
596 | % hObject handle to Baie11 (see GCBO) |
---|
597 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
598 | % handles structure with handles and user data (see GUIDATA) |
---|
599 | set(handles.LT2,'value',0); |
---|
600 | set(handles.Tune_BPM,'value',0); |
---|
601 | set(handles.Booster,'value',0); |
---|
602 | set(handles.Baie_test,'value',0); |
---|
603 | handles.table(11)=get(handles.Baie11,'value'); |
---|
604 | guidata(hObject, handles); |
---|
605 | |
---|
606 | % Hint: get(hObject,'Value') returns toggle state of Baie11 |
---|
607 | List=0; |
---|
608 | Index=0; |
---|
609 | handles.table |
---|
610 | set(handles.Devices_list,'value',1) |
---|
611 | for i=1:1:16 |
---|
612 | if handles.table(i)==1 |
---|
613 | List=Get_Dev_List(num2str(i)); |
---|
614 | for j=1:1:size(List,1) |
---|
615 | Dev_List(Index+j,:)=List(j,:); |
---|
616 | end |
---|
617 | set(handles.Devices_list,'string',Dev_List); |
---|
618 | current_list=get(handles.Devices_list,'string'); |
---|
619 | Index=size(current_list,1); |
---|
620 | end |
---|
621 | end |
---|
622 | |
---|
623 | % --- Executes on button press in Baie12. |
---|
624 | function Baie12_Callback(hObject, eventdata, handles) |
---|
625 | % hObject handle to Baie12 (see GCBO) |
---|
626 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
627 | % handles structure with handles and user data (see GUIDATA) |
---|
628 | set(handles.LT2,'value',0); |
---|
629 | set(handles.Tune_BPM,'value',0); |
---|
630 | set(handles.Booster,'value',0); |
---|
631 | set(handles.Baie_test,'value',0); |
---|
632 | handles.table(12)=get(handles.Baie12,'value'); |
---|
633 | guidata(hObject, handles); |
---|
634 | |
---|
635 | % Hint: get(hObject,'Value') returns toggle state of Baie12 |
---|
636 | List=0; |
---|
637 | Index=0; |
---|
638 | handles.table |
---|
639 | set(handles.Devices_list,'value',1) |
---|
640 | for i=1:1:16 |
---|
641 | if handles.table(i)==1 |
---|
642 | List=Get_Dev_List(num2str(i)); |
---|
643 | for j=1:1:size(List,1) |
---|
644 | Dev_List(Index+j,:)=List(j,:); |
---|
645 | end |
---|
646 | set(handles.Devices_list,'string',Dev_List); |
---|
647 | current_list=get(handles.Devices_list,'string'); |
---|
648 | Index=size(current_list,1); |
---|
649 | end |
---|
650 | end |
---|
651 | |
---|
652 | % --- Executes on button press in Baie13. |
---|
653 | function Baie13_Callback(hObject, eventdata, handles) |
---|
654 | % hObject handle to Baie13 (see GCBO) |
---|
655 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
656 | % handles structure with handles and user data (see GUIDATA) |
---|
657 | set(handles.LT2,'value',0); |
---|
658 | set(handles.Tune_BPM,'value',0); |
---|
659 | set(handles.Booster,'value',0); |
---|
660 | set(handles.Baie_test,'value',0); |
---|
661 | handles.table(13)=get(handles.Baie13,'value'); |
---|
662 | guidata(hObject, handles); |
---|
663 | |
---|
664 | % Hint: get(hObject,'Value') returns toggle state of Baie13 |
---|
665 | List=0; |
---|
666 | Index=0; |
---|
667 | handles.table |
---|
668 | set(handles.Devices_list,'value',1) |
---|
669 | for i=1:1:16 |
---|
670 | if handles.table(i)==1 |
---|
671 | List=Get_Dev_List(num2str(i)); |
---|
672 | for j=1:1:size(List,1) |
---|
673 | Dev_List(Index+j,:)=List(j,:); |
---|
674 | end |
---|
675 | set(handles.Devices_list,'string',Dev_List); |
---|
676 | current_list=get(handles.Devices_list,'string'); |
---|
677 | Index=size(current_list,1); |
---|
678 | end |
---|
679 | end |
---|
680 | |
---|
681 | % --- Executes on button press in Baie14. |
---|
682 | function Baie14_Callback(hObject, eventdata, handles) |
---|
683 | % hObject handle to Baie14 (see GCBO) |
---|
684 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
685 | % handles structure with handles and user data (see GUIDATA) |
---|
686 | set(handles.LT2,'value',0); |
---|
687 | set(handles.Tune_BPM,'value',0); |
---|
688 | set(handles.Booster,'value',0); |
---|
689 | set(handles.Baie_test,'value',0); |
---|
690 | handles.table(14)=get(handles.Baie14,'value'); |
---|
691 | guidata(hObject, handles); |
---|
692 | |
---|
693 | % Hint: get(hObject,'Value') returns toggle state of Baie14 |
---|
694 | List=0; |
---|
695 | Index=0; |
---|
696 | handles.table |
---|
697 | set(handles.Devices_list,'value',1) |
---|
698 | for i=1:1:16 |
---|
699 | if handles.table(i)==1 |
---|
700 | List=Get_Dev_List(num2str(i)); |
---|
701 | for j=1:1:size(List,1) |
---|
702 | Dev_List(Index+j,:)=List(j,:); |
---|
703 | end |
---|
704 | set(handles.Devices_list,'string',Dev_List); |
---|
705 | current_list=get(handles.Devices_list,'string'); |
---|
706 | Index=size(current_list,1); |
---|
707 | end |
---|
708 | end |
---|
709 | |
---|
710 | % --- Executes on button press in Baie15. |
---|
711 | function Baie15_Callback(hObject, eventdata, handles) |
---|
712 | % hObject handle to Baie15 (see GCBO) |
---|
713 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
714 | % handles structure with handles and user data (see GUIDATA) |
---|
715 | set(handles.LT2,'value',0); |
---|
716 | set(handles.Tune_BPM,'value',0); |
---|
717 | set(handles.Booster,'value',0); |
---|
718 | set(handles.Baie_test,'value',0); |
---|
719 | handles.table(15)=get(handles.Baie15,'value'); |
---|
720 | guidata(hObject, handles); |
---|
721 | |
---|
722 | % Hint: get(hObject,'Value') returns toggle state of Baie15 |
---|
723 | List=0; |
---|
724 | Index=0; |
---|
725 | handles.table |
---|
726 | set(handles.Devices_list,'value',1) |
---|
727 | for i=1:1:16 |
---|
728 | if handles.table(i)==1 |
---|
729 | List=Get_Dev_List(num2str(i)); |
---|
730 | for j=1:1:size(List,1) |
---|
731 | Dev_List(Index+j,:)=List(j,:); |
---|
732 | end |
---|
733 | set(handles.Devices_list,'string',Dev_List); |
---|
734 | current_list=get(handles.Devices_list,'string'); |
---|
735 | Index=size(current_list,1); |
---|
736 | end |
---|
737 | end |
---|
738 | |
---|
739 | % --- Executes on button press in Baie16. |
---|
740 | function Baie16_Callback(hObject, eventdata, handles) |
---|
741 | % hObject handle to Baie16 (see GCBO) |
---|
742 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
743 | % handles structure with handles and user data (see GUIDATA) |
---|
744 | set(handles.LT2,'value',0); |
---|
745 | set(handles.Tune_BPM,'value',0); |
---|
746 | set(handles.Booster,'value',0); |
---|
747 | set(handles.Baie_test,'value',0); |
---|
748 | handles.table(16)=get(handles.Baie16,'value'); |
---|
749 | guidata(hObject, handles); |
---|
750 | |
---|
751 | % Hint: get(hObject,'Value') returns toggle state of Baie16 |
---|
752 | List=0; |
---|
753 | Index=0; |
---|
754 | handles.table |
---|
755 | set(handles.Devices_list,'value',1) |
---|
756 | for i=1:1:16 |
---|
757 | if handles.table(i)==1 |
---|
758 | List=Get_Dev_List(num2str(i)); |
---|
759 | for j=1:1:size(List,1) |
---|
760 | Dev_List(Index+j,:)=List(j,:); |
---|
761 | end |
---|
762 | set(handles.Devices_list,'string',Dev_List); |
---|
763 | current_list=get(handles.Devices_list,'string'); |
---|
764 | Index=size(current_list,1); |
---|
765 | end |
---|
766 | end |
---|
767 | |
---|
768 | |
---|
769 | |
---|
770 | |
---|
771 | % --- Executes on selection change in Devices_list. |
---|
772 | function Devices_list_Callback(hObject, eventdata, handles) |
---|
773 | % hObject handle to Devices_list (see GCBO) |
---|
774 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
775 | % handles structure with handles and user data (see GUIDATA) |
---|
776 | |
---|
777 | % Hints: contents = get(hObject,'String') returns Devices_list contents as cell array |
---|
778 | % contents{get(hObject,'Value')} returns selected item from Devices_list |
---|
779 | |
---|
780 | |
---|
781 | % --- Executes during object creation, after setting all properties. |
---|
782 | function Devices_list_CreateFcn(hObject, eventdata, handles) |
---|
783 | % hObject handle to Devices_list (see GCBO) |
---|
784 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
785 | % handles empty - handles not created until after all CreateFcns called |
---|
786 | |
---|
787 | % Hint: listbox controls usually have a white background on Windows. |
---|
788 | % See ISPC and COMPUTER. |
---|
789 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
790 | set(hObject,'BackgroundColor','white'); |
---|
791 | end |
---|
792 | |
---|
793 | |
---|
794 | % --- Executes on selection change in attribute_list. |
---|
795 | function attribute_list_Callback(hObject, eventdata, handles) |
---|
796 | % hObject handle to attribute_list (see GCBO) |
---|
797 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
798 | % handles structure with handles and user data (see GUIDATA) |
---|
799 | |
---|
800 | % Hints: contents = get(hObject,'String') returns attribute_list contents as cell array |
---|
801 | % contents{get(hObject,'Value')} returns selected item from attribute_list |
---|
802 | Val=get(handles.attribute_list,'value'); |
---|
803 | String=get(handles.attribute_list,'string'); |
---|
804 | attribute=String{Val}; |
---|
805 | |
---|
806 | switch attribute |
---|
807 | case{'DDTriggerCounter','DDBufferFreezingEnabled','DDBufferFrozen','ExternalTriggerEnabled','PMNotified','XHigh','XLow','ZHigh','ZLow','MC locked','XRMSPosSA','ZRMSPosSA','State','Status'} |
---|
808 | set(handles.Write_attribute,'Enable','off') |
---|
809 | otherwise |
---|
810 | set(handles.Write_attribute,'Enable','on') |
---|
811 | end |
---|
812 | |
---|
813 | % --- Executes during object creation, after setting all properties. |
---|
814 | function attribute_list_CreateFcn(hObject, eventdata, handles) |
---|
815 | % hObject handle to attribute_list (see GCBO) |
---|
816 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
817 | % handles empty - handles not created until after all CreateFcns called |
---|
818 | |
---|
819 | % Hint: listbox controls usually have a white background on Windows. |
---|
820 | % See ISPC and COMPUTER. |
---|
821 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
822 | set(hObject,'BackgroundColor','white'); |
---|
823 | end |
---|
824 | |
---|
825 | |
---|
826 | % --- Executes on button press in Read_attribute. |
---|
827 | function Read_attribute_Callback(hObject, eventdata, handles) |
---|
828 | % hObject handle to Read_attribute (see GCBO) |
---|
829 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
830 | % handles structure with handles and user data (see GUIDATA) |
---|
831 | |
---|
832 | Val=get(handles.attribute_list,'value'); |
---|
833 | String=get(handles.attribute_list,'string'); |
---|
834 | attribute=String{Val}; |
---|
835 | |
---|
836 | list=get(handles.Devices_list,'string'); |
---|
837 | index=get(handles.Devices_list,'value'); |
---|
838 | Dev_List=list(index,:) |
---|
839 | switch attribute |
---|
840 | case {'XPosDD','ZPosDD','QuadDD','SumDD','VaDD','VbDD','VcDD','VdDD','XPosSAHistory','ZPosSAHistory','XPosPM','ZPosPM','QuadPM','SumPM','VaPM','VbPM','VcPM','VdPM','InterlockConfiguration','ADCChannelA','ADCChannelB','ADCChannelC','ADCChannelD'} |
---|
841 | if(size(Dev_List,1)~=1) |
---|
842 | warndlg('You can not select more than 1 Dserver to display an attribute that is a vector') |
---|
843 | else |
---|
844 | res=tango_read_attribute2(Dev_List(1,:),attribute); |
---|
845 | axes(handles.graph); |
---|
846 | plot(res.value); |
---|
847 | ylabel('mm'); |
---|
848 | title(attribute); |
---|
849 | end |
---|
850 | otherwise |
---|
851 | %h = waitbar(0,'Please wait...'); |
---|
852 | groupe=create_bpm_group(Dev_List); |
---|
853 | result=tango_group_read_attribute(groupe,attribute,1) |
---|
854 | tango_group_kill(groupe); |
---|
855 | for i=1:1:size(Dev_List,1) |
---|
856 | val_list(i)=result.replies(i).value(1); |
---|
857 | % switch attribute |
---|
858 | % case 'MC locked' |
---|
859 | % if i==1 |
---|
860 | % MCstatus_file=fopen('MC_Locked_satus.txt','wt'); |
---|
861 | % end |
---|
862 | % libera_ip=tango_get_property2(Dev_List(i,:),'LiberaIpAddr'); |
---|
863 | % fid=fopen('liste-IP-libera-test.txt','wt'); |
---|
864 | % fprintf(fid,libera_ip.value{1}); |
---|
865 | % fclose(fid); |
---|
866 | % command='./Read_MC_lock_anneau.sh liste-IP-libera-test.txt'; |
---|
867 | % [status,result]=unix(command,'-echo'); |
---|
868 | % lmtd_index=regexp(result,'lmtd'); |
---|
869 | % if isempty(lmtd_index) |
---|
870 | % ligne=[Dev_List(i,:),' ',libera_ip.value{1},' no locked message\n']; |
---|
871 | % val_list(i,:)=[Dev_List(i,5:8),Dev_List(i,12:16),' not locked']; |
---|
872 | % else |
---|
873 | % return_index_array=regexp(result,'\n'); |
---|
874 | % return_index=find(return_index_array>lmtd_index,1)-1; |
---|
875 | % start_line_index=return_index_array(return_index)+1; |
---|
876 | % stop_line_index=return_index_array(return_index+1); |
---|
877 | % ligne=[Dev_List(i,:),' ',result(start_line_index:stop_line_index)]; |
---|
878 | % if isempty(regexp(ligne,' locked')) |
---|
879 | % val_list(i,:)=[Dev_List(i,5:8),Dev_List(i,12:16),' unlocked']; |
---|
880 | % else |
---|
881 | % val_list(i,:)=[Dev_List(i,5:8),Dev_List(i,12:16),' locked']; |
---|
882 | % end |
---|
883 | % end |
---|
884 | % fprintf(MCstatus_file,ligne); |
---|
885 | % if(i==size(Dev_List,1)) |
---|
886 | % fclose(MCstatus_file); |
---|
887 | % % edit('MC_Locked_satus.txt'); |
---|
888 | % end |
---|
889 | % |
---|
890 | % otherwise |
---|
891 | |
---|
892 | |
---|
893 | % res=tango_read_attribute2(Dev_List(i,:),attribute); |
---|
894 | % val_list(i)=res.value(1); |
---|
895 | |
---|
896 | % waitbar(i/size(Dev_List,1)); |
---|
897 | end |
---|
898 | |
---|
899 | set(handles.Attribute_current_value_list,'value',1) |
---|
900 | set(handles.Attribute_current_value_list,'string',val_list); |
---|
901 | %close(h); |
---|
902 | end |
---|
903 | % --- Executes on button press in Write_attribute. |
---|
904 | function Write_attribute_Callback(hObject, eventdata, handles) |
---|
905 | % hObject handle to Write_attribute (see GCBO) |
---|
906 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
907 | % handles structure with handles and user data (see GUIDATA) |
---|
908 | |
---|
909 | |
---|
910 | Val=get(handles.attribute_list,'value'); |
---|
911 | String=get(handles.attribute_list,'string'); |
---|
912 | attribute=String{Val}; |
---|
913 | switch attribute |
---|
914 | case {'DDBufferSize','ADCBufferSize','RMSSamples','TimePhase','OffsetTune','MAFDelay','MAFLength','SwitchingDelay','SAStatNumSamples','DDTriggerOffset','PMOffset'} |
---|
915 | disp('toto') |
---|
916 | New_value=int32(str2num(get(handles.Attribute_next_value,'string'))); |
---|
917 | case {'DDEnabled', 'SAEnabled','ADCEnabled','AGCEnabled','CompensateTune','ExternalSwitching','HasMAFSupport','UseLiberaSAData'} |
---|
918 | New_value=uint8(str2num(get(handles.Attribute_next_value,'string'))); |
---|
919 | case {'Switches','DSCMode'} |
---|
920 | New_value=int16(str2num(get(handles.Attribute_next_value,'string'))); |
---|
921 | case 'DDDecimationFactor' |
---|
922 | New_value=uint16(str2num(get(handles.Attribute_next_value,'string'))); |
---|
923 | case 'Gain' |
---|
924 | New_value=(str2num(get(handles.Attribute_next_value,'string'))); |
---|
925 | case {'MachineTime','SystemTime','MaxIncoherence','MaxIncoherenceDrift'} |
---|
926 | New_value=double(str2num(get(handles.Attribute_next_value,'string'))); |
---|
927 | otherwise |
---|
928 | end |
---|
929 | |
---|
930 | list=get(handles.Devices_list,'string'); |
---|
931 | index=get(handles.Devices_list,'value'); |
---|
932 | Dev_List=list(index,:); |
---|
933 | |
---|
934 | groupe=create_bpm_group(Dev_List); |
---|
935 | tango_group_write_attribute(groupe,attribute,1,New_value) |
---|
936 | % |
---|
937 | % for i=1:1:size(Dev_List,1) |
---|
938 | % tango_write_attribute2(Dev_List(i,:),attribute,New_value); |
---|
939 | % end |
---|
940 | |
---|
941 | % Val=get(handles.attribute_list,'value'); |
---|
942 | % String=get(handles.attribute_list,'string'); |
---|
943 | % attribute=String{Val}; |
---|
944 | %groupe=create_bpm_group(Dev_List); |
---|
945 | pause(1.3); |
---|
946 | result=tango_group_read_attribute(groupe,attribute,1) |
---|
947 | tango_group_kill(groupe); |
---|
948 | if result.has_failed==0 |
---|
949 | for i=1:1:size(Dev_List,1) |
---|
950 | % res=tango_read_attribute2(Dev_List(i,:),attribute); |
---|
951 | % val_list(i)=res.value(1); |
---|
952 | val_list(i)=result.replies(i).value(1); |
---|
953 | end |
---|
954 | set(handles.Attribute_current_value_list,'string',val_list); |
---|
955 | else |
---|
956 | errordlg('read faild on at least one BPM'); |
---|
957 | end; |
---|
958 | |
---|
959 | function Attribute_next_value_Callback(hObject, eventdata, handles) |
---|
960 | % hObject handle to Attribute_next_value (see GCBO) |
---|
961 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
962 | % handles structure with handles and user data (see GUIDATA) |
---|
963 | |
---|
964 | % Hints: get(hObject,'String') returns contents of Attribute_next_value as text |
---|
965 | % str2double(get(hObject,'String')) returns contents of Attribute_next_value as a double |
---|
966 | |
---|
967 | |
---|
968 | % --- Executes during object creation, after setting all properties. |
---|
969 | function Attribute_next_value_CreateFcn(hObject, eventdata, handles) |
---|
970 | % hObject handle to Attribute_next_value (see GCBO) |
---|
971 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
972 | % handles empty - handles not created until after all CreateFcns called |
---|
973 | |
---|
974 | % Hint: edit controls usually have a white background on Windows. |
---|
975 | % See ISPC and COMPUTER. |
---|
976 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
977 | set(hObject,'BackgroundColor','white'); |
---|
978 | end |
---|
979 | |
---|
980 | |
---|
981 | % --- Executes on selection change in Attribute_current_value_list. |
---|
982 | function Attribute_current_value_list_Callback(hObject, eventdata, handles) |
---|
983 | % hObject handle to Attribute_current_value_list (see GCBO) |
---|
984 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
985 | % handles structure with handles and user data (see GUIDATA) |
---|
986 | |
---|
987 | % Hints: contents = get(hObject,'String') returns Attribute_current_value_list contents as cell array |
---|
988 | % contents{get(hObject,'Value')} returns selected item from Attribute_current_value_list |
---|
989 | |
---|
990 | % list=get(handles.Devices_list,'string'); |
---|
991 | % index=get(handles.Devices_list,'value'); |
---|
992 | % Dev_List=list(index,:); |
---|
993 | % |
---|
994 | % index_attributs=get(handles.Attribute_current_value_list,'value') |
---|
995 | % corresponding_device=Dev_List(index_attributs,:) |
---|
996 | % index(1)-1+index_attributs |
---|
997 | % set(handles.Devices_list,'value',index-1+index_attributs) |
---|
998 | |
---|
999 | % --- Executes during object creation, after setting all properties. |
---|
1000 | function Attribute_current_value_list_CreateFcn(hObject, eventdata, handles) |
---|
1001 | % hObject handle to Attribute_current_value_list (see GCBO) |
---|
1002 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1003 | % handles empty - handles not created until after all CreateFcns called |
---|
1004 | |
---|
1005 | % Hint: listbox controls usually have a white background on Windows. |
---|
1006 | % See ISPC and COMPUTER. |
---|
1007 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
1008 | set(hObject,'BackgroundColor','white'); |
---|
1009 | end |
---|
1010 | |
---|
1011 | |
---|
1012 | % --- Executes on selection change in Commands_list. |
---|
1013 | function Commands_list_Callback(hObject, eventdata, handles) |
---|
1014 | % hObject handle to Commands_list (see GCBO) |
---|
1015 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1016 | % handles structure with handles and user data (see GUIDATA) |
---|
1017 | |
---|
1018 | % Hints: contents = get(hObject,'String') returns Commands_list contents as cell array |
---|
1019 | % contents{get(hObject,'Value')} returns selected item from Commands_list |
---|
1020 | |
---|
1021 | |
---|
1022 | % --- Executes during object creation, after setting all properties. |
---|
1023 | function Commands_list_CreateFcn(hObject, eventdata, handles) |
---|
1024 | % hObject handle to Commands_list (see GCBO) |
---|
1025 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1026 | % handles empty - handles not created until after all CreateFcns called |
---|
1027 | |
---|
1028 | % Hint: listbox controls usually have a white background on Windows. |
---|
1029 | % See ISPC and COMPUTER. |
---|
1030 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
1031 | set(hObject,'BackgroundColor','white'); |
---|
1032 | end |
---|
1033 | |
---|
1034 | |
---|
1035 | % --- Executes on button press in Apply_command. |
---|
1036 | function Apply_command_Callback(hObject, eventdata, handles) |
---|
1037 | % hObject handle to Apply_command (see GCBO) |
---|
1038 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1039 | % handles structure with handles and user data (see GUIDATA) |
---|
1040 | Val=get(handles.Commands_list,'value'); |
---|
1041 | String=get(handles.Commands_list,'string'); |
---|
1042 | commande=String{Val}; |
---|
1043 | |
---|
1044 | list=get(handles.Devices_list,'string'); |
---|
1045 | index=get(handles.Devices_list,'value'); |
---|
1046 | Dev_List=list(index,:); |
---|
1047 | |
---|
1048 | switch commande |
---|
1049 | case {'Detune','Retune','Design'} |
---|
1050 | h = waitbar(0,'Please wait...'); |
---|
1051 | for i=1:1:size(Dev_List,1) |
---|
1052 | waitbar(i/size(Dev_List,1)); |
---|
1053 | libera_ip=tango_get_property2(Dev_List(i,:),'LiberaIpAddr') |
---|
1054 | fid=fopen('liste-IP-libera-test.txt','wt'); |
---|
1055 | fprintf(fid,libera_ip.value{1}); |
---|
1056 | fclose(fid); |
---|
1057 | if commande=='Detune' |
---|
1058 | command='./Detune_liste.sh liste-IP-libera-test.txt'; |
---|
1059 | [status,result]=unix(command,'-echo'); |
---|
1060 | detune_index=regexp(result,' -o '); |
---|
1061 | if isempty(detune_index) |
---|
1062 | val_list(i,:)=[Dev_List(i,5:8),Dev_List(i,12:16),' no detuning']; |
---|
1063 | else |
---|
1064 | ligne=[result(detune_index+1:detune_index+5),' ']; |
---|
1065 | val_list(i,:)=[Dev_List(i,5:8),Dev_List(i,12:16),' ',ligne]; |
---|
1066 | end |
---|
1067 | end |
---|
1068 | if commande=='Retune' |
---|
1069 | command='./Retune_liste.sh liste-IP-libera-test.txt'; |
---|
1070 | [status,result]=unix(command,'-echo'); |
---|
1071 | detune_index=regexp(result,' -o '); |
---|
1072 | if isempty(detune_index) |
---|
1073 | val_list(i,:)=[Dev_List(i,5:8),Dev_List(i,12:16),' no detuning']; |
---|
1074 | else |
---|
1075 | ligne=[result(detune_index+1:detune_index+5),' ']; |
---|
1076 | val_list(i,:)=[Dev_List(i,5:8),Dev_List(i,12:16),' ',ligne]; |
---|
1077 | end |
---|
1078 | end |
---|
1079 | if commande=='Design' |
---|
1080 | command='./get_FPGA_design.sh liste-IP-libera-test.txt'; |
---|
1081 | [status,result]=unix(command,'-echo'); |
---|
1082 | index=regexp(result,'->'); |
---|
1083 | if isempty(index) |
---|
1084 | val_list(i,:)=[Dev_List(i,5:8),Dev_List(i,12:16),' error']; |
---|
1085 | else |
---|
1086 | ligne=[result(index+15:index+27)]; |
---|
1087 | val_list(i,:)=[Dev_List(i,12:16),' ',ligne]; |
---|
1088 | end |
---|
1089 | end |
---|
1090 | end |
---|
1091 | |
---|
1092 | set(handles.Attribute_current_value_list,'string',val_list); |
---|
1093 | close(h) |
---|
1094 | otherwise |
---|
1095 | |
---|
1096 | groupe=create_bpm_group(Dev_List); |
---|
1097 | tango_group_command_inout2(groupe,commande,0,1) |
---|
1098 | tango_group_kill(groupe); |
---|
1099 | end |
---|
1100 | % for i=1:1:size(Dev_List,1) |
---|
1101 | % switch commande |
---|
1102 | % case 'Set_Time(synchro sur MC)' |
---|
1103 | % libera_ip='0'; |
---|
1104 | % Correspondance=tango_get_db_property('BPM','DeviceParameters'); |
---|
1105 | % for j=1:1:size(Correspondance,2) |
---|
1106 | % ligne=regexpi(Correspondance{j},Dev_List(i,:)); |
---|
1107 | % if isempty(ligne)==0 |
---|
1108 | % if size(Correspondance{j},2)==36 |
---|
1109 | % libera_ip=[Correspondance{j}(34),Correspondance{j}(35),Correspondance{j}(36)]; |
---|
1110 | % elseif size(Correspondance{j},2)==35 |
---|
1111 | % libera_ip=[Correspondance{j}(34),Correspondance{j}(35)] ; |
---|
1112 | % elseif size(Correspondance{j},2)==34 |
---|
1113 | % libera_ip=Correspondance{j}(34) ; |
---|
1114 | % end |
---|
1115 | % end |
---|
1116 | % end |
---|
1117 | % set_time_command=['./net-libera -x 0: 172.17.15.',libera_ip] |
---|
1118 | % |
---|
1119 | % unix(set_time_command) |
---|
1120 | % |
---|
1121 | % case 'Detune' |
---|
1122 | % libera_ip=tango_get_property2(Dev_List(i,:),'LiberaIpAddr') |
---|
1123 | % fid=fopen('liste-IP-libera-test.txt','wt'); |
---|
1124 | % fprintf(fid,libera_ip.value{1}); |
---|
1125 | % fclose(fid); |
---|
1126 | % command='./Detune_liste.sh liste-IP-libera-test.txt'; |
---|
1127 | % [status,result]=unix(command,'-echo'); |
---|
1128 | % detune_index=regexp(result,' -f '); |
---|
1129 | % if isempty(detune_index) |
---|
1130 | % val_list(i,:)=[Dev_List(i,5:8),Dev_List(i,12:16),' no detuning']; |
---|
1131 | % else |
---|
1132 | % ligne=[result(detune_index+1:detune_index+5),' ']; |
---|
1133 | % val_list(i,:)=[Dev_List(i,5:8),Dev_List(i,12:16),' ',ligne]; |
---|
1134 | % end |
---|
1135 | % |
---|
1136 | % case 'Retune' |
---|
1137 | % libera_ip=tango_get_property2(Dev_List(i,:),'LiberaIpAddr') |
---|
1138 | % fid=fopen('liste-IP-libera-test.txt','wt'); |
---|
1139 | % fprintf(fid,libera_ip.value{1}); |
---|
1140 | % fclose(fid); |
---|
1141 | % command='./Retune_liste.sh liste-IP-libera-test.txt'; |
---|
1142 | % [status,result]=unix(command,'-echo'); |
---|
1143 | % detune_index=regexp(result,' -f '); |
---|
1144 | % if isempty(detune_index) |
---|
1145 | % val_list(i,:)=[Dev_List(i,5:8),Dev_List(i,12:16),' no detuning']; |
---|
1146 | % else |
---|
1147 | % ligne=[result(detune_index+1:detune_index+5),' ']; |
---|
1148 | % val_list(i,:)=[Dev_List(i,5:8),Dev_List(i,12:16),' ',ligne]; |
---|
1149 | % end |
---|
1150 | % otherwise |
---|
1151 | |
---|
1152 | % tango_command_inout2(Dev_List(i,:),commande); |
---|
1153 | % end |
---|
1154 | % waitbar(i/size(Dev_List,1)); |
---|
1155 | % end |
---|
1156 | % switch commande |
---|
1157 | % case {'Detune','Retune'} |
---|
1158 | % set(handles.Attribute_current_value_list,'string',val_list); |
---|
1159 | % otherwise |
---|
1160 | % end |
---|
1161 | % close(h) |
---|
1162 | |
---|
1163 | % --- Executes on selection change in property_list. |
---|
1164 | function property_list_Callback(hObject, eventdata, handles) |
---|
1165 | % hObject handle to property_list (see GCBO) |
---|
1166 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1167 | % handles structure with handles and user data (see GUIDATA) |
---|
1168 | |
---|
1169 | % Hints: contents = get(hObject,'String') returns property_list contents as cell array |
---|
1170 | % contents{get(hObject,'Value')} returns selected item from property_list |
---|
1171 | |
---|
1172 | |
---|
1173 | % --- Executes during object creation, after setting all properties. |
---|
1174 | function property_list_CreateFcn(hObject, eventdata, handles) |
---|
1175 | % hObject handle to property_list (see GCBO) |
---|
1176 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1177 | % handles empty - handles not created until after all CreateFcns called |
---|
1178 | |
---|
1179 | % Hint: listbox controls usually have a white background on Windows. |
---|
1180 | % See ISPC and COMPUTER. |
---|
1181 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
1182 | set(hObject,'BackgroundColor','white'); |
---|
1183 | end |
---|
1184 | |
---|
1185 | |
---|
1186 | % --- Executes on selection change in property_current_value_list. |
---|
1187 | function property_current_value_list_Callback(hObject, eventdata, handles) |
---|
1188 | % hObject handle to property_current_value_list (see GCBO) |
---|
1189 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1190 | % handles structure with handles and user data (see GUIDATA) |
---|
1191 | |
---|
1192 | % Hints: contents = get(hObject,'String') returns property_current_value_list contents as cell array |
---|
1193 | % contents{get(hObject,'Value')} returns selected item from property_current_value_list |
---|
1194 | |
---|
1195 | |
---|
1196 | % --- Executes during object creation, after setting all properties. |
---|
1197 | function property_current_value_list_CreateFcn(hObject, eventdata, handles) |
---|
1198 | % hObject handle to property_current_value_list (see GCBO) |
---|
1199 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1200 | % handles empty - handles not created until after all CreateFcns called |
---|
1201 | |
---|
1202 | % Hint: listbox controls usually have a white background on Windows. |
---|
1203 | % See ISPC and COMPUTER. |
---|
1204 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
1205 | set(hObject,'BackgroundColor','white'); |
---|
1206 | end |
---|
1207 | |
---|
1208 | |
---|
1209 | % --- Executes on button press in Read_property. |
---|
1210 | function Read_property_Callback(hObject, eventdata, handles) |
---|
1211 | % hObject handle to Read_property (see GCBO) |
---|
1212 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1213 | % handles structure with handles and user data (see GUIDATA) |
---|
1214 | Val=get(handles.property_list,'value'); |
---|
1215 | propertylist=get(handles.property_list,'string'); |
---|
1216 | list=get(handles.Devices_list,'string'); |
---|
1217 | index=get(handles.Devices_list,'value'); |
---|
1218 | Dev_List=list(index,:); |
---|
1219 | switch Val |
---|
1220 | case {1, 2, 3, 4, 5, 6, 7, 8} |
---|
1221 | Val |
---|
1222 | for i=1:1:size(Dev_List,1) |
---|
1223 | res=tango_get_property2(Dev_List(i,:),'InterlockConfiguration'); |
---|
1224 | val_list(i)=res.value(Val) ; |
---|
1225 | end |
---|
1226 | |
---|
1227 | otherwise |
---|
1228 | for i=1:1:size(Dev_List,1) |
---|
1229 | propertyname=propertylist{Val}; |
---|
1230 | res=tango_get_property2(Dev_List(i,:),propertyname); |
---|
1231 | val_list(i)=res.value; |
---|
1232 | end |
---|
1233 | end |
---|
1234 | set(handles.property_current_value_list,'string',val_list); |
---|
1235 | |
---|
1236 | |
---|
1237 | % --- Executes on button press in Write_property. |
---|
1238 | function Write_property_Callback(hObject, eventdata, handles) |
---|
1239 | % hObject handle to Write_property (see GCBO) |
---|
1240 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1241 | % handles structure with handles and user data (see GUIDATA) |
---|
1242 | confirmation=questdlg('Modifier certaines properties peut déclencher l interlock. Voulez-vous continuer?','Avertissement','Oui','Non','Oui'); |
---|
1243 | switch confirmation |
---|
1244 | case 'Oui' |
---|
1245 | |
---|
1246 | Val=get(handles.property_list,'value'); |
---|
1247 | String=get(handles.property_list,'string'); |
---|
1248 | property_name=String{Val}; |
---|
1249 | list=get(handles.Devices_list,'string'); |
---|
1250 | index=get(handles.Devices_list,'value'); |
---|
1251 | Dev_List=list(index,:); |
---|
1252 | % String=get(handles.property_list,'string'); |
---|
1253 | % property=String{Val}; |
---|
1254 | New_Value=(get(handles.property_next_value,'string')); |
---|
1255 | h = waitbar(0,'Please wait...'); |
---|
1256 | for i=1:1:size(Dev_List,1) |
---|
1257 | if Val<9 |
---|
1258 | res=tango_get_property2(Dev_List(i,:),'UserDefinedStartupEnvParameters'); |
---|
1259 | res.value{Val+10}=New_Value; |
---|
1260 | tango_put_property2(Dev_List(i,:),res.name,res.value); |
---|
1261 | verif=tango_get_property2(Dev_List(i,:),'UserDefinedStartupEnvParameters'); |
---|
1262 | |
---|
1263 | val_list(i)=verif.value(Val+10) ; |
---|
1264 | |
---|
1265 | else |
---|
1266 | res=tango_get_property2(Dev_List(i,:),property_name); |
---|
1267 | res.value={New_Value}; |
---|
1268 | tango_put_property2(Dev_List(i,:),res.name,res.value); |
---|
1269 | verif=tango_get_property2(Dev_List(i,:),property_name); |
---|
1270 | val_list(i,:)=verif.value; |
---|
1271 | end |
---|
1272 | waitbar(i/size(Dev_List,1)); |
---|
1273 | end |
---|
1274 | set(handles.property_current_value_list,'string',val_list); |
---|
1275 | otherwise |
---|
1276 | end |
---|
1277 | close(h); |
---|
1278 | |
---|
1279 | function property_next_value_Callback(hObject, eventdata, handles) |
---|
1280 | % hObject handle to property_next_value (see GCBO) |
---|
1281 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1282 | % handles structure with handles and user data (see GUIDATA) |
---|
1283 | |
---|
1284 | % Hints: get(hObject,'String') returns contents of property_next_value as text |
---|
1285 | % str2double(get(hObject,'String')) returns contents of property_next_value as a double |
---|
1286 | |
---|
1287 | |
---|
1288 | % --- Executes during object creation, after setting all properties. |
---|
1289 | function property_next_value_CreateFcn(hObject, eventdata, handles) |
---|
1290 | % hObject handle to property_next_value (see GCBO) |
---|
1291 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1292 | % handles empty - handles not created until after all CreateFcns called |
---|
1293 | |
---|
1294 | % Hint: edit controls usually have a white background on Windows. |
---|
1295 | % See ISPC and COMPUTER. |
---|
1296 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
1297 | set(hObject,'BackgroundColor','white'); |
---|
1298 | end |
---|
1299 | |
---|
1300 | |
---|
1301 | % --- Executes on button press in ssh. |
---|
1302 | function ssh_Callback(hObject, eventdata, handles) |
---|
1303 | % hObject handle to ssh (see GCBO) |
---|
1304 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1305 | % handles structure with handles and user data (see GUIDATA) |
---|
1306 | list=get(handles.Devices_list,'string'); |
---|
1307 | index=get(handles.Devices_list,'value'); |
---|
1308 | Dev_List=list(index,:); |
---|
1309 | if(size(Dev_List,1)~=1) |
---|
1310 | warndlg('You can not select more than 1 Dserver to connect to a libera') |
---|
1311 | else |
---|
1312 | commandwindow |
---|
1313 | IP_address=tango_get_property2(Dev_List(1,:),'LiberaIPAddr'); |
---|
1314 | command=['ssh root@',IP_address.value{1}] |
---|
1315 | unix(command,'-echo') |
---|
1316 | end |
---|
1317 | |
---|