📄 fm_cpffig.m
字号:
function fig = fm_cpffig(varargin)% FM_CPFFIG create GUI for Continuation Power Flow settings%% HANDLE = FM_CPFFIG% HANDLE = figure graphic handle%%see CPF structure for settings%%Author: Federico Milano%Date: 11-Nov-2002%Update: 11-Feb-2003%Version: 1.0.2%%E-mail: fmilano@thunderbox.uwaterloo.ca%Web-site: http://thunderbox.uwaterloo.ca/~fmilano%% Copyright (C) 2002-2005 Federico Milano%% This toolbox is free software; you can redistribute it and/or modify% it under the terms of the GNU General Public License as published by% the Free Software Foundation; either version 2.0 of the License, or% (at your option) any later version.%% This toolbox is distributed in the hope that it will be useful, but% WITHOUT ANY WARRANTY; without even the implied warranty of% MERCHANDABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU% General Public License for more details.%% You should have received a copy of the GNU General Public License% along with this toolbox; if not, write to the Free Software% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,% USA.global Settings Path CPF Theme Figif nargin & ischar(varargin{1}) switch varargin{1} case 'hopf' switch get(gcbo,'Checked') case 'on' set(gcbo,'Checked','off') CPF.hopf = 0; case 'off' set(gcbo,'Checked','on') CPF.hopf = 1; end case 'stepcut' switch get(gcbo,'Checked') case 'on' set(gcbo,'Checked','off') CPF.stepcut = 0; case 'off' set(gcbo,'Checked','on') CPF.stepcut = 1; end case 'ilim' CPF.ilim = get(gcbo,'Value'); hdl = findobj(Fig.cpf,'Tag','PopupMenu2'); if CPF.ilim == 0 set(hdl,'Enable','off') else set(hdl,'Enable','on') end end returnendif Fig.cpf, figure(Fig.cpf), return, endflussi = {'Currents (I)'; 'Active Powers (P)'; 'Apparent Powers (S)'};metodi = {'Perpendicular Intersection'; 'Local Parametrization'};tipi = {'Complete Nose Curve'; 'Stop at Bifurcation'; 'Stop at Limit'};nr = 'normalized';c2 = Theme.color02;c3 = Theme.color03;c4 = Theme.color04;c5 = Theme.color05;f1 = Theme.font01;h0 = figure('Units',nr, ... 'Color',c2, ... 'Colormap',[], ... 'CreateFcn', 'Fig.cpf = gcf;', ... 'DeleteFcn', 'Fig.cpf = 0;', ... 'MenuBar','none', ... 'Name','PSAT-CPF', ... 'NumberTitle','off', ... 'PaperPosition',[18 180 576 432], ... 'PaperUnits','points', ... 'Position',sizefig(0.6,0.5), ... 'Resize','on', ... 'ToolBar','none', ... 'FileName','fm_cpffig');fm_set colormap% Menu Fileh1 = uimenu('Parent',h0, ... 'Label','File', ... 'Tag','MenuFile');h2 = uimenu('Parent',h1, ... 'Callback','close(gcf)', ... 'Label','Exit', ... 'Tag','NetSett', ... 'Accelerator','x');% Menu Edith1 = uimenu('Parent',h0, ... 'Label','Edit', ... 'Tag','MenuEdit');h2 = uimenu('Parent',h1, ... 'Callback','fm_setting', ... 'Label','General Settings', ... 'Tag','ToolSett', ... 'Accelerator','s');% Menu Runh1 = uimenu('Parent',h0, ... 'Label','Run', ... 'Tag','MenuRun');h2 = uimenu('Parent',h1, ... 'Callback','fm_cpf(''main'');', ... 'Label','Run CPF', ... 'Tag','ToolCPFSett', ... 'Accelerator','z');h2 = uimenu('Parent',h1, ... 'Callback','fm_n1cont', ... 'Label','N-1 Contingency Analysis', ... 'Tag','ViewN1C', ... 'Accelerator','n');% Menu Optionsh1 = uimenu('Parent',h0, ... 'Label','Options', ... 'Tag','MenuOpt');h2 = uimenu('Parent',h1, ... 'Callback','fm_cpffig hopf', ... 'Label','Check for Hopf Bif.', ... 'Tag','OptHB', ... 'Accelerator','h');if CPF.hopf set(h2,'Checked','on')else set(h2,'Checked','off')endh2 = uimenu('Parent',h1, ... 'Callback','fm_cpffig stepcut', ... 'Label','Enforce step cut control', ... 'Tag','OptSTC', ... 'Accelerator','c');if CPF.stepcut set(h2,'Checked','on')else set(h2,'Checked','off')end% Frameh1 = uicontrol('Parent',h0, ... 'Units', nr, ... 'BackgroundColor',c2, ... 'ForegroundColor',c3, ... 'Position',[0.025 0.275 0.95 0.675], ... 'Style','frame', ... 'Tag','Frame1');% Popup Menush1 = uicontrol('Parent',h0, ... 'Units', nr, ... 'BackgroundColor',c4, ... 'Callback', 'CPF.method = get(gcbo,''Value'');', ... 'FontName', f1, ... 'ForegroundColor',c5, ... 'Position',[0.608 0.79 0.342 0.06], ... 'String', metodi, ... 'Style', 'popupmenu', ... 'Tag','PopupMenu1', ... 'Value',CPF.method);h1 = uicontrol('Parent',h0, ... 'Units', nr, ... 'BackgroundColor',c4, ... 'Callback', 'CPF.flow = get(gcbo,''Value'');', ... 'ForegroundColor',c5, ... 'FontName', f1, ... 'Position',[0.608 0.64 0.342 0.06], ... 'String',flussi, ... 'Style','popupmenu', ... 'Tag','PopupMenu2', ... 'Value',CPF.flow);if CPF.ilim == 0 set(h1,'Enable','off')endh1 = uicontrol('Parent',h0, ... 'Units', nr, ... 'BackgroundColor',c4, ... 'Callback', 'CPF.type = get(gcbo,''Value'');', ... 'ForegroundColor',c5, ... 'FontName', f1, ... 'Position',[0.608 0.49 0.342 0.06], ... 'String',tipi, ... 'Style','popupmenu', ... 'Tag','PopupMenu3', ... 'Value',CPF.type);h1 = uicontrol('Parent',h0, ... 'Units', nr, ... 'BackgroundColor',c2, ... 'HorizontalAlignment','left', ... 'Position',[0.608 0.86 0.3 0.05], ... 'String', 'Corrector Step Method', ... 'Style', 'text', ... 'Tag', 'StaticText12');h1 = uicontrol('Parent',h0, ... 'Units', nr, ... 'BackgroundColor',c2, ... 'HorizontalAlignment','left', ... 'Position',[0.608 0.71 0.3 0.05], ... 'String','Flow Limits', ... 'Style','text', ... 'Tag','StaticText11');h1 = uicontrol('Parent',h0, ... 'Units', nr, ... 'BackgroundColor',c2, ... 'HorizontalAlignment','left', ... 'Position',[0.608 0.56 0.3 0.05], ... 'String','Stop Criterium', ... 'Style','text', ... 'Tag','StaticText11');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -