diff --git a/display/tactical/tactical.py b/display/tactical/tactical.py index 8aa697e..0d1c1a4 100644 --- a/display/tactical/tactical.py +++ b/display/tactical/tactical.py @@ -45,11 +45,14 @@ def update(self): self.displayTarget(target) # Display alerts - # TODO Clean up - if distance((0, 0), target.pos) > 10 and distance((0, 0), target.pos) < 10.3: - self.data_proc.tca.ui.displayAlert("Target has left the Alert zone") - elif distance((0, 0), target.pos) > 5 and distance((0, 0), target.pos) < 5.3: - self.data_proc.tca.ui.displayAlert("Target entered the Alert zone") + # TODO Cleanup + # TODO Change timestamp to only show time of entering/exiting + if distance((0, 0), target.pos) >= 10 and distance((0, 0), target.pos) < 10.3: + ts = datetime.now().strftime("%H:%M:%S") + self.data_proc.tca.ui.displayAlert(ts + " Target has left the Alert zone") + elif distance((0, 0), target.pos) >= 5 and distance((0, 0), target.pos) < 5.3: + ts = datetime.now().strftime("%H:%M:%S") + self.data_proc.tca.ui.displayAlert(ts + " Target entered the Alert zone") def updateCalibration(self, message): if message == 1: