1 | function varargout = RadiaMapGui(varargin) |
---|
2 | % RADIAMAPGUI M-file for RadiaMapGui.fig |
---|
3 | % RADIAMAPGUI, by itself, creates a new RADIAMAPGUI or raises the existing |
---|
4 | % singleton*. |
---|
5 | % |
---|
6 | % H = RADIAMAPGUI returns the handle to a new RADIAMAPGUI or the handle to |
---|
7 | % the existing singleton*. |
---|
8 | % |
---|
9 | % RADIAMAPGUI('CALLBACK',hObject,eventData,handles,...) calls the local |
---|
10 | % function named CALLBACK in RADIAMAPGUI.M with the given input arguments. |
---|
11 | % |
---|
12 | % RADIAMAPGUI('Property','Value',...) creates a new RADIAMAPGUI or raises the |
---|
13 | % existing singleton*. Starting from the left, property value pairs are |
---|
14 | % applied to the GUI before RadiaMapGui_OpeningFunction gets called. An |
---|
15 | % unrecognized property name or invalid value makes property application |
---|
16 | % stop. All inputs are passed to RadiaMapGui_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 RadiaMapGui |
---|
24 | |
---|
25 | % Last Modified by GUIDE v2.5 07-Jan-2011 15:24:20 |
---|
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', @RadiaMapGui_OpeningFcn, ... |
---|
32 | 'gui_OutputFcn', @RadiaMapGui_OutputFcn, ... |
---|
33 | 'gui_LayoutFcn', [] , ... |
---|
34 | 'gui_Callback', []); |
---|
35 | if nargin && ischar(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 RadiaMapGui is made visible. |
---|
48 | function RadiaMapGui_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 RadiaMapGui (see VARARGIN) |
---|
54 | |
---|
55 | % Choose default command line output for RadiaMapGui |
---|
56 | handles.output = hObject; |
---|
57 | |
---|
58 | % Update handles structure |
---|
59 | guidata(hObject, handles); |
---|
60 | |
---|
61 | % UIWAIT makes RadiaMapGui wait for user response (see UIRESUME) |
---|
62 | % uiwait(handles.figure1); |
---|
63 | |
---|
64 | %set default value for the plot StartLn, plot EndLn, plot data after |
---|
65 | % smooth Ln, Length of the undulator when generate 2D map from 1D map data |
---|
66 | handles.EndLn = str2double(get(handles.EndLn,'String')); |
---|
67 | handles.StartLn= str2double(get(handles.StartLn,'String')); |
---|
68 | handles.plotsmoothLn = str2double(get(handles.plotsmoothLn,'String')); |
---|
69 | handles.Length = str2double(get(handles.Length,'String')); |
---|
70 | |
---|
71 | % Update handles structure |
---|
72 | guidata(hObject, handles); |
---|
73 | |
---|
74 | |
---|
75 | |
---|
76 | % --- Outputs from this function are returned to the command line. |
---|
77 | function varargout = RadiaMapGui_OutputFcn(hObject, eventdata, handles) |
---|
78 | % varargout cell array for returning output args (see VARARGOUT); |
---|
79 | % hObject handle to figure |
---|
80 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
81 | % handles structure with handles and user data (see GUIDATA) |
---|
82 | |
---|
83 | % Get default command line output from handles structure |
---|
84 | varargout{1} = handles.output; |
---|
85 | |
---|
86 | |
---|
87 | function edit1_Callback(hObject, eventdata, handles) |
---|
88 | % hObject handle to edit1 (see GCBO) |
---|
89 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
90 | % handles structure with handles and user data (see GUIDATA) |
---|
91 | |
---|
92 | |
---|
93 | % Hints: get(hObject,'String') returns contents of edit1 as text |
---|
94 | % str2double(get(hObject,'String')) returns contents of edit1 as a double |
---|
95 | |
---|
96 | |
---|
97 | % --- Executes during object creation, after setting all properties. |
---|
98 | function edit1_CreateFcn(hObject, eventdata, handles) |
---|
99 | % hObject handle to edit1 (see GCBO) |
---|
100 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
101 | % handles empty - handles not created until after all CreateFcns called |
---|
102 | |
---|
103 | % Hint: edit controls usually have a white background on Windows. |
---|
104 | % See ISPC and COMPUTER. |
---|
105 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
106 | set(hObject,'BackgroundColor','white'); |
---|
107 | end |
---|
108 | |
---|
109 | |
---|
110 | |
---|
111 | % --- Executes on button press in open2Dmap. |
---|
112 | function open2Dmap_Callback(hObject, eventdata, handles) |
---|
113 | % hObject handle to open2Dmap (see GCBO) |
---|
114 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
115 | % handles structure with handles and user data (see GUIDATA) |
---|
116 | |
---|
117 | |
---|
118 | %set the 'smooth finish' display window to its initial value |
---|
119 | h = handles.smoothfinish; |
---|
120 | set(h,'String','finish smooth ???','Foregroundcolor','y'); |
---|
121 | |
---|
122 | |
---|
123 | % select the file name to read |
---|
124 | [FileName,PathName,FilterIndex] = uigetfile('*.dat'); |
---|
125 | %save the whole path |
---|
126 | handles.openfilename = [PathName,FileName]; |
---|
127 | handles.FileName = FileName; |
---|
128 | handles.PathName = PathName; |
---|
129 | |
---|
130 | |
---|
131 | |
---|
132 | % get the file name and read the file |
---|
133 | [x Bx,Bz,Px,Pz,Lu] = ReadRadiaMap(handles.openfilename); |
---|
134 | % save the data the all handles |
---|
135 | handles.x = x; |
---|
136 | handles.Px = Px; |
---|
137 | handles.Pz = Pz; |
---|
138 | handles.Lu = Lu; |
---|
139 | handles.Bx = Bx; |
---|
140 | handles.Bz = Bz; |
---|
141 | handles.forder = '2nd'; |
---|
142 | handles.funit = '[T2m2]'; |
---|
143 | %pass the file name to all the callbacks |
---|
144 | guidata(hObject,handles); |
---|
145 | |
---|
146 | |
---|
147 | |
---|
148 | %display the open file name in the display text window |
---|
149 | h = handles.displayOpenFile; |
---|
150 | set(h,'String',handles.openfilename); |
---|
151 | |
---|
152 | %display the horizontal and vertical points in the display text window |
---|
153 | h1 = handles.Hpoints; |
---|
154 | set(h1,'String',Px); |
---|
155 | h2 = handles.Vpoints; |
---|
156 | set(h2,'String',Pz); |
---|
157 | |
---|
158 | |
---|
159 | |
---|
160 | % --- Executes on button press in displayOpenFile. |
---|
161 | function displayOpenFile_Callback(hObject, eventdata, handles) |
---|
162 | % hObject handle to displayOpenFile (see GCBO) |
---|
163 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
164 | % handles structure with handles and user data (see GUIDATA) |
---|
165 | |
---|
166 | % Hint: get(hObject,'Value') returns toggle state of displayOpenFile |
---|
167 | |
---|
168 | |
---|
169 | |
---|
170 | |
---|
171 | function StartLn_Callback(hObject, eventdata, handles) |
---|
172 | % hObject handle to StartLn (see GCBO) |
---|
173 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
174 | % handles structure with handles and user data (see GUIDATA) |
---|
175 | |
---|
176 | % Hints: get(hObject,'String') returns contents of StartLn as text |
---|
177 | % str2double(get(hObject,'String')) returns contents of StartLn as a double |
---|
178 | |
---|
179 | %get the user input start line number |
---|
180 | StartLn = str2double(get(hObject,'String')); |
---|
181 | %save the start line number to all handles |
---|
182 | handles.StartLn = StartLn; |
---|
183 | guidata(hObject,handles); |
---|
184 | |
---|
185 | % --- Executes during object creation, after setting all properties. |
---|
186 | function StartLn_CreateFcn(hObject, eventdata, handles) |
---|
187 | % hObject handle to StartLn (see GCBO) |
---|
188 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
189 | % handles empty - handles not created until after all CreateFcns called |
---|
190 | |
---|
191 | % Hint: edit controls usually have a white background on Windows. |
---|
192 | % See ISPC and COMPUTER. |
---|
193 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
194 | set(hObject,'BackgroundColor','white'); |
---|
195 | end |
---|
196 | |
---|
197 | |
---|
198 | |
---|
199 | function EndLn_Callback(hObject, eventdata, handles) |
---|
200 | % hObject handle to EndLn (see GCBO) |
---|
201 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
202 | % handles structure with handles and user data (see GUIDATA) |
---|
203 | |
---|
204 | % Hints: get(hObject,'String') returns contents of EndLn as text |
---|
205 | % str2double(get(hObject,'String')) returns contents of EndLn as a double |
---|
206 | |
---|
207 | EndLn = str2double(get(hObject,'String')); |
---|
208 | |
---|
209 | %get the user input end line number |
---|
210 | EndLn = str2double(get(hObject,'String')); |
---|
211 | %save the end line number to all handles |
---|
212 | handles.EndLn = EndLn; |
---|
213 | guidata(hObject,handles); |
---|
214 | |
---|
215 | |
---|
216 | |
---|
217 | |
---|
218 | % --- Executes during object creation, after setting all properties. |
---|
219 | function EndLn_CreateFcn(hObject, eventdata, handles) |
---|
220 | % hObject handle to EndLn (see GCBO) |
---|
221 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
222 | % handles empty - handles not created until after all CreateFcns called |
---|
223 | |
---|
224 | % Hint: edit controls usually have a white background on Windows. |
---|
225 | % See ISPC and COMPUTER. |
---|
226 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
227 | set(hObject,'BackgroundColor','white'); |
---|
228 | end |
---|
229 | |
---|
230 | |
---|
231 | |
---|
232 | % --- Executes on button press in PlotBxx. |
---|
233 | function PlotBxx_Callback(hObject, eventdata, handles) |
---|
234 | % hObject handle to PlotBxx (see GCBO) |
---|
235 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
236 | % handles structure with handles and user data (see GUIDATA) |
---|
237 | |
---|
238 | PlotRadiaMap_Bxx(handles.StartLn,handles.EndLn,handles.x,handles.Bx,handles.forder,handles.funit); |
---|
239 | |
---|
240 | |
---|
241 | % --- Executes on button press in PlotBxy. |
---|
242 | function PlotBxy_Callback(hObject, eventdata, handles) |
---|
243 | % hObject handle to PlotBxy (see GCBO) |
---|
244 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
245 | % handles structure with handles and user data (see GUIDATA) |
---|
246 | |
---|
247 | % plot the radia map Bx versus y |
---|
248 | PlotRadiaMap_Bxy(handles.StartLn,handles.EndLn,handles.x,handles.Bx,handles.forder,handles.funit); |
---|
249 | |
---|
250 | % --- Executes on button press in PlotBxxy. |
---|
251 | function PlotBxxy_Callback(hObject, eventdata, handles) |
---|
252 | % hObject handle to PlotBxxy (see GCBO) |
---|
253 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
254 | % handles structure with handles and user data (see GUIDATA) |
---|
255 | |
---|
256 | % plot the 2D mesh of Bx |
---|
257 | PlotRadiaMap_Bxxy(handles.x,handles.Bx,handles.forder,handles.funit); |
---|
258 | |
---|
259 | |
---|
260 | % --- Executes on button press in PlotByx. |
---|
261 | function PlotByx_Callback(hObject, eventdata, handles) |
---|
262 | % hObject handle to PlotByx (see GCBO) |
---|
263 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
264 | % handles structure with handles and user data (see GUIDATA) |
---|
265 | |
---|
266 | PlotRadiaMap_Byx(handles.StartLn,handles.EndLn,handles.x,handles.Bz,handles.forder,handles.funit); |
---|
267 | |
---|
268 | % --- Executes on button press in PlotByy. |
---|
269 | function PlotByy_Callback(hObject, eventdata, handles) |
---|
270 | % hObject handle to PlotByy (see GCBO) |
---|
271 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
272 | % handles structure with handles and user data (see GUIDATA) |
---|
273 | |
---|
274 | % plot the radia map By versus y |
---|
275 | PlotRadiaMap_Byy(handles.StartLn,handles.EndLn,handles.x,handles.Bz,handles.forder,handles.funit); |
---|
276 | |
---|
277 | % --- Executes on button press in PlotByxy. |
---|
278 | function PlotByxy_Callback(hObject, eventdata, handles) |
---|
279 | % hObject handle to PlotByxy (see GCBO) |
---|
280 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
281 | % handles structure with handles and user data (see GUIDATA) |
---|
282 | |
---|
283 | % plot the 2D mesh of By |
---|
284 | PlotRadiaMap_Byxy(handles.x,handles.Bz,handles.forder,handles.funit); |
---|
285 | |
---|
286 | |
---|
287 | % --- Executes on button press in closefigure. |
---|
288 | function closefigure_Callback(hObject, eventdata, handles) |
---|
289 | % hObject handle to closefigure (see GCBO) |
---|
290 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
291 | % handles structure with handles and user data (see GUIDATA) |
---|
292 | |
---|
293 | %close all figures except figure: GUI |
---|
294 | figs=findobj('Type','Figure'); |
---|
295 | close(figs(figs~=gcbf)); |
---|
296 | |
---|
297 | |
---|
298 | |
---|
299 | % --- Executes on button press in pushbutton11. |
---|
300 | function pushbutton11_Callback(hObject, eventdata, handles) |
---|
301 | % hObject handle to pushbutton11 (see GCBO) |
---|
302 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
303 | % handles structure with handles and user data (see GUIDATA) |
---|
304 | |
---|
305 | |
---|
306 | % --- Executes on button press in Smooth. |
---|
307 | function Smooth_Callback(hObject, eventdata, handles) |
---|
308 | % hObject handle to Smooth (see GCBO) |
---|
309 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
310 | % handles structure with handles and user data (see GUIDATA) |
---|
311 | |
---|
312 | %smooth the data and save the data with the file extension: interpolation |
---|
313 | [sx,sBx,sBz] = SmoothRadiaMap(handles.PathName,handles.FileName,handles.x,handles.Bx,handles.Bz,... |
---|
314 | handles.Px,handles.Pz,handles.Lu,handles.forder,handles.funit); |
---|
315 | |
---|
316 | handles.sx = sx; |
---|
317 | handles.sBx = sBx; |
---|
318 | handles.sBz = sBz; |
---|
319 | guidata(hObject,handles); |
---|
320 | |
---|
321 | %display 'the smooth is finished' in the display text window |
---|
322 | h = handles.smoothfinish; |
---|
323 | set(h,'String','finish smooth !!!','Foregroundcolor','g'); |
---|
324 | |
---|
325 | |
---|
326 | % --- Executes on button press in plotsmooth. |
---|
327 | function plotsmooth_Callback(hObject, eventdata, handles) |
---|
328 | % hObject handle to plotsmooth (see GCBO) |
---|
329 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
330 | % handles structure with handles and user data (see GUIDATA) |
---|
331 | |
---|
332 | %get the line number to plot |
---|
333 | Ln = handles.plotsmoothLn; |
---|
334 | % plot the radia map after smooth |
---|
335 | PlotSmoothRadiaMap(Ln,handles.x,handles.Bx,handles.Bz,handles.sx,... |
---|
336 | handles.sBx,handles.sBz,handles.forder,handles.funit); |
---|
337 | |
---|
338 | % --- Executes on button press in smoothfinish. |
---|
339 | function smoothfinish_Callback(hObject, eventdata, handles) |
---|
340 | % hObject handle to smoothfinish (see GCBO) |
---|
341 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
342 | % handles structure with handles and user data (see GUIDATA) |
---|
343 | |
---|
344 | % Hint: get(hObject,'Value') returns toggle state of smoothfinish |
---|
345 | |
---|
346 | |
---|
347 | % --- Executes on button press in open1Dmap. |
---|
348 | function open1Dmap_Callback(hObject, eventdata, handles) |
---|
349 | % hObject handle to open1Dmap (see GCBO) |
---|
350 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
351 | % handles structure with handles and user data (see GUIDATA) |
---|
352 | |
---|
353 | % select the file name to read |
---|
354 | [FileName,PathName,FilterIndex] = uigetfile('*.dat'); |
---|
355 | setappdata(hObject,'UserFileName',FileName); |
---|
356 | setappdata(hObject,'UserPathName',PathName); |
---|
357 | |
---|
358 | % --- Executes on button press in Gen2Dmap. |
---|
359 | function Gen2Dmap_Callback(hObject, eventdata, handles) |
---|
360 | % hObject handle to Gen2Dmap (see GCBO) |
---|
361 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
362 | % handles structure with handles and user data (see GUIDATA) |
---|
363 | |
---|
364 | %get the user opened path name and file name |
---|
365 | PathName = getappdata(handles.open1Dmap,'UserPathName'); |
---|
366 | FileName = getappdata(handles.open1Dmap,'UserFileName'); |
---|
367 | % get the undulator Length |
---|
368 | Length = handles.Length; |
---|
369 | |
---|
370 | GenFieldMap(PathName,FileName,Length); |
---|
371 | |
---|
372 | |
---|
373 | |
---|
374 | function Length_Callback(hObject, eventdata, handles) |
---|
375 | % hObject handle to Length (see GCBO) |
---|
376 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
377 | % handles structure with handles and user data (see GUIDATA) |
---|
378 | |
---|
379 | % Hints: get(hObject,'String') returns contents of Length as text |
---|
380 | % str2double(get(hObject,'String')) returns contents of Length as a double |
---|
381 | |
---|
382 | handles.Length = str2double(get(hObject,'String')); |
---|
383 | guidata(hObject,handles); %update the data |
---|
384 | |
---|
385 | % setappdata(hObject,'Length',Length); |
---|
386 | |
---|
387 | % --- Executes during object creation, after setting all properties. |
---|
388 | function Length_CreateFcn(hObject, eventdata, handles) |
---|
389 | % hObject handle to Length (see GCBO) |
---|
390 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
391 | % handles empty - handles not created until after all CreateFcns called |
---|
392 | |
---|
393 | % Hint: edit controls usually have a white background on Windows. |
---|
394 | % See ISPC and COMPUTER. |
---|
395 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
396 | set(hObject,'BackgroundColor','white'); |
---|
397 | end |
---|
398 | |
---|
399 | |
---|
400 | |
---|
401 | function plotsmoothLn_Callback(hObject, eventdata, handles) |
---|
402 | % hObject handle to plotsmoothLn (see GCBO) |
---|
403 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
404 | % handles structure with handles and user data (see GUIDATA) |
---|
405 | |
---|
406 | % Hints: get(hObject,'String') returns contents of plotsmoothLn as text |
---|
407 | % str2double(get(hObject,'String')) returns contents of plotsmoothLn as a double |
---|
408 | |
---|
409 | handles.plotsmoothLn = str2double(get(hObject,'String')); |
---|
410 | guidata(hObject,handles); |
---|
411 | |
---|
412 | % setappdata(hObject,'plotsmoothLn',Ln); |
---|
413 | |
---|
414 | % --- Executes during object creation, after setting all properties. |
---|
415 | function plotsmoothLn_CreateFcn(hObject, eventdata, handles) |
---|
416 | % hObject handle to plotsmoothLn (see GCBO) |
---|
417 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
418 | % handles empty - handles not created until after all CreateFcns called |
---|
419 | |
---|
420 | % Hint: edit controls usually have a white background on Windows. |
---|
421 | % See ISPC and COMPUTER. |
---|
422 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
423 | set(hObject,'BackgroundColor','white'); |
---|
424 | end |
---|
425 | |
---|
426 | |
---|
427 | % --- Executes on button press in deleteline. |
---|
428 | function deleteline_Callback(hObject, eventdata, handles) |
---|
429 | % hObject handle to deleteline (see GCBO) |
---|
430 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
431 | % handles structure with handles and user data (see GUIDATA) |
---|
432 | |
---|
433 | |
---|
434 | %get the value of str to delete 'horizontal' or 'vertical' line |
---|
435 | str= getappdata(handles.popupmenu1,'str'); |
---|
436 | |
---|
437 | % get the value of delete line |
---|
438 | deleteLnstr= getappdata(handles.deleteLn,'str'); |
---|
439 | |
---|
440 | % plot the radia map after smooth |
---|
441 | DeleteLineRadiaMap(handles.PathName,handles.FileName,handles.x,handles.Bx,handles.Bz,handles.Lu,... |
---|
442 | handles.forder,handles.funit,deleteLnstr,str); |
---|
443 | |
---|
444 | |
---|
445 | |
---|
446 | |
---|
447 | % --- Executes on selection change in popupmenu1. |
---|
448 | function popupmenu1_Callback(hObject, eventdata, handles) |
---|
449 | % hObject handle to popupmenu1 (see GCBO) |
---|
450 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
451 | % handles structure with handles and user data (see GUIDATA) |
---|
452 | |
---|
453 | % Hints: contents = get(hObject,'String') returns popupmenu1 contents as cell array |
---|
454 | % contents{get(hObject,'Value')} returns selected item from popupmenu1 |
---|
455 | |
---|
456 | contents = get(hObject,'String'); |
---|
457 | val = get(hObject,'Value'); |
---|
458 | % Set current data to the selected data set. |
---|
459 | setappdata(hObject,'str',contents{val}); |
---|
460 | |
---|
461 | % --- Executes during object creation, after setting all properties. |
---|
462 | function popupmenu1_CreateFcn(hObject, eventdata, handles) |
---|
463 | % hObject handle to popupmenu1 (see GCBO) |
---|
464 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
465 | % handles empty - handles not created until after all CreateFcns called |
---|
466 | |
---|
467 | % Hint: popupmenu controls usually have a white background on Windows. |
---|
468 | % See ISPC and COMPUTER. |
---|
469 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
470 | set(hObject,'BackgroundColor','white'); |
---|
471 | end |
---|
472 | |
---|
473 | |
---|
474 | |
---|
475 | function deleteLn_Callback(hObject, eventdata, handles) |
---|
476 | % hObject handle to deleteLn (see GCBO) |
---|
477 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
478 | % handles structure with handles and user data (see GUIDATA) |
---|
479 | |
---|
480 | % Hints: get(hObject,'String') returns contents of deleteLn as text |
---|
481 | % str2double(get(hObject,'String')) returns contents of deleteLn as a double |
---|
482 | |
---|
483 | contents = get(hObject,'String'); |
---|
484 | val = get(hObject,'Value'); |
---|
485 | % Set current data to the selected data set. |
---|
486 | setappdata(hObject,'str',contents{val}); |
---|
487 | |
---|
488 | |
---|
489 | % --- Executes during object creation, after setting all properties. |
---|
490 | function deleteLn_CreateFcn(hObject, eventdata, handles) |
---|
491 | % hObject handle to deleteLn (see GCBO) |
---|
492 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
493 | % handles empty - handles not created until after all CreateFcns called |
---|
494 | |
---|
495 | % Hint: edit controls usually have a white background on Windows. |
---|
496 | % See ISPC and COMPUTER. |
---|
497 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
498 | set(hObject,'BackgroundColor','white'); |
---|
499 | end |
---|