Different Scripting Snippets

Question:
How can I collect all the ISignals from the input file?
Answer:

Collection<MIISignal> allISignalGroups = mdfModel(MIISignal)


Question:
How can I get the referenced ISignals from an ISignalgroup for (MIISignalARRef collectedISignalRef in isignalsInISignalGroup)?
 
Answer:
{
   MIISignal iSignal = collectedISignalRef.refTarget
}

Question:
How can I get the SystemDescription objects pointing to me (ISignal)?
Answer:

def iSignalReferencedBy = iSignal.systemDescriptionObjectsPointingToMe
 

Reference a SystemSignal in an ISignal

  • //first create the reference object
    MISystemSignalARRef systemSignalRef = mdfAccess.createMDFObject(MISystemSignalARRef.class)
     
  • //reference the AsrPath 
    systemSignalRef.setValue(newSystemSignal.asrPath)
     
  • //now assign the new reference to the ISignal
    newISignal.setSystemSignal(systemSignalRef)
Note:
For the mentioned examples you need additional imports like com.vector.cfg.model.mdf.ar4x.systemtemplate.fibex.fibexcore.corecommunicat
*ion.**
for the MIISignal.


Article ID: 1527
Last updated: 2019-12-19
Revision: 6
MICROSAR and DaVinci -> Scripting -> Groovy Script Examples -> Different Scripting Snippets
https://kb.vector.com/entry/1527/