function dummy = savecomp(LoopData,Name)
%SAVECOMP  Stores compensator design.
%
%   See also SISOTOOL.

%   Author(s): P. Gahinet
%   Copyright 1986-2000 The MathWorks, Inc.
%   $Revision: 1.2 $  $Date: 2000/06/14 20:18:29 $

% REVISIT
dummy = [];

% Add design to list
Designs = LoopData.SavedDesigns;
idx = size(Designs,1)+1;
Designs(idx,:).Name = Name;
Designs(idx,:).Configuration = LoopData.Configuration;
Designs(idx,:).FeedbackSign = LoopData.FeedbackSign;
Designs(idx,:).Plant = ...
    struct('Name',LoopData.Plant.Name,'Model',LoopData.Plant.Model);
Designs(idx,:).Sensor = ...
    struct('Name',LoopData.Sensor.Name,'Model',LoopData.Sensor.Model);
Designs(idx,:).PreFilter = ...
    struct('Name',LoopData.PreFilter.Name,'Model',LoopData.PreFilter.Model);
Designs(idx,:).Compensator = ...
    struct('Name',Name,'Model',zpk(LoopData.Compensator));

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

% Update design history
LoopData.SavedDesigns = Designs;

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

