diff options
author | brenda-br | 2023-01-19 13:21:11 +0530 |
---|---|---|
committer | brenda-br | 2023-01-19 13:21:11 +0530 |
commit | f5857f755b7d7f099c20c1dc29a010b6ff954e05 (patch) | |
tree | d54dc139700d9b4156b3f61d006205b113c8945c | |
parent | 22e16e822e952664b55a39bbc69dd15e2e55fe74 (diff) | |
download | Chemical-Simulator-GUI-f5857f755b7d7f099c20c1dc29a010b6ff954e05.tar.gz Chemical-Simulator-GUI-f5857f755b7d7f099c20c1dc29a010b6ff954e05.tar.bz2 Chemical-Simulator-GUI-f5857f755b7d7f099c20c1dc29a010b6ff954e05.zip |
Fix #35 Variable Description and Units displayed in tooltip
-rw-r--r-- | DockWidgets/__pycache__/DockWidget.cpython-37.pyc | bin | 4730 -> 4730 bytes | |||
-rw-r--r-- | DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc | bin | 3614 -> 3614 bytes | |||
-rw-r--r-- | DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc | bin | 10155 -> 10155 bytes | |||
-rw-r--r-- | DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc | bin | 3202 -> 3202 bytes | |||
-rw-r--r-- | DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc | bin | 8986 -> 8986 bytes | |||
-rw-r--r-- | DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc | bin | 2388 -> 2388 bytes | |||
-rw-r--r-- | DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc | bin | 5350 -> 5350 bytes | |||
-rw-r--r-- | DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc | bin | 3023 -> 3023 bytes | |||
-rw-r--r-- | Graphics.py | 4 | ||||
-rw-r--r-- | Streams.py | 46 | ||||
-rw-r--r-- | Undo.dat | bin | 42133 -> 3471 bytes |
11 files changed, 48 insertions, 2 deletions
diff --git a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc Binary files differindex cca7be4..b0cf5d3 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 7bf913d..db18769 100644 --- a/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc +++ b/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc diff --git a/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc Binary files differindex 34174b8..aa0f582 100644 --- a/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc +++ b/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc diff --git a/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc Binary files differindex 9dfa718..53d07bc 100644 --- a/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc +++ b/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc diff --git a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc Binary files differindex d693fd0..29c3683 100644 --- a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc +++ b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc diff --git a/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc Binary files differindex 454fa28..58c8a9e 100644 --- a/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc +++ b/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc diff --git a/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc Binary files differindex ec04e53..dd67795 100644 --- a/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc +++ b/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc diff --git a/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc Binary files differindex c888614..e19a9a3 100644 --- a/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc +++ b/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc diff --git a/Graphics.py b/Graphics.py index 7d456fe..1472516 100644 --- a/Graphics.py +++ b/Graphics.py @@ -424,7 +424,7 @@ class NodeItem(QtWidgets.QGraphicsItem): if (self.obj.modes_list): default_tooltip = f"{self.name}\n\n" - default_tooltip_dict = self.obj.param_getter(self.obj.mode) + default_tooltip_dict = self.obj.param_getter_tooltip(self.obj.mode) for i, j in default_tooltip_dict.items(): if j is not None: default_tooltip = default_tooltip + f" {i} : {j}\n" @@ -585,7 +585,7 @@ class NodeItem(QtWidgets.QGraphicsItem): def update_tooltip(self): default_tooltip = f"{self.name}\n\n" - default_tooltip_dict = self.obj.param_getter(self.obj.modes_list[0]) + default_tooltip_dict = self.obj.param_getter_tooltip(self.obj.mode) for i, j in default_tooltip_dict.items(): if j is not None: default_tooltip = default_tooltip + f" {i} : {j}\n" @@ -81,6 +81,52 @@ class MaterialStream(): for i in self.compound_names: self.variables[i] = {'value':''} + def param_getter_tooltip(self,mode): + dict = {} + + temp = [] + for i, val in enumerate(self.compound_names): + try: + temp.append(self.variables['x_pc[1,' + str(i+1) + ']']['value']) + except: + pass + self.variables['x_pc']['value'] = temp + + if(mode=="PT"): + self.mode1 = self.variables['P']['name'] + self.mode2 = self.variables['T']['name'] + dict = {self.mode1:str(self.variables['P']['value'])+' '+self.variables['P']['unit'], + self.mode2:str(self.variables['T']['value'])+' '+self.variables['T']['unit']} + elif(mode=="PH"): + self.mode1 = self.variables['P']['name'] + self.mode2 = self.variables['H_p[1]']['name'] + + dict = {self.mode1:str(self.variables['P']['value'])+' '+self.variables['P']['unit'], + self.mode2:str(self.variables['H_p[1]']['value'])+' '+self.variables['H_p[1]']['unit']} + elif(mode=="PVF"): + self.mode1 = self.variables['P']['name'] + self.mode2 = self.variables['xvap']['name'] + + dict = {self.mode1:str(self.variables['P']['value'])+' '+self.variables['P']['unit'], + self.mode2:str(self.variables['xvap']['value'])+' '+self.variables['xvap']['unit']} + elif(mode=="TVF"): + self.mode1 = self.variables['T']['name'] + self.mode2 = self.variables['xvap']['name'] + dict = {self.mode1:str(self.variables['T']['value'])+' '+self.variables['T']['unit'], + self.mode2:str(self.variables['xvap']['value'])+' '+self.variables['xvap']['unit']} + + elif(mode=="PS"): + self.mode1 = self.variables['P']['name'] + self.mode2 = self.variables['S_p[1]']['name'] + + dict = {self.mode1:str(self.variables['P']['value'])+' '+self.variables['P']['unit'], + self.mode2:str(self.variables['S_p[1]']['value'])+' '+self.variables['S_p[1]']['unit']} + + dict['Mole Flow'] = str(self.variables['F_p[1]']['value'])+' '+self.variables['F_p[1]']['unit'] + dict[self.variables['x_pc']['name']] = str(self.variables['x_pc']['value'])+' '+self.variables['x_pc']['unit'] + dict['Thermo Package'] = self.thermo_package + return dict + def param_getter(self,mode): dict = {} |