Home
Roadside
Carputer
geoHist
software
FRC
Blog
Now you can download a copy of these docs so you can use them offline!
Download now
Main Page
Related Pages
Classes
Files
File List
Commands
Scheduler.h
1
/*----------------------------------------------------------------------------*/
2
/* Copyright (c) FIRST 2011. All Rights Reserved. */
3
/* Open Source Software - may be modified and shared by FRC teams. The code */
4
/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
5
/*----------------------------------------------------------------------------*/
6
7
#ifndef __SCHEDULER_H__
8
#define __SCHEDULER_H__
9
10
#include "Commands/Command.h"
11
#include "ErrorBase.h"
12
#include "SmartDashboard/NamedSendable.h"
13
#include "networktables/NetworkTable.h"
14
#include "networktables2/type/NumberArray.h"
15
#include "networktables2/type/StringArray.h"
16
#include "SmartDashboard/SmartDashboard.h"
17
#include <list>
18
#include <map>
19
#include <set>
20
#include <vector>
21
22
class
ButtonScheduler
;
23
class
Subsystem
;
24
25
class
Scheduler
:
public
ErrorBase
,
public
NamedSendable
26
{
27
public
:
28
static
Scheduler
*
GetInstance
();
29
30
void
AddCommand
(
Command
* command);
31
void
AddButton(
ButtonScheduler
* button);
32
void
RegisterSubsystem
(
Subsystem
*subsystem);
33
void
Run
();
34
void
Remove
(
Command
*command);
35
void
RemoveAll();
36
void
SetEnabled(
bool
enabled);
37
38
void
UpdateTable
();
39
std::string
GetSmartDashboardType
();
40
void
InitTable
(
ITable
*subTable);
41
ITable
*
GetTable
();
42
std::string
GetName
();
43
std::string GetType();
44
45
private
:
46
Scheduler
();
47
virtual
~
Scheduler
();
48
49
void
ProcessCommandAddition(
Command
*command);
50
51
static
Scheduler
*_instance;
52
Command::SubsystemSet m_subsystems;
53
SEM_ID m_buttonsLock;
54
typedef
std::vector<ButtonScheduler *> ButtonVector;
55
ButtonVector m_buttons;
56
typedef
std::vector<Command *> CommandVector;
57
SEM_ID m_additionsLock;
58
CommandVector m_additions;
59
typedef
std::set<Command *> CommandSet;
60
CommandSet m_commands;
61
bool
m_adding;
62
bool
m_enabled;
63
StringArray
*commands;
64
NumberArray
*ids;
65
NumberArray
*toCancel;
66
ITable
*m_table;
67
bool
m_runningCommandsChanged;
68
};
69
#endif
70
Scheduler::GetName
std::string GetName()
Definition:
Scheduler.cpp:263
Scheduler
Definition:
Scheduler.h:25
NamedSendable
Definition:
NamedSendable.h:19
ITable
Definition:
ITable.h:26
ErrorBase
Definition:
ErrorBase.h:37
ButtonScheduler
Definition:
ButtonScheduler.h:13
Command
Definition:
Command.h:43
Scheduler::Run
void Run()
Definition:
Scheduler.cpp:130
Scheduler::AddCommand
void AddCommand(Command *command)
Definition:
Scheduler.cpp:63
Scheduler::GetSmartDashboardType
std::string GetSmartDashboardType()
Definition:
Scheduler.cpp:271
Subsystem
Definition:
Subsystem.h:17
NumberArray
Definition:
NumberArray.h:15
Scheduler::InitTable
void InitTable(ITable *subTable)
Definition:
Scheduler.cpp:275
Scheduler::UpdateTable
void UpdateTable()
Definition:
Scheduler.cpp:225
Scheduler::Remove
void Remove(Command *command)
Definition:
Scheduler.cpp:197
Scheduler::RegisterSubsystem
void RegisterSubsystem(Subsystem *subsystem)
Definition:
Scheduler.cpp:185
StringArray
Definition:
StringArray.h:16
Scheduler::GetTable
ITable * GetTable()
Definition:
Scheduler.cpp:286
Scheduler::GetInstance
static Scheduler * GetInstance()
Definition:
Scheduler.cpp:47
Generated on Sat Apr 26 2014 12:26:45 for WPILibC++ by
1.8.6
© 2006-2009 Dustin Spicuzza. All rights reserved.
Powered by Onnac
I do not condone or encourage graffiti. Please paint responsibly.