📄 mztools.m
字号:
function varargout = mztools(varargin)% MZTOOLS M-file for mztools.fig% MZTOOLS, by itself, creates a new MZTOOLS or raises the existing% singleton*.%% H = MZTOOLS returns the handle to a new MZTOOLS or the handle to% the existing singleton*.%% MZTOOLS('CALLBACK',hObject,eventData,handles,...) calls the local% function named CALLBACK in MZTOOLS.M with the given input arguments.%% MZTOOLS('Property','Value',...) creates a new MZTOOLS or raises the% existing singleton*. Starting from the left, property value pairs are% applied to the GUI before mztools_OpeningFcn gets called. An% unrecognized property name or invalid value makes property application% stop. All inputs are passed to mztools_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% Edit the above text to modify the response to help mztools% Last Modified by GUIDE v2.5 04-May-2008 16:26:41% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @mztools_OpeningFcn, ... 'gui_OutputFcn', @mztools_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []);if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1});endif nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});else gui_mainfcn(gui_State, varargin{:});end% End initialization code - DO NOT EDIT% --- Executes just before mztools is made visible.function mztools_OpeningFcn(hObject, eventdata, handles, varargin)% This function has no output args, see OutputFcn.% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% varargin command line arguments to mztools (see VARARGIN)%%%设置路径为用户先前保存路径global UserPathUserPath=GetConfigInfo('Config.ini');if length(UserPath)<3 UserPath=cd; if length(UserPath)>3 UserPath=strcat(UserPath,'\'); endendset(handles.Obj_Text_UserPath,'string',UserPath);%%% Choose default command line output for mztoolshandles.output = hObject;% Update handles structureguidata(hObject, handles);% UIWAIT makes mztools wait for user response (see UIRESUME)% uiwait(handles.Obj_Fig_Main);% --- Outputs from this function are returned to the command line.function varargout = mztools_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT);% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Get default command line output from handles structurevarargout{1} = handles.output;function Obj_Text_UserPath_Callback(hObject, eventdata, handles)% hObject handle to Obj_Text_UserPath (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of Obj_Text_UserPath as text% str2double(get(hObject,'String')) returns contents of Obj_Text_UserPath as a double% --- Executes during object creation, after setting all properties.function Obj_Text_UserPath_CreateFcn(hObject, eventdata, handles)% hObject handle to Obj_Text_UserPath (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end% --- Executes on button press in Obj_Cmd_Browse.function Obj_Cmd_Browse_Callback(hObject, eventdata, handles)% hObject handle to Obj_Cmd_Browse (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)%%%设置路径为用户先前保存路径global UserPathTempPath=uigetdir('Please select the input and output path.');if length(TempPath)>=3 if length(TempPath)>3 TempPath=strcat(TempPath,'\'); end UserPath=TempPath; set(handles.Obj_Text_UserPath,'string',UserPath); Fid_Config=fopen('Config.ini','w'); fprintf(Fid_Config,'UserPath_Open=%s',UserPath); fclose(Fid_Config);else msgbox('You have selected nothing.');end%%% --- Executes on button press in Obj_Cmd_Kml2XYZ.function Obj_Cmd_Kml2XYZ_Callback(hObject, eventdata, handles)% hObject handle to Obj_Cmd_Kml2XYZ (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)%%%kml2xyz,kml岸线转换为xyz线形global UserPathkml2xyz(UserPath);%%% --- Executes on button press in pushbutton4.function pushbutton4_Callback(hObject, eventdata, handles)% hObject handle to pushbutton4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% --- Executes on button press in Obj_Cmd_Mif2Kml.function Obj_Cmd_Mif2Kml_Callback(hObject, eventdata, handles)% hObject handle to Obj_Cmd_Mif2Kml (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)%%%Mif转换为kmlglobal UserPathmif2kml(UserPath);%%% --- Executes on button press in Obj_Cmd_Mesh2Kml.function Obj_Cmd_Mesh2Kml_Callback(hObject, eventdata, handles)% hObject handle to Obj_Cmd_Mesh2Kml (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)%%global UserPathTempStr=inputdlg({'经度偏移量','纬度偏移量'},'网格偏移量',2,{'0','0'});TempVar1=str2num(TempStr{1});TempVar2=str2num(TempStr{2});if length(TempVar1)<1 X_Shift=0;else X_Shift=TempVar1(1);endif length(TempVar2)<1 Y_Shift=0;else Y_Shift=TempVar2(1);endmesh2kml(UserPath,X_Shift,Y_Shift);%%% --- Executes on button press in Obj_Cmd_XYZ2Kml.function Obj_Cmd_XYZ2Kml_Callback(hObject, eventdata, handles)% hObject handle to Obj_Cmd_XYZ2Kml (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)%%global UserPathxyz2kml(UserPath);%%% --- Executes on button press in Obj_Cmd_Mif2XYZ.function Obj_Cmd_Mif2XYZ_Callback(hObject, eventdata, handles)% hObject handle to Obj_Cmd_Mif2XYZ (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)%%global UserPathmif2xyz(UserPath);%%% --- Executes on button press in pushbutton10.function pushbutton10_Callback(hObject, eventdata, handles)% hObject handle to pushbutton10 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% --- Executes on button press in pushbutton11.function pushbutton11_Callback(hObject, eventdata, handles)% hObject handle to pushbutton11 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% --- Executes on button press in Obj_Cmd_XYZ2Mif.function Obj_Cmd_XYZ2Mif_Callback(hObject, eventdata, handles)% hObject handle to Obj_Cmd_XYZ2Mif (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)%%global UserPathxyz2mif(UserPath);%%% --- Executes on button press in Obj_Cmd_UserPredict.function Obj_Cmd_UserPredict_Callback(hObject, eventdata, handles)% hObject handle to Obj_Cmd_UserPredict (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global UserPathuser_predict_tide(UserPath);% --- Executes on button press in Obj_Cmd_ChinaTide.function Obj_Cmd_ChinaTide_Callback(hObject, eventdata, handles)% hObject handle to Obj_Cmd_ChinaTide (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)chinatide;% --- Executes on button press in Obj_Cmd_About.function Obj_Cmd_About_Callback(hObject, eventdata, handles)% hObject handle to Obj_Cmd_About (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)ui_help;% --- Executes on button press in Obj_Cmd_Quit.function Obj_Cmd_Quit_Callback(hObject, eventdata, handles)% hObject handle to Obj_Cmd_Quit (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)close(handles.Obj_Fig_Main);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -