source: MML/trunk/machine/SOLEIL/StorageRing/diagnostics/Config_Dserver_BPM.m @ 17

Last change on this file since 17 was 17, checked in by zhangj, 10 years ago

To have a stable version on the server.

  • Property svn:executable set to *
File size: 47.1 KB
Line 
1function 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
28gui_Singleton = 1;
29gui_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',   []);
35if nargin && ischar(varargin{1})
36    gui_State.gui_Callback = str2func(varargin{1});
37end
38
39if nargout
40    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
41else
42    gui_mainfcn(gui_State, varargin{:});
43end
44% End initialization code - DO NOT EDIT
45
46
47% --- Executes just before Config_Dserver_BPM is made visible.
48function 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)
53for i=1:1:16
54handles.table(i)=0;
55end
56% varargin   command line arguments to Config_Dserver_BPM (see VARARGIN)
57
58% Choose default command line output for Config_Dserver_BPM
59handles.output = hObject;
60
61% Update handles structure
62guidata(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.
69function 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
76varargout{1} = handles.output;
77
78% --- Executes on button press in Booster.
79function 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
85set(handles.Tune_BPM,'value',0);
86set(handles.LT2,'value',0);
87set(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
109List=0;
110Index=0;
111handles.table
112set(handles.Devices_list,'value',1)
113List=Get_Dev_List('Booster');
114for j=1:1:size(List,1)
115    Dev_List(Index+j,:)=List(j,:);
116end
117set(handles.Devices_list,'string',Dev_List);
118current_list=get(handles.Devices_list,'string');
119Index=size(current_list,1);
120
121% --- Executes on button press in LT2.
122function 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
128set(handles.Tune_BPM,'value',0);
129set(handles.Booster,'value',0);
130set(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
152List=0;
153Index=0;
154handles.table
155set(handles.Devices_list,'value',1)
156List=Get_Dev_List('LT2');
157for j=1:1:size(List,1)
158    Dev_List(Index+j,:)=List(j,:);
159end
160set(handles.Devices_list,'string',Dev_List);
161current_list=get(handles.Devices_list,'string');
162Index=size(current_list,1);
163
164% --- Executes on button press in Baie_test.
165function 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
195List=0;
196Index=0;
197handles.table
198set(handles.Devices_list,'value',1)
199List=Get_Dev_List('test');
200for j=1:1:size(List,1)
201    Dev_List(Index+j,:)=List(j,:);
202end
203set(handles.Devices_list,'string',Dev_List);
204current_list=get(handles.Devices_list,'string');
205Index=size(current_list,1);
206
207% --- Executes on button press in Tune_BPM.
208function 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
214set(handles.LT2,'value',0);
215set(handles.Booster,'value',0);
216set(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
238List=0;
239Index=0;
240handles.table
241set(handles.Devices_list,'value',1)
242List=Get_Dev_List('Tune_BPM');
243for j=1:1:size(List,1)
244    Dev_List(Index+j,:)=List(j,:);
245end
246set(handles.Devices_list,'string',Dev_List);
247current_list=get(handles.Devices_list,'string');
248Index=size(current_list,1);
249
250
251% --- Executes on button press in All.
252function 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
259set(handles.LT2,'value',0);
260set(handles.Tune_BPM,'value',0);
261set(handles.Booster,'value',0);
262all=get(handles.All,'value');
263set(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
284List=0;
285Index=0;
286handles.table
287set(handles.Devices_list,'value',1)
288
289
290if 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);
298end 
299
300if all==0
301    set(handles.Devices_list,'string','');
302end
303   
304
305% --- Executes on button press in Baie1.
306function 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)
310set(handles.LT2,'value',0);
311set(handles.Tune_BPM,'value',0);
312set(handles.Booster,'value',0);
313set(handles.Baie_test,'value',0);
314handles.table(1)=get(handles.Baie1,'value');
315val=handles.table
316guidata(hObject, handles);
317% Hint: get(hObject,'Value') returns toggle state of Baie1
318List=0;
319Index=0;
320handles.table
321set(handles.Devices_list,'value',1)
322for 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 
332end
333
334% --- Executes on button press in Baie2.
335function 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)
339set(handles.LT2,'value',0);
340set(handles.Tune_BPM,'value',0);
341set(handles.Booster,'value',0);
342set(handles.Baie_test,'value',0);
343handles.table(2)=get(handles.Baie2,'value');
344guidata(hObject, handles);
345% Hint: get(hObject,'Value') returns toggle state of Baie2
346List=0;
347Index=0;
348handles.table
349set(handles.Devices_list,'value',1)
350for 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 
360end
361
362% --- Executes on button press in Baie3.
363function 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)
367set(handles.LT2,'value',0);
368set(handles.Tune_BPM,'value',0);
369set(handles.Booster,'value',0);
370set(handles.Baie_test,'value',0);
371handles.table(3)=get(handles.Baie3,'value');
372guidata(hObject, handles);
373
374% Hint: get(hObject,'Value') returns toggle state of Baie3
375List=0;
376Index=0;
377handles.table
378set(handles.Devices_list,'value',1)
379for 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 
389end
390
391% --- Executes on button press in Baie4.
392function 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)
396set(handles.LT2,'value',0);
397set(handles.Tune_BPM,'value',0);
398set(handles.Booster,'value',0);
399set(handles.Baie_test,'value',0);
400handles.table(4)=get(handles.Baie4,'value');
401guidata(hObject, handles);
402
403% Hint: get(hObject,'Value') returns toggle state of Baie4
404List=0;
405Index=0;
406handles.table
407set(handles.Devices_list,'value',1)
408for 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 
418end
419
420% --- Executes on button press in Baie5.
421function 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)
425set(handles.LT2,'value',0);
426set(handles.Tune_BPM,'value',0);
427set(handles.Booster,'value',0);
428set(handles.Baie_test,'value',0);
429handles.table(5)=get(handles.Baie5,'value');
430guidata(hObject, handles);
431
432% Hint: get(hObject,'Value') returns toggle state of Baie5
433List=0;
434Index=0;
435handles.table
436set(handles.Devices_list,'value',1)
437for 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 
447end
448
449% --- Executes on button press in Baie6.
450function 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)
454set(handles.LT2,'value',0);
455set(handles.Tune_BPM,'value',0);
456set(handles.Booster,'value',0);
457set(handles.Baie_test,'value',0);
458handles.table(6)=get(handles.Baie6,'value');
459guidata(hObject, handles);
460
461% Hint: get(hObject,'Value') returns toggle state of Baie6
462List=0;
463Index=0;
464handles.table
465set(handles.Devices_list,'value',1)
466for 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 
476end
477
478% --- Executes on button press in Baie7.
479function 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)
483set(handles.LT2,'value',0);
484set(handles.Tune_BPM,'value',0);
485set(handles.Booster,'value',0);
486set(handles.Baie_test,'value',0);
487handles.table(7)=get(handles.Baie7,'value');
488guidata(hObject, handles);
489
490% Hint: get(hObject,'Value') returns toggle state of Baie7
491List=0;
492Index=0;
493handles.table
494set(handles.Devices_list,'value',1)
495for 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 
505end
506
507% --- Executes on button press in Baie8.
508function 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)
512set(handles.LT2,'value',0);
513set(handles.Tune_BPM,'value',0);
514set(handles.Booster,'value',0);
515set(handles.Baie_test,'value',0);
516handles.table(8)=get(handles.Baie8,'value');
517guidata(hObject, handles);
518
519% Hint: get(hObject,'Value') returns toggle state of Baie8
520List=0;
521Index=0;
522handles.table
523set(handles.Devices_list,'value',1)
524for 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 
534end
535
536% --- Executes on button press in Baie9.
537function 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)
541set(handles.LT2,'value',0);
542set(handles.Tune_BPM,'value',0);
543set(handles.Booster,'value',0);
544set(handles.Baie_test,'value',0);
545handles.table(9)=get(handles.Baie9,'value');
546guidata(hObject, handles);
547
548% Hint: get(hObject,'Value') returns toggle state of Baie9
549List=0;
550Index=0;
551handles.table
552set(handles.Devices_list,'value',1)
553for 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 
563end
564
565% --- Executes on button press in Baie10.
566function 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)
570set(handles.LT2,'value',0);
571set(handles.Tune_BPM,'value',0);
572set(handles.Booster,'value',0);
573set(handles.Baie_test,'value',0);
574handles.table(10)=get(handles.Baie10,'value');
575guidata(hObject, handles);
576
577% Hint: get(hObject,'Value') returns toggle state of Baie10
578List=0;
579Index=0;
580handles.table
581set(handles.Devices_list,'value',1)
582for 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 
592end
593
594% --- Executes on button press in Baie11.
595function 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)
599set(handles.LT2,'value',0);
600set(handles.Tune_BPM,'value',0);
601set(handles.Booster,'value',0);
602set(handles.Baie_test,'value',0);
603handles.table(11)=get(handles.Baie11,'value');
604guidata(hObject, handles);
605
606% Hint: get(hObject,'Value') returns toggle state of Baie11
607List=0;
608Index=0;
609handles.table
610set(handles.Devices_list,'value',1)
611for 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 
621end
622
623% --- Executes on button press in Baie12.
624function 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)
628set(handles.LT2,'value',0);
629set(handles.Tune_BPM,'value',0);
630set(handles.Booster,'value',0);
631set(handles.Baie_test,'value',0);
632handles.table(12)=get(handles.Baie12,'value');
633guidata(hObject, handles);
634
635% Hint: get(hObject,'Value') returns toggle state of Baie12
636List=0;
637Index=0;
638handles.table
639set(handles.Devices_list,'value',1)
640for 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 
650end
651
652% --- Executes on button press in Baie13.
653function 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)
657set(handles.LT2,'value',0);
658set(handles.Tune_BPM,'value',0);
659set(handles.Booster,'value',0);
660set(handles.Baie_test,'value',0);
661handles.table(13)=get(handles.Baie13,'value');
662guidata(hObject, handles);
663
664% Hint: get(hObject,'Value') returns toggle state of Baie13
665List=0;
666Index=0;
667handles.table
668set(handles.Devices_list,'value',1)
669for 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 
679end
680
681% --- Executes on button press in Baie14.
682function 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)
686set(handles.LT2,'value',0);
687set(handles.Tune_BPM,'value',0);
688set(handles.Booster,'value',0);
689set(handles.Baie_test,'value',0);
690handles.table(14)=get(handles.Baie14,'value');
691guidata(hObject, handles);
692
693% Hint: get(hObject,'Value') returns toggle state of Baie14
694List=0;
695Index=0;
696handles.table
697set(handles.Devices_list,'value',1)
698for 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 
708end
709
710% --- Executes on button press in Baie15.
711function 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)
715set(handles.LT2,'value',0);
716set(handles.Tune_BPM,'value',0);
717set(handles.Booster,'value',0);
718set(handles.Baie_test,'value',0);
719handles.table(15)=get(handles.Baie15,'value');
720guidata(hObject, handles);
721
722% Hint: get(hObject,'Value') returns toggle state of Baie15
723List=0;
724Index=0;
725handles.table
726set(handles.Devices_list,'value',1)
727for 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 
737end
738
739% --- Executes on button press in Baie16.
740function 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)
744set(handles.LT2,'value',0);
745set(handles.Tune_BPM,'value',0);
746set(handles.Booster,'value',0);
747set(handles.Baie_test,'value',0);
748handles.table(16)=get(handles.Baie16,'value');
749guidata(hObject, handles);
750
751% Hint: get(hObject,'Value') returns toggle state of Baie16
752List=0;
753Index=0;
754handles.table
755set(handles.Devices_list,'value',1)
756for 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 
766end
767
768
769
770
771% --- Executes on selection change in Devices_list.
772function 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.
782function 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.
789if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
790    set(hObject,'BackgroundColor','white');
791end
792
793
794% --- Executes on selection change in attribute_list.
795function 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
802Val=get(handles.attribute_list,'value');
803String=get(handles.attribute_list,'string');
804attribute=String{Val};
805
806switch 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')
811end
812
813% --- Executes during object creation, after setting all properties.
814function 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.
821if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
822    set(hObject,'BackgroundColor','white');
823end
824
825
826% --- Executes on button press in Read_attribute.
827function 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
832Val=get(handles.attribute_list,'value');
833String=get(handles.attribute_list,'string');
834attribute=String{Val};
835
836list=get(handles.Devices_list,'string');
837index=get(handles.Devices_list,'value');
838Dev_List=list(index,:)
839switch 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...');
852groupe=create_bpm_group(Dev_List);
853result=tango_group_read_attribute(groupe,attribute,1)
854tango_group_kill(groupe);
855for i=1:1:size(Dev_List,1)
856val_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));
897end
898
899set(handles.Attribute_current_value_list,'value',1)
900set(handles.Attribute_current_value_list,'string',val_list);
901%close(h);
902end
903% --- Executes on button press in Write_attribute.
904function 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
910Val=get(handles.attribute_list,'value');
911String=get(handles.attribute_list,'string');
912attribute=String{Val};
913switch 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
928end
929
930list=get(handles.Devices_list,'string');
931index=get(handles.Devices_list,'value');
932Dev_List=list(index,:);
933
934groupe=create_bpm_group(Dev_List);
935tango_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);
945pause(1.3);
946result=tango_group_read_attribute(groupe,attribute,1)
947tango_group_kill(groupe);
948if 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
954set(handles.Attribute_current_value_list,'string',val_list);
955else
956    errordlg('read faild on at least one BPM');
957end;
958
959function 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.
969function 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.
976if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
977    set(hObject,'BackgroundColor','white');
978end
979
980
981% --- Executes on selection change in Attribute_current_value_list.
982function 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.
1000function 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.
1007if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1008    set(hObject,'BackgroundColor','white');
1009end
1010
1011
1012% --- Executes on selection change in Commands_list.
1013function 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.
1023function 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.
1030if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1031    set(hObject,'BackgroundColor','white');
1032end
1033
1034
1035% --- Executes on button press in Apply_command.
1036function 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)
1040Val=get(handles.Commands_list,'value');
1041String=get(handles.Commands_list,'string');
1042commande=String{Val};
1043
1044list=get(handles.Devices_list,'string');
1045index=get(handles.Devices_list,'value');
1046Dev_List=list(index,:);
1047
1048switch 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);
1099end
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.
1164function 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.
1174function 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.
1181if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1182    set(hObject,'BackgroundColor','white');
1183end
1184
1185
1186% --- Executes on selection change in property_current_value_list.
1187function 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.
1197function 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.
1204if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1205    set(hObject,'BackgroundColor','white');
1206end
1207
1208
1209% --- Executes on button press in Read_property.
1210function 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)
1214Val=get(handles.property_list,'value');
1215propertylist=get(handles.property_list,'string');
1216list=get(handles.Devices_list,'string');
1217index=get(handles.Devices_list,'value');
1218Dev_List=list(index,:);
1219switch 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
1233end
1234set(handles.property_current_value_list,'string',val_list);
1235
1236
1237% --- Executes on button press in Write_property.
1238function 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)
1242confirmation=questdlg('Modifier certaines properties peut déclencher l interlock. Voulez-vous continuer?','Avertissement','Oui','Non','Oui');
1243switch 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
1276end
1277close(h);
1278
1279function 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.
1289function 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.
1296if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1297    set(hObject,'BackgroundColor','white');
1298end
1299
1300
1301% --- Executes on button press in ssh.
1302function 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)
1306list=get(handles.Devices_list,'string');
1307index=get(handles.Devices_list,'value');
1308Dev_List=list(index,:);
1309if(size(Dev_List,1)~=1)
1310warndlg('You can not select more than 1 Dserver to connect to a libera')
1311else
1312    commandwindow
1313    IP_address=tango_get_property2(Dev_List(1,:),'LiberaIPAddr');
1314    command=['ssh root@',IP_address.value{1}]
1315    unix(command,'-echo')
1316end
1317
Note: See TracBrowser for help on using the repository browser.