1 | function varargout = show1imagesgui_15(varargin) % EN COURS !!!!!! |
---|
2 | % show1imagesgui_15 M-file for show1imagesgui_15.fig |
---|
3 | % show1imagesgui_15, by itself, creates a new show1imagesgui_15 or raises the existing |
---|
4 | % singleton*. |
---|
5 | % |
---|
6 | % H = show1imagesgui_15 returns the handle to a new show1imagesgui_15 or the handle to |
---|
7 | % the existing singleton*. |
---|
8 | % |
---|
9 | % show1imagesgui_15('CALLBACK',hObject,eventData,handles,...) calls the local |
---|
10 | % function named CALLBACK in show1imagesgui_15.M with the given input arguments. |
---|
11 | % |
---|
12 | % show1imagesgui_15('Property','Value',...) creates a new show1imagesgui_15 or raises the |
---|
13 | % existing singleton*. Starting from the left, property value pairs are |
---|
14 | % applied to the GUI before show1imagesgui_15_OpeningFunction gets called. An |
---|
15 | % unrecognized property name or invalid value makes property application |
---|
16 | % stop. All inputs are passed to show1imagesgui_15_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 show1imagesgui_15 |
---|
24 | |
---|
25 | % Last Modified by GUIDE v2.5 11-Oct-2005 18:37:57 |
---|
26 | |
---|
27 | % Begin initialization code - DO NOT EDIT |
---|
28 | gui_Singleton = 1; |
---|
29 | gui_State = struct('gui_Name', mfilename, ... |
---|
30 | 'gui_Singleton', gui_Singleton, ... |
---|
31 | 'gui_OpeningFcn', @show1imagesgui_15_OpeningFcn, ... |
---|
32 | 'gui_OutputFcn', @show1imagesgui_15_OutputFcn, ... |
---|
33 | 'gui_LayoutFcn', [] , ... |
---|
34 | 'gui_Callback', []); |
---|
35 | if nargin & isstr(varargin{1}) |
---|
36 | gui_State.gui_Callback = str2func(varargin{1}); |
---|
37 | end |
---|
38 | |
---|
39 | if nargout |
---|
40 | [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); |
---|
41 | else |
---|
42 | gui_mainfcn(gui_State, varargin{:}); |
---|
43 | end |
---|
44 | % End initialization code - DO NOT EDIT |
---|
45 | |
---|
46 | |
---|
47 | % --- Executes just before show1imagesgui_15 is made visible. |
---|
48 | function show1imagesgui_15_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 show1imagesgui_15 (see VARARGIN) |
---|
54 | |
---|
55 | % Choose default command line output for show1imagesgui_15 |
---|
56 | |
---|
57 | % Choose default command line output for test_1 |
---|
58 | handles.output = hObject; |
---|
59 | |
---|
60 | if iscell(varargin) && ~isempty(varargin) |
---|
61 | |
---|
62 | % store handle from caller |
---|
63 | handles.caller = varargin{1}.figure1; |
---|
64 | |
---|
65 | % Get nbiterations value from Application-Defined data |
---|
66 | handles.nbiterations = getappdata(handles.caller, 'nbiterations'); |
---|
67 | handles.nbenregistrs = getappdata(handles.caller, 'nbenregistrs'); |
---|
68 | handles.Q4courant=getappdata(handles.caller,'Q4courant'); |
---|
69 | handles.nbenregistrements = getappdata(handles.caller, 'nbenregistrements'); |
---|
70 | handles.tailles = getappdata(handles.caller, 'tailles'); |
---|
71 | handles.ResultsData = getappdata(handles.caller, 'ResultsData'); |
---|
72 | handles.listbox=findobj(allchild(handles.caller),'Tag','listbox1'); |
---|
73 | handles.remove_pushbutton=findobj(allchild(handles.caller),'Tag','remove_pushbutton'); |
---|
74 | handles.plot_pushbutton=findobj(allchild(handles.caller),'Tag','plot_pushbutton'); |
---|
75 | handles.restaurer_pushbutton15=findobj(allchild(handles.caller),'Tag','restaurer_pushbutton15'); |
---|
76 | handles.nbacqu_edit13=findobj(allchild(handles.caller),'Tag','nbacqu_edit13'); |
---|
77 | handles.largeur_option=getappdata(handles.caller, 'largeur_option'); |
---|
78 | handles.vect_colonne_noire=getappdata(handles.caller, 'vect_colonne_noire'); |
---|
79 | handles.vect_ligne_noire=getappdata(handles.caller, 'vect_ligne_noire'); |
---|
80 | handles.G=getappdata(handles.caller, 'G'); |
---|
81 | handles.device_name = getappdata(handles.caller, 'device_name'); |
---|
82 | setappdata(handles.caller,'selection_fenetre_H',num2str(0)); |
---|
83 | setappdata(handles.caller,'selection_fenetre_V',num2str(0)); |
---|
84 | setappdata(handles.caller,'Rabotage',num2str(0)); |
---|
85 | set(handles.rayon_fenetre_H_edit16,'String',num2str(1)); |
---|
86 | set(handles.rayon_fenetre_V_edit17,'String',num2str(1)); |
---|
87 | |
---|
88 | % button group sur squeeze du vecteur sumcolomn |
---|
89 | % h = uibuttongroup('visible','off','Position',[0.05 .9 .12 .08],... |
---|
90 | % 'Title','Image','TitlePosition','centertop'); |
---|
91 | % u1 = uicontrol('Style','Radio','String','ON','Tag','radiobutton1',... |
---|
92 | % 'pos',[2 .9 45 30],'parent',h,'HandleVisibility','off'); |
---|
93 | % u2 = uicontrol('Style','Radio','String','OFF','Tag','radiobutton2',... |
---|
94 | % 'pos',[50 .9 45 30],'parent',h,'HandleVisibility','off'); |
---|
95 | h = uibuttongroup('visible','off'); |
---|
96 | u1 = uicontrol('Style','Radio','String','ON','Tag','radiobutton1',... |
---|
97 | 'pos',[35. 28. 45 30],'parent',h,'HandleVisibility','off'); |
---|
98 | u2 = uicontrol('Style','Radio','String','OFF','Tag','radiobutton2',... |
---|
99 | 'pos',[75. 28. 45 30],'parent',h,'HandleVisibility','off'); |
---|
100 | set(h,'SelectionChangeFcn',... |
---|
101 | {@uibuttongroup_SelectionChangeFcn,handles}); |
---|
102 | set(h,'SelectedObject',u2); % No selection |
---|
103 | set(h,'Visible','on'); |
---|
104 | |
---|
105 | v = uibuttongroup('visible','off'); |
---|
106 | v1 = uicontrol('Style','Radio','String','ON','Tag','radiobutton1',... |
---|
107 | 'pos',[440. 390. 45 30],'parent',v,'HandleVisibility','off'); |
---|
108 | v2 = uicontrol('Style','Radio','String','OFF','Tag','radiobutton2',... |
---|
109 | 'pos',[440. 360. 45 30],'parent',v,'HandleVisibility','off'); |
---|
110 | set(v,'SelectionChangeFcn',... |
---|
111 | {@uibuttongroup_SelectionChangeFcn_V,handles}); |
---|
112 | set(v,'SelectedObject',v2); % No selection |
---|
113 | set(v,'Visible','on'); |
---|
114 | |
---|
115 | r = uibuttongroup('visible','off'); |
---|
116 | r1 = uicontrol('Style','Radio','String','ON','Tag','radiobutton1',... |
---|
117 | 'pos',[400. 28. 45 30],'parent',r,'HandleVisibility','off'); |
---|
118 | r2 = uicontrol('Style','Radio','String','OFF','Tag','radiobutton2',... |
---|
119 | 'pos',[440. 28. 45 30],'parent',r,'HandleVisibility','off'); |
---|
120 | set(r,'SelectionChangeFcn',... |
---|
121 | {@uibuttongroup_SelectionChangeFcn_R,handles}); |
---|
122 | set(r,'SelectedObject',r2); % No selection |
---|
123 | set(r,'Visible','on'); |
---|
124 | |
---|
125 | |
---|
126 | |
---|
127 | % Update handles structure |
---|
128 | guidata(hObject, handles); |
---|
129 | |
---|
130 | else |
---|
131 | |
---|
132 | end |
---|
133 | |
---|
134 | % Update handles structure |
---|
135 | guidata(hObject, handles); |
---|
136 | |
---|
137 | % UIWAIT makes show1imagesgui_15 wait for user response (see UIRESUME) |
---|
138 | % uiwait(handles.main); |
---|
139 | |
---|
140 | %______________________________________________________________________ |
---|
141 | % profil horizontal |
---|
142 | handles.vect_colonne_noire=getappdata(handles.caller, 'vect_colonne_noire'); |
---|
143 | |
---|
144 | |
---|
145 | name=['axes' num2str(1)]; |
---|
146 | axes(handles.(name)); %axis image ; |
---|
147 | |
---|
148 | %formation d'une image |
---|
149 | |
---|
150 | %toto=faisceau(rowmax,columnmax,rowmax/10,columnmax/5,rowmax/2,columnmax/2,20); |
---|
151 | |
---|
152 | device_name = getappdata(handles.caller,'device_name'); |
---|
153 | |
---|
154 | %axes1=findobj(allchild(handles.figure1),'Tag','axes1'); |
---|
155 | %axes(handles.axes1); |
---|
156 | dev=device_name.videograbber; |
---|
157 | |
---|
158 | toto=tango_read_attribute(dev,'Image'); |
---|
159 | %toto=tango_read_attribute(dev,'corrected_image'); |
---|
160 | %image(toto.value,'CDataMapping','scaled'); |
---|
161 | image(toto.value,'CDataMapping','scaled','Parent',handles.axes1) |
---|
162 | rowmax=size(toto.value,1); |
---|
163 | columnmax=size(toto.value,2); |
---|
164 | |
---|
165 | %imagesc(toto.value,'Parent',handles.axes1); |
---|
166 | colormap(gray); |
---|
167 | |
---|
168 | % calcul des projections |
---|
169 | sumcolumn=sum(toto.value(:,:)); |
---|
170 | %sauvegarde du profil horizontal brut |
---|
171 | setappdata(handles.caller, 'profil_H',sumcolumn); |
---|
172 | |
---|
173 | |
---|
174 | % test si on a bien cree une image dans faisceau |
---|
175 | if isequal(size(sumcolumn),size(handles.vect_colonne_noire)) |
---|
176 | % on soustraie l'image sans faisceau |
---|
177 | %% sumcolumn=sumcolumn-handles.vect_colonne_noire; % suppression le 07 mai 08 ! |
---|
178 | else |
---|
179 | errordlg('vous n avez pas fait d''image sans faisceau','Error'); |
---|
180 | end |
---|
181 | |
---|
182 | % seul souci : les pixels rendus nï¿œgatifs dans l'opï¿œration prï¿œcedente. On |
---|
183 | % les passe sauvagement ᅵ 0 ! |
---|
184 | for i=1:length(sumcolumn) |
---|
185 | if sumcolumn(i)<0 |
---|
186 | sumcolumn(i)=0; |
---|
187 | end |
---|
188 | end |
---|
189 | |
---|
190 | |
---|
191 | handles.largeur_option=getappdata(handles.caller, 'largeur_option'); |
---|
192 | |
---|
193 | % cas oᅵ aucune option de calcul pour la largeur n'a ᅵtᅵ sᅵlectionnᅵ |
---|
194 | if isequal(handles.largeur_option,0) |
---|
195 | errordlg('vous n avez pas fait votre choix pour la taille de faisceau','Error'); |
---|
196 | end |
---|
197 | |
---|
198 | % fit par gaussienne |
---|
199 | if isequal(handles.largeur_option,1) |
---|
200 | |
---|
201 | %xdata=1:columnmax+1; |
---|
202 | xdata=1:columnmax; |
---|
203 | ValMaxc=max(sumcolumn);ValMinc=min(sumcolumn); |
---|
204 | x0=[10 250 ValMaxc]; |
---|
205 | % option on enlï¿œve min : |
---|
206 | %[ac,resnorm] = lsqcurvefit(@myfun_gaussienne,x0,xdata,sumcolumn-ValMinc) |
---|
207 | % option : on enlï¿œve l'image noire (fait prï¿œcï¿œdemment) : |
---|
208 | [ac,resnorm] = lsqcurvefit(@myfun_gaussienne,x0,xdata,sumcolumn); |
---|
209 | rmsH=ac(1); |
---|
210 | %grossissement= str2num(handles.G); |
---|
211 | %val=sprintf('%0.2f',rmsH*grossissement); |
---|
212 | val=sprintf('%0.2f',rmsH*handles.G) |
---|
213 | % impression du rayon en mm |
---|
214 | set(handles.rmsH_edit11,'String',val); |
---|
215 | sumHstd=0; |
---|
216 | |
---|
217 | %plot du rï¿œsultat |
---|
218 | %F=ac(3)*exp(-(xdata-ac(2)).*(xdata-ac(2))/(2*ac(1)*ac(1)))+ValMinc; |
---|
219 | F=ac(3)*exp(-(xdata-ac(2)).*(xdata-ac(2))/(2*ac(1)*ac(1))); |
---|
220 | name=['axes' num2str(2)]; |
---|
221 | axes(handles.(name)); |
---|
222 | plot(xdata,sumcolumn,'k-'); |
---|
223 | xlim([0 length(sumcolumn)]) |
---|
224 | hold on |
---|
225 | plot(xdata,F,'b-') |
---|
226 | hold off |
---|
227 | |
---|
228 | end |
---|
229 | |
---|
230 | |
---|
231 | % vrai rms |
---|
232 | if isequal(handles.largeur_option,2) |
---|
233 | |
---|
234 | ValMaxc=max(sumcolumn);ValMinc=min(sumcolumn); |
---|
235 | sumcolumn=sumcolumn-ValMinc; |
---|
236 | vect=1:length(sumcolumn); |
---|
237 | sumcolumn1=sumcolumn/sum(sumcolumn); |
---|
238 | smoy=sum(sumcolumn1.*vect); |
---|
239 | tata=(vect-smoy).*(vect-smoy); |
---|
240 | srms=sum(sumcolumn1.*tata); |
---|
241 | rmsH=sqrt(srms); |
---|
242 | |
---|
243 | %grossissement= str2num(handles.G); |
---|
244 | %val=sprintf('%0.2f',rmsH*grossissement); |
---|
245 | |
---|
246 | val=sprintf('%0.2f',rmsH*handles.G); |
---|
247 | % impression du rayon en mm |
---|
248 | set(handles.rmsH_edit11,'String',val); |
---|
249 | |
---|
250 | %plot du rï¿œsultat |
---|
251 | xdata=1:columnmax; |
---|
252 | name=['axes' num2str(2)]; |
---|
253 | axes(handles.(name)); |
---|
254 | plot(xdata,sumcolumn+ValMinc,'k-'); |
---|
255 | xlim([0 length(sumcolumn)]) |
---|
256 | hold on |
---|
257 | %plot(xdata,F,'b-') |
---|
258 | hold off |
---|
259 | |
---|
260 | end |
---|
261 | |
---|
262 | % $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ |
---|
263 | % profil vertical |
---|
264 | handles.vect_ligne_noire=getappdata(handles.caller, 'vect_ligne_noire'); |
---|
265 | |
---|
266 | |
---|
267 | name=['axes' num2str(1)]; |
---|
268 | axes(handles.(name)); %axis image ; |
---|
269 | |
---|
270 | % %formation d'une image |
---|
271 | % rowmax=513; |
---|
272 | % columnmax=701; |
---|
273 | % toto=faisceau(rowmax,columnmax,rowmax/10,columnmax/5,rowmax/2,columnmax/2,20); |
---|
274 | % calcul des projections |
---|
275 | sumrow=sum(toto.value(:,:)'); |
---|
276 | %sauvegarde du profil horizontal brut |
---|
277 | setappdata(handles.caller, 'profil_V',sumrow); |
---|
278 | |
---|
279 | |
---|
280 | % test si on a bien cree une image dans faisceau |
---|
281 | if isequal(size(sumrow),size(handles.vect_ligne_noire)) |
---|
282 | % on soustraie l'image sans faisceau |
---|
283 | %%% sumrow=sumrow-handles.vect_ligne_noire; % suppression le 07 mai 08 ! |
---|
284 | else |
---|
285 | % a priori inutile (alarme dᅵjᅵ levᅵe en horizontal) errordlg('vous n avez pas fait d image sans faisceau','Error'); |
---|
286 | end |
---|
287 | |
---|
288 | % seul souci : les pixels rendus nï¿œgatifs dans l'opï¿œration prï¿œcedente. On |
---|
289 | % les passe sauvagement ᅵ 0 ! |
---|
290 | for i=1:length(sumrow) |
---|
291 | if sumrow(i)<0 |
---|
292 | sumrow(i)=0; |
---|
293 | end |
---|
294 | end |
---|
295 | |
---|
296 | |
---|
297 | % handles.largeur_option=getappdata(handles.caller, 'largeur_option'); |
---|
298 | |
---|
299 | % fit par gaussienne |
---|
300 | if isequal(handles.largeur_option,1) |
---|
301 | |
---|
302 | %xdata=1:rowmax+1; |
---|
303 | xdata=1:rowmax; |
---|
304 | ValMaxr=max(sumrow);ValMinr=min(sumrow); |
---|
305 | x0=[10 250 ValMaxr]; |
---|
306 | % option on enlï¿œve min : |
---|
307 | %[ac,resnorm] = lsqcurvefit(@myfun_gaussienne,x0,xdata,sumcolumn-ValMinc) |
---|
308 | % option : on enlï¿œve l'image noire (fait prï¿œcï¿œdemment) : |
---|
309 | [ar,resnorm] = lsqcurvefit(@myfun_gaussienne,x0,xdata,sumrow); |
---|
310 | rmsV=ar(1); |
---|
311 | |
---|
312 | %grossissement= str2num(handles.G); |
---|
313 | %val=sprintf('%0.2f',rmsV*grossissement); |
---|
314 | |
---|
315 | val=sprintf('%0.2f',rmsV*handles.G); |
---|
316 | % impression du rayon en mm |
---|
317 | set(handles.rmsV_edit12,'String',val); |
---|
318 | sumVstd=0; |
---|
319 | |
---|
320 | %plot du rï¿œsultat |
---|
321 | %F=ac(3)*exp(-(xdata-ac(2)).*(xdata-ac(2))/(2*ac(1)*ac(1)))+ValMinc; |
---|
322 | Fr=ar(3)*exp(-(xdata-ar(2)).*(xdata-ar(2))/(2*ar(1)*ar(1))); |
---|
323 | name=['axes' num2str(3)]; |
---|
324 | axes(handles.(name)); |
---|
325 | plot(xdata,sumrow,'k-'); |
---|
326 | xlim([0 length(sumrow)]) |
---|
327 | hold on |
---|
328 | plot(xdata,Fr,'b-') |
---|
329 | hold off |
---|
330 | |
---|
331 | end |
---|
332 | |
---|
333 | |
---|
334 | % vrai rms |
---|
335 | if isequal(handles.largeur_option,2) |
---|
336 | |
---|
337 | ValMaxr=max(sumrow);ValMinr=min(sumrow); |
---|
338 | sumrow=sumrow-ValMinr; |
---|
339 | vect=1:length(sumrow); |
---|
340 | sumrow1=sumrow/sum(sumrow); |
---|
341 | smoy=sum(sumrow1.*vect); |
---|
342 | toto=(vect-smoy).*(vect-smoy); |
---|
343 | srms=sum(sumrow1.*toto); |
---|
344 | rmsV=sqrt(srms); |
---|
345 | |
---|
346 | %grossissement= str2num(handles.G); |
---|
347 | %val=sprintf('%0.2f',rmsV*grossissement); |
---|
348 | |
---|
349 | val=sprintf('%0.2f',rmsV*handles.G); |
---|
350 | % impression du rayon en mm |
---|
351 | set(handles.rmsV_edit12,'String',val); |
---|
352 | |
---|
353 | %plot du rï¿œsultat |
---|
354 | xdata=1:rowmax; |
---|
355 | name=['axes' num2str(3)]; |
---|
356 | axes(handles.(name)); |
---|
357 | plot(xdata,sumrow+ValMinr,'k-'); |
---|
358 | xlim([0 length(sumrow)]) |
---|
359 | hold on |
---|
360 | %plot(xdata,F,'b-') |
---|
361 | hold off |
---|
362 | |
---|
363 | end |
---|
364 | |
---|
365 | %_______________________________________________________________ |
---|
366 | |
---|
367 | % |
---|
368 | % |
---|
369 | % |
---|
370 | % rowmax=80; |
---|
371 | % columnmax=100; |
---|
372 | % B=[]; |
---|
373 | % |
---|
374 | % %for i=1:handles.nbiterations |
---|
375 | % for i=1:1 |
---|
376 | % name=['axes' num2str(i)]; |
---|
377 | % axes(handles.(name)); %axis image ; |
---|
378 | % faisceau(513,701,120,50,-150,50,10); |
---|
379 | % B(i,:,:) = rand(rowmax,columnmax); |
---|
380 | % sumcolumn=sum(squeeze(B(i,:,:)));sumrow=sum(squeeze(B(i,:,:))'); |
---|
381 | % sumV(i)=sum(sumcolumn);sumH(i)=sum(sumrow); |
---|
382 | % % axes(handles.(name)); %axis image ; |
---|
383 | % % ima(i)=image(squeeze(B(i,:,:)),'CDataMapping','scaled'); |
---|
384 | % end |
---|
385 | % |
---|
386 | % sumHmean=mean(sumH);sumVmean=mean(sumV);sumHstd=std(sumH);sumVstd=std(sumV); |
---|
387 | % |
---|
388 | % set(handles.rmsH_edit11,'String',sumHmean); |
---|
389 | % sumHstd=0; |
---|
390 | % |
---|
391 | % set(handles.rmsV_edit12,'String',sumVmean); |
---|
392 | % |
---|
393 | % sumVstd=0; |
---|
394 | |
---|
395 | % --- Outputs from this function are returned to the command line. |
---|
396 | function varargout = show1imagesgui_15_OutputFcn(hObject, eventdata, handles) |
---|
397 | % varargout cell array for returning output args (see VARARGOUT); |
---|
398 | % hObject handle to figure |
---|
399 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
400 | % handles structure with handles and user data (see GUIDATA) |
---|
401 | |
---|
402 | % Get default command line output from handles structure |
---|
403 | varargout{1} = handles.output; % ??? |
---|
404 | |
---|
405 | % --- Executes on button press in pushbutton1. |
---|
406 | function recommencer_pushbutton1_Callback(hObject, eventdata, handles) |
---|
407 | % hObject handle to pushbutton1 (see GCBO) |
---|
408 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
409 | % handles structure with handles and user data (see GUIDATA) |
---|
410 | |
---|
411 | handles.vect_colonne_noire=getappdata(handles.caller, 'vect_colonne_noire'); |
---|
412 | selection_fenetre_H = getappdata(handles.caller,'selection_fenetre_H'); |
---|
413 | selection_fenetre_V = getappdata(handles.caller,'selection_fenetre_V'); |
---|
414 | Rabotage = getappdata(handles.caller,'Rabotage') |
---|
415 | |
---|
416 | name=['axes' num2str(1)]; |
---|
417 | axes(handles.(name)); %axis image ; |
---|
418 | |
---|
419 | %formation d'une image |
---|
420 | device_name = getappdata(handles.caller,'device_name'); |
---|
421 | dev=device_name.videograbber; |
---|
422 | toto=tango_read_attribute(dev,'Image'); |
---|
423 | %toto=tango_read_attribute(dev,'corrected_image'); |
---|
424 | image(toto.value,'CDataMapping','scaled','Parent',handles.axes1) |
---|
425 | rowmax=size(toto.value,1); |
---|
426 | columnmax=size(toto.value,2); |
---|
427 | colormap(gray); |
---|
428 | |
---|
429 | % calcul des projections |
---|
430 | sumcolumn=sum(toto.value(:,:)); |
---|
431 | %sauvegarde du profil horizontal brut |
---|
432 | setappdata(handles.caller, 'profil_H',sumcolumn); |
---|
433 | |
---|
434 | |
---|
435 | % test si on a bien cree une image dans faisceau |
---|
436 | if isequal(size(sumcolumn),size(handles.vect_colonne_noire)) |
---|
437 | % on soustraie l'image sans faisceau |
---|
438 | %sumcolumn=sumcolumn-handles.vect_colonne_noire; |
---|
439 | else |
---|
440 | errordlg('vous n avez pas fait d''image sans faisceau','Error'); |
---|
441 | end |
---|
442 | |
---|
443 | % seul souci : les pixels rendus nï¿œgatifs dans l'opï¿œration prï¿œcedente. On |
---|
444 | % les passe sauvagement ᅵ 0 ! |
---|
445 | for i=1:length(sumcolumn) |
---|
446 | if sumcolumn(i)<0 |
---|
447 | sumcolumn(i)=0; |
---|
448 | end |
---|
449 | end |
---|
450 | |
---|
451 | |
---|
452 | handles.largeur_option=getappdata(handles.caller, 'largeur_option'); |
---|
453 | |
---|
454 | % cas oᅵ aucune option de calcul pour la largeur n'a ᅵtᅵ sᅵlectionnᅵ |
---|
455 | if isequal(handles.largeur_option,0) |
---|
456 | errordlg('vous n avez pas fait votre choix pour la taille de faisceau','Error'); |
---|
457 | end |
---|
458 | |
---|
459 | |
---|
460 | % fit par gaussienne |
---|
461 | if isequal(handles.largeur_option,1) |
---|
462 | |
---|
463 | xdata=1:columnmax; |
---|
464 | ValMaxc=max(sumcolumn);ValMinc=min(sumcolumn); |
---|
465 | x0=[10 250 ValMaxc]; |
---|
466 | % option on enlï¿œve min : |
---|
467 | %[ac,resnorm] = lsqcurvefit(@myfun_gaussienne,x0,xdata,sumcolumn-ValMinc) |
---|
468 | % option : on enlï¿œve l'image noire (fait prï¿œcï¿œdemment) : |
---|
469 | [ac,resnorm] = lsqcurvefit(@myfun_gaussienne,x0,xdata,sumcolumn); |
---|
470 | rmsH=ac(1); |
---|
471 | |
---|
472 | %grossissement= str2num(handles.G); |
---|
473 | %val=sprintf('%0.2f',rmsH*grossissement); |
---|
474 | |
---|
475 | val=sprintf('%0.2f',rmsH*handles.G); |
---|
476 | % impression du rayon en mm |
---|
477 | set(handles.rmsH_edit11,'String',val); |
---|
478 | sumHstd=0; |
---|
479 | |
---|
480 | %plot du rï¿œsultat |
---|
481 | %F=ac(3)*exp(-(xdata-ac(2)).*(xdata-ac(2))/(2*ac(1)*ac(1)))+ValMinc; |
---|
482 | F=ac(3)*exp(-(xdata-ac(2)).*(xdata-ac(2))/(2*ac(1)*ac(1))); |
---|
483 | name=['axes' num2str(2)]; |
---|
484 | axes(handles.(name)); |
---|
485 | plot(xdata,sumcolumn,'k-'); |
---|
486 | xlim([0 length(sumcolumn)]) |
---|
487 | hold on |
---|
488 | plot(xdata,F,'b-') |
---|
489 | hold off |
---|
490 | |
---|
491 | end |
---|
492 | |
---|
493 | |
---|
494 | % vrai rms |
---|
495 | if isequal(handles.largeur_option,2) |
---|
496 | |
---|
497 | % test ! |
---|
498 | %Z = load('-mat','/home/matlabML/measdata/LT1data/emittance/2005-10-10_4/profilH_2_38.mat'); |
---|
499 | %Z = load('-mat','/home/matlabML/measdata/LT1data/emittance/2005-09-23_1/profilH_3_38.mat'); |
---|
500 | % Z = load('-mat','/home/matlabML/measdata/LT1data/emittance/2005-10-10_4/profilH_3_38.mat'); |
---|
501 | % sumcolumn = Z.vect_H; |
---|
502 | |
---|
503 | if isequal(Rabotage,num2str(1))&isequal(selection_fenetre_H,num2str(1)) |
---|
504 | errordlg('Attention deselectionnez une option !! ...','Error'); |
---|
505 | elseif isequal(Rabotage,num2str(1)) |
---|
506 | [Y,I] = max(sumcolumn); |
---|
507 | sumcolumn = sumcolumn - Y*0.01; |
---|
508 | for i = 1 : length(sumcolumn) |
---|
509 | if sumcolumn(i)<0 |
---|
510 | sumcolumn(i) = 0; |
---|
511 | end |
---|
512 | end |
---|
513 | elseif isequal(selection_fenetre_H,num2str(1)) |
---|
514 | res= get(handles.rayon_fenetre_H_edit16,'String'); |
---|
515 | rayon_fenetre_H = str2num(res); |
---|
516 | rayon_pixel_H = rayon_fenetre_H/handles.G; |
---|
517 | [Y,I] = max(sumcolumn); |
---|
518 | sumcolumn = sumcolumn(I-rayon_pixel_H : I+rayon_pixel_H); |
---|
519 | %sumcolumn = sumcolumn(640/2-rayon_pixel_H : 640/2+rayon_pixel_H); |
---|
520 | end |
---|
521 | |
---|
522 | ValMaxc=max(sumcolumn);ValMinc=min(sumcolumn); |
---|
523 | sumcolumn=sumcolumn-ValMinc; |
---|
524 | vect=1:length(sumcolumn); |
---|
525 | sumcolumn1=sumcolumn/sum(sumcolumn); |
---|
526 | smoy=sum(sumcolumn1.*vect); |
---|
527 | titi=(vect-smoy).*(vect-smoy); |
---|
528 | srms=sum(sumcolumn1.*titi); |
---|
529 | rmsH=sqrt(srms); |
---|
530 | |
---|
531 | %grossissement= str2num(handles.G); |
---|
532 | %val=sprintf('%0.2f',rmsH*grossissement); |
---|
533 | |
---|
534 | val=sprintf('%0.2f',rmsH*handles.G); |
---|
535 | % impression du rayon en mm |
---|
536 | set(handles.rmsH_edit11,'String',val); |
---|
537 | |
---|
538 | %plot du rï¿œsultat |
---|
539 | columnmax=size(sumcolumn,2); |
---|
540 | xdata=1:columnmax; |
---|
541 | name=['axes' num2str(2)]; |
---|
542 | axes(handles.(name)); |
---|
543 | plot(xdata,sumcolumn+ValMinc,'k-'); |
---|
544 | xlim([0 length(sumcolumn)]) |
---|
545 | hold on |
---|
546 | %plot(xdata,F,'b-') |
---|
547 | hold off |
---|
548 | |
---|
549 | end |
---|
550 | |
---|
551 | % $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ |
---|
552 | |
---|
553 | handles.vect_ligne_noire=getappdata(handles.caller, 'vect_ligne_noire'); |
---|
554 | |
---|
555 | |
---|
556 | name=['axes' num2str(1)]; |
---|
557 | axes(handles.(name)); %axis image ; |
---|
558 | |
---|
559 | % %formation d'une image |
---|
560 | % rowmax=513; |
---|
561 | % columnmax=701; |
---|
562 | % toto=faisceau(rowmax,columnmax,rowmax/10,columnmax/5,rowmax/2,columnmax/2,20); |
---|
563 | % calcul des projections |
---|
564 | sumrow=sum(toto.value(:,:)'); |
---|
565 | %sauvegarde du profil horizontal brut |
---|
566 | setappdata(handles.caller, 'profil_V',sumrow); |
---|
567 | |
---|
568 | |
---|
569 | % test si on a bien cree une image dans faisceau |
---|
570 | if isequal(size(sumrow),size(handles.vect_ligne_noire)) |
---|
571 | % on soustraie l'image sans faisceau |
---|
572 | %sumrow=sumrow-handles.vect_ligne_noire; |
---|
573 | else |
---|
574 | errordlg('vous n avez pas fait d image sans faisceau','Error'); |
---|
575 | end |
---|
576 | |
---|
577 | % seul souci : les pixels rendus nï¿œgatifs dans l'opï¿œration prï¿œcedente. On |
---|
578 | % les passe sauvagement ᅵ 0 ! |
---|
579 | for i=1:length(sumrow) |
---|
580 | if sumrow(i)<0 |
---|
581 | sumrow(i)=0; |
---|
582 | end |
---|
583 | end |
---|
584 | |
---|
585 | |
---|
586 | % handles.largeur_option=getappdata(handles.caller, 'largeur_option'); |
---|
587 | |
---|
588 | % fit par gaussienne |
---|
589 | if isequal(handles.largeur_option,1) |
---|
590 | |
---|
591 | xdata=1:rowmax; |
---|
592 | ValMaxr=max(sumrow);ValMinr=min(sumrow); |
---|
593 | x0=[10 250 ValMaxr]; |
---|
594 | % option on enlï¿œve min : |
---|
595 | %[ac,resnorm] = lsqcurvefit(@myfun_gaussienne,x0,xdata,sumcolumn-ValMinc) |
---|
596 | % option : on enlï¿œve l'image noire (fait prï¿œcï¿œdemment) : |
---|
597 | [ar,resnorm] = lsqcurvefit(@myfun_gaussienne,x0,xdata,sumrow); |
---|
598 | rmsV=ar(1); |
---|
599 | |
---|
600 | %grossissement= str2num(handles.G); |
---|
601 | %val=sprintf('%0.2f',rmsV*grossissement); |
---|
602 | |
---|
603 | val=sprintf('%0.2f',rmsV*handles.G); |
---|
604 | % impression du rayon en mm |
---|
605 | set(handles.rmsV_edit12,'String',val); |
---|
606 | sumVstd=0; |
---|
607 | |
---|
608 | %plot du rï¿œsultat |
---|
609 | %F=ac(3)*exp(-(xdata-ac(2)).*(xdata-ac(2))/(2*ac(1)*ac(1)))+ValMinc; |
---|
610 | Fr=ar(3)*exp(-(xdata-ar(2)).*(xdata-ar(2))/(2*ar(1)*ar(1))); |
---|
611 | name=['axes' num2str(3)]; |
---|
612 | axes(handles.(name)); |
---|
613 | plot(xdata,sumrow,'k-'); |
---|
614 | xlim([0 length(sumrow)]) |
---|
615 | hold on |
---|
616 | plot(xdata,Fr,'b-') |
---|
617 | hold off |
---|
618 | |
---|
619 | end |
---|
620 | |
---|
621 | |
---|
622 | % vrai rms |
---|
623 | if isequal(handles.largeur_option,2) |
---|
624 | |
---|
625 | % test ! |
---|
626 | %ZV = load('-mat','/home/matlabML/measdata/LT1data/emittance/2005-10-10_4/profilV_2_38.mat'); |
---|
627 | % ZV = load('-mat','/home/matlabML/measdata/LT1data/emittance/2005-10-10_4/profilV_3_38.mat'); |
---|
628 | % sumrow = ZV.vect_V; |
---|
629 | |
---|
630 | if isequal(Rabotage,num2str(1))&isequal(selection_fenetre_H,num2str(1)) |
---|
631 | errordlg('Attention deselectionnez une option !! ...','Error'); |
---|
632 | elseif isequal(Rabotage,num2str(1)) |
---|
633 | [Y,I] = max(sumrow); |
---|
634 | sumrow = sumrow - Y*0.01; |
---|
635 | for i = 1 : length(sumrow) |
---|
636 | if sumrow(i)<0 |
---|
637 | sumrow(i) = 0; |
---|
638 | end |
---|
639 | end |
---|
640 | elseif isequal(selection_fenetre_V,num2str(1)) |
---|
641 | res= get(handles.rayon_fenetre_V_edit17,'String'); |
---|
642 | rayon_fenetre_V = str2num(res); |
---|
643 | rayon_pixel_V = rayon_fenetre_V/handles.G; |
---|
644 | [Y,I] = max(sumrow) |
---|
645 | %sumrow = sumrow(480/2-rayon_pixel_V : 480/2+rayon_pixel_V); |
---|
646 | sumrow = sumrow(I-rayon_pixel_V : I+rayon_pixel_V); |
---|
647 | end |
---|
648 | |
---|
649 | |
---|
650 | ValMaxr=max(sumrow);ValMinr=min(sumrow); |
---|
651 | sumrow=sumrow-ValMinr; |
---|
652 | vect=1:length(sumrow); |
---|
653 | sumrow1=sumrow/sum(sumrow); |
---|
654 | smoy=sum(sumrow1.*vect); |
---|
655 | toto=(vect-smoy).*(vect-smoy); |
---|
656 | srms=sum(sumrow1.*toto); |
---|
657 | rmsV=sqrt(srms); |
---|
658 | |
---|
659 | %grossissement= str2num(handles.G); |
---|
660 | %val=sprintf('%0.2f',rmsV*grossissement); |
---|
661 | |
---|
662 | val=sprintf('%0.2f',rmsV*handles.G); |
---|
663 | % impression du rayon en mm |
---|
664 | set(handles.rmsV_edit12,'String',val); |
---|
665 | |
---|
666 | %plot du rï¿œsultat |
---|
667 | rowmax = length(sumrow); |
---|
668 | xdata=1:rowmax; |
---|
669 | name=['axes' num2str(3)]; |
---|
670 | axes(handles.(name)); |
---|
671 | plot(xdata,sumrow+ValMinr,'k-'); |
---|
672 | xlim([0 length(sumrow)]) |
---|
673 | hold on |
---|
674 | %plot(xdata,F,'b-') |
---|
675 | hold off |
---|
676 | |
---|
677 | end |
---|
678 | |
---|
679 | |
---|
680 | |
---|
681 | % -------------------------------------------------------------------- |
---|
682 | function FileMenu_Callback(hObject, eventdata, handles) |
---|
683 | % hObject handle to FileMenu (see GCBO) |
---|
684 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
685 | % handles structure with handles and user data (see GUIDATA) |
---|
686 | |
---|
687 | |
---|
688 | % -------------------------------------------------------------------- |
---|
689 | function OpenMenuItem_Callback(hObject, eventdata, handles) |
---|
690 | % hObject handle to OpenMenuItem (see GCBO) |
---|
691 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
692 | % handles structure with handles and user data (see GUIDATA) |
---|
693 | file = uigetfile('*.fig'); |
---|
694 | if ~isequal(file, 0) |
---|
695 | open(file); |
---|
696 | end |
---|
697 | |
---|
698 | % -------------------------------------------------------------------- |
---|
699 | function PrintMenuItem_Callback(hObject, eventdata, handles) |
---|
700 | % hObject handle to PrintMenuItem (see GCBO) |
---|
701 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
702 | % handles structure with handles and user data (see GUIDATA) |
---|
703 | printdlg(handles.figure1) |
---|
704 | |
---|
705 | % -------------------------------------------------------------------- |
---|
706 | function CloseMenuItem_Callback(hObject, eventdata, handles) |
---|
707 | % hObject handle to CloseMenuItem (see GCBO) |
---|
708 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
709 | % handles structure with handles and user data (see GUIDATA) |
---|
710 | selection = questdlg(['Close ' get(handles.figure1,'Name') '?'],... |
---|
711 | ['Close ' get(handles.figure1,'Name') '...'],... |
---|
712 | 'Yes','No','Yes'); |
---|
713 | if strcmp(selection,'No') |
---|
714 | return; |
---|
715 | end |
---|
716 | |
---|
717 | delete(handles.figure1) |
---|
718 | |
---|
719 | |
---|
720 | % --- Executes during object creation, after setting all properties. |
---|
721 | function rmsH_edit11_CreateFcn(hObject, eventdata, handles) |
---|
722 | % hObject handle to rmsH_edit11 (see GCBO) |
---|
723 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
724 | % handles empty - handles not created until after all CreateFcns called |
---|
725 | |
---|
726 | % Hint: edit controls usually have a white background on Windows. |
---|
727 | % See ISPC and COMPUTER. |
---|
728 | if ispc |
---|
729 | set(hObject,'BackgroundColor','white'); |
---|
730 | else |
---|
731 | set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); |
---|
732 | end |
---|
733 | |
---|
734 | |
---|
735 | |
---|
736 | function rmsH_edit11_Callback(hObject, eventdata, handles) |
---|
737 | % hObject handle to rmsH_edit11 (see GCBO) |
---|
738 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
739 | % handles structure with handles and user data (see GUIDATA) |
---|
740 | |
---|
741 | % Hints: get(hObject,'String') returns contents of rmsH_edit11 as text |
---|
742 | % str2double(get(hObject,'String')) returns contents of rmsH_edit11 as a double |
---|
743 | |
---|
744 | |
---|
745 | % --- Executes during object creation, after setting all properties. |
---|
746 | function rmsV_edit12_CreateFcn(hObject, eventdata, handles) |
---|
747 | % hObject handle to rmsV_edit12 (see GCBO) |
---|
748 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
749 | % handles empty - handles not created until after all CreateFcns called |
---|
750 | |
---|
751 | % Hint: edit controls usually have a white background on Windows. |
---|
752 | % See ISPC and COMPUTER. |
---|
753 | if ispc |
---|
754 | set(hObject,'BackgroundColor','white'); |
---|
755 | else |
---|
756 | set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); |
---|
757 | end |
---|
758 | |
---|
759 | |
---|
760 | |
---|
761 | function rmsV_edit12_Callback(hObject, eventdata, handles) |
---|
762 | % hObject handle to rmsV_edit12 (see GCBO) |
---|
763 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
764 | % handles structure with handles and user data (see GUIDATA) |
---|
765 | |
---|
766 | % Hints: get(hObject,'String') returns contents of rmsV_edit12 as text |
---|
767 | % str2double(get(hObject,'String')) returns contents of rmsV_edit12 as a double |
---|
768 | |
---|
769 | |
---|
770 | % ------------------------------------------------------------ |
---|
771 | % Callback for the Store push button |
---|
772 | % ------------------------------------------------------------ |
---|
773 | % --- Executes on button press in enregistrer_pushbutton. |
---|
774 | function enregistrer_pushbutton_Callback(hObject, eventdata, handles) |
---|
775 | % hObject handle to enregistrer_pushbutton (see GCBO) |
---|
776 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
777 | % handles structure with handles and user data (see GUIDATA) |
---|
778 | |
---|
779 | |
---|
780 | %handles.nbenregistrs=handles.nbenregistrs + 1; |
---|
781 | |
---|
782 | LargH=str2num(get(handles.rmsH_edit11,'String')); |
---|
783 | LargV=str2num(get(handles.rmsV_edit12,'String')); |
---|
784 | %%sigH=str2num(get(handles.edit13,'String')); |
---|
785 | %%sigV=str2num(get(handles.edit14,'String')); |
---|
786 | sigH=0; |
---|
787 | sigV=0; |
---|
788 | |
---|
789 | |
---|
790 | %handles.tailles=[ handles.tailles ; LargH sigH LargV sigV ] |
---|
791 | handles.tailles=[ LargH sigH LargV sigV ]; |
---|
792 | setappdata(handles.caller,'tailles',handles.tailles); |
---|
793 | |
---|
794 | guidata(hObject, handles); |
---|
795 | |
---|
796 | % Retrieve old results data structure |
---|
797 | handles.ResultsData = getappdata(handles.caller,'ResultsData'); |
---|
798 | %handles.nbenregistrements |
---|
799 | if isfield(handles,'ResultsData') & ~isempty(handles.ResultsData) |
---|
800 | ResultsData = handles.ResultsData; |
---|
801 | % Determine the maximum run number currently used. |
---|
802 | maxNum = ResultsData(length(ResultsData)).RunNumber; |
---|
803 | ResultNum = maxNum+1; |
---|
804 | ik =length(ResultsData); |
---|
805 | else, % Set up the results data structure |
---|
806 | % ResultsData = struct('nbenregistrs',[],'LargeurH',[],... |
---|
807 | ResultsData = struct('RunName',[],'RunNumber',[],'LargeurH',[],... |
---|
808 | 'sigmaH',[],'LargeurV',[],... |
---|
809 | 'sigmaV',[],'Q4courant',[],... |
---|
810 | 'G',[],'option_L',[],'date',''); |
---|
811 | ResultNum = 1; |
---|
812 | ik = 0; |
---|
813 | end |
---|
814 | |
---|
815 | if isequal(ResultNum,1), |
---|
816 | %--Enable the Plot and Remove buttons |
---|
817 | set([handles.remove_pushbutton,handles.plot_pushbutton,... |
---|
818 | handles.restaurer_pushbutton15],'Enable','on') ; |
---|
819 | % %ouvrir le dossier pour l'enregistrement des profils |
---|
820 | % prompt={'entrer un nom de rï¿œpertoire'}; |
---|
821 | % name='SAUVEGARDE DES PROFILS'; |
---|
822 | % numlines=1; |
---|
823 | % defaultanswer={'JJMMAA_n1'}; |
---|
824 | % options.Resize='on'; |
---|
825 | % options.WindowStyle='normal'; |
---|
826 | % options.Interpreter='tex'; |
---|
827 | % val=0; |
---|
828 | % while isequal(val,0) |
---|
829 | % directory=inputdlg(prompt,name,numlines,defaultanswer,options); |
---|
830 | % if ~isequal(directory,{}) |
---|
831 | % if ~isdir(strcat('/home/PM/tordeux/matlab_test/',directory{:})) |
---|
832 | % mkdir /home/PM/tordeux/matlab_test/directory; |
---|
833 | % val=1; |
---|
834 | % else |
---|
835 | % button = questdlg('ce dossier existe ! voulez-vous continuer?','ATTENTION','oui','non','non') ; |
---|
836 | % if isequal(button,'oui') |
---|
837 | % val=1; |
---|
838 | % end |
---|
839 | % end |
---|
840 | % else |
---|
841 | % %avoir deja creᅵ une directory de secours pour si on a fait "cancel".. |
---|
842 | % directory={'secours'}; |
---|
843 | % val=1; |
---|
844 | % end |
---|
845 | % end |
---|
846 | % chemin=strcat('/home/PM/tordeux/matlab_test/',directory{:}); |
---|
847 | % cd(chemin); |
---|
848 | end |
---|
849 | |
---|
850 | w=getappdata(handles.caller,'tailles'); |
---|
851 | handles.Q4courant=getappdata(handles.caller,'Q4courant'); |
---|
852 | handles.G=getappdata(handles.caller,'G'); |
---|
853 | handles.largeur_option=getappdata(handles.caller, 'largeur_option'); |
---|
854 | moment=datestr(now); |
---|
855 | |
---|
856 | ik = ik + 1; |
---|
857 | ResultsData(ik).RunName = ['Point ',num2str(ResultNum)]; |
---|
858 | ResultsData(ik).RunNumber = ResultNum; |
---|
859 | ResultsData(ik).LargeurH = w(1); |
---|
860 | ResultsData(ik).sigmaH = w(2); |
---|
861 | ResultsData(ik).LargeurV = w(3); |
---|
862 | ResultsData(ik).sigmaV = w(4); |
---|
863 | ResultsData(ik).Q4courant = handles.Q4courant; |
---|
864 | ResultsData(ik).G =handles.G; |
---|
865 | ResultsData(ik).option_L =handles.largeur_option; |
---|
866 | ResultsData(ik).date=moment; |
---|
867 | |
---|
868 | % Build the new results list string for the listbox |
---|
869 | ResultsStr = get(handles.listbox,'String'); |
---|
870 | Qcour=handles.Q4courant; |
---|
871 | i1=sprintf(' %9.2f \n',Qcour); |
---|
872 | i2=sprintf(' %9.2f \n',w(1)); |
---|
873 | i3=sprintf(' %9.2f \n',w(2)); |
---|
874 | i4=sprintf(' %9.2f \n',w(3)); |
---|
875 | i5=sprintf(' %9.2f \n',w(4)); |
---|
876 | i6=sprintf(' %9.3f \n',handles.G); |
---|
877 | i7=sprintf(' %4.0f \n',handles.largeur_option); |
---|
878 | |
---|
879 | |
---|
880 | if isequal(ResultNum,1) |
---|
881 | ResultsStr = {['Point 1',... |
---|
882 | i1,i2,i3,i4,i5,i6,i7,' ',moment]}; |
---|
883 | % num2str(Qcour),' ',num2str(w(1)),' ',num2str(w(2)),... |
---|
884 | % ' ',num2str(w(3)),' ',num2str(w(4)),... |
---|
885 | % ' ',num2str(handles.G),' ',num2str(handles.largeur_option),' ',moment... |
---|
886 | % ]}; |
---|
887 | else |
---|
888 | |
---|
889 | ResultsStr = [ResultsStr; {['Point ',num2str(ResultNum),... |
---|
890 | i1,i2,i3,i4,i5,i6,i7,' ',moment]}]; |
---|
891 | end |
---|
892 | set(handles.listbox,'String',ResultsStr); |
---|
893 | set(handles.listbox,'Value',size(ResultsStr,1)); |
---|
894 | |
---|
895 | |
---|
896 | % Store the new ResultsData |
---|
897 | handles.ResultsData = ResultsData; |
---|
898 | setappdata(handles.caller,'ResultsData',ResultsData); |
---|
899 | set(handles.nbacqu_edit13,'String', num2str(size(ResultsStr,1))); |
---|
900 | |
---|
901 | |
---|
902 | guidata(hObject, handles); |
---|
903 | |
---|
904 | |
---|
905 | % Enregistrer sur machine locale |
---|
906 | G=getappdata(handles.caller,'G'); |
---|
907 | vect_H=getappdata(handles.caller, 'profil_H'); |
---|
908 | Name=strcat('profilH_',num2str(ResultNum),'_',num2str(handles.G*1000)); |
---|
909 | save(Name,'moment', 'G','vect_H') ; |
---|
910 | |
---|
911 | vect_V=getappdata(handles.caller, 'profil_V'); |
---|
912 | Name=strcat('profilV_',num2str(ResultNum),'_',num2str(handles.G*1000)); |
---|
913 | save(Name,'moment', 'G','vect_V') ; |
---|
914 | |
---|
915 | %eval(['save ',strcat('profilH_',num2str(ResultNum)), moment vect_H]) ; |
---|
916 | |
---|
917 | %function pushbutton2_Callback(hObject, eventdata, handles) |
---|
918 | %% NE FAIT RIEN |
---|
919 | |
---|
920 | |
---|
921 | |
---|
922 | function rayon_fenetre_H_edit16_Callback(hObject, eventdata, handles) |
---|
923 | % hObject handle to rayon_fenetre_H_edit16 (see GCBO) |
---|
924 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
925 | % handles structure with handles and user data (see GUIDATA) |
---|
926 | |
---|
927 | % Hints: get(hObject,'String') returns contents of rayon_fenetre_H_edit16 as text |
---|
928 | % str2double(get(hObject,'String')) returns contents of rayon_fenetre_H_edit16 as a double |
---|
929 | |
---|
930 | |
---|
931 | % --- Executes during object creation, after setting all properties. |
---|
932 | function rayon_fenetre_H_edit16_CreateFcn(hObject, eventdata, handles) |
---|
933 | % hObject handle to rayon_fenetre_H_edit16 (see GCBO) |
---|
934 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
935 | % handles empty - handles not created until after all CreateFcns called |
---|
936 | |
---|
937 | % Hint: edit controls usually have a white background on Windows. |
---|
938 | % See ISPC and COMPUTER. |
---|
939 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
940 | set(hObject,'BackgroundColor','white'); |
---|
941 | end |
---|
942 | |
---|
943 | |
---|
944 | |
---|
945 | function rayon_fenetre_V_edit17_Callback(hObject, eventdata, handles) |
---|
946 | % hObject handle to rayon_fenetre_V_edit17 (see GCBO) |
---|
947 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
948 | % handles structure with handles and user data (see GUIDATA) |
---|
949 | |
---|
950 | % Hints: get(hObject,'String') returns contents of rayon_fenetre_V_edit17 as text |
---|
951 | % str2double(get(hObject,'String')) returns contents of rayon_fenetre_V_edit17 as a double |
---|
952 | |
---|
953 | |
---|
954 | % --- Executes during object creation, after setting all properties. |
---|
955 | function rayon_fenetre_V_edit17_CreateFcn(hObject, eventdata, handles) |
---|
956 | % hObject handle to rayon_fenetre_V_edit17 (see GCBO) |
---|
957 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
958 | % handles empty - handles not created until after all CreateFcns called |
---|
959 | |
---|
960 | % Hint: edit controls usually have a white background on Windows. |
---|
961 | % See ISPC and COMPUTER. |
---|
962 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
963 | set(hObject,'BackgroundColor','white'); |
---|
964 | end |
---|
965 | |
---|
966 | function uibuttongroup_SelectionChangeFcn(hObject,eventdata,handles) |
---|
967 | % hObject handle to uipanel1 (see GCBO) |
---|
968 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
969 | % handles structure with handles and user data (see GUIDATA) |
---|
970 | |
---|
971 | switch get(get(hObject,'SelectedObject'),'Tag') % Get Tag of selected object |
---|
972 | case 'radiobutton1' |
---|
973 | % code piece when radiobutton1 is selected goes here |
---|
974 | disp('selection d''une fenetre <-') |
---|
975 | setappdata(handles.caller,'selection_fenetre_H',num2str(1)); |
---|
976 | case 'radiobutton2' |
---|
977 | % code piece when radiobutton2 is selected goes here |
---|
978 | disp('arret selection de fenetre ->') |
---|
979 | setappdata(handles.caller,'selection_fenetre_H',num2str(0)); |
---|
980 | end |
---|
981 | |
---|
982 | function uibuttongroup_SelectionChangeFcn_V(hObject,eventdata,handles) |
---|
983 | % hObject handle to uipanel1 (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 | switch get(get(hObject,'SelectedObject'),'Tag') % Get Tag of selected object |
---|
988 | case 'radiobutton1' |
---|
989 | % code piece when radiobutton1 is selected goes here |
---|
990 | disp('selection d''une fenetre <-') |
---|
991 | setappdata(handles.caller,'selection_fenetre_V',num2str(1)); |
---|
992 | case 'radiobutton2' |
---|
993 | % code piece when radiobutton2 is selected goes here |
---|
994 | disp('arret selection de fenetre ->') |
---|
995 | setappdata(handles.caller,'selection_fenetre_V',num2str(0)); |
---|
996 | end |
---|
997 | |
---|
998 | |
---|
999 | function uibuttongroup_SelectionChangeFcn_R(hObject,eventdata,handles) |
---|
1000 | % hObject handle to uipanel1 (see GCBO) |
---|
1001 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
1002 | % handles structure with handles and user data (see GUIDATA) |
---|
1003 | |
---|
1004 | switch get(get(hObject,'SelectedObject'),'Tag') % Get Tag of selected object |
---|
1005 | case 'radiobutton1' |
---|
1006 | % code piece when radiobutton1 is selected goes here |
---|
1007 | disp('Rabotage à 1% <-') |
---|
1008 | setappdata(handles.caller,'Rabotage',num2str(1)); |
---|
1009 | case 'radiobutton2' |
---|
1010 | % code piece when radiobutton2 is selected goes here |
---|
1011 | disp('Rabotage à 1% ->') |
---|
1012 | setappdata(handles.caller,'Rabotage',num2str(0)); |
---|
1013 | end |
---|