-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d7a3696
commit 1f79d4c
Showing
19 changed files
with
813 additions
and
303 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
...qual_priority_not_permitted/assets/attempt_to_activate_flight_into_conflict.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
...ority_not_permitted/assets/attempt_to_modify_activated_flight_into_conflict.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
...riority_not_permitted/assets/attempt_to_modify_planned_flight_into_conflict.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
...ct_equal_priority_not_permitted/assets/attempt_to_plan_flight_into_conflict.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
316 changes: 316 additions & 0 deletions
316
...ios/astm/utm/nominal_planning/conflict_equal_priority_not_permitted/assets/make_assets.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,316 @@ | ||
# Requires svg.py 1.4.2 | ||
|
||
import inspect | ||
from textwrap import dedent | ||
from typing import List | ||
|
||
import svg | ||
|
||
|
||
def translate(points: List[float], dx: float, dy: float) -> List[float]: | ||
result = [] | ||
x = True | ||
for p in points: | ||
result.append(p + dx if x else p + dy) | ||
x = not x | ||
return result | ||
|
||
|
||
outline = "#202020" | ||
accepted = "#808080" | ||
activated = "#00ff00" | ||
nonconforming = "#ffff00" | ||
flight2_points = [10, 110, 100, 10, 190, 30, 220, 100, 160, 190] | ||
flight1_points = [20, 190, 50, 110, 310, 90, 340, 90, 340, 180, 270, 160] | ||
flight1c_points = [185, 180, 225, 110, 310, 90, 340, 90, 340, 180, 270, 160] | ||
flight1m_points = [140, 190, 170, 110, 310, 90, 340, 90, 340, 180, 270, 160] | ||
common_elements = [ | ||
svg.Style( | ||
text=dedent(""".heavy { font: bold 30px sans-serif; }"""), | ||
), | ||
svg.Marker( | ||
id="arrowhead", | ||
viewBox=svg.ViewBoxSpec(0, 0, 10, 10), | ||
refX=6, | ||
refY=4, | ||
markerWidth=6, | ||
markerHeight=6, | ||
color=outline, | ||
orient="auto-start-reverse", | ||
elements=[ | ||
svg.Path( | ||
d=[ | ||
svg.MoveTo(0, 0), | ||
svg.LineTo(8, 4), | ||
svg.LineTo(0, 8), | ||
svg.ClosePath(), | ||
], | ||
fill=outline, | ||
) | ||
], | ||
), | ||
] | ||
|
||
|
||
def make_attempt_to_plan_flight_into_conflict(): | ||
elements = [ | ||
svg.Polygon( | ||
points=flight2_points, | ||
stroke=outline, | ||
fill=activated, | ||
fill_opacity=0.4, | ||
stroke_width=8, | ||
), | ||
svg.Text(x=60, y=90, class_=["heavy"], text="Flight 2"), | ||
svg.Polygon( | ||
points=translate(flight2_points, 440, 0), | ||
stroke=outline, | ||
fill=activated, | ||
fill_opacity=0.4, | ||
stroke_width=8, | ||
), | ||
svg.Text(x=60 + 440, y=90, class_=["heavy"], text="Flight 2"), | ||
svg.Polygon( | ||
points=translate(flight1_points, 440, 0), | ||
stroke=outline, | ||
fill=accepted, | ||
fill_opacity=0.4, | ||
stroke_width=8, | ||
stroke_dasharray=[16], | ||
), | ||
svg.Text(x=220 + 440, y=140, class_=["heavy"], text="Flight 1"), | ||
svg.Text(x=560, y=150, class_=["heavy"], text="X", fill="red"), | ||
svg.Line( | ||
x1=370, | ||
y1=100, | ||
x2=420, | ||
y2=100, | ||
stroke=outline, | ||
stroke_width=8, | ||
marker_end="url(#arrowhead)", | ||
), | ||
] | ||
canvas = svg.SVG( | ||
width=800, | ||
height=200, | ||
elements=common_elements + elements, | ||
) | ||
with open(inspect.currentframe().f_code.co_name[len("make_") :] + ".svg", "w") as f: | ||
f.write(str(canvas)) | ||
|
||
|
||
def make_attempt_to_activate_flight_into_conflict(): | ||
elements = [ | ||
svg.Polygon( | ||
points=flight2_points, | ||
stroke=outline, | ||
fill=activated, | ||
fill_opacity=0.4, | ||
stroke_width=8, | ||
), | ||
svg.Text(x=60, y=90, class_=["heavy"], text="Flight 2"), | ||
svg.Polygon( | ||
points=translate(flight2_points, 440, 0), | ||
stroke=outline, | ||
fill=activated, | ||
fill_opacity=0.4, | ||
stroke_width=8, | ||
), | ||
svg.Text(x=60 + 440, y=90, class_=["heavy"], text="Flight 2"), | ||
svg.Polygon( | ||
points=translate(flight1_points, 440, 0), | ||
stroke=outline, | ||
fill=activated, | ||
fill_opacity=0.4, | ||
stroke_width=8, | ||
stroke_dasharray=[16], | ||
), | ||
svg.Text(x=220 + 440, y=140, class_=["heavy"], text="Flight 1"), | ||
svg.Text(x=560, y=150, class_=["heavy"], text="X", fill="red"), | ||
svg.Line( | ||
x1=370, | ||
y1=100, | ||
x2=420, | ||
y2=100, | ||
stroke=outline, | ||
stroke_width=8, | ||
marker_end="url(#arrowhead)", | ||
), | ||
] | ||
canvas = svg.SVG( | ||
width=800, | ||
height=200, | ||
elements=common_elements + elements, | ||
) | ||
with open(inspect.currentframe().f_code.co_name[len("make_") :] + ".svg", "w") as f: | ||
f.write(str(canvas)) | ||
|
||
|
||
def make_attempt_to_modify_planned_flight_into_conflict(): | ||
elements = [ | ||
svg.Polygon( | ||
points=flight2_points, | ||
stroke=outline, | ||
fill=activated, | ||
fill_opacity=0.4, | ||
stroke_width=8, | ||
), | ||
svg.Text(x=60, y=90, class_=["heavy"], text="Flight 2"), | ||
svg.Polygon( | ||
points=flight1c_points, | ||
stroke=outline, | ||
fill=accepted, | ||
fill_opacity=0.4, | ||
stroke_width=8, | ||
), | ||
svg.Text(x=217, y=145, class_=["heavy"], text="Flight 1c"), | ||
svg.Polygon( | ||
points=translate(flight2_points, 440, 0), | ||
stroke=outline, | ||
fill=activated, | ||
fill_opacity=0.4, | ||
stroke_width=8, | ||
), | ||
svg.Text(x=60 + 440, y=90, class_=["heavy"], text="Flight 2"), | ||
svg.Polygon( | ||
points=translate(flight1_points, 440, 0), | ||
stroke=outline, | ||
fill=activated, | ||
fill_opacity=0.4, | ||
stroke_width=8, | ||
stroke_dasharray=[16], | ||
), | ||
svg.Text(x=222 + 440, y=145, class_=["heavy"], text="Flight 1"), | ||
svg.Text(x=560, y=150, class_=["heavy"], text="X", fill="red"), | ||
svg.Line( | ||
x1=370, | ||
y1=100, | ||
x2=420, | ||
y2=100, | ||
stroke=outline, | ||
stroke_width=8, | ||
marker_end="url(#arrowhead)", | ||
), | ||
] | ||
canvas = svg.SVG( | ||
width=800, | ||
height=200, | ||
elements=common_elements + elements, | ||
) | ||
with open(inspect.currentframe().f_code.co_name[len("make_") :] + ".svg", "w") as f: | ||
f.write(str(canvas)) | ||
|
||
|
||
def make_attempt_to_modify_activated_flight_into_conflict(): | ||
elements = [ | ||
svg.Polygon( | ||
points=flight2_points, | ||
stroke=outline, | ||
fill=activated, | ||
fill_opacity=0.4, | ||
stroke_width=8, | ||
), | ||
svg.Text(x=60, y=90, class_=["heavy"], text="Flight 2"), | ||
svg.Polygon( | ||
points=flight1c_points, | ||
stroke=outline, | ||
fill=activated, | ||
fill_opacity=0.4, | ||
stroke_width=8, | ||
), | ||
svg.Text(x=217, y=145, class_=["heavy"], text="Flight 1c"), | ||
svg.Polygon( | ||
points=translate(flight2_points, 440, 0), | ||
stroke=outline, | ||
fill=activated, | ||
fill_opacity=0.4, | ||
stroke_width=8, | ||
), | ||
svg.Text(x=60 + 440, y=90, class_=["heavy"], text="Flight 2"), | ||
svg.Polygon( | ||
points=translate(flight1_points, 440, 0), | ||
stroke=outline, | ||
fill=activated, | ||
fill_opacity=0.4, | ||
stroke_width=8, | ||
stroke_dasharray=[16], | ||
), | ||
svg.Text(x=222 + 440, y=145, class_=["heavy"], text="Flight 1"), | ||
svg.Text(x=560, y=150, class_=["heavy"], text="X", fill="red"), | ||
svg.Line( | ||
x1=370, | ||
y1=100, | ||
x2=420, | ||
y2=100, | ||
stroke=outline, | ||
stroke_width=8, | ||
marker_end="url(#arrowhead)", | ||
), | ||
] | ||
canvas = svg.SVG( | ||
width=800, | ||
height=200, | ||
elements=common_elements + elements, | ||
) | ||
with open(inspect.currentframe().f_code.co_name[len("make_") :] + ".svg", "w") as f: | ||
f.write(str(canvas)) | ||
|
||
|
||
def make_modify_activated_flight_with_preexisting_conflict(): | ||
elements = [ | ||
svg.Polygon( | ||
points=flight2_points, | ||
stroke=outline, | ||
fill=nonconforming, | ||
fill_opacity=0.4, | ||
stroke_width=8, | ||
), | ||
svg.Text(x=60, y=90, class_=["heavy"], text="Flight 2"), | ||
svg.Polygon( | ||
points=flight1_points, | ||
stroke=outline, | ||
fill=activated, | ||
fill_opacity=0.4, | ||
stroke_width=8, | ||
), | ||
svg.Text(x=222, y=145, class_=["heavy"], text="Flight 1"), | ||
svg.Polygon( | ||
points=translate(flight2_points, 440, 0), | ||
stroke=outline, | ||
fill=nonconforming, | ||
fill_opacity=0.4, | ||
stroke_width=8, | ||
), | ||
svg.Text(x=60 + 440, y=90, class_=["heavy"], text="Flight 2"), | ||
svg.Polygon( | ||
points=translate(flight1m_points, 440, 0), | ||
stroke=outline, | ||
fill=activated, | ||
fill_opacity=0.4, | ||
stroke_width=8, | ||
), | ||
svg.Text(x=202 + 440, y=145, class_=["heavy"], text="Flight 1m"), | ||
svg.Line( | ||
x1=370, | ||
y1=100, | ||
x2=420, | ||
y2=100, | ||
stroke=outline, | ||
stroke_width=8, | ||
marker_end="url(#arrowhead)", | ||
), | ||
] | ||
canvas = svg.SVG( | ||
width=800, | ||
height=200, | ||
elements=common_elements + elements, | ||
) | ||
with open(inspect.currentframe().f_code.co_name[len("make_") :] + ".svg", "w") as f: | ||
f.write(str(canvas)) | ||
|
||
|
||
make_attempt_to_plan_flight_into_conflict() | ||
make_attempt_to_activate_flight_into_conflict() | ||
make_attempt_to_modify_planned_flight_into_conflict() | ||
make_attempt_to_modify_activated_flight_into_conflict() | ||
make_modify_activated_flight_with_preexisting_conflict() |
1 change: 1 addition & 0 deletions
1
...rity_not_permitted/assets/modify_activated_flight_with_preexisting_conflict.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.