function updateParam(this, name, constr)
%

%   Copyright 2013-2020 The MathWorks, Inc.

    constr = deblank(constr);
    assert(~isempty(this.ParamStruct))
    try
        if slavteng('feature','BusParameterTuning')
            param = this.getParamObjByName(name);
        else
            param = this.ParamStruct.(name);
        end
    catch
        error(message('Sldv:Parameters:NoParamToUpdate', name))
    end
    if ~isempty(constr)
        % Add param to config        
        param.Constraint = constr;            
        this.IsInConfig(param.Name) = 1;           
    else
        % The constaint is deleted. If the parameter is used in analysis (checked), 
        % put the constraint as '[]' else remove param from config.
        if this.isParamUsedInAnalysis(name)
            param.Constraint = '[]';
        else
        param.Constraint = '';
            this.removeFromConfig(param);
        end
    end
end
