76 lines
1.6 KiB
C++
76 lines
1.6 KiB
C++
/**
|
|
* @file captureRoute.h
|
|
* @author Alexander Klein (alex@kleiax.de)
|
|
* @brief Contains a class to capture a driven route
|
|
* @version 0.1
|
|
* @date 2022-02-15
|
|
*
|
|
* @copyright Copyright (c) 2022
|
|
*
|
|
*/
|
|
|
|
#ifndef CAPTURE_ROUTE_H
|
|
#define CAPTURE_ROUTE_H
|
|
|
|
#include <iostream>
|
|
|
|
#include "driveModi/Modi/ManualControl/manualControl.h"
|
|
#include "navigation.h"
|
|
|
|
/**
|
|
* @brief A class to capture a driven class
|
|
*
|
|
* This class inherits ManualControl so you can drive
|
|
* normally as in ManualControl. If GPS signal is valid
|
|
* you can add a Point everytime you want.
|
|
*
|
|
*/
|
|
class CaptureRoute : public ManualControl
|
|
{
|
|
public:
|
|
/**
|
|
* @brief Destroy the Capture Route object
|
|
*
|
|
* Disconnect the NTRIP-Client
|
|
*/
|
|
~CaptureRoute();
|
|
|
|
/**
|
|
* @brief Get the Route Info object
|
|
*
|
|
* @return RouteInfo
|
|
*/
|
|
RouteInfo getRouteInfo() const { return this->routeInfo; }
|
|
|
|
Navigation::Status getLastStatus() const { return this->status; }
|
|
Navigation *getNavigation() const { return this->navigation; }
|
|
|
|
/**
|
|
* @brief Get the distance to the last saved oint
|
|
*
|
|
* @return double in meters
|
|
*/
|
|
double getDistanceToLastPoint() const;
|
|
|
|
/**
|
|
* @brief Tells if there are new informations to display
|
|
*
|
|
* @return true
|
|
* @return false
|
|
*/
|
|
bool shouldUpdate();
|
|
|
|
private:
|
|
void run() override;
|
|
void afterActivate() override;
|
|
|
|
Navigation *navigation = nullptr;
|
|
RouteInfo routeInfo;
|
|
Point lastSavedPoint;
|
|
Navigation::Status status = Navigation::Status::Complete;
|
|
|
|
bool updateDisplay = false;
|
|
};
|
|
|
|
#endif // CAPTURE_ROUTE_H
|