source: MML/trunk/machine/SOLEIL/LT1/emittance/showsansfgui_15.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: 8.6 KB
Line 
1function varargout = showsansfgui_15(varargin)  % EN COURS !!!!!!
2% showsansfgui_15 M-file for showsansfgui_15.fig
3%      showsansfgui_15, by itself, creates a new showsansfgui_15 or raises the existing
4%      singleton*.
5%
6%      H = showsansfgui_15 returns the handle to a new showsansfgui_15 or the handle to
7%      the existing singleton*.
8%
9%      showsansfgui_15('CALLBACK',hObject,eventData,handles,...) calls the local
10%      function named CALLBACK in showsansfgui_15.M with the given input arguments.
11%
12%      showsansfgui_15('Property','Value',...) creates a new showsansfgui_15 or raises the
13%      existing singleton*.  Starting from the left, property value pairs are
14%      applied to the GUI before showsansfgui_15_OpeningFunction gets called.  An
15%      unrecognized property name or invalid value makes property application
16%      stop.  All inputs are passed to showsansfgui_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 showsansfgui_15
24
25% Last Modified by GUIDE v2.5 30-Aug-2004 18:40:49
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', @showsansfgui_15_OpeningFcn, ...
32                   'gui_OutputFcn',  @showsansfgui_15_OutputFcn, ...
33                   'gui_LayoutFcn',  [] , ...
34                   'gui_Callback',   []);
35if nargin & isstr(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 showsansfgui_15 is made visible.
48function showsansfgui_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 showsansfgui_15 (see VARARGIN)
54
55% Choose default command line output for showsansfgui_15
56
57% Choose default command line output for test_1
58handles.output = hObject;
59
60if iscell(varargin) && ~isempty(varargin)
61   
62    % store handle from caller
63    handles.caller2 = varargin{1}.figure1;
64   
65    % Get value from Application-Defined data
66%     handles.nbiterations = getappdata(handles.caller, 'nbiterations');
67%     handles.nbenregistrs = getappdata(handles.caller, 'nbenregistrs');
68%     %handles.Qcourant=getappdata(handles.caller,'Qcourant');
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.largeur_option=getappdata(handles.caller, 'largeur_option');
77    handles.G=getappdata(handles.caller2, 'G');   
78    handles.vect_colonne_noire=getappdata(handles.caller2, 'vect_colonne_noire');
79    handles.vect_ligne_noire=getappdata(handles.caller2, 'vect_ligne_noire');
80    device_name = getappdata(handles.caller2, 'device_name');
81   
82    % Update handles structure
83    guidata(hObject, handles);
84
85else
86   
87end
88
89% Update handles structure
90guidata(hObject, handles);
91
92% UIWAIT makes showsansfgui_15 wait for user response (see UIRESUME)
93% uiwait(handles.main);
94
95% dᅵcalage du shutter de la camᅵra en microsecondes (au moins 200 ms, ᅵ
96% tester !!!)
97% affiche le shutter delay avant :
98disp('avant changement = ')
99ShutterDelayvalue = tango_command_inout(device_name.videograbber,'GetShutterDelay')
100%pause(0.5);
101tango_command_inout(device_name.videograbber,'SetShutterDelay',200000.);
102pause(1);
103disp('pendant changement = ')
104tango_command_inout(device_name.videograbber,'GetShutterDelay')
105
106%generation d'une image noire
107    % rowmax=513;
108    % columnmax=701;
109    % p=0.2;
110    % toto = p*rand(rowmax+1,columnmax+1);
111
112device_name = getappdata(handles.caller2,'device_name');
113
114%axes1=findobj(allchild(handles.figure1),'Tag','axes1');
115%axes(handles.axes1);
116dev=device_name.videograbber;
117
118toto=tango_read_attribute(dev,'Image');
119%toto=tango_read_attribute(dev,'corrected_image');
120image(toto.value,'CDataMapping','scaled');
121image(toto.value,'CDataMapping','scaled','Parent',handles.axes1)
122rowmax=size(toto.value,1);
123columnmax=size(toto.value,2);
124
125%imagesc(toto.value,'Parent',handles.axes1);
126colormap(gray);   
127
128%projections
129    % sumcolumn=sum(toto(:,:));
130    % sumrow=sum(toto(:,:)');
131sumcolumn=sum(toto.value(:,:));
132sumrow=sum(toto.value(:,:)');
133
134%plot de l'image noire et des profils
135name=['axes' num2str(1)];
136axes(handles.(name)); %axis image ;
137image(toto.value,'CDataMapping','scaled')
138
139%xdata=1:columnmax+1;
140xdata=1:columnmax;
141name=['axes' num2str(2)];
142axes(handles.(name));
143plot(xdata,sumcolumn,'k-');
144xlim([0 length(sumcolumn)]);
145
146%xdata=1:rowmax+1;
147xdata=1:rowmax;
148name=['axes' num2str(3)];
149axes(handles.(name));
150plot(xdata,sumrow,'k-');
151xlim([0 length(sumrow)]);
152%hold on
153
154%hold off
155
156setappdata(handles.caller2, 'vect_colonne_noire',sumcolumn);
157setappdata(handles.caller2, 'vect_ligne_noire',sumrow);
158
159% repositionner ᅵ la valeur de dᅵpart le shutter de la camᅵra !!
160% ???
161% tango_command_inout(device_name.videograbber,'SetShutterDelay',200000.);
162tango_command_inout(device_name.videograbber,'SetShutterDelay', ShutterDelayvalue);
163disp('ShutterDelay remis comme avant ? = ')
164tango_command_inout(device_name.videograbber,'GetShutterDelay')
165
166% --- Outputs from this function are returned to the command line.
167function varargout = showsansfgui_15_OutputFcn(hObject, eventdata, handles)
168% varargout  cell array for returning output args (see VARARGOUT);
169% hObject    handle to figure
170% eventdata  reserved - to be defined in a future version of MATLAB
171% handles    structure with handles and user data (see GUIDATA)
172
173% Get default command line output from handles structure
174varargout{1} = handles.output;  % ???
175
176
177% --- Executes on button press in enregistrer_pushbutton1.
178function enregistrer_pushbutton1_Callback(hObject, eventdata, handles)
179% hObject    handle to enregistrer_pushbutton1 (see GCBO)
180% eventdata  reserved - to be defined in a future version of MATLAB
181% handles    structure with handles and user data (see GUIDATA)
182
183moment=datestr(now);
184
185
186%   maintenant fait dans emittance_v15 !!
187%         %ouvrir le dossier pour l'enregistrement des profils noires
188%         prompt={'entrer un nom de rï¿œpertoire'};
189%         name='SAUVEGARDE DES PROFILS';
190%         numlines=1;
191%         defaultanswer={'JJMMAA_n1'};
192%         options.Resize='on';
193%         options.WindowStyle='normal';
194%         options.Interpreter='tex';
195%         val=0;
196%         while isequal(val,0)
197%         directory=inputdlg(prompt,name,numlines,defaultanswer,options);
198%                 if ~isequal(directory,{})
199%                     if ~isdir(strcat('/home/PM/tordeux/matlab_test/',directory{:}))
200%
201%                         chemin=strcat('/home/PM/tordeux/matlab_test/',directory{:})
202%                         %cd  /home/PM/tordeux/matlab_test/
203%                         mkdir(chemin)
204%                         val=1;
205%                     else   
206%                         button = questdlg('ce dossier existe ! voulez-vous continuer?','ATTENTION','oui','non','non')  ;
207%                         if isequal(button,'oui')
208%                             val=1;
209%                         end
210%                     end     
211%                 else
212%                     %avoir deja creï¿œ une directory de secours pour si on a fait "cancel"..
213%                     directory={'secours'};
214%                     val=1;
215%                 end
216%         end
217%         chemin=strcat('/home/PM/tordeux/matlab_test/',directory{:});
218%         cd(chemin);
219%
220
221
222% Enregistrer sur machine locale
223% on associe une image de noire avec le grandissement en ï¿œm/pixel (pb du point !..)
224G = getappdata(handles.caller2, 'G');
225vect_H=getappdata(handles.caller2, 'vect_colonne_noire');
226Name=strcat('vect_colonne_noire_',num2str(handles.G*1000));
227save(Name,'moment', 'G','vect_H') ;
228
229vect_V=getappdata(handles.caller2, 'vect_ligne_noire');
230Name=strcat('vect_ligne_noire_',num2str(handles.G*1000));
231save(Name,'moment','G', 'vect_V') ;
Note: See TracBrowser for help on using the repository browser.