-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changed fit_file to fit_parser and all structure around
- Loading branch information
Showing
18 changed files
with
11,883 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#ifndef DATAPOINT_H | ||
#define DATAPOINT_H | ||
|
||
#include "enum_field.h" | ||
#include "value.h" | ||
|
||
#include <map> | ||
#include <vector> | ||
|
||
namespace vgraph { | ||
namespace telemetry { | ||
|
||
using datapoint = std::map<EField, value>; | ||
using datapoint_sequence = std::vector<datapoint>; | ||
|
||
} // namespace telemetry | ||
} // namespace vgraph | ||
|
||
#endif // DATAPOINT_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#ifndef ENUM_FIELD_H | ||
#define ENUM_FIELD_H | ||
|
||
namespace vgraph { | ||
namespace telemetry { | ||
|
||
enum class EField | ||
{ | ||
Timestamp, | ||
Latitude, | ||
Longitude, | ||
Altitude, | ||
Temperature, | ||
Distance, | ||
Speed, | ||
Cadence, | ||
Power, | ||
LeftPedalSmoothness, | ||
RightPedalSmoothness, | ||
LeftTorqueEffectiveness, | ||
RightTorqueEffectiveness, | ||
RespirationRate, | ||
HeartRate, | ||
Grit, | ||
Flow, | ||
}; | ||
|
||
} // namespace telemetry | ||
} // namespace vgraph | ||
|
||
#endif // ENUM_FIELD_H |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include "fit_parser.h" | ||
|
||
namespace vgraph { | ||
namespace telemetry { | ||
|
||
std::shared_ptr<datapoint_sequence> fit_parser::parse(const std::string& path) | ||
{ | ||
//FIXME to be implemented | ||
return nullptr; | ||
} | ||
|
||
} // namespace telemetry | ||
} // namespace vgraph |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef FIT_PARSER_H | ||
#define FIT_PARSER_H | ||
|
||
#include "parser.h" | ||
|
||
namespace vgraph { | ||
namespace telemetry { | ||
|
||
class fit_parser : public parser { | ||
public: | ||
fit_parser() = default; | ||
~fit_parser() = default; | ||
|
||
std::shared_ptr<datapoint_sequence> parse(const std::string& path) override; | ||
}; | ||
|
||
} // namespace telemetry | ||
} // namespace vgraph | ||
|
||
#endif // FIT_PARSER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#ifndef FILE_H | ||
#define FILE_H | ||
|
||
#include "datapoint.h" | ||
|
||
#include <string> | ||
#include <memory> | ||
|
||
namespace vgraph { | ||
namespace telemetry { | ||
|
||
class parser { | ||
public: | ||
parser() = default; | ||
~parser() = default; | ||
|
||
virtual std::shared_ptr<datapoint_sequence> parse(const std::string& path) = 0; | ||
}; | ||
|
||
} // namespace telemetry | ||
} // namespace vgraph | ||
|
||
#endif // FILE_H |
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#ifndef VALUE_H | ||
#define VALUE_H | ||
|
||
namespace vgraph { | ||
namespace telemetry { | ||
|
||
class value { | ||
public: | ||
value() = default; | ||
~value() = default; | ||
}; | ||
//TODO to be implemented, templated for different types of values | ||
|
||
} // namespace telemetry | ||
} // namespace vgraph | ||
|
||
#endif // VALUE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,5 @@ cmake_minimum_required(VERSION 3.20.0) | |
|
||
target_sources(vgraph_test | ||
PRIVATE | ||
fit_file_test.cpp | ||
fit_parser_test.cpp | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#include <gtest/gtest.h> | ||
#include "telemetry/fit_parser.h" | ||
|
||
#include "testutils/testdata.h" | ||
|
||
namespace vgraph { | ||
namespace telemetry { | ||
namespace consts { | ||
const std::string fitfile_path = std::string(TESTDATA_DIR) + "/test.fit"; | ||
const std::string gpxfile_path = std::string(TESTDATA_DIR) + "/test.gpx"; | ||
const std::string incorrect_path = "some/incorrect/path/to/file.fit"; | ||
} // namespace consts | ||
|
||
class fit_parser_test : public ::testing::Test { | ||
protected: | ||
void SetUp() override | ||
{ | ||
uut = std::make_shared<fit_parser>(); | ||
} | ||
|
||
void TearDown() override | ||
{ | ||
uut.reset(); | ||
} | ||
|
||
std::shared_ptr<fit_parser> uut; | ||
}; | ||
|
||
TEST_F(fit_parser_test, parse_incorrect_path_returns_nullptr) | ||
{ | ||
ASSERT_EQ(nullptr, uut->parse(consts::incorrect_path)); | ||
} | ||
|
||
TEST_F(fit_parser_test, parse_wrong_format_returns_nullptr) | ||
{ | ||
ASSERT_EQ(nullptr, uut->parse(consts::gpxfile_path)); | ||
} | ||
|
||
#if 0 | ||
//FIXME to be implemented | ||
TEST_F(fit_parser_test, parse_fit_file) | ||
{ | ||
auto retval = uut->parse(consts::fitfile_path); | ||
ASSERT_NE(nullptr, retval); | ||
} | ||
#endif | ||
|
||
} // namespace telemetry | ||
} // namespace vgraph |
Oops, something went wrong.