classdef (CaseInsensitiveProperties = true, TruncatedProperties = true) stabsep < ltioptions.StableUnstableSplit
    % Options set for the STABSEP command.
    
    % Copyright 2009-2023 The MathWorks, Inc.
    
    properties
        % Focus of stable/unstable decomposition [{'stable'} | 'unstable']
        Focus = 'stable';
    end
    
    
    properties (Dependent, Hidden)
       % Obsolete STABSEP option
       Mode  % Mode=1,2 <=> Focus = 'stable','unstable'
    end
    
    methods
        
       function this = stabsep()
          % Constructor
          this = this@ltioptions.StableUnstableSplit();
          this.Offset = 0;  % default for STABSEP
       end
       
       function this = set.Focus(this,value)
          % SET method for Focus option
          F = ltipack.matchKey(value,{'stable','unstable'});
          if isempty(F)
             error(message('Control:transformation:stabsep6'))
          else
             this.Focus = F;
          end
       end
       
       function value = get.Mode(this)
          value = find(strcmp(this.Focus,{'stable','unstable'}));
       end

       function this = set.Mode(this,value)
          % SET method for obsolete MODE option
          if ~(isnumeric(value) && isscalar(value) && any(value==[1 2]))
             error(message('Control:transformation:stabsep4'))
          end
          EnumList = {'stable','unstable'};
          this.Focus = EnumList{value};
       end
       
       function boo = wantStable(this)
          boo = (this.Focus(1)=='s');  % for STABSEP support
       end
    end
    
    methods (Access = protected)
       function cmd = getCommandName(~)
          cmd = 'stabsep';
       end       
    end
    
end