Browse Source

Merge pull request #5267 from DonLakeFlyer/UploadProgress

Plan: Better upload progress indication
QGC4.4
Don Gagne 8 years ago committed by GitHub
parent
commit
d1c2f3fb2c
  1. 3
      src/MissionManager/PlanMasterController.cc
  2. 36
      src/PlanView/PlanToolBar.qml

3
src/MissionManager/PlanMasterController.cc

@ -154,6 +154,7 @@ void PlanMasterController::loadFromVehicle(void)
} else { } else {
_loadGeoFence = true; _loadGeoFence = true;
_syncInProgress = true; _syncInProgress = true;
emit syncInProgressChanged(true);
_missionController.loadFromVehicle(); _missionController.loadFromVehicle();
setDirty(false); setDirty(false);
} }
@ -225,6 +226,8 @@ void PlanMasterController::sendToVehicle(void)
} else { } else {
qCDebug(PlanMasterControllerLog) << "PlanMasterController::sendToVehicle start mission sendToVehicle"; qCDebug(PlanMasterControllerLog) << "PlanMasterController::sendToVehicle start mission sendToVehicle";
_sendGeoFence = true; _sendGeoFence = true;
_syncInProgress = true;
emit syncInProgressChanged(true);
_missionController.sendToVehicle(); _missionController.sendToVehicle();
setDirty(false); setDirty(false);
} }

36
src/PlanView/PlanToolBar.qml

@ -117,6 +117,8 @@ Rectangle {
on_ControllerProgressPctChanged: { on_ControllerProgressPctChanged: {
if (_controllerProgressPct === 1) { if (_controllerProgressPct === 1) {
missionStats.visible = false
uploadCompleteText.visible = true
resetProgressTimer.start() resetProgressTimer.start()
} else if (_controllerProgressPct > 0) { } else if (_controllerProgressPct > 0) {
progressBar.visible = true progressBar.visible = true
@ -125,8 +127,12 @@ Rectangle {
Timer { Timer {
id: resetProgressTimer id: resetProgressTimer
interval: 1000 interval: 5000
onTriggered: progressBar.visible = false onTriggered: {
missionStats.visible = true
uploadCompleteText.visible = false
progressBar.visible = false
}
} }
Rectangle { Rectangle {
@ -139,15 +145,29 @@ Rectangle {
visible: false visible: false
} }
QGCLabel {
id: uploadCompleteText
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: logoRow.right
anchors.right: uploadButton.left
font.pointSize: ScreenTools.largeFontPointSize
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: "Done"
visible: false
}
GridLayout { GridLayout {
anchors.top: parent.top id: missionStats
anchors.bottom: parent.bottom anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.leftMargin: _margins anchors.leftMargin: _margins
anchors.rightMargin: _margins anchors.rightMargin: _margins
anchors.left: logoRow.right anchors.left: logoRow.right
anchors.right: uploadButton.visible ? uploadButton.left : parent.right anchors.right: uploadButton.visible ? uploadButton.left : parent.right
columnSpacing: 0//_margins columnSpacing: 0
columns: 3 columns: 3
GridLayout { GridLayout {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@ -281,7 +301,7 @@ Rectangle {
text: _controllerDirty ? qsTr("Upload Required") : qsTr("Upload") text: _controllerDirty ? qsTr("Upload Required") : qsTr("Upload")
enabled: !_controllerSyncInProgress enabled: !_controllerSyncInProgress
visible: !_controllerOffline visible: !_controllerOffline
primary: _controllerDirty primary: _controllerDirty && !_controllerSyncInProgress
onClicked: planMasterController.upload() onClicked: planMasterController.upload()
PropertyAnimation on opacity { PropertyAnimation on opacity {
@ -289,7 +309,7 @@ Rectangle {
from: 0.5 from: 0.5
to: 1 to: 1
loops: Animation.Infinite loops: Animation.Infinite
running: _controllerDirty running: _controllerDirty && !_controllerSyncInProgress
alwaysRunToEnd: true alwaysRunToEnd: true
duration: 2000 duration: 2000
} }

Loading…
Cancel
Save