The timer. More...
Public Member Functions | |
| def | __init__ |
| Documentation for method. | |
| def | reset |
| def | set |
| Documentation for method. | |
| def | isexpired |
| Documentation for method. | |
Public Attributes | |
| active | |
| starttime | |
| duration | |
The timer.
This class provides a timer which can be used in the working loop of the control programs. The working loop must run continously, this way sleep can not be used, because sleep suspends the working loop, and input changes can be missed. This is why a timer is needed, which can be started, stopped, and restarted automatically, or triggered way, and it timeouts based on delta time.
| def cpphlib.PPPASSIVETIMER.__init__ | ( | self, | |
duration = 0, |
|||
active = False |
|||
| ) |
Documentation for method.
When the timer is being created, you can define its timeout value, and you also can activate it immediately. If there is no parameters defined, the timer exists, but it is inactive. Its timeout value can be defined later, and it also can be activated then.
| duration | The time in seconds (float number also can be entered fx. 0.01) |
| active | It the parameter is True, then timer starts immediately. Short description: Constructs PPPASSIVETIMER class |
| def cpphlib.PPPASSIVETIMER.isexpired | ( | self | ) |
Documentation for method.
Timeout flag of the timer. Its return value is False till the time spent since calling set or reset methods less than given in duration parameter. If the value is bigger than the return value is True, and timer goes inactive state. Restarting the timer can be using reset, or set method with setting new timeout value.
Short description: Timeout flag of the timer
| def cpphlib.PPPASSIVETIMER.reset | ( | self | ) |
Short description: It restarts the timer
| def cpphlib.PPPASSIVETIMER.set | ( | self, | |
| duration | |||
| ) |
Documentation for method.
It sets, or changes timing value, and restarts the timer
| duration | The time in seconds (float number also can be entered fx. 0.01) Short description: It sets, or changes timing value |
1.7.6.1