cpphlib.PPPASSIVETIMER Class Reference

- Main Page
- Namespaces
- Classes

- Class List
- Class Members

Public Member Functions | Public Attributes
cpphlib.PPPASSIVETIMER Class Reference

The timer. More...

List of all members.

## 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

## Detailed Description

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.

## Constructor & Destructor Documentation

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.

Parameters:

  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

## Member Function Documentation

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

Parameters:

  duration | The time in seconds (float number also can be entered fx. 0.01)
      Short description: It sets, or changes timing value

The documentation for this class was generated from the following file:

- cpphlib.py