diff --git a/src/Vehicle/Vehicle.cc b/src/Vehicle/Vehicle.cc index 39c49a80877e211462a487d8771e19f561451ad7..ba290b3ae3e48b1ba8f0951e1a84c79b6ec10005 100644 --- a/src/Vehicle/Vehicle.cc +++ b/src/Vehicle/Vehicle.cc @@ -1959,7 +1959,7 @@ void Vehicle::_rallyPointLoadComplete(void) qCDebug(VehicleLog) << "_missionLoadComplete _initialPlanRequestComplete = true"; if (!_initialPlanRequestComplete) { _initialPlanRequestComplete = true; - emit initialPlanRequestCompleted(); + emit initialPlanRequestCompleteChanged(true); } } @@ -2817,6 +2817,18 @@ void Vehicle::_updateDistanceToHome(void) } } +void Vehicle::forceInitialPlanRequestComplete(void) +{ + _initialPlanRequestComplete = true; + emit initialPlanRequestCompleteChanged(true); +} + +void Vehicle::sendPlan(QString planFile) +{ + PlanMasterController::sendPlanToVehicle(this, planFile); +} + + //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- diff --git a/src/Vehicle/Vehicle.h b/src/Vehicle/Vehicle.h index 21ac005d35c38f7d1f582f4de1e20e3032d2bb09..57e6479a79fab7017a02d4ff60734edb441f4f93 100644 --- a/src/Vehicle/Vehicle.h +++ b/src/Vehicle/Vehicle.h @@ -317,6 +317,7 @@ public: Q_PROPERTY(QVariantList toolBarIndicators READ toolBarIndicators CONSTANT) Q_PROPERTY(QVariantList cameraList READ cameraList CONSTANT) Q_PROPERTY(QmlObjectListModel* adsbVehicles READ adsbVehicles CONSTANT) + Q_PROPERTY(bool initialPlanRequestComplete READ initialPlanRequestComplete NOTIFY initialPlanRequestCompleteChanged) /// true: Vehicle is flying, false: Vehicle is on ground Q_PROPERTY(bool flying READ flying NOTIFY flyingChanged) @@ -429,6 +430,7 @@ public: Q_INVOKABLE void clearMessages(); Q_INVOKABLE void triggerCamera(void); + Q_INVOKABLE void sendPlan(QString planFile); #if 0 // Temporarily removed, waiting for new command implementation @@ -700,7 +702,7 @@ public: /// @return: true: initial request is complete, false: initial request is still in progress; bool initialPlanRequestComplete(void) const { return _initialPlanRequestComplete; } - void forceInitialPlanRequestComplete(void) { _initialPlanRequestComplete = true; } + void forceInitialPlanRequestComplete(void); void _setFlying(bool flying); void _setLanding(bool landing); @@ -734,7 +736,7 @@ signals: void firmwareTypeChanged(void); void vehicleTypeChanged(void); void capabilitiesKnownChanged(bool capabilitiesKnown); - void initialPlanRequestCompleted(void); + void initialPlanRequestCompleteChanged(bool initialPlanRequestComplete); void capabilityBitsChanged(uint64_t capabilityBits); void messagesReceivedChanged (); diff --git a/src/qgcunittest/UnitTest.cc b/src/qgcunittest/UnitTest.cc index a970b5f1c9d681dfd49f6813bf294de384b04cb3..f2c9d260946f2cf890ae7cf0f477dede74887888 100644 --- a/src/qgcunittest/UnitTest.cc +++ b/src/qgcunittest/UnitTest.cc @@ -394,7 +394,7 @@ void UnitTest::_connectMockLink(MAV_AUTOPILOT autopilot) // Wait for plan request to complete if (!_vehicle->initialPlanRequestComplete()) { - QSignalSpy spyPlan(_vehicle, SIGNAL(initialPlanRequestCompleted())); + QSignalSpy spyPlan(_vehicle, SIGNAL(initialPlanRequestCompleteChanged(bool))); QCOMPARE(spyPlan.wait(10000), true); } }