Model Services

EcucDefinitionAccess

The IEcucDefinitionAccess provides convenient and typesafe access to definition objects (module, container, parameter and reference definitions). The contained def() methods take MDF definition objects and return wrappers which can be used to retrieve specific characteristics of definitions.

Example:

  IEcucDefinitionAccess eda;
  MIIntegerParamDef intParamDef;

  // Get the integer definition wrapper
  IEcucIntegerDefinition def = eda.def(intParamDef);

  // Get the (optional) default value
  Optional<BigInteger> defaultOpt = def.getDefault();
  boolean hasDefault = defaultOpt.isPresent();
     BigInteger defaultValue = defaultOpt.get();

  // Get the multiplicity
  IEcucDefMultiplicity multiplicity = def.getMultiplicity();
  BigInteger lower = multiplicity.getLower();
  BigInteger upper = multiplicity.getUpper();

EcuConfigurationAccess

The IEcuConfigurationAccess provides convenient and typesafe access to configuration objects (modules, containers, parameters and references). The contained cfg() methods take MDF (ECU configuration) objects and return wrappers which can be used to retrieve specific characteristics of the configuration content.

Example:

IEcuConfigurationAccess eca;
MINumericalValue intParam;

// Get the parameter wrapper
IEcucNumericalParameter numCfg = eca.cfg(intParam);

// Check if this is an integer parameter
if (numCfg instanceof IEcucIntegerParameter) {
    IEcucIntegerParameter intCfg = (IEcucIntegerParameter) numCfg;

    // Get the parameter value
    boolean hasValue = intCfg.hasValue();
    BigInteger value = intCfg.getValue();

    // Get the related definition wrapper
    IEcucIntegerDefinition def = intCfg.getEcucDefinition();
}