function freblkCallbackAutogenPRBSParams(blk)
%   Callback function of FRE block

%   Copyright 2023 The MathWorks, Inc.

% Obtain choices whether to use autogeneration of PRBS parameters
UseAutogenNumOfPRBSPeriod = strcmpi(get_param(blk,'UseAutogenNumOfPRBSPeriod'),'on');
UseAutogenPRBSSignalOrder = strcmpi(get_param(blk,'UseAutogenPRBSSignalOrder'),'on');
% Enable edit fields based on the choices
maskObj = Simulink.Mask.get(blk);
objectNumOfPRBSPeriod = maskObj.Parameters.findobj('Name','NumOfPRBSPeriod');
objectPRBSSignalOrder = maskObj.Parameters.findobj('Name','PRBSSignalOrder');
if UseAutogenNumOfPRBSPeriod
    objectNumOfPRBSPeriod.Enabled = 'off';
else
    objectNumOfPRBSPeriod.Enabled = 'on';
end
if UseAutogenPRBSSignalOrder
    objectPRBSSignalOrder.Enabled = 'off';
else
    objectPRBSSignalOrder.Enabled = 'on';
end