⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 arcsimulationsoft.m

📁 一共有15个m文件
💻 M
📖 第 1 页 / 共 2 页
字号:
ArcSimulationData = getappdata( handles.ArcSimulationSoft, 'ArcSimulationData' ) ;
if isempty( ArcSimulationData )
    ArcSimulationData = ArcSimulationSoft( 'Get_DefaultArcSimulationData' ) ;    
    % save the data .
    setappdata( handles.ArcSimulationSoft, 'ArcSimulationData', ArcSimulationData ) ;
end



% --------------------------------------------------------------------------
function   ArcSimulationData = Get_DefaultArcSimulationData ;
% init all of the parameters .

ArcSimulationData = GetDefaultArcParameter ;




% --------------------------------------------------------------------------
function  MenuOpenHistory_Callback( h )
       
handles = guidata( h ) ;


PromptString = '选择结果文件' ;                                 
WarningString1 = '文件格式出错。 ' ;
WarningString2 = '选择的文件不是正确的结果文件。 ' ;

% get file from view .
[ FileName, PathName ]  = uigetfile( {'*.fig', '结果文件(*.fig)'}, PromptString ) ;


% analyze the user select file type .
if FileName == 0
    return ;
else
    [TempPathName, FileName, FileTypeName, Version] = fileparts( FileName ) ;

    if ~strcmp( FileTypeName, '.fig' ) ;
        warndlg( WarningString1, '警告', 'modal' ) ;
        return ;
    end
    SaveFile = fullfile(PathName, [FileName, FileTypeName, Version]) ;
end



if strcmp( lower( FileName ), 'figuremenubar' )
    warndlg( '这是系统文件:FigureMenuBar.fig。', '警告', 'modal' ) ;
    return ;    
    
elseif strcmp( lower( FileName ), 'figuretoolbar' ) ;
    warndlg( '这是系统文件:FigureToolBar.fig。', '警告', 'modal' ) ;
    return ;    
else
end


% open the history figure .
NewFigureHandle = hgload( SaveFile ) ;

% get the marker of project file .
FigureTag = get( NewFigureHandle, 'Tag' ) ;
if  ~( find( strcmp( FigureTag, {'DisplayResult'; 'DisplayFFTResult' } ) ) ) ;
    % close error figure .
    close( NewFigureHandle ) ;
    
    warndlg( WarningString2, '警告', 'modal' ) ;
    return ;
end


% close current figure .
if ishandle( h )
    CurrentFigure = h ;
    
    pause(0.01) ;    
    close( CurrentFigure ) ;
else
end




% --------------------------------------------------------------------------
function  MenuLoadData_Callback( h )
       
handles = guidata( h ) ;


PromptString = '选择数据文件.' ;
WarningString1 = '文件格式出错。 ' ;
WarningString2 = '选择的文件不是正确的数据文件。 ' ;


[ FileName , PathName ] = uigetfile( {'*.mat','数据文件(*.mat)'}, PromptString ) ;


if FileName == 0
    return ;    
else
    
    [TempPathName, FileName, FileTypeName, Version] = fileparts( FileName ) ;

    if ~strcmp( FileTypeName, '.mat' ) ;
        warndlg( WarningString1, '警告', 'modal' ) ;
        return ;
    end
    SaveFile = fullfile( PathName, [FileName, FileTypeName, Version] ) ;
end

ArcSimulationData = [] ;
try
    load( SaveFile, 'ArcSimulationData' ) ;
catch
end

if isempty( ArcSimulationData ) | ~isstruct( ArcSimulationData ) ...
        | ~isfield( ArcSimulationData, 'MainCircuitParameter' ) ...
        | ~isfield( ArcSimulationData, 'ArcResistanceParameter' ) 
    
    warndlg( WarningString1, '警告', 'modal' ) ;
    return ;
end


% open the parameter figure .
% EditParameter( ArcSimulationData ) ;
CalculateStatusEquation( ArcSimulationData ) ;


% close the current figure .
pause(0) ;
close( handles.ArcSimulationSoft ) ;



% --------------------------------------------------------------------------
function  BeginButton_Callback( h )
       
handles = guidata( h ) ;

% get the ArcSimulationData .
ArcSimulationData = getappdata( handles.ArcSimulationSoft, 'ArcSimulationData' ) ;

% open the parameter figure .
% EditParameter( ArcSimulationData ) ;
CalculateStatusEquation( ArcSimulationData ) ;


% close the current figure .
pause(0) ;
close( handles.ArcSimulationSoft ) ;



% --------------------------------------------------------------------------
function  MenuHelp_Callback( h )
       
handles = guidata( h ) ;


try
    % get the current path .
    CurrentPath = cd ;
    HelpFileName = fullfile( CurrentPath, 'ArcSimulationHelp.pdf' ) ;
    
    % open the help file .
    mexrun( HelpFileName ) ;
    
catch
    % get the current path .
    CurrentPath = cd ;
    HelpFileName = fullfile( CurrentPath, 'ArcSimulationHelp.doc' ) ;
    
    % open the help file .
    mexrun( HelpFileName ) ;
    
end



% --------------------------------------------------------------------------
function  MenuDemo_Callback( h )
       
handles = guidata( h ) ;

% open the demo .
ArcSoftDemo ;



% --------------------------------------------------------------------------
function  MenuAbout_Callback( h )
       
handles = guidata( h ) ;


% find if have the same figure, and close it .
OldFigure = findobj( 'type', 'figure', 'Tag', 'AboutArcSimulation' ) ;
if ishandle( OldFigure )
    close( OldFigure ) ;
end

% init the variables .
FigureWidth = 250 ;
FigureHeight = 220 ;
TabSpace = 10 ;
TextHeight = 20 ;

% generate a new figure .
FigureHandle = figure( 'Visible', 'off' ) ;
set( FigureHandle, 'Units' , 'pixels', 'Position', [150  150  FigureWidth  FigureHeight], ...
    'Name', '关于', 'Tag', 'AboutArcSimulation', 'FileName' , '' ,...
    'MenuBar' , 'none', 'NumberTitle' , 'off' ,...
    'Resize', 'off', 'windowstyle', 'normal', 'Visible', 'off' ) ;
movegui( FigureHandle, 'center' )


% generate the axes to plot lines .
AxesHandle = axes( 'Parent', FigureHandle, 'Units' , 'normalized' ,  ...
    'Position', [0 0 1 1], 'Visible', 'off', ...
    'Xlim', [0  FigureWidth], 'Ylim', [0  FigureHeight] ) ;

% get the color of the figure .
FigureColor = get( FigureHandle, 'Color' ) ;
% reset the default value of the uicontrols .
set(FigureHandle,'defaultuicontrolunits','normalized');
set(FigureHandle,'defaultuicontrolfontname','隶书');
set(FigureHandle,'defaultuicontrolBackgroundColor', FigureColor );


% generate the parameters of the MainCircuitParameter .
% -----------------------------------------------------------------------------
% define the first frame .
FrameXPos = TabSpace * 2 ;
FrameWidth = FigureWidth - TabSpace * 4  ;
FrameHeight = FigureHeight - TabSpace * 8 ;
FrameYPos = FigureHeight - FrameHeight - TabSpace * 2 ;
Frame1Position = [FrameXPos  FrameYPos  FrameWidth  FrameHeight] ;
% generate a frame .
TitleHandle = uicontrol(FigureHandle,'style','frame', 'Units','pixels',...
    'position',Frame1Position  );


TextXPos = Frame1Position(1) + TabSpace  ;
TextYPos = Frame1Position(2) + TabSpace ;
TextWidth = Frame1Position(3) - TabSpace * 2 ;
TextHeight = Frame1Position(4) - TabSpace * 2 ;
TextPosition = [TextXPos  TextYPos  TextWidth  TextHeight] ;
% subtitle: 电弧电阻公式
TextHandle = uicontrol(FigureHandle, 'Style','text', 'Units','pixels',...
    'position',TextPosition, 'Horizontal','left',...
    'string', {['  《电弧炉对电网影响仿真软件》是一个完全由matlab实现的软件。']}, 'fontsize',13 );


ButtonWidth = 80 ;
ButtonHeight = 25 ;
ButtonXPos = FigureWidth - ButtonWidth - TabSpace * 3 ;
ButtonYPos = TabSpace * 2 ;;
ButtonPosition = [ButtonXPos  ButtonYPos  ButtonWidth  ButtonHeight] ;
% generate the pushbutton: Close .
ButtonHandle = uicontrol( 'Parent', FigureHandle, 'Units', 'Pixels', 'Position', ButtonPosition, ...
    'Style', 'pushbutton', 'string', '关闭', 'Fontsize',12, 'Callback', ['close(gcbf) ;'] ) ;


% display the figure .
set( FigureHandle, 'Visible', 'on' ) ;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -