diff --git a/README.md b/README.md index 58e7e08..f006bcb 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/birdvisu/graphics_items.py b/birdvisu/graphics_items.py index 4db3e5a..20a9eae 100644 --- a/birdvisu/graphics_items.py +++ b/birdvisu/graphics_items.py @@ -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: