diff options
author | Priyam Nayak | 2021-06-22 08:41:25 +0530 |
---|---|---|
committer | GitHub | 2021-06-22 08:41:25 +0530 |
commit | ecf089991f8f3c15c3c99f376be3b954ec5b3545 (patch) | |
tree | 6de70decc9a0907b5fc8b58452c28e85a84d24db /Graphics.py | |
parent | 3f8095e27df1ea62c4356c08de09cc42ffca00ed (diff) | |
parent | 4f47bbc5cb8a325bdb31776d5c9f2963603695d4 (diff) | |
download | Chemical-Simulator-GUI-ecf089991f8f3c15c3c99f376be3b954ec5b3545.tar.gz Chemical-Simulator-GUI-ecf089991f8f3c15c3c99f376be3b954ec5b3545.tar.bz2 Chemical-Simulator-GUI-ecf089991f8f3c15c3c99f376be3b954ec5b3545.zip |
Merge pull request #24 from pravindalve/master
Fixed problem of compound updating during simulation
Diffstat (limited to 'Graphics.py')
-rw-r--r-- | Graphics.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Graphics.py b/Graphics.py index a9a6d23..8fbbbf0 100644 --- a/Graphics.py +++ b/Graphics.py @@ -36,6 +36,11 @@ class Graphics(QDialog, QtWidgets.QGraphicsItem): def create_node_item(self,unit_operation, container): return NodeItem(unit_operation, container, self.graphicsView) + + def update_compounds(self): + for i in self.scene.items(): + if isinstance(i, NodeItem): + i.update_compounds() def load_canvas(self, obj, container): stm = ['MaterialStream','EngStm'] @@ -581,6 +586,13 @@ class NodeItem(QtWidgets.QGraphicsItem): default_tooltip = default_tooltip + f" {i} : {j}\n" self.setToolTip(default_tooltip) + def update_compounds(self): + try: + self.obj.update_compounds() + self.dock_widget.update_compounds() + except AttributeError: + pass + def findMainWindow(self): ''' |