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
Next revision
Previous revision
eeros_architecture:safety_system:properties [2020/02/11 14:17] – [Safety Events] grafeeros_architecture:safety_system:properties [2023/02/25 07:30] (current) – [Safety Events] ursgraf
Line 60: Line 60:
 <code c> <code c>
   // Add events to multiple levels   // Add events to multiple levels
-  addEventToLevelAndAbove(slPowerOn, seDoEmergency, kPublicEvent);+  addEventToLevelAndAbove(slPowerOn, seDoEmergency, slEmergency, kPublicEvent);
 </code> </code>
 Two more functions serve a similar purpose. Two more functions serve a similar purpose.
 <code c> <code c>
   // Add events to all levels equal or smaller than srcLevel   // Add events to all levels equal or smaller than srcLevel
-  addEventToLevelAndBelow(srcLevel, destLevel, event, kPublicEvent);+  addEventToLevelAndBelow(srcLevel, event, destLevel, kPublicEvent);
   // Add events to all levels in between lowerLevel and upperLevel (including lowerLevel and upperLevel)   // Add events to all levels in between lowerLevel and upperLevel (including lowerLevel and upperLevel)
-  addEventToAllLevelsBetween(lowerLevel, upperLevel, destLevel, event, kPublicEvent);+  addEventToAllLevelsBetween(lowerLevel, upperLevel, event, destLevel, kPublicEvent);
 </code> </code>
  
Line 80: Line 80:
     privateContext->triggerEvent(seDoSwInit);     privateContext->triggerEvent(seDoSwInit);
   });   });
-  ... 
 </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.
  
 === Counter === === Counter ===
-Each time that the safety system runs in a certain level a counter named ''nofActivations'' is incremented. Whenever the safety level due to an event this counter will be reset to 0. This allows for measuring the time the system will run in a given safety level. The following example demonstrates this. +Each time that the safety system runs in a certain level a counter named ''nofActivations'' is incremented. Whenever the safety level changes due to an event this counter will be reset to 0. This allows for measuring the time the system will run in a given safety level. The following example demonstrates this. 
 <code cpp> <code cpp>
   slRunning.setLevelAction([this,period](SafetyContext* privateContext) {   slRunning.setLevelAction([this,period](SafetyContext* privateContext) {
eeros_architecture/safety_system/properties.1581427048.txt.gz · Last modified: 2020/02/11 14:17 by graf