| 
 | 
 
function varargout = main_figure(varargin) 
% MAIN_FIGURE MATLAB code for main_figure.fig 
%      MAIN_FIGURE, by itself, creates a new MAIN_FIGURE or raises the existing 
%      singleton*. 
% 
%      H = MAIN_FIGURE returns the handle to a new MAIN_FIGURE or the handle to 
%      the existing singleton*. 
% 
%      MAIN_FIGURE('CALLBACK',hObject,eventData,handles,...) calls the local 
%      function named CALLBACK in MAIN_FIGURE.M with the given input arguments. 
% 
%      MAIN_FIGURE('Property','Value',...) creates a new MAIN_FIGURE or raises the 
%      existing singleton*.  Starting from the left, property value pairs are 
%      applied to the GUI before main_figure_OpeningFcn gets called.  An 
%      unrecognized property name or invalid value makes property application 
%      stop.  All inputs are passed to main_figure_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 main_figure 
 
% Last Modified by GUIDE v2.5 05-Jun-2017 08:58:47 
 
% Begin initialization code - DO NOT EDIT 
gui_Singleton = 1; 
gui_State = struct('gui_Name',       mfilename, ... 
                   'gui_Singleton',  gui_Singleton, ... 
                   'gui_OpeningFcn', @main_figure_OpeningFcn, ... 
                   'gui_OutputFcn',  @main_figure_OutputFcn, ... 
                   'gui_LayoutFcn',  [] , ... 
                   'gui_Callback',   []); 
if nargin && ischar(varargin{1}) 
    gui_State.gui_Callback = str2func(varargin{1}); 
end 
 
if 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 main_figure is made visible. 
function main_figure_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 main_figure (see VARARGIN) 
 
% Choose default command line output for main_figure 
handles.output = hObject; 
 
% Update handles structure 
guidata(hObject, handles); 
 
% UIWAIT makes main_figure wait for user response (see UIRESUME) 
% uiwait(handles.figure_tag); 
 
 
% --- Outputs from this function are returned to the command line. 
function varargout = main_figure_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 structure 
varargout{1} = handles.output; 
 
 
% --- Executes on button press in begin_tag. 
function begin_tag_Callback(hObject, eventdata, handles) 
% hObject    handle to begin_tag (see GCBO) 
% eventdata  reserved - to be defined in a future version of MATLAB 
% handles    structure with handles and user data (see GUIDATA) 
global VM Angle_m 
e1 = str2num(handles.e1_tag.String); 
% e2 = str2num(handles.e2_tag.String); 
Angle_m = str2num(handles.angle_m_tag.String); 
VM = str2num(handles.vm_tag.String); 
e3 = str2num(handles.e3_tag.String); 
e4 = str2num(handles.e4_tag.String); 
 
handles.begin_tag.BackgroundColor = [1,0,0]; 
handles.begin_tag.String = '正在运行'; 
pause(0.01) 
m_ptOrigin = getAirToAirTrace(e1,Angle_m,VM,e3,e4); 
[theta,rho] = cart2pol(m_ptOrigin(:,1),m_ptOrigin(:,2)); 
maxRho = max(rho); 
minRho = min(rho); 
t=linspace(0,2*pi,length(theta)); 
r=minRho/3*ones(length(theta)); 
 
axes(handles.axes_tag) 
polarplot(theta,rho,'r',t,r,'k') 
 
handles.external_tag.String = num2str(maxRho);  
handles.internal_tag.String = num2str(minRho);  
handles.begin_tag.BackgroundColor = [0,1,0]; 
handles.begin_tag.String = '开始'; 
 
% --- Executes on button press in quit_tag. 
function quit_tag_Callback(hObject, eventdata, handles) 
% hObject    handle to quit_tag (see GCBO) 
% eventdata  reserved - to be defined in a future version of MATLAB 
% handles    structure with handles and user data (see GUIDATA) 
close(main_figure) 
 
 
function e1_tag_Callback(hObject, eventdata, handles) 
% hObject    handle to e1_tag (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 e1_tag as text 
%        str2double(get(hObject,'String')) returns contents of e1_tag as a double 
 
 
% --- Executes during object creation, after setting all properties. 
function e1_tag_CreateFcn(hObject, eventdata, handles) 
% hObject    handle to e1_tag (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 
 
 
 
function e2_tag_Callback(hObject, eventdata, handles) 
% hObject    handle to e2_tag (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 e2_tag as text 
%        str2double(get(hObject,'String')) returns contents of e2_tag as a double 
 
 
% --- Executes during object creation, after setting all properties. 
function e2_tag_CreateFcn(hObject, eventdata, handles) 
% hObject    handle to e2_tag (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 
 
 
 
function angle_m_tag_Callback(hObject, eventdata, handles) 
% hObject    handle to angle_m_tag (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 angle_m_tag as text 
%        str2double(get(hObject,'String')) returns contents of angle_m_tag as a double 
 
 
% --- Executes during object creation, after setting all properties. 
function angle_m_tag_CreateFcn(hObject, eventdata, handles) 
% hObject    handle to angle_m_tag (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 
 
 
 
function vm_tag_Callback(hObject, eventdata, handles) 
% hObject    handle to vm_tag (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 vm_tag as text 
%        str2double(get(hObject,'String')) returns contents of vm_tag as a double 
 
 
% --- Executes during object creation, after setting all properties. 
function vm_tag_CreateFcn(hObject, eventdata, handles) 
% hObject    handle to vm_tag (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 
 
 
 
function e3_tag_Callback(hObject, eventdata, handles) 
% hObject    handle to e3_tag (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 e3_tag as text 
%        str2double(get(hObject,'String')) returns contents of e3_tag as a double 
 
 
% --- Executes during object creation, after setting all properties. 
function e3_tag_CreateFcn(hObject, eventdata, handles) 
% hObject    handle to e3_tag (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 
 
 
 
function e4_tag_Callback(hObject, eventdata, handles) 
% hObject    handle to e4_tag (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 e4_tag as text 
%        str2double(get(hObject,'String')) returns contents of e4_tag as a double 
 
 
% --- Executes during object creation, after setting all properties. 
function e4_tag_CreateFcn(hObject, eventdata, handles) 
% hObject    handle to e4_tag (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 
 
 
 
function height_tag_Callback(hObject, eventdata, handles) 
% hObject    handle to height_tag (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 height_tag as text 
%        str2double(get(hObject,'String')) returns contents of height_tag as a double 
 
 
% --- Executes during object creation, after setting all properties. 
function height_tag_CreateFcn(hObject, eventdata, handles) 
% hObject    handle to height_tag (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 during object creation, after setting all properties. 
function external_tag_CreateFcn(hObject, eventdata, handles) 
% hObject    handle to external_tag (see GCBO) 
% eventdata  reserved - to be defined in a future version of MATLAB 
% handles    empty - handles not created until after all CreateFcns called 
 
 
% --- Executes during object creation, after setting all properties. 
function internal_tag_CreateFcn(hObject, eventdata, handles) 
% hObject    handle to internal_tag (see GCBO) 
% eventdata  reserved - to be defined in a future version of MATLAB 
% handles    empty - handles not created until after all CreateFcns called 
 
 
 |   
 
 
 
 |