From ce501c2d9e437e3988105595d2e9068045a98720 Mon Sep 17 00:00:00 2001 From: Pravin Dalve Date: Tue, 22 Jun 2021 00:33:41 +0530 Subject: update compounds method added in all unit operations, material stream and material stream dockwidget --- Graphics.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Graphics.py') 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): ''' -- cgit