-
Notifications
You must be signed in to change notification settings - Fork 4
/
Component.cpp
47 lines (39 loc) · 972 Bytes
/
Component.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/** Example of subsystem task behavior.
*
* This class is derived from the standard Component base class and includes
* initialization for the devices used to control a given subsystem.
*
* The task receives messages from the main robot class and implements behaviors
* for a given subsystem.
*/
#include "WPILib.h"
//Robot
#include "ComponentBase.h"
#include "RobotParams.h"
//Local
#include "Component.h"
Component::Component()
: ComponentBase(COMPONENT_TASKNAME, COMPONENT_QUEUE, COMPONENT_PRIORITY)
{
pTask = new Task(COMPONENT_TASKNAME, (FUNCPTR) &Component::StartTask,
COMPONENT_PRIORITY, COMPONENT_STACKSIZE);
wpi_assert(pTask);
pTask->Start((int)this);
};
Component::~Component()
{
delete(pTask);
};
void Component::OnStateChange()
{
};
void Component::Run()
{
switch(localMessage.command) //Reads the message command
{
case COMMAND_COMPONENT_TEST:
break;
default:
break;
}
};