changes to support nodes containing their configurations, starting with emane, making copying easier and reducing code

This commit is contained in:
Blake Harnden 2020-04-21 00:38:36 -07:00
parent 54eab4576d
commit bd30d0d9ff
5 changed files with 60 additions and 68 deletions

View file

@ -1,5 +1,6 @@
import logging
import tkinter as tk
from copy import deepcopy
from tkinter import BooleanVar
from typing import TYPE_CHECKING, Tuple
@ -922,6 +923,9 @@ class CanvasGraph(tk.Canvas):
)
node = CanvasNode(self.master, scaled_x, scaled_y, copy, canvas_node.image)
# copy configurations
node.emane_model_configs = deepcopy(canvas_node.emane_model_configs)
# add new node to modified_service_nodes set if that set contains the
# to_copy node
if self.core.service_been_modified(core_node.id):

View file

@ -58,6 +58,10 @@ class CanvasNode:
self.wireless_edges = set()
self.antennas = []
self.antenna_images = {}
# possible configurations
self.emane_model_configs = {}
self.wlan_config = {}
self.mobility_config = {}
self.setup_bindings()
def setup_bindings(self):