function updateParamInfo(testComp, parametersToInline)
% Update the flat parameter information to keep track of only the tunable
% parameters

%   Copyright 2022 The MathWorks, Inc.

    parameterArray = testComp.mdlFlatIOInfo.Parameter;
    for idx = 1:length(parametersToInline)
        paramName = parametersToInline(idx).name;

        allParamNames = {parameterArray.name};
        paramToInlineIdx = contains(allParamNames, paramName);
        if any(paramToInlineIdx)
            parameterArray(paramToInlineIdx) = parameterArray(end);
            parameterArray(end) = [];
        end
    end
    testComp.mdlFlatIOInfo.Parameter = parameterArray;
    paramMap = containers.Map();
    for idx = 1:length(parameterArray)
        paramMap(parameterArray(idx).name) = idx;
    end
    testComp.mdlFlatIOInfo.ParamNameMap = paramMap;
end

