- reafctor

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