-
- 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(ILogger logger)Constructs a new instance of the SubsystemsHub class.
-
Method Summary
Modifier and Type Method Description <T extends ISubsystem> Tadd(T subsystem)Add a new subsystem to the hub. <T extends ISubsystem> TfindFirst(Class<T> subsystemClass)Find the first available subsystem by its class. voidremove(ISubsystem subsystem)Removes an subsystem to the hub. voidperiodic()Executes periodic actions on all subsystems. -
-
Constructor Detail
-
SubsystemHub
SubsystemHub(ILogger logger)
Constructs a new instance of the SubsystemsHub class.- Parameters:
logger- custom telemetry logger reference.
-
-
Method Detail
-
add
<T extends ISubsystem> T add(T 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.
-
-
-
-