1 | function varargout = DserverBPM(varargin) |
---|
2 | % DSERVERBPM M-file for DserverBPM.fig |
---|
3 | % DSERVERBPM, by itself, creates a new DSERVERBPM or raises the existing |
---|
4 | % singleton*. |
---|
5 | % |
---|
6 | % H = DSERVERBPM returns the handle to a new DSERVERBPM or the handle to |
---|
7 | % the existing singleton*. |
---|
8 | % |
---|
9 | % DSERVERBPM('CALLBACK',hObject,eventData,handles,...) calls the local |
---|
10 | % function named CALLBACK in DSERVERBPM.M with the given input arguments. |
---|
11 | % |
---|
12 | % DSERVERBPM('Property','Value',...) creates a new DSERVERBPM or raises the |
---|
13 | % existing singleton*. Starting from the left, property value pairs are |
---|
14 | % applied to the GUI before DserverBPM_OpeningFunction gets called. An |
---|
15 | % unrecognized property name or invalid value makes property application |
---|
16 | % stop. All inputs are passed to DserverBPM_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 | % Copyright 2002-2003 The MathWorks, Inc. |
---|
24 | |
---|
25 | % Edit the above text to modify the response to help DserverBPM |
---|
26 | |
---|
27 | % Last Modified by GUIDE v2.5 05-Sep-2005 16:02:39 |
---|
28 | |
---|
29 | % Begin initialization code - DO NOT EDIT |
---|
30 | gui_Singleton = 1; |
---|
31 | gui_State = struct('gui_Name', mfilename, ... |
---|
32 | 'gui_Singleton', gui_Singleton, ... |
---|
33 | 'gui_OpeningFcn', @DserverBPM_OpeningFcn, ... |
---|
34 | 'gui_OutputFcn', @DserverBPM_OutputFcn, ... |
---|
35 | 'gui_LayoutFcn', [] , ... |
---|
36 | 'gui_Callback', []); |
---|
37 | if nargin && ischar(varargin{1}) |
---|
38 | gui_State.gui_Callback = str2func(varargin{1}); |
---|
39 | end |
---|
40 | |
---|
41 | if nargout |
---|
42 | [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); |
---|
43 | else |
---|
44 | gui_mainfcn(gui_State, varargin{:}); |
---|
45 | end |
---|
46 | % End initialization code - DO NOT EDIT |
---|
47 | |
---|
48 | |
---|
49 | % --- Executes just before DserverBPM is made visible. |
---|
50 | function DserverBPM_OpeningFcn(hObject, eventdata, handles, varargin) |
---|
51 | % This function has no output args, see OutputFcn. |
---|
52 | % hObject handle to figure |
---|
53 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
54 | % handles structure with handles and user data (see GUIDATA) |
---|
55 | % varargin command line arguments to DserverBPM (see VARARGIN) |
---|
56 | |
---|
57 | % Choose default command line output for DserverBPM |
---|
58 | handles.output = hObject; |
---|
59 | |
---|
60 | % Update handles structure |
---|
61 | guidata(hObject, handles); |
---|
62 | |
---|
63 | % UIWAIT makes DserverBPM wait for user response (see UIRESUME) |
---|
64 | % uiwait(handles.figure1); |
---|
65 | |
---|
66 | |
---|
67 | % --- Outputs from this function are returned to the command line. |
---|
68 | function varargout = DserverBPM_OutputFcn(hObject, eventdata, handles) |
---|
69 | % varargout cell array for returning output args (see VARARGOUT); |
---|
70 | % hObject handle to figure |
---|
71 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
72 | % handles structure with handles and user data (see GUIDATA) |
---|
73 | |
---|
74 | % Get default command line output from handles structure |
---|
75 | varargout{1} = handles.output; |
---|
76 | |
---|
77 | |
---|
78 | |
---|
79 | function dev_name_Callback(hObject, eventdata, handles) |
---|
80 | % hObject handle to dev_name (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 | % Hints: get(hObject,'String') returns contents of dev_name as text |
---|
85 | % str2double(get(hObject,'String')) returns contents of dev_name as a double |
---|
86 | dev=get(handles.dev_name,'String') |
---|
87 | val_dev=get(handles.dev_name,'value') |
---|
88 | mode=tango_read_attribute(dev{val_dev},'Mode'); |
---|
89 | set(handles.Current_mode,'String',mode.value); |
---|
90 | |
---|
91 | |
---|
92 | Nvalues=tango_read_attribute(dev{val_dev},'NumSamples'); |
---|
93 | set(handles.Nsamples,'String',num2str(Nvalues.value(1))); |
---|
94 | |
---|
95 | % --- Executes during object creation, after setting all properties. |
---|
96 | function dev_name_CreateFcn(hObject, eventdata, handles) |
---|
97 | % hObject handle to dev_name (see GCBO) |
---|
98 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
99 | % handles empty - handles not created until after all CreateFcns called |
---|
100 | |
---|
101 | % Hint: edit controls usually have a white background on Windows. |
---|
102 | % See ISPC and COMPUTER. |
---|
103 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
104 | set(hObject,'BackgroundColor','white'); |
---|
105 | end |
---|
106 | |
---|
107 | |
---|
108 | |
---|
109 | % --- Executes on button press in pushbutton3. |
---|
110 | function pushbutton3_Callback(hObject, eventdata, handles) |
---|
111 | % hObject handle to pushbutton3 (see GCBO) |
---|
112 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
113 | % handles structure with handles and user data (see GUIDATA) |
---|
114 | |
---|
115 | |
---|
116 | % --- Executes on button press in pushbutton4. |
---|
117 | function pushbutton4_Callback(hObject, eventdata, handles) |
---|
118 | % hObject handle to pushbutton4 (see GCBO) |
---|
119 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
120 | % handles structure with handles and user data (see GUIDATA) |
---|
121 | |
---|
122 | |
---|
123 | |
---|
124 | |
---|
125 | function Nsamples_Callback(hObject, eventdata, handles) |
---|
126 | % hObject handle to Nsamples (see GCBO) |
---|
127 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
128 | % handles structure with handles and user data (see GUIDATA) |
---|
129 | |
---|
130 | % Hints: get(hObject,'String') returns contents of Nsamples as text |
---|
131 | % str2double(get(hObject,'String')) returns contents of Nsamples as a double |
---|
132 | Nvaleurs=int32(str2num(get(handles.Nsamples,'String'))); |
---|
133 | dev=get(handles.dev_name,'String'); |
---|
134 | val_dev=get(handles.dev_name,'value'); |
---|
135 | tango_write_attribute(dev{val_dev},'NumSamples',Nvaleurs); |
---|
136 | if tango_error==-1 |
---|
137 | tango_print_error_stack; |
---|
138 | error('Write attribute'); |
---|
139 | return |
---|
140 | end |
---|
141 | |
---|
142 | %test_erreur_tango; |
---|
143 | argout=tango_read_attribute2(dev{val_dev},'NumSamples'); |
---|
144 | %test_erreur_tango; |
---|
145 | if argout.value(1)~=Nvaleurs |
---|
146 | disp('Le nombre de valeurs demandees n a pas ete mis a jour'); |
---|
147 | end |
---|
148 | % --- Executes during object creation, after setting all properties. |
---|
149 | function Nsamples_CreateFcn(hObject, eventdata, handles) |
---|
150 | % hObject handle to Nsamples (see GCBO) |
---|
151 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
152 | % handles empty - handles not created until after all CreateFcns called |
---|
153 | |
---|
154 | % Hint: edit controls usually have a white background on Windows. |
---|
155 | % See ISPC and COMPUTER. |
---|
156 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
157 | set(hObject,'BackgroundColor','white'); |
---|
158 | end |
---|
159 | |
---|
160 | |
---|
161 | |
---|
162 | % --- Executes on selection change in Change_mode. |
---|
163 | function Change_mode_Callback(hObject, eventdata, handles) |
---|
164 | % hObject handle to Change_mode (see GCBO) |
---|
165 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
166 | % handles structure with handles and user data (see GUIDATA) |
---|
167 | |
---|
168 | % Hints: contents = get(hObject,'String') returns Change_mode contents as cell array |
---|
169 | % contents{get(hObject,'Value')} returns selected item from Change_mode |
---|
170 | val=get(handles.Change_mode,'Value') |
---|
171 | dev=get(handles.dev_name,'String') |
---|
172 | val_dev=get(handles.dev_name,'value') |
---|
173 | |
---|
174 | switch val |
---|
175 | case 1 |
---|
176 | tango_write_attribute(dev{val_dev},'Mode','MODE_FT') |
---|
177 | %test_erreur_tango; |
---|
178 | case 2 |
---|
179 | tango_write_attribute(dev{val_dev},'Mode','MODE_TT') |
---|
180 | %test_erreur_tango; |
---|
181 | case 3 |
---|
182 | tango_write_attribute(dev{val_dev},'Mode','MODE_BN') |
---|
183 | set(handles.Current_mode,'String','Boo Normal'); |
---|
184 | set(handles.Nsamples,'string',num2str(10169)); |
---|
185 | end; |
---|
186 | mode=tango_read_attribute(dev{val_dev},'Mode') |
---|
187 | %test_erreur_tango; |
---|
188 | set(handles.Current_mode,'String',mode.value); |
---|
189 | |
---|
190 | % --- Executes during object creation, after setting all properties. |
---|
191 | function Change_mode_CreateFcn(hObject, eventdata, handles) |
---|
192 | % hObject handle to Change_mode (see GCBO) |
---|
193 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
194 | % handles empty - handles not created until after all CreateFcns called |
---|
195 | |
---|
196 | % Hint: listbox controls usually have a white background on Windows. |
---|
197 | % See ISPC and COMPUTER. |
---|
198 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
199 | set(hObject,'BackgroundColor','white'); |
---|
200 | end |
---|
201 | |
---|
202 | |
---|
203 | |
---|
204 | function Current_mode_Callback(hObject, eventdata, handles) |
---|
205 | % hObject handle to Current_mode (see GCBO) |
---|
206 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
207 | % handles structure with handles and user data (see GUIDATA) |
---|
208 | |
---|
209 | % Hints: get(hObject,'String') returns contents of Current_mode as text |
---|
210 | % str2double(get(hObject,'String')) returns contents of Current_mode as a double |
---|
211 | |
---|
212 | |
---|
213 | % --- Executes during object creation, after setting all properties. |
---|
214 | function Current_mode_CreateFcn(hObject, eventdata, handles) |
---|
215 | % hObject handle to Current_mode (see GCBO) |
---|
216 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
217 | % handles empty - handles not created until after all CreateFcns called |
---|
218 | |
---|
219 | % Hint: edit controls usually have a white background on Windows. |
---|
220 | % See ISPC and COMPUTER. |
---|
221 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
222 | set(hObject,'BackgroundColor','white'); |
---|
223 | end |
---|
224 | |
---|
225 | |
---|
226 | % --- Executes on button press in Get_mode. |
---|
227 | function Get_mode_Callback(hObject, eventdata, handles) |
---|
228 | % hObject handle to Get_mode (see GCBO) |
---|
229 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
230 | % handles structure with handles and user data (see GUIDATA) |
---|
231 | |
---|
232 | dev=get(handles.dev_name,'String') |
---|
233 | val_dev=get(handles.dev_name,'value') |
---|
234 | mode=tango_read_attribute(dev{val_dev},'Mode'); |
---|
235 | set(handles.Current_mode,'String',mode.value); |
---|
236 | |
---|
237 | % --- Executes on button press in pushbutton14. |
---|
238 | function Get_data_Callback(hObject, eventdata, handles) |
---|
239 | % hObject handle to pushbutton14 (see GCBO) |
---|
240 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
241 | % handles structure with handles and user data (see GUIDATA) |
---|
242 | global X Z Q Sum Va Vb Vc Vd Stop; |
---|
243 | |
---|
244 | dev=get(handles.dev_name,'String'); |
---|
245 | val_dev=get(handles.dev_name,'value'); |
---|
246 | |
---|
247 | Nsamples=int32(str2num(get(handles.Nsamples,'String'))); |
---|
248 | %tango_write_attribute(dev{val_dev},'NumSamples',Nsamples); |
---|
249 | %test_erreur_tango; |
---|
250 | |
---|
251 | tango_set_timeout(dev{val_dev},30000); |
---|
252 | tango_get_timeout(dev{val_dev}); |
---|
253 | Attr_name_list={'XPosVector','ZPosVector','QuadVector','SumVector','VaVector','VbVector','VcVector','VdVector'}; |
---|
254 | Stop=0; |
---|
255 | while Stop==0, |
---|
256 | String=get(handles.Moyennage,'String'); |
---|
257 | val=get(handles.Moyennage,'Value'); |
---|
258 | Moyenne=str2num(String{val}) |
---|
259 | val=get(handles.Aquisition_continue,'Value'); |
---|
260 | switch val |
---|
261 | case 0 |
---|
262 | Stop=1; |
---|
263 | case 1 |
---|
264 | Stop=0; |
---|
265 | end |
---|
266 | argout=tango_read_attributes(dev{val_dev},Attr_name_list); |
---|
267 | %test_erreur_tango; |
---|
268 | X=argout(1).value; |
---|
269 | Z=argout(2).value; |
---|
270 | Q=argout(3).value; |
---|
271 | Sum=argout(4).value; |
---|
272 | Va=argout(5).value; |
---|
273 | Vb=argout(6).value; |
---|
274 | Vc=argout(7).value; |
---|
275 | Vd=argout(8).value; |
---|
276 | |
---|
277 | X_display=0; |
---|
278 | Z_display=0; |
---|
279 | Q_display=0; |
---|
280 | Sum_display=0; |
---|
281 | Va_display=0; |
---|
282 | Vb_display=0; |
---|
283 | Vc_display=0; |
---|
284 | Vd_display=0; |
---|
285 | |
---|
286 | if (Moyenne==1) |
---|
287 | X_display=X; |
---|
288 | Z_display=Z; |
---|
289 | Q_display=Q; |
---|
290 | Sum_display=Sum; |
---|
291 | Va_display=Va; |
---|
292 | Vb_display=Vb; |
---|
293 | Vc_display=Vc; |
---|
294 | Vd_display=Vd; |
---|
295 | |
---|
296 | else |
---|
297 | for i=1:Moyenne:Nsamples, |
---|
298 | X_display=[X_display,mean(X(i:i+Moyenne-1))]; |
---|
299 | Z_display=[Z_display,mean(Z(i:i+Moyenne-1))]; |
---|
300 | Q_display=[Q_display,mean(Q(i:i+Moyenne-1))]; |
---|
301 | Sum_display=[Sum_display,mean(Sum(i:i+Moyenne-1))]; |
---|
302 | Va_display=[Va_display,mean(Va(i:i+Moyenne-1))]; |
---|
303 | Vb_display=[Vb_display,mean(Vb(i:i+Moyenne-1))]; |
---|
304 | Vc_display=[Vc_display,mean(Vc(i:i+Moyenne-1))]; |
---|
305 | Vd_display=[Vd_display,mean(Vd(i:i+Moyenne-1))]; |
---|
306 | |
---|
307 | end |
---|
308 | X_display=X_display(2:size(X_display,2)); |
---|
309 | Z_display=Z_display(2:size(Z_display,2)); |
---|
310 | Q_display=Q_display(2:size(Q_display,2)); |
---|
311 | Sum_display=Sum_display(2:size(Sum_display,2)); |
---|
312 | Va_display=Va_display(2:size(Va_display,2)); |
---|
313 | Vb_display=Vb_display(2:size(Vb_display,2)); |
---|
314 | Vc_display=Vc_display(2:size(Vc_display,2)); |
---|
315 | Vd_display=Vd_display(2:size(Vd_display,2)); |
---|
316 | |
---|
317 | end |
---|
318 | |
---|
319 | axes(handles.Graph_X); |
---|
320 | plot(X_display);ylabel('mm'); |
---|
321 | title('X'); |
---|
322 | set(handles.Graph_X,'YLim',[-5 5]); |
---|
323 | %set(handles.Graph_X,'XLim',[0 200]); |
---|
324 | |
---|
325 | axes(handles.Graph_Z); |
---|
326 | plot(Z_display); |
---|
327 | title('Z');ylabel('mm'); |
---|
328 | set(handles.Graph_Z,'YLim',[-5 5]); |
---|
329 | %set(handles.Graph_Z,'XLim',[0 200]); |
---|
330 | |
---|
331 | axes(handles.Graph_Q); |
---|
332 | plot(Q_display);title('Q');ylabel('mm'); |
---|
333 | set(handles.Graph_Q,'YLim',[-5 5]); |
---|
334 | %set(handles.Graph_Q,'XLim',[0 200]); |
---|
335 | |
---|
336 | axes(handles.Graph_Somme); |
---|
337 | plot(Sum_display);title('Somme'); |
---|
338 | %set(handles.Graph_Somme,'YLim',[0 1.2e9]); |
---|
339 | %set(handles.Graph_Somme,'XLim',[0 200]); |
---|
340 | |
---|
341 | val=get(handles.Display_channels,'Value'); |
---|
342 | switch val |
---|
343 | case 0 |
---|
344 | case 1 |
---|
345 | figure(1) |
---|
346 | subplot(2,2,1);plot(Va); title('VA'); |
---|
347 | subplot(2,2,2);plot(Vb); title('VB'); |
---|
348 | subplot(2,2,3);plot(Vc); title('VC'); |
---|
349 | subplot(2,2,4);plot(Vd); title('VD'); |
---|
350 | end |
---|
351 | |
---|
352 | |
---|
353 | |
---|
354 | val=get(handles.Detection,'Value'); |
---|
355 | switch val |
---|
356 | case 0 |
---|
357 | case 1 |
---|
358 | [Max_sum,I]=max(Sum_display) |
---|
359 | seuil=0.9*Max_sum; |
---|
360 | indices=find(Sum_display>seuil); |
---|
361 | figure(2) |
---|
362 | subplot(2,2,1);plot(indices,X_display(indices)); title('X'); |
---|
363 | valeur=num2str(X_display(indices)); |
---|
364 | legend(valeur); |
---|
365 | subplot(2,2,2);plot(indices,Z_display(indices)); title('Z'); |
---|
366 | valeur=num2str(Z_display(indices)); |
---|
367 | legend(valeur); |
---|
368 | subplot(2,2,3);plot(indices,Q_display(indices)); title('Q'); |
---|
369 | subplot(2,2,4);plot(indices,Sum_display(indices)); title('Sum'); |
---|
370 | end |
---|
371 | |
---|
372 | pause(1); |
---|
373 | end |
---|
374 | |
---|
375 | |
---|
376 | |
---|
377 | |
---|
378 | |
---|
379 | |
---|
380 | % --- Executes on button press in Display_channels. |
---|
381 | function Display_channels_Callback(hObject, eventdata, handles) |
---|
382 | % hObject handle to Display_channels (see GCBO) |
---|
383 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
384 | % handles structure with handles and user data (see GUIDATA) |
---|
385 | |
---|
386 | % Hint: get(hObject,'Value') returns toggle state of Display_channels |
---|
387 | global Va Vb Vc Vd; |
---|
388 | val=get(handles.Display_channels,'Value'); |
---|
389 | switch val |
---|
390 | case 0 |
---|
391 | case 1 |
---|
392 | figure(1) |
---|
393 | subplot(2,2,1);plot(Va); title('VA'); |
---|
394 | subplot(2,2,2);plot(Vb); title('VB'); |
---|
395 | subplot(2,2,3);plot(Vc); title('VC'); |
---|
396 | subplot(2,2,4);plot(Vd); title('VD'); |
---|
397 | end |
---|
398 | |
---|
399 | |
---|
400 | |
---|
401 | % --- Executes on selection change in Moyennage. |
---|
402 | function Moyennage_Callback(hObject, eventdata, handles) |
---|
403 | % hObject handle to Moyennage (see GCBO) |
---|
404 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
405 | % handles structure with handles and user data (see GUIDATA) |
---|
406 | |
---|
407 | % Hints: contents = get(hObject,'String') returns Moyennage contents as cell array |
---|
408 | % contents{get(hObject,'Value')} returns selected item from Moyennage |
---|
409 | global X Z Q Sum Va Vb Vc Vd; |
---|
410 | Nsamples=str2num(get(handles.Nsamples,'String')); |
---|
411 | String=get(handles.Moyennage,'String'); |
---|
412 | val=get(handles.Moyennage,'Value'); |
---|
413 | Moyenne=str2num(String{val}) |
---|
414 | |
---|
415 | hX=get(handles.Graph_X,'children'); |
---|
416 | hZ=get(handles.Graph_Z,'children'); |
---|
417 | hQ=get(handles.Graph_Q,'children'); |
---|
418 | hSum=get(handles.Graph_Somme,'children'); |
---|
419 | |
---|
420 | |
---|
421 | X_display=0; |
---|
422 | Z_display=0; |
---|
423 | Q_display=0; |
---|
424 | Sum_display=0; |
---|
425 | Va_display=0; |
---|
426 | Vb_display=0; |
---|
427 | Vc_display=0; |
---|
428 | Vd_display=0; |
---|
429 | |
---|
430 | if (Moyenne==1) |
---|
431 | X_display=X; |
---|
432 | Z_display=Z; |
---|
433 | Q_display=Q; |
---|
434 | Sum_display=Sum; |
---|
435 | Va_display=Va; |
---|
436 | Vb_display=Vb; |
---|
437 | Vc_display=Vc; |
---|
438 | Vd_display=Vd; |
---|
439 | else |
---|
440 | for i=1:Moyenne:Nsamples, |
---|
441 | X_display=[X_display,mean(X(i:i+Moyenne-1))]; |
---|
442 | Z_display=[Z_display,mean(Z(i:i+Moyenne-1))]; |
---|
443 | Q_display=[Q_display,mean(Q(i:i+Moyenne-1))]; |
---|
444 | Sum_display=[Sum_display,mean(Sum(i:i+Moyenne-1))]; |
---|
445 | Va_display=[Va_display,mean(Va(i:i+Moyenne-1))]; |
---|
446 | Vb_display=[Vb_display,mean(Vb(i:i+Moyenne-1))]; |
---|
447 | Vc_display=[Vc_display,mean(Vc(i:i+Moyenne-1))]; |
---|
448 | Vd_display=[Vd_display,mean(Vd(i:i+Moyenne-1))]; |
---|
449 | end |
---|
450 | X_display=X_display(2:size(X_display,2)); |
---|
451 | Z_display=Z_display(2:size(Z_display,2)); |
---|
452 | Q_display=Q_display(2:size(Q_display,2)); |
---|
453 | Sum_display=Sum_display(2:size(Sum_display,2)); |
---|
454 | Va_display=Va_display(2:size(Va_display,2)); |
---|
455 | Vb_display=Vb_display(2:size(Vb_display,2)); |
---|
456 | Vc_display=Vc_display(2:size(Vc_display,2)); |
---|
457 | Vd_display=Vd_display(2:size(Vd_display,2)); |
---|
458 | |
---|
459 | end |
---|
460 | |
---|
461 | set(hX,'YData',X_display); |
---|
462 | set(hZ,'YData',Z_display); |
---|
463 | set(hQ,'YData',Q_display); |
---|
464 | set(hSum,'YData',Sum_display); |
---|
465 | val=get(handles.Display_channels,'Value'); |
---|
466 | switch val |
---|
467 | case 0 |
---|
468 | case 1 |
---|
469 | figure(1) |
---|
470 | subplot(2,2,1);plot(Va_display); title('VA'); |
---|
471 | subplot(2,2,2);plot(Vb_display); title('VB'); |
---|
472 | subplot(2,2,3);plot(Vc_display); title('VC'); |
---|
473 | subplot(2,2,4);plot(Vd_display); title('VD'); |
---|
474 | end |
---|
475 | |
---|
476 | % --- Executes during object creation, after setting all properties. |
---|
477 | function Moyennage_CreateFcn(hObject, eventdata, handles) |
---|
478 | % hObject handle to Moyennage (see GCBO) |
---|
479 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
480 | % handles empty - handles not created until after all CreateFcns called |
---|
481 | |
---|
482 | % Hint: popupmenu controls usually have a white background on Windows. |
---|
483 | % See ISPC and COMPUTER. |
---|
484 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
485 | set(hObject,'BackgroundColor','white'); |
---|
486 | end |
---|
487 | |
---|
488 | |
---|
489 | |
---|
490 | |
---|
491 | % --- Executes on button press in Stop. |
---|
492 | function Stop_Callback(hObject, eventdata, handles) |
---|
493 | % hObject handle to Stop (see GCBO) |
---|
494 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
495 | % handles structure with handles and user data (see GUIDATA) |
---|
496 | global Stop; |
---|
497 | Stop=1; |
---|
498 | |
---|
499 | |
---|
500 | |
---|
501 | % --- Executes on button press in Aquisition_continue. |
---|
502 | function Aquisition_continue_Callback(hObject, eventdata, handles) |
---|
503 | % hObject handle to Aquisition_continue (see GCBO) |
---|
504 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
505 | % handles structure with handles and user data (see GUIDATA) |
---|
506 | |
---|
507 | % Hint: get(hObject,'Value') returns toggle state of Aquisition_continue |
---|
508 | |
---|
509 | |
---|
510 | |
---|
511 | |
---|
512 | |
---|
513 | function Filename_Callback(hObject, eventdata, handles) |
---|
514 | % hObject handle to Filename (see GCBO) |
---|
515 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
516 | % handles structure with handles and user data (see GUIDATA) |
---|
517 | |
---|
518 | % Hints: get(hObject,'String') returns contents of Filename as text |
---|
519 | % str2double(get(hObject,'String')) returns contents of Filename as a double |
---|
520 | |
---|
521 | |
---|
522 | % --- Executes during object creation, after setting all properties. |
---|
523 | function Filename_CreateFcn(hObject, eventdata, handles) |
---|
524 | % hObject handle to Filename (see GCBO) |
---|
525 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
526 | % handles empty - handles not created until after all CreateFcns called |
---|
527 | |
---|
528 | % Hint: edit controls usually have a white background on Windows. |
---|
529 | % See ISPC and COMPUTER. |
---|
530 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
531 | set(hObject,'BackgroundColor','white'); |
---|
532 | end |
---|
533 | |
---|
534 | |
---|
535 | % --- Executes on button press in Save. |
---|
536 | function Save_Callback(hObject, eventdata, handles) |
---|
537 | % hObject handle to Save (see GCBO) |
---|
538 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
539 | % handles structure with handles and user data (see GUIDATA) |
---|
540 | global X Z Q Sum Va Vb Vc Vd; |
---|
541 | Nsamples=str2num(get(handles.Nsamples,'String')); |
---|
542 | dev=get(handles.dev_name,'String'); |
---|
543 | val_dev=get(handles.dev_name,'value'); |
---|
544 | mode=tango_read_attribute(dev{val_dev},'Mode'); |
---|
545 | filename=get(handles.Filename,'String') |
---|
546 | %filepath=['c:\testni\ESRF\',filename] |
---|
547 | save(filename,'Nsamples','mode','X','Z','Q','Sum','Va','Vb','Vc','Vd'); |
---|
548 | |
---|
549 | |
---|
550 | % --- Executes on button press in Detection. |
---|
551 | function Detection_Callback(hObject, eventdata, handles) |
---|
552 | % hObject handle to Detection (see GCBO) |
---|
553 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
554 | % handles structure with handles and user data (see GUIDATA) |
---|
555 | |
---|
556 | % Hint: get(hObject,'Value') returns toggle state of Detection |
---|
557 | |
---|
558 | |
---|