Skip to content

Commit

Permalink
[mock_uss/f3548v21/flight_planning] Validate operational intent are n…
Browse files Browse the repository at this point in the history
…ot in the past (#554)
  • Loading branch information
mickmis authored Mar 19, 2024
1 parent c784033 commit 80f77c1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions monitoring/mock_uss/f3548v21/flight_planning.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,16 @@ def validate_request(op_intent: f3548_v21.OperationalIntent) -> None:
f"Operational intent is activated but has no volume currently active (now: {now})"
)

# Validate intent is not (entirely) in the past
now = arrow.utcnow().datetime
volumes = Volume4DCollection.from_interuss_scd_api(
op_intent.details.volumes + op_intent.details.off_nominal_volumes
)
if volumes.time_end.datetime < now:
raise PlanningError(
f"Operational intent is in the past (time_end: {volumes.time_end.datetime}; now: {now})"
)


def check_for_disallowed_conflicts(
new_op_intent: f3548_v21.OperationalIntent,
Expand Down

0 comments on commit 80f77c1

Please sign in to comment.