function schema
%SCHEMA  Definition of @TimePlotOptions 
% Options for @timeplot

%  Author(s): C. Buhr
%  Copyright 1986-2004 The MathWorks, Inc.
%  $Revision: 1.1.6.1 $ $Date: 2004/12/26 21:52:35 $

% Register class 
pkg = findpackage('plotopts');
superclass = findclass(pkg, 'RespPlotOptions');
c = schema.class(pkg, 'TimePlotOptions', superclass);

% Public attributes
p = schema.prop(c, 'Normalize', 'on/off');  
p.FactoryValue = 'off';

p = schema.prop(c, 'SettleTimeThreshold', 'MATLAB array');  
p.setfunction = {@LocalSetSettleTimeThreshold};
p.FactoryValue = .02;

p = schema.prop(c, 'RiseTimeLimits', 'MATLAB array');
p.setfunction = {@LocalSetRiseTimeLimits};
p.FactoryValue = [.10 .90];



%----------------------LOCAL SET FUCTIONS---------------------------------%

% ------------------------------------------------------------------------%
% Function: LocalSetSettleTimeThreshold
% Purpose:  Error handling of setting SettleTimeThreshold property
% ------------------------------------------------------------------------%
function valueStored = LocalSetSettleTimeThreshold(this, ProposedValue)
if isnumeric(ProposedValue) && isscalar(ProposedValue) && ...
        isreal(ProposedValue) && isfinite(ProposedValue)
    valueStored = ProposedValue;
else
    error('CST:PlotOptions', ...
        sprintf('SettleTimeThreshold must be a real scalar value between 0 and 1.'))
end

% ------------------------------------------------------------------------%
% Function: LocalSetRiseTimeLimits
% Purpose:  Error handling of setting RiseTimeLimits property
% ------------------------------------------------------------------------%
function valueStored = LocalSetRiseTimeLimits(this, ProposedValue)
if isnumeric(ProposedValue) && all((size(ProposedValue)==[1,2]))
    valueStored = ProposedValue;
else
    error('CST:PlotOptions', ...
    sprintf('RiseTimeLimits must be a real 1-by-2 vector with values between 0 and 1.'))
end