source: MML/trunk/machine/SOLEIL/StorageRing/bpm/Post_Mortem.m @ 4

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

Initial import--MML version from SOLEIL@2013

File size: 29.8 KB
Line 
1function varargout = Post_Mortem(varargin)
2% POST_MORTEM M-file for Post_Mortem.fig
3%      POST_MORTEM, by itself, creates a new POST_MORTEM or raises the existing
4%      singleton*.
5%
6%      H = POST_MORTEM returns the handle to a new POST_MORTEM or the handle to
7%      the existing singleton*.
8%
9%      POST_MORTEM('CALLBACK',hObject,eventData,handles,...) calls the local
10%      function named CALLBACK in POST_MORTEM.M with the given input arguments.
11%
12%      POST_MORTEM('Property','Value',...) creates a new POST_MORTEM or raises the
13%      existing singleton*.  Starting from the left, property value pairs are
14%      applied to the GUI before Post_Mortem_OpeningFunction gets called.  An
15%      unrecognized property name or invalid value makes property application
16%      stop.  All inputs are passed to Post_Mortem_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 Post_Mortem
24
25% Last Modified by GUIDE v2.5 20-Nov-2007 16:03:15
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', @Post_Mortem_OpeningFcn, ...
32                   'gui_OutputFcn',  @Post_Mortem_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 Post_Mortem is made visible.
48function Post_Mortem_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% varargin   command line arguments to Post_Mortem (see VARARGIN)
54% Choose default command line output for Post_Mortem
55handles.output = hObject;
56
57% Update handles structure
58guidata(hObject, handles);
59
60% UIWAIT makes Post_Mortem wait for user response (see UIRESUME)
61% uiwait(handles.figure1);
62
63
64% --- Outputs from this function are returned to the command line.
65function varargout = Post_Mortem_OutputFcn(hObject, eventdata, handles)
66% varargout  cell array for returning output args (see VARARGOUT);
67% hObject    handle to figure
68% eventdata  reserved - to be defined in a future version of MATLAB
69% handles    structure with handles and user data (see GUIDATA)
70
71% Get default command line output from handles structure
72varargout{1} = handles.output;
73
74
75% --- Executes on button press in pushbutton2.
76function pushbutton2_Callback(hObject, eventdata, handles)
77% hObject    handle to pushbutton2 (see GCBO)
78% eventdata  reserved - to be defined in a future version of MATLAB
79% handles    structure with handles and user data (see GUIDATA)
80
81uiopen(getfamilydata('Directory','BPMPostmortem'));
82
83%X=[start:1:Endaff];
84 for i=1:1:16000
85    handles.toto.value(i)=0;
86 end
87handles.res1=res;
88handles.zoomx=0;
89handles.zoomz=0;
90handles.limitex=10;
91handles.limitez=5;
92handles.start=1;
93handles.Endaff=15000;
94handles.cellule=1;
95guidata(hObject, handles);
96pushbutton3_Callback(hObject, eventdata, handles);
97set(handles.pushbutton19,'BackgroundColor',[0.831,0.816,0.784]);
98set(handles.pushbutton20,'BackgroundColor',[0.831,0.816,0.784]);
99readnotification(handles)
100
101% --- Executes on button press in pushbutton3.
102function pushbutton3_Callback(hObject, eventdata, handles)
103% hObject    handle to pushbutton3 (see GCBO)
104% eventdata  reserved - to be defined in a future version of MATLAB
105% handles    structure with handles and user data (see GUIDATA)
106
107handles.cellule=1;
108guidata(hObject, handles);
109affiche(handles);
110efface_bouton(handles);
111set(handles.pushbutton3,'BackgroundColor','green');
112
113
114function affiche(handles);
115
116res=handles.res1;
117cellule = handles.cellule;   
118switch (cellule);
119    case 1
120        affbpm=0;
121    case 2
122        affbpm=7;
123    case 3
124        affbpm=15;
125    case 4
126        affbpm=23;
127    case 5
128        affbpm=30;
129    case 6
130        affbpm=37;
131    case 7
132        affbpm=45;
133    case 8
134        affbpm=53;
135    case 9
136        affbpm=60;
137    case 10
138        affbpm=67;
139    case 11
140        affbpm=75;
141    case 12
142        affbpm=83;
143    case 13
144        affbpm=90;
145    case 14
146        affbpm=97;
147    case 15
148        affbpm=105;
149    case 16
150        affbpm=113;
151    otherwise
152        affbpm=0;
153
154end
155
156% cellule 1 (120,1-6), C02 (7-14), C03(15-22), C04 (23-29), C05(30-36), C06(37-44), C07(45-52), C08(53-59)
157% C09 (60-66), C10(67-74), C11 (75-82), C12(83-89), C13(90-96), C14(97-104), C15(105-112), C16(113-119)
158
159X=[1:1:16000];
160toto=0;
161
162axes(handles.axes1);
163if affbpm==0
164  set(handles.text2,'string','BPM.1 (120)');
165  if res.dev_replies(120).attr_values(1).value | toto;
166   [A1,h1,g1]=plotyy(X,res.dev_replies(120).attr_values(2).value,X,res.dev_replies(120).attr_values(4).value);
167   ylim([-handles.limitex handles.limitex])
168   xLim([handles.start handles.Endaff])
169   set(g1,'Color','red');
170   set(A1(2),'YColor','r');
171   xLim(A1(2),[handles.start handles.Endaff]);
172   axes(handles.axes9);
173   [A1,h1,g1]=plotyy(X,res.dev_replies(120).attr_values(3).value,X,res.dev_replies(120).attr_values(4).value);
174   ylim([-handles.limitez handles.limitez])
175   xLim([handles.start handles.Endaff])
176   set(g1,'Color','red');
177   set(A1(2),'YColor','r');
178   xLim(A1(2),[handles.start handles.Endaff]);
179  else
180   plot(handles.toto.value);
181   axes(handles.axes9);
182   plot(handles.toto.value);
183  end   
184else
185  set(handles.text2,'string',['BPM.1 (' num2str(affbpm) ')']);
186  if res.dev_replies(affbpm).attr_values(1).value | toto;
187   [A1,h1,g1]=plotyy(X,res.dev_replies(affbpm).attr_values(2).value,X,res.dev_replies(affbpm).attr_values(4).value);
188   ylim([-handles.limitex handles.limitex])
189   xLim([handles.start handles.Endaff])
190   set(g1,'Color','red');
191   set(A1(2),'YColor','r');
192   xLim(A1(2),[handles.start handles.Endaff]);
193   axes(handles.axes9);
194   if res.dev_replies(affbpm).attr_values(1).value | toto;
195   [A1,h1,g1]=plotyy(X,res.dev_replies(affbpm).attr_values(3).value,X,res.dev_replies(affbpm).attr_values(4).value);
196    ylim([-handles.limitez handles.limitez])
197   xLim([handles.start handles.Endaff])
198   set(g1,'Color','red');
199   set(A1(2),'YColor','r');
200   xLim(A1(2),[handles.start handles.Endaff]);
201  end
202  else
203   plot(handles.toto.value);
204   axes(handles.axes9);
205   plot(handles.toto.value);
206  end   
207end
208axes(handles.axes2);
209set(handles.text3,'string',['BPM.2 (' num2str(affbpm+1) ')']);
210if res.dev_replies(affbpm+1).attr_values(1).value | toto;
211 [A1,h1,g1]=plotyy(X,res.dev_replies(affbpm+1).attr_values(2).value,X,res.dev_replies(affbpm+1).attr_values(4).value);
212 ylim([-handles.limitex handles.limitex])
213 xLim([handles.start handles.Endaff])
214 set(g1,'Color','red');
215 set(A1(2),'YColor','r');
216 xLim(A1(2),[handles.start handles.Endaff]);
217 axes(handles.axes10);
218 if res.dev_replies(affbpm+1).attr_values(1).value | toto;
219  [A1,h1,g1]=plotyy(X,res.dev_replies(affbpm+1).attr_values(3).value,X,res.dev_replies(affbpm+1).attr_values(4).value);
220  ylim([-handles.limitez handles.limitez])
221  xLim([handles.start handles.Endaff])
222  set(g1,'Color','red');
223  set(A1(2),'YColor','r');
224  xLim(A1(2),[handles.start handles.Endaff]);
225 end
226else
227 plot(handles.toto.value);
228 axes(handles.axes10);
229 plot(handles.toto.value);
230end   
231axes(handles.axes3);
232set(handles.text4,'string',['BPM.3 (' num2str(affbpm+2) ')']);
233if res.dev_replies(affbpm+2).attr_values(1).value | toto;
234 [A1,h1,g1]=plotyy(X,res.dev_replies(affbpm+2).attr_values(2).value,X,res.dev_replies(affbpm+2).attr_values(4).value);
235 ylim([-handles.limitex handles.limitex])
236 xLim([handles.start handles.Endaff])
237 set(g1,'Color','red');
238 set(A1(2),'YColor','r');
239 xLim(A1(2),[handles.start handles.Endaff]);
240 axes(handles.axes11);
241 if res.dev_replies(affbpm+2).attr_values(1).value | toto;
242  [A1,h1,g1]=plotyy(X,res.dev_replies(affbpm+2).attr_values(3).value,X,res.dev_replies(affbpm+2).attr_values(4).value);
243  ylim([-handles.limitez handles.limitez])
244  xLim([handles.start handles.Endaff])
245  set(g1,'Color','red');
246  set(A1(2),'YColor','r');
247  xLim(A1(2),[handles.start handles.Endaff]);
248 end   
249else
250  plot(handles.toto.value);
251  axes(handles.axes11);
252  plot(handles.toto.value);
253end   
254axes(handles.axes4);
255set(handles.text5,'string',['BPM.4 (' num2str(affbpm+3) ')']);
256if res.dev_replies(affbpm+3).attr_values(1).value | toto;
257 [A1,h1,g1]=plotyy(X,res.dev_replies(affbpm+3).attr_values(2).value,X,res.dev_replies(affbpm+3).attr_values(4).value);
258 ylim([-handles.limitex handles.limitex])
259 xLim([handles.start handles.Endaff])
260 set(g1,'Color','red');
261 set(A1(2),'YColor','r');
262 xLim(A1(2),[handles.start handles.Endaff]);
263 axes(handles.axes12);
264 if res.dev_replies(affbpm+3).attr_values(1).value | toto;
265  [A1,h1,g1]=plotyy(X,res.dev_replies(affbpm+3).attr_values(3).value,X,res.dev_replies(affbpm+3).attr_values(4).value);
266  ylim([-handles.limitez handles.limitez])
267  xLim([handles.start handles.Endaff])
268  set(g1,'Color','red');
269  set(A1(2),'YColor','r');
270  xLim(A1(2),[handles.start handles.Endaff]);
271 end   
272else
273 plot(handles.toto.value);
274 axes(handles.axes12);
275 plot(handles.toto.value);
276end   
277axes(handles.axes5);
278set(handles.text6,'string',['BPM.5 (' num2str(affbpm+4) ')']);
279if res.dev_replies(affbpm+4).attr_values(1).value | toto;
280 [A1,h1,g1]=plotyy(X,res.dev_replies(affbpm+4).attr_values(2).value,X,res.dev_replies(affbpm+4).attr_values(4).value);
281 ylim([-handles.limitex handles.limitex])
282 xLim([handles.start handles.Endaff])
283 set(g1,'Color','red');
284 set(A1(2),'YColor','r');
285 xLim(A1(2),[handles.start handles.Endaff]);
286 axes(handles.axes13);
287 if res.dev_replies(affbpm+4).attr_values(1).value | toto;
288  [A1,h1,g1]=plotyy(X,res.dev_replies(affbpm+4).attr_values(3).value,X,res.dev_replies(affbpm+4).attr_values(4).value);
289  ylim([-handles.limitez handles.limitez])
290  xLim([handles.start handles.Endaff])
291  set(g1,'Color','red');
292  set(A1(2),'YColor','r');
293  xLim(A1(2),[handles.start handles.Endaff]);
294 end   
295else
296 plot(handles.toto.value);
297 axes(handles.axes13);
298 plot(handles.toto.value);
299end   
300axes(handles.axes6);
301set(handles.text7,'string',['BPM.6 (' num2str(affbpm+5) ')']);
302if res.dev_replies(affbpm+5).attr_values(1).value | toto;
303 [A1,h1,g1]=plotyy(X,res.dev_replies(affbpm+5).attr_values(2).value,X,res.dev_replies(affbpm+5).attr_values(4).value);
304 ylim([-handles.limitex handles.limitex])
305 xLim([handles.start handles.Endaff])
306 set(g1,'Color','red');
307 set(A1(2),'YColor','r');
308 xLim(A1(2),[handles.start handles.Endaff]);
309 axes(handles.axes14);
310 if res.dev_replies(affbpm+5).attr_values(1).value | toto;
311  [A1,h1,g1]=plotyy(X,res.dev_replies(affbpm+5).attr_values(3).value,X,res.dev_replies(affbpm+5).attr_values(4).value);
312  ylim([-handles.limitez handles.limitez])
313  xLim([handles.start handles.Endaff])
314  set(g1,'Color','red');
315  set(A1(2),'YColor','r');
316  xLim(A1(2),[handles.start handles.Endaff]);
317 end   
318else
319 plot(handles.toto.value);
320 axes(handles.axes14);
321 plot(handles.toto.value);
322end   
323axes(handles.axes7);
324set(handles.text8,'string',['BPM.7 (' num2str(affbpm+6) ')']);
325if res.dev_replies(affbpm+6).attr_values(1).value | toto;
326 [A1,h1,g1]=plotyy(X,res.dev_replies(affbpm+6).attr_values(2).value,X,res.dev_replies(affbpm+6).attr_values(4).value);
327 ylim([-handles.limitex handles.limitex])
328 xLim([handles.start handles.Endaff])
329 set(g1,'Color','red');
330 set(A1(2),'YColor','r');
331 xLim(A1(2),[handles.start handles.Endaff]);
332 axes(handles.axes15);
333 if res.dev_replies(affbpm+6).attr_values(1).value | toto;
334  [A1,h1,g1]=plotyy(X,res.dev_replies(affbpm+6).attr_values(3).value,X,res.dev_replies(affbpm+6).attr_values(4).value);
335  ylim([-handles.limitez handles.limitez])
336  xLim([handles.start handles.Endaff])
337  set(g1,'Color','red');
338  set(A1(2),'YColor','r');
339  xLim(A1(2),[handles.start handles.Endaff]);
340 end   
341else
342 plot(handles.toto.value);
343 axes(handles.axes15);
344 plot(handles.toto.value);
345end   
346if ((affbpm==7) | (affbpm==15) | (affbpm==37) | (affbpm==45) | (affbpm==67) | (affbpm==75) | (affbpm==97) | (affbpm==105))
347 axes(handles.axes8);
348 set(handles.text9,'string',['BPM.8 (' num2str(affbpm+7) ')']);
349 if res.dev_replies(affbpm+7).attr_values(1).value | toto;
350  [A1,h1,g1]=plotyy(X,res.dev_replies(affbpm+7).attr_values(2).value,X,res.dev_replies(affbpm+7).attr_values(4).value);
351  ylim([-handles.limitex handles.limitex])
352  xLim([handles.start handles.Endaff])
353  set(g1,'Color','red');
354  set(A1(2),'YColor','r');
355  xLim(A1(2),[handles.start handles.Endaff]);
356  axes(handles.axes16);
357  [A1,h1,g1]=plotyy(X,res.dev_replies(affbpm+7).attr_values(3).value,X,res.dev_replies(affbpm+7).attr_values(4).value);
358  ylim([-handles.limitez handles.limitez])
359  xLim([handles.start handles.Endaff])
360  set(g1,'Color','red');
361  set(A1(2),'YColor','r');
362  xLim(A1(2),[handles.start handles.Endaff]);
363 else
364  plot(handles.toto.value);
365 end
366else
367   set(handles.text9,'string',' ');
368   axes(handles.axes8);
369   plot(handles.toto.value);
370   axes(handles.axes16);
371   plot(handles.toto.value);
372 end
373if cellule < 10
374  set(handles.text1,'string',['C0' num2str(cellule)]);
375else
376set(handles.text1,'string',['C' num2str(cellule)]);
377end
378
379% --- Executes on button press in pushbutton4.
380function pushbutton4_Callback(hObject, eventdata, handles)
381% hObject    handle to pushbutton4 (see GCBO)
382% eventdata  reserved - to be defined in a future version of MATLAB
383% handles    structure with handles and user data (see GUIDATA)
384handles.cellule=2;
385guidata(hObject, handles);
386affiche(handles);
387efface_bouton(handles);
388set(handles.pushbutton4,'BackgroundColor','green');
389
390
391% --- Executes on button press in pushbutton5.
392function pushbutton5_Callback(hObject, eventdata, handles)
393% hObject    handle to pushbutton5 (see GCBO)
394% eventdata  reserved - to be defined in a future version of MATLAB
395% handles    structure with handles and user data (see GUIDATA)
396handles.cellule=3;
397guidata(hObject, handles);
398affiche(handles);
399efface_bouton(handles);
400set(hObject,'BackgroundColor','green');
401
402
403% --- Executes on button press in pushbutton6.
404function pushbutton6_Callback(hObject, eventdata, handles)
405% hObject    handle to pushbutton6 (see GCBO)
406% eventdata  reserved - to be defined in a future version of MATLAB
407% handles    structure with handles and user data (see GUIDATA)
408handles.cellule=4;
409guidata(hObject, handles);
410affiche(handles);
411efface_bouton(handles);
412set(hObject,'BackgroundColor','green');
413
414
415% --- Executes on button press in pushbutton7.
416function pushbutton7_Callback(hObject, eventdata, handles)
417% hObject    handle to pushbutton7 (see GCBO)
418% eventdata  reserved - to be defined in a future version of MATLAB
419% handles    structure with handles and user data (see GUIDATA)
420handles.cellule=5;
421guidata(hObject, handles);
422affiche(handles);
423efface_bouton(handles);
424set(hObject,'BackgroundColor','green');
425
426
427% --- Executes on button press in pushbutton8.
428function pushbutton8_Callback(hObject, eventdata, handles)
429% hObject    handle to pushbutton8 (see GCBO)
430% eventdata  reserved - to be defined in a future version of MATLAB
431% handles    structure with handles and user data (see GUIDATA)
432handles.cellule=6;
433guidata(hObject, handles);
434affiche(handles);
435efface_bouton(handles);
436set(hObject,'BackgroundColor','green');
437
438
439% --- Executes on button press in pushbutton9.
440function pushbutton9_Callback(hObject, eventdata, handles)
441% hObject    handle to pushbutton9 (see GCBO)
442% eventdata  reserved - to be defined in a future version of MATLAB
443% handles    structure with handles and user data (see GUIDATA)
444handles.cellule=7;
445guidata(hObject, handles);
446affiche(handles);
447efface_bouton(handles);
448set(hObject,'BackgroundColor','green');
449
450
451% --- Executes on button press in pushbutton10.
452function pushbutton10_Callback(hObject, eventdata, handles)
453% hObject    handle to pushbutton10 (see GCBO)
454% eventdata  reserved - to be defined in a future version of MATLAB
455% handles    structure with handles and user data (see GUIDATA)
456handles.cellule=8;
457guidata(hObject, handles);
458affiche(handles);
459efface_bouton(handles);
460set(hObject,'BackgroundColor','green');
461
462
463% --- Executes on button press in pushbutton11.
464function pushbutton11_Callback(hObject, eventdata, handles)
465% hObject    handle to pushbutton11 (see GCBO)
466% eventdata  reserved - to be defined in a future version of MATLAB
467% handles    structure with handles and user data (see GUIDATA)
468handles.cellule=9;
469guidata(hObject, handles);
470affiche(handles);
471efface_bouton(handles);
472set(hObject,'BackgroundColor','green');
473
474% --- Executes on button press in pushbutton12.
475function pushbutton12_Callback(hObject, eventdata, handles)
476% hObject    handle to pushbutton12 (see GCBO)
477% eventdata  reserved - to be defined in a future version of MATLAB
478% handles    structure with handles and user data (see GUIDATA)
479handles.cellule=10;
480guidata(hObject, handles);
481affiche(handles);
482efface_bouton(handles);
483set(hObject,'BackgroundColor','green');
484
485
486% --- Executes on 0button press in pushbutton13.
487function pushbutton13_Callback(hObject, eventdata, handles)
488% hObject    handle to pushbutton13 (see GCBO)
489% eventdata  reserved - to be defined in a future version of MATLAB
490% handles    structure with handles and user data (see GUIDATA)
491handles.cellule=11;
492guidata(hObject, handles);
493affiche(handles);
494efface_bouton(handles);
495set(hObject,'BackgroundColor','green');
496
497
498% --- Executes on button press in pushbutton14.
499function pushbutton14_Callback(hObject, eventdata, handles)
500% hObject    handle to pushbutton14 (see GCBO)
501% eventdata  reserved - to be defined in a future version of MATLAB
502% handles    structure with handles and user data (see GUIDATA)
503handles.cellule=12;
504guidata(hObject, handles);
505affiche(handles);
506efface_bouton(handles);
507set(hObject,'BackgroundColor','green');
508
509
510% --- Executes on button press in pushbutton15.
511function pushbutton15_Callback(hObject, eventdata, handles)
512% hObject    handle to pushbutton15 (see GCBO)
513% eventdata  reserved - to be defined in a future version of MATLAB
514% handles    structure with handles and user data (see GUIDATA)
515handles.cellule=13;
516guidata(hObject, handles);
517affiche(handles);
518efface_bouton(handles);
519set(hObject,'BackgroundColor','green');
520
521
522% --- Executes on button press in pushbutton16.
523function pushbutton16_Callback(hObject, eventdata, handles)
524% hObject    handle to pushbutton16 (see GCBO)
525% eventdata  reservedx - to be defined in a future version of MATLAB
526% handles    structure with handles and user data (see GUIDATA)
527handles.cellule=14;
528guidata(hObject, handles);
529affiche(handles);
530efface_bouton(handles);
531set(hObject,'BackgroundColor','green');
532
533
534% --- Executes on button press in pushbutton17.
535function pushbutton17_Callback(hObject, eventdata, handles)
536% hObject    handle to pushbutton17 (see GCBO)
537% eventdata  reserved - to be defined in a future version of MATLAB
538% handles    structure with handles and user data (see GUIDATA)
539handles.cellule=15;
540guidata(hObject, handles);
541affiche(handles);
542efface_bouton(handles);
543set(hObject,'BackgroundColor','green');
544
545
546% --- Executes on button press in pushbutton18.
547function pushbutton18_Callback(hObject, eventdata, handles)
548% hObject    handle to pushbutton18 (see GCBO)
549% eventdata  reserved - to be defined in a future version of MATLAB
550% handles    structure with handles and user data (see GUIDATA)
551handles.cellule=16;
552guidata(hObject, handles);
553affiche(handles);
554efface_bouton(handles);
555set(hObject,'BackgroundColor','green');
556
557
558function efface_bouton(handles);
559
560set(handles.pushbutton3,'BackgroundColor',[0.831,0.816,0.784]);
561set(handles.pushbutton4,'BackgroundColor',[0.831,0.816,0.784]);
562set(handles.pushbutton5,'BackgroundColor',[0.831,0.816,0.784]);
563set(handles.pushbutton6,'BackgroundColor',[0.831,0.816,0.784]);
564set(handles.pushbutton7,'BackgroundColor',[0.831,0.816,0.784]);
565set(handles.pushbutton8,'BackgroundColor',[0.831,0.816,0.784]);
566set(handles.pushbutton9,'BackgroundColor',[0.831,0.816,0.784]);
567set(handles.pushbutton10,'BackgroundColor',[0.831,0.816,0.784]);
568set(handles.pushbutton11,'BackgroundColor',[0.831,0.816,0.784]);
569set(handles.pushbutton12,'BackgroundColor',[0.831,0.816,0.784]);
570set(handles.pushbutton13,'BackgroundColor',[0.831,0.816,0.784]);
571set(handles.pushbutton14,'BackgroundColor',[0.831,0.816,0.784]);
572set(handles.pushbutton15,'BackgroundColor',[0.831,0.816,0.784]);
573set(handles.pushbutton16,'BackgroundColor',[0.831,0.816,0.784]);
574set(handles.pushbutton17,'BackgroundColor',[0.831,0.816,0.784]);
575set(handles.pushbutton18,'BackgroundColor',[0.831,0.816,0.784]);
576
577
578% --- Executes on button press in pushbutton19.
579function pushbutton19_Callback(hObject, eventdata, handles)
580% hObject    handle to pushbutton19 (see GCBO)
581% eventdata  reserved - to be defined in a future version of MATLAB
582% handles    structure with handles and user data (see GUIDATA)
583
584
585zoom=handles.zoomx;
586if zoom==0;
587   handles.zoomx=1;
588   handles.start=13000;
589   handles.Endaff=15000;
590   set(hObject,'BackgroundColor','green');
591else
592   handles.zoomx=0;
593   handles.start=1;
594   handles.Endaff=15000;
595   set(hObject,'BackgroundColor',[0.831,0.816,0.784]);
596end
597guidata(hObject, handles);
598affiche(handles)
599
600% --- Executes on button press in pushbutton20.
601function pushbutton20_Callback(hObject, eventdata, handles)
602% hObject    handle to pushbutton20 (see GCBO)
603% eventdata  reserved - to be defined in a future version of MATLAB
604% handles    structure with handles and user data (see GUIDATA)
605
606zoom=handles.zoomz;
607if handles.zoomz==0;
608   handles.zoomz=1;
609   handles.limitex=5;
610   handles.limitez=2;
611   set(hObject,'BackgroundColor','green');
612else
613   handles.zoomz=0;
614   handles.limitex=10;
615   handles.limitez=5;
616   set(hObject,'BackgroundColor',[0.831,0.816,0.784]);
617end
618guidata(hObject, handles);
619affiche(handles);
620
621
622% --- Executes on button press in pushbutton21.
623function pushbutton21_Callback(hObject, eventdata, handles)
624% hObject    handle to pushbutton21 (see GCBO)
625% eventdata  reserved - to be defined in a future version of MATLAB
626% handles    structure with handles and user data (see GUIDATA)
627N=16000
628start=13000;
629stop=14000;
630orbite=0;
631groupe=tango_group_create2('BPMs_ans');
632for i=1:1:16
633    list=getbpmbyrack(i);
634    dev_list=dev2tango ('BPMx','Monitor',list);
635    for j=1:1:size(dev_list,1)
636        dev_list{j}=dev_list{j}(1:16);
637        tango_group_add(groupe,dev_list{j});
638    end
639   
640
641end
642tango_group_dump(groupe)
643attr_list={'PMNotified','XPosPM','ZPosPM','SumPM'}
644res=tango_group_read_attributes(groupe,attr_list,3)
645filename = [getfamilydata('Directory','BPMPostmortem') 'PM_data_',date];
646uisave('res',filename);
647tango_group_kill(groupe);
648for i=1:1:16000
649    handles.toto.value(i)=0;
650end
651handles.res1=res;
652handles.zoomx=0;
653handles.zoomz=0;
654handles.limitex=10;
655handles.limitez=5;
656handles.start=1;
657handles.Endaff=15000;
658handles.cellule=1;
659guidata(hObject, handles);
660pushbutton3_Callback(hObject, eventdata, handles);
661set(handles.pushbutton19,'BackgroundColor',[0.831,0.816,0.784]);
662set(handles.pushbutton20,'BackgroundColor',[0.831,0.816,0.784]);
663readnotification(handles)
664
665% --- Executes on button press in pushbutton22.
666function pushbutton22_Callback(hObject, eventdata, handles)
667% hObject    handle to pushbutton22 (see GCBO)
668% eventdata  reserved - to be defined in a future version of MATLAB
669% handles    structure with handles and user data (see GUIDATA)
670N=16000
671start=13000;
672stop=14000;
673orbite=0;
674groupe=tango_group_create2('BPMs_ans');
675for i=1:1:16
676    list=getbpmbyrack(i);
677    dev_list=dev2tango ('BPMx','Monitor',list);
678    for j=1:1:size(dev_list,1)
679        dev_list{j}=dev_list{j}(1:16);
680        tango_group_add(groupe,dev_list{j});
681    end
682   
683
684end
685tango_group_dump(groupe)
686attr_list={'PMNotified','XPosPM','ZPosPM','SumPM'}
687res=tango_group_read_attributes(groupe,attr_list,3)
688tango_group_kill(groupe);
689for i=1:1:16000
690    handles.toto.value(i)=0;
691end
692handles.res1=res;
693handles.zoomx=0;
694handles.zoomz=0;
695handles.limitex=10;
696handles.limitez=5;
697handles.start=1;
698handles.Endaff=15000;
699handles.cellule=1;
700guidata(hObject, handles);
701pushbutton3_Callback(hObject, eventdata, handles);
702set(handles.pushbutton19,'BackgroundColor',[0.831,0.816,0.784]);
703set(handles.pushbutton20,'BackgroundColor',[0.831,0.816,0.784]);
704readnotification(handles)
705% readinterlocknotification(handles)
706
707% --- Executes on button press in pushbutton23.
708function pushbutton23_Callback(hObject, eventdata, handles)
709% hObject    handle to pushbutton23 (see GCBO)
710% eventdata  reserved - to be defined in a future version of MATLAB
711% handles    structure with handles and user data (see GUIDATA)
712
713% tango_command_inout2('ans/dg/state-bpm','ResetPMNotificationAll');
714groupe=tango_group_create2('BPMs_ans');
715for i=1:1:16
716    list=getbpmbyrack(i);
717    dev_list=dev2tango ('BPMx','Monitor',list);
718    for j=1:1:size(dev_list,1)
719        dev_list{j}=dev_list{j}(1:16);
720        tango_group_add(groupe,dev_list{j});
721    end
722end
723tango_group_dump(groupe);
724tango_group_command_inout(groupe,'ResetPMNotification',1)
725pause(1);
726attr_list={'PMNotified'};
727res2=tango_group_read_attributes(groupe,attr_list,3)
728tango_group_kill(groupe);
729a=0;
730for b=1:1:120
731  if res2.dev_replies(b).attr_values.value;
732     a=1+a;
733  end
734end
735set(handles.text14,'String',num2str(a));
736
737
738% --- Executes on button press in pushbutton24.
739function pushbutton24_Callback(hObject, eventdata, handles)
740% hObject    handle to pushbutton24 (see GCBO)
741% eventdata  reserved - to be defined in a future version of MATLAB
742% handles    structure with handles and user data (see GUIDATA)
743
744tango_command_inout2('ans/dg/state-bpm','ResetInterlockNotification');
745
746
747function readnotification(handles)
748
749res2=handles.res1;
750a=0;
751for b=1:1:120
752  if res2.dev_replies(b).attr_values(1).value;
753    a=a+1;
754  end
755end
756set(handles.text14,'String',num2str(a));
757
758
759
760function readinterlocknotification(handles)
761
762cellule=handles.cellule;
763tango_command_inout2('ans/dg/state-bpm','ResetPMNotificationAll');
764groupe=tango_group_create2('BPMs_ans');
765for i=1:1:16
766    list=getbpmbyrack(i);
767    dev_list=dev2tango ('BPMx','Monitor',list);
768    for j=1:1:size(dev_list,1)
769        dev_list{j}=dev_list{j}(1:16);
770        tango_group_add(groupe,dev_list{j});
771    end
772end
773tango_group_dump(groupe)
774attr_list={'InterlockXNotified','InterlockZNotified','InterlockADCPostFilterNotified'}
775res2=tango_group_read_attributes(groupe,attr_list,3)
776switch (cellule);
777    case 1
778        affbpm=0;
779    case 2
780        affbpm=7;
781    case 3
782        affbpm=15;
783    case 4
784        affbpm=23;
785    case 5
786        affbpm=30;
787    case 6
788        affbpm=37;
789    case 7
790        affbpm=45;
791    case 8
792        affbpm=53;
793    case 9
794        affbpm=60;
795    case 10
796        affbpm=67;
797    case 11
798        affbpm=75;
799    case 12
800        affbpm=83;
801    case 13
802        affbpm=90;
803    case 14
804        affbpm=97;
805    case 15
806        affbpm=105;
807    case 16
808        affbpm=113;
809    otherwise
810        affbpm=0;
811
812end
813if affbpm==0;
814    affbpm=120;
815end
816if res2.dev_replies(affbpm).attr_values(1).value;
817   set(handles.text16,'String','InterlockXNotified');
818 else
819    if res2.dev_replies(affbpm).attr_values(2).value;
820     set(handles.text16,'String','InterlockZNotified');
821    else
822      if res2.dev_replies(affbpm).attr_values(3).value;
823      set(handles.text16,'String','InterlockADCNotified');
824      else
825          set(handles.text16,'String',' ');
826      end
827    end
828end
829if affbpm==120;
830    affbpm=0;
831end
832if res2.dev_replies(affbpm+1).attr_values(1).value;
833   set(handles.text17,'String','InterlockXNotified');
834 else
835    if res2.dev_replies(affbpm+1).attr_values(2).value;
836     set(handles.text17,'String','InterlockZNotified');
837    else
838      if res2.dev_replies(affbpm+1).attr_values(3).value;
839      set(handles.text17,'String','InterlockADCNotified');
840      else
841          set(handles.text17,'String',' ');
842      end
843    end
844end
845if res2.dev_replies(affbpm+1).attr_values(1).value;
846   set(handles.text18,'String','InterlockXNotified');
847 else
848    if res2.dev_replies(affbpm+1).attr_values(2).value;
849     set(handles.text18,'String','InterlockZNotified');
850    else
851      if res2.dev_replies(affbpm+1).attr_values(3).value;
852      set(handles.text18,'String','InterlockADCNotified');
853      else
854          set(handles.text18,'String',' ');
855      end
856    end
857end
858if res2.dev_replies(affbpm+1).attr_values(1).value;
859   set(handles.text19,'String','InterlockXNotified');
860 else
861    if res2.dev_replies(affbpm+1).attr_values(2).value;
862     set(handles.text19,'String','InterlockZNotified');
863    else
864      if res2.dev_replies(affbpm+1).attr_values(3).value;
865      set(handles.text19,'String','InterlockADCNotified');
866      else
867          set(handles.text19,'String',' ');
868      end
869    end
870end
871if res2.dev_replies(affbpm+1).attr_values(1).value;
872   set(handles.text20,'String','InterlockXNotified');
873 else
874    if res2.dev_replies(affbpm+1).attr_values(2).value;
875     set(handles.text20,'String','InterlockZNotified');
876    else
877      if res2.dev_replies(affbpm+1).attr_values(3).value;
878      set(handles.text20,'String','InterlockADCNotified');
879      else
880          set(handles.text20,'String',' ');
881      end
882    end
883end
884if res2.dev_replies(affbpm+1).attr_values(1).value;
885   set(handles.text21,'String','InterlockXNotified');
886 else
887    if res2.dev_replies(affbpm+1).attr_values(2).value;
888     set(handles.text21,'String','InterlockZNotified');
889    else
890      if res2.dev_replies(affbpm+1).attr_values(3).value;
891      set(handles.text21,'String','InterlockADCNotified');
892      else
893          set(handles.text21,'String',' ');
894      end
895    end
896end
897if res2.dev_replies(affbpm+1).attr_values(1).value;
898   set(handles.text22,'String','InterlockXNotified');
899 else
900    if res2.dev_replies(affbpm+1).attr_values(2).value;
901     set(handles.text22,'String','InterlockZNotified');
902    else
903      if res2.dev_replies(affbpm+1).attr_values(3).value;
904      set(handles.text22,'String','InterlockADCNotified');
905      else
906          set(handles.text22,'String',' ');
907      end
908    end
909end
910if res2.dev_replies(affbpm+1).attr_values(1).value;
911   set(handles.text23,'String','InterlockXNotified');
912 else
913    if res2.dev_replies(affbpm+1).attr_values(2).value;
914     set(handles.text23,'String','InterlockZNotified');
915    else
916      if res2.dev_replies(affbpm+1).attr_values(3).value;
917      set(handles.text23,'String','InterlockADCNotified');
918      else
919          set(handles.text23,'String',' ');
920      end
921    end
922end
Note: See TracBrowser for help on using the repository browser.