From cdd7ca2a45f5e0cfd14e20a3d1fff8a58d8be32d Mon Sep 17 00:00:00 2001 From: Blaine Date: Wed, 10 Jun 2020 20:42:52 +0530 Subject: implement new svg files --- src/main/python/utils/app.py | 5 +- src/main/python/utils/toolbar.py | 2 +- .../base/Compressors/Centrifugal Compressor.svg | 123 +++++++++++++++ .../base/Compressors/Ejector Compressor.svg | 66 ++++++++ src/main/resources/base/Compressors/Fan.svg | 109 +++++++++++++ .../Positive Displacement Compressor.svg | 94 ++++++++++++ .../base/Compressors/Reciprocating Compressor.svg | 99 ++++++++++++ src/main/resources/base/Compressors/Turbine.svg | 104 +++++++++++++ src/main/resources/base/config/items.json | 65 ++++++++ .../svg/Compressors/Centrifugal Compressor.svg | 123 +++++++++++++++ .../base/svg/Compressors/Ejector Compressor.svg | 66 ++++++++ src/main/resources/base/svg/Compressors/Fan.svg | 109 +++++++++++++ .../Positive Displacement Compressor.svg | 94 ++++++++++++ .../svg/Compressors/Reciprocating Compressor.svg | 99 ++++++++++++ .../resources/base/svg/Compressors/Turbine.svg | 104 +++++++++++++ src/main/resources/base/svg/Pumps/Blowing Egg.svg | 76 +++++++++ src/main/resources/base/svg/Pumps/Duplex Pump.svg | 156 ++++++++++--------- .../base/svg/Pumps/Ejector(Vapor Service).svg | 78 ++++++++++ .../base/svg/Pumps/Hand Pump with Drum.svg | 169 +++++++++++++++++++++ .../toolbar/Compressors/Centrifugal Compressor.png | Bin 0 -> 1413 bytes .../toolbar/Compressors/Ejector Compressor.png | Bin 0 -> 1126 bytes .../resources/base/toolbar/Compressors/Fan.png | Bin 0 -> 1600 bytes .../Positive Displacement Compressor.png | Bin 0 -> 1098 bytes .../Compressors/Reciprocating Compressor.png | Bin 0 -> 1091 bytes .../resources/base/toolbar/Compressors/Turbine.png | Bin 0 -> 1368 bytes .../resources/base/toolbar/Piping/Inflow Line.png | Bin 1185 -> 1185 bytes .../resources/base/toolbar/Piping/Outflow Line.png | Bin 1244 -> 1244 bytes .../resources/base/toolbar/Pumps/Blowing Egg.png | Bin 0 -> 1556 bytes .../resources/base/toolbar/Pumps/Duplex Pump.png | Bin 1368 -> 1387 bytes .../base/toolbar/Pumps/Ejector(Vapor Service).png | Bin 0 -> 1106 bytes .../base/toolbar/Pumps/Hand Pump with Drum.png | Bin 0 -> 2166 bytes .../resources/base/toolbar/Pumps/Plunger Pump.png | Bin 1057 -> 1057 bytes .../base/toolbar/Pumps/Proportioning Pump.png | Bin 1272 -> 1272 bytes .../base/toolbar/Pumps/Reciprocating Pump.png | Bin 1258 -> 1258 bytes 34 files changed, 1670 insertions(+), 71 deletions(-) create mode 100644 src/main/resources/base/Compressors/Centrifugal Compressor.svg create mode 100644 src/main/resources/base/Compressors/Ejector Compressor.svg create mode 100644 src/main/resources/base/Compressors/Fan.svg create mode 100644 src/main/resources/base/Compressors/Positive Displacement Compressor.svg create mode 100644 src/main/resources/base/Compressors/Reciprocating Compressor.svg create mode 100644 src/main/resources/base/Compressors/Turbine.svg create mode 100644 src/main/resources/base/svg/Compressors/Centrifugal Compressor.svg create mode 100644 src/main/resources/base/svg/Compressors/Ejector Compressor.svg create mode 100644 src/main/resources/base/svg/Compressors/Fan.svg create mode 100644 src/main/resources/base/svg/Compressors/Positive Displacement Compressor.svg create mode 100644 src/main/resources/base/svg/Compressors/Reciprocating Compressor.svg create mode 100644 src/main/resources/base/svg/Compressors/Turbine.svg create mode 100644 src/main/resources/base/svg/Pumps/Blowing Egg.svg create mode 100644 src/main/resources/base/svg/Pumps/Ejector(Vapor Service).svg create mode 100644 src/main/resources/base/svg/Pumps/Hand Pump with Drum.svg create mode 100644 src/main/resources/base/toolbar/Compressors/Centrifugal Compressor.png create mode 100644 src/main/resources/base/toolbar/Compressors/Ejector Compressor.png create mode 100644 src/main/resources/base/toolbar/Compressors/Fan.png create mode 100644 src/main/resources/base/toolbar/Compressors/Positive Displacement Compressor.png create mode 100644 src/main/resources/base/toolbar/Compressors/Reciprocating Compressor.png create mode 100644 src/main/resources/base/toolbar/Compressors/Turbine.png create mode 100644 src/main/resources/base/toolbar/Pumps/Blowing Egg.png create mode 100644 src/main/resources/base/toolbar/Pumps/Ejector(Vapor Service).png create mode 100644 src/main/resources/base/toolbar/Pumps/Hand Pump with Drum.png diff --git a/src/main/python/utils/app.py b/src/main/python/utils/app.py index 9812fda..4cc8228 100644 --- a/src/main/python/utils/app.py +++ b/src/main/python/utils/app.py @@ -5,14 +5,15 @@ Declare fbs application so that it can be imported in other modules. from fbs_runtime.application_context.PyQt5 import ApplicationContext from PyQt5.QtCore import QSettings from json import JSONEncoder, dumps, loads, dump, load +from os.path import join app = ApplicationContext() settings = QSettings(QSettings.IniFormat, QSettings.UserScope ,"FOSSEE", "Chemical-PFD") version = app.build_settings['version'] -def fileImporter(file): +def fileImporter(*file): # Helper function to fetch files from src/main/resources - return app.get_resource(file) + return app.get_resource(join(*file)) class JSON_Encoder: diff --git a/src/main/python/utils/toolbar.py b/src/main/python/utils/toolbar.py index ffb0896..90b46fb 100644 --- a/src/main/python/utils/toolbar.py +++ b/src/main/python/utils/toolbar.py @@ -120,7 +120,7 @@ class toolbarButton(QToolButton): def __init__(self, parent = None, item = None): super(toolbarButton, self).__init__(parent) #uses fbs resource manager to get icons - self.setIcon(QIcon(fileImporter(f'toolbar/{item["icon"]}'))) + self.setIcon(QIcon(fileImporter('toolbar', item['icon']))) self.setIconSize(QSize(64, 64)) #unecessary but left for future references self.dragStartPosition = None #intialize value for drag event self.itemObject = item['object'] #refer current item object, to handle drag mime diff --git a/src/main/resources/base/Compressors/Centrifugal Compressor.svg b/src/main/resources/base/Compressors/Centrifugal Compressor.svg new file mode 100644 index 0000000..15ae554 --- /dev/null +++ b/src/main/resources/base/Compressors/Centrifugal Compressor.svg @@ -0,0 +1,123 @@ + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + M + + + diff --git a/src/main/resources/base/Compressors/Ejector Compressor.svg b/src/main/resources/base/Compressors/Ejector Compressor.svg new file mode 100644 index 0000000..cb345d1 --- /dev/null +++ b/src/main/resources/base/Compressors/Ejector Compressor.svg @@ -0,0 +1,66 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/src/main/resources/base/Compressors/Fan.svg b/src/main/resources/base/Compressors/Fan.svg new file mode 100644 index 0000000..b23a097 --- /dev/null +++ b/src/main/resources/base/Compressors/Fan.svg @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + M + + + diff --git a/src/main/resources/base/Compressors/Positive Displacement Compressor.svg b/src/main/resources/base/Compressors/Positive Displacement Compressor.svg new file mode 100644 index 0000000..99802b2 --- /dev/null +++ b/src/main/resources/base/Compressors/Positive Displacement Compressor.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/src/main/resources/base/Compressors/Reciprocating Compressor.svg b/src/main/resources/base/Compressors/Reciprocating Compressor.svg new file mode 100644 index 0000000..521e144 --- /dev/null +++ b/src/main/resources/base/Compressors/Reciprocating Compressor.svg @@ -0,0 +1,99 @@ + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + M + + diff --git a/src/main/resources/base/Compressors/Turbine.svg b/src/main/resources/base/Compressors/Turbine.svg new file mode 100644 index 0000000..6383f61 --- /dev/null +++ b/src/main/resources/base/Compressors/Turbine.svg @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + T + + + diff --git a/src/main/resources/base/config/items.json b/src/main/resources/base/config/items.json index fff7505..9a55a4d 100644 --- a/src/main/resources/base/config/items.json +++ b/src/main/resources/base/config/items.json @@ -43,6 +43,71 @@ "class": "Pumps", "object": "ReciprocatingPump", "args": [] + }, + "Blowing Egg": { + "name": "Blowing Egg", + "icon": ".\\Pumps\\Blowing Egg.png", + "class": "Pumps", + "object": "BlowingEgg", + "args": [] + }, + "Ejector(Vapor Service)": { + "name": "Ejector(Vapor Service)", + "icon": ".\\Pumps\\Ejector(Vapor Service).png", + "class": "Pumps", + "object": "Ejector(VaporService)", + "args": [] + }, + "Hand Pump with Drum": { + "name": "Hand Pump with Drum", + "icon": ".\\Pumps\\Hand Pump with Drum.png", + "class": "Pumps", + "object": "HandPumpWithDrum", + "args": [] + } + }, + "Compressors": { + "Centrifugal Compressor": { + "name": "Centrifugal Compressor", + "icon": ".\\Compressors\\Centrifugal Compressor.png", + "class": "Compressors", + "object": "CentrifugalCompressor", + "args": [] + }, + "Ejector Compressor": { + "name": "Ejector Compressor", + "icon": ".\\Compressors\\Ejector Compressor.png", + "class": "Compressors", + "object": "EjectorCompressor", + "args": [] + }, + "Fan": { + "name": "Fan", + "icon": ".\\Compressors\\Fan.png", + "class": "Compressors", + "object": "Fan", + "args": [] + }, + "Positive Displacement Compressor": { + "name": "Positive Displacement Compressor", + "icon": ".\\Compressors\\Positive Displacement Compressor.png", + "class": "Compressors", + "object": "PositiveDisplacementCompressor", + "args": [] + }, + "Reciprocating Compressor": { + "name": "Reciprocating Compressor", + "icon": ".\\Compressors\\Reciprocating Compressor.png", + "class": "Compressors", + "object": "ReciprocatingCompressor", + "args": [] + }, + "Turbine": { + "name": "Turbine", + "icon": ".\\Compressors\\Turbine.png", + "class": "Compressors", + "object": "Turbine", + "args": [] } } } \ No newline at end of file diff --git a/src/main/resources/base/svg/Compressors/Centrifugal Compressor.svg b/src/main/resources/base/svg/Compressors/Centrifugal Compressor.svg new file mode 100644 index 0000000..15ae554 --- /dev/null +++ b/src/main/resources/base/svg/Compressors/Centrifugal Compressor.svg @@ -0,0 +1,123 @@ + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + M + + + diff --git a/src/main/resources/base/svg/Compressors/Ejector Compressor.svg b/src/main/resources/base/svg/Compressors/Ejector Compressor.svg new file mode 100644 index 0000000..cb345d1 --- /dev/null +++ b/src/main/resources/base/svg/Compressors/Ejector Compressor.svg @@ -0,0 +1,66 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/src/main/resources/base/svg/Compressors/Fan.svg b/src/main/resources/base/svg/Compressors/Fan.svg new file mode 100644 index 0000000..b23a097 --- /dev/null +++ b/src/main/resources/base/svg/Compressors/Fan.svg @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + M + + + diff --git a/src/main/resources/base/svg/Compressors/Positive Displacement Compressor.svg b/src/main/resources/base/svg/Compressors/Positive Displacement Compressor.svg new file mode 100644 index 0000000..99802b2 --- /dev/null +++ b/src/main/resources/base/svg/Compressors/Positive Displacement Compressor.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/src/main/resources/base/svg/Compressors/Reciprocating Compressor.svg b/src/main/resources/base/svg/Compressors/Reciprocating Compressor.svg new file mode 100644 index 0000000..521e144 --- /dev/null +++ b/src/main/resources/base/svg/Compressors/Reciprocating Compressor.svg @@ -0,0 +1,99 @@ + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + M + + diff --git a/src/main/resources/base/svg/Compressors/Turbine.svg b/src/main/resources/base/svg/Compressors/Turbine.svg new file mode 100644 index 0000000..6383f61 --- /dev/null +++ b/src/main/resources/base/svg/Compressors/Turbine.svg @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + T + + + diff --git a/src/main/resources/base/svg/Pumps/Blowing Egg.svg b/src/main/resources/base/svg/Pumps/Blowing Egg.svg new file mode 100644 index 0000000..979d6b9 --- /dev/null +++ b/src/main/resources/base/svg/Pumps/Blowing Egg.svg @@ -0,0 +1,76 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + M + + diff --git a/src/main/resources/base/svg/Pumps/Duplex Pump.svg b/src/main/resources/base/svg/Pumps/Duplex Pump.svg index 7557711..d499cc7 100644 --- a/src/main/resources/base/svg/Pumps/Duplex Pump.svg +++ b/src/main/resources/base/svg/Pumps/Duplex Pump.svg @@ -7,39 +7,63 @@ xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" - id="svg5576" - version="1.1" - viewBox="0 0 21.156015 22.703859" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + inkscape:version="1.0 (4035a4fb49, 2020-05-01)" + sodipodi:docname="Duplex Pump.svg" + width="21.156015mm" height="22.703859mm" - width="21.156015mm"> + viewBox="0 0 21.156015 22.703859" + version="1.1" + id="svg5576"> + + y2="280.57645" + x2="2365.7141" + y1="280.57645" + x1="2331.7856" + id="linearGradient5047" + xlink:href="#linearGradient4926" /> + osb:paint="solid" + id="linearGradient4926"> + style="stop-color:#000000;stop-opacity:1;" /> + x2="2365.7141" + y1="280.57645" + x1="2331.7856" + gradientUnits="userSpaceOnUse" + id="linearGradient5051" + xlink:href="#linearGradient4926" /> @@ -49,60 +73,56 @@ image/svg+xml - + + id="g873"> + + style="stroke-width:3.02362;stroke-miterlimit:4;stroke-dasharray:none" + transform="matrix(0.26458333,0,0,0.26458333,-259.85352,-96.898438)" + id="g5609"> - - - + M - - - - - + style="font-size:22.5px;line-height:1.25;stroke-width:3.02362;stroke-miterlimit:4;stroke-dasharray:none">M + + + + diff --git a/src/main/resources/base/svg/Pumps/Ejector(Vapor Service).svg b/src/main/resources/base/svg/Pumps/Ejector(Vapor Service).svg new file mode 100644 index 0000000..4278349 --- /dev/null +++ b/src/main/resources/base/svg/Pumps/Ejector(Vapor Service).svg @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/src/main/resources/base/svg/Pumps/Hand Pump with Drum.svg b/src/main/resources/base/svg/Pumps/Hand Pump with Drum.svg new file mode 100644 index 0000000..8c7815c --- /dev/null +++ b/src/main/resources/base/svg/Pumps/Hand Pump with Drum.svg @@ -0,0 +1,169 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/base/toolbar/Compressors/Centrifugal Compressor.png b/src/main/resources/base/toolbar/Compressors/Centrifugal Compressor.png new file mode 100644 index 0000000..0dd5c81 Binary files /dev/null and b/src/main/resources/base/toolbar/Compressors/Centrifugal Compressor.png differ diff --git a/src/main/resources/base/toolbar/Compressors/Ejector Compressor.png b/src/main/resources/base/toolbar/Compressors/Ejector Compressor.png new file mode 100644 index 0000000..2401524 Binary files /dev/null and b/src/main/resources/base/toolbar/Compressors/Ejector Compressor.png differ diff --git a/src/main/resources/base/toolbar/Compressors/Fan.png b/src/main/resources/base/toolbar/Compressors/Fan.png new file mode 100644 index 0000000..44ee063 Binary files /dev/null and b/src/main/resources/base/toolbar/Compressors/Fan.png differ diff --git a/src/main/resources/base/toolbar/Compressors/Positive Displacement Compressor.png b/src/main/resources/base/toolbar/Compressors/Positive Displacement Compressor.png new file mode 100644 index 0000000..f7e6e8e Binary files /dev/null and b/src/main/resources/base/toolbar/Compressors/Positive Displacement Compressor.png differ diff --git a/src/main/resources/base/toolbar/Compressors/Reciprocating Compressor.png b/src/main/resources/base/toolbar/Compressors/Reciprocating Compressor.png new file mode 100644 index 0000000..781f722 Binary files /dev/null and b/src/main/resources/base/toolbar/Compressors/Reciprocating Compressor.png differ diff --git a/src/main/resources/base/toolbar/Compressors/Turbine.png b/src/main/resources/base/toolbar/Compressors/Turbine.png new file mode 100644 index 0000000..795cc90 Binary files /dev/null and b/src/main/resources/base/toolbar/Compressors/Turbine.png differ diff --git a/src/main/resources/base/toolbar/Piping/Inflow Line.png b/src/main/resources/base/toolbar/Piping/Inflow Line.png index 72dfd01..7e5356d 100644 Binary files a/src/main/resources/base/toolbar/Piping/Inflow Line.png and b/src/main/resources/base/toolbar/Piping/Inflow Line.png differ diff --git a/src/main/resources/base/toolbar/Piping/Outflow Line.png b/src/main/resources/base/toolbar/Piping/Outflow Line.png index a71f49f..84d1645 100644 Binary files a/src/main/resources/base/toolbar/Piping/Outflow Line.png and b/src/main/resources/base/toolbar/Piping/Outflow Line.png differ diff --git a/src/main/resources/base/toolbar/Pumps/Blowing Egg.png b/src/main/resources/base/toolbar/Pumps/Blowing Egg.png new file mode 100644 index 0000000..87118a4 Binary files /dev/null and b/src/main/resources/base/toolbar/Pumps/Blowing Egg.png differ diff --git a/src/main/resources/base/toolbar/Pumps/Duplex Pump.png b/src/main/resources/base/toolbar/Pumps/Duplex Pump.png index 5f77e7a..b2ee84b 100644 Binary files a/src/main/resources/base/toolbar/Pumps/Duplex Pump.png and b/src/main/resources/base/toolbar/Pumps/Duplex Pump.png differ diff --git a/src/main/resources/base/toolbar/Pumps/Ejector(Vapor Service).png b/src/main/resources/base/toolbar/Pumps/Ejector(Vapor Service).png new file mode 100644 index 0000000..e317698 Binary files /dev/null and b/src/main/resources/base/toolbar/Pumps/Ejector(Vapor Service).png differ diff --git a/src/main/resources/base/toolbar/Pumps/Hand Pump with Drum.png b/src/main/resources/base/toolbar/Pumps/Hand Pump with Drum.png new file mode 100644 index 0000000..a183826 Binary files /dev/null and b/src/main/resources/base/toolbar/Pumps/Hand Pump with Drum.png differ diff --git a/src/main/resources/base/toolbar/Pumps/Plunger Pump.png b/src/main/resources/base/toolbar/Pumps/Plunger Pump.png index b1b977a..c6dc484 100644 Binary files a/src/main/resources/base/toolbar/Pumps/Plunger Pump.png and b/src/main/resources/base/toolbar/Pumps/Plunger Pump.png differ diff --git a/src/main/resources/base/toolbar/Pumps/Proportioning Pump.png b/src/main/resources/base/toolbar/Pumps/Proportioning Pump.png index 66f233f..c00c923 100644 Binary files a/src/main/resources/base/toolbar/Pumps/Proportioning Pump.png and b/src/main/resources/base/toolbar/Pumps/Proportioning Pump.png differ diff --git a/src/main/resources/base/toolbar/Pumps/Reciprocating Pump.png b/src/main/resources/base/toolbar/Pumps/Reciprocating Pump.png index bd44b12..de8155e 100644 Binary files a/src/main/resources/base/toolbar/Pumps/Reciprocating Pump.png and b/src/main/resources/base/toolbar/Pumps/Reciprocating Pump.png differ -- cgit