add wireless network variable to CanvasGraph that maps a wireless/EMANE node to all MDRs connected to it
This commit is contained in:
parent
08e652633f
commit
d8f586bd2b
3 changed files with 25 additions and 0 deletions
|
@ -177,6 +177,17 @@ class CanvasEdge:
|
|||
dst_node_type = dst_node.core_node.type
|
||||
is_src_wireless = NodeUtils.is_wireless_node(src_node_type)
|
||||
is_dst_wireless = NodeUtils.is_wireless_node(dst_node_type)
|
||||
|
||||
# update the wlan/EMANE network
|
||||
wlan_network = self.canvas.wireless_network
|
||||
if is_src_wireless and not is_dst_wireless:
|
||||
if self.src not in wlan_network:
|
||||
wlan_network[self.src] = set()
|
||||
wlan_network[self.src].add(self.dst)
|
||||
elif not is_src_wireless and is_dst_wireless:
|
||||
if self.dst not in wlan_network:
|
||||
wlan_network[self.dst] = set()
|
||||
wlan_network[self.dst].add(self.src)
|
||||
return is_src_wireless or is_dst_wireless
|
||||
|
||||
def check_wireless(self):
|
||||
|
|
|
@ -42,6 +42,10 @@ class CanvasGraph(tk.Canvas):
|
|||
self.edges = {}
|
||||
self.shapes = {}
|
||||
self.wireless_edges = {}
|
||||
|
||||
# map wireless/EMANE node to the set of MDRs connected to that node
|
||||
self.wireless_network = {}
|
||||
|
||||
self.drawing_edge = None
|
||||
self.grid = None
|
||||
self.shape_drawing = False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue