function setSfunSystemObject(obj, propName, propValue, noTuningError)
%MATLAB Code Generation Library function.
% Implement set method for System objects.

%   Copyright 2007-2014 The MathWorks, Inc.
%#codegen

coder.inline('always');

eml_invariant(nargin == 4 && ~isstruct(propName), ...
    'MATLAB:system:unsupportedSetCodegen');
  
checkSystemObjectInput(obj, 'set');

eml_invariant(eml_is_const(propName), ...
  'MATLAB:system:propNameNotConstCodegen');

eml_invariant(eml_is_const(size(propValue)), ...
  'MATLAB:system:sfunPropTunableSpecsChangedCodegen');


comp = eml_sea_get_obj(obj);
coder.extrinsic('sysObjIsSameSizeAsProp');
eml_invariant( ...
  coder.const(sysObjIsSameSizeAsProp(comp,propName,size(propValue))), ...
  'MATLAB:system:sfunPropTunableSpecsChangedCodegen');

eml_sea_method_call('set', obj, propName, propValue, noTuningError);

