Better wording of comments and strings

topo-mov
LEdoian 1 year ago
parent 391a6c9078
commit 62feed9caf

@ -20,8 +20,9 @@ Also, this is the project for my Bachelor thesis.
Run `pip install -e .`. You can use a virtualenv if you wish (recommended).
A demo is located in `./poor_mans_visualisation.py`, if that runs, everything
should be working.
Birdvisu can then be run just as `visu`. Other ways include running `python -m
birdvisu` or `./visu.py` from this directory, all of them are functionally
equivalent.
## Documentation

@ -12,8 +12,15 @@ def _addrs_as_str(addrs):
if isinstance(addrs, IPv4Network) or isinstance(addrs, IPv6Network): return str(addrs)
return '\n'.join(str(a) for a in addrs)
"""Z-value guide:
- Vertices at Z=200
- Edges at Z=100
- Highlights at Z reduced by 10.
"""
# TODO: we MAY WISH TO use QGraphicsItemGroup.
# TODO: Do not duplicate so much code!
# TODO: Do not duplicate so much code! (But it is only two times, so it counts :-))
# TODO: tooltips?
class RouterGraphicsItem(QGraphicsItem):
default_style = {
@ -25,7 +32,7 @@ class RouterGraphicsItem(QGraphicsItem):
self.window = window
size = 30
self.icon = QGraphicsRectItem(-size/2, -size/2, size, size, parent=self)
self.icon = QGraphicsRectItem(-size/2, -size/2, size, size, parent=self) # Should use Cisco icon for router…
self.icon.setZValue(200)
self.icon.setBrush(QBrush(QColor('yellow')))
self.label = QGraphicsSimpleTextItem(parent=self.icon)
@ -74,7 +81,7 @@ class RouterGraphicsItem(QGraphicsItem):
def contextMenuEvent(self, evt):
menu = QMenu(self.window)
tree_act = QAction('Show routing tree', self.window)
tree_act = QAction('Show routing DAG', self.window)
menu.addAction(tree_act)
path_act = object()
if self.window.mode == self.window.Mode.ShortestPathDAG:
@ -103,7 +110,7 @@ class NetworkGraphicsItem(QGraphicsItem):
self.window = window
size = 40
self.icon = QGraphicsRectItem(-size/2, -size/2, size, size, parent=self)
self.icon = QGraphicsRectItem(-size/2, -size/2, size, size, parent=self) # TODO: Cisco cloud
self.icon.setZValue(200)
self.icon.setBrush(QBrush(QColor('gray')))
self.label = QGraphicsSimpleTextItem(parent=self.icon)
@ -153,7 +160,7 @@ class NetworkGraphicsItem(QGraphicsItem):
def contextMenuEvent(self, evt):
menu = QMenu(self.window)
tree_act = QAction('Show routing tree', self.window)
tree_act = QAction('Show routing DAG', self.window)
menu.addAction(tree_act)
path_act = object()
if self.window.mode == self.window.Mode.ShortestPathDAG:

Loading…
Cancel
Save