refactore
all components now have a base class compnent for loop functions
This commit is contained in:
2023-08-18 10:47:35 +02:00
parent 25d37e3970
commit 11d21e2e89
35 changed files with 303 additions and 511 deletions
+4 -8
View File
@@ -21,6 +21,7 @@
#include "route.h"
#include "NTRIPClient.h"
#include "calibrateCompass.h"
#include "component.h"
/**
* @brief The minimal distance between Points
@@ -54,7 +55,7 @@ struct CourseCorrection {
* be drive and the distance to the next checkpoint.
*
*/
class Navigation {
class Navigation : public Component {
public:
enum Status {
InsufficientAccuracy,
@@ -103,13 +104,6 @@ class Navigation {
*/
void initNtrip(String host, uint16_t port, String mountPoint, String user, String password);
/**
* @brief Decodes new GPS information
*
* Should be called ever main loop.
*/
void loop();
/**
* @brief creates a new empty route
*
@@ -218,6 +212,8 @@ class Navigation {
static int16_t fixDegree(int16_t degree);
private:
void run() override;
void runAsChild() override;
void updateCurrentLocation();
void updateMagneticDeclination();
void init(Route* route);