function [ outData ] = transformTrajectoryScope( inData )
%transformTrajectoryScope is called during automatic replacement of the Discrete-Time 
% Signal Trajectory Scope with Constellation Diagram blocks in the commsink2 and 
% commviewers2 libraries. This function ensures that Constellation Diagram blocks 
% originating from Discrete-Time Signal Trajectory Scope blocks have 'ShowTrajectory' = true. 
% For more info regarding transformation functions, see:
% web(fullfile(docroot, 'simulink/ug/creating-block-libraries.html#brkngxr-6'))

%   Copyright 2014 The MathWorks, Inc.

outData.NewBlockPath = '';
outData.NewInstanceData = [];

instanceData = inData.InstanceData;
% Get the field type 'Name' from instanceData
[ParameterNames{1:length(instanceData)}] = instanceData.Name;

if (~ismember('ShowTrajectory',ParameterNames))
    % ShowTrajectory is not present in old link. Set it to true for automatic
    % block replacement of Discrete-Time Signal Trajectory Scope blocks
    instanceData(end+1).Name = 'ShowTrajectory';
    instanceData(end).Value = 'true';
end

outData.NewInstanceData = instanceData;

end

