updates to allow wlan config changes during runtime
This commit is contained in:
parent
084aedf3d2
commit
0082d61517
3 changed files with 16 additions and 5 deletions
|
@ -58,6 +58,9 @@ class WlanConfigDialog(Dialog):
|
||||||
|
|
||||||
:return: nothing
|
:return: nothing
|
||||||
"""
|
"""
|
||||||
self.config_frame.parse_config()
|
config = self.config_frame.parse_config()
|
||||||
self.app.core.wlan_configs[self.node.id] = self.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()
|
self.destroy()
|
||||||
|
|
|
@ -87,6 +87,9 @@ class CanvasGraph(tk.Canvas):
|
||||||
:param core.api.grpc.core_pb2.Session session: session to draw
|
:param core.api.grpc.core_pb2.Session session: session to draw
|
||||||
:return: nothing
|
:return: nothing
|
||||||
"""
|
"""
|
||||||
|
# hide context
|
||||||
|
self.hide_context()
|
||||||
|
|
||||||
# delete any existing drawn items
|
# delete any existing drawn items
|
||||||
for tag in tags.COMPONENT_TAGS:
|
for tag in tags.COMPONENT_TAGS:
|
||||||
self.delete(tag)
|
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("<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))
|
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):
|
def get_actual_coords(self, x, y):
|
||||||
actual_x = (x - self.offset[0]) / self.ratio
|
actual_x = (x - self.offset[0]) / self.ratio
|
||||||
actual_y = (y - self.offset[1]) / self.ratio
|
actual_y = (y - self.offset[1]) / self.ratio
|
||||||
|
@ -294,8 +302,7 @@ class CanvasGraph(tk.Canvas):
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.context:
|
if self.context:
|
||||||
self.context.unpost()
|
self.hide_context()
|
||||||
self.context = None
|
|
||||||
else:
|
else:
|
||||||
if self.mode == GraphMode.ANNOTATION:
|
if self.mode == GraphMode.ANNOTATION:
|
||||||
self.focus_set()
|
self.focus_set()
|
||||||
|
@ -592,8 +599,7 @@ class CanvasGraph(tk.Canvas):
|
||||||
self.context = canvas_node.create_context()
|
self.context = canvas_node.create_context()
|
||||||
self.context.post(event.x_root, event.y_root)
|
self.context.post(event.x_root, event.y_root)
|
||||||
else:
|
else:
|
||||||
self.context.unpost()
|
self.hide_context()
|
||||||
self.context = None
|
|
||||||
|
|
||||||
def press_delete(self, event):
|
def press_delete(self, event):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -222,6 +222,7 @@ class Toolbar(ttk.Frame):
|
||||||
|
|
||||||
:return: nothing
|
:return: nothing
|
||||||
"""
|
"""
|
||||||
|
self.app.canvas.hide_context()
|
||||||
self.app.statusbar.core_alarms.clear()
|
self.app.statusbar.core_alarms.clear()
|
||||||
self.app.statusbar.progress_bar.start(5)
|
self.app.statusbar.progress_bar.start(5)
|
||||||
self.app.canvas.mode = GraphMode.SELECT
|
self.app.canvas.mode = GraphMode.SELECT
|
||||||
|
@ -385,6 +386,7 @@ class Toolbar(ttk.Frame):
|
||||||
|
|
||||||
:return: nothing
|
:return: nothing
|
||||||
"""
|
"""
|
||||||
|
self.app.canvas.hide_context()
|
||||||
self.app.statusbar.progress_bar.start(5)
|
self.app.statusbar.progress_bar.start(5)
|
||||||
thread = threading.Thread(target=self.app.core.stop_session)
|
thread = threading.Thread(target=self.app.core.stop_session)
|
||||||
thread.start()
|
thread.start()
|
||||||
|
|
Loading…
Reference in a new issue