-
Notifications
You must be signed in to change notification settings - Fork 0
/
ViewController.hpp
64 lines (46 loc) · 1.14 KB
/
ViewController.hpp
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
64
#pragma once
#include "Serial.hpp"
#include <map>
#include "SerialHandler.hpp"
#include <vector>
#define SAVE_FILE "buffer"
class ViewController
{
private:
SerialHandler &serial;
enum ioModes
{
HEX,
ASCII
} ioMode;
int activeDevice;
std::vector<std::string> devices;
std::vector<std::string> buffers;
bool lastConnectionSuccessful;
bool autoScroll;
std::string saveFileName;
int saveIncr;
bool localEcho;
public:
void connect(const std::string &, int);
void disconnect();
void sendData(const std::string &);
void checkForData(ioModes);
std::string getBuffer();
void addBufferData(const std::string &);
void nextIOMode();
ioModes getIOMode() const;
std::string getIOModeString() const;
void setActiveDevice(int);
std::string nextDevice();
bool hasActiveDevice();
std::string getActiveDevice();
std::string getLastConnectionStatus();
std::string getSaveFile();
void saveFile();
bool getAutoScroll();
void toggleAutoScroll();
void toggleLocalEcho();
bool getLocalEcho();
ViewController(SerialHandler &);
};