change verifyversion to use member variable

This commit is contained in:
Drew Williams
2024-05-16 11:02:50 -04:00
parent 713fad6f6b
commit 4439839c8f
2 changed files with 5 additions and 3 deletions

View File

@@ -189,7 +189,9 @@ std::optional<cv::Mat> PhotonCamera::GetDistCoeffs() {
}
void PhotonCamera::VerifyVersion() {
if (!PhotonCamera::VERSION_CHECK_ENABLED) return;
if (!versionCheckEnabled) {
return;
}
if ((frc::Timer::GetFPGATimestamp() - lastVersionCheckTime) <
VERSION_CHECK_INTERVAL)

View File

@@ -153,7 +153,7 @@ class PhotonCamera {
std::optional<cv::Mat> GetDistCoeffs();
inline static void SetVersionCheckEnabled(bool enabled) {
PhotonCamera::VERSION_CHECK_ENABLED = enabled;
versionCheckEnabled = enabled;
}
std::shared_ptr<nt::NetworkTable> 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();