-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathNetcom.cpp
46 lines (38 loc) · 1.03 KB
/
Netcom.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
#include <networktables/NetworkTable.h>
#include <networktables/NetworkTableProvider.h>
#include "Netcom.h"
const std::string Netcom::PATH = "612NetworkVariables";
const std::string Netcom::PRIMEKEY = "PrimeLocation";
const std::string Netcom::RUMBLEKEY = "ShouldRumble";
const std::string Netcom::HOTKEY = "HotGoalOn";
const std::string Netcom::DISTKEY = "Distance";
Netcom::Netcom()
{
nwt612 = NetworkTable::GetTable(PATH);
}
Netcom::~Netcom()
{
}
void Netcom::primeLocation(double distance)
{
if(distance >= ((PRIMEDISTANCE - BUFFER)) && distance <= (PRIMEDISTANCE + BUFFER))
{
bool idealDistance = true;
nwt612 -> PutBoolean(PRIMEKEY, idealDistance);
}
else
{
bool idealDistance = false;
nwt612 -> PutBoolean(PRIMEKEY, idealDistance);
}
nwt612 -> PutNumber(DISTKEY, distance);
}
void Netcom::joyRumble(bool rumble)
{
nwt612 -> PutBoolean(RUMBLEKEY, rumble);
}
bool Netcom::getHotGoal()
{
return (nwt612 -> GetBoolean(HOTKEY, false));
}
//don't even know what' wrong!!!