$darkmode
#include <hmi_contact.hpp>
Public Member Functions | |
| Switch (std::function< void()> set_fn, std::function< void()> unset_fn, bool active) | |
Public Member Functions inherited from cloe::utility::Contact< D > | |
| Contact (bool active) | |
| void | update (D time, bool down) |
| bool | has_contact () const |
Protected Member Functions | |
| void | contact_down (D) override |
| void | contact_up (D) override |
Additional Inherited Members | |
Protected Attributes inherited from cloe::utility::Contact< D > | |
| bool | active_ {false} |
Switch simulates a switch contact.
Pressing the switch immediately triggers the set function, and unpressing the switch immediately triggers the unset function.
*---------------—* set/push unset/release
In contrast to a PushButton, a switch can start its life in either the ON or the OFF position.
|
inlineoverrideprotectedvirtual |
Apply the contact.
This corresponds to pushing down on a key or button, or moving a switch to the ON position, and should set active_ to true.
Implements cloe::utility::Contact< D >.
|
inlineoverrideprotectedvirtual |
Release the contact.
This corresponds to releasing a previous push on a key or button, or moving a switch to the OFF position, and should set active_ to false.
Implements cloe::utility::Contact< D >.