mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-23 01:21:40 +00:00
Does the following: - Adjusts the shade of red buttons and banners to increase readability and reduce eye strain   - Cleans up factory reset and camera deletion modals   - Removes matchCamerasOnlyByPath as it is no longer used and throws errors in the console  - Limits the criteria to flag a camera mismatch in Camera Matching to only what is necessary based on camera type and highlights differences in table properties (testing on this is appreciated)  - Only displays both saved vs. current info in camera matching if there is a difference between the two  - Some general code cleanup (reduced unnecessary padding/margin/row-col statements, style="display:flex;" -> class="d-flex", etc. - Moves Compact Mode button to the bottom away from all the menu items (cleaner imo, open to thoughts) - Establishes a general spacing format for cards and pages and applies this to existing cards and pages to create a consistent look and feel to the UI (e.g. keeping things in line and less erratic spacing/placement of UI elements)     - Delete protection for camera matching modules - Anti-backend-spam for activate/deactivate/delete modules to hopefully prevent any odd behavior from button spamming - Enforces a common camera stream size on camera matching view (NEEDS MORE TESTING)  https://private-user-images.githubusercontent.com/29715865/400783758-dc99c151-b8a7-4367-a173-74c2fc5b2666.mp4?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzYyNTc3NzEsIm5iZiI6MTczNjI1NzQ3MSwicGF0aCI6Ii8yOTcxNTg2NS80MDA3ODM3NTgtZGM5OWMxNTEtYjhhNy00MzY3LWExNzMtNzRjMmZjNWIyNjY2Lm1wND9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAxMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMTA3VDEzNDQzMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWMwOWM1MDc2ZTVlOWZhM2MxYjAwZjAyZTc2MTYyZTk1ZTVmOGFhZmVkMzlmODRlZTk1ODVlOTk2ZGQzZmM0Y2EmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.ovtRnObwbkEfljr9d5fqaory0nH91LWJSSkmrUUe_4Y
124 lines
3.7 KiB
Vue
124 lines
3.7 KiB
Vue
<script setup lang="ts">
|
|
import { computed } from "vue";
|
|
import CamerasCard from "@/components/dashboard/CamerasCard.vue";
|
|
import CameraAndPipelineSelectCard from "@/components/dashboard/CameraAndPipelineSelectCard.vue";
|
|
import StreamConfigCard from "@/components/dashboard/StreamConfigCard.vue";
|
|
import PipelineConfigCard from "@/components/dashboard/ConfigOptions.vue";
|
|
import { useCameraSettingsStore } from "@/stores/settings/CameraSettingsStore";
|
|
import { useStateStore } from "@/stores/StateStore";
|
|
import { PlaceholderCameraSettings } from "@/types/SettingTypes";
|
|
|
|
const cameraViewType = computed<number[]>({
|
|
get: (): number[] => {
|
|
// Only show the input stream in Color Picking Mode
|
|
if (useStateStore().colorPickingMode) return [0];
|
|
|
|
// Only show the output stream in Driver Mode or Calibration Mode
|
|
if (useCameraSettingsStore().isDriverMode || useCameraSettingsStore().isCalibrationMode) return [1];
|
|
|
|
const ret: number[] = [];
|
|
if (useCameraSettingsStore().currentPipelineSettings.inputShouldShow) {
|
|
ret.push(0);
|
|
}
|
|
if (useCameraSettingsStore().currentPipelineSettings.outputShouldShow) {
|
|
ret.push(1);
|
|
}
|
|
|
|
if (ret.length === 0) return [0];
|
|
|
|
return ret;
|
|
},
|
|
set: (v) => {
|
|
useCameraSettingsStore().changeCurrentPipelineSetting(
|
|
{
|
|
inputShouldShow: v.includes(0),
|
|
outputShouldShow: v.includes(1)
|
|
},
|
|
true
|
|
);
|
|
}
|
|
});
|
|
|
|
// TODO - deduplicate with needsCamerasConfigured
|
|
const warningShown = computed<boolean>(() => {
|
|
return (
|
|
Object.values(useCameraSettingsStore().cameras).length === 0 ||
|
|
useCameraSettingsStore().cameras["Placeholder Name"] === PlaceholderCameraSettings
|
|
);
|
|
});
|
|
|
|
const arducamWarningShown = computed<boolean>(() => {
|
|
return Object.values(useCameraSettingsStore().cameras).some(
|
|
(c) =>
|
|
c.cameraQuirks?.quirks?.ArduCamCamera === true &&
|
|
!(
|
|
c.cameraQuirks?.quirks?.ArduOV2311Controls === true ||
|
|
c.cameraQuirks?.quirks?.ArduOV9281Controls === true ||
|
|
c.cameraQuirks?.quirks?.ArduOV9782Controls === true
|
|
)
|
|
);
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<v-container class="pa-3" fluid>
|
|
<v-banner
|
|
v-if="arducamWarningShown"
|
|
v-model="arducamWarningShown"
|
|
rounded
|
|
color="error"
|
|
dark
|
|
class="mb-3"
|
|
icon="mdi-alert-circle-outline"
|
|
>
|
|
<span
|
|
>Arducam Camera Detected! Please configure the camera model in the <a href="#/cameras">Cameras tab</a>!
|
|
</span>
|
|
</v-banner>
|
|
<v-row no-gutters align="center" justify="center">
|
|
<v-col cols="12" class="pb-3 pr-lg-3" lg="8" align-self="stretch">
|
|
<CamerasCard v-model="cameraViewType" />
|
|
</v-col>
|
|
<v-col cols="12" class="pb-3" lg="4" style="display: flex; flex-direction: column" align-self="stretch">
|
|
<CameraAndPipelineSelectCard />
|
|
<StreamConfigCard v-model="cameraViewType" />
|
|
</v-col>
|
|
</v-row>
|
|
<PipelineConfigCard />
|
|
|
|
<!-- TODO - not sure this belongs here -->
|
|
<v-dialog v-if="warningShown" v-model="warningShown" :persistent="false" max-width="800" dark>
|
|
<v-card dark flat color="primary">
|
|
<v-card-title>Setup some cameras to get started!</v-card-title>
|
|
<v-card-text>
|
|
No cameras activated - head to the <a href="#/cameraConfigs">Camera matching tab</a> to set some up!
|
|
</v-card-text>
|
|
</v-card>
|
|
</v-dialog>
|
|
</v-container>
|
|
</template>
|
|
|
|
<style scoped>
|
|
a:link {
|
|
color: #ffd843;
|
|
background-color: transparent;
|
|
text-decoration: none;
|
|
}
|
|
a:visited {
|
|
color: #ffd843;
|
|
background-color: transparent;
|
|
text-decoration: none;
|
|
}
|
|
a:hover {
|
|
color: pink;
|
|
background-color: transparent;
|
|
text-decoration: underline;
|
|
}
|
|
|
|
a:active {
|
|
color: yellow;
|
|
background-color: transparent;
|
|
text-decoration: none;
|
|
}
|
|
</style>
|