function outData = commMILQAMDemodTransform(inData)
%COMMMILQAMDEMODTRANSFORM Transform function for MIL-188 QAM Demodulator
%Block from R2019a to R2019b

% Copyright 2018-2019 The MathWorks, Inc.

InstanceData = inData.InstanceData;
oldBlockParams = {InstanceData.Name};

outData.NewInstanceData = InstanceData;
[~, pOTIdx] = find(strcmp('OutputType', oldBlockParams));
% Demod specific parameter mapping from old block to new block
if ~isempty(pOTIdx)
    [~, pDCTIdx] = find(strcmp('DecisionType', oldBlockParams));
    pOTVal = InstanceData(pOTIdx).Value;
    pDCTVal = InstanceData(pDCTIdx).Value;
    isInt = strcmp(pOTVal,'Integer');
    % Find OutputDataType* property name to map to CodeIDF
    if isInt
        pODTTypeName = ['OutputDataType' pOTVal(1:3)];
    elseif ~isInt && strcmp(pDCTVal,'Hard decision')
        pODTTypeName = ['OutputDataType' pOTVal(1:3)];
    else
        pODTTypeName = 'OutputDataTypeSoft';
    end
    [~, paramIdx] = find(strcmp(pODTTypeName,{outData.NewInstanceData.Name}));
    if ~isempty(paramIdx)
        outData.NewInstanceData(paramIdx).Name = 'OutputDataType';
    end
    [~,outDTypeOldList] = find(strncmpi({outData.NewInstanceData.Name},'OutputDataType',14));
    if ~isempty(outDTypeOldList)
        if ~isempty(paramIdx)
            outDTypeOldList(outDTypeOldList == paramIdx) = [];
        end
        outData.NewInstanceData(outDTypeOldList) = [];
    end
end
outData.NewBlockPath = inData.ForwardingTableEntry.('__slOldName__');
end
