updated wlan/mobility configs to be directly associated with a node and allow them to be copied

This commit is contained in:
Blake Harnden 2020-04-21 09:34:30 -07:00
parent bd30d0d9ff
commit 85b4a81f8a
7 changed files with 52 additions and 52 deletions

View file

@ -108,7 +108,7 @@ class EmaneModelDialog(Dialog):
def click_apply(self):
self.config_frame.parse_config()
key = (self.model, self.interface)
self.canvas_node.emane_model_configs[key] = dict(self.config)
self.canvas_node.emane_model_configs[key] = self.config
self.destroy()

View file

@ -31,7 +31,9 @@ class MobilityConfigDialog(Dialog):
self.config_frame = None
self.has_error = False
try:
self.config = self.app.core.get_mobility_config(self.node.id)
self.config = self.canvas_node.mobility_config
if not self.config:
self.config = self.app.core.get_mobility_config(self.node.id)
self.draw()
except grpc.RpcError as e:
self.has_error = True
@ -60,5 +62,5 @@ class MobilityConfigDialog(Dialog):
def click_apply(self):
self.config_frame.parse_config()
self.app.core.mobility_configs[self.node.id] = self.config
self.canvas_node.mobility_config = self.config
self.destroy()

View file

@ -48,8 +48,9 @@ class MobilityPlayer:
self.dialog.show()
def handle_close(self):
self.dialog.destroy()
self.dialog = None
if self.dialog:
self.dialog.destroy()
self.dialog = None
def set_play(self):
self.state = MobilityAction.START

View file

@ -32,7 +32,9 @@ class WlanConfigDialog(Dialog):
self.ranges = {}
self.positive_int = self.app.master.register(self.validate_and_update)
try:
self.config = self.app.core.get_wlan_config(self.node.id)
self.config = self.canvas_node.wlan_config
if not self.config:
self.config = self.app.core.get_wlan_config(self.node.id)
self.init_draw_range()
self.draw()
except grpc.RpcError as e:
@ -83,7 +85,7 @@ class WlanConfigDialog(Dialog):
retrieve user's wlan configuration and store the new configuration values
"""
config = self.config_frame.parse_config()
self.app.core.wlan_configs[self.node.id] = self.config
self.canvas_node.wlan_config = self.config
if self.app.core.is_runtime():
session_id = self.app.core.session_id
self.app.core.client.set_wlan_config(session_id, self.node.id, config)