Commit debee651 authored by Valentin Platzgummer's avatar Valentin Platzgummer

trying to add wp form wimaPlaner to flight view

parent a48d2306
......@@ -386,6 +386,34 @@ int MissionController::insertSimpleMissionItem(QGeoCoordinate coordinate, int i)
return newItem->sequenceNumber();
int MissionController::insertSimpleMissionItem(const MissionItem &missionItem, int i)
int sequenceNumber = _nextSequenceNumber();
SimpleMissionItem * newItem = new SimpleMissionItem(_controllerVehicle, _flyView, missionItem, this);
MAV_CMD takeoffCmd = _controllerVehicle->vtol() ? MAV_CMD_NAV_VTOL_TAKEOFF : MAV_CMD_NAV_TAKEOFF;
if (newItem->command() == takeoffCmd) {
if (!_controllerVehicle->firmwarePlugin()->supportedMissionCommands().contains(takeoffCmd)) {
return -1; // can not add this takeoff command for this vehicle
if (newItem->specifiesAltitude()) {
double prevAltitude;
int prevAltitudeMode;
if (_findPreviousAltitude(i, &prevAltitude, &prevAltitudeMode)) {
_visualItems->insert(i, newItem);
return newItem->sequenceNumber();
int MissionController::insertROIMissionItem(QGeoCoordinate coordinate, int i)
int sequenceNumber = _nextSequenceNumber();
......@@ -108,6 +108,11 @@ public:
/// @return Sequence number for new item
Q_INVOKABLE int insertSimpleMissionItem(QGeoCoordinate coordinate, int i);
/// Add a new simple mission item to the list
/// @param i: index to insert at
/// @return Sequence number for new item
int insertSimpleMissionItem(const MissionItem &missionItem, int i);
/// Add a new ROI mission item to the list
/// @param i: index to insert at
/// @return Sequence number for new item
add refpt gui and edit constructor
new path optim required for circ survey
add gui elements for circ survey
solve bug for cantFindPath.wima on Desktop/WimaPath
......@@ -214,6 +214,11 @@ void WimaController::containerDataValidChanged(bool valid)
for (auto missionItem : tempMissionItems)
_missionItems.append(const_cast<MissionItem *>(missionItem)); // losing const qualifier here
QmlObjectListModel* missionItems = _missionController->visualItems();
for ( auto missionItem : tempMissionItems)
_missionController->insertSimpleMissionItem(*missionItem, missionItems->count());
if (areaCounter == numAreas)
_localPlanDataValid = true;
......@@ -6,3 +6,6 @@ How to exchange mission between WimaPlaner and WimaController.
4) start/continue mission
5) return vehicle on battery low
6) go to 4) or quit if last waypoint reached
investigate load, loadFromVehicle, syncInProgress, _newMissionItemsAvailableFromVehicle
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