-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
63 lines (46 loc) · 1.23 KB
/
main.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include <iostream>
#include "RiptideRecorder/RiptideRecorder.h"
#include "TestDevice.h"
using namespace std;
int main(int argc, char* argv[]) {
cout << argc << endl;
for (int h = 0; h<argc; h++)
cout << argv[h] << endl;
cout << endl;
Recorder* rec = Recorder::GetInstance();
//One of each device
TestDevice* dev = new TestDevice("dev");
Relay* rel = new Relay();
SpeedController* ctrl = new SpeedController();
Servo* serv = new Servo();
DoubleSolenoid* ds = new DoubleSolenoid();
Solenoid* sol = new Solenoid();
//Add all devices to recorder
rec->AddDevice("Relay",rel);
rec->AddDevice("Speed Controller",ctrl);
rec->AddDevice("Servo",serv);
rec->AddDevice("Double Solenoid",ds);
rec->AddDevice("Solenoid",sol);
rec->AddDevice(dev);
//Creates macro
cout << dev->GetName() << endl;
Macro* mac = rec -> macro();
int iterations = 5;
for (int i = 0; i<iterations; i++) {
mac->Record();
}
mac->WriteFile("auto.csv");
mac->Reset();
mac->ReadFile("auto.csv");
while (!mac->IsFinished())
{
mac->PlayBack();
}
cout << "plz work" << endl;
mac->Reset();
Command* recCom = mac->NewRecordFileCommand("auto2.csv");
recCom->Initialize();
for (int i = 0; i < 30; i ++) recCom->Execute();
recCom->End();
return 0;
}