Repository for a Process Flow Diagram Software
Main window
- Drag and Drop symbols from toolbar to scene
- Undo Redo action
- Save and Load files
- Connect symbols with lines, and add labels
- Create stream table
- Use various paper sizes
- Work on multiple diagrams and file at once
- View diagrams side by side
- Zoom In/out on the scene
main application entry point, defines the main window and runs it.
Contains the shape and line definitions and logic.
contains the sub window definitions along with various utility methods.
git clone https://github.com/FOSSEE/Chemical-PFD.git
or by simply pressing the Clone or Download button and using your own preferred way of obtaining a working copy of the repository
pip install --upgrade pip
pip install -r requirements.txt
fbs run
or
python3 build.py run
additionally, if fbs doesnt work, you can manually run the program as
python3 ./src/main/python/main.py
that is run the main.py file located in ./src/main/python/main.py any output generated when run this way would be saved in ./src/main/python/
There are two methods of doing this,
Using pyrcc5, the resource.qrc can be compiled to a python file
pyrcc5 -o src/main/python/resources/resources.py src/main/ui/resources.rcc
Using fbs's freeze feature.
fbs freeze
One can now build installer using fbs,
fbs release
note: Windows user will need nsis installed on their system and added to env path. Additionally multiple things might need to be done, follow the onscreen instruction.
can be done, by using build.py build
python3 build.py build
The process of adding symbols, is simple.
It is necessary that the symbol is in svg format. One can use any of the many svg tools out there. We recommend Inkscape
Under src/main/python/shapes/shape.py, using the following as an example, one can create his own class definition for the symbol. The grip list is the percentage position of the grip item object along with the parent's width and height, the third value is its position and the fourth value if specified is the width/height if the grip is a line grip item.
class HorizontalVessel(NodeItem):
def __init__(self):
super(HorizontalVessel, self).__init__("svg/Process Vessels/Horizontal Vessel")
self.grips = [
[50, 100, "top", 87.08554680344],
[0, 50, "left"],
[100, 50, "right"],
[50, 0, "bottom", 87.08554680344]
]
The items.json is present in src/main/resources/base/config/items.json Once the class name and category has been decided, an items.json entry can be configured as follows,
{
"Process Vessels": {
"Horizontal Vessel": {
"name": "Horizontal Vessel",
"icon": ".\\Process Vessels\\Horizontal Vessel.png",
"class": "Process Vessels",
"object": "HorizontalVessel",
"args": []
},
}
}
A 64x64 toolbar icon as a png needs to be prepared to be shown in the toolbar. It needs to be placed in src/main/resources/base/toolbar/ in the corresponding folder in the json file.
Most of the above process can be automated, following are a few procedures one can use
You can find the script here
You can launch the tool while running the app, by clicking Add new Symbols in the edit menu. Or by directly launching the edit symbol menu using build.py
python3 build.py symbolGen
The QtForPython docs were used to implement the program, one can reference them here
- QtForPython The docs for Qt for C++ library can be found here
- Qt