📄 fm_dir.m
字号:
function fig = fm_dir()% FM_DIR create GUI for data format conversion%% HDL = FM_DIR()%%see also FM_DIRSET%%Author: Federico Milano%Date: 11-Nov-2002%Update: 31-Jul-2003%Update: 07-Oct-2003%Version: 1.1.0%%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 Theme Figif Fig.dir, figure(Fig.dir), return, end%screensize = get(0,'ScreenSize');formati = {'IEEE CDF (.dat, .txt, .cf)'; 'CYME (.nnd, .sf)'; 'MatPower (.m)'; 'PSAT (.m)'; 'PST (.m)'; 'EPRI WECC (.wsc, .txt, .dat)'; 'PSS/E (.raw)'; 'PSAP (.dat)'; 'Eurostag (.dat)'; 'EPRI BPA/China (.dat)'; 'TH (.dat)'; 'INPTC1 (.dat)'; 'VST (.dat)'; 'SIMPOW (.optpow, .dynpow)'; 'NEPLAN (.ndt)'; 'DigSilent (.dz)'; 'PowerWorld (.aux)'; 'PET (.pet)'; 'Flowdemo.net (.fdn)'; 'GE format (.epc)'; 'All Files (*.*)'};frompsat = {'IEEE CDF'; 'BPA/WECC'};h0 = figure('Color',Theme.color01, ... 'Units', 'normalized', ... 'ColorMap', [], ... 'ResizeFcn','fm_dirset chformat', ... 'CreateFcn','Fig.dir = gcf;', ... 'DeleteFcn','Fig.dir = 0;', ... 'FileName','fm_dir', ... 'MenuBar','none', ... 'Name','Data Format Conversion', ... 'NumberTitle','off', ... 'PaperPosition',[18 180 576 432], ... 'PaperUnits','points', ... 'Position',sizefig(1.1*0.5375,1.1*0.5068), ... 'ShareColors', 'on', ... 'ToolBar','none');fm_set colormaph1 = axes('Parent',h0, ... 'Box','on', ... 'CameraUpVector',[0 1 0], ... 'CameraUpVectorMode','manual', ... 'Color',Theme.color04, ... 'ColorOrder',Settings.color, ... 'Drawmode','fast', ... 'Layer','top', ... 'NextPlot','add', ... 'Position',[0.7393 0.4016 0.1931 0.3411], ... 'Tag','Axes1', ... 'XColor',[0 0 0], ... 'XLim',[0.5 117.5], ... 'XLimMode','manual', ... 'XTickLabelMode','manual', ... 'XTickMode','manual', ... 'YColor',[0 0 0], ... 'YDir','reverse', ... 'YLim',[0.5 147.5], ... 'YLimMode','manual', ... 'YTickLabelMode','manual', ... 'YTickMode','manual', ... 'ZColor',[0 0 0]);%0.7368 0.432 0.198 0.2804], ...a = imread([Path.images,'logo_ieee.jpg'],'jpg');%try% a = imresize(a,117,'bilinear',7);%catch % imresize is not available!!!%endh2 = image('Parent',h1, ... 'CData',a, ... 'Erase','none', ... 'Tag','Axes1Image1', ... 'XData',[1 117], ... 'YData',[1 147]);h1 = uicontrol('Parent',h0, ... 'Units', 'normalized', ... 'BackgroundColor',Theme.color04, ... 'Callback','fm_dirset diredit', ... 'CreateFcn','set(gcbo,''String'',pwd); set(gcf,''UserData'',pwd)', ... 'FontName','Helvetica', ... 'HorizontalAlignment','left', ... 'Position',[0.18023 0.88054 0.7 0.052023], ... 'String',pwd, ... 'Style','edit', ... 'Tag','EditText1');h1 = uicontrol('Parent',h0, ... 'Units', 'normalized', ... 'BackgroundColor',Theme.color03, ... 'Callback','fm_dirset convert', ... 'FontWeight','bold', ... 'ForegroundColor',Theme.color09, ... 'Position',[0.70349 0.25626 0.26163 0.090559], ... 'String','Convert', ... 'Tag','Pushbutton1');h1 = uicontrol('Parent',h0, ... 'Units', 'normalized', ... 'BackgroundColor',Theme.color04, ... 'ForegroundColor',Theme.color05, ... 'Callback','fm_dirset chformat', ... 'Position',[0.039244 0.33333 0.27035 0.040462], ... 'String',formati, ... 'Style','popupmenu', ... 'Tag','PopupMenu1', ... 'Value',1);h1 = uicontrol('Parent',h0, ... 'Units', 'normalized', ... 'BackgroundColor',Theme.color04, ... 'CreateFcn','fm_dirset fileinit', ... 'ButtonDownFcn','fm_dirset convert', ... 'Callback', 'if strcmp(get(Fig.dir,''SelectionType''),''open''),fm_dirset view,end', ... 'FontName',Theme.font01, ... 'ForegroundColor',Theme.color07, ... 'Max',201, ... 'Position',[0.37064 0.050096 0.2718 0.69364], ... 'Style','listbox', ... 'String',cell(0,1), ... 'Tag','Listbox2', ... 'Value',1);h1 = uicontrol('Parent',h0, ... 'Units', 'normalized', ... 'BackgroundColor',Theme.color01, ... 'Enable','inactive', ... 'Position',[0.039244 0.12717 0.27035 0.040462], ... 'String','Translate to PSAT format', ... 'Style','checkbox', ... 'Tag','Checkbox1', ... 'Value',1);h1 = uicontrol('Parent',h0, ... 'Units', 'normalized', ... 'BackgroundColor',Theme.color01, ... 'HorizontalAlignment','left', ... 'Position',[0.039244 0.25 0.2718 0.036609], ... 'Enable','off', ... 'String','Translate PSAT file to:', ... 'Style','text', ... 'Tag','StaticText2');h1 = uicontrol('Parent',h0, ... 'Units', 'normalized', ... 'BackgroundColor',Theme.color01, ... 'Position',[0.039244 0.20424 0.27035 0.040462], ... 'Enable','off', ... 'String',frompsat, ... 'Style','popupmenu', ... 'Tag','Checkbox2', ... 'Value', 1);h1 = uicontrol('Parent',h0, ... 'Units', 'normalized', ... 'BackgroundColor',Theme.color01, ... 'Position',[0.039244 0.050096 0.27035 0.040462], ... 'String','Attach original format', ... 'Style','checkbox', ... 'Tag','Checkbox3');h1 = uicontrol('Parent',h0, ... 'Units', 'normalized', ... 'BackgroundColor',Theme.color01, ... 'HorizontalAlignment','left', ... 'Position',[0.039244 0.88247 0.13081 0.050096], ... 'String','Current path:', ... 'Style','text', ... 'Tag','StaticText1');h1 = uicontrol('Parent',h0, ... 'Units', 'normalized', ... 'BackgroundColor',Theme.color01, ... 'HorizontalAlignment','left', ... 'Position',[0.039244 0.77842 0.27035 0.050096], ... 'String','Folders in current path:', ... 'Style','text', ... 'Tag','StaticText1');h1 = uicontrol('Parent',h0, ... 'Units', 'normalized', ... 'BackgroundColor',Theme.color01, ... 'HorizontalAlignment','left', ... 'Position',[0.039244 0.38536 0.2718 0.036609], ... 'String','Filters:', ... 'Style','text', ... 'Tag','StaticText1');h1 = uicontrol('Parent',h0, ... 'Units', 'normalized', ... 'BackgroundColor',Theme.color01, ... 'HorizontalAlignment','left', ... 'Position',[0.37064 0.77842 0.2718 0.050096], ... 'String','Files in current path:', ... 'Style','text', ... 'Tag','StaticText1');h1 = uicontrol('Parent',h0, ... 'Units', 'normalized', ... 'BackgroundColor',Theme.color04, ... 'ButtonDownFcn','fm_dirset chndir', ... 'Callback', 'fm_dirset dirsel', ... 'CreateFcn','fm_dirset dirinit', ... 'FontName',Theme.font01, ... 'ForegroundColor',Theme.color05, ... 'Max',201, ... 'Position',[0.039244 0.45279 0.2718 0.29094], ... 'String', cell(0,1), ... 'Style','listbox', ... 'Tag','Listbox1', ... 'Value',1);h1 = uicontrol('Parent',h0, ... 'Units', 'normalized', ... 'BackgroundColor',Theme.color02, ... 'Callback','fm_dirset view', ... 'Position',[0.70349 0.15222 0.26163 0.090559], ... 'String','View File', ... 'Tag','Pushbutton2');h1 = uicontrol('Parent',h0, ... 'Units', 'normalized', ... 'BackgroundColor',Theme.color02, ... 'Callback', 'close(gcf);', ... 'Position',[0.70349 0.050096 0.26163 0.090559], ... 'String','Close', ... 'Tag','Pushbutton3');h1 = uicontrol('Parent',h0, ... 'CData', fm_mat('misc_folder'), ... 'Units', 'normalized', ... 'BackgroundColor',Theme.color02, ... 'Callback','fm_dirset getfolder', ... 'Position',[0.9164 0.875 0.065/1.333 0.065], ... 'TooltipString','Get folder', ... 'Tag','Pushbutton4');if Settings.hostver < 6.5 set(h1,'Enable','off')end% Menu Fileh1 = uimenu('Parent',h0, ... 'Label','File', ... 'Tag','U2');h2 = uimenu('Parent',h1, ... 'Callback','close(gcf);', ... 'Label','Close', ... 'Tag','S24', ... 'Accelerator','x');% Menu Edith1 = uimenu('Parent',h0, ... 'Label','Edit', ... 'Tag','U3');h2 = uimenu('Parent',h1, ... 'Callback','fm_dirset convert', ... 'Label','Convert', ... 'Tag','S24', ... 'Accelerator','c');h2 = uimenu('Parent',h1,'Callback', ... 'hdl = findobj(Fig.dir,''Tag'',''Listbox1''); set(hdl,''Value'',1), fm_dirset chndir', ... 'Label','Refresh Folder', ... 'Tag','S24', ... 'Accelerator','r', ... 'Separator','on');h2 = uimenu('Parent',h1, ... 'Callback','fm_dirset chndir', ... 'Label','Change Folder', ... 'Tag','S24', ... 'Accelerator','z');h2 = uimenu('Parent',h1, ... 'Callback','fm_dirset getfolder', ... 'Label','Get Folder', ... 'Tag','S24', ... 'Accelerator','g');if Settings.hostver < 6.5 set(h2,'Enable','off')endh2 = uimenu('Parent',h1, ... 'Callback', 'hdl = findobj(Fig.dir,''Tag'',''Listbox1''); set(hdl,''Value'',2), fm_dirset chndir', ... 'Label','Back Folder', ... 'Tag','S24', ... 'Accelerator','b');% Menu Viewh1 = uimenu('Parent',h0, ... 'Label','View', ... 'Tag','U3');h2 = uimenu('Parent',h1, ... 'Callback','fm_dirset view', ... 'Label','View File', ... 'Tag','S24', ... 'Accelerator','v');h2 = uimenu('Parent',h1, ... 'Callback','fm_tviewer', ... 'Label','Text Viewer', ... 'Tag','OTV', ... 'Accelerator','t');if nargout > 0, fig = h0; end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -