diff options
-rw-r--r-- | DockWidgets/DockWidgetMaterialStream.py | 64 | ||||
-rw-r--r-- | DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc | bin | 8382 -> 8132 bytes |
2 files changed, 28 insertions, 36 deletions
diff --git a/DockWidgets/DockWidgetMaterialStream.py b/DockWidgets/DockWidgetMaterialStream.py index 937aa65..d272933 100644 --- a/DockWidgets/DockWidgetMaterialStream.py +++ b/DockWidgets/DockWidgetMaterialStream.py @@ -156,7 +156,6 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): # result data tab def results_category(self,name): - flag = True try: print("Under result category name ", name) result=self.container.result @@ -182,9 +181,13 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): print(ll) j = 0 - t = 0 - namee = klst[j] + namee = 'none' print("namee ", namee) + #initialization for treewidgets + lroot = 1 + mroot = 1 + vroot = 1 + for i,k in enumerate(ll): ind = result[0].index(k) @@ -194,40 +197,29 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): print("######Resultsfetch####",resultval) print(k[k.find(".")+1:k.find("[")]) obj.variables[k.split('.')[1]]['value'] = resultval - if namee in k: - if i%3 == 0: - if(flag): - mroot = QTreeWidgetItem(self.mTreeWidget, [lst[j]]) - child = QTreeWidgetItem(mroot, [compound_selected[t], str(resultval),obj.variables[k.split('.')[1]]['unit']]) - elif i%3 == 1: - if(flag): - lroot = QTreeWidgetItem(self.lTreeWidget, [lst[j]]) - child = QTreeWidgetItem(lroot, [compound_selected[t], str(resultval),obj.variables[k.split('.')[1]]['unit']]) - elif i%3 == 2: - if (flag): - vroot = QTreeWidgetItem(self.vTreeWidget, [lst[j]]) - child = QTreeWidgetItem(vroot, [compound_selected[t], str(resultval),obj.variables[k.split('.')[1]]['unit']]) - t += 1 - flag = False - else: - j += 1 - t = 0 + + if namee not in k: + mroot = QTreeWidgetItem(self.mTreeWidget, [lst[j]]) + lroot = QTreeWidgetItem(self.lTreeWidget, [lst[j]]) + vroot = QTreeWidgetItem(self.vTreeWidget, [lst[j]]) namee = klst[j] - flag = True - if i%3 == 0: - if (flag): - mroot = QTreeWidgetItem(self.mTreeWidget, [lst[j]]) - child = QTreeWidgetItem(mroot, [compound_selected[t], str(resultval),obj.variables[k.split('.')[1]]['unit']]) - elif i%3 == 1: - if (flag): - lroot = QTreeWidgetItem(self.lTreeWidget, [lst[j]]) - child = QTreeWidgetItem(lroot, [compound_selected[t], str(resultval),obj.variables[k.split('.')[1]]['unit']]) - elif i%3 == 2: - if (flag): - vroot = QTreeWidgetItem(self.vTreeWidget, [lst[j]]) - child = QTreeWidgetItem(vroot, [compound_selected[t], str(resultval),obj.variables[k.split('.')[1]]['unit']]) - t += 1 - flag = False + + phase_no = int(k[k.index(',') - 1]) # phase no is from modelica list + compound_no = int(k[k.index(',') + 1]) - 1 # compound is from python list + + if phase_no == 1: + child = QTreeWidgetItem(mroot, [compound_selected[compound_no], str(resultval), + obj.variables[k.split('.')[1]]['unit']]) + elif phase_no == 2: + child = QTreeWidgetItem(lroot, [compound_selected[compound_no], str(resultval), + obj.variables[k.split('.')[1]]['unit']]) + elif phase_no == 3: + child = QTreeWidgetItem(vroot, [compound_selected[compound_no], str(resultval), + obj.variables[k.split('.')[1]]['unit']]) + if (compound_no + 1) == len(compound_selected): + j += 1 + + # Phase Properties Tab phaseResLst = [] diff --git a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc Binary files differindex 550aab7..f3850cf 100644 --- a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc +++ b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc |