1 | function varargout = FOFB_defauts(varargin) |
---|
2 | % FOFB_DEFAUTS M-file for FOFB_defauts.fig |
---|
3 | % FOFB_DEFAUTS, by itself, creates a new FOFB_DEFAUTS or raises the existing |
---|
4 | % singleton*. |
---|
5 | % |
---|
6 | % H = FOFB_DEFAUTS returns the handle to a new FOFB_DEFAUTS or the handle to |
---|
7 | % the existing singleton*. |
---|
8 | % |
---|
9 | % FOFB_DEFAUTS('CALLBACK',hObject,eventData,handles,...) calls the local |
---|
10 | % function named CALLBACK in FOFB_DEFAUTS.M with the given input arguments. |
---|
11 | % |
---|
12 | % FOFB_DEFAUTS('Property','Value',...) creates a new FOFB_DEFAUTS or raises the |
---|
13 | % existing singleton*. Starting from the left, property value pairs are |
---|
14 | % applied to the GUI before FOFB_defauts_OpeningFunction gets called. An |
---|
15 | % unrecognized property name or invalid value makes property application |
---|
16 | % stop. All inputs are passed to FOFB_defauts_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 FOFB_defauts |
---|
24 | |
---|
25 | % Last Modified by GUIDE v2.5 03-Feb-2009 11:21:17 |
---|
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', @FOFB_defauts_OpeningFcn, ... |
---|
32 | 'gui_OutputFcn', @FOFB_defauts_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 FOFB_defauts is made visible. |
---|
48 | function FOFB_defauts_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 FOFB_defauts (see VARARGIN) |
---|
54 | |
---|
55 | % Choose default command line output for FOFB_defauts |
---|
56 | handles.output = hObject; |
---|
57 | |
---|
58 | % Update handles structure |
---|
59 | guidata(hObject, handles); |
---|
60 | |
---|
61 | % UIWAIT makes FOFB_defauts wait for user response (see UIRESUME) |
---|
62 | % uiwait(handles.figure1); |
---|
63 | attr_list={'processTimeOutOfRange','xOrbitOutOfRange','zOrbitOutOfRange','xCorrectionOutOfRange','zCorrectionOutOfRange','bpmsCountOutOfRange','storageRingCurrentOutOfRange','fofbRecordTimeout','bpmsTangoComError','sniffersTangoComError','steerersTangoComError','dcctTangoComError','serviceLockerComError','logs','fofbErrorStatus'}; |
---|
64 | setappdata(handles.figure1,'attr_list',attr_list) |
---|
65 | dev='ANS/DG/FOFB-MANAGER'; |
---|
66 | |
---|
67 | result=tango_read_attributes2(dev,attr_list); |
---|
68 | |
---|
69 | set(handles.processTimeOutOfRange,'value',result(1).value); |
---|
70 | set(handles.xOrbitOutOfRange,'value',result(2).value); |
---|
71 | set(handles.zOrbitOutOfRange,'value',result(3).value); |
---|
72 | set(handles.xCorrectionOutOfRange,'value',result(4).value); |
---|
73 | set(handles.zCorrectionOutOfRange,'value',result(5).value); |
---|
74 | set(handles.bpmsCountOutOfRange,'value',result(6).value); |
---|
75 | set(handles.storageRingCurrentOutOfRange,'value',result(7).value); |
---|
76 | set(handles.fofbRecordTimeout,'value',result(8).value); |
---|
77 | set(handles.bpmsTangoComError,'value',result(9).value); |
---|
78 | set(handles.sniffersTangoComError,'value',result(10).value); |
---|
79 | set(handles.steerersTangoComError,'value',result(11).value); |
---|
80 | set(handles.dcctTangoComError,'value',result(12).value); |
---|
81 | set(handles.serviceLockerComError,'value',result(13).value); |
---|
82 | |
---|
83 | % new_text=''; |
---|
84 | % for i=1:1:size(result(14).value,2) |
---|
85 | % new_text=strvcat(new_text,result(14).value{i}); |
---|
86 | % end |
---|
87 | new_text=result(14).value; |
---|
88 | |
---|
89 | set(handles.logs,'string',new_text); |
---|
90 | set(handles.logs,'value',size(new_text,1)); |
---|
91 | |
---|
92 | set(handles.fofbErrorStatus,'string',result(15).value); |
---|
93 | |
---|
94 | switch result(15).value |
---|
95 | case 'no error' |
---|
96 | set(handles.fofbErrorStatus,'BackgroundColor',[1 1 1]*0.702) |
---|
97 | otherwise |
---|
98 | set(handles.fofbErrorStatus,'BackgroundColor','red') |
---|
99 | end |
---|
100 | |
---|
101 | % Count errors |
---|
102 | sum = 0; |
---|
103 | for k=1:13, |
---|
104 | sum = result(k).value; |
---|
105 | end |
---|
106 | |
---|
107 | % Change color of List defaut |
---|
108 | if sum > 0 |
---|
109 | set(handles.text_list_defaults, 'BackgroundColor', [1 0 0]); |
---|
110 | else |
---|
111 | set(handles.text_list_defaults, 'BackgroundColor', [0 1 0]); |
---|
112 | end |
---|
113 | |
---|
114 | |
---|
115 | % --- Outputs from this function are returned to the command line. |
---|
116 | function varargout = FOFB_defauts_OutputFcn(hObject, eventdata, handles) |
---|
117 | % varargout cell array for returning output args (see VARARGOUT); |
---|
118 | % hObject handle to figure |
---|
119 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
120 | % handles structure with handles and user data (see GUIDATA) |
---|
121 | |
---|
122 | % Get default command line output from handles structure |
---|
123 | varargout{1} = handles.output; |
---|
124 | |
---|
125 | |
---|
126 | % --- Executes on button press in processTimeOutOfRange. |
---|
127 | function processTimeOutOfRange_Callback(hObject, eventdata, handles) |
---|
128 | % hObject handle to processTimeOutOfRange (see GCBO) |
---|
129 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
130 | % handles structure with handles and user data (see GUIDATA) |
---|
131 | |
---|
132 | % Hint: get(hObject,'Value') returns toggle state of processTimeOutOfRange |
---|
133 | |
---|
134 | |
---|
135 | % --- Executes on button press in xOrbitOutOfRange. |
---|
136 | function xOrbitOutOfRange_Callback(hObject, eventdata, handles) |
---|
137 | % hObject handle to xOrbitOutOfRange (see GCBO) |
---|
138 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
139 | % handles structure with handles and user data (see GUIDATA) |
---|
140 | |
---|
141 | % Hint: get(hObject,'Value') returns toggle state of xOrbitOutOfRange |
---|
142 | |
---|
143 | |
---|
144 | % --- Executes on button press in zOrbitOutOfRange. |
---|
145 | function zOrbitOutOfRange_Callback(hObject, eventdata, handles) |
---|
146 | % hObject handle to zOrbitOutOfRange (see GCBO) |
---|
147 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
148 | % handles structure with handles and user data (see GUIDATA) |
---|
149 | |
---|
150 | % Hint: get(hObject,'Value') returns toggle state of zOrbitOutOfRange |
---|
151 | |
---|
152 | |
---|
153 | % --- Executes on button press in xCorrectionOutOfRange. |
---|
154 | function xCorrectionOutOfRange_Callback(hObject, eventdata, handles) |
---|
155 | % hObject handle to xCorrectionOutOfRange (see GCBO) |
---|
156 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
157 | % handles structure with handles and user data (see GUIDATA) |
---|
158 | |
---|
159 | % Hint: get(hObject,'Value') returns toggle state of xCorrectionOutOfRange |
---|
160 | |
---|
161 | |
---|
162 | % --- Executes on button press in zCorrectionOutOfRange. |
---|
163 | function zCorrectionOutOfRange_Callback(hObject, eventdata, handles) |
---|
164 | % hObject handle to zCorrectionOutOfRange (see GCBO) |
---|
165 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
166 | % handles structure with handles and user data (see GUIDATA) |
---|
167 | |
---|
168 | % Hint: get(hObject,'Value') returns toggle state of zCorrectionOutOfRange |
---|
169 | |
---|
170 | |
---|
171 | % --- Executes on button press in storageRingCurrentOutOfRange. |
---|
172 | function storageRingCurrentOutOfRange_Callback(hObject, eventdata, handles) |
---|
173 | % hObject handle to storageRingCurrentOutOfRange (see GCBO) |
---|
174 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
175 | % handles structure with handles and user data (see GUIDATA) |
---|
176 | |
---|
177 | % Hint: get(hObject,'Value') returns toggle state of storageRingCurrentOutOfRange |
---|
178 | |
---|
179 | |
---|
180 | % --- Executes on button press in fofbRecordTimeout. |
---|
181 | function fofbRecordTimeout_Callback(hObject, eventdata, handles) |
---|
182 | % hObject handle to fofbRecordTimeout (see GCBO) |
---|
183 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
184 | % handles structure with handles and user data (see GUIDATA) |
---|
185 | |
---|
186 | % Hint: get(hObject,'Value') returns toggle state of fofbRecordTimeout |
---|
187 | |
---|
188 | |
---|
189 | % --- Executes on button press in bpmsTangoComError. |
---|
190 | function bpmsTangoComError_Callback(hObject, eventdata, handles) |
---|
191 | % hObject handle to bpmsTangoComError (see GCBO) |
---|
192 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
193 | % handles structure with handles and user data (see GUIDATA) |
---|
194 | |
---|
195 | % Hint: get(hObject,'Value') returns toggle state of bpmsTangoComError |
---|
196 | |
---|
197 | |
---|
198 | % --- Executes on button press in sniffersTangoComError. |
---|
199 | function sniffersTangoComError_Callback(hObject, eventdata, handles) |
---|
200 | % hObject handle to sniffersTangoComError (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 | % Hint: get(hObject,'Value') returns toggle state of sniffersTangoComError |
---|
205 | |
---|
206 | |
---|
207 | % --- Executes on button press in steerersTangoComError. |
---|
208 | function steerersTangoComError_Callback(hObject, eventdata, handles) |
---|
209 | % hObject handle to steerersTangoComError (see GCBO) |
---|
210 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
211 | % handles structure with handles and user data (see GUIDATA) |
---|
212 | |
---|
213 | % Hint: get(hObject,'Value') returns toggle state of steerersTangoComError |
---|
214 | |
---|
215 | |
---|
216 | % --- Executes on button press in dcctTangoComError. |
---|
217 | function dcctTangoComError_Callback(hObject, eventdata, handles) |
---|
218 | % hObject handle to dcctTangoComError (see GCBO) |
---|
219 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
220 | % handles structure with handles and user data (see GUIDATA) |
---|
221 | |
---|
222 | % Hint: get(hObject,'Value') returns toggle state of dcctTangoComError |
---|
223 | |
---|
224 | |
---|
225 | % --- Executes on button press in serviceLockerComError. |
---|
226 | function serviceLockerComError_Callback(hObject, eventdata, handles) |
---|
227 | % hObject handle to serviceLockerComError (see GCBO) |
---|
228 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
229 | % handles structure with handles and user data (see GUIDATA) |
---|
230 | |
---|
231 | % Hint: get(hObject,'Value') returns toggle state of serviceLockerComError |
---|
232 | |
---|
233 | |
---|
234 | % --- Executes on button press in Aknowledge. |
---|
235 | function Aknowledge_Callback(hObject, eventdata, handles) |
---|
236 | % hObject handle to Aknowledge (see GCBO) |
---|
237 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
238 | % handles structure with handles and user data (see GUIDATA) |
---|
239 | attr_list=getappdata(handles.figure1,'attr_list'); |
---|
240 | dev='ANS/DG/FOFB-MANAGER'; |
---|
241 | tango_command_inout2(dev,'AcknowledgeError'); |
---|
242 | pause(1) |
---|
243 | result=tango_read_attributes2(dev,attr_list); |
---|
244 | |
---|
245 | set(handles.processTimeOutOfRange,'value',result(1).value); |
---|
246 | set(handles.xOrbitOutOfRange,'value',result(2).value); |
---|
247 | set(handles.zOrbitOutOfRange,'value',result(3).value); |
---|
248 | set(handles.xCorrectionOutOfRange,'value',result(4).value); |
---|
249 | set(handles.zCorrectionOutOfRange,'value',result(5).value); |
---|
250 | set(handles.bpmsCountOutOfRange,'value',result(6).value); |
---|
251 | set(handles.storageRingCurrentOutOfRange,'value',result(7).value); |
---|
252 | set(handles.fofbRecordTimeout,'value',result(8).value); |
---|
253 | set(handles.bpmsTangoComError,'value',result(9).value); |
---|
254 | set(handles.sniffersTangoComError,'value',result(10).value); |
---|
255 | set(handles.steerersTangoComError,'value',result(11).value); |
---|
256 | set(handles.dcctTangoComError,'value',result(12).value); |
---|
257 | set(handles.serviceLockerComError,'value',result(13).value); |
---|
258 | |
---|
259 | % new_text=''; |
---|
260 | % for i=1:1:size(result(14).value,2) |
---|
261 | % new_text=strvcat(new_text,result(14).value{i}); |
---|
262 | % end |
---|
263 | new_text = result(14).value; |
---|
264 | set(handles.logs,'string',new_text); |
---|
265 | set(handles.logs,'value',size(new_text,1)); |
---|
266 | |
---|
267 | set(handles.fofbErrorStatus,'string',result(15).value); |
---|
268 | |
---|
269 | switch result(15).value |
---|
270 | case 'no error' |
---|
271 | set(handles.fofbErrorStatus,'BackgroundColor',[1 1 1]*0.702) |
---|
272 | otherwise |
---|
273 | set(handles.fofbErrorStatus,'BackgroundColor','red') |
---|
274 | end |
---|
275 | |
---|
276 | set(handles.text_date_acquitter,'String', datestr(clock)); |
---|
277 | |
---|
278 | % Count errors |
---|
279 | sum = 0; |
---|
280 | for k=1:13, |
---|
281 | sum = result(k).value; |
---|
282 | end |
---|
283 | |
---|
284 | % Change color of List defaut |
---|
285 | if sum > 0 |
---|
286 | set(handles.text_list_defaults, 'BackgroundColor', [1 0 0]); |
---|
287 | else |
---|
288 | set(handles.text_list_defaults, 'BackgroundColor', [0 1 0]); |
---|
289 | end |
---|
290 | |
---|
291 | |
---|
292 | % --- Executes on button press in close. |
---|
293 | function close_Callback(hObject, eventdata, handles) |
---|
294 | % hObject handle to close (see GCBO) |
---|
295 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
296 | % handles structure with handles and user data (see GUIDATA) |
---|
297 | close(handles.figure1) |
---|
298 | |
---|
299 | |
---|
300 | % --- Executes on button press in bpmsCountOutOfRange. |
---|
301 | function bpmsCountOutOfRange_Callback(hObject, eventdata, handles) |
---|
302 | % hObject handle to bpmsCountOutOfRange (see GCBO) |
---|
303 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
304 | % handles structure with handles and user data (see GUIDATA) |
---|
305 | |
---|
306 | % Hint: get(hObject,'Value') returns toggle state of bpmsCountOutOfRange |
---|
307 | |
---|
308 | |
---|
309 | % --- Executes on selection change in logs. |
---|
310 | function logs_Callback(hObject, eventdata, handles) |
---|
311 | % hObject handle to logs (see GCBO) |
---|
312 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
313 | % handles structure with handles and user data (see GUIDATA) |
---|
314 | |
---|
315 | % Hints: contents = get(hObject,'String') returns logs contents as cell array |
---|
316 | % contents{get(hObject,'Value')} returns selected item from logs |
---|
317 | |
---|
318 | |
---|
319 | % --- Executes during object creation, after setting all properties. |
---|
320 | function logs_CreateFcn(hObject, eventdata, handles) |
---|
321 | % hObject handle to logs (see GCBO) |
---|
322 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
323 | % handles empty - handles not created until after all CreateFcns called |
---|
324 | |
---|
325 | % Hint: listbox controls usually have a white background on Windows. |
---|
326 | % See ISPC and COMPUTER. |
---|
327 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
328 | set(hObject,'BackgroundColor','white'); |
---|
329 | end |
---|
330 | |
---|
331 | |
---|
332 | % --- Executes during object creation, after setting all properties. |
---|
333 | function text_date_acquitter_CreateFcn(hObject, eventdata, handles) |
---|
334 | % hObject handle to text_date_acquitter (see GCBO) |
---|
335 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
336 | % handles empty - handles not created until after all CreateFcns called |
---|
337 | |
---|
338 | set(hObject,'String', datestr(clock)); |
---|
339 | |
---|
340 | |
---|