source: MML/trunk/machine/SOLEIL/StorageRing/loco/bpmrespmatgui.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: 9.2 KB
Line 
1function varargout = bpmrespmatgui(varargin)
2% BPMRESPMATGUI M-file for bpmrespmatgui.fig
3%      BPMRESPMATGUI, by itself, creates a new BPMRESPMATGUI or raises the existing
4%      singleton*.
5%
6%      H = BPMRESPMATGUI returns the handle to a new BPMRESPMATGUI or the handle to
7%      the existing singleton*.
8%
9%      BPMRESPMATGUI('CALLBACK',hObject,eventData,handles,...) calls the local
10%      function named CALLBACK in BPMRESPMATGUI.M with the given input arguments.
11%
12%      BPMRESPMATGUI('Property','Value',...) creates a new BPMRESPMATGUI or raises the
13%      existing singleton*.  Starting from the left, property value pairs are
14%      applied to the GUI before bpmrespmatgui_OpeningFcn gets called.  An
15%      unrecognized property name or invalid value makes property application
16%      stop.  All inputs are passed to bpmrespmatgui_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 bpmrespmatgui
24
25% Last Modified by GUIDE v2.5 21-Mar-2011 17:01:17
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', @bpmrespmatgui_OpeningFcn, ...
32                   'gui_OutputFcn',  @bpmrespmatgui_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 bpmrespmatgui is made visible.
48function bpmrespmatgui_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 bpmrespmatgui (see VARARGIN)
54
55% Choose default command line output for bpmrespmatgui
56handles.output = hObject;
57
58% Directory name for saving data
59handles.DirName = '';
60
61% Update handles structure
62guidata(hObject, handles);
63
64% UIWAIT makes bpmrespmatgui wait for user response (see UIRESUME)
65% uiwait(handles.figure1);
66
67
68% --- Outputs from this function are returned to the command line.
69function varargout = bpmrespmatgui_OutputFcn(hObject, eventdata, handles)
70% varargout  cell array for returning output args (see VARARGOUT);
71% hObject    handle to figure
72% eventdata  reserved - to be defined in a future version of MATLAB
73% handles    structure with handles and user data (see GUIDATA)
74
75% Get default command line output from handles structure
76varargout{1} = handles.output;
77
78
79% --- Executes on button press in pushbutton_bruit.
80function pushbutton_bruit_Callback(hObject, eventdata, handles)
81% hObject    handle to pushbutton_bruit (see GCBO)
82% eventdata  reserved - to be defined in a future version of MATLAB
83% handles    structure with handles and user data (see GUIDATA)
84
85switch getmode('BPMx')
86    case 'Online'
87        [Rx Ry DCCT tout BPMxStd BPMyStd FileName] = monbpm('Archive',180);
88    otherwise
89        [Rx Ry DCCT tout BPMxStd BPMyStd FileName] = monbpm('Archive',10);
90end
91           
92system(['mv ' FileName ' ' handles.DirName filesep]);
93
94
95% --- Executes on button press in pushbutton_dispersion.
96function pushbutton_dispersion_Callback(hObject, eventdata, handles)
97% hObject    handle to pushbutton_dispersion (see GCBO)
98% eventdata  reserved - to be defined in a future version of MATLAB
99% handles    structure with handles and user data (see GUIDATA)
100
101figure
102[Dx, Dy, FileName] = measdisp('Archive', 'Display');
103system(['mv ' FileName ' ' handles.DirName filesep]);
104
105
106% --- Executes on button press in pushbutton_matSOFB.
107function pushbutton_matSOFB_Callback(hObject, eventdata, handles)
108% hObject    handle to pushbutton_matSOFB (see GCBO)
109% eventdata  reserved - to be defined in a future version of MATLAB
110% handles    structure with handles and user data (see GUIDATA)
111
112switch getmode('BPMx')
113    case 'Online'
114        [Rmat, OutputFileName] = measbpmresp('Archive');
115        if ~isempty(Rmat)
116            tango_giveInformationMessage('Fin de mesure Matrice réponse');
117        end
118    otherwise
119        [Rmat, OutputFileName] = measbpmresp('Archive', 'Model');
120end
121if ~isempty(Rmat)
122    system(['mv ' OutputFileName ' ' handles.DirName filesep]);
123end
124
125% --- Executes on button press in pushbutton_matFOFB.
126function pushbutton_matFOFB_Callback(hObject, eventdata, handles)
127% hObject    handle to pushbutton_matFOFB (see GCBO)
128% eventdata  reserved - to be defined in a future version of MATLAB
129% handles    structure with handles and user data (see GUIDATA)
130
131switch getmode('BPMx')
132    case 'Online'
133        [Rmat, OutputFileName] = measbpmresp4FOFB('Archive');
134        if ~isempty(Rmat)
135            tango_giveInformationMessage('Fin de mesure Matrice réponse');
136        end
137    otherwise
138        [Rmat, OutputFileName] = measbpmresp4FOFB('Archive', 'Model');
139end
140
141if ~isempty(Rmat)
142    system(['mv ' OutputFileName ' ' handles.DirName filesep]);
143end
144       
145% --- Executes on button press in pushbutton_directory.
146function pushbutton_directory_Callback(hObject, eventdata, handles)
147% hObject    handle to pushbutton_directory (see GCBO)
148% eventdata  reserved - to be defined in a future version of MATLAB
149% handles    structure with handles and user data (see GUIDATA)
150
151RootDirectory = fileparts(getfamilydata('Directory', 'LOCOData'));
152DirName = RootDirectory;
153while ~ischar(DirName) || (strcmpi(DirName, RootDirectory) || exist(DirName, 'dir') ~=7)
154    DirName = uigetdir(RootDirectory, 'Select or create a LOC0 directory');
155    if strcmpi(DirName, RootDirectory)
156        h = warndlg('Abort: Directory is not correct. Choose a subdirectory');
157        uiwait(h)
158    elseif ischar(DirName) && exist(DirName, 'dir') ~=7
159        warndlg('Abort: Directory not selected');
160    end
161end
162cd(DirName); % gotodirectory
163
164handles.DirName = DirName;
165% Update handles structure
166guidata(hObject, handles);
167
168ival = regexp(DirName,'/', 'end');
169
170set(handles.text_directory, 'String', DirName(ival(end)+1:end));
171
172
173
174% --- Executes on button press in pushbutton_buildloco.
175function pushbutton_buildloco_Callback(hObject, eventdata, handles)
176% hObject    handle to pushbutton_buildloco (see GCBO)
177% eventdata  reserved - to be defined in a future version of MATLAB
178% handles    structure with handles and user data (see GUIDATA)
179buildlocoinput
180
181% --- Executes on button press in pushbutton_locogui.
182function pushbutton_locogui_Callback(hObject, eventdata, handles)
183% hObject    handle to pushbutton_locogui (see GCBO)
184% eventdata  reserved - to be defined in a future version of MATLAB
185% handles    structure with handles and user data (see GUIDATA)
186
187locogui
188
189
190% --- Executes on button press in pushbutton_applysym.
191function pushbutton_applysym_Callback(hObject, eventdata, handles)
192% hObject    handle to pushbutton_applysym (see GCBO)
193% eventdata  reserved - to be defined in a future version of MATLAB
194% handles    structure with handles and user data (see GUIDATA)
195LOCOsymgui
196
197
198% --- Executes on button press in pushbutton_directory2.
199function pushbutton_directory2_Callback(hObject, eventdata, handles)
200% hObject    handle to pushbutton_directory2 (see GCBO)
201% eventdata  reserved - to be defined in a future version of MATLAB
202% handles    structure with handles and user data (see GUIDATA)
203pushbutton_directory_Callback(hObject, eventdata, handles)
204
205% --- Executes on button press in pushbutton_measdisp2.
206function pushbutton_measdisp2_Callback(hObject, eventdata, handles)
207% hObject    handle to pushbutton_measdisp2 (see GCBO)
208% eventdata  reserved - to be defined in a future version of MATLAB
209% handles    structure with handles and user data (see GUIDATA)
210pushbutton_dispersion_Callback
211
212% --- Executes on button press in pushbutton_bpmmon2.
213function pushbutton_bpmmon2_Callback(hObject, eventdata, handles)
214% hObject    handle to pushbutton_bpmmon2 (see GCBO)
215% eventdata  reserved - to be defined in a future version of MATLAB
216% handles    structure with handles and user data (see GUIDATA)
217pushbutton_bruit_Callback
218
219
220% --- Executes on button press in pushbutton_applyFOFB.
221function pushbutton_applyFOFB_Callback(hObject, eventdata, handles)
222% hObject    handle to pushbutton_applyFOFB (see GCBO)
223% eventdata  reserved - to be defined in a future version of MATLAB
224% handles    structure with handles and user data (see GUIDATA)
225
226
227% --- Executes on button press in pushbutton_locogui2.
228function pushbutton_locogui2_Callback(hObject, eventdata, handles)
229% hObject    handle to pushbutton_locogui2 (see GCBO)
230% eventdata  reserved - to be defined in a future version of MATLAB
231% handles    structure with handles and user data (see GUIDATA)
232locogui
233
234% --- Executes on button press in pushbutton_buildlocoFOFB.
235function pushbutton_buildlocoFOFB_Callback(hObject, eventdata, handles)
236% hObject    handle to pushbutton_buildlocoFOFB (see GCBO)
237% eventdata  reserved - to be defined in a future version of MATLAB
238% handles    structure with handles and user data (see GUIDATA)
239buildlocoinput_fofb
Note: See TracBrowser for help on using the repository browser.