classdef (Hidden) PlotEnum    
    % Plot enumeration for plot types that are used in Model Reducer
    % App.
    
    % Copyright 2015 The MathWorks, Inc.    
    
    enumeration
        % Plot names
        Bode ('bode')
        Nichols ('nichols')
        Nyquist ('nyquist')
        Step ('step')
        Impulse ('impulse')
        SingularValue ('sigma')
        PoleZeroMap ('pzmap')
        IOPoleZeroMap ('iopzmap')        
    end
    properties
        Tag
    end
    methods
        function obj = PlotEnum(tag)
            obj.Tag = tag;
        end
    end
    
    methods (Static)
        function plotenum = getPlot(tag)
            if strcmp(tag,mrtool.PlotEnum.Bode.Tag)
                plotenum = mrtool.PlotEnum.Bode;
            elseif strcmp(tag,mrtool.PlotEnum.Nichols.Tag)
                plotenum = mrtool.PlotEnum.Nichols;
            elseif strcmp(tag,mrtool.PlotEnum.Nyquist.Tag)
                plotenum = mrtool.PlotEnum.Nyquist;
            elseif strcmp(tag,mrtool.PlotEnum.Step.Tag)
                plotenum = mrtool.PlotEnum.Step;
            elseif strcmp(tag,mrtool.PlotEnum.Impulse.Tag)
                plotenum = mrtool.PlotEnum.Impulse;
            elseif strcmp(tag,mrtool.PlotEnum.SingularValue.Tag)
                plotenum = mrtool.PlotEnum.SingularValue;
            elseif strcmp(tag,mrtool.PlotEnum.PoleZeroMap.Tag)
                plotenum = mrtool.PlotEnum.PoleZeroMap;
            elseif strcmp(tag,mrtool.PlotEnum.IOPoleZeroMap.Tag)
                plotenum = mrtool.PlotEnum.IOPoleZeroMap;
            else
                plotenum = [];
            end
        end
        function icon = getIcon(tag,islarge)
            if nargin<2
                islarge = true;
            end
            switch tag
                case 'bode'
                    if islarge
                        icon = mrtool.guiutil.getmrToolIcon('PlotBodeLarge');
                    else
                        icon = mrtool.guiutil.getmrToolIcon('PlotBodeSmall');
                    end
                case 'nichols'
                    if islarge
                        icon = mrtool.guiutil.getmrToolIcon('PlotNicholsLarge');
                    else
                        icon = mrtool.guiutil.getmrToolIcon('PlotNicholsSmall');
                    end
                case 'nyquist'
                    if islarge
                        icon = mrtool.guiutil.getmrToolIcon('PlotNyquistLarge');
                    else
                        icon = mrtool.guiutil.getmrToolIcon('PlotNyquistSmall');
                    end
                case 'step'
                    if islarge
                        icon = mrtool.guiutil.getmrToolIcon('PlotStepLarge');
                    else
                        icon = mrtool.guiutil.getmrToolIcon('PlotStepSmall');
                    end
                case 'impulse'
                    if islarge
                        icon = mrtool.guiutil.getmrToolIcon('PlotImpulseLarge');
                    else
                        icon = mrtool.guiutil.getmrToolIcon('PlotImpulseSmall');
                    end
                case 'sigma'
                    if islarge
                        icon = mrtool.guiutil.getmrToolIcon('PlotSigmaLarge');
                    else
                        icon = mrtool.guiutil.getmrToolIcon('PlotSigmaSmall');
                    end
                case 'pzmap'
                    if islarge
                        icon = mrtool.guiutil.getmrToolIcon('PlotPZLarge');
                    else
                        icon = mrtool.guiutil.getmrToolIcon('PlotPZSmall');
                    end
                case 'iopzmap'
                    if islarge
                        icon = mrtool.guiutil.getmrToolIcon('PlotIOPZLarge');
                    else
                        icon = mrtool.guiutil.getmrToolIcon('PlotIOPZSmall');
                    end
            end
        end
        function plottypes = getPlotTypes(isfrd)
            if isfrd
                plottypes = [mrtool.PlotEnum.Bode;...
                    mrtool.PlotEnum.Nichols;...
                    mrtool.PlotEnum.Nyquist;];
            else
                plottypes = [mrtool.PlotEnum.Step;...
                    mrtool.PlotEnum.Bode;...
                    mrtool.PlotEnum.Impulse;...
                    mrtool.PlotEnum.Nyquist;...
                    mrtool.PlotEnum.Nichols;...
                    mrtool.PlotEnum.SingularValue;...
                    mrtool.PlotEnum.PoleZeroMap;...
                    mrtool.PlotEnum.IOPoleZeroMap];
            end
        end
    end
    
end