Commit 071506a9 authored by Valentin Platzgummer's avatar Valentin Platzgummer

WimaPlaner auto recacl paths added

parent e07f9bc8
......@@ -1053,9 +1053,9 @@ bool MissionController::readyForSaveSend(void) const
return true;
}
bool MissionController::setTakeoffCommand(SimpleMissionItem &missionItem, Vehicle &vehicle)
bool MissionController::setTakeoffCommand(SimpleMissionItem &missionItem)
{
if (vehicle.fixedWing() || vehicle.vtol() || vehicle.multiRotor()) {
if (_controllerVehicle->fixedWing() || _controllerVehicle->vtol() || _controllerVehicle->multiRotor()) {
MAV_CMD takeoffCmd = _controllerVehicle->vtol() ? MAV_CMD_NAV_VTOL_TAKEOFF : MAV_CMD_NAV_TAKEOFF;
if (_controllerVehicle->firmwarePlugin()->supportedMissionCommands().contains(takeoffCmd)) {
missionItem.setCommand(takeoffCmd);
......@@ -1067,10 +1067,10 @@ bool MissionController::setTakeoffCommand(SimpleMissionItem &missionItem, Vehicl
return true;
}
bool MissionController::setLandCommand(SimpleMissionItem &missionItem, Vehicle &vehicle)
bool MissionController::setLandCommand(SimpleMissionItem &missionItem)
{
MAV_CMD landCmd = vehicle.vtol() ? MAV_CMD_NAV_VTOL_LAND : MAV_CMD_NAV_LAND;
if (vehicle.firmwarePlugin()->supportedMissionCommands().contains(landCmd)) {
MAV_CMD landCmd = _controllerVehicle->vtol() ? MAV_CMD_NAV_VTOL_LAND : MAV_CMD_NAV_LAND;
if (_controllerVehicle->firmwarePlugin()->supportedMissionCommands().contains(landCmd)) {
missionItem.setCommand(landCmd);
} else
return false;
......
......@@ -151,9 +151,9 @@ public:
bool readyForSaveSend(void) const;
/// sets the command in missionItem to a land command
bool setLandCommand (SimpleMissionItem &missionItem, Vehicle &vehicle);
bool setLandCommand (SimpleMissionItem &missionItem);
/// sets the command in missionItem to a takeoff command
bool setTakeoffCommand (SimpleMissionItem &missionItem, Vehicle &vehicle);
bool setTakeoffCommand (SimpleMissionItem &missionItem);
/// Sends the mission items to the specified vehicle
static void sendItemsToVehicle(Vehicle* vehicle, QmlObjectListModel* visualMissionItems);
......
......@@ -548,7 +548,7 @@ bool WimaController::calcNextPhase()
qWarning("WimaController::calcNextPhase(): nullptr");
return false;
}
_missionController->setLandCommand(*landItem, *_masterController->controllerVehicle());
_missionController->setLandCommand(*landItem);
// copy to _currentMissionItems
for ( int i = 1; i < missionControllerVisuals->count(); i++) {
......
This diff is collapsed.
......@@ -122,10 +122,12 @@ signals:
private slots:
void recalcPolygonInteractivity (int index);
bool calcArrivalAndReturnPath (void);
bool recalcJoinedArea (QString &errorString);
void pushToContainer ();
void setDirtyTrue ();
// called by _updateTimer::timeout signal, updates different mission parts, if parameters (e.g. survey or areas) have changed
void updateTimerSlot ();
private:
// Member Functions
WimaPlanData toPlanData();
......@@ -145,4 +147,10 @@ private:
WimaCorridor _corridor; // corridor connecting _measurementArea and _serviceArea
int _arrivalPathLength; // the number waypoints the arrival path consists of (path from takeoff to first measurement point)
int _returnPathLength; // the number waypoints the return path consists of (path from last measurement point to land)
CircularSurveyComplexItem* _circularSurvey; // pointer to the CircularSurvey item in _missionController.visualItems()
QTimer _updateTimer; // on this timers timeout different mission parts will be updated, if parameters (e.g. survey or areas) have changed
QGeoCoordinate _lastSurveyRefPoint;
bool _surveyRefChanging;
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment