-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathTestingInterface.h
More file actions
63 lines (45 loc) · 1.43 KB
/
TestingInterface.h
File metadata and controls
63 lines (45 loc) · 1.43 KB
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
#pragma once
#include "config.h"
#if TESTING == 1
#include "IO/Interface.h"
#include "IO/Radio.h"
#include "IO/SensorLogger.h"
#include "IO/TestingSensors.h"
#include "data/StateData.h"
#include <queue>
#include <string>
class TestingInterface : public Interface
{
public:
TestingInterface();
~TestingInterface();
void initialize() override;
void calibrateTelemetry() override;
// to get the latest rocket state. return a pointer to latestState
std::shared_ptr<StateData> getLatest() override;
bool updateInputs() override;
bool updateOutputs(std::shared_ptr<StateData> data) override;
#if USE_GPIO == 1
void createNewGpioOutput(std::string name, int pinNbr) override;
void createNewGpioPwmOutput(std::string name, int pinNbr, int safePosition, bool softpwm) override;
void createNewGpioDCMotorOutput(std::string name, int pinForward, int pinReverse, int motorPower,
int limitSwitchMinPin, int limitSwitchMaxPin, int potentiometerPin) override;
#endif
#if USE_LOGGER == 1
virtual void restartLogger() override;
#endif
time_point getCurrentTime() override;
private:
void initializeOutputs();
std::shared_ptr<spdlog::logger> logger;
std::shared_ptr<StateData> latestState;
TestingSensors testingSensors;
time_point latestTime;
#if USE_LOGGER == 1
SensorLogger sensorLogger;
#endif
#if USE_RADIO == 1
Radio radio;
#endif
};
#endif