From d59be893ae3046647c49ab3a9907e2134f893119 Mon Sep 17 00:00:00 2001 From: Sriman Achanta <68172138+srimanachanta@users.noreply.github.com> Date: Tue, 16 Jan 2024 22:23:05 -0500 Subject: [PATCH] Fix UI bugs from RKNN PR (#1169) * fix interactiveCols * fix deferred store bug * Fix bug where ObjectDetection pipeline could be made on invalid platforms * Update vite.config.ts --- .../dashboard/CameraAndPipelineSelectCard.vue | 21 ++++++++++++------- .../components/dashboard/tabs/AprilTagTab.vue | 13 ++++++------ .../components/dashboard/tabs/ArucoTab.vue | 13 ++++++------ .../components/dashboard/tabs/ContoursTab.vue | 13 ++++++------ .../components/dashboard/tabs/InputTab.vue | 13 ++++++------ .../dashboard/tabs/ObjectDetectionTab.vue | 19 +++++++++-------- .../components/dashboard/tabs/OutputTab.vue | 13 ++++++------ .../src/components/dashboard/tabs/PnPTab.vue | 13 ++++++------ .../dashboard/tabs/ThresholdTab.vue | 13 ++++++------ photon-client/vite.config.ts | 2 +- 10 files changed, 67 insertions(+), 66 deletions(-) diff --git a/photon-client/src/components/dashboard/CameraAndPipelineSelectCard.vue b/photon-client/src/components/dashboard/CameraAndPipelineSelectCard.vue index a42264186..38505dee0 100644 --- a/photon-client/src/components/dashboard/CameraAndPipelineSelectCard.vue +++ b/photon-client/src/components/dashboard/CameraAndPipelineSelectCard.vue @@ -27,6 +27,7 @@ const changeCurrentCameraIndex = (index: number) => { break; case PipelineType.ObjectDetection: pipelineType.value = WebsocketPipelineType.ObjectDetection; + break; } }; @@ -124,6 +125,18 @@ const cancelPipelineNameEdit = () => { const showPipelineCreationDialog = ref(false); const newPipelineName = ref(""); const newPipelineType = ref(useCameraSettingsStore().currentWebsocketPipelineType); +const validNewPipelineTypes = computed(() => { + const pipelineTypes = [ + { name: "Reflective", value: WebsocketPipelineType.Reflective }, + { name: "Colored Shape", value: WebsocketPipelineType.ColoredShape }, + { name: "AprilTag", value: WebsocketPipelineType.AprilTag }, + { name: "Aruco", value: WebsocketPipelineType.Aruco } + ]; + if (useSettingsStore().general.rknnSupported) { + pipelineTypes.push({ name: "Object Detection", value: WebsocketPipelineType.ObjectDetection }); + } + return pipelineTypes; +}); const showCreatePipelineDialog = () => { newPipelineName.value = ""; newPipelineType.value = useCameraSettingsStore().currentWebsocketPipelineType; @@ -359,13 +372,7 @@ useCameraSettingsStore().$subscribe((mutation, state) => { :select-cols="12 - 3" label="Tracking Type" tooltip="Pipeline type, which changes the type of processing that will happen on input frames" - :items="[ - { name: 'Reflective', value: WebsocketPipelineType.Reflective }, - { name: 'Colored Shape', value: WebsocketPipelineType.ColoredShape }, - { name: 'AprilTag', value: WebsocketPipelineType.AprilTag }, - { name: 'Aruco', value: WebsocketPipelineType.Aruco }, - { name: 'Object Detection', value: WebsocketPipelineType.ObjectDetection } - ]" + :items="validNewPipelineTypes" /> diff --git a/photon-client/src/components/dashboard/tabs/AprilTagTab.vue b/photon-client/src/components/dashboard/tabs/AprilTagTab.vue index 359c54f0f..a7b017d38 100644 --- a/photon-client/src/components/dashboard/tabs/AprilTagTab.vue +++ b/photon-client/src/components/dashboard/tabs/AprilTagTab.vue @@ -14,13 +14,12 @@ const currentPipelineSettings = computed( () => useCameraSettingsStore().currentPipelineSettings ); -const interactiveCols = computed( - () => - (getCurrentInstance()?.proxy.$vuetify.breakpoint.mdAndDown || false) && - (!useStateStore().sidebarFolded || useCameraSettingsStore().isDriverMode) -) - ? 9 - : 8; +const interactiveCols = computed(() => + (getCurrentInstance()?.proxy.$vuetify.breakpoint.mdAndDown || false) && + (!useStateStore().sidebarFolded || useCameraSettingsStore().isDriverMode) + ? 9 + : 8 +);