function dummy = loadcomp(LoopData,DesignIndex)
%LOADCOMP  Retrieves given compensator design.
%
%   See also SISOTOOL.

%   Author(s): P. Gahinet
%   Copyright 1986-2000 The MathWorks, Inc.
%   $Revision: 1.3 $  $Date: 2000/08/23 16:40:43 $

% REVISIT
dummy = [];

if DesignIndex>length(LoopData.SavedDesigns)
    return
else
    Design = LoopData.SavedDesigns(DesignIndex);
end

% Start transaction
T = handle.transaction(get(findpackage('sisodata'),'DefaultDatabase'));
set(T,'Name','Retrieve Compensator','OperationStore','on','InverseOperationStore','on');

% Update data
LoopData.Configuration = Design.Configuration;
LoopData.FeedbackSign = Design.FeedbackSign;
importdata(LoopData,Design.Plant,Design.Sensor,Design.PreFilter,Design.Compensator);

% Commit and register transaction
register(LoopData,T);

% Notify peers of data change
dataevent(LoopData,'all');
