diff options
author | pravindalve | 2023-01-27 01:41:16 +0530 |
---|---|---|
committer | GitHub | 2023-01-27 01:41:16 +0530 |
commit | e10e1eebbf6927d5548ccb7bbb6563994cee0c35 (patch) | |
tree | 17cc1ae47d6151bbaf7d4761370e74909f21fe08 /DockWidgets | |
parent | 2bae254bfdb89e554a4f10c35a45011069376ac6 (diff) | |
parent | 9a90a5af1f7e57b25675416f7d90b1b62515a5a3 (diff) | |
download | Chemical-Simulator-GUI-e10e1eebbf6927d5548ccb7bbb6563994cee0c35.tar.gz Chemical-Simulator-GUI-e10e1eebbf6927d5548ccb7bbb6563994cee0c35.tar.bz2 Chemical-Simulator-GUI-e10e1eebbf6927d5548ccb7bbb6563994cee0c35.zip |
Merge pull request #42 from brenda-br/Fix-35
Fix -34, 38, 35, 43, 36
Diffstat (limited to 'DockWidgets')
-rw-r--r-- | DockWidgets/DockWidget.py | 7 | ||||
-rw-r--r-- | DockWidgets/DockWidgetCompoundSeparator.py | 60 | ||||
-rw-r--r-- | DockWidgets/DockWidgetCompressorExpander.py | 8 | ||||
-rw-r--r-- | DockWidgets/DockWidgetMaterialStream.py | 9 | ||||
-rw-r--r-- | DockWidgets/__pycache__/DockWidget.cpython-37.pyc | bin | 4730 -> 4849 bytes | |||
-rw-r--r-- | DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc | bin | 3614 -> 4104 bytes | |||
-rw-r--r-- | DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc | bin | 8986 -> 9127 bytes |
7 files changed, 64 insertions, 20 deletions
diff --git a/DockWidgets/DockWidget.py b/DockWidgets/DockWidget.py index e7e5b8b..cc222db 100644 --- a/DockWidgets/DockWidget.py +++ b/DockWidgets/DockWidget.py @@ -92,6 +92,13 @@ class DockWidget(QDockWidget,ui_dialog): print("param ", self.dict) self.obj.param_setter(self.dict) + for i in self.container.graphics.graphicsView.items(): + try: + if(i.name == self.name): + i.update_tooltip() + except: + pass + self.hide() except Exception as e: diff --git a/DockWidgets/DockWidgetCompoundSeparator.py b/DockWidgets/DockWidgetCompoundSeparator.py index 69b2770..8fcee39 100644 --- a/DockWidgets/DockWidgetCompoundSeparator.py +++ b/DockWidgets/DockWidgetCompoundSeparator.py @@ -20,15 +20,16 @@ class DockWidgetCompoundSeparator(QDockWidget,ui_dialog): self.obj=obj self.type = comptype self.input_dict = [] - + self.lst = [] self.input_params_list() self.dict = [] def input_params_list(self): try: if self.type == 'CompoundSeparator': - calculationGroupBox = QGroupBox('Calculation Parameters') - calculationLayout = QGridLayout() + self.lst.clear() + self.calculationGroupBox = QGroupBox('Calculation Parameters') + self.calculationLayout = QGridLayout() r1 = QRadioButton('Stream 1') r1.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) @@ -42,37 +43,37 @@ class DockWidgetCompoundSeparator(QDockWidget,ui_dialog): r2.setChecked(True) - lst = [r1, r2] - calculationLayout.addWidget(r1, 0, 1) - calculationLayout.addWidget(r2, 0, 2) + self.lst = [r1, r2] + self.calculationLayout.addWidget(r1, 0, 1) + self.calculationLayout.addWidget(r2, 0, 2) for k,val in enumerate(self.obj.compounds): combo = QComboBox() - print("CompoundSeparator combo") + #print("CompoundSeparator combo") for j in self.obj.SepFact_modes: combo.addItem(str(j)) - print(self.obj.variables['SepFact_c']['value'][k]) + #print(self.obj.variables['SepFact_c']['value'][k]) combo.setCurrentText(self.obj.variables['SepFact_c']['value'][k]) combo.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) l = QLineEdit(str(self.obj.variables['SepVal_c']['value'][k])) l.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) - calculationLayout.addWidget(QLabel(val+" :"), k+1,0, alignment=Qt.AlignLeft) - calculationLayout.addWidget(combo, k+1, 1, alignment=Qt.AlignCenter) - calculationLayout.addWidget(l,k+1,2, alignment=Qt.AlignCenter) - lst.append(combo) - lst.append(l) + self.calculationLayout.addWidget(QLabel(val+" :"), k+1,0, alignment=Qt.AlignLeft) + self.calculationLayout.addWidget(combo, k+1, 1, alignment=Qt.AlignCenter) + self.calculationLayout.addWidget(l,k+1,2, alignment=Qt.AlignCenter) + self.lst.append(combo) + self.lst.append(l) - calculationLayout.setColumnStretch(3, len(self.obj.compounds)+1) - calculationGroupBox.setLayout(calculationLayout) + self.calculationLayout.setColumnStretch(3, len(self.obj.compounds)+1) + self.calculationGroupBox.setLayout(self.calculationLayout) btn = QPushButton('Submit') btn.clicked.connect(self.param) self.gridLayout.setVerticalSpacing(5) - self.gridLayout.addWidget(calculationGroupBox,0,0) + self.gridLayout.addWidget(self.calculationGroupBox,0,0) self.gridLayout.addWidget(btn,1,0) - self.input_dict = lst + self.input_dict = self.lst except Exception as e: print(e) @@ -80,6 +81,22 @@ class DockWidgetCompoundSeparator(QDockWidget,ui_dialog): def show_error(self): QMessageBox.about(self, 'Important', "Please fill all fields with data") + def update_compounds(self): + try: + self.obj.init_variables() + t_item = self.calculationGroupBox.layout().itemAt(0) + self.calculationGroupBox.layout().removeItem(t_item) + while(t_item): + t_widget = t_item.widget() + if(t_widget): + t_widget.setHidden(True) + self.calculationGroupBox.layout().removeWidget(t_widget) + t_item = self.calculationGroupBox.layout().itemAt(0) + self.input_params_list() + except Exception as e: + print(e) + + def param(self): try: self.dict=[] @@ -87,10 +104,13 @@ class DockWidgetCompoundSeparator(QDockWidget,ui_dialog): self.dict = [self.input_dict[0].isChecked(), self.input_dict[1].isChecked()] j = 2 for i in range(len(self.obj.compounds)): - print(j+i) self.dict.append(self.input_dict[j+i].currentText()) - self.dict.append(self.input_dict[j+i+1].text()) - j += 1 + if(self.input_dict[j+i+1].text()): + self.dict.append(self.input_dict[j+i+1].text()) + j += 1 + else: + self.show_error() + self.obj.param_setter(self.dict) self.hide() diff --git a/DockWidgets/DockWidgetCompressorExpander.py b/DockWidgets/DockWidgetCompressorExpander.py index 5309bba..cd0135c 100644 --- a/DockWidgets/DockWidgetCompressorExpander.py +++ b/DockWidgets/DockWidgetCompressorExpander.py @@ -100,6 +100,14 @@ class DockWidgetCompressorExpander(QDockWidget,ui_dialog): break self.obj.param_setter(self.dict) + + for i in self.container.graphics.graphicsView.items(): + try: + if(i.name == self.name): + i.update_tooltip() + except: + pass + self.hide() except Exception as e: diff --git a/DockWidgets/DockWidgetMaterialStream.py b/DockWidgets/DockWidgetMaterialStream.py index 09cddf4..64545be 100644 --- a/DockWidgets/DockWidgetMaterialStream.py +++ b/DockWidgets/DockWidgetMaterialStream.py @@ -128,6 +128,7 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): indexx = self.comboBox.currentIndex() self.comboBox.setCurrentIndex(1) self.comboBox.setCurrentIndex(indexx) + self.obj.init_variables() except Exception as e: print(e) @@ -166,6 +167,14 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): #print("param ", self.dict) self.obj.param_setter(self.dict) + + for i in self.container.graphics.graphicsView.items(): + try: + if(i.name == self.name): + i.update_tooltip() + except: + pass + self.hide() except Exception as e: diff --git a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc Binary files differindex b0cf5d3..5d0ec10 100644 --- a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc +++ b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc diff --git a/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc Binary files differindex db18769..f11f259 100644 --- a/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc +++ b/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc diff --git a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc Binary files differindex 29c3683..e5bba23 100644 --- a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc +++ b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc |