fix merge conflict, add a logging error to temporarily solve issue removing a wireless link when multiple wireless links exist
This commit is contained in:
commit
08d4bf98c7
19 changed files with 407 additions and 102 deletions
|
@ -1,6 +1,5 @@
|
|||
import logging
|
||||
import tkinter as tk
|
||||
from tkinter.font import Font
|
||||
from typing import TYPE_CHECKING, Any, Tuple
|
||||
|
||||
from core.gui import themes
|
||||
|
@ -14,6 +13,7 @@ if TYPE_CHECKING:
|
|||
TEXT_DISTANCE = 0.30
|
||||
EDGE_WIDTH = 3
|
||||
EDGE_COLOR = "#ff0000"
|
||||
WIRELESS_WIDTH = 1.5
|
||||
WIRELESS_COLOR = "#009933"
|
||||
|
||||
|
||||
|
@ -32,7 +32,10 @@ class CanvasWirelessEdge:
|
|||
self.dst = dst
|
||||
self.canvas = canvas
|
||||
self.id = self.canvas.create_line(
|
||||
*position, tags=tags.WIRELESS_EDGE, width=EDGE_WIDTH, fill="#009933"
|
||||
*position,
|
||||
tags=tags.WIRELESS_EDGE,
|
||||
width=WIRELESS_WIDTH * self.canvas.app.app_scale,
|
||||
fill=WIRELESS_COLOR,
|
||||
)
|
||||
|
||||
def delete(self):
|
||||
|
@ -62,13 +65,18 @@ class CanvasEdge:
|
|||
self.dst_interface = None
|
||||
self.canvas = canvas
|
||||
self.id = self.canvas.create_line(
|
||||
x1, y1, x2, y2, tags=tags.EDGE, width=EDGE_WIDTH, fill=EDGE_COLOR
|
||||
x1,
|
||||
y1,
|
||||
x2,
|
||||
y2,
|
||||
tags=tags.EDGE,
|
||||
width=EDGE_WIDTH * self.canvas.app.app_scale,
|
||||
fill=EDGE_COLOR,
|
||||
)
|
||||
self.text_src = None
|
||||
self.text_dst = None
|
||||
self.text_middle = None
|
||||
self.token = None
|
||||
self.font = Font(size=8)
|
||||
self.link = None
|
||||
self.asymmetric_link = None
|
||||
self.throughput = None
|
||||
|
@ -118,7 +126,7 @@ class CanvasEdge:
|
|||
y1,
|
||||
text=label_one,
|
||||
justify=tk.CENTER,
|
||||
font=self.font,
|
||||
font=self.canvas.app.edge_font,
|
||||
tags=tags.LINK_INFO,
|
||||
)
|
||||
self.text_dst = self.canvas.create_text(
|
||||
|
@ -126,7 +134,7 @@ class CanvasEdge:
|
|||
y2,
|
||||
text=label_two,
|
||||
justify=tk.CENTER,
|
||||
font=self.font,
|
||||
font=self.canvas.app.edge_font,
|
||||
tags=tags.LINK_INFO,
|
||||
)
|
||||
|
||||
|
@ -147,7 +155,7 @@ class CanvasEdge:
|
|||
if self.text_middle is None:
|
||||
x, y = self.get_midpoint()
|
||||
self.text_middle = self.canvas.create_text(
|
||||
x, y, tags=tags.THROUGHPUT, font=self.font, text=value
|
||||
x, y, tags=tags.THROUGHPUT, font=self.canvas.app.edge_font, text=value
|
||||
)
|
||||
else:
|
||||
self.canvas.itemconfig(self.text_middle, text=value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue