mirror of
https://github.com/PhotonVision/photonvision
synced 2026-07-03 03:01:40 +00:00
UI patches (#905)
- Show 0 clients when NT server props are undefined - Add Prettier --------- Co-authored-by: Matthew Morley <matthew.morley.ca@gmail.com>
This commit is contained in:
@@ -8,12 +8,16 @@ import PhotonCameraStream from "@/components/app/photon-camera-stream.vue";
|
||||
|
||||
defineProps<{
|
||||
// TODO fully update v-model usage in custom components on Vue3 update
|
||||
value: number[]
|
||||
value: number[];
|
||||
}>();
|
||||
|
||||
const driverMode = computed<boolean>({
|
||||
get: () => useCameraSettingsStore().isDriverMode,
|
||||
set: v => useCameraSettingsStore().changeCurrentPipelineIndex(v ? -1 : useCameraSettingsStore().currentCameraSettings.lastPipelineIndex || 0, true)
|
||||
set: (v) =>
|
||||
useCameraSettingsStore().changeCurrentPipelineIndex(
|
||||
v ? -1 : useCameraSettingsStore().currentCameraSettings.lastPipelineIndex || 0,
|
||||
true
|
||||
)
|
||||
});
|
||||
|
||||
const fpsTooLow = computed<boolean>(() => {
|
||||
@@ -23,17 +27,12 @@ const fpsTooLow = computed<boolean>(() => {
|
||||
const gpuAccel = useSettingsStore().general.gpuAcceleration !== undefined;
|
||||
const isReflective = useCameraSettingsStore().currentPipelineSettings.pipelineType === PipelineType.Reflective;
|
||||
|
||||
return (currFPS - targetFPS) < -5 && currFPS !== 0 && !driverMode && gpuAccel && isReflective;
|
||||
return currFPS - targetFPS < -5 && currFPS !== 0 && !driverMode && gpuAccel && isReflective;
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<v-card
|
||||
color="primary"
|
||||
height="100%"
|
||||
style="display: flex; flex-direction: column"
|
||||
dark
|
||||
>
|
||||
<v-card color="primary" height="100%" style="display: flex; flex-direction: column" dark>
|
||||
<v-card-title
|
||||
class="pb-0 mb-0 pl-4 pt-1"
|
||||
style="min-height: 50px; justify-content: space-between; align-content: center"
|
||||
@@ -49,7 +48,13 @@ const fpsTooLow = computed<boolean>(() => {
|
||||
<span class="pr-1">
|
||||
Processing @ {{ Math.round(useStateStore().pipelineResults?.fps || 0) }} FPS –
|
||||
</span>
|
||||
<span v-if="fpsTooLow && !useCameraSettingsStore().currentPipelineSettings.inputShouldShow && useCameraSettingsStore().currentPipelineSettings.pipelineType === PipelineType.Reflective">
|
||||
<span
|
||||
v-if="
|
||||
fpsTooLow &&
|
||||
!useCameraSettingsStore().currentPipelineSettings.inputShouldShow &&
|
||||
useCameraSettingsStore().currentPipelineSettings.pipelineType === PipelineType.Reflective
|
||||
"
|
||||
>
|
||||
HSV thresholds are too broad; narrow them for better performance
|
||||
</span>
|
||||
<span v-else-if="fpsTooLow && useCameraSettingsStore().currentPipelineSettings.inputShouldShow">
|
||||
@@ -61,39 +66,16 @@ const fpsTooLow = computed<boolean>(() => {
|
||||
</v-chip>
|
||||
</div>
|
||||
<div>
|
||||
<v-switch
|
||||
v-model="driverMode"
|
||||
label="Driver Mode"
|
||||
style="margin-left: auto;"
|
||||
color="accent"
|
||||
class="pt-2"
|
||||
/>
|
||||
<v-switch v-model="driverMode" label="Driver Mode" style="margin-left: auto" color="accent" class="pt-2" />
|
||||
</div>
|
||||
</v-card-title>
|
||||
<v-divider style="border-color: white" />
|
||||
<v-row
|
||||
class="pl-3 pr-3 pt-3 pb-3"
|
||||
style="flex-wrap: nowrap; justify-content: center"
|
||||
>
|
||||
<v-col
|
||||
v-show="value.includes(0)"
|
||||
style="max-width: 500px; display: flex; align-items: center"
|
||||
>
|
||||
<photon-camera-stream
|
||||
id="input-camera-stream"
|
||||
stream-type="Raw"
|
||||
style="width: 100%; height: auto"
|
||||
/>
|
||||
<v-row class="pl-3 pr-3 pt-3 pb-3" style="flex-wrap: nowrap; justify-content: center">
|
||||
<v-col v-show="value.includes(0)" style="max-width: 500px; display: flex; align-items: center">
|
||||
<photon-camera-stream id="input-camera-stream" stream-type="Raw" style="width: 100%; height: auto" />
|
||||
</v-col>
|
||||
<v-col
|
||||
v-show="value.includes(1)"
|
||||
style="max-width: 500px; display: flex; align-items: center"
|
||||
>
|
||||
<photon-camera-stream
|
||||
id="output-camera-stream"
|
||||
stream-type="Processed"
|
||||
style="width: 100%; height: auto"
|
||||
/>
|
||||
<v-col v-show="value.includes(1)" style="max-width: 500px; display: flex; align-items: center">
|
||||
<photon-camera-stream id="output-camera-stream" stream-type="Processed" style="width: 100%; height: auto" />
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card>
|
||||
|
||||
Reference in New Issue
Block a user