ExtronLib-CDS/extronlib/system/Wait.py
2021-09-21 10:27:39 -05:00

46 lines
1.5 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

class Wait():
""" The wait class allows the user to execute programmed actions after a desired delay without blocking other processor activity.
In addition to being used as a one-shot (decorator), Wait can be named and reusable.
---
Arguments:
- Time (float) - Expiration time of the wait in seconds
- Function (function) - Code to execute when Time expires
---
Parameters:
- Function - Returns (function) - Code to execute when Time expires.
- Time - Returns (float) - Expiration time of the wait in seconds with 10ms precision.
"""
Time: float = 0.0
Function: callable = None
def __init__(self, Time: float, Function: callable=None) -> None:
""" File class constructor.
Arguments:
- Time (float) - Expiration time of the wait in seconds
- Function (function) - Code to execute when Time expires
"""
...
def Add(self, Time: float) -> None:
""" Add time to current timer. """
pass
def Cancel(self) -> None:
""" Stop wait Function from executing when the timer expires. """
pass
def Change(self) -> None:
""" Set a new Time value for current and future timers in this instance. """
pass
def Restart(self) -> None:
""" Restarts the timer executes the Function in Time seconds. If the a timer is active, cancels that timer before starting the new timer.
"""
pass