mirror of
https://github.com/PhotonVision/photonvision
synced 2026-07-06 03:31:41 +00:00
Check all new prop names not just exposure time (#1080)
Fixes v4l renaming prop names and OV9281 exposure min/max being wrong by introducing new UI control
This commit is contained in:
@@ -3,13 +3,13 @@ import PvSelect from "@/components/common/pv-select.vue";
|
||||
import PvNumberInput from "@/components/common/pv-number-input.vue";
|
||||
import { useCameraSettingsStore } from "@/stores/settings/CameraSettingsStore";
|
||||
import { useStateStore } from "@/stores/StateStore";
|
||||
import { ref, watchEffect } from "vue";
|
||||
import { computed, ref, watchEffect } from "vue";
|
||||
|
||||
const currentFov = ref();
|
||||
|
||||
const saveCameraSettings = () => {
|
||||
useCameraSettingsStore()
|
||||
.updateCameraSettings({ fov: currentFov.value }, false)
|
||||
.updateCameraSettings({ fov: currentFov.value, quirksToChange: quirksToChange.value }, false)
|
||||
.then((response) => {
|
||||
useCameraSettingsStore().currentCameraSettings.fov.value = currentFov.value;
|
||||
useStateStore().showSnackbarMessage({
|
||||
@@ -41,6 +41,43 @@ const saveCameraSettings = () => {
|
||||
watchEffect(() => {
|
||||
currentFov.value = useCameraSettingsStore().currentCameraSettings.fov.value;
|
||||
});
|
||||
|
||||
const quirksToChange = ref({
|
||||
ArduOV9281: false,
|
||||
ArduOV2311: false
|
||||
});
|
||||
|
||||
let arducams = ["N/A", "OV9281", "OV2311"];
|
||||
|
||||
const arducamModel = computed({
|
||||
get() {
|
||||
const quirks = useCameraSettingsStore().currentCameraSettings.cameraQuirks.quirks;
|
||||
|
||||
if (quirks.ArduOV9281) {
|
||||
return 1;
|
||||
} else if (quirks.ArduOV2311) {
|
||||
return 2;
|
||||
}
|
||||
return 0;
|
||||
},
|
||||
set(value) {
|
||||
if (value === 1) {
|
||||
quirksToChange.value.ArduOV9281 = true;
|
||||
quirksToChange.value.ArduOV2311 = false;
|
||||
} else if (value === 2) {
|
||||
quirksToChange.value.ArduOV9281 = false;
|
||||
quirksToChange.value.ArduOV2311 = true;
|
||||
} else {
|
||||
quirksToChange.value.ArduOV9281 = false;
|
||||
quirksToChange.value.ArduOV2311 = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const isArducam = () => {
|
||||
const settings = useCameraSettingsStore().currentCameraSettings;
|
||||
return settings.cameraQuirks.quirks.ArduCamCamera;
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -70,14 +107,15 @@ watchEffect(() => {
|
||||
:disabled="useCameraSettingsStore().currentCameraSettings.fov.managedByVendor"
|
||||
:label-cols="4"
|
||||
/>
|
||||
<pv-select
|
||||
v-model="arducamModel"
|
||||
label="Arducam Model"
|
||||
:disabled="!isArducam()"
|
||||
:items="arducams"
|
||||
:select-cols="8"
|
||||
/>
|
||||
<br />
|
||||
<v-btn
|
||||
style="margin-top: 10px"
|
||||
small
|
||||
color="secondary"
|
||||
:disabled="currentFov === useCameraSettingsStore().currentCameraSettings.fov.value"
|
||||
@click="saveCameraSettings"
|
||||
>
|
||||
<v-btn style="margin-top: 10px" small color="secondary" @click="saveCameraSettings">
|
||||
<v-icon left> mdi-content-save </v-icon>
|
||||
Save Changes
|
||||
</v-btn>
|
||||
|
||||
Reference in New Issue
Block a user