function isVisible = overrunDetectionVisibleCallback(hObj, overrunDetection, action)
% Decides visibility of overrun detection config set parameters
% Copyright 2020-2021 The MathWorks, Inc.

isVisible = 0;
if codertarget.target.isCoderTarget(hObj.getConfigSet())
    if codertarget.data.isValidParameter(hObj, overrunDetection)
        overrundetection_data = codertarget.data.getParameterValue(hObj, overrunDetection);
        if strcmp(action,'Check_GPIO_Status')
            isVisible = isequal(overrundetection_data.Enable_overrun_detection,1)&& isequal(overrundetection_data.Check_GPIO_Status,1);
        elseif strcmp(action,'Call_ISR')
            isVisible = isequal(overrundetection_data.Enable_overrun_detection,1)&& strcmp(overrundetection_data.Custom_Logic,'Trigger interrupt');
        elseif strcmp(action,'Call_Custom_Function')
            isVisible = isequal(overrundetection_data.Enable_overrun_detection,1)&& strcmp(overrundetection_data.Custom_Logic,'Call user-defined function');
        else
            isVisible = isequal(overrundetection_data.Enable_overrun_detection,1);
        end
    end
end
end