Add API get network link nodes
This commit is contained in:
10
tjnetwork.py
10
tjnetwork.py
@@ -839,6 +839,16 @@ def get_network_coords(name: str) -> dict[str, dict[str, float]]:
|
||||
result[node_id] = api.get_node_coord(name, node_id)
|
||||
return result
|
||||
|
||||
# DingZQ, 2024-12-08, get all links' start and end node
|
||||
# link_id:node_id1:node_id2
|
||||
def get_network_link_nodes(name: str) -> list[str]:
|
||||
links = api.get_links(name)
|
||||
result = []
|
||||
for link_id in links:
|
||||
nodes = api.get_link_nodes(name, link_id)
|
||||
result.append(f"{link_id}:{nodes[0]}:{nodes[1]}")
|
||||
return result
|
||||
|
||||
############################################################
|
||||
# vertex 25.[VERTICES]
|
||||
############################################################
|
||||
|
||||
Reference in New Issue
Block a user