Commit cc52c00ac619e969acbf1e178cf7a35da3b014ae

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

Addedauxilliary data yrange control

GUI_drifter_cleanup.m
... ... @@ -22,7 +22,7 @@ function varargout = GUI_drifter_cleanup(varargin)
22 22  
23 23 % Edit the above text to modify the response to help GUI_drifter_cleanup
24 24  
25   -% Last Modified by GUIDE v2.5 10-Apr-2018 10:08:14
  25 +% Last Modified by GUIDE v2.5 10-Apr-2018 12:40:42
26 26  
27 27 % Begin initialization code - DO NOT EDIT
28 28 gui_Singleton = 1;
... ... @@ -82,6 +82,7 @@ function varargout = GUI_drifter_cleanup_OutputFcn(hObject, eventdata, handles)
82 82 % eventdata reserved - to be defined in a future version of MATLAB
83 83 % handles structure with handles and user data (see GUIDATA)
84 84  
  85 +
85 86 % Get default command line output from handles structure
86 87 varargout{1} = handles.output;
87 88  
... ... @@ -148,6 +149,10 @@ switch whatever
148 149 xlim([I0 If])
149 150 xlabel('Index')
150 151 ylabel('Speed (m/s)')
  152 + % update ylim
  153 + ylimits = get(gca,'YLim') ;
  154 + handles.edit_aux_ymax.String = num2str(ylimits(2)) ;
  155 + handles.edit_aux_ymin.String = num2str(ylimits(1)) ;
151 156 case 'Time'
152 157 axes(handles.ax_aux_data);
153 158 try delete(handles.aux_line) ; catch ; end
... ... @@ -156,6 +161,10 @@ switch whatever
156 161 xlabel('Index')
157 162 ylabel('Time (mm/dd)')
158 163 datetick('y','mm/dd') ;
  164 + % update ylim
  165 + ylimits = get(gca,'YLim') ;
  166 + handles.edit_aux_ymax.String = num2str(ylimits(2)) ;
  167 + handles.edit_aux_ymin.String = num2str(ylimits(1)) ;
159 168 case 'Distance'
160 169 axes(handles.ax_aux_data);
161 170 try delete(handles.aux_line) ; catch ; end
... ... @@ -164,6 +173,10 @@ switch whatever
164 173 xlim([I0 If])
165 174 xlabel('Index')
166 175 ylabel('Distance (km)')
  176 + % update ylim
  177 + ylimits = get(gca,'YLim') ;
  178 + handles.edit_aux_ymax.String = num2str(ylimits(2)) ;
  179 + handles.edit_aux_ymin.String = num2str(ylimits(1)) ;
167 180 case 'None'
168 181 axes(handles.ax_aux_data);
169 182 XL = handles.ax_aux_data.XLim;
... ... @@ -171,6 +184,10 @@ switch whatever
171 184 try delete(handles.aux_line) ; catch ; end
172 185 handles.ax_aux_data.XLim = XL ;
173 186 xlabel('Index')
  187 + % update ylim
  188 + ylimits = get(gca,'YLim') ;
  189 + handles.edit_aux_ymax.String = '' ;
  190 + handles.edit_aux_ymin.String = '' ;
174 191 end
175 192  
176 193 % Update handles structure
... ... @@ -243,3 +260,27 @@ function edit_get_time_step_CreateFcn(hObject, eventdata, handles)
243 260 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
244 261 set(hObject,'BackgroundColor','white');
245 262 end
  263 +
  264 +% --- Executes during object creation, after setting all properties.
  265 +function edit_aux_ymax_CreateFcn(hObject, eventdata, handles)
  266 +% hObject handle to edit_aux_ymax (see GCBO)
  267 +% eventdata reserved - to be defined in a future version of MATLAB
  268 +% handles empty - handles not created until after all CreateFcns called
  269 +
  270 +% Hint: edit controls usually have a white background on Windows.
  271 +% See ISPC and COMPUTER.
  272 +if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  273 + set(hObject,'BackgroundColor','white');
  274 +end
  275 +
  276 +% --- Executes during object creation, after setting all properties.
  277 +function edit_aux_ymin_CreateFcn(hObject, eventdata, handles)
  278 +% hObject handle to edit_aux_ymin (see GCBO)
  279 +% eventdata reserved - to be defined in a future version of MATLAB
  280 +% handles empty - handles not created until after all CreateFcns called
  281 +
  282 +% Hint: edit controls usually have a white background on Windows.
  283 +% See ISPC and COMPUTER.
  284 +if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  285 + set(hObject,'BackgroundColor','white');
  286 +end
... ...
lib/edit_aux_ymax_Callback.m 0 → 100644
... ... @@ -0,0 +1,16 @@
  1 +function edit_aux_ymax_Callback(hObject, eventdata, handles)
  2 +
  3 +ymax = str2num(handles.edit_aux_ymax.String) ;
  4 +ymin = str2num(handles.edit_aux_ymin.String) ;
  5 +
  6 +% Security
  7 +if ymax > ymin
  8 + handles.ax_aux_data.YLim = [ymin ymax] ;
  9 +else
  10 + handles.edit_aux_ymax.String = num2str(handles.ax_aux_data.YLim(2)) ;
  11 +end
  12 +
  13 +% Update handles structure
  14 +guidata(hObject, handles);
  15 +
  16 +end
0 17 \ No newline at end of file
... ...
lib/edit_aux_ymin_Callback.m 0 → 100644
... ... @@ -0,0 +1,16 @@
  1 +function edit_aux_ymin_Callback(hObject, eventdata, handles)
  2 +
  3 +ymax = str2num(handles.edit_aux_ymax.String) ;
  4 +ymin = str2num(handles.edit_aux_ymin.String) ;
  5 +
  6 +% Security
  7 +if ymax > ymin
  8 + handles.ax_aux_data.YLim = [ymin ymax] ;
  9 +else
  10 + handles.edit_aux_ymin.String = num2str(handles.ax_aux_data.YLim(1)) ;
  11 +end
  12 +
  13 +% Update handles structure
  14 +guidata(hObject, handles);
  15 +
  16 +end
0 17 \ No newline at end of file
... ...