Auxiliary class that helps to apply some inertia when deciding whether some status has changed.
More...
|
| def | __init__ (self, initial_state, confirmation_window_size_ms) |
| | InertialStatus Class Initializer.
|
| |
| def | SetCurrentStatus (self, current_status, reset_confirmation_window=False) |
| | Inputs the current status.
|
| |
| def | GetCurrentStatus (self) |
| | Outputs the last status that was inputted.
|
| |
| def | IsCurrentStatusConfirmed (self) |
| | Checks if the last status that was inputted is already confirmed.
|
| |
| def | GetLastConfirmedStatus (self) |
| | Gets the last status that was steady for at least the confirmation window size.
|
| |
| def | CurrentTimeMs (self) |
| | Get the current time in milliseconds since epoch.
|
| |
Auxiliary class that helps to apply some inertia when deciding whether some status has changed.
◆ __init__()
| def MonScripts.InertialStatus.InertialStatus.__init__ |
( |
|
self, |
|
|
|
initial_state, |
|
|
|
confirmation_window_size_ms |
|
) |
| |
InertialStatus Class Initializer.
- Parameters
-
| initial_state | Base state from which class starts calculating iniertia |
| confirmation_window_size_ms | Confirmation window in milliseconds |
◆ CurrentTimeMs()
| def MonScripts.InertialStatus.InertialStatus.CurrentTimeMs |
( |
|
self | ) |
|
Get the current time in milliseconds since epoch.
- Returns
- current time in milliseconds.
◆ GetCurrentStatus()
| def MonScripts.InertialStatus.InertialStatus.GetCurrentStatus |
( |
|
self | ) |
|
Outputs the last status that was inputted.
- Returns
- the current status
◆ GetLastConfirmedStatus()
| def MonScripts.InertialStatus.InertialStatus.GetLastConfirmedStatus |
( |
|
self | ) |
|
Gets the last status that was steady for at least the confirmation window size.
- Returns
- last confirmed status
◆ IsCurrentStatusConfirmed()
| def MonScripts.InertialStatus.InertialStatus.IsCurrentStatusConfirmed |
( |
|
self | ) |
|
Checks if the last status that was inputted is already confirmed.
- Returns
- True if last status is confirmed
◆ SetCurrentStatus()
| def MonScripts.InertialStatus.InertialStatus.SetCurrentStatus |
( |
|
self, |
|
|
|
current_status, |
|
|
|
reset_confirmation_window = False |
|
) |
| |
Inputs the current status.
- Parameters
-
| current_status | the status of now |
| reset_confirmation_window | true if the current_status should have immediate effect without any confirmation |
◆ m_confirmation_window_size
| MonScripts.InertialStatus.InertialStatus.m_confirmation_window_size |
◆ m_confirmation_window_start
| MonScripts.InertialStatus.InertialStatus.m_confirmation_window_start |
◆ m_status_current
| MonScripts.InertialStatus.InertialStatus.m_status_current |
◆ m_status_last_confirmed
| MonScripts.InertialStatus.InertialStatus.m_status_last_confirmed |
The documentation for this class was generated from the following file: