www.gusucode.com > mbcdata 工具箱 matlab 源码程序 > mbcdata/@calibrationdata/@calibratable/calibratable.m

    function obj = calibratable(varargin)
%CALIBRATABLE  Abstract base class for calibratable items.
%
%  Public properties are IDENTIFIER, NAME, DESCRIPTION, UNITS, FORMAT,
%  DATATYPE, UPPERLIMIT, LOWERLIMIT, DEFAULTVALUE, VALUE and READONLY.
%
%  Construction syntax is:
%  OBJ = CALIBRATIONDATA.CALIBRATABLE
%  OBJ = CALIBRATIONDATA.CALIBRATABLE(OBJ)
%  OBJ = CALIBRATIONDATA.CALIBRATABLE('PROPERTY', VALUE)

%  Copyright 2004-2007 The MathWorks, Inc.


% Allow construction from scratch or from an existing object
if nargin && isa(varargin{1}, 'calibrationdata.calibratable')
    obj = varargin{1};
    varargin(1) = [];
else
    obj = calibrationdata.calibratable;
    obj.Value = [];
    warning(message('mbc:calibrationdata:calibratable:InvalidState'));
end

% Attach listeners
listeners = [ ...
    handle.listener(obj, obj.findprop('DataType'), 'PropertyPostSet', obj.ListenerFunctionHandles{1}); ...
    handle.listener(obj, obj.findprop('LowerLimit'), 'PropertyPostSet', obj.ListenerFunctionHandles{2}); ...
    handle.listener(obj, obj.findprop('UpperLimit'), 'PropertyPostSet', obj.ListenerFunctionHandles{3}); ...
    handle.listener(obj, obj.findprop('Size'), 'PropertyPostSet', obj.ListenerFunctionHandles{4}); ...
    handle.listener(obj, obj.findprop('Value'), 'PropertyPostSet', obj.ListenerFunctionHandles{5}); ...
    handle.listener(obj, obj.findprop('DefaultValue'), 'PropertyPostSet', obj.ListenerFunctionHandles{6}) ...
    ];
set(listeners, 'CallbackTarget', obj);
obj.addListener(listeners);

% Allow property, value pairs to be passed into constructor
if length(varargin)
   set(obj, varargin{:});
end