You are here: Foswiki>FESA Web>FESA3>FESA3Relationships (02 Sep 2024, DominicDay)Edit Attach

Class Relationships

Use relationships to share functionality between FESA classes. Two types of relationship are supported:
  • Association: A FESA Class subscribes to properties of another FESA Class via middleware
  • Composition: A FESA Class shares functions with another FESA Class running in the same Deploy Unit
Multiple independent classes can also be included in a single deploy unit, but these have no relationship defined.

Associations

To define an association add the element `equipment-model/relationship/association` in the Class .design file. Enter the class name and version. It must be present in the same workspace.

Add an on-subscription event and action (Insert RT wizard)

In the Deploy-Unit add the element `deploy-unit/include/associations/association`. Enter the class name and version. It must be present in the same workspace. Note that the eclipse XML editor may show an element tree `deploy-unit/include/xi:include`, this is not part of the FESA design.

In the Instance, there will be an element `instantiation-unit/classes/MyClass/events-mapping/MyOnsubscriptionEvent`.

Add a element `event-configuration` and configure the attributes:
  • context: multiplexing context to subscribe to (blank for all)
  • device: nomenclature of device
  • property: name of property
Then select this event-configuration in the events-mapping of the device instance

For the RTAction C++ code see https://www-acc.gsi.de/wiki/FESA/FESA700_CodeSnippets#OnSubscription_Payload

Yocto Code Generation

The yocto codegen tool requires the path to the design files of all associated classes

yocto-fesa3 -c MyClass -a path/to/AssocClass/src/AssocClass.design gen

This will make constants and property data structures from the associated design available in your C++ code.

Notes

Code generation requires the associated class design to generate the data types for the sharted properties. Different FESA / Class versions can be associated as long as the property definition does not change.

Older FESA versions required the binary of the associated class to be linked.

-- DominicDay - 02 Sep 2024
Topic revision: r1 - 02 Sep 2024, DominicDay
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback