/EEE231

EEE231 Directed Graph Editor

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

EEE231 Directed Graph Editor

0. Table of Contents

1. Background

1.0 Install

  • Clone GitHub Repository git clone git@github.com:Spehhhhh/EEE228.git
  • Switch to the directory cd EEE231

1.1 Usage

  • This project uses pipenv to manage the virtual environment.
  • Install Poetry curl -sSL https://install.python-poetry.org | python3 -
  • Set environment variables echo 'export PATH="$HOME/.poetry/bin:$PATH"' >> ~/.zshrc
  • Install package poetry install
  • Activate the virtual environment for the current project poetry shell
  • Generate lockfile poetry lock --no-update
  • Run the main program poetry run python main.py

1.2 Name Convention

  • Class Naming Convention: CapWords
  • Function Naming Convention: lower_with_under()
  • Variables Naming Convention: lower_with_under

1.3 Development Process

Each group develops code in its own branch. After completing the development of the features and writing the unit tests. Pull Request to Main branch.

How do I create a branch?

$ git pull
$ git checkout -b dggui
$ git push --set-upstream origin dggui

How to properly Clone a branch Branch in an upstream repository?

$ git clone https://github.com/pirlite2/EEE231-group-B.git
$ cd EEE231-group-B
$ git checkout -b dggui origin/dggui # git checkout -b {your_local_branch_name} origin/<remote_branch_name>

How do I get my own feature branch to synchronize the code in the main branch?

$ git pull
$ git checkout feature1 # The branch you want to synchronize your code with
$ git merge main

We use Black for code formatting.

2. Architecture

2.0 Module

Module Folder Location Feature Detailed documentation
directedgraph /directedgraph ๐Ÿ”—
dgutils /directedgraph/dgutils Software External Interfaces ๐Ÿ”—
dggui /directedgraph/dggui Software UI ๐Ÿ”—
dgapp /directedgraph/dgapp Software Event ๐Ÿ”—
dgcore /directedgraph/dgcore Graph Resource Model ๐Ÿ”—

2.1 Class

Class Diagram Overview

Class Diagram

Class Feature
directedgraph.dgcore.Graph Used to control Graph
directedgraph.dgcore.GraphComponent Used to control specific Arc and Node
directedgraph.dgcore.Node
directedgraph.dgcore.SourceNode
directedgraph.dgcore.GroundNode
directedgraph.dgcore.Arc
directedgraph.dggui.GraphEditorMainWindow
directedgraph.dggui.InputDialogNode Input Dialog GUI
directedgraph.dggui.InputDialogArc Input Dialog GUI
directedgraph.dggui.NodeItem Node GUI
directedgraph.dggui.SourceNodeItem SourceNode GUI
directedgraph.dggui.GroundNodeItem GroundNode GUI
directedgraph.dggui.ArcItem Arc GUI
directedgraph.dgutils.FileManager Reading and saving XML
directedgraph.dgutils.GraphSimulator Exporting Graph as a simulation file

A GraphEditorGUI instance corresponds to a software window.

A Graph Class instance corresponds to a Directed Graph.

GraphComponent Class is the software component library. All Nodes Class and Arcs Class inherit from GraphComponent.

Most of the Methods in GraphController are Use Cases, where a Method corresponds to some user action on the GUI. For example, when the user clicks the Create button, the GUI calls the Method in the GraphController instead of the GUI manipulating the database directly.

In the case of the FileManager Class, when the user calls read_graph, the function takes a local xml file as an argument, reads the data and returns a Graph instance. Typically, a local xml file will correspond to a Graph instance.

The advantage of this design is that, firstly, the software can launch multiple Graphs and multiple GUI interfaces at the same time. Secondly, the fine-grained class classification makes teamwork less difficult and the GUI team only needs to focus on interface design.

3. License

GNU General Public License v3.0

4. External Link

5. ChangeLog

  • 210507 add Development Process
  • 210501 add Branch
  • 210501 fix Contributors
  • 210414 add Architecture
  • 210412 add Naming Conventions
  • 210324 init