updates to allow wlan config changes during runtime

This commit is contained in:
Blake Harnden 2019-12-16 14:55:54 -08:00
parent 084aedf3d2
commit 0082d61517
3 changed files with 16 additions and 5 deletions

View file

@ -58,6 +58,9 @@ class WlanConfigDialog(Dialog):
:return: nothing
"""
self.config_frame.parse_config()
config = self.config_frame.parse_config()
self.app.core.wlan_configs[self.node.id] = 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)
self.destroy()

View file

@ -87,6 +87,9 @@ class CanvasGraph(tk.Canvas):
:param core.api.grpc.core_pb2.Session session: session to draw
:return: nothing
"""
# hide context
self.hide_context()
# delete any existing drawn items
for tag in tags.COMPONENT_TAGS:
self.delete(tag)
@ -122,6 +125,11 @@ class CanvasGraph(tk.Canvas):
self.bind("<ButtonPress-3>", lambda e: self.scan_mark(e.x, e.y))
self.bind("<B3-Motion>", lambda e: self.scan_dragto(e.x, e.y, gain=1))
def hide_context(self):
if self.context:
self.context.unpost()
self.context = None
def get_actual_coords(self, x, y):
actual_x = (x - self.offset[0]) / self.ratio
actual_y = (y - self.offset[1]) / self.ratio
@ -294,8 +302,7 @@ class CanvasGraph(tk.Canvas):
return
if self.context:
self.context.unpost()
self.context = None
self.hide_context()
else:
if self.mode == GraphMode.ANNOTATION:
self.focus_set()
@ -592,8 +599,7 @@ class CanvasGraph(tk.Canvas):
self.context = canvas_node.create_context()
self.context.post(event.x_root, event.y_root)
else:
self.context.unpost()
self.context = None
self.hide_context()
def press_delete(self, event):
"""

View file

@ -222,6 +222,7 @@ class Toolbar(ttk.Frame):
:return: nothing
"""
self.app.canvas.hide_context()
self.app.statusbar.core_alarms.clear()
self.app.statusbar.progress_bar.start(5)
self.app.canvas.mode = GraphMode.SELECT
@ -385,6 +386,7 @@ class Toolbar(ttk.Frame):
:return: nothing
"""
self.app.canvas.hide_context()
self.app.statusbar.progress_bar.start(5)
thread = threading.Thread(target=self.app.core.stop_session)
thread.start()