Skip to content

Commit

Permalink
Mission-planning: Add undo for survey generation
Browse files Browse the repository at this point in the history
Signed-off-by: Arturo Manzoli <[email protected]>
  • Loading branch information
ArturoManzoli committed Jan 14, 2025
1 parent 452dd23 commit 04f8cc0
Show file tree
Hide file tree
Showing 2 changed files with 255 additions and 68 deletions.
40 changes: 33 additions & 7 deletions src/components/mission-planning/ContextMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
color="#FFFFFF22"
class="text-[12px] rotate-[145deg]"
@click="handleToggleSurvey"
></v-btn
></template>
>
</v-btn>
</template>
</v-tooltip>
</div>

Expand All @@ -44,6 +45,24 @@
</template>
</v-tooltip>
</div>
<div v-if="enableUndo" id="button-3" class="orbit-button orbit-button-3">
<v-tooltip text="Edit survey's polygon">
<template #activator="{ props: tooltipProps2 }">
<v-btn
v-bind="tooltipProps2"
variant="elevated"
icon="mdi-pencil"
:style="{ backgroundColor: '#333333EE' }"
rounded="full"
:disabled="undoIsInProgress"
size="x-small"
color="#FFFFFF22"
class="text-[13px] rotate-[220deg]"
@click="handleUndoGenerateWaypoints"
></v-btn>
</template>
</v-tooltip>
</div>
<v-tooltip text="Delete survey">
<template #activator="{ props: tooltipProps3 }">
<div
Expand Down Expand Up @@ -111,6 +130,8 @@ const props = defineProps<{
selectedSurveyId: string | null
isCreatingSurvey: boolean
isCreatingSimpleMission: boolean
undoIsInProgress: boolean
enableUndo: boolean
}>()
/* eslint-enable jsdoc/require-jsdoc */
Expand All @@ -119,6 +140,7 @@ const emit = defineEmits<{
(event: 'toggleSurvey'): void
(event: 'toggleSimpleMission'): void
(event: 'deleteSelectedSurvey'): void
(event: 'undoGeneratedWaypoints'): void
}>()
const selectedSurveyId = computed(() => props.selectedSurveyId)
Expand Down Expand Up @@ -159,6 +181,10 @@ const handleToggleSimpleMission = (): void => {
emit('close')
}
const handleUndoGenerateWaypoints = (): void => {
emit('undoGeneratedWaypoints')
}
const handleDeleteSelectedSurvey = (): void => {
emit('deleteSelectedSurvey')
}
Expand Down Expand Up @@ -204,17 +230,17 @@ const handleDeleteSelectedSurvey = (): void => {
}
.orbit-button-1 {
animation: orbit-1 0.5s ease-out forwards;
animation: orbit-1 0.05s ease-out forwards;
}
.orbit-button-2 {
animation: orbit-2 0.4s ease-out forwards;
animation-delay: 0.2s;
animation: orbit-2 0.05s ease-out forwards;
animation-delay: 0.05s;
}
.orbit-button-3 {
animation: orbit-3 0.3s ease-out forwards;
animation-delay: 0.4s;
animation: orbit-3 0.05s ease-out forwards;
animation-delay: 0.05s;
}
@keyframes orbit-1 {
Expand Down
Loading

0 comments on commit 04f8cc0

Please sign in to comment.