function outData = commPhaseNoiseTransform(inData)
%COMMPHASENOISETRANSFORM Transformation function from a subsystem-based
%Phase Noise block to a System object-based Phase Noise block.

% Copyright 2018 The MathWorks, Inc.

%#ok<*AGROW>
InstanceData = inData.InstanceData;
oldBlockParams = {InstanceData.Name};

for p=1:length(oldBlockParams)
  switch oldBlockParams{p}
    case 'PhNs'
      newInstanceData(p) = struct( ...
        'Name',  'Level', ...
        'Value', InstanceData(p).Value);
    case 'Fo'
      newInstanceData(p) = struct( ...
        'Name',  'FrequencyOffset', ...
        'Value', InstanceData(p).Value);
    case 'Fs'
      newInstanceData(p) = struct( ...
        'Name',  'SampleRate', ...
        'Value', InstanceData(p).Value);
    case 'seed'
      newInstanceData(p) = struct( ...
        'Name',  'Seed', ...
        'Value', InstanceData(p).Value);
    otherwise
      newInstanceData(p) = InstanceData(p);
  end
end

outData.NewBlockPath = '';
outData.NewInstanceData = newInstanceData;

% EOF