0

I've been trying to develop an AUTOSAR 4.2.1 module to generate code using Xpand/Xtend. I'm using artext demonstrator 1.6.0. But my query is that the concept of defining a variation point is not found in the PDF(ECUConfigurationParameters.arxml) when I create a new Ecu platform project in the demonstrator (or maybe I'm not familiar with finding out how).

By default I'm able to fetch parameter values from an arxml. But when there is more than one value for a parameter which is defined in a different post build variant condition, I'm getting only the first value. For example, if the arxml contains this

<ECUC-NUMERICAL-PARAM-VALUE>
<DEFINITION-REF DEST="ECUC-BOOLEAN-PARAM-DEF"> /AUTOSAR/EcucDefs/Com/ComConfig/ComIPdu/ComIPduCancellationSuppo rt</DEFINITION-REF>
<VARIATION-POINT>
<POST-BUILD-VARIANT-CONDITIONS>
<POST-BUILD-VARIANT-CONDITION>
<MATCHING-CRITERION-REF DEST="POST-BUILD-VARIANT-CRITERION">/EcucDemo/PostBuildConfigSet</MATCHING-CRITERION-REF>
<VALUE>1</VALUE>
</POST-BUILD-VARIANT-CONDITION>
</POST-BUILD-VARIANT-CONDITIONS>
</VARIATION-POINT>
<VALUE>1</VALUE>
</ECUC-NUMERICAL-PARAM-VALUE>
<ECUC-NUMERICAL-PARAM-VALUE>
<DEFINITION-REF DEST="ECUC-BOOLEAN-PARAM-DEF"> /AUTOSAR/EcucDefs/Com/ComConfig/ComIPdu/ComIPduCancellationSuppo rt</DEFINITION-REF>
<VARIATION-POINT>
<POST-BUILD-VARIANT-CONDITIONS>
<POST-BUILD-VARIANT-CONDITION>
<MATCHING-CRITERION-REF DEST="POST-BUILD-VARIANT-CRITERION">/EcucDemo/PostBuildConfigSet</MATCHING-CRITERION-REF>
<VALUE>2</VALUE>
</POST-BUILD-VARIANT-CONDITION>
</POST-BUILD-VARIANT-CONDITIONS>
</VARIATION-POINT>
<VALUE>0</VALUE>
</ECUC-NUMERICAL-PARAM-VALUE>

it gives me value as 'true' in Xpand if I do Com.ComConfig.ComIpdus.ComIPduCancellationSupport. I’m unable to access the second value ‘false’.

How may I proceed to fetch the parameter values based on the post-build variant conditions?

I'm trying to do the following:

«DEFINE Gen1 FOR varianthandling::VariationPoint»
    «EXPAND Gen1::GetThings»
«ENDDEFINE»

«DEFINE GenMain FOR AUTOSAR::EcucDefs::Com»
        «EXPAND Gen1 FOR varianthandling::VariationPoint»
«ENDDEFINE»

This gives me an error as 'Couldn't find definition ComOtherVarGen for type xpand2::Type'. How do I achieve the above? Please note that I am not trying to add/modify any functionality to the template of 'MainObj' so 'AROUND' is not what I'm looking for.

Any help is greatly appreciated.

Sujju
  • 97
  • 8
  • ```«EXPAND Gen1 FOR varianthandling::VariationPoint»```makes no sense to me. the thing after the for in the expression that searches the stuff that is expanded – Christian Dietrich May 13 '15 at 11:30
  • With that `EXPAND` expression I'm trying to access the template `Gen1` I've written for `varianthandling::VariationPoint` object. This I'm trying to access from inside the template `GenMain` defined for the object `AUTOSAR::EcucDefs::Com`. My question is can I access it that way... the template of `varianthandling::VariationPoint` from inside the template of `AUTOSAR::EcucDefs::Com` Hoping this cleared the confusion. – Sujju May 14 '15 at 05:47
  • 1
    i dont know how your autosar wrappers are working. but they should give you a field or a method to access the value (or they ignore the variation and always return the first one) so how do your wrappers work. how are they created. – Christian Dietrich May 14 '15 at 07:06

1 Answers1

0

The tool which you are using to create the model (which is created from the PDF file + EcuC Values file) must be able to build a model which is post-build compatible.

If you are sure, this being done- Then try the below method

Com.ComConfig.ComIpdus.ComIPduCancellationSupport changes to

<FOREACH Com.ComConfig.ComIpdus.ComIPduCancellationSupport AS ele>
<ele>
<ENDFOREACH>

or

Com.ComConfig.ComIpdus.ComIPduCancellationSupport.get(0) Com.ComConfig.ComIpdus.ComIPduCancellationSupport.get(1)

DarkKnight
  • 131
  • 10