Commit cc30c9c6 authored by Don Gagne's avatar Don Gagne

Better upload progress indication

parent d30527f4
...@@ -154,6 +154,7 @@ void PlanMasterController::loadFromVehicle(void) ...@@ -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) ...@@ -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);
} }
......
...@@ -117,6 +117,8 @@ Rectangle { ...@@ -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 { ...@@ -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 { ...@@ -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
...@@ -278,10 +298,10 @@ Rectangle { ...@@ -278,10 +298,10 @@ Rectangle {
anchors.rightMargin: _margins anchors.rightMargin: _margins
anchors.right: parent.right anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: _controllerDirty ? qsTr("Upload Required") : qsTr("Upload") text: _controllerSyncInProgress ? qsTr("Uploading...") : (_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 { ...@@ -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
} }
......
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