From d88ea4a75d4ccf1dcc3485b592379adddab527cf Mon Sep 17 00:00:00 2001 From: Sam Freund Date: Fri, 4 Jul 2025 16:43:17 -0500 Subject: [PATCH] De-conflict camera names and hostnames by use of a banner (#1982) --- .../stores/settings/GeneralSettingsStore.ts | 8 +- photon-client/src/types/SettingTypes.ts | 2 + photon-client/src/views/DashboardView.vue | 34 ++++- .../common/configuration/NetworkConfig.java | 2 + .../networktables/NetworkTablesManager.java | 126 +++++++++++++++++- .../dataflow/websocket/UIGeneralSettings.java | 8 +- .../websocket/UIPhotonConfiguration.java | 5 +- .../common/networking/NetworkManager.java | 29 ++++ 8 files changed, 202 insertions(+), 12 deletions(-) diff --git a/photon-client/src/stores/settings/GeneralSettingsStore.ts b/photon-client/src/stores/settings/GeneralSettingsStore.ts index f9614bcd3..e5f345823 100644 --- a/photon-client/src/stores/settings/GeneralSettingsStore.ts +++ b/photon-client/src/stores/settings/GeneralSettingsStore.ts @@ -28,7 +28,9 @@ export const useSettingsStore = defineStore("settings", { hardwarePlatform: undefined, mrCalWorking: true, availableModels: [], - supportedBackends: [] + supportedBackends: [], + conflictingHostname: false, + conflictingCameras: "" }, network: { ntServerAddress: "", @@ -107,7 +109,9 @@ export const useSettingsStore = defineStore("settings", { gpuAcceleration: data.general.gpuAcceleration || undefined, mrCalWorking: data.general.mrCalWorking, availableModels: data.general.availableModels || undefined, - supportedBackends: data.general.supportedBackends || [] + supportedBackends: data.general.supportedBackends || [], + conflictingHostname: data.general.conflictingHostname || false, + conflictingCameras: data.general.conflictingCameras || "" }; this.lighting = data.lighting; this.network = data.networkSettings; diff --git a/photon-client/src/types/SettingTypes.ts b/photon-client/src/types/SettingTypes.ts index 0933d6b6e..cec92713f 100644 --- a/photon-client/src/types/SettingTypes.ts +++ b/photon-client/src/types/SettingTypes.ts @@ -10,6 +10,8 @@ export interface GeneralSettings { mrCalWorking: boolean; availableModels: ObjectDetectionModelProperties[]; supportedBackends: string[]; + conflictingHostname: boolean; + conflictingCameras: string; } export interface ObjectDetectionModelProperties { diff --git a/photon-client/src/views/DashboardView.vue b/photon-client/src/views/DashboardView.vue index 553739451..c42efbdf6 100644 --- a/photon-client/src/views/DashboardView.vue +++ b/photon-client/src/views/DashboardView.vue @@ -6,6 +6,7 @@ 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 { useSettingsStore } from "@/stores/settings/GeneralSettingsStore"; const cameraViewType = computed({ get: (): number[] => { @@ -50,22 +51,49 @@ const arducamWarningShown = computed(() => { ); }); +const conflictingHostnameShown = computed(() => { + return useSettingsStore().general.conflictingHostname; +}); + +const conflictingCameraShown = computed(() => { + return useSettingsStore().general.conflictingCameras.length > 0; +}); + const showCameraSetupDialog = ref(useCameraSettingsStore().needsCameraConfiguration);