Class FireControl
A command to control the firing mechanism. More...
#include <firecontrol.h>
Inherits the following classes: Command, AutoCommand
Public Attributes inherited from Command
See Command
| Type | Name |
|---|---|
| uint64_t | id = 0Unique identifier for the command, typically based on a timestamp. |
| uint64_t | run_after = 0The time at which the command should be executed. |
Public Attributes inherited from Command
See Command
| Type | Name |
|---|---|
| uint64_t | id = 0Unique identifier for the command, typically based on a timestamp. |
| uint64_t | run_after = 0The time at which the command should be executed. |
Public Functions
| Type | Name |
|---|---|
| virtual void | Execute (SystemState * state) override Executes the fire control command, setting the firing state. |
| FireControl (bool initial_active, uint16_t initial_duration, int64_t initial_run_after) Constructs a new FireControl object. |
Public Functions inherited from Command
See Command
| Type | Name |
|---|---|
| Command (uint64_t initial_run_after=0) Constructs a new Command object. |
|
| virtual void | Execute (SystemState * state) = 0 |
| virtual constexpr const std::string_view | Type () const = 0 |
| virtual | ~Command () = default |
Public Functions inherited from AutoCommand
See AutoCommand
| Type | Name |
|---|---|
| virtual constexpr const std::string_view | Type () override const |
Public Functions inherited from Command
See Command
| Type | Name |
|---|---|
| Command (uint64_t initial_run_after=0) Constructs a new Command object. |
|
| virtual void | Execute (SystemState * state) = 0 |
| virtual constexpr const std::string_view | Type () const = 0 |
| virtual | ~Command () = default |
Detailed Description
This class implements the Command interface to activate or deactivate the firing pin. It is used to schedule firing events at specific times.
Public Functions Documentation
function Execute
Executes the fire control command, setting the firing state.
virtual void FireControl::Execute (
SystemState * state
) override
This method checks conditions before changing the firing state, such as whether the requested state is already active and if enough time has passed since the last action.
Parameters:
stateA pointer to the system state.
Implements Command::Execute
function FireControl
Constructs a new FireControl object.
FireControl::FireControl (
bool initial_active,
uint16_t initial_duration,
int64_t initial_run_after
)
Parameters:
activeThe desired state of the firing pin.initial_durationThe duration for the firing state.initial_run_afterThe time delay (in microseconds) after which the command should run.
The documentation for this class was generated from the following file firecontrol.h