jodeln.gui package

jodeln.gui.dialog_open module

class jodeln.gui.dialog_open.DialogOpen

Bases: QWidget

Dialog to open network files (node file, link file, etc).

accept() None

User clicks ‘ok’.

get_data() FilePathCache

Accessor function to get data from the dialog.

on_pbOpenClick(line_edit, title) None

Open a standard file dialog; put file path in line edit.

reject() None

User clicks ‘cancel’.

staticMetaObject = <PySide2.QtCore.QMetaObject object>
store_data() None

Stores current list edit text in self.data.

Cached data is helpful to reset the dialog when the user clicks Cancel.

class jodeln.gui.dialog_open.FilePathCache(nodes: str, links: str, turns: str, routes: str, seed_od: str)

Bases: object

Contains file paths stored in the line edit widgets.

nodes: str
routes: str
seed_od: str
turns: str

jodeln.gui.od_tablemodel module

class jodeln.gui.od_tablemodel.ODTableModel(route_data)

Bases: QAbstractTableModel

Model for showing a table of OD routes.

columnCount(self, parent: PySide2.QtCore.QModelIndex = Invalid(PySide2.QtCore.QModelIndex)) int
data(self, index: PySide2.QtCore.QModelIndex, role: int = PySide2.QtCore.Qt.ItemDataRole.DisplayRole) Any
get_route_at_index(index)

Return routes for the OD at the selected index.

headerData(section: int, orientation: <class 'PySide2.QtCore.Qt.Orientation'>, role: int)

Get Table header names.

rowCount(self, parent: PySide2.QtCore.QModelIndex = Invalid(PySide2.QtCore.QModelIndex)) int
staticMetaObject = <PySide2.QtCore.QMetaObject object>

jodeln.gui.schematic_items module

class jodeln.gui.schematic_items.LinkItem(pts, parent: Optional[QGraphicsItem] = None)

Bases: QGraphicsItem

GraphicsItem for network links.

Displayed as a line between the starting node i and ending node j of the link.

boundingRect(self) PySide2.QtCore.QRectF
paint(self, painter: PySide2.QtGui.QPainter, option: PySide2.QtWidgets.QStyleOptionGraphicsItem, widget: Optional[PySide2.QtWidgets.QWidget] = None) None
class jodeln.gui.schematic_items.NodeItem(x, y, name, parent: Optional[QGraphicsItem] = None)

Bases: QGraphicsItem

GraphicsItem for network nodes.

Displayed as a circle at the node xy coordinate.

boundingRect(self) PySide2.QtCore.QRectF
paint(self, painter: PySide2.QtGui.QPainter, option: PySide2.QtWidgets.QStyleOptionGraphicsItem, widget: Optional[PySide2.QtWidgets.QWidget] = None) None

jodeln.gui.schematic_scene module

class jodeln.gui.schematic_scene.SchematicScene

Bases: QGraphicsScene

QGraphicsScene for displaying the network.

Stores a LinkItem for each link in the network. Keyed by: (start node id, end node id)

Type

Dict

routes

Stores the nodes along each route. Keyed by: (route.origin, route.destination, route.name)

Type

Dict

color_route(route, is_selected) None

Sets a bool to indicate if the link is on the user-selected path.

LinkItem objects in the scene can update themselves to be colored based on the selection bool.

Parameters
  • route (Tuple) – Route identifier tuple: (route.origin, route.destination, route.name)

  • is_selected (bool) – True if the the link is on the user selected path.

load_network(nodes, links) None

Transfer network node and link data from the Model to the SchematicScene.

Parameters
  • nodes (Dict) – {i: (x, y, name)} Dict of coordinates for each node.

  • links (List) – [(i, j, shape_points), …] List of start/end node numbers for each link.

load_routes(routes: List[RouteInfo]) None

Transfers data about the routes and od from the Model to the SchematicScene.

Parameters

routes (List[RouteInfo]) – Basic info about the route for each OD. Includes route origin, destination, route name, and nodes.

mousePressEvent(self, event: PySide2.QtWidgets.QGraphicsSceneMouseEvent) None
staticMetaObject = <PySide2.QtCore.QMetaObject object>

jodeln.gui.schematic_view module

class jodeln.gui.schematic_view.SchematicView(parent=None)

Bases: QGraphicsView

staticMetaObject = <PySide2.QtCore.QMetaObject object>
wheelEvent(self, event: PySide2.QtGui.QWheelEvent) None

jodeln.gui.ui_dialog_open module

class jodeln.gui.ui_dialog_open.Ui_Dialog

Bases: object

retranslateUi(Dialog)
setupUi(Dialog)

jodeln.gui.ui_mainwindow module

class jodeln.gui.ui_mainwindow.Ui_MainWindow

Bases: object

retranslateUi(MainWindow)
setupUi(MainWindow)