-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGPSFileReader.cpp
More file actions
38 lines (30 loc) · 997 Bytes
/
GPSFileReader.cpp
File metadata and controls
38 lines (30 loc) · 997 Bytes
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
#include "GPSFileReader.h"
namespace PaulNovack {
GPSFileReader::GPSFileReader() {
}
GPSFileReader::GPSFileReader(const GPSFileReader& orig) {
}
GPSFileReader::~GPSFileReader() {
}
void GPSFileReader::RunFileReader() {
ifstream gpsDataFile("/home/pnovack/2023Code/boatAutopilot/autoPilotCPlusPlusServer/GPSTracks/TripToLowes.txt");
if (!gpsDataFile.is_open()) {
cout << "Failed to open the GPS data file." << endl;
}
// Read and process each line of the GPS data
string gpsMessage;
long i = 0;
while (getline(gpsDataFile, gpsMessage)) {
gpsParser->parse(gpsMessage);
if (gpsParser->_messageType == "GLL") {
// pass data to navigation that is calculate in Parser
this_thread::sleep_for(chrono::milliseconds(1000));
}
}
gpsDataFile.close();
}
void GPSFileReader::setPlugins(Navigation& navigation, GPSParser& gpsParser) {
this->navigation = &navigation;
this->gpsParser = &gpsParser;
}
}