-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackendprocesses.h
More file actions
69 lines (54 loc) · 1.45 KB
/
backendprocesses.h
File metadata and controls
69 lines (54 loc) · 1.45 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
64
65
66
67
68
69
#ifndef BACKENDPROCESSES_H
#define BACKENDPROCESSES_H
#ifdef unix
#undef unix
#endif
#include <QGuiApplication>
#include <QObject>
#include <vector>
#include <QMutex>
#include <fstream>
#include "telemetrylib/Telemetry.h"
#include "telemetrylib/DTI.h"
#include "telemetrylib/TCP.cpp"
#include "telemetrylib/SQL.cpp"
#include "telemetrylib/UDP.cpp"
#include "telemetrylib/Serial.cpp"
struct timestampOffsets {
int hr;
int mn;
int sc;
int ms;
int unix;
};
class BackendProcesses : public QObject
{
Q_OBJECT
public:
explicit BackendProcesses(QByteArray &bytes, std::vector<std::string> &names, std::vector<std::string> &types, timestampOffsets timeDataOffsets, QMutex &mutex, int byteSize, QObject *parent = nullptr);
~BackendProcesses();
//~BackendProcesses();
public slots:
void threadProcedure();
void startThread();
void comm_status(bool s);
signals:
void eng_dash_connection(bool state);
void dataReady();
private:
timestampOffsets tstampOffsets;
QByteArray &bytes;
std::atomic<bool> stop = false;
std::vector<std::string> &names;
std::vector<std::string> &types;
QMutex &mutex;
int byteSize;
Telemetry* tel;
// path of output directory used for file sync
QString basePath;
// timestamp when the last file sync output was written to disk
uint8_t last_minute = 0;
// queued data for file sync
QByteArray all_bytes_in_minute;
};
#endif // BACKENDPROCESSES_H