pygui: fixed issue in emane configuration for node interfaces using the wrong values

This commit is contained in:
Blake Harnden 2021-06-03 21:48:07 -07:00
parent 425a2ee141
commit 7198d2adc9

View file

@ -298,10 +298,9 @@ class NodeConfigDialog(Dialog):
emane_node = self.canvas_node.has_emane_link(iface.id) emane_node = self.canvas_node.has_emane_link(iface.id)
if emane_node: if emane_node:
emane_model = emane_node.emane.split("_")[1] emane_model = emane_node.emane.split("_")[1]
command = partial(self.click_emane_config, emane_model, iface.id)
button = ttk.Button( button = ttk.Button(
tab, tab, text=f"Configure EMANE {emane_model}", command=command
text=f"Configure EMANE {emane_model}",
command=lambda: self.click_emane_config(emane_model, iface.id),
) )
button.grid(row=row, sticky=tk.EW, columnspan=3, pady=PADY) button.grid(row=row, sticky=tk.EW, columnspan=3, pady=PADY)
row += 1 row += 1
@ -367,6 +366,7 @@ class NodeConfigDialog(Dialog):
button.grid(row=0, column=1, sticky=tk.EW) button.grid(row=0, column=1, sticky=tk.EW)
def click_emane_config(self, emane_model: str, iface_id: int) -> None: def click_emane_config(self, emane_model: str, iface_id: int) -> None:
logger.info("configuring emane: %s - %s", emane_model, iface_id)
dialog = EmaneModelDialog(self, self.app, self.node, emane_model, iface_id) dialog = EmaneModelDialog(self, self.app, self.node, emane_model, iface_id)
dialog.show() dialog.show()