function freblkCallbackExperimentMode(blk)
%   Callback function of FRE block

%   Author: R. Chen
%   Copyright 2018 The MathWorks, Inc.

IsExternalSource = strcmpi(get_param(blk,'SineSource'),slsvInternal('slsvGetEnStringFromCatalog','Slcontrol:onlinefre:rbtnElementPort'));
IsSinestream = strcmpi(get_param(blk,'ExperimentMode'),slsvInternal('slsvGetEnStringFromCatalog','Slcontrol:onlinefre:rbtnElementSS'));
IsOnlineEstimation = strcmpi(get_param(blk,'EstimationMode'),slsvInternal('slsvGetEnStringFromCatalog','Slcontrol:onlinefre:rbtnElementOnline'));
IsHz = strcmpi(get_param(blk,'FreqUnits'),'hz');
% switch experiment settings panel depending on mode selection
maskObj = Simulink.Mask.get(blk);
objectSS = maskObj.getDialogControl('SSPanel');
objectSI = maskObj.getDialogControl('SIPanel');
if IsSinestream
    objectSI.Visible = 'off';
    objectSS.Visible = 'on';
else
    objectSI.Visible = 'on';
    objectSS.Visible = 'off';
end
% update experiment length display
wksp = getWorkspaceVariables(maskObj);
W = wksp(strcmp('Frequencies',{wksp.Name})).Value;
EP = wksp(strcmp('NumOfEstPeriod',{wksp.Name})).Value;
SP = wksp(strcmp('NumOfSetPeriod',{wksp.Name})).Value;
Ts = wksp(strcmp('DiscreteTs',{wksp.Name})).Value;
freblkUpdateLength(blk,IsExternalSource,IsSinestream,IsHz,W,EP,SP,Ts);
