8 #ifndef __SCHEDULER_H__
9 #define __SCHEDULER_H__
11 #include "Commands/Command.h"
12 #include "ErrorBase.h"
13 #include "SmartDashboard/NamedSendable.h"
14 #include "networktables/NetworkTable.h"
15 #include "SmartDashboard/SmartDashboard.h"
22 #include "HAL/cpp/priority_mutex.h"
38 void SetEnabled(
bool enabled);
42 void InitTable(std::shared_ptr<ITable> subTable);
43 std::shared_ptr<ITable>
GetTable()
const;
45 std::string GetType()
const;
51 void ProcessCommandAddition(
Command *command);
53 Command::SubsystemSet m_subsystems;
55 typedef std::vector<ButtonScheduler *> ButtonVector;
56 ButtonVector m_buttons;
57 typedef std::vector<Command *> CommandVector;
59 CommandVector m_additions;
60 typedef std::set<Command *> CommandSet;
61 CommandSet m_commands;
62 bool m_adding =
false;
63 bool m_enabled =
true;
64 std::vector<std::string> commands;
65 std::vector<double> ids;
66 std::vector<double> toCancel;
67 std::shared_ptr<ITable> m_table;
68 bool m_runningCommandsChanged =
false;
Definition: Scheduler.h:27
void ResetAll()
Completely resets the scheduler.
Definition: Scheduler.cpp:203
void Remove(Command *command)
Removes the Command from the Scheduler.
Definition: Scheduler.cpp:176
void UpdateTable()
Update the network tables associated with the Scheduler object on the SmartDashboard.
Definition: Scheduler.cpp:216
void Run()
Runs a single iteration of the loop.
Definition: Scheduler.cpp:108
Definition: Subsystem.h:18
Base class for most objects.
Definition: ErrorBase.h:66
static Scheduler * GetInstance()
Returns the Scheduler, creating it if one does not exist.
Definition: Scheduler.cpp:26
void InitTable(std::shared_ptr< ITable > subTable)
Initializes a table for this sendable object.
Definition: Scheduler.cpp:265
Definition: priority_mutex.h:53
std::shared_ptr< ITable > GetTable() const
Definition: Scheduler.cpp:273
The interface for sendable objects that gives the sendable a default name in the Smart Dashboard...
Definition: NamedSendable.h:19
std::string GetName() const
Definition: Scheduler.cpp:259
std::string GetSmartDashboardType() const
Definition: Scheduler.cpp:263
The Command class is at the very core of the entire command framework.
Definition: Command.h:54
void AddCommand(Command *command)
Add a command to be scheduled later.
Definition: Scheduler.cpp:40
void RegisterSubsystem(Subsystem *subsystem)
Registers a Subsystem to this Scheduler, so that the Scheduler might know if a default Command needs ...
Definition: Scheduler.cpp:164