ASCII2GIS_GUI M-file for ASCII2GIS_GUI.fig ASCII2GIS_GUI, by itself, creates a new ASCII2GIS_GUI or raises the existing singleton*. H = ASCII2GIS_GUI returns the handle to a new ASCII2GIS_GUI or the handle to the existing singleton*. ASCII2GIS_GUI('CALLBACK',hObject,eventData,handles,...) calls the local function named CALLBACK in ASCII2GIS_GUI.M with the given input arguments. ASCII2GIS_GUI('Property','Value',...) creates a new ASCII2GIS_GUI or raises the existing singleton*. Starting from the left, property value pairs are applied to the GUI before ASCII2GIS_GUI_OpeningFcn gets called. An unrecognized property name or invalid value makes property application stop. All inputs are passed to ASCII2GIS_GUI_OpeningFcn via varargin. *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one instance to run (singleton)". See also: GUIDE, GUIDATA, GUIHANDLES
0001 function varargout = ASCII2GIS_GUI(varargin) 0002 % ASCII2GIS_GUI M-file for ASCII2GIS_GUI.fig 0003 % ASCII2GIS_GUI, by itself, creates a new ASCII2GIS_GUI or raises the existing 0004 % singleton*. 0005 % 0006 % H = ASCII2GIS_GUI returns the handle to a new ASCII2GIS_GUI or the handle to 0007 % the existing singleton*. 0008 % 0009 % ASCII2GIS_GUI('CALLBACK',hObject,eventData,handles,...) calls the local 0010 % function named CALLBACK in ASCII2GIS_GUI.M with the given input arguments. 0011 % 0012 % ASCII2GIS_GUI('Property','Value',...) creates a new ASCII2GIS_GUI or raises the 0013 % existing singleton*. Starting from the left, property value pairs are 0014 % applied to the GUI before ASCII2GIS_GUI_OpeningFcn gets called. An 0015 % unrecognized property name or invalid value makes property application 0016 % stop. All inputs are passed to ASCII2GIS_GUI_OpeningFcn via varargin. 0017 % 0018 % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one 0019 % instance to run (singleton)". 0020 % 0021 % See also: GUIDE, GUIDATA, GUIHANDLES 0022 0023 % Edit the above text to modify the response to help ASCII2GIS_GUI 0024 0025 % Last Modified by GUIDE v2.5 29-Apr-2014 13:04:55 0026 0027 % Begin initialization code - DO NOT EDIT 0028 gui_Singleton = 1; 0029 gui_State = struct('gui_Name', mfilename, ... 0030 'gui_Singleton', gui_Singleton, ... 0031 'gui_OpeningFcn', @ASCII2GIS_GUI_OpeningFcn, ... 0032 'gui_OutputFcn', @ASCII2GIS_GUI_OutputFcn, ... 0033 'gui_LayoutFcn', [] , ... 0034 'gui_Callback', []); 0035 if nargin && ischar(varargin{1}) 0036 gui_State.gui_Callback = str2func(varargin{1}); 0037 end 0038 0039 if nargout 0040 [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); 0041 else 0042 gui_mainfcn(gui_State, varargin{:}); 0043 end 0044 % End initialization code - DO NOT EDIT 0045 0046 0047 % --- Executes just before ASCII2GIS_GUI is made visible. 0048 function ASCII2GIS_GUI_OpeningFcn(hObject, eventdata, handles, varargin) 0049 % This function has no output args, see OutputFcn. 0050 % hObject handle to figure 0051 % eventdata reserved - to be defined in a future version of MATLAB 0052 % handles structure with handles and user data (see GUIDATA) 0053 % varargin command line arguments to ASCII2GIS_GUI (see VARARGIN) 0054 0055 % Choose default command line output for ASCII2GIS_GUI 0056 handles.output = hObject; 0057 0058 % Update handles structure 0059 guidata(hObject, handles); 0060 0061 % Ensure path to utils & docs is available 0062 % ---------------------------------------- 0063 if ~isdeployed 0064 filesep = '\'; % windows 0065 utilspath = [pwd filesep 'utils']; 0066 docspath = [pwd filesep 'doc']; 0067 toolspath = [pwd filesep 'tools']; 0068 addpath(utilspath,docspath,toolspath) 0069 end 0070 0071 % UIWAIT makes ASCII2GIS_GUI wait for user response (see UIRESUME) 0072 % uiwait(handles.figure1); 0073 0074 0075 % --- Outputs from this function are returned to the command line. 0076 function varargout = ASCII2GIS_GUI_OutputFcn(hObject, eventdata, handles) 0077 % varargout cell array for returning output args (see VARARGOUT); 0078 % hObject handle to figure 0079 % eventdata reserved - to be defined in a future version of MATLAB 0080 % handles structure with handles and user data (see GUIDATA) 0081 0082 % Get default command line output from handles structure 0083 varargout{1} = handles.output; 0084 0085 %Initialize variables 0086 handles.dfslow = 0; 0087 handles.dfshi = 1; 0088 handles.hablim = 1; 0089 handles.DFSfull = 0; 0090 handles.units = 1; 0091 handles.ref = 1; 0092 handles.VelOut = []; 0093 handles.goodrows = []; 0094 handles.Ascale = 1.0; 0095 handles.Vspace = 1; 0096 handles.TAV = []; 0097 0098 guidata(hObject, handles); 0099 0100 0101 % --- Executes on button press in RunButton. 0102 function RunButton_Callback(hObject, eventdata, handles) 0103 % hObject handle to RunButton (see GCBO) 0104 % eventdata reserved - to be defined in a future version of MATLAB 0105 % handles structure with handles and user data (see GUIDATA) 0106 if handles.ref 0107 vref = 'dfs'; 0108 disp('Reference is set to DFS') 0109 if handles.DFSfull 0110 drange = []; 0111 disp('DFS Range set to Full Depth' ) 0112 else 0113 if handles.units 0114 drange = [handles.dfslow handles.dfshi]; 0115 disp(['DFS Range = ' num2str(drange(1)) ' to ' num2str(drange(2)) ' m']) 0116 else %units = Feet 0117 drange = [handles.dfslow handles.dfshi]./3.281; % Convert to meters 0118 disp(['DFS Range = ' num2str(drange(1)*3.281) ' to ' num2str(drange(2)*3.281) ' ft']) 0119 end 0120 end 0121 else 0122 vref = 'hab'; 0123 disp('Reference is set to HAB') 0124 if handles.units 0125 drange = handles.hablim; 0126 disp(['HAB Limit = ' num2str(drange) ' m']) 0127 else %units = Feet 0128 drange = handles.hablim./3.281; % Convert to meters 0129 disp(['HAB Limit = ' num2str(drange*3.281) ' ft']) 0130 end 0131 end 0132 0133 [handles.VelOut,handles.goodrows] = ASCII2GIS(drange,vref,handles.TAV); 0134 guidata(hObject,handles) 0135 0136 % --- Executes on button press in FullDepthcheckbox. 0137 function FullDepthcheckbox_Callback(hObject, eventdata, handles) 0138 % hObject handle to FullDepthcheckbox (see GCBO) 0139 % eventdata reserved - to be defined in a future version of MATLAB 0140 % handles structure with handles and user data (see GUIDATA) 0141 0142 % Hint: get(hObject,'Value') returns toggle state of FullDepthcheckbox 0143 handles.DFSfull = get(hObject,'Value'); 0144 guidata(hObject,handles) 0145 0146 0147 0148 0149 function DFSlow_Callback(hObject, eventdata, handles) 0150 % hObject handle to DFSlow (see GCBO) 0151 % eventdata reserved - to be defined in a future version of MATLAB 0152 % handles structure with handles and user data (see GUIDATA) 0153 0154 % Hints: get(hObject,'String') returns contents of DFSlow as text 0155 % str2double(get(hObject,'String')) returns contents of DFSlow as a double 0156 handles.dfslow = str2double(get(hObject,'String')); 0157 guidata(hObject,handles) 0158 0159 0160 0161 % --- Executes during object creation, after setting all properties. 0162 function DFSlow_CreateFcn(hObject, eventdata, handles) 0163 % hObject handle to DFSlow (see GCBO) 0164 % eventdata reserved - to be defined in a future version of MATLAB 0165 % handles empty - handles not created until after all CreateFcns called 0166 0167 % Hint: edit controls usually have a white background on Windows. 0168 % See ISPC and COMPUTER. 0169 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0170 set(hObject,'BackgroundColor','white'); 0171 end 0172 0173 0174 0175 function DFShi_Callback(hObject, eventdata, handles) 0176 % hObject handle to DFShi (see GCBO) 0177 % eventdata reserved - to be defined in a future version of MATLAB 0178 % handles structure with handles and user data (see GUIDATA) 0179 0180 % Hints: get(hObject,'String') returns contents of DFShi as text 0181 % str2double(get(hObject,'String')) returns contents of DFShi as a double 0182 handles.dfshi = str2double(get(hObject,'String')); 0183 guidata(hObject,handles) 0184 0185 0186 0187 % --- Executes during object creation, after setting all properties. 0188 function DFShi_CreateFcn(hObject, eventdata, handles) 0189 % hObject handle to DFShi (see GCBO) 0190 % eventdata reserved - to be defined in a future version of MATLAB 0191 % handles empty - handles not created until after all CreateFcns called 0192 0193 % Hint: edit controls usually have a white background on Windows. 0194 % See ISPC and COMPUTER. 0195 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0196 set(hObject,'BackgroundColor','white'); 0197 end 0198 0199 0200 0201 function HABlim_Callback(hObject, eventdata, handles) 0202 % hObject handle to HABlim (see GCBO) 0203 % eventdata reserved - to be defined in a future version of MATLAB 0204 % handles structure with handles and user data (see GUIDATA) 0205 0206 % Hints: get(hObject,'String') returns contents of HABlim as text 0207 % str2double(get(hObject,'String')) returns contents of HABlim as a double 0208 handles.hablim = str2double(get(hObject,'String')); 0209 guidata(hObject,handles) 0210 0211 0212 0213 % --- Executes during object creation, after setting all properties. 0214 function HABlim_CreateFcn(hObject, eventdata, handles) 0215 % hObject handle to HABlim (see GCBO) 0216 % eventdata reserved - to be defined in a future version of MATLAB 0217 % handles empty - handles not created until after all CreateFcns called 0218 0219 % Hint: edit controls usually have a white background on Windows. 0220 % See ISPC and COMPUTER. 0221 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0222 set(hObject,'BackgroundColor','white'); 0223 end 0224 0225 0226 % --- Executes when selected object is changed in uipanel1. 0227 function uipanel1_SelectionChangeFcn(hObject, eventdata, handles) 0228 % hObject handle to the selected object in uipanel1 0229 % eventdata structure with the following fields (see UIBUTTONGROUP) 0230 % EventName: string 'SelectionChanged' (read only) 0231 % OldValue: handle of the previously selected object or empty if none was selected 0232 % NewValue: handle of the currently selected object 0233 % handles structure with handles and user data (see GUIDATA) 0234 switch get(eventdata.NewValue,'Tag') % Get Tag of selected object. 0235 case 'DFSradiobutton' 0236 handles.ref = 1; 0237 case 'HABradiobutton' 0238 handles.ref = 0; 0239 % Continue with more cases as necessary. 0240 otherwise 0241 handles.ref = 1; 0242 end 0243 guidata(hObject,handles) 0244 0245 0246 0247 % --- Executes when selected object is changed in uipanel3. 0248 function uipanel3_SelectionChangeFcn(hObject, eventdata, handles) 0249 % hObject handle to the selected object in uipanel3 0250 % eventdata structure with the following fields (see UIBUTTONGROUP) 0251 % EventName: string 'SelectionChanged' (read only) 0252 % OldValue: handle of the previously selected object or empty if none was selected 0253 % NewValue: handle of the currently selected object 0254 % handles structure with handles and user data (see GUIDATA) 0255 switch get(eventdata.NewValue,'Tag') % Get Tag of selected object. 0256 case 'Feetradiobutton' 0257 handles.units = 0; 0258 case 'Metersradiobutton' 0259 handles.units = 1; 0260 % Continue with more cases as necessary. 0261 otherwise 0262 handles.units = 1; 0263 end 0264 guidata(hObject,handles) 0265 0266 0267 % --- Executes on button press in PlotDAVcheckbox. 0268 function PlotDAVcheckbox_Callback(hObject, eventdata, handles) 0269 % hObject handle to PlotDAVcheckbox (see GCBO) 0270 % eventdata reserved - to be defined in a future version of MATLAB 0271 % handles structure with handles and user data (see GUIDATA) 0272 0273 % Hint: get(hObject,'Value') returns toggle state of PlotDAVcheckbox 0274 0275 handles.plotDAV = get(hObject,'Value'); 0276 guidata(hObject,handles) 0277 0278 0279 function AscaleEditBox_Callback(hObject, eventdata, handles) 0280 % hObject handle to AscaleEditBox (see GCBO) 0281 % eventdata reserved - to be defined in a future version of MATLAB 0282 % handles structure with handles and user data (see GUIDATA) 0283 0284 % Hints: get(hObject,'String') returns contents of AscaleEditBox as text 0285 % str2double(get(hObject,'String')) returns contents of AscaleEditBox as a double 0286 0287 handles.Ascale = str2double(get(hObject,'String')); 0288 guidata(hObject,handles) 0289 0290 0291 % --- Executes during object creation, after setting all properties. 0292 function AscaleEditBox_CreateFcn(hObject, eventdata, handles) 0293 % hObject handle to AscaleEditBox (see GCBO) 0294 % eventdata reserved - to be defined in a future version of MATLAB 0295 % handles empty - handles not created until after all CreateFcns called 0296 0297 % Hint: edit controls usually have a white background on Windows. 0298 % See ISPC and COMPUTER. 0299 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0300 set(hObject,'BackgroundColor','white'); 0301 end 0302 0303 0304 % --- Executes on button press in pushbutton2. 0305 function pushbutton2_Callback(hObject, eventdata, handles) 0306 % hObject handle to pushbutton2 (see GCBO) 0307 % eventdata reserved - to be defined in a future version of MATLAB 0308 % handles structure with handles and user data (see GUIDATA) 0309 0310 %overlay DOQQ 0311 msgbox('Adding Background','VMT Status','help','replace'); 0312 log_text = VMT_OverlayDOQQ(pwd); 0313 msgbox('Replotting Complete','VMT Status','help','replace'); 0314 0315 0316 % --- Executes during object deletion, before destroying properties. 0317 function PlotDAVcheckbox_DeleteFcn(hObject, eventdata, handles) 0318 % hObject handle to PlotDAVcheckbox (see GCBO) 0319 % eventdata reserved - to be defined in a future version of MATLAB 0320 % handles structure with handles and user data (see GUIDATA) 0321 0322 0323 % --- Executes on button press in PlotDAVButton. 0324 function PlotDAVButton_Callback(hObject, eventdata, handles) 0325 % hObject handle to PlotDAVButton (see GCBO) 0326 % eventdata reserved - to be defined in a future version of MATLAB 0327 % handles structure with handles and user data (see GUIDATA) 0328 0329 %Plot the DAV data 0330 msgbox('Plotting Vectors...Please be patient','VMT Status','help','replace'); 0331 VMT_PlotDAVvectors(handles.VelOut(handles.goodrows,1),handles.VelOut(handles.goodrows,2),handles.VelOut(handles.goodrows,4),handles.VelOut(handles.goodrows,5),handles.Ascale,handles.Vspace,handles.units) 0332 msgbox('Plotting Complete','VMT Status','help','replace'); 0333 0334 0335 function edit5_Callback(hObject, eventdata, handles) 0336 % hObject handle to edit5 (see GCBO) 0337 % eventdata reserved - to be defined in a future version of MATLAB 0338 % handles structure with handles and user data (see GUIDATA) 0339 0340 % Hints: get(hObject,'String') returns contents of edit5 as text 0341 % str2double(get(hObject,'String')) returns contents of edit5 as a double 0342 0343 handles.Vspace = str2double(get(hObject,'String')); 0344 guidata(hObject,handles) 0345 0346 0347 % --- Executes during object creation, after setting all properties. 0348 function edit5_CreateFcn(hObject, eventdata, handles) 0349 % hObject handle to edit5 (see GCBO) 0350 % eventdata reserved - to be defined in a future version of MATLAB 0351 % handles empty - handles not created until after all CreateFcns called 0352 0353 % Hint: edit controls usually have a white background on Windows. 0354 % See ISPC and COMPUTER. 0355 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0356 set(hObject,'BackgroundColor','white'); 0357 end 0358 0359 0360 0361 function tav_editbox_Callback(hObject, eventdata, handles) 0362 % hObject handle to tav_editbox (see GCBO) 0363 % eventdata reserved - to be defined in a future version of MATLAB 0364 % handles structure with handles and user data (see GUIDATA) 0365 0366 % Hints: get(hObject,'String') returns contents of tav_editbox as text 0367 % str2double(get(hObject,'String')) returns contents of tav_editbox as a double 0368 handles.TAV = str2double(get(hObject,'String')); 0369 guidata(hObject,handles) 0370 0371 0372 % --- Executes during object creation, after setting all properties. 0373 function tav_editbox_CreateFcn(hObject, eventdata, handles) 0374 % hObject handle to tav_editbox (see GCBO) 0375 % eventdata reserved - to be defined in a future version of MATLAB 0376 % handles empty - handles not created until after all CreateFcns called 0377 0378 % Hint: edit controls usually have a white background on Windows. 0379 % See ISPC and COMPUTER. 0380 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 0381 set(hObject,'BackgroundColor','white'); 0382 end