From 4439839c8fc66bd69dbe30937918ffc22d0f2063 Mon Sep 17 00:00:00 2001 From: Drew Williams Date: Thu, 16 May 2024 11:02:50 -0400 Subject: [PATCH] change verifyversion to use member variable --- photon-lib/src/main/native/cpp/photon/PhotonCamera.cpp | 4 +++- photon-lib/src/main/native/include/photon/PhotonCamera.h | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/photon-lib/src/main/native/cpp/photon/PhotonCamera.cpp b/photon-lib/src/main/native/cpp/photon/PhotonCamera.cpp index 47be45075..407dc7c10 100644 --- a/photon-lib/src/main/native/cpp/photon/PhotonCamera.cpp +++ b/photon-lib/src/main/native/cpp/photon/PhotonCamera.cpp @@ -189,7 +189,9 @@ std::optional PhotonCamera::GetDistCoeffs() { } void PhotonCamera::VerifyVersion() { - if (!PhotonCamera::VERSION_CHECK_ENABLED) return; + if (!versionCheckEnabled) { + return; + } if ((frc::Timer::GetFPGATimestamp() - lastVersionCheckTime) < VERSION_CHECK_INTERVAL) diff --git a/photon-lib/src/main/native/include/photon/PhotonCamera.h b/photon-lib/src/main/native/include/photon/PhotonCamera.h index 6d29754bf..eb1d1b5ff 100644 --- a/photon-lib/src/main/native/include/photon/PhotonCamera.h +++ b/photon-lib/src/main/native/include/photon/PhotonCamera.h @@ -153,7 +153,7 @@ class PhotonCamera { std::optional GetDistCoeffs(); inline static void SetVersionCheckEnabled(bool enabled) { - PhotonCamera::VERSION_CHECK_ENABLED = enabled; + versionCheckEnabled = enabled; } std::shared_ptr GetCameraTable() const { return rootTable; } @@ -192,7 +192,7 @@ class PhotonCamera { private: units::second_t lastVersionCheckTime = 0_s; - inline static bool VERSION_CHECK_ENABLED = true; + bool versionCheckEnabled = true; inline static int InstanceCount = 0; void VerifyVersion();