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

    function pDoSetMap(obj, mapsI)
%PDOSETMAP  Private method.

%  Implementation for setMap.

%  Copyright 2000-2005 The MathWorks, Inc.


% Get identifiers of inbound (I) and existing (E) items
identifiersI = get(mapsI, {'Identifier'}); % identifiers of incoming items
mapsE = obj.Maps; % existing items
identifiersE = get(mapsE, {'Identifier'});

% Get identifiers of inbound (I) and existing (E) referenced items
xAxisIdentifiersI = get(mapsI, {'XAxisIdentifier'});
yAxisIdentifiersI = get(mapsI, {'YAxisIdentifier'});
axisIdentifiersI = unique([xAxisIdentifiersI, yAxisIdentifiersI]);
axesE = obj.Axes;
axisIdentifiersE = get(axesE, {'Identifier'});

if numel(mapsI) > 1 && obj.phHasDuplicates(identifiersI)
    % Items to add have duplicate identifiers
    error(message('mbc:calibrationdata:calibration:InvalidOperation17'))
elseif any(~ismember(axisIdentifiersI, axisIdentifiersE))
    % Incoming item references non-existent dependent
    error(message('mbc:calibrationdata:calibration:InvalidOperation18'))
else
    [match, position] = ismember(identifiersI, identifiersE);
    if any(~match)
        error(message('mbc:calibrationdata:calibration:ObjectNotFound11'))
    else
        % Copy
        mapsI = copy(mapsI);
        % Strip out calibration interface
        mapsI.pClearCalibrationInterface;
        % Set
        mapsE(position) = mapsI;
        obj.Maps = mapsE;
    end
end