-
- All Implemented Interfaces:
-
com.automaducks.pond.subsystems.IRealTimeSubsystem
,com.automaducks.pond.subsystems.ISubsystem
,com.automaducks.pond.subsystems.ISubsystemHub
public class SubsystemHub extends SubsystemBase implements ISubsystemHub
A subsystem hub is a collection of subsystems.
-
-
Constructor Summary
Constructors Constructor Description SubsystemHub(ITelemetryLogger logger)
Constructs a new instance of the SubsystemsHub class.
-
Method Summary
Modifier and Type Method Description void
add(ISubsystem subsystem)
Add a new subsystem to the hub. <T extends ISubsystem> T
findFirst(Class<T> subsystemClass)
Find the first available subsystem by its class. void
remove(ISubsystem subsystem)
Removes an subsystem to the hub. void
periodic()
Executes periodic actions on all subsystems. -
-
Constructor Detail
-
SubsystemHub
SubsystemHub(ITelemetryLogger logger)
Constructs a new instance of the SubsystemsHub class.- Parameters:
logger
- custom telemetry logger reference.
-
-
Method Detail
-
add
void add(ISubsystem subsystem)
Add a new subsystem to the hub.
- Parameters:
subsystem
- subsystem to be added.
-
findFirst
<T extends ISubsystem> T findFirst(Class<T> subsystemClass)
Find the first available subsystem by its class.
- Parameters:
subsystemClass
- the subsystem class.
-
remove
void remove(ISubsystem subsystem)
Removes an subsystem to the hub.
- Parameters:
subsystem
- subsystem to be removed.
-
periodic
void periodic()
Executes periodic actions on all subsystems.
-
-
-
-