From 474e4f07f8f2500fd600cdad82416c5952af61ce Mon Sep 17 00:00:00 2001 From: Craig Schardt Date: Fri, 3 Jan 2025 08:29:18 -0600 Subject: [PATCH] Refined network management (#1672) This PR implements several refinements to the way that NetworkManager controls the network interface. - The monitor detects and logs changes to the network address - The monitor detects and logs changes to the connection and will reinitialize the connection if needed - Remove NetworkInterface.java class, which wasn't used anywhere - Use java.net.NetworkInterface to get IP addresses for any interface (device) - Adds a metric for the current IP address (address on the currently selected interface) --- .../cameras/CameraCalibrationCard.vue | 2 +- .../src/components/settings/MetricsCard.vue | 46 +++-- .../stores/settings/GeneralSettingsStore.ts | 6 +- photon-client/src/types/SettingTypes.ts | 1 + .../src/views/CameraMatchingView.vue | 32 ++-- photon-client/src/views/DashboardView.vue | 4 +- .../hardware/metrics/MetricsManager.java | 11 ++ .../common/networking/NetworkInterface.java | 78 -------- .../common/networking/NetworkManager.java | 181 ++++++++++-------- .../common/networking/NetworkUtils.java | 40 +++- .../common/networking/NetworkingCommands.java | 46 +++++ .../photonvision/common/util/ShellExec.java | 30 ++- 12 files changed, 273 insertions(+), 204 deletions(-) delete mode 100644 photon-core/src/main/java/org/photonvision/common/networking/NetworkInterface.java create mode 100644 photon-core/src/main/java/org/photonvision/common/networking/NetworkingCommands.java diff --git a/photon-client/src/components/cameras/CameraCalibrationCard.vue b/photon-client/src/components/cameras/CameraCalibrationCard.vue index 47271283f..b3f033cc9 100644 --- a/photon-client/src/components/cameras/CameraCalibrationCard.vue +++ b/photon-client/src/components/cameras/CameraCalibrationCard.vue @@ -242,7 +242,7 @@ const setSelectedVideoFormat = (format: VideoFormat) => { {{ value.verticalFOV !== undefined ? value.verticalFOV.toFixed(2) + "°" : "-" }} {{ value.diagonalFOV !== undefined ? value.diagonalFOV.toFixed(2) + "°" : "-" }} -