53 lines
1.3 KiB
Python
53 lines
1.3 KiB
Python
from project import *
|
|
from s2_junctions import *
|
|
|
|
p = "test_s2_junctions"
|
|
|
|
if is_project_open(p):
|
|
close_project(p)
|
|
|
|
if have_project(p):
|
|
delete_project(p)
|
|
|
|
create_project(p)
|
|
open_project(p)
|
|
|
|
j = 'j-1'
|
|
print(get_junction_coord(p, j)) # None
|
|
print(get_junction_elevation(p, j)) # None
|
|
print(get_junction_demand(p, j)) # None
|
|
print(get_junction_pattern(p, j)) # None
|
|
|
|
add_junction(p, j, 10.0, 20.0, 30.0)
|
|
print(get_junction_coord(p, j)) # {'x': 10.0, 'y': 20.0}
|
|
print(get_junction_elevation(p, j)) # 30.0
|
|
print(get_junction_demand(p, j)) # NULL
|
|
print(get_junction_pattern(p, j)) # NULL
|
|
|
|
set_junction_demand(p, j, 100.0)
|
|
print(get_junction_demand(p, j)) # 100.0
|
|
|
|
execute_undo(p)
|
|
print(get_junction_demand(p, j)) # NULL
|
|
|
|
execute_undo(p)
|
|
print(get_junction_coord(p, j)) # None
|
|
print(get_junction_elevation(p, j)) # None
|
|
print(get_junction_demand(p, j)) # None
|
|
print(get_junction_pattern(p, j)) # None
|
|
|
|
add_junction(p, j, 10.0, 20.0, 30.0)
|
|
print(get_junction_coord(p, j)) # {'x': 10.0, 'y': 20.0}
|
|
print(get_junction_elevation(p, j)) # 30.0
|
|
print(get_junction_demand(p, j)) # NULL
|
|
print(get_junction_pattern(p, j)) # NULL
|
|
|
|
set_junction_coord(p, j, 100.0, 200.0)
|
|
print(get_junction_coord(p, j)) # {'x': 100.0, 'y': 200.0}
|
|
|
|
execute_undo(p)
|
|
print(get_junction_coord(p, j)) # {'x': 10.0, 'y': 20.0}
|
|
|
|
close_project(p)
|
|
# delete_project(p)
|