Skip to content

Commit

Permalink
Timestamp added to alerts
Browse files Browse the repository at this point in the history
Uncommitted changes for "status flags" in development so that timestamp
can be modified to only display once (will also be needed later for
logging alerts).
  • Loading branch information
jtchia99 committed Jul 6, 2013
1 parent 1075a0f commit 07e49dc
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions display/tactical/tactical.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

2 comments on commit 07e49dc

@joemirizio
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want the timestamp on the Alert, but the Alert class should handle that. When an Alert object gets created, it should figure out the current time and store it as part of the object. Later we can grab this information separately.

@jtchia99
Copy link
Collaborator Author

@jtchia99 jtchia99 commented on 07e49dc Jul 6, 2013 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.