function [outData] = commAWGNChannelTransform(inData)
%commAWGNChannelTransform Transform function for AWGN Channel pre-R2023a to
%R2023a

% Copyright 2022 The MathWorks, Inc.

%#ok<*AGROW>
InstanceData = inData.InstanceData;
oldBlockParams = {InstanceData.Name};
cnt = 1;
newInstanceData(cnt) = struct( ...
  'Name', 'LegacyMode', ...
  'Value', 'on');
cnt = cnt+1;

varSrc = '';
for p=1:length(oldBlockParams)
  switch oldBlockParams{p}
    case 'seed'
      newInstanceData(cnt) = struct( ...
        'Name',  'Seed', ...
        'Value', InstanceData(p).Value);
    case 'noiseMode'
      newInstanceData(cnt) = struct( ...
        'Name',  'noiseMode', ...
        'Value', InstanceData(p).Value);
    case 'EbNodB'
      newInstanceData(cnt) = struct( ...
        'Name',  'EbNo', ...
        'Value', InstanceData(p).Value);
    case 'EsNodB'
      newInstanceData(cnt) = struct( ...
        'Name',  'EsNo', ...
        'Value', InstanceData(p).Value);
    case 'SNRdB'
      newInstanceData(cnt) = struct( ...
        'Name',  'SNR', ...
        'Value', InstanceData(p).Value);
    case 'bitsPerSym'
      newInstanceData(cnt) = struct( ...
        'Name',  'BitsPerSymbol', ...
        'Value', InstanceData(p).Value);
    case 'Ps'
      newInstanceData(cnt) = struct( ...
        'Name',  'SignalPower', ...
        'Value', InstanceData(p).Value);
    case 'Tsym'
      newInstanceData(cnt) = struct( ...
        'Name',  'SymbolPeriod', ...
        'Value', InstanceData(p).Value);
    case 'variance'
      newInstanceData(cnt) = struct( ...
        'Name',  'Variance', ...
        'Value', InstanceData(p).Value);
    otherwise
      cnt = cnt - 1;
  end
  cnt = cnt + 1;
end
if ~isempty(varSrc)
  newInstanceData(cnt) = struct( ...
    'Name',  'VarianceSource', ...
    'Value', varSrc);
end

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