|
Lamp-Da 0.1
A compact lantern project
|
This alert is raised when the sunset timer is active. It means that the system will turn off on it's own after a delay. More...
Public Member Functions | |
| bool | show () const override |
| display this alert on the indicator | |
| Type | get_type () const override |
| return the Defined type of this alert | |
| virtual uint32_t | alert_shutdown_timeout () const |
| Return the timeout after which an alert will make the system auto-shutdown. | |
| virtual void | execute_loop () const |
| function executed if this alert is raised, every loop turns | |
| virtual void | on_raised () const |
| function executed when this alert is raised | |
| virtual void | on_lowered () const |
| function executed when this alert is cleared | |
| virtual bool | should_be_raised () const |
| return true if this alert type should be raised | |
| virtual brightness_t | max_brightness () const |
| Maximum output brightness allowed while this alert is raised. The system limit is the lowest of the raised alerts limits, see handle_all() | |
| virtual bool | should_be_cleared () const |
| return true if this alert type should be cleared | |
| virtual bool | should_shutdown_system () final |
| Return true if the system should shutdown from this alert. | |
| uint32_t | time_since_raised () const |
| Time elapsed since the latest raise (or refresh) of this alert, 0 if the raise time is not set. Synchronized with the raise time refreshes. Can be called from any thread. | |
| virtual bool | handle_raised_state (const uint32_t time) |
| Handler for the raised state of the alert. If the alert is not raised, raise the alert. | |
| void | update_raise_time_locked () |
| Update the raised time of this alert. An alert continuously firing as to be updated. Call it with _raiseTimeMutex held (see AlertManager_t::raise). | |
| virtual bool | handle_lowered_state (const uint32_t time) |
| Handler for the lowered state of the alert. If the alert is raised, lower the alert. | |
| virtual bool | should_prevent_lamp_output () const |
| override to prevent lamp output power if this alert if raised. Default to False | |
| virtual bool | should_prevent_battery_charge () const |
| override to prevent battery charge if this alert if raised. Default to False | |
| virtual bool | should_prevent_usb_port_use () const |
| override to prevent USB port usage if this alert if raised. Default to False | |
Public Attributes | |
| bool | _isRaisedHandled = false |
| Alert raise signal has been handled. | |
| bool | _isLoweredHandled = false |
| Alert lower signal has been handled. | |
| uint32_t | raisedTime = 0 |
| Store the latest time at which this alert raise() was called, 0 if not set. Refreshed by raise() from other threads, while the main loop reads it for the timeout decisions: only access it under _raiseTimeMutex (see time_since_raised()) | |
| bool | isRaisedTimeSet = false |
| True if raisedTime holds a raise time (that can be 0). Only access it under _raiseTimeMutex. | |
| std::atomic< uint32_t > | refreshCount {0} |
| Incremented on every raise() refresh of the raised alert, under _raiseTimeMutex. See AlertManager_t::clear_unless_refreshed. | |
| uint32_t | loweredTime = 0 |
| Store the latest time at which this alert lower() was called. | |
This alert is raised when the sunset timer is active. It means that the system will turn off on it's own after a delay.
|
inlinevirtualinherited |
Return the timeout after which an alert will make the system auto-shutdown.
Reimplemented in lampda::logic::alerts::Alert_BatteryCritical, and lampda::logic::alerts::Alert_TempCritical.
|
inlineoverridevirtual |
return the Defined type of this alert
Implements lampda::logic::alerts::AlertBase.
|
inlinevirtualinherited |
Handler for the lowered state of the alert. If the alert is raised, lower the alert.
|
inlinevirtualinherited |
Handler for the raised state of the alert. If the alert is not raised, raise the alert.
|
inlinevirtualinherited |
Maximum output brightness allowed while this alert is raised. The system limit is the lowest of the raised alerts limits, see handle_all()
Reimplemented in lampda::logic::alerts::Alert_BatteryLow, and lampda::logic::alerts::Alert_TempTooHigh.
|
inlinevirtualinherited |
function executed when this alert is raised
Reimplemented in lampda::logic::alerts::Alert_BatteryLow, and lampda::logic::alerts::Alert_TempTooHigh.
|
inlinevirtualinherited |
return true if this alert type should be cleared
Reimplemented in lampda::logic::alerts::Alert_BatteryReadingIncoherent, lampda::logic::alerts::Alert_BatteryCritical, lampda::logic::alerts::Alert_BatteryLow, lampda::logic::alerts::Alert_TempTooHigh, lampda::logic::alerts::Alert_BluetoothAdvertisement, lampda::logic::alerts::Alert_FavoriteSet, lampda::logic::alerts::Alert_SystemShutdownFailed, lampda::logic::alerts::Alert_SkippedCleanSleep, and lampda::logic::alerts::Alert_UsbPortShort.
|
inlinevirtualinherited |
return true if this alert type should be raised
Reimplemented in lampda::logic::alerts::Alert_BatteryCritical, lampda::logic::alerts::Alert_BatteryLow, lampda::logic::alerts::Alert_TempTooHigh, and lampda::logic::alerts::Alert_TempCritical.
|
inlinevirtualinherited |
override to prevent battery charge if this alert if raised. Default to False
Reimplemented in lampda::logic::alerts::Alert_BatteryReadingIncoherent, lampda::logic::alerts::Alert_BatteryMissing, lampda::logic::alerts::Alert_TempCritical, lampda::logic::alerts::Alert_HardwareAlert, lampda::logic::alerts::Alert_SystemShutdownFailed, lampda::logic::alerts::Alert_SystemInErrorState, and lampda::logic::alerts::Alert_UsbPortShort.
|
inlinevirtualinherited |
override to prevent lamp output power if this alert if raised. Default to False
Reimplemented in lampda::logic::alerts::Alert_BatteryReadingIncoherent, lampda::logic::alerts::Alert_BatteryMissing, lampda::logic::alerts::Alert_TempCritical, lampda::logic::alerts::Alert_HardwareAlert, lampda::logic::alerts::Alert_OtgFailed, lampda::logic::alerts::Alert_SystemShutdownFailed, lampda::logic::alerts::Alert_SystemInErrorState, and lampda::logic::alerts::Alert_OtgOverLimits.
|
inlinevirtualinherited |
override to prevent USB port usage if this alert if raised. Default to False
Reimplemented in lampda::logic::alerts::Alert_BatteryReadingIncoherent, lampda::logic::alerts::Alert_BatteryMissing, lampda::logic::alerts::Alert_TempCritical, lampda::logic::alerts::Alert_HardwareAlert, lampda::logic::alerts::Alert_SystemShutdownFailed, lampda::logic::alerts::Alert_SystemInErrorState, lampda::logic::alerts::Alert_UsbPortShort, and lampda::logic::alerts::Alert_OtgOverLimits.
|
inlineoverridevirtual |
display this alert on the indicator
Reimplemented from lampda::logic::alerts::AlertBase.