[4] | 1 | function varargout = RFPostMortem(varargin) |
---|
| 2 | %RFPOSTMORTEM121007 M-file for RFPostMortem121007.fig |
---|
| 3 | % RFPOSTMORTEM121007, by itself, creates a new RFPOSTMORTEM121007 or raises the existing |
---|
| 4 | % singleton*. |
---|
| 5 | % |
---|
| 6 | % H = RFPOSTMORTEM121007 returns the handle to a new RFPOSTMORTEM121007 or the handle to |
---|
| 7 | % the existing singleton*. |
---|
| 8 | % |
---|
| 9 | % RFPOSTMORTEM121007('Property','Value',...) creates a new RFPOSTMORTEM121007 using the |
---|
| 10 | % given property value pairs. Unrecognized properties are passed via |
---|
| 11 | % varargin to RFPostMortem121007_OpeningFcn. This calling syntax produces a |
---|
| 12 | % warning when there is an existing singleton*. |
---|
| 13 | % |
---|
| 14 | % RFPOSTMORTEM121007('CALLBACK') and RFPOSTMORTEM121007('CALLBACK',hObject,...) call the |
---|
| 15 | % local function named CALLBACK in RFPOSTMORTEM121007.M with the given input |
---|
| 16 | % arguments. |
---|
| 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 RFPostMortem121007 |
---|
| 24 | |
---|
| 25 | % Last Modified by G+1UIDE v2.5 29-Feb-2008 13:41:07 |
---|
| 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', @RFPostMortem_OpeningFcn, ... |
---|
| 32 | 'gui_OutputFcn', @RFPostMortem_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 | % --- Executes just before RFPostMortem121007 is made visible. |
---|
| 47 | function RFPostMortem_OpeningFcn(hObject, eventdata, handles, varargin) |
---|
| 48 | % This function has no output args, see OutputFcn. |
---|
| 49 | % hObject handle to figure |
---|
| 50 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 51 | % handles structure with handles and user data (see GUIDATA) |
---|
| 52 | % varargin unrecognized PropertyName/PropertyValue pairs from the |
---|
| 53 | % command line (see VARARGIN) |
---|
| 54 | |
---|
| 55 | % Choose default command line output for RFPostMortem121007 |
---|
| 56 | handles.output = hObject; |
---|
| 57 | |
---|
| 58 | % Update handles structure |
---|
| 59 | guidata(hObject, handles); |
---|
| 60 | |
---|
| 61 | % UIWAIT makes RFPostMortem121007 wait for user response (see UIRESUME) |
---|
| 62 | % uiwait(handles.figure1); |
---|
| 63 | |
---|
| 64 | |
---|
| 65 | % --- Outputs from this function are returned to the command line. |
---|
| 66 | function varargout = RFPostMortem_OutputFcn(hObject, eventdata, handles) |
---|
| 67 | % varargout cell array for returning output args (see VARARGOUT); |
---|
| 68 | % hObject handle to figure |
---|
| 69 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 70 | % handles structure with handles and user data (see GUIDATA) |
---|
| 71 | |
---|
| 72 | % Get default command line output from handles structure |
---|
| 73 | varargout{1} = handles.output; |
---|
| 74 | |
---|
| 75 | |
---|
| 76 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 77 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 78 | % CAVITE 1 % |
---|
| 79 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 80 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 81 | |
---|
| 82 | |
---|
| 83 | % --- Executes on button press in pushbutton1_ACQUISITION. |
---|
| 84 | function pushbutton1_ACQUISITION_Callback(hObject, eventdata, handles) |
---|
| 85 | % hObject handle to pushbutton1_ACQUISITION (see GCBO) |
---|
| 86 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 87 | % handles structure with handles and user data (see GUIDATA) |
---|
| 88 | |
---|
| 89 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 90 | |
---|
| 91 | statusAcquisition_cav1=tango_read_attribute2('ANS-C03/RF/PM.1','Status'); |
---|
| 92 | text=statusAcquisition_cav1.value; |
---|
| 93 | if findstr(text, 'running') |
---|
| 94 | msgbox('Fonctionnement Normal: pas d''acquisition à faire','Info','warn'); |
---|
| 95 | return; |
---|
| 96 | |
---|
| 97 | else |
---|
| 98 | |
---|
| 99 | set(handles.text4_PR1,'String','Pr1'); |
---|
| 100 | set(handles.text_PR2,'String','Pr2'); |
---|
| 101 | set(handles.text_PR3,'String','Pr3'); |
---|
| 102 | set(handles.text_PR4,'String','Pr4'); |
---|
| 103 | |
---|
| 104 | rep = tango_read_attributes2('ANS-C03/RF/AMP.1-DATA', {'reflectedPowerSecurityT1','reflectedPowerSecurityT2',... |
---|
| 105 | 'reflectedPowerSecurityT3','reflectedPowerSecurityT4'}); |
---|
| 106 | |
---|
| 107 | Data.AMP1.reflectedPowerSecurityT1 = rep(1).value; |
---|
| 108 | Data.AMP1.reflectedPowerSecurityT2 = rep(2).value; |
---|
| 109 | Data.AMP1.reflectedPowerSecurityT3 = rep(3).value; |
---|
| 110 | Data.AMP1.reflectedPowerSecurityT4 = rep(4).value; |
---|
| 111 | |
---|
| 112 | |
---|
| 113 | if Data.AMP1.reflectedPowerSecurityT1 |
---|
| 114 | set(handles.text4_PR1,'BackgroundColor', [0 1 0]); %green |
---|
| 115 | else |
---|
| 116 | set(handles.text4_PR1,'BackgroundColor', [1 0 0]); %red |
---|
| 117 | end |
---|
| 118 | |
---|
| 119 | if Data.AMP1.reflectedPowerSecurityT2 |
---|
| 120 | set(handles.text_PR2,'BackgroundColor', [0 1 0]); %green |
---|
| 121 | else |
---|
| 122 | set(handles.text_PR2,'BackgroundColor', [1 0 0]); %red |
---|
| 123 | end |
---|
| 124 | |
---|
| 125 | if Data.AMP1.reflectedPowerSecurityT3 |
---|
| 126 | set(handles.text_PR3,'BackgroundColor', [0 1 0]); %green |
---|
| 127 | else |
---|
| 128 | set(handles.text_PR3,'BackgroundColor', [1 0 0]); %red |
---|
| 129 | end |
---|
| 130 | |
---|
| 131 | if Data.AMP1.reflectedPowerSecurityT4 |
---|
| 132 | set(handles.text_PR4,'BackgroundColor', [0 1 0]); %green |
---|
| 133 | else |
---|
| 134 | set(handles.text_PR4,'BackgroundColor', [1 0 0]); %red |
---|
| 135 | end |
---|
| 136 | |
---|
| 137 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 138 | set(handles.text_Pi,'String','Pi'); |
---|
| 139 | set(handles.text_PSS,'String','PSS Sec'); |
---|
| 140 | set(handles.text_uC,'String','uC'); |
---|
| 141 | |
---|
| 142 | repPSS = tango_read_attribute2('ANS-C03/RF/LLE.1','pssSecurity'); |
---|
| 143 | %rep = tango_read_attributes2('ANS-C03/RF/AMP.1-DATA', {'incidentPowerSecurity','pssSecurity','microcontrollerSecurity'}); |
---|
| 144 | rep = tango_read_attributes2('ANS-C03/RF/AMP.1-DATA', {'incidentPowerSecurity','microcontrollerSecurity'}); |
---|
| 145 | |
---|
| 146 | Data.AMP1.incidentPowerSecurity = rep(1).value; |
---|
| 147 | Data.AMP1.pssSecurity = repPSS.value; |
---|
| 148 | Data.AMP1.microcontrollerSecurity=rep(2).value; |
---|
| 149 | |
---|
| 150 | if Data.AMP1.incidentPowerSecurity |
---|
| 151 | set(handles.text_Pi,'BackgroundColor', [0 1 0]); %green |
---|
| 152 | else |
---|
| 153 | set(handles.text_Pi,'BackgroundColor', [1 0 0]); %red |
---|
| 154 | end |
---|
| 155 | |
---|
| 156 | if Data.AMP1.pssSecurity |
---|
| 157 | set(handles.text_PSS,'BackgroundColor', [0 1 0]); %green |
---|
| 158 | else |
---|
| 159 | set(handles.text_PSS,'BackgroundColor', [1 0 0]); %red |
---|
| 160 | end |
---|
| 161 | |
---|
| 162 | if Data.AMP1.microcontrollerSecurity |
---|
| 163 | set(handles.text_uC,'BackgroundColor', [0 1 0]); %green |
---|
| 164 | else |
---|
| 165 | set(handles.text_uC,'BackgroundColor', [1 0 0]); %red |
---|
| 166 | end |
---|
| 167 | |
---|
| 168 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 169 | |
---|
| 170 | set(handles.text_InterLCKmach,'String','Interlck MACH'); |
---|
| 171 | set(handles.text_VAC,'String','VAC'); |
---|
| 172 | set(handles.text_CRYO,'String','CRYO'); |
---|
| 173 | |
---|
| 174 | |
---|
| 175 | repINTER = tango_read_attribute2('ANS-C03/RF/LLE.1','machineSecurity'); |
---|
| 176 | %rep = tango_read_attributes2('ANS-C03/RF/CAV.1', {'interlock','vacuumSecurity','cryomoduleSecurity'}); |
---|
| 177 | rep = tango_read_attributes2('ANS-C03/RF/CAV.1', {'vacuumSecurity','cryomoduleSecurity'}); |
---|
| 178 | |
---|
| 179 | Data.CAV1.interlock = repINTER.value; |
---|
| 180 | %Data.CAV1.interlock = rep(1).value; |
---|
| 181 | Data.CAV1.vacuum = rep(1).value; |
---|
| 182 | Data.CAV1.cryo = rep(2).value; |
---|
| 183 | |
---|
| 184 | if Data.CAV1.interlock |
---|
| 185 | set(handles.text_InterLCKmach,'BackgroundColor', [0 1 0]); %green |
---|
| 186 | else |
---|
| 187 | %disp (Data.CAV1.interlock); |
---|
| 188 | set(handles.text_InterLCKmach,'BackgroundColor', [1 0 0]); %red |
---|
| 189 | end |
---|
| 190 | |
---|
| 191 | if Data.CAV1.vacuum |
---|
| 192 | %disp (Data.CAV1.vacuum); |
---|
| 193 | set(handles.text_VAC,'BackgroundColor', [0 1 0]); %green |
---|
| 194 | else |
---|
| 195 | %disp (Data.CAV1.vacuum) |
---|
| 196 | set(handles.text_VAC,'BackgroundColor', [1 0 0]); %red |
---|
| 197 | end |
---|
| 198 | |
---|
| 199 | if Data.CAV1.cryo |
---|
| 200 | %disp (Data.CAV1.cryo); |
---|
| 201 | set(handles.text_CRYO,'BackgroundColor', [0 1 0]); %green |
---|
| 202 | else |
---|
| 203 | %disp (Data.CAV1.vacuum) |
---|
| 204 | set(handles.text_CRYO,'BackgroundColor', [1 0 0]); %red |
---|
| 205 | end |
---|
| 206 | |
---|
| 207 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 208 | |
---|
| 209 | rep = tango_read_attributes2('ANS-C03/RF/PM.1', {'acqHighResolutionCh1', 'acqHighResolutionCh2', 'acqHighResolutionCh3', ... |
---|
| 210 | 'acqHighResolutionCh4'}); |
---|
| 211 | Data.PM1.DataHR1 = rep(1).value; |
---|
| 212 | Data.PM1.DataHR2 = rep(2).value; |
---|
| 213 | Data.PM1.DataHR3 = rep(3).value; |
---|
| 214 | Data.PM1.DataHR4 = rep(4).value; |
---|
| 215 | |
---|
| 216 | Data.PM1.TimestampHR = tango_shift_time(rep(1).time); |
---|
| 217 | |
---|
| 218 | reptrig1 = tango_read_attribute2('ANS-C03/RF/PM.1','triggerTimestamp'); |
---|
| 219 | Data.PM1.triggerTimestamp = reptrig1.value; |
---|
| 220 | |
---|
| 221 | [NbrColumn,NbrPoint1] = size (Data.PM1.DataHR1); |
---|
| 222 | |
---|
| 223 | axes(handles.graph1); |
---|
| 224 | |
---|
| 225 | name1='_AcRAPIDE' |
---|
| 226 | |
---|
| 227 | %pnt=1:10000; |
---|
| 228 | pnt=1:NbrPoint1; |
---|
| 229 | |
---|
| 230 | |
---|
| 231 | hold off; |
---|
| 232 | plot(pnt, Data.PM1.DataHR1,'b'); hold on; grid on; |
---|
| 233 | plot(pnt, Data.PM1.DataHR2,'r'); |
---|
| 234 | plot(pnt, Data.PM1.DataHR3,'g'); |
---|
| 235 | plot(pnt, Data.PM1.DataHR4,'k'); |
---|
| 236 | legend('Ac. Rapide CH1: Vcav', 'Ac. Rapide CH2: Pi','Ac. Rapide CH3: Pr','Ac. Rapide CH4: Ib'); |
---|
| 237 | %text(Data.PM1.triggerTimestamp); |
---|
| 238 | xlabel('nombre de points (temps: 1 us par point)'); |
---|
| 239 | ylabel('Signal'); |
---|
| 240 | |
---|
| 241 | |
---|
| 242 | |
---|
| 243 | %++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% |
---|
| 244 | |
---|
| 245 | DirectoryName = getfamilydata('Directory', 'RFPostmortem'); |
---|
| 246 | %FileName = appendtimestamp('RFdata_CAV1', Data.PM1.TimestampHR); |
---|
| 247 | %COMMENT% FileName = appendtimestamp('RFdata_CAV1', Data.PM1.triggerTimestamp); |
---|
| 248 | %FileName = appendtimestamp('RFdata_CAV1', Data.PM1.triggerTimestamp); |
---|
| 249 | FileName =['RFdata_CAV1_', Data.PM1.triggerTimestamp]; |
---|
| 250 | %FileName = strcat(FileName,name1); |
---|
| 251 | %button group |
---|
| 252 | |
---|
| 253 | [token,remain]=strtok(FileName); |
---|
| 254 | res=datevec(remain); |
---|
| 255 | resp1=num2str(res(1)); |
---|
| 256 | resp2=num2str(res(2)); |
---|
| 257 | resp3=num2str(res(3)); |
---|
| 258 | resp4=num2str(res(4)); |
---|
| 259 | resp5=num2str(res(5)); |
---|
| 260 | resp6=num2str(res(6)); |
---|
| 261 | FileNameLAST=strcat('RFdata_CAV1','_',resp1,'-',resp2,'-',resp3,'_',resp4,'h',resp5,'mn',resp6,'s'); |
---|
| 262 | disp (FileNameLAST); |
---|
| 263 | |
---|
| 264 | [FileNameLAST, DirectoryName] = uiputfile('*.mat', 'Select File (Cancel to not save to a file)', [DirectoryName FileNameLAST, '.mat']); |
---|
| 265 | if FileNameLAST == 0 |
---|
| 266 | disp(' No data saved'); |
---|
| 267 | return; |
---|
| 268 | %RFdata_2007-10-10_13-48-23.mat |
---|
| 269 | end |
---|
| 270 | |
---|
| 271 | DirStart = pwd; |
---|
| 272 | [DirectoryName, ErrorFlag] = gotodirectory(DirectoryName); |
---|
| 273 | save(FileNameLAST, 'Data'); |
---|
| 274 | cd(DirStart); |
---|
| 275 | fprintf(' Data saved to %s\n', [DirectoryName FileNameLAST]); |
---|
| 276 | |
---|
| 277 | setappdata(handles.figure1, 'RFdata_CAV1', Data); |
---|
| 278 | |
---|
| 279 | end |
---|
| 280 | %+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% |
---|
| 281 | |
---|
| 282 | |
---|
| 283 | |
---|
| 284 | % --- Executes on button press in pushbutton2_CLEA*.matR. |
---|
| 285 | function pushbutton2_CLEAR_Callback(hObject, eventdata, handles) |
---|
| 286 | % hObject handle to pushbutton2_CLEAR (see GCBO) |
---|
| 287 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 288 | % handles structure*.mat with handles and user data (see GUIDATA) |
---|
| 289 | |
---|
| 290 | axes(handles.graph1); |
---|
| 291 | hold off; |
---|
| 292 | plot(NaN); |
---|
| 293 | |
---|
| 294 | |
---|
| 295 | set(handles.text4_PR1,'BackgroundColor', [0.702 0.702 0.702]); %gray |
---|
| 296 | set(handles.text_PR2,'BackgroundColor', [0.702 0.702 0.702]); %gray |
---|
| 297 | set(handles.text_PR3,'BackgroundColor', [0.702 0.702 0.702]); %gray |
---|
| 298 | set(handles.text_PR4,'BackgroundColor', [0.702 0.702 0.702]); %gray |
---|
| 299 | |
---|
| 300 | set(handles.text_Pi,'BackgroundColor', [0.702 0.702 0.702]); %gray |
---|
| 301 | set(handles.text_PSS,'BackgroundColor', [0.702 0.702 0.702]); %gray |
---|
| 302 | set(handles.text_uC,'BackgroundColor', [0.702 0.702 0.702]); %gray |
---|
| 303 | |
---|
| 304 | set(handles.text_InterLCKmach,'BackgroundColor', [0.702 0.702 0.702]); %gray |
---|
| 305 | set(handles.text_VAC,'BackgroundColor', [0.702 0.702 0.702]); %gray |
---|
| 306 | set(handles.text_CRYO,'BackgroundColor', [0.702 0.702 0.702]); %gray |
---|
| 307 | |
---|
| 308 | |
---|
| 309 | %++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% |
---|
| 310 | |
---|
| 311 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 312 | |
---|
| 313 | % --- Executes on button press in pushbutton_Open. |
---|
| 314 | function pushbutton_Open_Callback(hObject, eventdata, handles) |
---|
| 315 | % hObject handle to pushbutton_Open (see GCBO) |
---|
| 316 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 317 | % handles structure with handles and user data (see GUIDATA) |
---|
| 318 | |
---|
| 319 | DirectoryName = getfamilydata('Directory', 'RFPostmortem'); |
---|
| 320 | DirStart = pwd; |
---|
| 321 | DirectoryName = gotodirectory(DirectoryName); |
---|
| 322 | [FileName, DirectoryName] = uigetfile('*.mat', 'Select File (Cancel to not save to a file)','RFdata_CAV1*'); |
---|
| 323 | disp (FileName); |
---|
| 324 | |
---|
| 325 | global DirectoryNameGlobal; |
---|
| 326 | DirectoryNameGlobal=DirectoryName; |
---|
| 327 | global FileNameGlobal; |
---|
| 328 | FileNameGlobal=FileName; |
---|
| 329 | |
---|
| 330 | if FileName == 0 |
---|
| 331 | msgbox('No file chosen','Info','warn'); |
---|
| 332 | %disp(' No file chosen'); |
---|
| 333 | return; |
---|
| 334 | else |
---|
| 335 | load(FileName, 'Data'); |
---|
| 336 | end |
---|
| 337 | cd(DirStart); |
---|
| 338 | |
---|
| 339 | setappdata(handles.figure1, 'RFdata_CAV1', Data); |
---|
| 340 | |
---|
| 341 | |
---|
| 342 | |
---|
| 343 | if Data.AMP1.reflectedPowerSecurityT1 |
---|
| 344 | set(handles.text4_PR1,'BackgroundColor', [0 1 0]); %green |
---|
| 345 | else |
---|
| 346 | set(handles.text4_PR1,'BackgroundColor', [1 0 0]); %red |
---|
| 347 | end |
---|
| 348 | |
---|
| 349 | if Data.AMP1.reflectedPowerSecurityT2 |
---|
| 350 | set(handles.text_PR2,'BackgroundColor', [0 1 0]); %green |
---|
| 351 | else |
---|
| 352 | set(handles.text_PR2,'BackgroundColor', [1 0 0]); %red |
---|
| 353 | end |
---|
| 354 | |
---|
| 355 | if Data.AMP1.reflectedPowerSecurityT3 |
---|
| 356 | set(handles.text_PR3,'BackgroundColor', [0 1 0]); %green |
---|
| 357 | else |
---|
| 358 | set(handles.text_PR3,'BackgroundColor', [1 0 0]); %red |
---|
| 359 | end |
---|
| 360 | |
---|
| 361 | if Data.AMP1.reflectedPowerSecurityT4 |
---|
| 362 | set(handles.text_PR4,'BackgroundColor', [0 1 0]); %green |
---|
| 363 | else |
---|
| 364 | set(handles.text_PR4,'BackgroundColor', [1 0 0]); %red |
---|
| 365 | end |
---|
| 366 | |
---|
| 367 | |
---|
| 368 | if Data.AMP1.incidentPowerSecurity |
---|
| 369 | set(handles.text_Pi,'BackgroundColor', [0 1 0]); %green |
---|
| 370 | else |
---|
| 371 | set(handles.text_Pi,'BackgroundColor', [1 0 0]); %red |
---|
| 372 | end |
---|
| 373 | |
---|
| 374 | if Data.AMP1.pssSecurity |
---|
| 375 | set(handles.text_PSS,'BackgroundColor', [0 1 0]); %green |
---|
| 376 | else |
---|
| 377 | set(handles.text_PSS,'BackgroundColor', [1 0 0]); %red |
---|
| 378 | end |
---|
| 379 | |
---|
| 380 | if Data.AMP1.microcontrollerSecurity |
---|
| 381 | set(handles.text_uC,'BackgroundColor', [0 1 0]); %green |
---|
| 382 | else |
---|
| 383 | set(handles.text_uC,'BackgroundColor', [1 0 0]); %red |
---|
| 384 | end |
---|
| 385 | |
---|
| 386 | if Data.CAV1.interlock |
---|
| 387 | set(handles.text_InterLCKmach,'BackgroundColor', [0 1 0]); %green |
---|
| 388 | else |
---|
| 389 | set(handles.text_InterLCKmach,'BackgroundColor', [1 0 0]); %red |
---|
| 390 | end |
---|
| 391 | |
---|
| 392 | if Data.CAV1.vacuum |
---|
| 393 | set(handles.text_VAC,'BackgroundColor', [0 1 0]); %green |
---|
| 394 | else |
---|
| 395 | set(handles.text_VAC,'BackgroundColor', [1 0 0]); %red |
---|
| 396 | end |
---|
| 397 | |
---|
| 398 | if Data.CAV1.cryo |
---|
| 399 | set(handles.text_CRYO,'BackgroundColor', [0 1 0]); %green |
---|
| 400 | else |
---|
| 401 | set(handles.text_CRYO,'BackgroundColor', [1 0 0]); %red |
---|
| 402 | end |
---|
| 403 | |
---|
| 404 | axes(handles.graph1); |
---|
| 405 | |
---|
| 406 | [NbrColumn,NbrPoint2] = size (Data.PM1.DataHR1); |
---|
| 407 | |
---|
| 408 | %%Data.PM1.DataHR1 = -(Data.PM1.DataHR1/5)*10^6; |
---|
| 409 | %disp (Data.PM1.DataHR1(2)); |
---|
| 410 | %%Data.PM1.DataHR2 = ((0.0361 + 0.2542*Data.PM1.DataHR2 - 0.0112*Data.PM1.DataHR2.^2 + 0.0011*Data.PM1.DataHR2.^3).^2/50)*2.74*10^7; |
---|
| 411 | %%Data.PM1.DataHR3 = ((0.0361 + 0.2542*Data.PM1.DataHR3 - 0.0112*Data.PM1.DataHR3.^2 + 0.0011*Data.PM1.DataHR3.^3).^2/50)*8.2*10^5; |
---|
| 412 | %%Data.PM1.DataHR4 = (Data.PM1.DataHR4)*10^4; |
---|
| 413 | |
---|
| 414 | %global NbrPoint |
---|
| 415 | %[NbrColumn,NbrPoint2] = size (Data.PM1.DataHR1); |
---|
| 416 | %NbrPoint2=10000; |
---|
| 417 | |
---|
| 418 | hold off; |
---|
| 419 | pnt=[1:NbrPoint2]; |
---|
| 420 | |
---|
| 421 | %pnt=1:NbrPoint2; |
---|
| 422 | |
---|
| 423 | %hold on; grid on; |
---|
| 424 | %//pnt1=1:200000; |
---|
| 425 | %//pnt2=1:200000; |
---|
| 426 | %[haxes,hline1,hline2,hline3]=plotyy(pnt,Data.PM1.DataHR1,pnt,Data.PM1.DataHR2,pnt,Data.PM1.DataHR3); |
---|
| 427 | %[haxes,hline1,hline2]=plotyy(pnt,Data.PM1.DataHR1,pnt,Data.PM1.DataHR2); |
---|
| 428 | %//[haxes,hline1,hline2]=plotyy(pnt1,Data.PM1.DataHR1,pnt2,Data.PM1.DataHR2,'plot'); |
---|
| 429 | %//set(hline1,'Color','b'); |
---|
| 430 | %//set(hline2,'Color','r'); |
---|
| 431 | %//axes(haxes(1));%110108% |
---|
| 432 | %110108%axis([valmin valmax minHR1app maxHR1app]);%110108% |
---|
| 433 | %110108%set(gca,'YTick',minHR1app:((maxHR1app-minHR1app)/10):maxHR1app);%110108% |
---|
| 434 | %[haxes,hline3,hline4]=plotyy(pnt,Data.PM1.DataHR3,pnt,Data.PM1.DataHR4); |
---|
| 435 | plot(pnt, Data.PM1.DataHR1,'b'); hold on; grid on; |
---|
| 436 | plot(pnt, Data.PM1.DataHR2,'r'); |
---|
| 437 | plot(pnt, Data.PM1.DataHR3,'g'); |
---|
| 438 | plot(pnt, Data.PM1.DataHR4,'k'); |
---|
| 439 | legend('Ac. Rapide CH1: Vcav', 'Ac. Rapide CH2: Pi','Ac. Rapide CH3: Pr','Ac. Rapide CH4: Ib'); |
---|
| 440 | %%legend('Ac. Rapide CH1: Vcav', 'Ac. Rapide CH2: Pi'); |
---|
| 441 | xlabel('nombre de points (temps: 1 us par point)'); |
---|
| 442 | |
---|
| 443 | %zoom on; |
---|
| 444 | %//ylabel('Vcav [V]','Color','b'); |
---|
| 445 | ylabel('Signal'); |
---|
| 446 | %//ylabel('Vcav [V]'); |
---|
| 447 | %LegVcav=legend('Ac. Rapide CH1: Vcav'); |
---|
| 448 | %121108 set(LegVcav,'Location','NorthWest'); |
---|
| 449 | %set(LegVcav,'background','g'); |
---|
| 450 | %//axes(haxes(2)); |
---|
| 451 | %110108%axis([valmin valmax minapp1 maxapp1]);%110108% |
---|
| 452 | %110108%set(gca,'YTick',minapp1:((maxapp1-minapp1)/10):maxapp1);%110108% |
---|
| 453 | %//axis auto; |
---|
| 454 | %axes(h,'Color','b'); |
---|
| 455 | %//ylabel('Power [Watts]'); |
---|
| 456 | %//hold on; grid on; |
---|
| 457 | %//plot(pnt2,Data.PM1.DataHR3,'y'); |
---|
| 458 | |
---|
| 459 | %hold on; grid on; |
---|
| 460 | %//plot(pnt2, Data.PM1.DataHR4,'k'); |
---|
| 461 | %//LegPuissance=legend('Ac. Rapide CH2: Pi','Ac. Rapide CH3: Pr','Ac. Rapide CH4: Ib'); |
---|
| 462 | %legend('Ac. Rapide CH4: Ib'); |
---|
| 463 | %ylabel('Signal'); |
---|
| 464 | text(1000,0.5,Data.PM1.triggerTimestamp); |
---|
| 465 | |
---|
| 466 | |
---|
| 467 | |
---|
| 468 | |
---|
| 469 | |
---|
| 470 | |
---|
| 471 | |
---|
| 472 | |
---|
| 473 | |
---|
| 474 | % --- Executes on button press in pushbutton13. |
---|
| 475 | function pushbutton13_Callback(hObject, eventdata, handles) |
---|
| 476 | % hObject handle to pushbutton13 (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 | valmax=1; |
---|
| 481 | valmin=0; |
---|
| 482 | |
---|
| 483 | valminINIT=get(handles.edit2,'String'); |
---|
| 484 | valmin=str2num(valminINIT{1}); |
---|
| 485 | valmaxINIT=get(handles.edit3,'String'); |
---|
| 486 | valmax=str2num(valmaxINIT{1}); |
---|
| 487 | |
---|
| 488 | n=valmax-valmin+1; |
---|
| 489 | i=1; |
---|
| 490 | |
---|
| 491 | global DirectoryNameGlobal; |
---|
| 492 | disp ('DirectoryNameGlobal'); |
---|
| 493 | gotodirectory(DirectoryNameGlobal); |
---|
| 494 | |
---|
| 495 | global FileNameGlobal; |
---|
| 496 | load(FileNameGlobal, 'Data'); |
---|
| 497 | |
---|
| 498 | for i=1:n |
---|
| 499 | %matAbscisse(i)=valmin+i-1; |
---|
| 500 | %matHR1(i)=Data.PM1.DataHR1(i); |
---|
| 501 | %matHR1(i)=-(Data.PM1.DataHR1(valmin+i-1)/5)*10^6; |
---|
| 502 | Data.PM1.DataHR1(valmin+i-1)=-((Data.PM1.DataHR1(valmin+i-1))/5)*10^2; |
---|
| 503 | %Data.PM1.DataHR1=-Data.PM1.DataHR1(1,valmin:valmax)*10; |
---|
| 504 | %matHR2(i)=Data.PM1.DataHR2(i); |
---|
| 505 | %matHR2(i)=((0.0361 + 0.2542*Data.PM1.DataHR2(valmin+i-1) - 0.0112*Data.PM1.DataHR2(valmin+i-1).^2 + 0.0011*Data.PM1.DataHR2(valmin+i-1).^3).^2/50)*2.74*10^7; |
---|
| 506 | Data.PM1.DataHR2(valmin+i-1)=((0.0361 + 0.2542*Data.PM1.DataHR2(valmin+i-1) - 0.0112*Data.PM1.DataHR2(valmin+i-1).^2 + 0.0011*Data.PM1.DataHR2(valmin+i-1).^3).^2/50)*2.74*10^4; |
---|
| 507 | %%Data.PM1.DataHR2=Data.PM1.DataHR2*12; |
---|
| 508 | %matHR3(i)=Data.PM1.DataHR3(i); |
---|
| 509 | %matHR3(i)=((0.0361 + 0.2542*Data.PM1.DataHR3(valmin+i-1) - 0.0112*Data.PM1.DataHR3(valmin+i-1).^2 + 0.0011*Data.PM1.DataHR3(valmin+i-1).^3).^2/50)*8.2*10^5; |
---|
| 510 | Data.PM1.DataHR3(valmin+i-1)=((0.0361 + 0.2542*Data.PM1.DataHR3(valmin+i-1) - 0.0112*Data.PM1.DataHR3(valmin+i-1).^2 + 0.0011*Data.PM1.DataHR3(valmin+i-1).^3).^2/50)*8.2*10^2; |
---|
| 511 | %%Data.PM1.DataHR3=Data.PM1.DataHR3*14; |
---|
| 512 | %matHR4(i)=Data.PM1.DataHR4(i); |
---|
| 513 | %matHR4(i)=(Data.PM1.DataHR4(valmin+i-1))*10^3; |
---|
| 514 | Data.PM1.DataHR4(valmin+i-1)=(Data.PM1.DataHR4(valmin+i-1))*10^2; |
---|
| 515 | %%Data.PM1.DataHR4=Data.PM1.DataHR4*16; |
---|
| 516 | end |
---|
| 517 | |
---|
| 518 | maxHR1=max(Data.PM1.DataHR1); |
---|
| 519 | maxHR2=max(Data.PM1.DataHR2); |
---|
| 520 | maxHR3=max(Data.PM1.DataHR3); |
---|
| 521 | maxHR4=max(Data.PM1.DataHR4); |
---|
| 522 | minHR1=min(Data.PM1.DataHR1); |
---|
| 523 | minHR2=min(Data.PM1.DataHR2); |
---|
| 524 | minHR3=min(Data.PM1.DataHR3); |
---|
| 525 | minHR4=min(Data.PM1.DataHR4); |
---|
| 526 | |
---|
| 527 | if (maxHR2(1)>maxHR3(1)) |
---|
| 528 | max1=maxHR2(1) |
---|
| 529 | else max1=maxHR3(1); |
---|
| 530 | end |
---|
| 531 | if (max1<maxHR4(1)) |
---|
| 532 | max1=maxHR4(1); |
---|
| 533 | end |
---|
| 534 | |
---|
| 535 | if (minHR2(1)<minHR3(1)) |
---|
| 536 | min1=minHR2(1) |
---|
| 537 | else min1=minHR3(1); |
---|
| 538 | end |
---|
| 539 | if (min1>minHR4(1)) |
---|
| 540 | min1=minHR4(1); |
---|
| 541 | end |
---|
| 542 | |
---|
| 543 | %minapp1=min1; |
---|
| 544 | %maxapp1=max1; |
---|
| 545 | minHR1app=minHR1(1); |
---|
| 546 | maxHR1app=maxHR1(1); |
---|
| 547 | |
---|
| 548 | if (minHR1app<min1) |
---|
| 549 | mini=minHR1 |
---|
| 550 | else |
---|
| 551 | mini=min1 |
---|
| 552 | end |
---|
| 553 | |
---|
| 554 | if (maxHR1app>max1) |
---|
| 555 | maxi=maxHR1 |
---|
| 556 | else |
---|
| 557 | maxi=max1 |
---|
| 558 | end |
---|
| 559 | |
---|
| 560 | axes(handles.graph1); |
---|
| 561 | |
---|
| 562 | |
---|
| 563 | hold off; |
---|
| 564 | pnt=[valmin:valmax]; |
---|
| 565 | axis([valmin valmax mini maxi]); |
---|
| 566 | set(gca,'XTick',[valmin valmax]); |
---|
| 567 | plot(Data.PM1.DataHR1,'b'); hold on; grid on; |
---|
| 568 | axis([valmin valmax mini maxi]) |
---|
| 569 | plot(Data.PM1.DataHR2,'r'); |
---|
| 570 | plot(Data.PM1.DataHR3,'g'); |
---|
| 571 | plot(Data.PM1.DataHR4,'k'); |
---|
| 572 | legend('Ac. Rapide CH1: Vcav', 'Ac. Rapide CH2: Pi','Ac. Rapide CH3: Pr','Ac. Rapide CH4: Ib'); |
---|
| 573 | xlabel('nombre de points (temps: 1 us par point)'); |
---|
| 574 | ylabel('Signal'); |
---|
| 575 | text(1000,0.5,Data.PM1.triggerTimestamp); |
---|
| 576 | |
---|
| 577 | |
---|
| 578 | |
---|
| 579 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 580 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 581 | |
---|
| 582 | % --- Executes on button press in pushbutton_RESET_cav1. |
---|
| 583 | function pushbutton_RESET_cav1_Callback(hObject, eventdata, handles) |
---|
| 584 | % hObject handle to pushbutton_RESET_cav1 (see GCBO) |
---|
| 585 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 586 | % handles structure with handles and user data (see GUIDATA) |
---|
| 587 | |
---|
| 588 | %DirectoryNameESP='/home/operateur/GrpRF/Nicolas'; |
---|
| 589 | %DirectoryNameESP = gotodirectory(DirectoryNameESP); |
---|
| 590 | %FilenameESP='ESP'; |
---|
| 591 | %load(Filename); |
---|
| 592 | |
---|
| 593 | statusAcquisition_cav1=tango_read_attribute2('ANS-C03/RF/PM.1','Status'); |
---|
| 594 | text=statusAcquisition_cav1.value; |
---|
| 595 | if findstr(text, 'running') |
---|
| 596 | msgbox('Un reset a déjà été fait, le device fonctionne Normalement','Info','warn'); |
---|
| 597 | return; |
---|
| 598 | else |
---|
| 599 | set(handles.pushbutton_RESET_cav1,'Tag','pushbutton_RESET_cav1'); |
---|
| 600 | %set(handles.pushbutton_RESET_cav1,'String','RESET'); |
---|
| 601 | %tango_command_inout2('ANS-C03/RF/PM.1','Init'); |
---|
| 602 | tango_command_inout2('ANS-C03/RF/PM.1','Start'); |
---|
| 603 | |
---|
| 604 | fid=0; |
---|
| 605 | filenameRES='/home/operateur/GrpRF/Nicolas/SUIVIreset'; |
---|
| 606 | %filenameRES='TESTres'; |
---|
| 607 | fid=fopen(filenameRES,'a+'); |
---|
| 608 | %disp (fid); |
---|
| 609 | %disp ('2'); |
---|
| 610 | %valeurTEST='test11111'; |
---|
| 611 | valeurTEST=datestr(clock,0); |
---|
| 612 | |
---|
| 613 | fprintf(fid,'Reset CAV1 at: %s \n',valeurTEST); |
---|
| 614 | fclose(fid); |
---|
| 615 | %DateReset = clock; |
---|
| 616 | end |
---|
| 617 | |
---|
| 618 | %tango_command_inout2('ANS-C03/RF/PM.1','Stop'); %NE PAS OUBLIER D'ENLEVER CETTE LIGNE APRES TEST |
---|
| 619 | |
---|
| 620 | |
---|
| 621 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 622 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 623 | % CAVITE 2 % |
---|
| 624 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 625 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 626 | |
---|
| 627 | % --- Executes on button press in pushbutton_cav2_Acquisition. |
---|
| 628 | function pushbutton_cav2_Acquisition_Callback(hObject, eventdata, handles) |
---|
| 629 | % hObject handle to pushbutton_cav2_Acquisition (see GCBO) |
---|
| 630 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 631 | % handles structure with handles and user data (see GUIDATA) |
---|
| 632 | |
---|
| 633 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 634 | |
---|
| 635 | statusAcquisition_cav2=tango_read_attribute2('ANS-C03/RF/PM.2','Status'); |
---|
| 636 | text=statusAcquisition_cav2.value; |
---|
| 637 | if findstr(text, 'running') |
---|
| 638 | msgbox('Fonctionnement Normal: pas d''acquisition à faire','Info','warn'); |
---|
| 639 | return; |
---|
| 640 | |
---|
| 641 | else |
---|
| 642 | |
---|
| 643 | set(handles.text_cav2_PR1,'String','Pr1'); |
---|
| 644 | set(handles.text_cav2_PR2,'String','Pr2'); |
---|
| 645 | set(handles.text_cav2_PR3,'String','Pr3'); |
---|
| 646 | set(handles.text_cav2_PR4,'String','Pr4'); |
---|
| 647 | |
---|
| 648 | rep = tango_read_attributes2('ANS-C03/RF/AMP.2-DATA', {'reflectedPowerSecurityT1','reflectedPowerSecurityT2',... |
---|
| 649 | 'reflectedPowerSecurityT3','reflectedPowerSecurityT4'}); |
---|
| 650 | |
---|
| 651 | %%rep = tango_read_attribute2('ANS-C03/RF/AMP.2-DATA','reflectedPowerSecurityT1') |
---|
| 652 | |
---|
| 653 | %%Data.AMP2.reflectedPowerSecurityT1 = rep.value; |
---|
| 654 | Data.AMP2.reflectedPowerSecurityT1 = rep(1).value; |
---|
| 655 | Data.AMP2.reflectedPowerSecurityT2 = rep(2).value; |
---|
| 656 | Data.AMP2.reflectedPowerSecurityT3 = rep(3).value; |
---|
| 657 | Data.AMP2.reflectedPowerSecurityT4 = rep(4).value; |
---|
| 658 | |
---|
| 659 | if Data.AMP2.reflectedPowerSecurityT1 |
---|
| 660 | set(handles.text_cav2_PR1,'BackgroundColor', [0 1 0]); %green |
---|
| 661 | else |
---|
| 662 | set(handles.text_cav2_PR1,'BackgroundColor', [1 0 0]); %red |
---|
| 663 | end |
---|
| 664 | |
---|
| 665 | if Data.AMP2.reflectedPowerSecurityT2 |
---|
| 666 | set(handles.text_cav2_PR2,'BackgroundColor', [0 1 0]); %green |
---|
| 667 | else |
---|
| 668 | set(handles.text_cav2_PR2,'BackgroundColor', [1 0 0]); %red |
---|
| 669 | end |
---|
| 670 | |
---|
| 671 | if Data.AMP2.reflectedPowerSecurityT3 |
---|
| 672 | set(handles.text_cav2_PR3,'BackgroundColor', [0 1 0]); %green |
---|
| 673 | else |
---|
| 674 | set(handles.text_cav2_PR3,'BackgroundColor', [1 0 0]); %red |
---|
| 675 | end |
---|
| 676 | |
---|
| 677 | if Data.AMP2.reflectedPowerSecurityT4 |
---|
| 678 | set(handles.text_cav2_PR4,'BackgroundColor', [0 1 0]); %green |
---|
| 679 | else |
---|
| 680 | set(handles.text_cav2_PR4,'BackgroundColor', [1 0 0]); %red |
---|
| 681 | end |
---|
| 682 | |
---|
| 683 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 684 | |
---|
| 685 | rep = tango_read_attributes2('ANS-C03/RF/PM.2', {'acqHighResolutionCh1', 'acqHighResolutionCh2', 'acqHighResolutionCh3', ... |
---|
| 686 | 'acqHighResolutionCh4'}); |
---|
| 687 | Data.PM2.DataHR1 = rep(1).value; |
---|
| 688 | Data.PM2.DataHR2 = rep(2).value; |
---|
| 689 | Data.PM2.DataHR3 = rep(3).value; |
---|
| 690 | Data.PM2.DataHR4 = rep(4).value; |
---|
| 691 | |
---|
| 692 | Data.PM2.TimestampHR = tango_shift_time(rep(1).time); |
---|
| 693 | |
---|
| 694 | reptrig2 = tango_read_attribute2('ANS-C03/RF/PM.2','triggerTimestamp'); |
---|
| 695 | Data.PM2.triggerTimestamp = reptrig2.value; |
---|
| 696 | |
---|
| 697 | [NbrColumn,NbrPoint3] = size (Data.PM2.DataHR1); |
---|
| 698 | |
---|
| 699 | axes(handles.graph2); |
---|
| 700 | |
---|
| 701 | name2='_AcRAPIDE' |
---|
| 702 | |
---|
| 703 | %pnt=1:10000; |
---|
| 704 | pnt=1:NbrPoint3; |
---|
| 705 | |
---|
| 706 | hold off; |
---|
| 707 | plot(pnt, Data.PM2.DataHR1,'b'); hold on; grid on; |
---|
| 708 | plot(pnt, Data.PM2.DataHR2,'r'); |
---|
| 709 | plot(pnt, Data.PM2.DataHR3,'g'); |
---|
| 710 | plot(pnt, Data.PM2.DataHR4,'k'); |
---|
| 711 | legend('Ac. Rapide CH1: Vcav', 'Ac. Rapide CH2: Pi','Ac. Rapide CH3: Pr','Ac. Rapide CH4: Ib'); |
---|
| 712 | xlabel('nombre de points (temps: 1 us par point)'); |
---|
| 713 | ylabel('Signal'); |
---|
| 714 | |
---|
| 715 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 716 | |
---|
| 717 | set(handles.text_cav2_PI,'String','Pi'); |
---|
| 718 | set(handles.text_cav2_PSS,'String','PSS Sec'); |
---|
| 719 | set(handles.text_cav2_uC,'String','uC'); |
---|
| 720 | |
---|
| 721 | repPSS = tango_read_attribute2('ANS-C03/RF/LLE.2','pssSecurity'); |
---|
| 722 | %rep = tango_read_attributes2('ANS-C03/RF/AMP.2-DATA', {'incidentPowerSecurity','pssSecurity','microcontrollerSecurity'}); |
---|
| 723 | rep = tango_read_attributes2('ANS-C03/RF/AMP.2-DATA', {'incidentPowerSecurity','microcontrollerSecurity'}); |
---|
| 724 | |
---|
| 725 | Data.AMP2.incidentPowerSecurity = rep(1).value; |
---|
| 726 | Data.AMP2.pssSecurity = repPSS.value; |
---|
| 727 | Data.AMP2.microcontrollerSecurity=rep(2).value; |
---|
| 728 | |
---|
| 729 | if Data.AMP2.incidentPowerSecurity |
---|
| 730 | set(handles.text_cav2_PI,'BackgroundColor', [0 1 0]); %green |
---|
| 731 | else |
---|
| 732 | set(handles.text_cav2_PI,'BackgroundColor', [1 0 0]); %red |
---|
| 733 | end |
---|
| 734 | |
---|
| 735 | if Data.AMP2.pssSecurity |
---|
| 736 | set(handles.text_cav2_PSS,'BackgroundColor', [0 1 0]); %green |
---|
| 737 | else |
---|
| 738 | set(handles.text_cav2_PSS,'BackgroundColor', [1 0 0]); %red |
---|
| 739 | end |
---|
| 740 | |
---|
| 741 | if Data.AMP2.microcontrollerSecurity |
---|
| 742 | set(handles.text_cav2_uC,'BackgroundColor', [0 1 0]); %green |
---|
| 743 | else |
---|
| 744 | set(handles.text_cav2_uC,'BackgroundColor', [1 0 0]); %red |
---|
| 745 | end |
---|
| 746 | |
---|
| 747 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 748 | |
---|
| 749 | set(handles.text_cav2_InterLCKmach,'String','Interlck MACH'); |
---|
| 750 | set(handles.text_cav2_VAC,'String','VAC'); |
---|
| 751 | set(handles.text_cav2_CRYO,'String','CRYO'); |
---|
| 752 | |
---|
| 753 | repINTER = tango_read_attribute2('ANS-C03/RF/LLE.2','machineSecurity'); |
---|
| 754 | %rep = tango_read_attributes2('ANS-C03/RF/CAV.2', {'interlock','vacuumSecurity','cryomoduleSecurity'}); |
---|
| 755 | rep = tango_read_attributes2('ANS-C03/RF/CAV.2', {'vacuumSecurity','cryomoduleSecurity'}); |
---|
| 756 | |
---|
| 757 | Data.CAV2.interlock = repINTER.value; |
---|
| 758 | %Data.CAV2.interlock = rep(1).value; |
---|
| 759 | Data.CAV2.vacuum = rep(1).value; |
---|
| 760 | Data.CAV2.cryo = rep(2).value; |
---|
| 761 | |
---|
| 762 | if Data.CAV2.interlock |
---|
| 763 | set(handles.text_cav2_InterLCKmach,'BackgroundColor', [0 1 0]); %green |
---|
| 764 | else |
---|
| 765 | %disp (Data.CAV2.interlock); |
---|
| 766 | set(handles.text_cav2_InterLCKmach,'BackgroundColor', [1 0 0]); %red |
---|
| 767 | end |
---|
| 768 | |
---|
| 769 | if Data.CAV2.vacuum |
---|
| 770 | %disp (Data.CAV2.vacuum); |
---|
| 771 | set(handles.text_cav2_VAC,'BackgroundColor', [0 1 0]); %green |
---|
| 772 | else |
---|
| 773 | %disp (Data.CAV2.vacuum) |
---|
| 774 | set(handles.text_cav2_VAC,'BackgroundColor', [1 0 0]); %red |
---|
| 775 | end |
---|
| 776 | |
---|
| 777 | if Data.CAV2.cryo |
---|
| 778 | %disp (Data.CAV2.cryo); |
---|
| 779 | set(handles.text_cav2_CRYO,'BackgroundColor', [0 1 0]); %green |
---|
| 780 | else |
---|
| 781 | %disp (Data.CAV2.vacuum) |
---|
| 782 | set(handles.text_cav2_CRYO,'BackgroundColor', [1 0 0]); %red |
---|
| 783 | end |
---|
| 784 | |
---|
| 785 | %+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% |
---|
| 786 | |
---|
| 787 | DirectoryName = getfamilydata('Directory', 'RFPostmortem'); |
---|
| 788 | %FileName = appendtimestamp('RFdata_CAV2', Data.PM2.TimestampHR); |
---|
| 789 | %comment% FileName = appendtimestamp('RFdata_CAV2', Data.PM2.triggerTimestamp); |
---|
| 790 | %disp (Data.PM2.triggerTimestamp); |
---|
| 791 | %disp (datevec(Data.PM2.triggerTimestamp)); |
---|
| 792 | %FileName = appendtimestamp('RFdata_CAV2', Data.PM2.triggerTimestamp); |
---|
| 793 | FileName =['RFdata_CAV2_', Data.PM2.triggerTimestamp]; |
---|
| 794 | |
---|
| 795 | [token,remain]=strtok(FileName); |
---|
| 796 | res=datevec(remain); |
---|
| 797 | resp1=num2str(res(1)); |
---|
| 798 | resp2=num2str(res(2)); |
---|
| 799 | resp3=num2str(res(3)); |
---|
| 800 | resp4=num2str(res(4)); |
---|
| 801 | resp5=num2str(res(5)); |
---|
| 802 | resp6=num2str(res(6)); |
---|
| 803 | FileNameLAST2=strcat('RFdata_CAV2','_',resp1,'-',resp2,'-',resp3,'_',resp4,'h',resp5,'mn',resp6,'s'); |
---|
| 804 | disp (FileNameLAST2); |
---|
| 805 | |
---|
| 806 | %FileName = strcat(FileName,name2); |
---|
| 807 | %button group |
---|
| 808 | [FileNameLAST2, DirectoryName] = uiputfile('*.mat', 'Select File (Cancel to not save to a file)', [DirectoryName FileNameLAST2, '.mat']); |
---|
| 809 | if FileNameLAST2 == 0 |
---|
| 810 | disp(' No data saved'); |
---|
| 811 | return; |
---|
| 812 | %RFdata_2007-10-10_13-48-23.mat |
---|
| 813 | end |
---|
| 814 | |
---|
| 815 | DirStart = pwd; |
---|
| 816 | [DirectoryName, ErrorFlag] = gotodirectory(DirectoryName); |
---|
| 817 | save(FileNameLAST2, 'Data'); |
---|
| 818 | cd(DirStart); |
---|
| 819 | fprintf(' Data saved to %s\n', [DirectoryName FileNameLAST2]); |
---|
| 820 | |
---|
| 821 | setappdata(handles.figure1, 'RFdata_CAV2', Data); |
---|
| 822 | |
---|
| 823 | |
---|
| 824 | end |
---|
| 825 | |
---|
| 826 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 827 | |
---|
| 828 | % --- Executes on button press in pushbutton_cav2_OPEN. |
---|
| 829 | function pushbutton_cav2_OPEN_Callback(hObject, eventdata, handles) |
---|
| 830 | % hObject handle to pushbutton_cav2_OPEN (see GCBO) |
---|
| 831 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 832 | % handles structure with handles and user data (see GUIDATA) |
---|
| 833 | |
---|
| 834 | DirectoryName = getfamilydata('Directory', 'RFPostmortem'); |
---|
| 835 | |
---|
| 836 | DirStart = pwd; |
---|
| 837 | DirectoryName = gotodirectory(DirectoryName); |
---|
| 838 | [FileName, DirectoryName] = uigetfile('*.mat', 'Select File (Cancel to not save to a file)','RFdata_CAV2*'); |
---|
| 839 | |
---|
| 840 | global DirectoryNameGlobal; |
---|
| 841 | DirectoryNameGlobal=DirectoryName; |
---|
| 842 | global FileNameGlobal; |
---|
| 843 | FileNameGlobal=FileName; |
---|
| 844 | |
---|
| 845 | if FileName == 0 |
---|
| 846 | msgbox('No file chosen','Info','warn'); |
---|
| 847 | %disp(' No file chosen'); |
---|
| 848 | return; |
---|
| 849 | else |
---|
| 850 | load(FileName, 'Data'); |
---|
| 851 | end |
---|
| 852 | cd(DirStart); |
---|
| 853 | |
---|
| 854 | setappdata(handles.figure1, 'RFdata_CAV2', Data); |
---|
| 855 | |
---|
| 856 | %disp (Data.PM2.DataLR); |
---|
| 857 | |
---|
| 858 | |
---|
| 859 | |
---|
| 860 | if Data.AMP2.reflectedPowerSecurityT1 |
---|
| 861 | set(handles.text_cav2_PR1,'BackgroundColor', [0 1 0]); %green |
---|
| 862 | else |
---|
| 863 | set(handles.text_cav2_PR1,'BackgroundColor', [1 0 0]); %red |
---|
| 864 | end |
---|
| 865 | |
---|
| 866 | if Data.AMP2.reflectedPowerSecurityT2 |
---|
| 867 | set(handles.text_cav2_PR2,'BackgroundColor', [0 1 0]); %green |
---|
| 868 | else |
---|
| 869 | set(handles.text_cav2_PR2,'BackgroundColor', [1 0 0]); %red |
---|
| 870 | end |
---|
| 871 | |
---|
| 872 | if Data.AMP2.reflectedPowerSecurityT3 |
---|
| 873 | set(handles.text_cav2_PR3,'BackgroundColor', [0 1 0]); %green |
---|
| 874 | else |
---|
| 875 | set(handles.text_cav2_PR3,'BackgroundColor', [1 0 0]); %red |
---|
| 876 | end |
---|
| 877 | |
---|
| 878 | if Data.AMP2.reflectedPowerSecurityT4 |
---|
| 879 | set(handles.text_cav2_PR4,'BackgroundColor', [0 1 0]); %green |
---|
| 880 | else |
---|
| 881 | set(handles.text_cav2_PR4,'BackgroundColor', [1 0 0]); %red |
---|
| 882 | end |
---|
| 883 | |
---|
| 884 | |
---|
| 885 | |
---|
| 886 | if Data.AMP2.incidentPowerSecurity |
---|
| 887 | set(handles.text_cav2_PI,'BackgroundColor', [0 1 0]); %green |
---|
| 888 | else |
---|
| 889 | set(handles.text_cav2_PI,'BackgroundColor', [1 0 0]); %red |
---|
| 890 | end |
---|
| 891 | |
---|
| 892 | if Data.AMP2.pssSecurity |
---|
| 893 | set(handles.text_cav2_PSS,'BackgroundColor', [0 1 0]); %green |
---|
| 894 | else |
---|
| 895 | set(handles.text_cav2_PSS,'BackgroundColor', [1 0 0]); %red |
---|
| 896 | end |
---|
| 897 | |
---|
| 898 | if Data.AMP2.microcontrollerSecurity |
---|
| 899 | set(handles.text_cav2_uC,'BackgroundColor', [0 1 0]); %green |
---|
| 900 | else |
---|
| 901 | set(handles.text_cav2_uC,'BackgroundColor', [1 0 0]); %red |
---|
| 902 | end |
---|
| 903 | |
---|
| 904 | if Data.CAV2.interlock |
---|
| 905 | set(handles.text_cav2_InterLCKmach,'BackgroundColor', [0 1 0]); %green |
---|
| 906 | else |
---|
| 907 | set(handles.text_cav2_InterLCKmach,'BackgroundColor', [1 0 0]); %red |
---|
| 908 | end |
---|
| 909 | |
---|
| 910 | if Data.CAV2.vacuum |
---|
| 911 | set(handles.text_cav2_VAC,'BackgroundColor', [0 1 0]); %green |
---|
| 912 | else |
---|
| 913 | set(handles.text_cav2_VAC,'BackgroundColor', [1 0 0]); %red |
---|
| 914 | end |
---|
| 915 | |
---|
| 916 | if Data.CAV2.cryo |
---|
| 917 | set(handles.text_cav2_CRYO,'BackgroundColor', [0 1 0]); %green |
---|
| 918 | else |
---|
| 919 | set(handles.text_cav2_CRYO,'BackgroundColor', [1 0 0]); %red |
---|
| 920 | end |
---|
| 921 | |
---|
| 922 | axes(handles.graph2); |
---|
| 923 | |
---|
| 924 | |
---|
| 925 | [NbrColumn,NbrPoint4] = size (Data.PM2.DataHR1); |
---|
| 926 | |
---|
| 927 | %//Data.PM2.DataHR1 = -(Data.PM2.DataHR1/5)*10^6; |
---|
| 928 | %//Data.PM2.DataHR2 = ((0.0361 + 0.2542*Data.PM2.DataHR2 - 0.0112*Data.PM2.DataHR2.^2 + 0.0011*Data.PM2.DataHR2.^3).^2/50)*3.0*10^7; |
---|
| 929 | %//Data.PM2.DataHR3 = ((0.0361 + 0.2542*Data.PM2.DataHR3 - 0.0112*Data.PM2.DataHR3.^2 + 0.0011*Data.PM2.DataHR3.^3).^2/50)*10.5*10^5; |
---|
| 930 | %//Data.PM2.DataHR4 = (Data.PM2.DataHR4)*10^4; |
---|
| 931 | |
---|
| 932 | hold off; |
---|
| 933 | %hold on; grid on; |
---|
| 934 | |
---|
| 935 | pnt=[1:NbrPoint4]; |
---|
| 936 | |
---|
| 937 | %//pnt1=1:10000; |
---|
| 938 | %//pnt2=1:10000; |
---|
| 939 | %[haxes,hline1,hline2,hline3]=plotyy(pnt,Data.PM2.DataHR1,pnt,Data.PM2.DataHR2,pnt,Data.PM2.DataHR3); |
---|
| 940 | %[haxes,hline1,hline2]=plotyy(pnt,Data.PM2.DataHR1,pnt,Data.PM2.DataHR2); |
---|
| 941 | %//[haxes,hline1,hline2]=plotyy(pnt1,Data.PM2.DataHR1,pnt2,Data.PM2.DataHR2,'plot'); |
---|
| 942 | %//set(hline1,'Color','b'); |
---|
| 943 | %//set(hline2,'Color','r'); |
---|
| 944 | %[haxes,hline3,hline4]=plotyy(pnt,Data.PM2.DataHR3,pnt,Data.PM2.DataHR4); |
---|
| 945 | plot(pnt, Data.PM2.DataHR1,'b'); hold on; grid on; |
---|
| 946 | plot(pnt, Data.PM2.DataHR2,'r'); |
---|
| 947 | plot(pnt, Data.PM2.DataHR3,'g'); |
---|
| 948 | plot(pnt, Data.PM2.DataHR4,'k'); |
---|
| 949 | legend('Ac. Rapide CH1: Vcav', 'Ac. Rapide CH2: Pi','Ac. Rapide CH3: Pr','Ac. Rapide CH4: Ib'); |
---|
| 950 | %%legend('Ac. Rapide CH1: Vcav', 'Ac. Rapide CH2: Pi'); |
---|
| 951 | xlabel('nombre de points (temps: 1 us par point)'); |
---|
| 952 | %//axes(haxes(1)); |
---|
| 953 | %//axis auto; |
---|
| 954 | %zoom on; |
---|
| 955 | %ylabel('Vcav [V]','Color','b'); |
---|
| 956 | %//ylabel('Vcav [V]'); |
---|
| 957 | ylabel('Signal'); |
---|
| 958 | %//LegVcav=legend('Ac. Rapide CH1: Vcav'); |
---|
| 959 | %//set(LegVcav,'Location','NorthWest'); |
---|
| 960 | %set(LegVcav,'background','g'); |
---|
| 961 | %//axes(haxes(2)); |
---|
| 962 | %//axis auto; |
---|
| 963 | %axes(h,'Color','b'); |
---|
| 964 | %//ylabel('Power [Watts]'); |
---|
| 965 | %//hold on; grid on; |
---|
| 966 | %//plot(pnt2,Data.PM2.DataHR3,'y'); |
---|
| 967 | |
---|
| 968 | %hold on; grid on; |
---|
| 969 | %//plot(pnt2, Data.PM2.DataHR4,'k'); |
---|
| 970 | %//LegPuissance=legend('Ac. Rapide CH2: Pi','Ac. Rapide CH3: Pr','Ac. Rapide CH4: Ib'); |
---|
| 971 | %legend('Ac. Rapide CH4: Ib'); |
---|
| 972 | %ylabel('Signal'); |
---|
| 973 | text(1000,0.5,Data.PM2.triggerTimestamp); |
---|
| 974 | |
---|
| 975 | |
---|
| 976 | %SAVED |
---|
| 977 | %hold off; |
---|
| 978 | %pnt=1:10000; |
---|
| 979 | %plot(pnt, Data.PM2.DataHR1,'b'); hold on; grid on; |
---|
| 980 | %plot(pnt, Data.PM2.DataHR2,'r'); |
---|
| 981 | %plot(pnt, Data.PM2.DataHR3,'g'); |
---|
| 982 | %plot(pnt, Data.PM2.DataHR4,'k'); |
---|
| 983 | %legend('Ac. Rapide CH1: Vcav', 'Ac. Rapide CH2: Pi','Ac. Rapide CH3: Pr','Ac. Rapide CH4: Ib'); |
---|
| 984 | %text(1000,0.5,Data.PM2.triggerTimestamp); |
---|
| 985 | %xlabel('nombre de points (temps: 1 us par point)'); |
---|
| 986 | %ylabel('Signal'); |
---|
| 987 | |
---|
| 988 | |
---|
| 989 | |
---|
| 990 | |
---|
| 991 | |
---|
| 992 | |
---|
| 993 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 994 | |
---|
| 995 | % --- Executes on button press in pushbutton_cav2_clear. |
---|
| 996 | function pushbutton_cav2_clear_Callback(hObject, eventdata, handles) |
---|
| 997 | % hObject handle to pushbutton_cav2_clear (see GCBO) |
---|
| 998 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 999 | % handles structure with handles and user data (see GUIDATA) |
---|
| 1000 | |
---|
| 1001 | axes(handles.graph2); |
---|
| 1002 | hold off; |
---|
| 1003 | plot(NaN); |
---|
| 1004 | |
---|
| 1005 | set(handles.text_cav2_PR1,'BackgroundColor', [0.702 0.702 0.702]); %gray |
---|
| 1006 | set(handles.text_cav2_PR2,'BackgroundColor', [0.702 0.702 0.702]); %gray |
---|
| 1007 | set(handles.text_cav2_PR3,'BackgroundColor', [0.702 0.702 0.702]); %gray |
---|
| 1008 | set(handles.text_cav2_PR4,'BackgroundColor', [0.702 0.702 0.702]); %gray |
---|
| 1009 | |
---|
| 1010 | set(handles.text_cav2_PI,'BackgroundColor', [0.702 0.702 0.702]); %gray |
---|
| 1011 | set(handles.text_cav2_PSS,'BackgroundColor', [0.702 0.702 0.702]); %gray |
---|
| 1012 | set(handles.text_cav2_uC,'BackgroundColor', [0.702 0.702 0.702]); %gray |
---|
| 1013 | |
---|
| 1014 | set(handles.text_cav2_InterLCKmach,'BackgroundColor', [0.702 0.702 0.702]); %gray |
---|
| 1015 | set(handles.text_cav2_VAC,'BackgroundColor', [0.702 0.702 0.702]); %gray |
---|
| 1016 | set(handles.text_cav2_CRYO,'BackgroundColor', [0.702 0.702 0.702]); %gray |
---|
| 1017 | |
---|
| 1018 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 1019 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 1020 | |
---|
| 1021 | % --- Executes on button press in pushbutton_RESET_cav2. |
---|
| 1022 | function pushbutton_RESET_cav2_Callback(hObject, eventdata, handles) |
---|
| 1023 | % hObject handle to pushbutton_RESET_cav2 (see GCBO) |
---|
| 1024 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 1025 | % handles structure with handles and user data (see GUIDATA) |
---|
| 1026 | |
---|
| 1027 | statusAcquisition_cav2=tango_read_attribute2('ANS-C03/RF/PM.2','Status'); |
---|
| 1028 | text=statusAcquisition_cav2.value; |
---|
| 1029 | if findstr(text, 'running') |
---|
| 1030 | %%set(handles.pushbutton_RESET_cav2,'String','NO need reset, Device is Running'); |
---|
| 1031 | msgbox('Un reset a déjà été fait, le device fonctionne Normalement','Info','warn'); |
---|
| 1032 | return; |
---|
| 1033 | else |
---|
| 1034 | set(handles.pushbutton_RESET_cav2,'Tag','pushbutton_RESET_cav2'); |
---|
| 1035 | %tango_command_inout2('ANS-C03/RF/PM.2','Init'); |
---|
| 1036 | tango_command_inout2('ANS-C03/RF/PM.2','Start'); |
---|
| 1037 | |
---|
| 1038 | fid=0; |
---|
| 1039 | filenameRES='/home/operateur/GrpRF/Nicolas/SUIVIreset'; |
---|
| 1040 | %filenameRES='TESTres'; |
---|
| 1041 | fid=fopen(filenameRES,'a+'); |
---|
| 1042 | %disp (fid); |
---|
| 1043 | %disp ('2'); |
---|
| 1044 | %valeurTEST='test11111'; |
---|
| 1045 | valeurTEST=datestr(clock,0); |
---|
| 1046 | |
---|
| 1047 | fprintf(fid,'Reset CAV2 at: %s \n',valeurTEST); |
---|
| 1048 | fclose(fid); |
---|
| 1049 | end |
---|
| 1050 | |
---|
| 1051 | %tango_command_inout2('ANS-C03/RF/PM.2','Stop'); %NE PAS OUBLIER D'ENLEVER CETTE LIGNE APRES TEST |
---|
| 1052 | |
---|
| 1053 | |
---|
| 1054 | % --- Executes on button press in pushbutton12. |
---|
| 1055 | function pushbutton12_Callback(hObject, eventdata, handles) |
---|
| 1056 | % hObject handle to pushbutton12 (see GCBO) |
---|
| 1057 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 1058 | % handles structure with handles and user data (see GUIDATA) |
---|
| 1059 | |
---|
| 1060 | |
---|
| 1061 | function edit2_Callback(hObject, eventdata, handles) |
---|
| 1062 | % hObject handle to edit2 (see GCBO) |
---|
| 1063 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 1064 | % handles structure with handles and user data (see GUIDATA) |
---|
| 1065 | |
---|
| 1066 | % Hints: get(hObject,'String') returns contents of edit2 as text |
---|
| 1067 | % str2double(get(hObject,'String')) returns contents of edit2 as a double |
---|
| 1068 | |
---|
| 1069 | |
---|
| 1070 | % --- Executes during object creation, after setting all properties. |
---|
| 1071 | function edit2_CreateFcn(hObject, eventdata, handles) |
---|
| 1072 | % hObject handle to edit2 (see GCBO) |
---|
| 1073 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 1074 | % handles empty - handles not created until after all CreateFcns called |
---|
| 1075 | |
---|
| 1076 | % Hint: edit controls usually have a white background on Windows. |
---|
| 1077 | % See ISPC and COMPUTER. |
---|
| 1078 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
| 1079 | set(hObject,'BackgroundColor','white'); |
---|
| 1080 | end |
---|
| 1081 | |
---|
| 1082 | |
---|
| 1083 | |
---|
| 1084 | function edit3_Callback(hObject, eventdata, handles) |
---|
| 1085 | % hObject handle to edit3 (see GCBO) |
---|
| 1086 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 1087 | % handles structure with handles and user data (see GUIDATA) |
---|
| 1088 | |
---|
| 1089 | % Hints: get(hObject,'String') returns contents of edit3 as text |
---|
| 1090 | % str2double(get(hObject,'String')) returns contents of edit3 as a double |
---|
| 1091 | |
---|
| 1092 | |
---|
| 1093 | % --- Executes during object creation, after setting all properties. |
---|
| 1094 | function edit3_CreateFcn(hObject, eventdata, handles) |
---|
| 1095 | % hObject handle to edit3 (see GCBO) |
---|
| 1096 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 1097 | % handles empty - handles not created until after all CreateFcns called |
---|
| 1098 | |
---|
| 1099 | % Hint: edit controls usually have a white background on Windows. |
---|
| 1100 | % See ISPC and COMPUTER. |
---|
| 1101 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
| 1102 | set(hObject,'BackgroundColor','white'); |
---|
| 1103 | end |
---|
| 1104 | |
---|
| 1105 | |
---|
| 1106 | |
---|
| 1107 | function edit5_Callback(hObject, eventdata, handles) |
---|
| 1108 | % hObject handle to edit5 (see GCBO) |
---|
| 1109 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 1110 | % handles structure with handles and user data (see GUIDATA) |
---|
| 1111 | |
---|
| 1112 | % Hints: get(hObject,'String') returns contents of edit5 as text |
---|
| 1113 | % str2double(get(hObject,'String')) returns contents of edit5 as a double |
---|
| 1114 | |
---|
| 1115 | |
---|
| 1116 | % --- Executes during object creation, after setting all properties. |
---|
| 1117 | function edit5_CreateFcn(hObject, eventdata, handles) |
---|
| 1118 | % hObject handle to edit5 (see GCBO) |
---|
| 1119 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 1120 | % handles empty - handles not created until after all CreateFcns called |
---|
| 1121 | |
---|
| 1122 | % Hint: edit controls usually have a white background on Windows. |
---|
| 1123 | % See ISPC and COMPUTER. |
---|
| 1124 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
| 1125 | set(hObject,'BackgroundColor','white'); |
---|
| 1126 | end |
---|
| 1127 | |
---|
| 1128 | |
---|
| 1129 | |
---|
| 1130 | function edit6_Callback(hObject, eventdata, handles) |
---|
| 1131 | % hObject handle to edit6 (see GCBO) |
---|
| 1132 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 1133 | % handles structure with handles and user data (see GUIDATA) |
---|
| 1134 | |
---|
| 1135 | % Hints: get(hObject,'String') returns contents of edit6 as text |
---|
| 1136 | % str2double(get(hObject,'String')) returns contents of edit6 as a double |
---|
| 1137 | |
---|
| 1138 | |
---|
| 1139 | % --- Executes during object creation, after setting all properties. |
---|
| 1140 | function edit6_CreateFcn(hObject, eventdata, handles) |
---|
| 1141 | % hObject handle to edit6 (see GCBO) |
---|
| 1142 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 1143 | % handles empty - handles not created until after all CreateFcns called |
---|
| 1144 | |
---|
| 1145 | % Hint: edit controls usually have a white background on Windows. |
---|
| 1146 | % See ISPC and COMPUTER. |
---|
| 1147 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
---|
| 1148 | set(hObject,'BackgroundColor','white'); |
---|
| 1149 | end |
---|
| 1150 | |
---|
| 1151 | |
---|
| 1152 | % --- Executes on button press in pushbutton15. |
---|
| 1153 | function pushbutton15_Callback(hObject, eventdata, handles) |
---|
| 1154 | % hObject handle to pushbutton15 (see GCBO) |
---|
| 1155 | % eventdata reserved - to be defined in a future version of MATLAB |
---|
| 1156 | % handles structure with handles and user data (see GUIDATA) |
---|
| 1157 | |
---|
| 1158 | valmax=1; |
---|
| 1159 | valmin=0; |
---|
| 1160 | |
---|
| 1161 | valminINIT=get(handles.edit5,'String'); |
---|
| 1162 | valmin=str2num(valminINIT{1}); |
---|
| 1163 | valmaxINIT=get(handles.edit6,'String'); |
---|
| 1164 | valmax=str2num(valmaxINIT{1}); |
---|
| 1165 | |
---|
| 1166 | n=valmax-valmin+1; |
---|
| 1167 | i=1; |
---|
| 1168 | |
---|
| 1169 | global DirectoryNameGlobal; |
---|
| 1170 | disp ('DirectoryNameGlobal'); |
---|
| 1171 | gotodirectory(DirectoryNameGlobal); |
---|
| 1172 | |
---|
| 1173 | global FileNameGlobal; |
---|
| 1174 | load(FileNameGlobal, 'Data'); |
---|
| 1175 | |
---|
| 1176 | %//Data.PM2.DataHR1 = -(Data.PM2.DataHR1/5)*10^6; |
---|
| 1177 | %//Data.PM2.DataHR2 = ((0.0361 + 0.2542*Data.PM2.DataHR2 - 0.0112*Data.PM2.DataHR2.^2 + 0.0011*Data.PM2.DataHR2.^3).^2/50)*3.0*10^7; |
---|
| 1178 | %//Data.PM2.DataHR3 = ((0.0361 + 0.2542*Data.PM2.DataHR3 - 0.0112*Data.PM2.DataHR3.^2 + 0.0011*Data.PM2.DataHR3.^3).^2/50)*10.5*10^5; |
---|
| 1179 | %//Data.PM2.DataHR4 = (Data.PM2.DataHR4)*10^4; |
---|
| 1180 | |
---|
| 1181 | for i=1:n |
---|
| 1182 | Data.PM2.DataHR1(valmin+i-1)=-((Data.PM2.DataHR1(valmin+i-1))/5)*10^2; |
---|
| 1183 | Data.PM2.DataHR2(valmin+i-1)=((0.0361 + 0.2542*Data.PM2.DataHR2(valmin+i-1) - 0.0112*Data.PM2.DataHR2(valmin+i-1).^2 + 0.0011*Data.PM2.DataHR2(valmin+i-1).^3).^2/50)*3.0*10^4; |
---|
| 1184 | Data.PM2.DataHR3(valmin+i-1)=((0.0361 + 0.2542*Data.PM2.DataHR3(valmin+i-1) - 0.0112*Data.PM2.DataHR3(valmin+i-1).^2 + 0.0011*Data.PM2.DataHR3(valmin+i-1).^3).^2/50)*10.5*10^2; |
---|
| 1185 | Data.PM2.DataHR4(valmin+i-1)=(Data.PM2.DataHR4(valmin+i-1))*10^2; |
---|
| 1186 | end |
---|
| 1187 | |
---|
| 1188 | maxHR1=max(Data.PM2.DataHR1); |
---|
| 1189 | maxHR2=max(Data.PM2.DataHR2); |
---|
| 1190 | maxHR3=max(Data.PM2.DataHR3); |
---|
| 1191 | maxHR4=max(Data.PM2.DataHR4); |
---|
| 1192 | minHR1=min(Data.PM2.DataHR1); |
---|
| 1193 | minHR2=min(Data.PM2.DataHR2); |
---|
| 1194 | minHR3=min(Data.PM2.DataHR3); |
---|
| 1195 | minHR4=min(Data.PM2.DataHR4); |
---|
| 1196 | |
---|
| 1197 | if (maxHR2(1)>maxHR3(1)) |
---|
| 1198 | max1=maxHR2(1) |
---|
| 1199 | else max1=maxHR3(1); |
---|
| 1200 | end |
---|
| 1201 | if (max1<maxHR4(1)) |
---|
| 1202 | max1=maxHR4(1); |
---|
| 1203 | end |
---|
| 1204 | |
---|
| 1205 | if (minHR2(1)<minHR3(1)) |
---|
| 1206 | min1=minHR2(1) |
---|
| 1207 | else min1=minHR3(1); |
---|
| 1208 | end |
---|
| 1209 | if (min1>minHR4(1)) |
---|
| 1210 | min1=minHR4(1); |
---|
| 1211 | end |
---|
| 1212 | |
---|
| 1213 | minHR1app=minHR1(1); |
---|
| 1214 | maxHR1app=maxHR1(1); |
---|
| 1215 | |
---|
| 1216 | if (minHR1app<min1) |
---|
| 1217 | mini=minHR1 |
---|
| 1218 | else |
---|
| 1219 | mini=min1 |
---|
| 1220 | end |
---|
| 1221 | |
---|
| 1222 | if (maxHR1app>max1) |
---|
| 1223 | maxi=maxHR1 |
---|
| 1224 | else |
---|
| 1225 | maxi=max1 |
---|
| 1226 | end |
---|
| 1227 | |
---|
| 1228 | axes(handles.graph2); |
---|
| 1229 | |
---|
| 1230 | hold off; |
---|
| 1231 | pnt=[valmin:valmax]; |
---|
| 1232 | axis([valmin valmax mini maxi]) |
---|
| 1233 | plot(Data.PM2.DataHR1,'b'); hold on; grid on; |
---|
| 1234 | axis([valmin valmax mini maxi]) |
---|
| 1235 | plot(Data.PM2.DataHR2,'r'); |
---|
| 1236 | plot(Data.PM2.DataHR3,'g'); |
---|
| 1237 | plot(Data.PM2.DataHR4,'k'); |
---|
| 1238 | legend('Ac. Rapide CH1: Vcav', 'Ac. Rapide CH2: Pi','Ac. Rapide CH3: Pr','Ac. Rapide CH4: Ib'); |
---|
| 1239 | xlabel('nombre de points (temps: 1 us par point)'); |
---|
| 1240 | ylabel('Signal'); |
---|
| 1241 | text(1000,0.5,Data.PM2.triggerTimestamp); |
---|