All Signals used inside a State Machine will be stored in a signals enumeration.
Signals are used to Trigger Transitions inside the State Machine.
The signals enumeration is a special kind of enumeration in your project which contains the signals of your state machines.
A signals enumeration must - by convention - be named Signals. When generating the signals for a package, Embedded Engineer examines your package and collects all signals. It will then look for the signals enumeration and update the enumeration so that it contains all signals it collected.
If there is more than one signals enumeration in your package, Embedded Engineer will issue an error. Likewise, it will issue an error if no signals enumeration is found. Signals added to the enumeration by Embedded Engineer are marked with the generated stereotype. When generating the signals, the following procedure takes place:
- Signals which are new to the model and aren't part of the signals enumeration yet are added with stereotype generated
- Signals with the stereotype generated in the enumeration, for which no signal in the model could be found, are removed from the enumeration
- Signals which are part of the enumeration, but don't have the generated stereotype, are preserved even if they've not been found in the model
To make persistent changes to a signal in your signals enumeration, you need to remove the generated stereotype from that particular signal. From then on, you can make changes to that signal without your changes being overwritten every time you re-generate the signals.
Keep in mind that removing the generated stereotype makes you responsible for keeping that signal up-to-date. If your signal in the model changes its name, a new signal will be introduced to the signals enumeration.
Multiple/custom signal enums
Custom signals enumerations can be accomplished by creating a standardt Enumeration and adding the Stereotype
To support multiple signal enums the following constraints were added:
- a custom signals enum needs to be linked with a "use" link to the Class
- if no "use" link, from a Class to a signals enum, was found the code generation will fall back the default signals enum
- a signals enum may be used by multiple Classes
- a Class may only have one "use" link to a signals enum
Generating signalsfeature of Embedded Engineer will use point 1. and 2. to determine where to add the signals.
- due to point 1. - 4. it will be possible that a signal enum entry will be genereated in multiple signal enums
- if one wants to send signals to another Class/State Machine he/she should either use the same signals enum or needs to take care of "signal mapping" him-/herself.