source: MML/trunk/machine/SOLEIL/StorageRing/diagnostics/Lifetime_with_Liberas.m @ 4

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

Initial import--MML version from SOLEIL@2013

File size: 22.2 KB
Line 
1function varargout = Lifetime_with_Liberas(varargin)
2% LIFETIME_WITH_LIBERAS M-file for Lifetime_with_Liberas.fig
3%      LIFETIME_WITH_LIBERAS, by itself, creates a new LIFETIME_WITH_LIBERAS or raises the existing
4%      singleton*.
5%
6%      H = LIFETIME_WITH_LIBERAS returns the handle to a new LIFETIME_WITH_LIBERAS or the handle to
7%      the existing singleton*.
8%
9%      LIFETIME_WITH_LIBERAS('CALLBACK',hObject,eventData,handles,...) calls the local
10%      function named CALLBACK in LIFETIME_WITH_LIBERAS.M with the given input arguments.
11%
12%      LIFETIME_WITH_LIBERAS('Property','Value',...) creates a new LIFETIME_WITH_LIBERAS or raises the
13%      existing singleton*.  Starting from the left, property value pairs are
14%      applied to the GUI before Lifetime_with_Liberas_OpeningFunction gets called.  An
15%      unrecognized property name or invalid value makes property application
16%      stop.  All inputs are passed to Lifetime_with_Liberas_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 Lifetime_with_Liberas
24
25% Last Modified by GUIDE v2.5 11-Jul-2011 11:59:21
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', @Lifetime_with_Liberas_OpeningFcn, ...
32                   'gui_OutputFcn',  @Lifetime_with_Liberas_OutputFcn, ...
33                   'gui_LayoutFcn',  [] , ...
34                   'gui_Callback',   []);
35if nargin && ischar(varargin{1})
36    gui_State.gui_Callback = str2func(varargin{1});
37end
38
39if nargout
40    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
41else
42    gui_mainfcn(gui_State, varargin{:});
43end
44% End initialization code - DO NOT EDIT
45
46
47% --- Executes just before Lifetime_with_Liberas is made visible.
48function Lifetime_with_Liberas_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 Lifetime_with_Liberas (see VARARGIN)
54
55% Choose default command line output for Lifetime_with_Liberas
56handles.output = hObject;
57
58% Update handles structure
59guidata(hObject, handles);
60
61% UIWAIT makes Lifetime_with_Liberas wait for user response (see UIRESUME)
62% uiwait(handles.figure1);
63Red=0.877;
64Green=0.889;
65Blue=1.000;
66BackgroundColor=[Red Green Blue];
67setappdata(handles.figure1,'BackGroundColor',BackgroundColor);
68
69set(handles.figure1,'Color',BackgroundColor);
70set(handles.text_buff_length,'BackgroundColor',BackgroundColor);
71set(handles.text_seuil_1,'BackgroundColor',BackgroundColor);
72set(handles.text_seuil_2,'BackgroundColor',BackgroundColor);
73set(handles.text_NLib2valid,'BackgroundColor',BackgroundColor);
74set(handles.text_historic_size,'BackgroundColor',BackgroundColor);
75set(handles.text_LT_Libera,'BackgroundColor',BackgroundColor);
76set(handles.text_LT_DCCT,'BackgroundColor',BackgroundColor);
77set(handles.text_title,'BackgroundColor',BackgroundColor);
78set(handles.N_Liberas,'BackgroundColor',BackgroundColor);
79set(handles.Process_Time,'BackgroundColor',BackgroundColor);
80set(handles.start_stop,'BackgroundColor','Green');
81
82text_color=[0.824 0.824 0.895]
83set(handles.Lib_list,'BackgroundColor',text_color);
84
85
86N_samples=1000;
87setappdata(handles.figure1,'N_samples',N_samples);
88set(handles.N_samples,'string',num2str(N_samples));
89
90historic_size=10000;
91setappdata(handles.figure1,'historic_size',historic_size);
92set(handles.historic_size,'string',num2str(historic_size));
93
94seuil_1=0.2;
95setappdata(handles.figure1,'seuil_1',seuil_1);
96set(handles.seuil_1,'string',num2str(seuil_1));
97
98seuil_2=0.06;
99setappdata(handles.figure1,'seuil_2',seuil_2);
100set(handles.seuil_2,'string',num2str(seuil_2));
101
102NLib2valid=60;
103setappdata(handles.figure1,'NLib2valid',NLib2valid);
104set(handles.NLib2valid,'string',num2str(NLib2valid));
105
106NBPM=size(family2tangodev('BPMx'),1)
107previous_LT_Lib(1:NBPM)=0;
108setappdata(handles.figure1,'previous_LT_Lib',previous_LT_Lib);
109
110N_lib_valid(1:historic_size)=NaN;
111setappdata(handles.figure1,'N_lib_valid',N_lib_valid);
112
113N_lib_valid_first_sort(1:historic_size)=NaN;
114setappdata(handles.figure1,'N_lib_valid_first_sort',N_lib_valid_first_sort);
115
116N_lib_valid_second_sort(1:historic_size)=NaN;
117setappdata(handles.figure1,'N_lib_valid_second_sort',N_lib_valid_second_sort);
118
119LT_lib_mean(1:historic_size)=NaN;
120setappdata(handles.figure1,'LT_lib_mean',LT_lib_mean);
121
122LT_lib_by_quarter(1:4,1:historic_size)=NaN;
123setappdata(handles.figure1,'LT_lib_by_quarter',LT_lib_by_quarter);
124
125LT_DCCT(1:historic_size)=NaN;
126setappdata(handles.figure1,'LT_DCCT',LT_DCCT);
127
128Time_history(1:historic_size)=NaN;
129setappdata(handles.figure1,'Time_history',Time_history);
130
131DCCT_history(1:historic_size)=NaN;
132setappdata(handles.figure1,'DCCT_history',DCCT_history);
133
134
135
136bpm_group=tango_group_create('bpms')
137dev_list=family2tangodev('BPMx')
138for i=1:1:size(dev_list,1)
139    tango_group_add(bpm_group,dev_list{i})
140    BPM_index(i)=i;
141end
142tango_group_dump(bpm_group)
143tango_group_ping(bpm_group)
144N_BPM=tango_group_size(bpm_group);
145setappdata(handles.figure1,'dev_list',dev_list);
146setappdata(handles.figure1,'N_BPM',N_BPM);
147setappdata(handles.figure1,'BPM_index',BPM_index);
148setappdata(handles.figure1,'bpm_group',bpm_group);
149
150timer_id=timer('Period', 2.0,'ExecutionMode','fixedSpacing');
151timer_id.TimerFcn = {@LT_Process,handles,hObject,eventdata};
152%timer_id.StopFcn = {@stop_fofb,handles,hObject,eventdata};
153setappdata(handles.figure1,'timer_id',timer_id);
154
155
156% --- Outputs from this function are returned to the command line.
157function varargout = Lifetime_with_Liberas_OutputFcn(hObject, eventdata, handles)
158% varargout  cell array for returning output args (see VARARGOUT);
159% hObject    handle to figure
160% eventdata  reserved - to be defined in a future version of MATLAB
161% handles    structure with handles and user data (see GUIDATA)
162
163% Get default command line output from handles structure
164varargout{1} = handles.output;
165
166function LT_Process(obj, event, handles,hObject,eventdata)
167
168previous_LT_Lib=getappdata(handles.figure1,'previous_LT_Lib');
169N_lib_valid=getappdata(handles.figure1,'N_lib_valid');
170N_lib_valid_first_sort=getappdata(handles.figure1,'N_lib_valid_first_sort');
171N_lib_valid_second_sort=getappdata(handles.figure1,'N_lib_valid_second_sort');
172LT_lib_mean=getappdata(handles.figure1,'LT_lib_mean');
173LT_lib_by_quarter=getappdata(handles.figure1,'LT_lib_by_quarter');
174LT_DCCT=getappdata(handles.figure1,'LT_DCCT');
175N_BPM=getappdata(handles.figure1,'N_BPM');
176BPM_index=getappdata(handles.figure1,'BPM_index');
177bpm_group=getappdata(handles.figure1,'bpm_group');
178N_samples=str2num(get(handles.N_samples,'string'));
179historic_size=str2num(get(handles.historic_size,'string'));
180seuil_1=str2num(get(handles.seuil_1,'string'));
181seuil_2=str2num(get(handles.seuil_2,'string'));
182NLib2valid=str2num(get(handles.NLib2valid,'string'));
183setappdata(handles.figure1,'NLib2valid',NLib2valid);
184BackgroundColor=getappdata(handles.figure1,'BackGroundColor');
185
186Time_history=getappdata(handles.figure1,'Time_history');
187DCCT_history=getappdata(handles.figure1,'DCCT_history');
188old_historic_size=getappdata(handles.figure1,'historic_size');
189if old_historic_size<historic_size
190    fill(1:historic_size-old_historic_size)=NaN;
191    fill4(4,1:historic_size-old_historic_size)=NaN;
192    N_lib_valid=[fill N_lib_valid];
193    N_lib_valid_first_sort=[fill N_lib_valid_first_sort];
194    N_lib_valid_second_sort=[fill N_lib_valid_second_sort];
195    LT_lib_mean=[fill LT_lib_mean];
196    LT_lib_by_quarter=[fill4 LT_lib_by_quarter];
197    LT_DCCT=[fill LT_DCCT];
198    Time_history=[fill Time_history];
199    DCCT_history=[fill DCCT_history];
200elseif old_historic_size>historic_size
201    N_lib_valid=N_lib_valid(old_historic_size-historic_size+1:old_historic_size);
202    N_lib_valid_first_sort=N_lib_valid_first_sort(old_historic_size-historic_size+1:old_historic_size);
203    N_lib_valid_second_sort=N_lib_valid_second_sort(old_historic_size-historic_size+1:old_historic_size);
204    LT_lib_mean=LT_lib_mean(old_historic_size-historic_size+1:old_historic_size);
205    LT_lib_by_quarter=LT_lib_by_quarter(:,old_historic_size-historic_size+1:old_historic_size);
206
207   LT_DCCT=LT_DCCT(old_historic_size-historic_size+1:old_historic_size);
208    Time_history=Time_history(old_historic_size-historic_size+1:old_historic_size);
209    DCCT_history=DCCT_history(old_historic_size-historic_size+1:old_historic_size);
210end
211tic 
212h=now;
213[previous_LT_Lib,LT_lib_mean,LT_lib_by_quarter,N_lib_valid,N_lib_valid_first_sort,N_lib_valid_second_sort,LT_DCCT,index_seuil_1,index_seuil_2,Time_history, DCCT_history]=...
214    get_LT(bpm_group,BPM_index,N_samples,previous_LT_Lib,LT_lib_mean,LT_lib_by_quarter,N_lib_valid,...
215            N_lib_valid_first_sort,N_lib_valid_second_sort,LT_DCCT,seuil_1,seuil_2,NLib2valid,Time_history,DCCT_history);
216t=toc;
217set(handles.Liberas_LT,'string',[num2str(LT_lib_mean(size(LT_lib_mean,2)),'%3.2f'),' Hrs']);
218set(handles.DCCT_LT,'string',[num2str(LT_DCCT(size(LT_DCCT,2)),'%3.2f'),' Hrs']);
219set(handles.N_Liberas,'string',['Number of valid Liberas = ',num2str(N_lib_valid_second_sort(size(N_lib_valid_second_sort,2)))]);
220if N_lib_valid_second_sort(size(N_lib_valid_second_sort,2))<NLib2valid
221    set(handles.N_Liberas,'BackgroundColor','Red');
222else
223    set(handles.N_Liberas,'BackgroundColor',BackgroundColor);
224end   
225
226set(handles.Process_Time,'string',['Process Time = ',num2str(t,'%2.1f'),' sec']);
227
228axes(handles.LT_Libera)
229plot(handles.LT_Libera,previous_LT_Lib,'bo','LineWidth',2)
230xlabel(handles.LT_Libera,'BPM Number')
231ylabel(handles.LT_Libera,'Hours')
232title(handles.LT_Libera,'Last LT measurment for each Libera')
233hold(handles.LT_Libera,'on')
234plot(handles.LT_Libera,index_seuil_2,previous_LT_Lib(index_seuil_2),'gx','LineWidth',3,'MarkerSize',20)
235plot(handles.LT_Libera,index_seuil_1,previous_LT_Lib(index_seuil_1),'rx','LineWidth',3,'MarkerSize',20)
236hold(handles.LT_Libera,'off')
237
238dev_list=getappdata(handles.figure1,'dev_list');
239
240text=datestr(now);
241text=strvcat(text,'First Sort:');
242[Y1,I1]=sort(previous_LT_Lib(index_seuil_1));
243for k=1:1:size(index_seuil_1,2)   
244    next_line=[dev_list{index_seuil_1(I1(k))},': ',num2str(Y1(k),'%3.2f'),' hours'];
245    text=strvcat(text,next_line);
246end
247text=strvcat(text,'Second Sort:');
248[Y2,I2]=sort(previous_LT_Lib(index_seuil_2));
249for k=1:1:size(index_seuil_2,2)
250    if isempty(find(I1==I2(k)))
251    next_line=[dev_list{index_seuil_2(I2(k))},': ',num2str(Y2(k),'%3.2f'),' hours'];
252    text=strvcat(text,next_line);
253    end
254end
255set(handles.Lib_list,'string',text);
256
257formatstr= 'HH:MM';
258
259axes(handles.N_Libera_remaining)
260if get(handles.is_stats,'value')
261    plot(handles.N_Libera_remaining,Time_history,N_lib_valid,'b')
262    hold(handles.N_Libera_remaining,'on')
263    plot(handles.N_Libera_remaining,Time_history,N_lib_valid_first_sort,'r')
264    plot(handles.N_Libera_remaining,Time_history,N_lib_valid_second_sort,'g')
265    hold(handles.N_Libera_remaining,'off')
266    legend(handles.N_Libera_remaining,'valid buffer length','first sort','second sort','Location','NorthWest')
267    title(handles.N_Libera_remaining,'History of valid Libera measurments number')
268else
269    plot(handles.N_Libera_remaining,Time_history,DCCT_history,'b')
270end
271datetick(handles.N_Libera_remaining,'x',formatstr);
272
273
274axes(handles.LT_History)
275plot(handles.LT_History,Time_history,LT_lib_mean,'b','LineWidth',3)
276hold(handles.LT_History,'on')
277plot(handles.LT_History,Time_history,LT_DCCT,'r','LineWidth',3)
278if get(handles.disp_quarter,'value')
279    plot(handles.LT_History,Time_history,LT_lib_by_quarter(1,:),'k');
280    plot(handles.LT_History,Time_history,LT_lib_by_quarter(2,:),'g');
281    plot(handles.LT_History,Time_history,LT_lib_by_quarter(3,:),'m');
282    plot(handles.LT_History,Time_history,LT_lib_by_quarter(4,:),'c');
283    legend(handles.LT_History,'Libera all','DCCT','Libera Q1','Libera Q2','Libera Q3','Libera Q4','Location','NorthWest')
284else
285    legend(handles.LT_History,'Libera all','DCCT','Location','NorthWest')
286end
287hold(handles.LT_History,'off')
288ylabel(handles.LT_History,'Hours')
289title(handles.LT_History,'Lifetime History')
290datetick(handles.LT_History,'x',formatstr);
291
292setappdata(handles.figure1,'previous_LT_Lib',previous_LT_Lib);
293setappdata(handles.figure1,'N_lib_valid',N_lib_valid);
294setappdata(handles.figure1,'N_lib_valid_first_sort',N_lib_valid_first_sort);
295setappdata(handles.figure1,'N_lib_valid_second_sort',N_lib_valid_second_sort);
296setappdata(handles.figure1,'LT_lib_mean',LT_lib_mean);
297setappdata(handles.figure1,'LT_lib_by_quarter',LT_lib_by_quarter);
298setappdata(handles.figure1,'LT_DCCT',LT_DCCT);
299setappdata(handles.figure1,'N_BPM',N_BPM);
300setappdata(handles.figure1,'BPM_index',BPM_index);
301setappdata(handles.figure1,'bpm_group',bpm_group);
302
303setappdata(handles.figure1,'N_samples',N_samples);
304setappdata(handles.figure1,'historic_size',historic_size);
305setappdata(handles.figure1,'seuil_1',seuil_1);
306setappdata(handles.figure1,'seuil_2',seuil_2);
307setappdata(handles.figure1,'NLib2valid',NLib2valid);
308
309setappdata(handles.figure1,'Time_history',Time_history);
310setappdata(handles.figure1,'DCCT_history',DCCT_history);
311
312
313function N_samples_Callback(hObject, eventdata, handles)
314% hObject    handle to N_samples (see GCBO)
315% eventdata  reserved - to be defined in a future version of MATLAB
316% handles    structure with handles and user data (see GUIDATA)
317
318% Hints: get(hObject,'String') returns contents of N_samples as text
319%        str2double(get(hObject,'String')) returns contents of N_samples as a double
320
321
322% --- Executes during object creation, after setting all properties.
323function N_samples_CreateFcn(hObject, eventdata, handles)
324% hObject    handle to N_samples (see GCBO)
325% eventdata  reserved - to be defined in a future version of MATLAB
326% handles    empty - handles not created until after all CreateFcns called
327
328% Hint: edit controls usually have a white background on Windows.
329%       See ISPC and COMPUTER.
330if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
331    set(hObject,'BackgroundColor','white');
332end
333
334
335
336function DCCT_LT_Callback(hObject, eventdata, handles)
337% hObject    handle to DCCT_LT (see GCBO)
338% eventdata  reserved - to be defined in a future version of MATLAB
339% handles    structure with handles and user data (see GUIDATA)
340
341% Hints: get(hObject,'String') returns contents of DCCT_LT as text
342%        str2double(get(hObject,'String')) returns contents of DCCT_LT as a double
343
344
345% --- Executes during object creation, after setting all properties.
346function DCCT_LT_CreateFcn(hObject, eventdata, handles)
347% hObject    handle to DCCT_LT (see GCBO)
348% eventdata  reserved - to be defined in a future version of MATLAB
349% handles    empty - handles not created until after all CreateFcns called
350
351% Hint: edit controls usually have a white background on Windows.
352%       See ISPC and COMPUTER.
353if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
354    set(hObject,'BackgroundColor','white');
355end
356
357
358
359function Liberas_LT_Callback(hObject, eventdata, handles)
360% hObject    handle to Liberas_LT (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% Hints: get(hObject,'String') returns contents of Liberas_LT as text
365%        str2double(get(hObject,'String')) returns contents of Liberas_LT as a double
366
367
368% --- Executes during object creation, after setting all properties.
369function Liberas_LT_CreateFcn(hObject, eventdata, handles)
370% hObject    handle to Liberas_LT (see GCBO)
371% eventdata  reserved - to be defined in a future version of MATLAB
372% handles    empty - handles not created until after all CreateFcns called
373
374% Hint: edit controls usually have a white background on Windows.
375%       See ISPC and COMPUTER.
376if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
377    set(hObject,'BackgroundColor','white');
378end
379
380
381% --- Executes on button press in start_stop.
382function start_stop_Callback(hObject, eventdata, handles)
383% hObject    handle to start_stop (see GCBO)
384% eventdata  reserved - to be defined in a future version of MATLAB
385% handles    structure with handles and user data (see GUIDATA)
386state=get(handles.start_stop,'string');
387switch state
388    case 'Stop'
389       set(handles.start_stop,'string','Start');
390       set(handles.start_stop,'BackgroundColor','Green');
391       %stop timer
392       timer_id=getappdata(handles.figure1,'timer_id');
393       stop(timer_id);
394    case 'Start'
395       set(handles.start_stop,'string','Stop');   
396       set(handles.start_stop,'BackgroundColor','Red');
397      %start timer
398       timer_id=getappdata(handles.figure1,'timer_id');
399       start(timer_id);
400
401end
402
403
404% --- Executes on selection change in Lib_list.
405function Lib_list_Callback(hObject, eventdata, handles)
406% hObject    handle to Lib_list (see GCBO)
407% eventdata  reserved - to be defined in a future version of MATLAB
408% handles    structure with handles and user data (see GUIDATA)
409
410% Hints: contents = get(hObject,'String') returns Lib_list contents as cell array
411%        contents{get(hObject,'Value')} returns selected item from Lib_list
412
413
414% --- Executes during object creation, after setting all properties.
415function Lib_list_CreateFcn(hObject, eventdata, handles)
416% hObject    handle to Lib_list (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: listbox controls usually have a white background on Windows.
421%       See ISPC and COMPUTER.
422if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
423    set(hObject,'BackgroundColor','white');
424end
425
426
427
428function historic_size_Callback(hObject, eventdata, handles)
429% hObject    handle to historic_size (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% Hints: get(hObject,'String') returns contents of historic_size as text
434%        str2double(get(hObject,'String')) returns contents of historic_size as a double
435
436
437% --- Executes during object creation, after setting all properties.
438function historic_size_CreateFcn(hObject, eventdata, handles)
439% hObject    handle to historic_size (see GCBO)
440% eventdata  reserved - to be defined in a future version of MATLAB
441% handles    empty - handles not created until after all CreateFcns called
442
443% Hint: edit controls usually have a white background on Windows.
444%       See ISPC and COMPUTER.
445if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
446    set(hObject,'BackgroundColor','white');
447end
448
449
450
451function seuil_1_Callback(hObject, eventdata, handles)
452% hObject    handle to seuil_1 (see GCBO)
453% eventdata  reserved - to be defined in a future version of MATLAB
454% handles    structure with handles and user data (see GUIDATA)
455
456% Hints: get(hObject,'String') returns contents of seuil_1 as text
457%        str2double(get(hObject,'String')) returns contents of seuil_1 as a double
458
459
460% --- Executes during object creation, after setting all properties.
461function seuil_1_CreateFcn(hObject, eventdata, handles)
462% hObject    handle to seuil_1 (see GCBO)
463% eventdata  reserved - to be defined in a future version of MATLAB
464% handles    empty - handles not created until after all CreateFcns called
465
466% Hint: edit controls usually have a white background on Windows.
467%       See ISPC and COMPUTER.
468if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
469    set(hObject,'BackgroundColor','white');
470end
471
472
473
474function seuil_2_Callback(hObject, eventdata, handles)
475% hObject    handle to seuil_2 (see GCBO)
476% eventdata  reserved - to be defined in a future version of MATLAB
477% handles    structure with handles and user data (see GUIDATA)
478
479% Hints: get(hObject,'String') returns contents of seuil_2 as text
480%        str2double(get(hObject,'String')) returns contents of seuil_2 as a double
481
482
483% --- Executes during object creation, after setting all properties.
484function seuil_2_CreateFcn(hObject, eventdata, handles)
485% hObject    handle to seuil_2 (see GCBO)
486% eventdata  reserved - to be defined in a future version of MATLAB
487% handles    empty - handles not created until after all CreateFcns called
488
489% Hint: edit controls usually have a white background on Windows.
490%       See ISPC and COMPUTER.
491if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
492    set(hObject,'BackgroundColor','white');
493end
494
495
496
497function NLib2valid_Callback(hObject, eventdata, handles)
498% hObject    handle to NLib2valid (see GCBO)
499% eventdata  reserved - to be defined in a future version of MATLAB
500% handles    structure with handles and user data (see GUIDATA)
501
502% Hints: get(hObject,'String') returns contents of NLib2valid as text
503%        str2double(get(hObject,'String')) returns contents of NLib2valid as a double
504
505
506% --- Executes during object creation, after setting all properties.
507function NLib2valid_CreateFcn(hObject, eventdata, handles)
508% hObject    handle to NLib2valid (see GCBO)
509% eventdata  reserved - to be defined in a future version of MATLAB
510% handles    empty - handles not created until after all CreateFcns called
511
512% Hint: edit controls usually have a white background on Windows.
513%       See ISPC and COMPUTER.
514if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
515    set(hObject,'BackgroundColor','white');
516end
517
518
519% --- Executes on button press in disp_quarter.
520function disp_quarter_Callback(hObject, eventdata, handles)
521% hObject    handle to disp_quarter (see GCBO)
522% eventdata  reserved - to be defined in a future version of MATLAB
523% handles    structure with handles and user data (see GUIDATA)
524
525% Hint: get(hObject,'Value') returns toggle state of disp_quarter
526
527
528% --- Executes on button press in save.
529function save_Callback(hObject, eventdata, handles)
530% hObject    handle to save (see GCBO)
531% eventdata  reserved - to be defined in a future version of MATLAB
532% handles    structure with handles and user data (see GUIDATA)
533struct.LT_lib_mean=getappdata(handles.figure1,'LT_lib_mean');
534struct.LT_lib_by_quarter=getappdata(handles.figure1,'LT_lib_by_quarter');
535struct.LT_DCCT=getappdata(handles.figure1,'LT_DCCT');
536struct.Time_history=getappdata(handles.figure1,'Time_history');
537struct.DCCT_history=getappdata(handles.figure1,'DCCT_history');
538uisave('struct','/home/operateur/GrpDiagnostics/matlab/data/');
Note: See TracBrowser for help on using the repository browser.