function freblkUpdateVariant(blk,Ts)
%   Utility function of FRE block

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

IsOutputCD = strcmpi(get_param(blk,'OutputMode'),slsvInternal('slsvGetEnStringFromCatalog','Slcontrol:onlinefre:rbtnElementCplusD'));
IsSinestream = strcmpi(get_param(blk,'ExperimentMode'),slsvInternal('slsvGetEnStringFromCatalog','Slcontrol:onlinefre:rbtnElementSS'));
IsOnlineEstimation = strcmpi(get_param(blk,'EstimationMode'),slsvInternal('slsvGetEnStringFromCatalog','Slcontrol:onlinefre:rbtnElementOnline'));
UseBodePlot = strcmpi(get_param(blk,'UseBodePlot'),'on');
% Select variant subsystem for Experiment/Estimation and BodePlot
if IsSinestream
    if IsOnlineEstimation
        if UseBodePlot && Ts>0
            set_param(blk,'ExperimentChoice','VariantSS','BodePlotChoice','VariantBode');
        else
            set_param(blk,'ExperimentChoice','VariantSS','BodePlotChoice','VariantNull');
            if Ts==-1
                fprintf('%s\n',getString(message('Slcontrol:onlinefre:warnNoBodePlot')));
            end
        end
    else
        set_param(blk,'ExperimentChoice','VariantSSNoEst','BodePlotChoice','VariantNull');
    end
else
    if IsOnlineEstimation    
        if UseBodePlot && Ts>0
            set_param(blk,'ExperimentChoice','VariantSI','BodePlotChoice','VariantBode');
        else
            set_param(blk,'ExperimentChoice','VariantSI','BodePlotChoice','VariantNull');
            if Ts==-1
                fprintf('%s\n',getString(message('Slcontrol:onlinefre:warnNoBodePlot')));
            end
        end
    else
        set_param(blk,'ExperimentChoice','VariantSINoEst','BodePlotChoice','VariantNull');
    end
end
if IsOutputCD
    set_param(blk,'OutputChoice','VariantCandD');
else
    set_param(blk,'OutputChoice','VariantDonly');
end
