- reafctor
This commit is contained in:
@@ -131,30 +131,31 @@ void MenuAutopilot::printPage() const {
|
||||
}
|
||||
|
||||
case 4:
|
||||
if (this->driveManager->getNavigation()->getCalcAzimuthState() == Navigation::CalcAzimuthState::Good
|
||||
||this->driveManager->getNavigation()->getCalcAzimuthState() == Navigation::CalcAzimuthState::Super)
|
||||
|
||||
if (this->autopilot->getSensorData().getCalcAzimuth() == CalcAzimuth::CalcAzimuthState::Good
|
||||
||this->autopilot->getSensorData().getCalcAzimuth() == CalcAzimuth::CalcAzimuthState::Super)
|
||||
{
|
||||
lineOne = "Calc Azi: ";
|
||||
lineTwo = "State: ";
|
||||
lineOne.concat(this->driveManager->getNavigation()->getCalcAzimuth());
|
||||
switch (this->driveManager->getNavigation()->getCalcAzimuthState()) {
|
||||
case Navigation::CalcAzimuthState::Bad :
|
||||
lineOne.concat(this->autopilot->getSensorData().getCalcAzimuth());
|
||||
switch (this->autopilot->getSensorData().getCalcAzimuthState()) {
|
||||
case CalcAzimuth::CalcAzimuthState::Bad :
|
||||
lineTwo.concat("Bad");
|
||||
break;
|
||||
|
||||
case Navigation::CalcAzimuthState::Good :
|
||||
case CalcAzimuth::CalcAzimuthState::Good :
|
||||
lineTwo.concat("Good");
|
||||
break;
|
||||
|
||||
case Navigation::CalcAzimuthState::Invalid :
|
||||
case CalcAzimuth::CalcAzimuthState::Invalid :
|
||||
lineTwo.concat("Invalid");
|
||||
break;
|
||||
|
||||
case Navigation::CalcAzimuthState::Ok :
|
||||
case CalcAzimuth::CalcAzimuthState::Ok :
|
||||
lineTwo.concat("Ok");
|
||||
break;
|
||||
|
||||
case Navigation::CalcAzimuthState::Super :
|
||||
case CalcAzimuth::CalcAzimuthState::Super :
|
||||
lineTwo.concat("Super");
|
||||
break;
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#define MENU_CALIBRATE_COMPASS_H
|
||||
|
||||
#include "SpecialMenus/driveModi/menuDriveMode.h"
|
||||
#include ""
|
||||
#include "calibrateCompass.h"
|
||||
|
||||
/**
|
||||
@@ -44,7 +45,7 @@ class MenuCalibrateCompass : public MenuDriveMode {
|
||||
void runCommand() const override;
|
||||
|
||||
private:
|
||||
ManualControl* manualControl;
|
||||
CalibrateCompassM* caliCompassMode;
|
||||
CalibrateCompass* caliCompass;
|
||||
};
|
||||
|
||||
|
||||
@@ -23,12 +23,12 @@
|
||||
#include "debugTimes.h"
|
||||
#include "controlPadInput.h"
|
||||
#include "component.h"
|
||||
#include "sensorData.h"
|
||||
|
||||
// All Drive Modi
|
||||
#include "driveModi/Modi/ManualControl/manualControl.h"
|
||||
#include "driveModi/Modi/CaptureRoute/captureRoute.h"
|
||||
#include "driveModi/Modi/Autopilot/autopilot.h"
|
||||
#include "driveModi/Modi/ConsolControl/consolControl.h"
|
||||
#include "driveModi/Modi/TestMode/testMode.h"
|
||||
|
||||
/**
|
||||
@@ -40,7 +40,6 @@ enum class Modi {
|
||||
ManualControl,
|
||||
CaptureRoute,
|
||||
Autopilot,
|
||||
ConsolControl,
|
||||
TestMode
|
||||
};
|
||||
|
||||
@@ -53,7 +52,8 @@ class DriveManager : public Component {
|
||||
*
|
||||
* @param moveControl
|
||||
*/
|
||||
DriveManager(MoveControl *moveControl, SPIClass *spiPort, const ControlPadInput *input, bool wifi = false);
|
||||
DriveManager(MoveControl *moveControl, SensorData* sensorData, ControlPadInput *input, bool wifi = false);
|
||||
DriveManager(DriveModiParams params, bool wifi = false);
|
||||
|
||||
/**
|
||||
* @brief Destroy the Drive Manager object
|
||||
@@ -61,14 +61,6 @@ class DriveManager : public Component {
|
||||
*/
|
||||
~DriveManager();
|
||||
|
||||
/**
|
||||
* @brief Increment the DriveModi enum
|
||||
* Than calls changeModus
|
||||
*
|
||||
* @see Modi
|
||||
*/
|
||||
void nextModus();
|
||||
|
||||
/**
|
||||
* @brief Change the DriveModi to a specific value
|
||||
*
|
||||
@@ -106,14 +98,13 @@ class DriveManager : public Component {
|
||||
Modi getDriveModi() const { return this->currentModus; }
|
||||
|
||||
private:
|
||||
void run() override;
|
||||
void run() override {};
|
||||
void init(bool wifi);
|
||||
|
||||
Modi currentModus = Modi::Off;
|
||||
MoveControl *moveControl;
|
||||
const ControlPadInput* input;
|
||||
DriveModi *currentModusPtr = nullptr;
|
||||
Navigation* navigation;
|
||||
SPIClass* spiPort;
|
||||
DriveModiParams driveModiParams;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user