xxsimQuerySettings - Retrieve the settings of the active 20-sim model and tool session. Syntax: [settings, result] = xxsimQuerySettings(key) Inputs: key = the key to retrieve the setting for, if empty or omitted, retrieves all settings. Outputs: settings = array of settings that were requested. result = returns true when the setting has been retrieved successfully. Examples: settings = xxsimQuerySettings('model.simulator.integrationmethod') Query one setting. settings = xxsimQuerySettings({'model.simulator.integrationmethod', 'model.simulator.integrationmethod.Euler.stepsize'}) Query multiple settings. [settings, result] = xxsimQuerySettings({'model.simulator.integrationmethod'}) Query one setting and also ask for the result boolean. See also: xxsimSetSettings Author: Controllab Products B.V. email: info@controllab.nl Website: http://www.controllab.nl October 2014
0001 function [settings, result] = xxsimQuerySettings(varargin) 0002 % xxsimQuerySettings - Retrieve the settings of the active 20-sim model and tool session. 0003 % 0004 % Syntax: 0005 % [settings, result] = xxsimQuerySettings(key) 0006 % 0007 % Inputs: 0008 % key = the key to retrieve the setting for, if empty or omitted, retrieves all settings. 0009 % 0010 % Outputs: 0011 % settings = array of settings that were requested. 0012 % result = returns true when the setting has been retrieved successfully. 0013 % 0014 % Examples: 0015 % settings = xxsimQuerySettings('model.simulator.integrationmethod') 0016 % Query one setting. 0017 % settings = xxsimQuerySettings({'model.simulator.integrationmethod', 'model.simulator.integrationmethod.Euler.stepsize'}) 0018 % Query multiple settings. 0019 % [settings, result] = xxsimQuerySettings({'model.simulator.integrationmethod'}) 0020 % Query one setting and also ask for the result boolean. 0021 % 0022 % See also: xxsimSetSettings 0023 % 0024 % Author: Controllab Products B.V. 0025 % email: info@controllab.nl 0026 % Website: http://www.controllab.nl 0027 % October 2014 0028 0029 %------------- BEGIN CODE -------------- 0030 global xxsim; 0031 xxsimVerbose = 0; 0032 if exist('xxsim') 0033 xxsimVerbose = xxsim.verbose; 0034 end 0035 0036 % start with empy key list 0037 keys = {}; 0038 if length(varargin) > 1 0039 error('Too many input arguments.'); 0040 end 0041 if length(varargin) == 1 0042 if ~ischar(varargin{1}) 0043 keys = varargin{1}; 0044 else 0045 keys = {varargin{1}}; 0046 end 0047 end 0048 0049 % do the actual invoke 0050 settings = xrlinvoke('xxsim.querySettings', struct('keys', {{ keys, 'array' }})); 0051 0052 if size(settings) == 0 0053 result = 0; 0054 else 0055 result = 1; 0056 end; 0057 0058 end 0059 %------------- END CODE --------------