User Tools

Site Tools


eeros_architecture:safety_system:properties

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
eeros_architecture:safety_system:properties [2024/06/10 09:45] – [Critical Inputs and Outputs] ursgrafeeros_architecture:safety_system:properties [2025/01/31 11:53] (current) – [Level Actions] ursgraf
Line 82: Line 82:
 </code> </code>
 The method //setLevelAction// accepts a function, which is used solely here and can be defined without giving it a name. In this example the function is a so called lambda function meaning that it can be passed as a parameter without prior declaration. It must take a parameter itself of type ''SafetyContext''. This ensures that the level function can trigger a private event. The method //setLevelAction// accepts a function, which is used solely here and can be defined without giving it a name. In this example the function is a so called lambda function meaning that it can be passed as a parameter without prior declaration. It must take a parameter itself of type ''SafetyContext''. This ensures that the level function can trigger a private event.
 +
 +=== Entry and Exit Actions ===
 +You also have the possibility to define an action which is executed when a safety level is entered. That means when the safety system switches to this level.
 +<code cpp>
 +  slOff.setEntryAction([this](SafetyContext* privateContext) {
 +    // do anything
 +  });
 +</code>
 +
 +Further, you can define an action which is executed when a safety level is left. That means when the safety system switches from this level to another level.
 +<code cpp>
 +  slOff.setExitAction([this](SafetyContext* privateContext) {
 +    // do anything
 +  });
 +</code>
  
 === Counter === === Counter ===
eeros_architecture/safety_system/properties.1718005538.txt.gz · Last modified: 2024/06/10 09:45 by ursgraf