Adding regex check for crossfire gps format when reading logs in tele… (#5347)

* Adding regex check for crossfire gps format when reading logs in telemetry simulator

Adding a regex check when the telemetry simulator parses gps cords from a log file to see if the if the cords are in the crossfire gps log format. 
The GPS telemetry sensor from crossfire logs the coordinates as latitude with a precision of six decimal places followed by a space and then longitude also to six decimal places. e.g. "53.279969 -7.701416"
When the cords are already in this format their is no need to call convertDegMin on the values

* Fixing code styling

* Updating code style

* Updating code style

* Checking the gps coordinates format once before the full file is processed instead of evaluating the regex for every line of the file.

Optimize regex by removing surrounding parenthesis
This commit is contained in:
Harpalyke
2017-11-13 22:21:22 +01:00
committed by Bertrand Songis
parent 57d53abd6e
commit fd265eccbb
2 changed files with 39 additions and 2 deletions
+2
View File
@@ -96,6 +96,7 @@ class TelemetrySimulator : public QWidget
void updatePositionLabel(int32_t percentage);
void setUiDataValues();
double logFrequency; // in seconds
bool logFileGpsCordsInDecimalFormat;
private:
enum CONVERT_TYPE {
@@ -149,6 +150,7 @@ class TelemetrySimulator : public QWidget
double convertDegMin(QString input);
QDateTime parseTransmittterTimestamp(QString row);
void calcLogFrequency();
void checkGpsFormat();
QMap<QString, CONVERT_TYPE> colToFuncMap; // contains all 'known' column headings and how they are to be processed
Ui::TelemetrySimulator * ui;