Commit 2a777cc8 authored by Gus Grubba's avatar Gus Grubba

Merge branch 'Stable_V3.2' of https://github.com/mavlink/qgroundcontrol into cameraControl

parents aa490d2c bd287607
......@@ -106,6 +106,7 @@ QGCView {
Connections {
target: _missionController
onResumeMissionReady: guidedActionsController.confirmAction(guidedActionsController.actionResumeMissionReady)
onResumeMissionUploadFail: guidedActionsController.confirmAction(guidedActionsController.actionResumeMissionUploadFail)
}
MessageDialog {
......
......@@ -41,6 +41,7 @@ Item {
readonly property string startMissionTitle: qsTr("Start Mission")
readonly property string continueMissionTitle: qsTr("Continue Mission")
readonly property string resumeMissionTitle: qsTr("Resume Mission")
readonly property string resumeMissionUploadFailTitle: qsTr("Resume FAILED")
readonly property string pauseTitle: qsTr("Pause")
readonly property string changeAltTitle: qsTr("Change Altitude")
readonly property string orbitTitle: qsTr("Orbit")
......@@ -55,6 +56,7 @@ Item {
readonly property string startMissionMessage: qsTr("Takeoff from ground and start the current mission.")
readonly property string continueMissionMessage: qsTr("Continue the mission from the current waypoint.")
property string resumeMissionMessage: qsTr("Resume the current mission. This will re-generate the mission from waypoint %1, takeoff and continue the mission.").arg(_resumeMissionIndex)
property string resumeMissionUploadFailMessage: qsTr("Upload of resume mission failed. Confirm to retry upload")
readonly property string resumeMissionReadyMessage: qsTr("Review the modified mission. Confirm if you want to takeoff and begin mission.")
readonly property string landMessage: qsTr("Land the vehicle at the current position.")
readonly property string rtlMessage: qsTr("Return to the home position of the vehicle.")
......@@ -80,7 +82,8 @@ Item {
readonly property int actionContinueMission: 13
readonly property int actionResumeMission: 14
readonly property int actionResumeMissionReady: 15
readonly property int actionPause: 16
readonly property int actionResumeMissionUploadFail: 16
readonly property int actionPause: 17
property bool showEmergenyStop: !_hideEmergenyStop && _activeVehicle && _vehicleArmed && _vehicleFlying
property bool showArm: _activeVehicle && !_vehicleArmed
......@@ -205,6 +208,11 @@ Item {
confirmDialog.message = resumeMissionMessage
confirmDialog.hideTrigger = Qt.binding(function() { return !showResumeMission })
break;
case actionResumeMissionUploadFail:
confirmDialog.title = resumeMissionUploadFailTitle
confirmDialog.message = resumeMissionUploadFailMessage
confirmDialog.hideTrigger = Qt.binding(function() { return !showResumeMission })
break;
case actionResumeMissionReady:
confirmDialog.title = resumeMissionTitle
confirmDialog.message = resumeMissionReadyMessage
......@@ -271,6 +279,7 @@ Item {
_activeVehicle.guidedModeTakeoff()
break
case actionResumeMission:
case actionResumeMissionUploadFail:
missionController.resumeMission(missionController.resumeMissionIndex)
break
case actionResumeMissionReady:
......
......@@ -1476,6 +1476,7 @@ void MissionController::managerVehicleChanged(Vehicle* managerVehicle)
connect(_missionManager, &MissionManager::currentIndexChanged, this, &MissionController::_currentMissionIndexChanged);
connect(_missionManager, &MissionManager::lastCurrentIndexChanged, this, &MissionController::resumeMissionIndexChanged);
connect(_missionManager, &MissionManager::resumeMissionReady, this, &MissionController::resumeMissionReady);
connect(_missionManager, &MissionManager::resumeMissionUploadFail, this, &MissionController::resumeMissionUploadFail);
connect(_managerVehicle, &Vehicle::homePositionChanged, this, &MissionController::_managerVehicleHomePositionChanged);
connect(_managerVehicle, &Vehicle::defaultCruiseSpeedChanged, this, &MissionController::_recalcMissionFlightStatus);
connect(_managerVehicle, &Vehicle::defaultHoverSpeedChanged, this, &MissionController::_recalcMissionFlightStatus);
......
......@@ -160,6 +160,7 @@ signals:
void complexMissionItemNamesChanged(void);
void resumeMissionIndexChanged(void);
void resumeMissionReady(void);
void resumeMissionUploadFail(void);
void batteryChangePointChanged(int batteryChangePoint);
void batteriesRequiredChanged(int batteriesRequired);
void plannedHomePositionChanged(QGeoCoordinate plannedHomePosition);
......
......@@ -55,6 +55,7 @@ void MissionManager::_writeMissionItemsWorker(void)
qCDebug(MissionManagerLog) << "writeMissionItems count:" << _writeMissionItems.count();
// Prime write list
_itemIndicesToWrite.clear();
for (int i=0; i<_writeMissionItems.count(); i++) {
_itemIndicesToWrite << i;
}
......@@ -63,11 +64,6 @@ void MissionManager::_writeMissionItemsWorker(void)
_retryCount = 0;
emit inProgressChanged(true);
_writeMissionCount();
_currentMissionIndex = -1;
_lastCurrentIndex = -1;
emit currentIndexChanged(-1);
emit lastCurrentIndexChanged(-1);
}
......@@ -875,6 +871,10 @@ void MissionManager::_finishTransaction(bool success)
case TransactionWrite:
if (success) {
// Write succeeded, update internal list to be current
_currentMissionIndex = -1;
_lastCurrentIndex = -1;
emit currentIndexChanged(-1);
emit lastCurrentIndexChanged(-1);
_clearAndDeleteMissionItems();
for (int i=0; i<_writeMissionItems.count(); i++) {
_missionItems.append(_writeMissionItems[i]);
......@@ -895,7 +895,11 @@ void MissionManager::_finishTransaction(bool success)
if (_resumeMission) {
_resumeMission = false;
if (success) {
emit resumeMissionReady();
} else {
emit resumeMissionUploadFail();
}
}
}
......
......@@ -88,6 +88,7 @@ signals:
void currentIndexChanged(int currentIndex);
void lastCurrentIndexChanged(int lastCurrentIndex);
void resumeMissionReady(void);
void resumeMissionUploadFail(void);
void progressPct(double progressPercentPct);
void removeAllComplete (bool error);
void sendComplete (bool error);
......
......@@ -671,3 +671,8 @@ void QGCApplication::qmlAttemptWindowClose(void)
{
QMetaObject::invokeMethod(_rootQmlObject(), "attemptWindowClose");
}
bool QGCApplication::isInternetAvailable()
{
return getQGCMapEngine()->isInternetActive();
}
......@@ -92,6 +92,9 @@ public:
/// Do we have Bluetooth Support?
bool isBluetoothAvailable() { return _bluetoothAvailable; }
/// Is Internet available?
bool isInternetAvailable();
public slots:
/// You can connect to this slot to show an information message box from a different thread.
void informationMessageBoxOnMainThread(const QString& title, const QString& msg);
......
......@@ -1056,7 +1056,7 @@ void
QGCCacheWorker::_testInternet()
{
QTcpSocket socket;
socket.connectToHost("8.8.8.8", 53);
socket.connectToHost("www.github.com", 80);
if (socket.waitForConnected(2500)) {
qCDebug(QGCTileCacheLog) << "Yes Internet Access";
emit internetStatus(true);
......
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