mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-19 00:41:41 +00:00
fix bad implementation of global variables and version check, which prevented python version checks from working (#1050)
This commit is contained in:
@@ -19,6 +19,7 @@ _VERSION_CHECK_ENABLED = True
|
||||
|
||||
|
||||
def setVersionCheckEnabled(enabled: bool):
|
||||
global _VERSION_CHECK_ENABLED
|
||||
_VERSION_CHECK_ENABLED = enabled
|
||||
|
||||
|
||||
@@ -131,12 +132,16 @@ class PhotonCamera:
|
||||
return (now - self.prevHeartbeatChangeTime) < 0.5
|
||||
|
||||
def _versionCheck(self) -> None:
|
||||
global lastVersionTimeCheck
|
||||
|
||||
if not _VERSION_CHECK_ENABLED:
|
||||
return
|
||||
|
||||
if (Timer.getFPGATimestamp() - lastVersionTimeCheck) < 5.0:
|
||||
return
|
||||
|
||||
lastVersionTimeCheck = Timer.getFPGATimestamp()
|
||||
|
||||
if not self.heartbeatEntry.exists():
|
||||
cameraNames = (
|
||||
self.cameraTable.getInstance().getTable(self._tableName).getSubTables()
|
||||
|
||||
Reference in New Issue
Block a user