2019-11-02 17:27:54 -05:00
|
|
|
|
|
|
|
|
|
|
|
class TelemetryLimited:
|
|
|
|
Sng = SerialNumGen()
|
|
|
|
|
|
|
|
def __init__(self):
|
2019-12-30 18:17:24 -06:00
|
|
|
self._telemetryLimiterId = self.Sng.next()
|
2019-11-02 17:27:54 -05:00
|
|
|
self._limits = set()
|
|
|
|
|
|
|
|
def getTelemetryLimiterId(self):
|
|
|
|
return self._telemetryLimiterId
|
|
|
|
|
|
|
|
def addTelemetryLimit(self, limit):
|
|
|
|
self._limits.add(limit)
|
|
|
|
|
|
|
|
def removeTelemetryLimit(self, limit):
|
|
|
|
if limit in self._limits:
|
|
|
|
self._limits.remove(limit)
|
|
|
|
|
|
|
|
def enforceTelemetryLimits(self):
|
2021-06-29 14:08:37 -05:00
|
|
|
if __astron__ and self.isEmpty():
|
|
|
|
return
|
|
|
|
|
2019-11-02 17:27:54 -05:00
|
|
|
for limit in self._limits:
|
|
|
|
limit(self)
|