function updateCLIWithModelProps(this, model)
% Create CLI object and update code gen parameters from model if any

%   Copyright 2006-2013 The MathWorks, Inc.

if nargin == 1
    model = this.getModelName; 
end

if ~isempty(model)
    this.applyCodegenParamsFromMdl(model);
    % Do not load props from CLI to other dialogs if separate CLIs exist
    % for a configset and attached configset cache object.  These both
    % point to the same hdledas and hdltb object, so the CLIs may need to
    % have separate values.
    if ~isempty(this.getConfigSet) && strcmp(this.IsDialogCache, 'off') && ...
            ~isempty(this.getConfigSet.getConfigSetCache) && ...
            ~isempty(this.getConfigSet.getConfigSetCache.getComponent('HDL Coder').getCLI)
        return;
    else
        this.loadPropsFromCLI;
    end
end
end
