📄 vct0805.m
字号:
function varargout = vct0805(varargin)
% VCT0805 M-file for vct0805.fig
% VCT0805, by itself, creates a new VCT0805 or raises the existing
% singleton*.
%
% H = VCT0805 returns the handle to a new VCT0805 or the handle to
% the existing singleton*.
%
% VCT0805('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in VCT0805.M with the given input arguments.
%
% VCT0805('Property','Value',...) creates a new VCT0805 or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before vct0805_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to vct0805_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 vct0805
% Last Modified by GUIDE v2.5 08-Aug-2007 10:30:36
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @vct0805_OpeningFcn, ...
'gui_OutputFcn', @vct0805_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 vct0805 is made visible.
function vct0805_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)
image_date=imread('vvvct.JPG');
image(image_date)
set(gca,'xtick',[],'ytick',[]);
%fig = handles.F14ControllerEditor;
% varargin command line arguments to vct0805 (see VARARGIN)
global jinb jina
NewStrVal = get(handles.radiobuttonjin,'Value');
%h = guihandles( gcbf )
%handles.jinb=NewStrVal;
%guidate(h,handles);
%NewVal = str2num(NewStrVal);
assignin('base','jina',NewStrVal);
%窗口最大化开始
%Screen=get(0,'ScreenSize')
%set(gcf,'OuterPosition',Screen);
%窗口大化完
model_open(handles)
% Choose default command line output for vct0805
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes vct0805 wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = vct0805_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;
% ------------------------------------------------------------
% Ensure that the Simulink model is open
% ------------------------------------------------------------
function model_open(handles)
% Make sure the diagram is still open
if isempty(find_system('Name','PIDkongzhixiangying')),
open_system('PIDkongzhixiangying');
%open_system('PIDkongzhixiangying/vane')
%set_param('f14/Controller/Gain','Position',[275 14 340 56])
%figure(handles.F14ControllerEditor)
% Put values of Kf and Ki from the GUI into the Block dialogs
%set_param('PIDkongzhixiangying/Constant1',...
%'Constant value',get(handles.shudu,'String'))
%set_param('PIDkongzhixiangying/vane/Proportional plus integral compensator',...
% 'Numerator',get(handles.wendu,'String'))
end
%endfunction model_open
function shudu_Callback(hObject, eventdata, handles)
% hObject handle to shudu (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global shudu;
% Hints: get(hObject,'String') returns contents of shudu as text
% str2double(get(hObject,'String')) returns contents of shudu as a double
model_open(handles)
% Get the new value for the Kf Gain
NewStrVal = get(hObject,'String');
NewVal = str2num(NewStrVal);
% Check that the entered value falls within the allowable range
if isempty(NewVal) || (NewVal< 0) || (NewVal>6000),
% Revert to last value, as indicated by KfValueSlider
set(hObject,'String',shudu)
assignin('base','zhuanshu',str2double(shudu));
%set_param('PIDkongzhixiangying','Constant1',shudu)
% set_param('PIDkongzhixiangying/Constant1',...
%'constant value',get(handles.shudu,'String'))
else
%assignin('base','oldval',NewStrVal);
shudu = NewStrVal;
%get(hObject,'String');
% Set the Gain parameter of the Kf Gain Block to the new value
assignin('base','zhuanshu',NewVal);
end
% --- Executes during object creation, after setting all properties.
function shudu_CreateFcn(hObject, eventdata, handles)
% hObject handle to shudu (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 wendu_Callback(hObject, eventdata, handles)
% hObject handle to wendu (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global oldval
NewStrVal = get(hObject,'String');
NewVal = str2double(NewStrVal);
% Check that the entered value falls within the allowable range
if isempty(NewVal) || (NewVal< 0) || (NewVal>150),
% Revert to last value, as indicated by KfValueSlider
set(handles.wendu,'String',oldval)
assignin('base','oilwen',str2double(oldval));
%set_param('f14/Controller/Proportional plus integral compensator',...
% 'Numerator',oldval)
else
oldval = NewStrVal ;
assignin('base','oilwen',NewVal);
% Set the Gain parameter of the Kf Gain Block to the new value
% set_param('f14/Controller/Proportional plus integral compensator',...
%'Numerator',NewStrVal)
end
% Hints: get(hObject,'String') returns contents of wendu as text
% str2double(get(hObject,'String')) returns contents of wendu as a double
% --- Executes during object creation, after setting all properties.
function wendu_CreateFcn(hObject, eventdata, handles)
% hObject handle to wendu (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 youya_Callback(hObject, eventdata, handles)
% hObject handle to youya (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
NewStrVal = get(hObject,'String');
NewVal = str2double(NewStrVal);
assignin('base','oilya',NewVal);
% set_param('f14/Controller','Ka',NewStrVal)
% Hints: get(hObject,'String') returns contents of youya as text
% str2double(get(hObject,'String')) returns contents of youya as a double
% --- Executes during object creation, after setting all properties.
function youya_CreateFcn(hObject, eventdata, handles)
% hObject handle to youya (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -