mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-19 00:41:41 +00:00
[PhotonLib C++] Fix SetVersionCheckEnabled to actually disable version checking (#1323)
* change verifyversion to use member variable
* Revert "change verifyversion to use member variable"
This reverts commit 4439839c8f.
* Removed inline specifier for versioncheck variable
---------
Co-authored-by: Drew Williams <DrewW@iARx.com>
This commit is contained in:
@@ -60,6 +60,11 @@ namespace photon {
|
||||
|
||||
constexpr const units::second_t VERSION_CHECK_INTERVAL = 5_s;
|
||||
static const std::vector<std::string_view> 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<cv::Mat> 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)
|
||||
|
||||
Reference in New Issue
Block a user