Skip to content

Commit

Permalink
Mission-planner: Fix loaction of mission's upload and download linear…
Browse files Browse the repository at this point in the history
… progress bar

Signed-off-by: Arturo Manzoli <[email protected]>
  • Loading branch information
ArturoManzoli committed Nov 4, 2024
1 parent 05eefe7 commit f13f964
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
12 changes: 12 additions & 0 deletions src/components/widgets/Map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,15 @@
absolute
bottom
color="white"
:style="`top: ${topProgressBarDisplacement}`"
/>
<p
v-if="fetchingMission"
:style="{ top: topProgressBarDisplacement }"
class="absolute left-[7px] mt-4 flex text-md font-bold text-white z-30 drop-shadow-md"
>
Loading mission...
</p>
</template>

<script setup lang="ts">
Expand Down Expand Up @@ -557,6 +565,10 @@ const widgetStore = useWidgetManagerStore()
const bottomButtonsDisplacement = computed(() => {
return `${Math.max(-widgetStore.widgetClearanceForVisibleArea(widget.value).bottom, 0)}px`
})
const topProgressBarDisplacement = computed(() => {
return `${Math.max(-widgetStore.widgetClearanceForVisibleArea(widget.value).top, 0)}px`
})
</script>

<style>
Expand Down
14 changes: 12 additions & 2 deletions src/views/MissionPlanningView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,15 @@
absolute
bottom
height="10"
color="rgba(0, 110, 255, 0.8)"
color="white"
:style="`top: ${widgetStore.currentTopBarHeightPixels}px`"
/>
<p
v-if="uploadingMission"
class="fixed top-[58px] left-[7px] flex text-md font-bold text-white z-30 drop-shadow-md"
>
Uploading mission to vehicle...
</p>
</div>
</template>

Expand Down Expand Up @@ -283,6 +290,9 @@ const uploadMissionToVehicle = async (): Promise<void> => {
missionUploadProgress.value = loadingPerc
}
try {
if (!vehicleStore.isVehicleOnline) {
throw 'Vehicle is not online.'
}
await vehicleStore.uploadMission(missionStore.currentPlanningWaypoints, loadingCallback)
const message = `Mission upload succeed! Open the Map widget in Flight Mode and click the "play" button to start the mission.`
showDialog({ variant: 'success', message, timer: 6000 })
Expand Down Expand Up @@ -729,7 +739,7 @@ const generateWaypointsFromSurvey = (): void => {
clearSurveyPath()
isCreatingSurvey.value = false
showDialog({ variant: 'success', message: 'Waypoints generated from survey path.', timer: 3000 })
showDialog({ variant: 'success', message: 'Waypoints generated from survey path.', timer: 1000 })
}
// Helper function to connect two waypoints with a polyline
Expand Down

0 comments on commit f13f964

Please sign in to comment.