Commit 48d36084559990d298964f32239fc98293df4bd5

Authored by Jean-Luc Shaw
1 parent ce1b9754
Exists in master

Added operation log.

GUI_drifter_cleanup.m
... ... @@ -232,17 +232,6 @@ if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgr
232 232 set(hObject,'BackgroundColor','white');
233 233 end
234 234  
235   -
236   -% --- Executes on button press in but_get_time_step.
237   -function but_get_time_step_Callback(hObject, eventdata, handles)
238   -% hObject handle to but_get_time_step (see GCBO)
239   -% eventdata reserved - to be defined in a future version of MATLAB
240   -% handles structure with handles and user data (see GUIDATA)
241   -
242   -
243   -
244   -
245   -
246 235 % --- Executes during object creation, after setting all properties.
247 236 function edit_get_time_step_CreateFcn(hObject, eventdata, handles)
248 237 % hObject handle to edit_get_time_step (see GCBO)
... ...
lib/but_bathy_filter_Callback.m
... ... @@ -9,10 +9,16 @@ if isfield(S,'z')
9 9 S.lat(I) = [] ;
10 10 S.dnum(I) = [] ;
11 11 S.z(I) = [] ;
12   - If = str2num(handles.edit_If.String) - numel(I) ;
13   - handles.edit_If.String = num2str(If) ;
  12 + If = str2num(handles.edit_If.String) ;
  13 + I0 = str2num(handles.edit_I0.String) ;
  14 + nIf = str2num(handles.edit_If.String) - numel(I) ;
  15 + handles.edit_If.String = num2str(nIf) ;
14 16 guidata(hObject, handles);
15 17 update_plots(hObject, eventdata, handles) ;
  18 +
  19 + % write to logfile
  20 + N = numel(S.dnum) ; % track size
  21 + fprintf(handles.logfid,'%s,%d,%d,%f,%d\n','bathy_filter',I0,If,zmin,N) ;
16 22 else
17 23 msgbox('No z computed for GPS track. Load bathymetry file!')
18 24 end
... ...
lib/but_delete_Callback.m
... ... @@ -10,6 +10,10 @@ S.lon(I0:If) = [];
10 10 S.lat(I0:If) = [];
11 11 S.dnum(I0:If) = [];
12 12  
  13 +% write to logfile
  14 +newN = numel(S.dnum) ; % track size
  15 +fprintf(handles.logfid,'%s,%d,%d,%f,%d\n','delete',I0,If,nan,newN) ;
  16 +
13 17 %% Update plots zooming out
14 18 N = numel(S.dnum) ;
15 19 I0 = 1 ;
... ...
lib/but_interpolate_Callback.m
... ... @@ -9,6 +9,10 @@ If = str2num(handles.edit_If.String);
9 9 tq = [S.dnum(I0):step:S.dnum(If)]' ;
10 10 iN = numel(tq) ;
11 11  
  12 +% write to logfile
  13 +newN = numel(S.dnum)-numel(I0:If)+iN ; % track size
  14 +fprintf(handles.logfid,'%s,%d,%d,%f,%d\n','interpolate',I0,If,step,newN) ;
  15 +
12 16 %% get interpolated coordinate values
13 17 ilon = interp1(S.dnum(I0:If),S.lon(I0:If),tq) ;
14 18 ilat = interp1(S.dnum(I0:If),S.lat(I0:If),tq) ;
... ...
lib/but_punch_out_Callback.m
... ... @@ -23,6 +23,10 @@ S.lat(I0:If) = [];
23 23 S.dnum(I0:If) = [];
24 24 if isfield(S,'z'); S.z(I0:If) = [] ; end
25 25  
  26 +% write to logfile
  27 +newN = numel(S.dnum) ; % track size
  28 +fprintf(handles.logfid,'%s,%d,%d,%f,%d\n','output',I0,If,cnt-1,newN) ;
  29 +
26 30 %% Update plots zooming out
27 31 N = numel(S.dnum) ;
28 32 I0 = 1 ;
... ...
lib/menu_files_Callback.m
... ... @@ -19,6 +19,12 @@ cnt = 0 ; % reset output punch counter
19 19 axes(handles.ax_track) ;
20 20 plot(S.lon,S.lat,'b',S.lon,S.lat,'ko')
21 21  
  22 +% Open a new logfile
  23 +if isfield(handles,'logfid') ; delete(handles.logfid) ; end % out with the old
  24 +logfid = fopen(['log/' file(1:end-4) '.log'],'w') ;
  25 +fprintf(logfid,'%s\n','Operation, I0, If, Parameter, New track size') ;
  26 +handles.logfid = logfid ; % in with the new
  27 +
22 28 % Update handles structure
23 29 guidata(hObject, handles);
24 30 end
25 31 \ No newline at end of file
... ...