From 7b8e2551b97b4d18a3769ee3a9bc6409f27427d8 Mon Sep 17 00:00:00 2001 From: pravindalve Date: Wed, 24 Jun 2020 13:59:35 +0530 Subject: issue with updating database while creating new file fixed --- DockWidgets/__pycache__/DockWidget.cpython-37.pyc | Bin 6125 -> 6125 bytes .../DockWidgetCompoundSeparator.cpython-37.pyc | Bin 3187 -> 3187 bytes .../DockWidgetDistillationColumn.cpython-37.pyc | Bin 4204 -> 4204 bytes .../__pycache__/DockWidgetFlash.cpython-37.pyc | Bin 2913 -> 2913 bytes .../DockWidgetMaterialStream.cpython-37.pyc | Bin 8757 -> 8757 bytes .../__pycache__/DockWidgetMixer.cpython-37.pyc | Bin 2233 -> 2233 bytes .../DockWidgetShortcutColumn.cpython-37.pyc | Bin 3382 -> 3382 bytes .../__pycache__/DockWidgetSplitter.cpython-37.pyc | Bin 2764 -> 2764 bytes 8 files changed, 0 insertions(+), 0 deletions(-) (limited to 'DockWidgets') diff --git a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc index 80d0ae1..73e3283 100644 Binary files a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc index e5023b1..a017f6c 100644 Binary files a/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc index 0584a29..9edcc3b 100644 Binary files a/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc index 7eaaef7..634882d 100644 Binary files a/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc index a99f092..ad1e8f3 100644 Binary files a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc index 52a0ca1..fa45bf4 100644 Binary files a/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc index 85449f8..7e4a733 100644 Binary files a/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc index 19250d9..ea2d2ea 100644 Binary files a/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc differ -- cgit From 304347a14fb0a5d770717e08f10efaed84d51902 Mon Sep 17 00:00:00 2001 From: pravindalve Date: Thu, 25 Jun 2020 12:51:06 +0530 Subject: Bug fixes for Splitter --- DockWidgets/DockWidgetSplitter.py | 14 +++++++------- .../__pycache__/DockWidgetSplitter.cpython-37.pyc | Bin 2764 -> 2751 bytes 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'DockWidgets') diff --git a/DockWidgets/DockWidgetSplitter.py b/DockWidgets/DockWidgetSplitter.py index 262bd45..c1c0120 100644 --- a/DockWidgets/DockWidgetSplitter.py +++ b/DockWidgets/DockWidgetSplitter.py @@ -30,9 +30,9 @@ class DockWidgetSplitter(QDockWidget,ui_dialog): try: print("input_params_list ", self.input_dict) - self.l1.setText(self.obj.variables['NOO']['name']+":") - self.le1.setText(str(self.obj.variables['NOO']['value'])) - self.u1.setText(self.obj.variables['NOO']['unit']) + self.l1.setText(self.obj.variables['No']['name']+":") + self.le1.setText(str(self.obj.variables['No']['value'])) + self.u1.setText(self.obj.variables['No']['unit']) for i in self.obj.CalcType_modes: self.cb2.addItem(str(i)) @@ -52,12 +52,12 @@ class DockWidgetSplitter(QDockWidget,ui_dialog): print(e) def fun(self): - if self.cb2.currentText() == 'Mole Flow Specs': + if self.cb2.currentText() == 'Molar_Flow': self.u3.setText('mol/s') self.u4.setText('mol/s') - elif self.cb2.currentText() == 'Mass Flow Specs': - self.u3.setText('kg/s') - self.u4.setText('kg/s') + elif self.cb2.currentText() == 'Mass_Flow': + self.u3.setText('g/s') + self.u4.setText('g/s') else: self.u3.setText('') self.u4.setText('') diff --git a/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc index ea2d2ea..045ca3d 100644 Binary files a/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc differ -- cgit From da8e13197c906ee90ba8672567b6670a291eb2c1 Mon Sep 17 00:00:00 2001 From: pravindalve Date: Thu, 25 Jun 2020 14:56:00 +0530 Subject: Generalization for integer and float variables in flowsheet_initialization --- DockWidgets/DockWidgetMixer.py | 2 +- DockWidgets/__pycache__/DockWidget.cpython-37.pyc | Bin 6125 -> 6125 bytes .../__pycache__/DockWidgetMixer.cpython-37.pyc | Bin 2233 -> 2244 bytes 3 files changed, 1 insertion(+), 1 deletion(-) (limited to 'DockWidgets') diff --git a/DockWidgets/DockWidgetMixer.py b/DockWidgets/DockWidgetMixer.py index 28cbff0..01bfd48 100644 --- a/DockWidgets/DockWidgetMixer.py +++ b/DockWidgets/DockWidgetMixer.py @@ -52,7 +52,7 @@ class DockWidgetMixer(QDockWidget,ui_dialog): try: self.dict={} print("param.input_dict ", self.input_dict) - self.dict = [int(self.input_dict[0].text()),self.input_dict[1].currentText()] + self.dict = [int(self.input_dict[0].text()), '"' + self.input_dict[1].currentText() + '"'] print("param ", self.dict) self.obj.param_setter(self.dict) self.hide() diff --git a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc index 73e3283..0733a15 100644 Binary files a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc index fa45bf4..6bfb174 100644 Binary files a/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc differ -- cgit From a69bc3eb0486d949c024bb5b373b14c0618d2220 Mon Sep 17 00:00:00 2001 From: lucaszhao19 Date: Wed, 8 Jul 2020 16:25:01 +0630 Subject: Compound Separator bug fixed. --- DockWidgets/__pycache__/DockWidget.cpython-37.pyc | Bin 6125 -> 6107 bytes .../DockWidgetCompoundSeparator.cpython-37.pyc | Bin 3187 -> 3169 bytes .../DockWidgetDistillationColumn.cpython-37.pyc | Bin 4204 -> 4186 bytes .../__pycache__/DockWidgetFlash.cpython-37.pyc | Bin 2913 -> 2895 bytes .../DockWidgetMaterialStream.cpython-37.pyc | Bin 8757 -> 8739 bytes .../__pycache__/DockWidgetMixer.cpython-37.pyc | Bin 2244 -> 2226 bytes .../DockWidgetShortcutColumn.cpython-37.pyc | Bin 3382 -> 3364 bytes .../__pycache__/DockWidgetSplitter.cpython-37.pyc | Bin 2751 -> 2733 bytes 8 files changed, 0 insertions(+), 0 deletions(-) (limited to 'DockWidgets') diff --git a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc index 0733a15..f1fa8b5 100644 Binary files a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc index a017f6c..ecad97b 100644 Binary files a/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc index 9edcc3b..e5f9002 100644 Binary files a/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc index 634882d..c706582 100644 Binary files a/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc index ad1e8f3..e42b5d7 100644 Binary files a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc index 6bfb174..ab2fad7 100644 Binary files a/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc index 7e4a733..1c34a04 100644 Binary files a/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc index 045ca3d..bcd36dc 100644 Binary files a/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc differ -- cgit From dafe790599284515c1db8bbf58946aae531bb551 Mon Sep 17 00:00:00 2001 From: pravindalve Date: Wed, 8 Jul 2020 16:39:05 +0530 Subject: Flash bugs fixed --- DockWidgets/DockWidgetFlash.py | 2 +- DockWidgets/__pycache__/DockWidget.cpython-37.pyc | Bin 6107 -> 6125 bytes .../DockWidgetCompoundSeparator.cpython-37.pyc | Bin 3169 -> 3187 bytes .../DockWidgetDistillationColumn.cpython-37.pyc | Bin 4186 -> 4204 bytes .../__pycache__/DockWidgetFlash.cpython-37.pyc | Bin 2895 -> 2914 bytes .../DockWidgetMaterialStream.cpython-37.pyc | Bin 8739 -> 8757 bytes .../__pycache__/DockWidgetMixer.cpython-37.pyc | Bin 2226 -> 2244 bytes .../DockWidgetShortcutColumn.cpython-37.pyc | Bin 3364 -> 3382 bytes .../__pycache__/DockWidgetSplitter.cpython-37.pyc | Bin 2733 -> 2751 bytes 9 files changed, 1 insertion(+), 1 deletion(-) (limited to 'DockWidgets') diff --git a/DockWidgets/DockWidgetFlash.py b/DockWidgets/DockWidgetFlash.py index 6098b27..1634169 100644 --- a/DockWidgets/DockWidgetFlash.py +++ b/DockWidgets/DockWidgetFlash.py @@ -29,7 +29,7 @@ class DockWidgetFlash(QDockWidget,ui_dialog): try: print("input_params_list ", self.input_dict) - self.l1.setText(self.obj.variables['thermoPackage']['name']+":") + self.l1.setText(self.obj.variables['thermo_package']['name']+":") self.lines = [line.rstrip('\n') for line in open('thermopackage.txt')] for j in self.lines: self.cb1.addItem(str(j)) diff --git a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc index f1fa8b5..0733a15 100644 Binary files a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc index ecad97b..a017f6c 100644 Binary files a/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc index e5f9002..9edcc3b 100644 Binary files a/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc index c706582..7a0568c 100644 Binary files a/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc index e42b5d7..ad1e8f3 100644 Binary files a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc index ab2fad7..6bfb174 100644 Binary files a/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc index 1c34a04..7e4a733 100644 Binary files a/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc index bcd36dc..045ca3d 100644 Binary files a/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc differ -- cgit From 2cd248a0ae312672d63a55cf6ac72436e515b2e6 Mon Sep 17 00:00:00 2001 From: lucaszhao19 Date: Thu, 9 Jul 2020 15:49:58 +0630 Subject: Fixed connection problems for Valve, ShortcutColumn and DistillationColumn --- DockWidgets/__pycache__/DockWidget.cpython-37.pyc | Bin 6125 -> 6107 bytes .../DockWidgetCompoundSeparator.cpython-37.pyc | Bin 3187 -> 3169 bytes .../DockWidgetDistillationColumn.cpython-37.pyc | Bin 4204 -> 4186 bytes .../__pycache__/DockWidgetFlash.cpython-37.pyc | Bin 2914 -> 2896 bytes .../DockWidgetMaterialStream.cpython-37.pyc | Bin 8757 -> 8739 bytes .../__pycache__/DockWidgetMixer.cpython-37.pyc | Bin 2244 -> 2226 bytes .../DockWidgetShortcutColumn.cpython-37.pyc | Bin 3382 -> 3364 bytes .../__pycache__/DockWidgetSplitter.cpython-37.pyc | Bin 2751 -> 2733 bytes 8 files changed, 0 insertions(+), 0 deletions(-) (limited to 'DockWidgets') diff --git a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc index 0733a15..f1fa8b5 100644 Binary files a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc index a017f6c..ecad97b 100644 Binary files a/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc index 9edcc3b..e5f9002 100644 Binary files a/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc index 7a0568c..3054328 100644 Binary files a/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc index ad1e8f3..e42b5d7 100644 Binary files a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc index 6bfb174..ab2fad7 100644 Binary files a/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc index 7e4a733..1c34a04 100644 Binary files a/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc index 045ca3d..bcd36dc 100644 Binary files a/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc differ -- cgit From 4754490bd9f60c89f66f886e399abc9ea91e932a Mon Sep 17 00:00:00 2001 From: lucaszhao19 Date: Fri, 10 Jul 2020 22:00:01 +0630 Subject: Result issues fixed and optional input for DistillationColumn --- DockWidgets/DockWidget.py | 7 ++++--- DockWidgets/__pycache__/DockWidget.cpython-37.pyc | Bin 6107 -> 6155 bytes 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'DockWidgets') diff --git a/DockWidgets/DockWidget.py b/DockWidgets/DockWidget.py index 6fc7731..2b1cdb9 100644 --- a/DockWidgets/DockWidget.py +++ b/DockWidgets/DockWidget.py @@ -187,10 +187,11 @@ class DockWidget(QDockWidget,ui_dialog): @staticmethod def show_result(lst): - #DockWidget1.flag = True for i in lst: - i.results_category(i.name) - #i.show() + try: + i.results_category(i.name) + except AttributeError: + pass # result data tab def results_category(self,name): diff --git a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc index f1fa8b5..b042722 100644 Binary files a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc differ -- cgit From badd3b0787acaf3cbecdd9a9935d34de886fb5c2 Mon Sep 17 00:00:00 2001 From: lucaszhao19 Date: Thu, 16 Jul 2020 20:45:15 +0630 Subject: Fetching results for input data of MaterialStream --- DockWidgets/DockWidgetMaterialStream.py | 75 ++++++++++----------- DockWidgets/__pycache__/DockWidget.cpython-37.pyc | Bin 6155 -> 6155 bytes .../DockWidgetMaterialStream.cpython-37.pyc | Bin 8739 -> 8853 bytes 3 files changed, 36 insertions(+), 39 deletions(-) (limited to 'DockWidgets') diff --git a/DockWidgets/DockWidgetMaterialStream.py b/DockWidgets/DockWidgetMaterialStream.py index 78959fc..130b290 100644 --- a/DockWidgets/DockWidgetMaterialStream.py +++ b/DockWidgets/DockWidgetMaterialStream.py @@ -40,13 +40,6 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): self.lTreeWidget.itemClicked.connect(lambda : self.printer(self.lTreeWidget.currentItem())) self.vTreeWidget.itemClicked.connect(lambda : self.printer(self.vTreeWidget.currentItem())) - - # def printer(self, treeItem ): - # foldername = treeItem.text(0) - # comment = treeItem.text(1) - # data = treeItem.text(2) - # print(foldername , ': ' , comment , ' (' + data + ')') - # input data tab def modes(self): modes_list = self.obj.modes_list @@ -69,6 +62,7 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): def input_params_list(self): try: print("input_params_list ", self.input_dict) + for c,i in enumerate(self.input_dict): if(i=="thermo_package"): print("thermo1") @@ -83,39 +77,31 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): self.formLayout.addRow(lay) self.input_dict[i] = combo print("thermo") - elif(i=="condType"): - combo = QComboBox() - self.lines = ["Total","Partial"] - for j in self.lines: - combo.addItem(str(j)) - lay = QGridLayout() - lay.addWidget(QLabel("Condensor Type :"+":"), 0, 0, alignment=Qt.AlignLeft) - lay.addWidget(combo, 0, 1, alignment=Qt.AlignCenter) - self.formLayout.addRow(lay) - self.input_dict[i] = combo elif(i=="x_pc"): noc = len(compound_selected) print(noc) self.x_pclist.clear() - + gp = QGroupBox("Mole Fractions") lay = QGridLayout() for j in range(noc): l = QLineEdit() if self.input_dict[i] != '': - l.setText(str(self.obj.variables[compound_selected[j]]['value'])) + l.setText(str(self.obj.variables['x_pc']['value'][j])) + print('l = ', str(self.obj.variables['x_pc']['value'][j])) + self.input_dict[i] = "x_pc" lay.addWidget(QLabel(str(compound_selected[j])+":"),j,0, alignment=Qt.AlignLeft) lay.addWidget(l,j,1, alignment=Qt.AlignCenter) - self.x_pclist.append(l) - + self.x_pclist.append(l) gp.setLayout(lay) - self.formLayout.addRow(gp) + self.formLayout.addRow(gp) else: print("elseloop") l = QLineEdit() if self.input_dict[i] != None: l.setText(str(self.input_dict[i])) + lay = QGridLayout() lay.addWidget(QLabel(i+":"),0,0, alignment=Qt.AlignLeft) lay.addWidget(l,0,1, alignment=Qt.AlignCenter) @@ -124,8 +110,7 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): else: lay.addWidget(QLabel("mol/s"),0,2, alignment=Qt.AlignCenter) self.formLayout.addRow(lay) - self.input_dict[i] = l - + self.input_dict[i] = l except Exception as e: print(e) @@ -144,12 +129,6 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): else: self.show_error() break - elif(i=="condType"): - if (self.input_dict[i].currentText()): - self.dict[i] = self.input_dict[i].currentText() - else: - self.show_error() - break elif(i =="x_pc"): l=[] mf = [] @@ -197,6 +176,7 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): result=self.container.result obj = self.container.fetch_object(name) + d = {"Mole Fraction":"x_pc", "Mass Fraction":"xm_pc", "Mole Flow":"F_pc", "Mass Flow":"Fm_pc"} lst = list(d.keys()) klst = list(d.values()) @@ -206,21 +186,21 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): # Amounts Tab if obj.type == 'MaterialStream': - l = [] # list for basis names + ll = [] # list for basis names for basis in d: propertyname = name + '.' + d[basis] print("basis ", basis, propertyname) for i in result[0]: if (propertyname in i): - l.append(i) - print(l) + ll.append(i) + print(ll) j = 0 t = 0 namee = klst[j] print("namee ", namee) - for i,k in enumerate(l): + for i,k in enumerate(ll): ind = result[0].index(k) print("index ", ind) print("str ", k) @@ -323,10 +303,27 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): self.mTableWidget.setItem(mrowPosition , 2, QTableWidgetItem(obj.variables[val.split('.')[1]]['unit'])) self.mTableWidget.resizeColumnsToContents() - print(obj.variables) - except Exception as e: - print(e) - + # updating the input data from fetched results from simulation + print(self.comboBox.currentText()) + + self.input_dict = {} + self.input_dict = self.obj.param_getter(self.comboBox.currentText()) + print("before", self.input_dict) + self.input_dict.pop("x_pc") + temp = self.input_dict.pop('thermo_package') + for i in range(len(compound_selected)): + print(i) + self.input_dict['x_pc[1,' + str(i+1) + ']'] = self.obj.variables['x_pc[1,' + str(i+1) +']']['value'] + self.input_dict['thermo_package'] = temp + print("after", self.input_dict) + + # chaning index for updating the input data + indexx = self.comboBox.currentIndex() + self.comboBox.setCurrentIndex(1) + self.comboBox.setCurrentIndex(indexx) + - \ No newline at end of file + + except Exception as e: + print(e) \ No newline at end of file diff --git a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc index b042722..fec7953 100644 Binary files a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc index e42b5d7..16bd08d 100644 Binary files a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc differ -- cgit From b43d2c8eef88b48f2db6f118805a3f621a0a13d3 Mon Sep 17 00:00:00 2001 From: lucaszhao19 Date: Fri, 17 Jul 2020 21:30:55 +0630 Subject: Fixed ShortcutColumn --- DockWidgets/DockWidgetShortcutColumn.py | 39 +++++++++++++++++---- DockWidgets/DockWidgetShortcutColumn.ui | 34 ++++++++++++++++-- .../DockWidgetShortcutColumn.cpython-37.pyc | Bin 3364 -> 4160 bytes 3 files changed, 65 insertions(+), 8 deletions(-) (limited to 'DockWidgets') diff --git a/DockWidgets/DockWidgetShortcutColumn.py b/DockWidgets/DockWidgetShortcutColumn.py index af81441..fc5c34f 100644 --- a/DockWidgets/DockWidgetShortcutColumn.py +++ b/DockWidgets/DockWidgetShortcutColumn.py @@ -34,12 +34,13 @@ class DockWidgetShortcutColumn(QDockWidget,ui_dialog): print("input_params_list ", self.input_dict) self.l1.setText(self.obj.variables['HKey']['name']+":") + self.l2.setText(self.obj.variables['LKey']['name']+":") + print(self.obj.compounds) for i in self.obj.compounds: self.cb1.addItem(str(i)) self.cb2.addItem(str(i)) - self.l2.setText(self.obj.variables['LKey']['name']+":") self.l3.setText(self.obj.variables['HKey_x_pc']['name']+":") self.le3.setText(str(self.obj.variables['HKey_x_pc']['value'])) @@ -84,14 +85,40 @@ class DockWidgetShortcutColumn(QDockWidget,ui_dialog): except Exception as e: print(e) - @staticmethod def show_result(lst): - #DockWidget1.flag = True for i in lst: - i.resultsCategory(i.name) - #i.show() + try: + i.results_category(i.name) + except AttributeError: + pass # result data tab def results_category(self,name): - pass \ No newline at end of file + flag = True + try: + print("Under result category name ", name) + result=self.container.result + obj = self.container.fetch_object(name) + self.tableWidget.setRowCount(0) + variKeys = obj.result_parameters + print(variKeys) + for i, val in enumerate(variKeys): + propertyname = name + '.' + val + print(i,val, propertyname) + if propertyname in result[0]: + ind = result[0].index(propertyname) + resultval = str(result[-1][ind]) + obj.variables[val]['value']= result[-1][ind] + print("######Resultsfetch####",val,resultval) + rowPosition = self.tableWidget.rowCount() + self.tableWidget.insertRow(rowPosition) + self.tableWidget.setItem(rowPosition , 0, QTableWidgetItem(obj.variables[val]['name'])) + self.tableWidget.setItem(rowPosition , 1, QTableWidgetItem(resultval)) + self.tableWidget.setItem(rowPosition , 2, QTableWidgetItem(obj.variables[val]['unit'])) + self.tableWidget.resizeColumnsToContents() + + print(obj.variables) + + except Exception as e: + print(e) \ No newline at end of file diff --git a/DockWidgets/DockWidgetShortcutColumn.ui b/DockWidgets/DockWidgetShortcutColumn.ui index c66e699..47595ec 100644 --- a/DockWidgets/DockWidgetShortcutColumn.ui +++ b/DockWidgets/DockWidgetShortcutColumn.ui @@ -33,8 +33,8 @@ 10 40 - 351 - 321 + 381 + 611 @@ -287,6 +287,36 @@ Results + + + + + 3 + + + 110 + + + true + + + + Attribute + + + + + Value + + + + + Unit + + + + + diff --git a/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc index 1c34a04..560bdac 100644 Binary files a/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc differ -- cgit From 8b296f3d098669a6cb4f20511aaa3b42ac4510ba Mon Sep 17 00:00:00 2001 From: lucaszhao19 Date: Tue, 21 Jul 2020 22:02:16 +0630 Subject: Fixed updating Tooltip values from fetched results --- DockWidgets/DockWidget.py | 4 +++- DockWidgets/__pycache__/DockWidget.cpython-37.pyc | Bin 6155 -> 6155 bytes 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'DockWidgets') diff --git a/DockWidgets/DockWidget.py b/DockWidgets/DockWidget.py index 2b1cdb9..a32d125 100644 --- a/DockWidgets/DockWidget.py +++ b/DockWidgets/DockWidget.py @@ -218,4 +218,6 @@ class DockWidget(QDockWidget,ui_dialog): self.tableWidget.resizeColumnsToContents() except Exception as e: - print(e) \ No newline at end of file + print(e) + + \ No newline at end of file diff --git a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc index fec7953..81a4e00 100644 Binary files a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc differ -- cgit From d2cb7dadd3554586ccd0b88af7418b24877991e8 Mon Sep 17 00:00:00 2001 From: lucaszhao19 Date: Mon, 27 Jul 2020 21:08:14 +0630 Subject: Partially fixed DistillationColumn --- DockWidgets/DockWidgetDistillationColumn.py | 65 +++++++++++++++++---- DockWidgets/DockWidgetDistillationColumn.ui | 36 ++---------- .../DockWidgetDistillationColumn.cpython-37.pyc | Bin 4186 -> 4926 bytes 3 files changed, 61 insertions(+), 40 deletions(-) (limited to 'DockWidgets') diff --git a/DockWidgets/DockWidgetDistillationColumn.py b/DockWidgets/DockWidgetDistillationColumn.py index 65e9932..a3650e0 100644 --- a/DockWidgets/DockWidgetDistillationColumn.py +++ b/DockWidgets/DockWidgetDistillationColumn.py @@ -34,10 +34,20 @@ class DockWidgetDistillationColumn(QDockWidget,ui_dialog): print("input_params_list ", self.input_dict) # tab 1 - self.l1.setText(self.obj.variables['Nt']['name']+":") - self.le1.setText(str(self.obj.variables['Nt']['value'])) - self.l2.setText(self.obj.variables['In_s']['name']+":") - self.l3.setText(self.obj.variables['InT_s']['name']+":") + # self.l1.setText(self.obj.variables['Nt']['name']+":") + # self.le1.setText(str(self.obj.variables['Nt']['value'])) + # self.l2.setText(self.obj.variables['InT_s']['name']+":") + l1 = QLineEdit() + self.lay1.addWidget(QLabel(self.obj.variables['Nt']['name'] + " :"), 0 ,0, alignment=Qt.AlignLeft) + self.lay1.addWidget(l1,0,1, alignment=Qt.AlignCenter) + self.input_dict.append(l1) + + for i in range(self.obj.variables['Ni']['value']): + print(i) + l = QLineEdit() + self.lay1.addWidget(QLabel(self.obj.variables['InT_s']['name'] +" " + str(i+1) + " location :"),i+1,0, alignment=Qt.AlignLeft) + self.lay1.addWidget(l,i+1,1, alignment=Qt.AlignCenter) + self.input_dict.append(l) # tab 2 self.l4.setText(self.obj.variables['Ctype']['name']+":") @@ -55,8 +65,13 @@ class DockWidgetDistillationColumn(QDockWidget,ui_dialog): for j in self.obj.compounds: self.cb2.addItem(str(j)) self.cb2.setDisabled(True) - self.cb1.currentIndexChanged.connect(self.fun2) - + self.cb1.currentIndexChanged.connect(self.fun2) + + self.input_dict.append(self.cb5) + self.input_dict.append(self.le5) + self.input_dict.append(self.cb1) + self.input_dict.append(self.cb2) + self.input_dict.append(self.le6) # tab3 self.l8.setText(self.obj.variables['Preb']['name']+":") @@ -72,7 +87,12 @@ class DockWidgetDistillationColumn(QDockWidget,ui_dialog): self.cb4.setDisabled(True) self.cb3.currentIndexChanged.connect(self.fun3) - self.input_dict = [self.le1, self.le2, self.le3, self.cb5, self.le5, self.cb1, self.cb2, self.le6, self.le7, self.cb3, self.cb4, self.le8] + self.input_dict.append(self.le7) + self.input_dict.append(self.cb3) + self.input_dict.append(self.cb4) + self.input_dict.append(self.le8) + + # self.input_dict = [self.le1, self.le2, self.le3, self.cb5, self.le5, self.cb1, self.cb2, self.le6, self.le7, self.cb3, self.cb4, self.le8] except Exception as e: print(e) @@ -95,10 +115,35 @@ class DockWidgetDistillationColumn(QDockWidget,ui_dialog): def param(self): try: self.dict= [] + temp = 0 print("param.input_dict ", self.input_dict) - self.dict = [self.input_dict[0].text(),self.input_dict[1].text(), self.input_dict[2].text(), self.input_dict[3].currentText(), - self.input_dict[4].text(), self.input_dict[5].currentText(), self.input_dict[6].currentText(), self.input_dict[7].text(), - self.input_dict[8].text(), self.input_dict[9].currentText(), self.input_dict[10].currentText(), self.input_dict[11].text()] + self.dict.append(int(self.input_dict[0].text())) + + for i in range(self.obj.variables['Ni']['value']): + self.dict.append(int(self.input_dict[i+1].text())) + temp = i + 1 + print(temp) + + print(temp) + print(self.input_dict[temp+1]) + self.dict.append(self.input_dict[temp+1].currentText()) + print(temp+1) + self.dict.append(int(self.input_dict[temp+2].text())) + print(temp+2) + self.dict.append(self.input_dict[temp+3].currentText()) + print(temp+3) + self.dict.append(self.input_dict[temp+4].currentText()) + print(temp+4) + self.dict.append(int(self.input_dict[temp+5].text())) + print(temp+5) + self.dict.append(int(self.input_dict[temp+6].text())) + print(temp+6) + self.dict.append(self.input_dict[temp+7].currentText()) + print(temp+7) + self.dict.append(self.input_dict[temp+8].currentText()) + print(temp+8) + self.dict.append(int(self.input_dict[temp+9].text())) + print(temp+9) print("param ", self.dict) self.obj.param_setter(self.dict) diff --git a/DockWidgets/DockWidgetDistillationColumn.ui b/DockWidgets/DockWidgetDistillationColumn.ui index 0cb1043..e603071 100644 --- a/DockWidgets/DockWidgetDistillationColumn.ui +++ b/DockWidgets/DockWidgetDistillationColumn.ui @@ -78,36 +78,12 @@ - - - - TextLabel - - - - - - - - - - TextLabel - - - - - - - - - - TextLabel - - - - - - + + QLayout::SetDefaultConstraint + + + 0 + diff --git a/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc index e5f9002..e3b2d9e 100644 Binary files a/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc differ -- cgit From df3ccdd24766f725e11bf41495855b9cd974008f Mon Sep 17 00:00:00 2001 From: lucaszhao19 Date: Wed, 29 Jul 2020 21:09:26 +0630 Subject: Fixed single input Mixer issue --- DockWidgets/DockWidgetMixer.py | 2 +- .../__pycache__/DockWidgetMixer.cpython-37.pyc | Bin 2226 -> 2215 bytes 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'DockWidgets') diff --git a/DockWidgets/DockWidgetMixer.py b/DockWidgets/DockWidgetMixer.py index 01bfd48..804cdba 100644 --- a/DockWidgets/DockWidgetMixer.py +++ b/DockWidgets/DockWidgetMixer.py @@ -52,7 +52,7 @@ class DockWidgetMixer(QDockWidget,ui_dialog): try: self.dict={} print("param.input_dict ", self.input_dict) - self.dict = [int(self.input_dict[0].text()), '"' + self.input_dict[1].currentText() + '"'] + self.dict = [int(self.input_dict[0].text()), self.input_dict[1].currentText()] print("param ", self.dict) self.obj.param_setter(self.dict) self.hide() diff --git a/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc index ab2fad7..3ca772a 100644 Binary files a/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc differ -- cgit From 788b7f4bbb7aa51839c0836b1ab163fa831ce8fc Mon Sep 17 00:00:00 2001 From: lucaszhao19 Date: Thu, 30 Jul 2020 21:19:00 +0630 Subject: Fixed populating the wrong simulation results --- DockWidgets/DockWidget.py | 3 +++ DockWidgets/DockWidgetMaterialStream.py | 9 +++++++++ DockWidgets/DockWidgetShortcutColumn.py | 5 ++++- DockWidgets/__pycache__/DockWidget.cpython-37.pyc | Bin 6155 -> 6306 bytes .../DockWidgetMaterialStream.cpython-37.pyc | Bin 8853 -> 9112 bytes .../DockWidgetShortcutColumn.cpython-37.pyc | Bin 4160 -> 4325 bytes 6 files changed, 16 insertions(+), 1 deletion(-) (limited to 'DockWidgets') diff --git a/DockWidgets/DockWidget.py b/DockWidgets/DockWidget.py index a32d125..2087910 100644 --- a/DockWidgets/DockWidget.py +++ b/DockWidgets/DockWidget.py @@ -193,6 +193,9 @@ class DockWidget(QDockWidget,ui_dialog): except AttributeError: pass + def clear_results(self): + self.tableWidget.setRowCount(0) + # result data tab def results_category(self,name): flag = True diff --git a/DockWidgets/DockWidgetMaterialStream.py b/DockWidgets/DockWidgetMaterialStream.py index 130b290..f53e331 100644 --- a/DockWidgets/DockWidgetMaterialStream.py +++ b/DockWidgets/DockWidgetMaterialStream.py @@ -168,6 +168,15 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): i.results_category(i.name) #i.show() + + def clear_results(self): + self.mTreeWidget.clear() + self.mTableWidget.setRowCount(0) + self.lTreeWidget.clear() + self.lTableWidget.setRowCount(0) + self.vTreeWidget.clear() + self.vTableWidget.setRowCount(0) + # result data tab def results_category(self,name): flag = True diff --git a/DockWidgets/DockWidgetShortcutColumn.py b/DockWidgets/DockWidgetShortcutColumn.py index fc5c34f..f3a12b7 100644 --- a/DockWidgets/DockWidgetShortcutColumn.py +++ b/DockWidgets/DockWidgetShortcutColumn.py @@ -92,7 +92,10 @@ class DockWidgetShortcutColumn(QDockWidget,ui_dialog): i.results_category(i.name) except AttributeError: pass - + + def clear_results(self): + self.tableWidget.setRowCount(0) + # result data tab def results_category(self,name): flag = True diff --git a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc index 81a4e00..1f3821d 100644 Binary files a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc index 16bd08d..d592243 100644 Binary files a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc index 560bdac..3201c35 100644 Binary files a/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc differ -- cgit From 7a6921b773cf8879cc29c8eb6c0f6ca2a1da961e Mon Sep 17 00:00:00 2001 From: lucaszhao19 Date: Mon, 3 Aug 2020 20:45:29 +0630 Subject: Add Thermo Package for ShortcutColumn --- DockWidgets/DockWidgetShortcutColumn.py | 11 +- DockWidgets/DockWidgetShortcutColumn.ui | 187 ++++++++++++--------- .../DockWidgetShortcutColumn.cpython-37.pyc | Bin 4325 -> 4661 bytes 3 files changed, 120 insertions(+), 78 deletions(-) (limited to 'DockWidgets') diff --git a/DockWidgets/DockWidgetShortcutColumn.py b/DockWidgets/DockWidgetShortcutColumn.py index f3a12b7..409c051 100644 --- a/DockWidgets/DockWidgetShortcutColumn.py +++ b/DockWidgets/DockWidgetShortcutColumn.py @@ -63,7 +63,13 @@ class DockWidgetShortcutColumn(QDockWidget,ui_dialog): self.l8.setText(self.obj.variables['RR']['name']+":") self.le8.setText(str(self.obj.variables['RR']['value'])) - self.input_dict = [self.cb1, self.cb2, self.le3, self.le4, self.cb5, self.le6, self.le7, self.le8] + self.l9.setText("Thermo Package :") + + self.lines = [line.rstrip('\n') for line in open('thermopackage.txt')] + for j in self.lines: + self.cb6.addItem(str(j)) + + self.input_dict = [self.cb1, self.cb2, self.le3, self.le4, self.cb5, self.le6, self.le7, self.le8, self.cb6] except Exception as e: print(e) @@ -76,7 +82,8 @@ class DockWidgetShortcutColumn(QDockWidget,ui_dialog): self.dict=[] print("param.input_dict ", self.input_dict) self.dict = [self.input_dict[0].currentText(),self.input_dict[1].currentText(),float(self.input_dict[2].text()), float(self.input_dict[3].text()), - self.input_dict[4].currentText(), float(self.input_dict[5].text()), float(self.input_dict[6].text()), float(self.input_dict[7].text())] + self.input_dict[4].currentText(), float(self.input_dict[5].text()), float(self.input_dict[6].text()), float(self.input_dict[7].text()), + self.input_dict[8].currentText()] print("param ", self.dict) self.obj.param_setter(self.dict) diff --git a/DockWidgets/DockWidgetShortcutColumn.ui b/DockWidgets/DockWidgetShortcutColumn.ui index 47595ec..f79c27e 100644 --- a/DockWidgets/DockWidgetShortcutColumn.ui +++ b/DockWidgets/DockWidgetShortcutColumn.ui @@ -50,7 +50,7 @@ 8 13 331 - 237 + 261 @@ -65,8 +65,8 @@ - - + + 0 @@ -75,15 +75,18 @@ - - - - TextLabel + + + + + 0 + 0 + - - + + 0 @@ -95,21 +98,25 @@ - - + + + + TextLabel + + + + + - + 0 0 - - TextLabel - - - + + 0 @@ -121,15 +128,8 @@ - - - - TextLabel - - - - - + + 0 @@ -138,29 +138,25 @@ - - - - TextLabel - - - - - + + TextLabel - - - - TextLabel + + + + + 0 + 0 + - - + + 0 @@ -169,28 +165,25 @@ - - + + TextLabel - - + + - + 0 0 - - TextLabel - - - + + 0 @@ -199,18 +192,28 @@ - - + + + + TextLabel + + + + + - + 0 0 + + TextLabel + - - + + 0 @@ -222,40 +225,37 @@ - - + + - + 0 0 + + TextLabel + - - + + TextLabel - - - - - 0 - 0 - + + + + TextLabel - - - - - 0 - 0 - + + + + TextLabel @@ -267,7 +267,7 @@ 10 - 250 + 350 331 23 @@ -282,6 +282,41 @@ Submit + + + + 10 + 280 + 331 + 61 + + + + + 0 + 0 + + + + + + + + + + + + TextLabel + + + + + + + + + + diff --git a/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc index 3201c35..e1adb56 100644 Binary files a/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc differ -- cgit From f21a9a6ff969e4472100ee0f2ad498018700d935 Mon Sep 17 00:00:00 2001 From: lucaszhao19 Date: Mon, 3 Aug 2020 21:13:22 +0630 Subject: Update Thermo Package option for MaterialStream DockWidget --- DockWidgets/DockWidgetMaterialStream.py | 38 ++++++-------- DockWidgets/DockWidgetMaterialStream.ui | 57 ++++++++++++++++++--- .../DockWidgetMaterialStream.cpython-37.pyc | Bin 9112 -> 8936 bytes 3 files changed, 66 insertions(+), 29 deletions(-) (limited to 'DockWidgets') diff --git a/DockWidgets/DockWidgetMaterialStream.py b/DockWidgets/DockWidgetMaterialStream.py index f53e331..915bea3 100644 --- a/DockWidgets/DockWidgetMaterialStream.py +++ b/DockWidgets/DockWidgetMaterialStream.py @@ -64,20 +64,7 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): print("input_params_list ", self.input_dict) for c,i in enumerate(self.input_dict): - if(i=="thermo_package"): - print("thermo1") - combo = QComboBox() - self.lines = [line.rstrip('\n') for line in open('thermopackage.txt')] - print("thermo2") - for j in self.lines: - combo.addItem(str(j)) - lay = QGridLayout() - lay.addWidget(QLabel(i+":"), 0,0, alignment=Qt.AlignLeft) - lay.addWidget(combo, 0, 1, alignment=Qt.AlignRight) - self.formLayout.addRow(lay) - self.input_dict[i] = combo - print("thermo") - elif(i=="x_pc"): + if(i=="x_pc"): noc = len(compound_selected) print(noc) self.x_pclist.clear() @@ -111,6 +98,12 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): lay.addWidget(QLabel("mol/s"),0,2, alignment=Qt.AlignCenter) self.formLayout.addRow(lay) self.input_dict[i] = l + + self.lines = [line.rstrip('\n') for line in open('thermopackage.txt')] + for j in self.lines: + self.cbTP.addItem(str(j)) + self.input_dict['Thermo Package'] = self.cbTP + except Exception as e: print(e) @@ -123,13 +116,8 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): print("param.input_dict ", self.input_dict) for i in self.input_dict: - if(i=="thermo_package"): - if (self.input_dict[i].currentText()): - self.dict[i] = self.input_dict[i].currentText() - else: - self.show_error() - break - elif(i =="x_pc"): + print(i) + if(i =="x_pc"): l=[] mf = [] total_moles = 0 @@ -145,14 +133,18 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): self.obj.variables[compound_selected[c]]['value'] = str(float(l[c])/total_moles) self.x_pclist[c].setText(mf[-1]) self.dict[i] = ",".join(mf) + elif (i == "Thermo Package"): + self.dict[i] = self.input_dict[i].currentText() else: if (self.input_dict[i].text()): self.dict[i] = self.input_dict[i].text() else: - print(self.input_dict[i].text()) + print(self.input_dict[i]) self.show_error() break - + # print(self.input_dict[-1].currentText()) + # self.dict['Thermo Package'] = self.input_dict['Thermo Package'].currentText() + print("param ", self.dict) self.obj.param_setter(self.dict) self.hide() diff --git a/DockWidgets/DockWidgetMaterialStream.ui b/DockWidgets/DockWidgetMaterialStream.ui index 8995ba6..a442eee 100644 --- a/DockWidgets/DockWidgetMaterialStream.ui +++ b/DockWidgets/DockWidgetMaterialStream.ui @@ -98,7 +98,7 @@ 10 100 331 - 321 + 221 @@ -114,7 +114,7 @@ 10 - 430 + 390 331 21 @@ -123,6 +123,51 @@ Submit + + + + 10 + 330 + 331 + 51 + + + + + + + + + + + + + 0 + 0 + + + + Thermo Package + + + + + + + true + + + + 0 + 0 + + + + + + + + @@ -273,8 +318,8 @@ 0 0 - 335 - 494 + 151 + 128 @@ -362,8 +407,8 @@ 0 0 - 335 - 494 + 151 + 128 diff --git a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc index d592243..16511b3 100644 Binary files a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc differ -- cgit From 62b3c9106e1a3cadb1c570818ca7f1a86dffd914 Mon Sep 17 00:00:00 2001 From: lucaszhao19 Date: Wed, 5 Aug 2020 20:16:55 +0630 Subject: Added DockWidgetCompressorExpander --- DockWidgets/DockWidget.ui | 4 ++-- DockWidgets/DockWidgetMaterialStream.py | 6 +++--- .../DockWidgetMaterialStream.cpython-37.pyc | Bin 8936 -> 8485 bytes 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'DockWidgets') diff --git a/DockWidgets/DockWidget.ui b/DockWidgets/DockWidget.ui index 5851d71..ba6dc52 100644 --- a/DockWidgets/DockWidget.ui +++ b/DockWidgets/DockWidget.ui @@ -101,7 +101,7 @@ 10 100 331 - 321 + 271 @@ -117,7 +117,7 @@ 10 - 430 + 380 331 21 diff --git a/DockWidgets/DockWidgetMaterialStream.py b/DockWidgets/DockWidgetMaterialStream.py index 915bea3..ee57902 100644 --- a/DockWidgets/DockWidgetMaterialStream.py +++ b/DockWidgets/DockWidgetMaterialStream.py @@ -36,9 +36,9 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): self.lTreeWidget.setHeaderItem(header) self.vTreeWidget.setHeaderItem(header) - self.mTreeWidget.itemClicked.connect(lambda : self.printer(self.mTreeWidget.currentItem())) - self.lTreeWidget.itemClicked.connect(lambda : self.printer(self.lTreeWidget.currentItem())) - self.vTreeWidget.itemClicked.connect(lambda : self.printer(self.vTreeWidget.currentItem())) + # self.mTreeWidget.itemClicked.connect(lambda : self.printer(self.mTreeWidget.currentItem())) + # self.lTreeWidget.itemClicked.connect(lambda : self.printer(self.lTreeWidget.currentItem())) + # self.vTreeWidget.itemClicked.connect(lambda : self.printer(self.vTreeWidget.currentItem())) # input data tab def modes(self): diff --git a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc index 16511b3..ddd011b 100644 Binary files a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc differ -- cgit From 76e58a6e14de583ab9d6694aeef9af215972649a Mon Sep 17 00:00:00 2001 From: lucaszhao19 Date: Wed, 5 Aug 2020 20:41:35 +0630 Subject: Remove unnecessary codes from DockWidget.py --- DockWidgets/DockWidget.py | 110 +++------------------- DockWidgets/__pycache__/DockWidget.cpython-37.pyc | Bin 6306 -> 4323 bytes 2 files changed, 11 insertions(+), 99 deletions(-) (limited to 'DockWidgets') diff --git a/DockWidgets/DockWidget.py b/DockWidgets/DockWidget.py index 2087910..d6813ee 100644 --- a/DockWidgets/DockWidget.py +++ b/DockWidgets/DockWidget.py @@ -2,10 +2,7 @@ from PyQt5.QtCore import * from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.uic import loadUiType -import pandas as pd -from functools import partial from ComponentSelector import * -from collections import defaultdict from Graphics import * ui_dialog,_ = loadUiType('DockWidgets/DockWidget.ui') @@ -20,15 +17,13 @@ class DockWidget(QDockWidget,ui_dialog): self.obj=obj self.type = comptype self.input_dict = {} - self.x_pclist = [] self.modes() self.comboBox.currentIndexChanged.connect(self.mode_selection) print("constructor ", self.input_dict) self.pushButton_2.clicked.connect(self.param) - self.dict = {} - self.name_type = None + self.dict = {} self.container = container # input data tab @@ -61,72 +56,18 @@ class DockWidget(QDockWidget,ui_dialog): try: print("input_params_list ", self.input_dict) for c,i in enumerate(self.input_dict): + print(i) if i == None: continue - if(i=="thermo_package"): - print("thermo1") - combo = QComboBox() - self.lines = [line.rstrip('\n') for line in open('thermopackage.txt')] - print("thermo2") - for j in self.lines: - combo.addItem(str(j)) - combo.setMinimumContentsLength(15) - lay = QGridLayout() - lay.addWidget(QLabel(i+":"), 0,0, alignment=Qt.AlignLeft) - lay.addWidget(combo, 0, 1, alignment=Qt.AlignCenter) - lay.addWidget(QLabel(''), 0, 2, alignment = Qt.AlignCenter) - self.formLayout.addRow(lay) - self.input_dict[i] = combo - print("thermo") - elif(i=="Ctype"): - combo = QComboBox() - self.lines = ["Total","Partial"] - for j in self.lines: - combo.addItem(str(j)) - combo.setMinimumContentsLength(15) - lay = QGridLayout() - lay.addWidget(QLabel("Condensor Type :"), 0, 0, alignment=Qt.AlignLeft) - lay.addWidget(combo, 0, 1, alignment=Qt.AlignCenter) - lay.addWidget(QLabel(''), 0, 2, alignment = Qt.AlignCenter) - self.formLayout.addRow(lay) - self.input_dict[i] = combo - elif(i=="x_pc"): - noc = len(compound_selected) - print(noc) - self.x_pclist.clear() - gp = QGroupBox("Compounds") - lay = QGridLayout() - for j in range(noc): - l = QLineEdit() - self.input_dict[i] = "x_pc" - lay.addWidget(QLabel(str(compound_selected[j])+":"),j,0, alignment=Qt.AlignLeft) - lay.addWidget(l,j,1, alignment=Qt.AlignCenter) - lay.addWidget(QLabel(self.obj.variables[i]['unit']),j,2, alignment=Qt.AlignCenter) - self.x_pclist.append(l) - gp.setLayout(lay) - self.formLayout.addRow(gp) - else: - print("elseloop") - print(i) - if i == None: - continue - l = QLineEdit() - if self.input_dict[i] != None: - l.setText(str(self.input_dict[i])) - print('before lay') - lay = QGridLayout() - lay.addWidget(QLabel(self.obj.variables[i]['name']+":"),0,0, alignment=Qt.AlignLeft) #self.obj.variables[i]['name'] - lay.addWidget(l,0,1, alignment=Qt.AlignCenter) - print('after lay') - if(i != 'MolFlow'): - lay.addWidget(QLabel(self.obj.variables[i]['unit']),0,2, alignment=Qt.AlignCenter) - else: - lay.addWidget(QLabel('mol/s'),0,2, alignment=Qt.AlignCenter) - print('after all') - self.formLayout.addRow(lay) - self.input_dict[i] = l - - + l = QLineEdit() + if self.input_dict[i] != None: + l.setText(str(self.input_dict[i])) + lay = QGridLayout() + lay.addWidget(QLabel(self.obj.variables[i]['name']+":"),0,0, alignment=Qt.AlignLeft) + lay.addWidget(l,0,1, alignment=Qt.AlignCenter) + lay.addWidget(QLabel(self.obj.variables[i]['unit']),0,2, alignment=Qt.AlignCenter) + self.formLayout.addRow(lay) + self.input_dict[i] = l except Exception as e: print(e) @@ -140,35 +81,6 @@ class DockWidget(QDockWidget,ui_dialog): for i in self.input_dict: if (self.input_dict[i] == None): continue - if(i=="thermo_package"): - if (self.input_dict[i].currentText()): - self.dict[i] = self.input_dict[i].currentText() - else: - self.show_error() - break - elif(i=="Ctype"): - if (self.input_dict[i].currentText()): - self.dict[i] = self.input_dict[i].currentText() - else: - self.show_error() - break - elif(i =="x_pc"): - l=[] - mf = [] - total_moles = 0 - for mol_frac in self.x_pclist: - if (mol_frac.text()): - l.append(mol_frac.text()) - total_moles += float(l[-1]) - else: - self.show_error() - break - for c in range(len(compound_selected)): - mf.append(str(float(l[c])/total_moles)) - self.x_pclist[c].setText(mf[-1]) - self.dict[i] = ",".join(mf) - elif(i == 'Pout' and self.obj.type == 'Mixer' or i == '' or i == 'HKey' or i == 'LKey'): - self.dict[i] = self.input_dict[i].currentText() else: print(self.input_dict[i], i, self.obj.type) if (self.input_dict[i].text()): diff --git a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc index 1f3821d..431c298 100644 Binary files a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc differ -- cgit From 37a360da5346302eb881071f7db2fe7159f8e643 Mon Sep 17 00:00:00 2001 From: lucaszhao19 Date: Wed, 5 Aug 2020 21:07:37 +0630 Subject: Remove unnecessary codes from all dock widgets --- DockWidgets/DockWidget.py | 4 ++-- DockWidgets/DockWidgetCompoundSeparator.py | 7 ------- DockWidgets/DockWidgetDistillationColumn.py | 5 +---- DockWidgets/DockWidgetFlash.py | 12 +++--------- DockWidgets/DockWidgetMaterialStream.py | 23 ++--------------------- DockWidgets/DockWidgetMixer.py | 12 +----------- DockWidgets/DockWidgetShortcutColumn.py | 17 ++--------------- DockWidgets/DockWidgetSplitter.py | 13 +------------ 8 files changed, 12 insertions(+), 81 deletions(-) (limited to 'DockWidgets') diff --git a/DockWidgets/DockWidget.py b/DockWidgets/DockWidget.py index d6813ee..b3845bb 100644 --- a/DockWidgets/DockWidget.py +++ b/DockWidgets/DockWidget.py @@ -23,7 +23,7 @@ class DockWidget(QDockWidget,ui_dialog): print("constructor ", self.input_dict) self.pushButton_2.clicked.connect(self.param) - self.dict = {} + self.dict = {} # a dictionary self.container = container # input data tab @@ -76,7 +76,7 @@ class DockWidget(QDockWidget,ui_dialog): def param(self): try: - self.dict={} + self.dict = {} print("param.input_dict ", self.input_dict) for i in self.input_dict: if (self.input_dict[i] == None): diff --git a/DockWidgets/DockWidgetCompoundSeparator.py b/DockWidgets/DockWidgetCompoundSeparator.py index 1818290..6de61a5 100644 --- a/DockWidgets/DockWidgetCompoundSeparator.py +++ b/DockWidgets/DockWidgetCompoundSeparator.py @@ -21,18 +21,13 @@ class DockWidgetCompoundSeparator(QDockWidget,ui_dialog): self.type = comptype self.input_dict = [] - print("constructor ", self.input_dict) self.input_params_list() self.dict = [] def input_params_list(self): try: - print("input_params_list ", self.input_dict) if self.type == 'CompoundSeparator': - - # self.gridLayout = QGridLayout() calculationGroupBox = QGroupBox('Calculation Parameters') - calculationLayout = QGridLayout() r1 = QRadioButton('Stream 1') @@ -81,7 +76,6 @@ class DockWidgetCompoundSeparator(QDockWidget,ui_dialog): def param(self): try: self.dict=[] - print("param.input_dict ", self.input_dict) self.dict = [self.input_dict[0].isChecked(), self.input_dict[1].isChecked()] j = 2 @@ -91,7 +85,6 @@ class DockWidgetCompoundSeparator(QDockWidget,ui_dialog): self.dict.append(self.input_dict[j+i+1].text()) j += 1 - print("param ", self.dict) self.obj.param_setter(self.dict) self.hide() diff --git a/DockWidgets/DockWidgetDistillationColumn.py b/DockWidgets/DockWidgetDistillationColumn.py index a3650e0..3255015 100644 --- a/DockWidgets/DockWidgetDistillationColumn.py +++ b/DockWidgets/DockWidgetDistillationColumn.py @@ -20,7 +20,6 @@ class DockWidgetDistillationColumn(QDockWidget,ui_dialog): self.obj=obj self.type = comptype self.input_dict = [] - print("constructor ", self.input_dict) self.pushButton_2.clicked.connect(self.param) self.dict = [] self.input_params_list() @@ -34,9 +33,7 @@ class DockWidgetDistillationColumn(QDockWidget,ui_dialog): print("input_params_list ", self.input_dict) # tab 1 - # self.l1.setText(self.obj.variables['Nt']['name']+":") - # self.le1.setText(str(self.obj.variables['Nt']['value'])) - # self.l2.setText(self.obj.variables['InT_s']['name']+":") + l1 = QLineEdit() self.lay1.addWidget(QLabel(self.obj.variables['Nt']['name'] + " :"), 0 ,0, alignment=Qt.AlignLeft) self.lay1.addWidget(l1,0,1, alignment=Qt.AlignCenter) diff --git a/DockWidgets/DockWidgetFlash.py b/DockWidgets/DockWidgetFlash.py index 1634169..4e1c5e3 100644 --- a/DockWidgets/DockWidgetFlash.py +++ b/DockWidgets/DockWidgetFlash.py @@ -2,10 +2,7 @@ from PyQt5.QtCore import * from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.uic import loadUiType -import pandas as pd -from functools import partial from ComponentSelector import * -from collections import defaultdict from Graphics import * ui_dialog,_ = loadUiType('DockWidgets/DockWidgetFlash.ui') @@ -20,15 +17,12 @@ class DockWidgetFlash(QDockWidget,ui_dialog): self.obj=obj self.type = comptype self.input_dict = [] - print("constructor ", self.input_dict) self.input_params_list() self.btn.clicked.connect(self.param) - self.dict = [] + self.dict = [] # a list def input_params_list(self): - try: - print("input_params_list ", self.input_dict) - + try: self.l1.setText(self.obj.variables['thermo_package']['name']+":") self.lines = [line.rstrip('\n') for line in open('thermopackage.txt')] for j in self.lines: @@ -63,7 +57,7 @@ class DockWidgetFlash(QDockWidget,ui_dialog): def param(self): try: - self.dict={} + self.dict = [] print("param.input_dict ", self.input_dict) self.dict = [self.input_dict[0].currentText(),self.input_dict[1].isChecked(), float(self.input_dict[2].text()), self.input_dict[3].isChecked(), float(self.input_dict[4].text())] print("param ", self.dict) diff --git a/DockWidgets/DockWidgetMaterialStream.py b/DockWidgets/DockWidgetMaterialStream.py index ee57902..a661362 100644 --- a/DockWidgets/DockWidgetMaterialStream.py +++ b/DockWidgets/DockWidgetMaterialStream.py @@ -2,10 +2,7 @@ from PyQt5.QtCore import * from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.uic import loadUiType -import pandas as pd -from functools import partial from ComponentSelector import * -from collections import defaultdict from Graphics import * ui_dialog,_ = loadUiType('DockWidgets/DockWidgetMaterialStream.ui') @@ -24,9 +21,8 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): self.modes() self.comboBox.currentIndexChanged.connect(self.mode_selection) - print("constructor ", self.input_dict) self.pushButton_2.clicked.connect(self.param) - self.dict = {} + self.dict = {} # a dictionary self.name_type = None self.container = container @@ -36,10 +32,6 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): self.lTreeWidget.setHeaderItem(header) self.vTreeWidget.setHeaderItem(header) - # self.mTreeWidget.itemClicked.connect(lambda : self.printer(self.mTreeWidget.currentItem())) - # self.lTreeWidget.itemClicked.connect(lambda : self.printer(self.lTreeWidget.currentItem())) - # self.vTreeWidget.itemClicked.connect(lambda : self.printer(self.vTreeWidget.currentItem())) - # input data tab def modes(self): modes_list = self.obj.modes_list @@ -60,9 +52,7 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): self.input_params_list() def input_params_list(self): - try: - print("input_params_list ", self.input_dict) - + try: for c,i in enumerate(self.input_dict): if(i=="x_pc"): noc = len(compound_selected) @@ -113,7 +103,6 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): def param(self): try: self.dict={} - print("param.input_dict ", self.input_dict) for i in self.input_dict: print(i) @@ -142,8 +131,6 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): print(self.input_dict[i]) self.show_error() break - # print(self.input_dict[-1].currentText()) - # self.dict['Thermo Package'] = self.input_dict['Thermo Package'].currentText() print("param ", self.dict) self.obj.param_setter(self.dict) @@ -152,14 +139,10 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): except Exception as e: print(e) - @staticmethod def show_result(lst): - #DockWidget1.flag = True for i in lst: i.results_category(i.name) - #i.show() - def clear_results(self): self.mTreeWidget.clear() @@ -243,7 +226,6 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): child = QTreeWidgetItem(vroot, [compound_selected[t], str(resultval),obj.variables[k.split('.')[1]]['unit']]) t += 1 flag = False - #print(obj.variables) # Phase Properties Tab phaseResLst = [] @@ -295,7 +277,6 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): self.vTableWidget.setItem(vrowPosition , 2, QTableWidgetItem(obj.variables[val.split('.')[1]]['unit'])) self.vTableWidget.resizeColumnsToContents() if not '[' in val: - #print(p[val.split('.')[1]]) print(obj.variables[val.split('.')[1]]['name']) mrowPosition = self.mTableWidget.rowCount() self.mTableWidget.insertRow(mrowPosition) diff --git a/DockWidgets/DockWidgetMixer.py b/DockWidgets/DockWidgetMixer.py index 804cdba..6c46c39 100644 --- a/DockWidgets/DockWidgetMixer.py +++ b/DockWidgets/DockWidgetMixer.py @@ -2,10 +2,7 @@ from PyQt5.QtCore import * from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.uic import loadUiType -import pandas as pd -from functools import partial from ComponentSelector import * -from collections import defaultdict from Graphics import * ui_dialog,_ = loadUiType('DockWidgets/DockWidgetMixer.ui') @@ -21,16 +18,13 @@ class DockWidgetMixer(QDockWidget,ui_dialog): self.type = comptype self.input_dict = [] self.x_pclist = [] - print("constructor ", self.input_dict) self.input_params_list() self.btn.clicked.connect(self.param) self.dict = {} # input data tab def input_params_list(self): - try: - print("input_params_list ", self.input_dict) - + try: self.l1.setText(self.obj.variables['NI']['name']+":") self.le1.setText(str(self.obj.variables['NI']['value'])) self.u1.setText(self.obj.variables['NI']['unit']) @@ -38,8 +32,6 @@ class DockWidgetMixer(QDockWidget,ui_dialog): self.cb2.addItem(str(i)) self.l2.setText(self.obj.variables['outPress']['name']+":") - - self.input_dict = [self.le1, self.cb2] except Exception as e: @@ -51,9 +43,7 @@ class DockWidgetMixer(QDockWidget,ui_dialog): def param(self): try: self.dict={} - print("param.input_dict ", self.input_dict) self.dict = [int(self.input_dict[0].text()), self.input_dict[1].currentText()] - print("param ", self.dict) self.obj.param_setter(self.dict) self.hide() diff --git a/DockWidgets/DockWidgetShortcutColumn.py b/DockWidgets/DockWidgetShortcutColumn.py index 409c051..2b7dfae 100644 --- a/DockWidgets/DockWidgetShortcutColumn.py +++ b/DockWidgets/DockWidgetShortcutColumn.py @@ -2,10 +2,7 @@ from PyQt5.QtCore import * from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.uic import loadUiType -import pandas as pd -from functools import partial from ComponentSelector import * -from collections import defaultdict from Graphics import * ui_dialog,_ = loadUiType('DockWidgets/DockWidgetShortcutColumn.ui') @@ -20,7 +17,6 @@ class DockWidgetShortcutColumn(QDockWidget,ui_dialog): self.obj=obj self.type = comptype self.input_dict = [] - print("constructor ", self.input_dict) self.input_params_list() self.btn.clicked.connect(self.param) self.dict = [] @@ -30,9 +26,7 @@ class DockWidgetShortcutColumn(QDockWidget,ui_dialog): # input data tab def input_params_list(self): - try: - print("input_params_list ", self.input_dict) - + try: self.l1.setText(self.obj.variables['HKey']['name']+":") self.l2.setText(self.obj.variables['LKey']['name']+":") @@ -41,7 +35,6 @@ class DockWidgetShortcutColumn(QDockWidget,ui_dialog): self.cb1.addItem(str(i)) self.cb2.addItem(str(i)) - self.l3.setText(self.obj.variables['HKey_x_pc']['name']+":") self.le3.setText(str(self.obj.variables['HKey_x_pc']['value'])) self.u3.setText(self.obj.variables['HKey_x_pc']['unit']) @@ -80,12 +73,9 @@ class DockWidgetShortcutColumn(QDockWidget,ui_dialog): def param(self): try: self.dict=[] - print("param.input_dict ", self.input_dict) self.dict = [self.input_dict[0].currentText(),self.input_dict[1].currentText(),float(self.input_dict[2].text()), float(self.input_dict[3].text()), self.input_dict[4].currentText(), float(self.input_dict[5].text()), float(self.input_dict[6].text()), float(self.input_dict[7].text()), - self.input_dict[8].currentText()] - - print("param ", self.dict) + self.input_dict[8].currentText()] self.obj.param_setter(self.dict) self.hide() @@ -127,8 +117,5 @@ class DockWidgetShortcutColumn(QDockWidget,ui_dialog): self.tableWidget.setItem(rowPosition , 1, QTableWidgetItem(resultval)) self.tableWidget.setItem(rowPosition , 2, QTableWidgetItem(obj.variables[val]['unit'])) self.tableWidget.resizeColumnsToContents() - - print(obj.variables) - except Exception as e: print(e) \ No newline at end of file diff --git a/DockWidgets/DockWidgetSplitter.py b/DockWidgets/DockWidgetSplitter.py index c1c0120..303d166 100644 --- a/DockWidgets/DockWidgetSplitter.py +++ b/DockWidgets/DockWidgetSplitter.py @@ -2,10 +2,7 @@ from PyQt5.QtCore import * from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.uic import loadUiType -import pandas as pd -from functools import partial from ComponentSelector import * -from collections import defaultdict from Graphics import * ui_dialog,_ = loadUiType('DockWidgets/DockWidgetSplitter.ui') @@ -20,23 +17,19 @@ class DockWidgetSplitter(QDockWidget,ui_dialog): self.obj=obj self.type = comptype self.input_dict = [] - print("constructor ", self.input_dict) self.input_params_list() self.btn.clicked.connect(self.param) self.dict = {} # input data tab def input_params_list(self): - try: - print("input_params_list ", self.input_dict) - + try: self.l1.setText(self.obj.variables['No']['name']+":") self.le1.setText(str(self.obj.variables['No']['value'])) self.u1.setText(self.obj.variables['No']['unit']) for i in self.obj.CalcType_modes: self.cb2.addItem(str(i)) - self.l2.setText(self.obj.variables['CalcType']['name']+":") self.l3.setText("Stream 1 :") @@ -45,7 +38,6 @@ class DockWidgetSplitter(QDockWidget,ui_dialog): self.u4.setText('') self.cb2.currentIndexChanged.connect(self.fun) - self.input_dict = [self.le1, self.cb2, self.le3, self.le4] except Exception as e: @@ -68,11 +60,8 @@ class DockWidgetSplitter(QDockWidget,ui_dialog): def param(self): try: self.dict={} - print("param.input_dict ", self.input_dict) self.dict = [int(self.input_dict[0].text()),self.input_dict[1].currentText(), float(self.input_dict[2].text()), float(self.input_dict[3].text())] - print("param ", self.dict) self.obj.param_setter(self.dict) self.hide() - except Exception as e: print(e) -- cgit From 4babc3c0fb44e9dc0332e4d0da9bd12ab67b3c57 Mon Sep 17 00:00:00 2001 From: lucaszhao19 Date: Fri, 7 Aug 2020 21:10:13 +0630 Subject: Clean unnecessary codes from Graphics.py, Container.py and Streams.py --- DockWidgets/__pycache__/DockWidget.cpython-37.pyc | Bin 4323 -> 4323 bytes .../DockWidgetCompoundSeparator.cpython-37.pyc | Bin 3169 -> 3047 bytes .../DockWidgetDistillationColumn.cpython-37.pyc | Bin 4926 -> 4893 bytes .../__pycache__/DockWidgetFlash.cpython-37.pyc | Bin 2896 -> 2719 bytes .../DockWidgetMaterialStream.cpython-37.pyc | Bin 8485 -> 8308 bytes .../__pycache__/DockWidgetMixer.cpython-37.pyc | Bin 2215 -> 1983 bytes .../DockWidgetShortcutColumn.cpython-37.pyc | Bin 4661 -> 4417 bytes .../__pycache__/DockWidgetSplitter.cpython-37.pyc | Bin 2733 -> 2501 bytes 8 files changed, 0 insertions(+), 0 deletions(-) (limited to 'DockWidgets') diff --git a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc index 431c298..86045c1 100644 Binary files a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc index ecad97b..08716b1 100644 Binary files a/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc index e3b2d9e..55be9b4 100644 Binary files a/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc index 3054328..6828ab1 100644 Binary files a/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc index ddd011b..a8c9f80 100644 Binary files a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc index 3ca772a..460aa1b 100644 Binary files a/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc index e1adb56..13f8328 100644 Binary files a/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc index bcd36dc..fea33a2 100644 Binary files a/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc differ -- cgit From 4cffaf3d0d29ee1f2d31601dd1571c7de40a8c5f Mon Sep 17 00:00:00 2001 From: lucaszhao19 Date: Tue, 11 Aug 2020 20:06:51 +0630 Subject: Added Adiabatic Expander and Compressor DockWidgets --- DockWidgets/DockWidgetCompressorExpander.py | 146 +++++++++++++++++++ DockWidgets/DockWidgetCompressorExpander.ui | 214 ++++++++++++++++++++++++++++ 2 files changed, 360 insertions(+) create mode 100644 DockWidgets/DockWidgetCompressorExpander.py create mode 100644 DockWidgets/DockWidgetCompressorExpander.ui (limited to 'DockWidgets') diff --git a/DockWidgets/DockWidgetCompressorExpander.py b/DockWidgets/DockWidgetCompressorExpander.py new file mode 100644 index 0000000..841b850 --- /dev/null +++ b/DockWidgets/DockWidgetCompressorExpander.py @@ -0,0 +1,146 @@ +from PyQt5.QtCore import * +from PyQt5.QtWidgets import * +from PyQt5.QtGui import * +from PyQt5.uic import loadUiType +from ComponentSelector import * +from Graphics import * + +ui_dialog,_ = loadUiType('DockWidgets/DockWidgetCompressorExpander.ui') + +class DockWidgetCompressorExpander(QDockWidget,ui_dialog): + + def __init__(self,name,comptype,obj,container, parent=None): + QDockWidget.__init__(self,parent) + self.setupUi(self) + self.setWindowTitle(obj.name) + self.name=name + self.obj=obj + self.type = comptype + self.input_dict = {} + self.x_pclist = [] + self.modes() + self.comboBox.currentIndexChanged.connect(self.mode_selection) + + self.pushButton_2.clicked.connect(self.param) + self.dict = {} + + self.name_type = None + self.container = container + + # input data tab + def modes(self): + modes_list = self.obj.modes_list + if(modes_list): + for j in modes_list: + self.comboBox.addItem(str(self.obj.variables[j]['name'])) + self.mode_selection() + else: + self.comboBox.setDisabled(True) + self.input_dict= {} + self.input_dict = self.obj.param_getter() + self.input_params_list() + + def mode_selection(self): + self.input_dict= {} + for i in reversed(range(self.formLayout.count())): + self.formLayout.removeRow(i) + print(self.comboBox.currentText()) + for i in self.obj.variables: + if self.obj.variables[i]['name'] == self.comboBox.currentText(): + currentText = i + break + self.input_dict = self.obj.param_getter(currentText) + print('mode selection ', self.input_dict) + self.input_params_list() + + def input_params_list(self): + try: + print("input_params_list ", self.input_dict) + for c,i in enumerate(self.input_dict): + if i == None: + continue + + l = QLineEdit() + if self.input_dict[i] != None: + l.setText(str(self.input_dict[i])) + lay = QGridLayout() + lay.addWidget(QLabel(self.obj.variables[i]['name']+":"),0,0, alignment=Qt.AlignLeft) + lay.addWidget(l,0,1, alignment=Qt.AlignCenter) + lay.addWidget(QLabel(self.obj.variables[i]['unit']),0,2, alignment=Qt.AlignCenter) + + self.formLayout.addRow(lay) + self.input_dict[i] = l + + self.lines = [line.rstrip('\n') for line in open('thermopackage.txt')] + for j in self.lines: + self.cbTP.addItem(str(j)) + self.input_dict['Thermo Package'] = self.cbTP + + except Exception as e: + print(e) + + def show_error(self): + QMessageBox.about(self, 'Important', "Please fill all fields with data") + + def param(self): + try: + self.dict={} + for i in self.input_dict: + if (self.input_dict[i] == None): + continue + elif (i == "Thermo Package"): + self.dict[i] = self.input_dict[i].currentText() + else: + print(self.input_dict[i], i, self.obj.type) + if (self.input_dict[i].text()): + self.dict[i] = self.input_dict[i].text() + else: + print(self.input_dict[i].text()) + self.show_error() + break + + self.obj.param_setter(self.dict) + self.hide() + + except Exception as e: + print(e) + + @staticmethod + def show_result(lst): + for i in lst: + try: + i.results_category(i.name) + except AttributeError: + pass + + def clear_results(self): + self.tableWidget.setRowCount(0) + + # result data tab + def results_category(self,name): + flag = True + try: + print("Under result category name ", name) + result=self.container.result + obj = self.container.fetch_object(name) + self.tableWidget.setRowCount(0) + variKeys = list(obj.variables.keys()) + print(variKeys) + for i, val in enumerate(variKeys): + propertyname = name + '.' + val + print(i,val, propertyname) + if propertyname in result[0]: + ind = result[0].index(propertyname) + resultval = str(result[-1][ind]) + print("######Resultsfetch####",val,resultval) + rowPosition = self.tableWidget.rowCount() + self.tableWidget.insertRow(rowPosition) + self.tableWidget.setItem(rowPosition , 0, QTableWidgetItem(obj.variables[val]['name'])) + self.tableWidget.setItem(rowPosition , 1, QTableWidgetItem(resultval)) + self.tableWidget.setItem(rowPosition , 2, QTableWidgetItem(obj.variables[val]['unit'])) + self.tableWidget.resizeColumnsToContents() + + except Exception as e: + print(e) + + \ No newline at end of file diff --git a/DockWidgets/DockWidgetCompressorExpander.ui b/DockWidgets/DockWidgetCompressorExpander.ui new file mode 100644 index 0000000..372fc0b --- /dev/null +++ b/DockWidgets/DockWidgetCompressorExpander.ui @@ -0,0 +1,214 @@ + + + Form + + + true + + + + 0 + 0 + 392 + 700 + + + + + 0 + 0 + + + + + 3200 + 5000 + + + + Form + + + false + + + + + 10 + 30 + 361 + 621 + + + + false + + + 0 + + + + Input Data + + + + + 9 + 9 + 331 + 71 + + + + Mode Selection + + + + + + + + + 0 + 0 + + + + Mode : + + + + + + + true + + + + 0 + 0 + + + + + + + + + + + + 10 + 100 + 331 + 111 + + + + Parameter Selection + + + + + + + + + + + 10 + 280 + 331 + 21 + + + + Submit + + + + + + 10 + 220 + 331 + 51 + + + + + + + + + + + + + 0 + 0 + + + + Thermo Package + + + + + + + true + + + + 0 + 0 + + + + + + + + + + + + Results + + + + + + 3 + + + 110 + + + true + + + + Attribute + + + + + Value + + + + + Unit + + + + + + + + + + + -- cgit