2024-01-15 22:28:34 -05:00
< script setup lang = "ts" >
import { useCameraSettingsStore } from "@/stores/settings/CameraSettingsStore" ;
2024-01-16 22:23:05 -05:00
import { type ActivePipelineSettings , PipelineType } from "@/types/PipelineTypes" ;
2024-01-15 22:28:34 -05:00
import PvSlider from "@/components/common/pv-slider.vue" ;
import { computed , getCurrentInstance } from "vue" ;
import { useStateStore } from "@/stores/StateStore" ;
// TODO fix pipeline typing in order to fix this, the store settings call should be able to infer that only valid pipeline type settings are exposed based on pre-checks for the entire config section
// Defer reference to store access method
2024-01-16 22:23:05 -05:00
const currentPipelineSettings = computed < ActivePipelineSettings > (
( ) => useCameraSettingsStore ( ) . currentPipelineSettings
) ;
2024-01-15 22:28:34 -05:00
2024-01-16 22:23:05 -05:00
const interactiveCols = computed ( ( ) =>
( getCurrentInstance ( ) ? . proxy . $vuetify . breakpoint . mdAndDown || false ) &&
( ! useStateStore ( ) . sidebarFolded || useCameraSettingsStore ( ) . isDriverMode )
? 9
: 8
) ;
2024-01-15 22:28:34 -05:00
< / script >
< template >
< div v-if = "currentPipelineSettings.pipelineType === PipelineType.ObjectDetection" >
< pv-slider
v - model = "currentPipelineSettings.confidence"
class = "pt-2"
: slider - cols = "interactiveCols"
label = "Confidence"
tooltip = "The minimum confidence for a detection to be considered valid. Bigger numbers mean fewer but more probable detections are allowed through."
: min = "0"
: max = "1"
: step = "0.01"
@ input = "(value) => useCameraSettingsStore().changeCurrentPipelineSetting({ confidence: value }, false)"
/ >
< / div >
< / template >