diff --git a/photon-lib/src/main/native/cpp/photon/PhotonCamera.cpp b/photon-lib/src/main/native/cpp/photon/PhotonCamera.cpp index 47be45075..281351a31 100644 --- a/photon-lib/src/main/native/cpp/photon/PhotonCamera.cpp +++ b/photon-lib/src/main/native/cpp/photon/PhotonCamera.cpp @@ -60,6 +60,11 @@ namespace photon { constexpr const units::second_t VERSION_CHECK_INTERVAL = 5_s; static const std::vector PHOTON_PREFIX = {"/photonvision/"}; +bool PhotonCamera::VERSION_CHECK_ENABLED = true; + +void PhotonCamera::SetVersionCheckEnabled(bool enabled) { + VERSION_CHECK_ENABLED = enabled; +} PhotonCamera::PhotonCamera(nt::NetworkTableInstance instance, const std::string_view cameraName) @@ -189,7 +194,9 @@ std::optional PhotonCamera::GetDistCoeffs() { } void PhotonCamera::VerifyVersion() { - if (!PhotonCamera::VERSION_CHECK_ENABLED) return; + if (!PhotonCamera::VERSION_CHECK_ENABLED) { + 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..f588c340d 100644 --- a/photon-lib/src/main/native/include/photon/PhotonCamera.h +++ b/photon-lib/src/main/native/include/photon/PhotonCamera.h @@ -152,9 +152,7 @@ class PhotonCamera { std::optional GetCameraMatrix(); std::optional GetDistCoeffs(); - inline static void SetVersionCheckEnabled(bool enabled) { - PhotonCamera::VERSION_CHECK_ENABLED = enabled; - } + static void SetVersionCheckEnabled(bool enabled); std::shared_ptr GetCameraTable() const { return rootTable; } @@ -192,7 +190,7 @@ class PhotonCamera { private: units::second_t lastVersionCheckTime = 0_s; - inline static bool VERSION_CHECK_ENABLED = true; + static bool VERSION_CHECK_ENABLED; inline static int InstanceCount = 0; void VerifyVersion();