summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--DockWidgets/DockWidgetSplitter.py14
-rw-r--r--DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pycbin2764 -> 2751 bytes
-rw-r--r--Graphics.py2
-rw-r--r--Undo.datbin107976 -> 135899 bytes
-rw-r--r--UnitOperations.py19
6 files changed, 21 insertions, 17 deletions
diff --git a/.gitignore b/.gitignore
index 7796682..f1134d7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,4 +10,5 @@ Simulator/simulateEQN.mos
__pycache__/*
.idea/*
DockWidgets/__pycache__/*
-undo.dat \ No newline at end of file
+undo.dat
+test.py
diff --git a/DockWidgets/DockWidgetSplitter.py b/DockWidgets/DockWidgetSplitter.py
index 262bd45..c1c0120 100644
--- a/DockWidgets/DockWidgetSplitter.py
+++ b/DockWidgets/DockWidgetSplitter.py
@@ -30,9 +30,9 @@ class DockWidgetSplitter(QDockWidget,ui_dialog):
try:
print("input_params_list ", self.input_dict)
- self.l1.setText(self.obj.variables['NOO']['name']+":")
- self.le1.setText(str(self.obj.variables['NOO']['value']))
- self.u1.setText(self.obj.variables['NOO']['unit'])
+ self.l1.setText(self.obj.variables['No']['name']+":")
+ self.le1.setText(str(self.obj.variables['No']['value']))
+ self.u1.setText(self.obj.variables['No']['unit'])
for i in self.obj.CalcType_modes:
self.cb2.addItem(str(i))
@@ -52,12 +52,12 @@ class DockWidgetSplitter(QDockWidget,ui_dialog):
print(e)
def fun(self):
- if self.cb2.currentText() == 'Mole Flow Specs':
+ if self.cb2.currentText() == 'Molar_Flow':
self.u3.setText('mol/s')
self.u4.setText('mol/s')
- elif self.cb2.currentText() == 'Mass Flow Specs':
- self.u3.setText('kg/s')
- self.u4.setText('kg/s')
+ elif self.cb2.currentText() == 'Mass_Flow':
+ self.u3.setText('g/s')
+ self.u4.setText('g/s')
else:
self.u3.setText('')
self.u4.setText('')
diff --git a/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc
index ea2d2ea..045ca3d 100644
--- a/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc
+++ b/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc
Binary files differ
diff --git a/Graphics.py b/Graphics.py
index 0fa3306..fd02d39 100644
--- a/Graphics.py
+++ b/Graphics.py
@@ -472,7 +472,7 @@ class NodeItem(QtWidgets.QGraphicsItem):
if ok and text:
self.nop = int(text)
self.obj.no_of_outputs = self.nop
- self.obj.variables['NOO']['value'] = self.nop
+ self.obj.variables['No']['value'] = self.nop
self.dock_widget = None
lst.append(self)
diff --git a/Undo.dat b/Undo.dat
index 47f2cf8..09e1639 100644
--- a/Undo.dat
+++ b/Undo.dat
Binary files differ
diff --git a/UnitOperations.py b/UnitOperations.py
index 006c015..ea7c916 100644
--- a/UnitOperations.py
+++ b/UnitOperations.py
@@ -131,7 +131,7 @@ class UnitOperation():
for k in self.parameters:
self.OM_data_init += ', '
self.OM_data_init += k + ' = ' + ('"' + self.variables[k]['value'] + '"' if isinstance(self.variables[k]['value'], str)
- else str(self.variables[k]['value']))
+ else str(json.dumps(self.variables[k]['value']).replace('[', '{').replace(']', '}')))
self.OM_data_init += ');\n'
return self.OM_data_init
@@ -153,6 +153,8 @@ class UnitOperation():
self.OM_data_eqn += ('connect(' + strm.name + '.In,' + self.name + '.Out[' + str(strcount) + ']);\n')
strcount += 1
else:
+ print(self.input_stms)
+ print(self.output_stms)
self.OM_data_eqn += ('connect(' + self.name + '.Out,' + self.output_stms[0].name + '.In);\n')
if self.mode:
@@ -377,29 +379,30 @@ class Splitter(UnitOperation):
self.no_of_outputs = 3
# self.input_stms = None
- self.CalcType_modes = ['Split Ratios', 'Mole Flow Specs', 'Mass Flow Specs']
+ self.CalcType_modes = ['Split_Ratio', 'Molar_Flow', 'Mass_Flow']
- self.parameters = ['NOO', 'CalcType']#, 'SpecVal_s'
+ self.parameters = ['No', 'CalcType', 'SpecVal_s']
type(self).counter += 1
self.variables = {
- 'NOO' : {'name':'No. of Output', 'value':3, 'unit':''},
+ 'No' : {'name':'No. of Output', 'value':3, 'unit':''},
'CalcType' : {'name':'Calculation Type', 'value':self.CalcType_modes[0], 'unit':''},
'SpecVal_s' : {'name':'Specification Value', 'value':[50,50], 'unit':''}
}
specval = self.variables['SpecVal_s']['value'] # [50,50]
self.specval = json.dumps(specval).replace('[','{').replace(']','}')
+ print(self.specval)
def param_setter(self,params):
print("param_setter ", params)
- self.variables['NOO']['value'] = int(params[0])
+ self.variables['No']['value'] = int(params[0])
self.variables['CalcType']['value'] = params[1]
self.variables['SpecVal_s']['value'] = [float(params[2]), float(params[3])]
- if self.variables['CalcType']['value'] == 'Mole Flow Specs':
+ if self.variables['CalcType']['value'] == 'Molar_Flow':
self.variables['SpecVal_s']['unit'] = 'mol/s'
- elif self.variables['CalcType']['value'] == 'Mass Flow Specs':
- self.variables['SpecVal_s']['unit'] = 'kg/s'
+ elif self.variables['CalcType']['value'] == 'Mass_Flow':
+ self.variables['SpecVal_s']['unit'] = 'g/s'
print(self.variables)
class Mixer(UnitOperation):