Skip to content

Class TargetSelection

ClassList > TargetSelection

A command to select a target for the system to focus on. More...

  • #include <target_selection.h>

Inherits the following classes: Command, AutoCommand

Public Attributes inherited from Command

See Command

Type Name
uint64_t id = 0
Unique identifier for the command, typically based on a timestamp.
uint64_t run_after = 0
The time at which the command should be executed.

Public Attributes inherited from Command

See Command

Type Name
uint64_t id = 0
Unique identifier for the command, typically based on a timestamp.
uint64_t run_after = 0
The time at which the command should be executed.

Public Functions

Type Name
virtual void Execute (SystemState * state) override
Executes the target selection command.
TargetSelection (TargetSource initial_target_source, uint8_t initial_target_id, int initial_speed, int64_t initial_run_after)
Constructs a new TargetSelection 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 schedule a change in the currently selected target. The radar identifies potential targets, and this command is used to specify which one to track and engage.

Public Functions Documentation

function Execute

Executes the target selection command.

virtual void TargetSelection::Execute (
    SystemState * state
) override

This method sets the specified target as the current one and then queues the next target selection command. This creates a cycle of target evaluation.

Parameters:

  • state A pointer to the system state.

Implements Command::Execute


function TargetSelection

Constructs a new TargetSelection object.

TargetSelection::TargetSelection (
    TargetSource initial_target_source,
    uint8_t initial_target_id,
    int initial_speed,
    int64_t initial_run_after
) 

Parameters:

  • target_id The ID of the target to select.
  • initial_speed The tracking speed to use.
  • initial_run_after The time delay (in microseconds) after which the command should run.


The documentation for this class was generated from the following file target_selection.h