function [designObjSL, designObjSF] = topMdlReplacementMdlElementsMap( testcomp, repBlkH )
%

%    Copyright 2014-2018 The MathWorks, Inc.

% For the given replacement block 'repBlkH' in the replacement model, this
% function computes corresponding block it replaced in the top model.

% Note that API is transperant to the case whether replaement model is
% generated or not; i.e. repBlkH may be infact a block from original design
% model. In that case, the generated handles are identical to the ones in original
% model.

% replBlkH = struct('slBlkH', 'sfObjId', 'isStateflow')

designObjSL = 0;
designObjSF = 0;

if repBlkH.slBlkH~=0
    designObjSL = Sldv.DataUtils.getDesignObject(testcomp, repBlkH.slBlkH);
    % For 'test objective' block, this is the only way to get access to top
    % level block handle.
    designObjSL = sldvprivate('get_sldv_block', designObjSL);
end

if repBlkH.isStateflow
    designObjSF = Sldv.DataUtils.getDesignObject(testcomp, repBlkH.sfObjId);
end



end

