diff options
Diffstat (limited to 'src/main/python')
21 files changed, 48 insertions, 26 deletions
diff --git a/src/main/python/DockWidgets/DockWidget.py b/src/main/python/DockWidgets/DockWidget.py index fcfc172..764d8fb 100644 --- a/src/main/python/DockWidgets/DockWidget.py +++ b/src/main/python/DockWidgets/DockWidget.py @@ -27,7 +27,7 @@ class DockWidget(QDockWidget,ui_dialog): self.modes() self.comboBox.currentIndexChanged.connect(self.mode_selection) - print("constructor ", self.input_dict) + #print("constructor ", self.input_dict) self.pushButton_2.clicked.connect(self.param) self.dict = {} # a dictionary @@ -62,16 +62,17 @@ class DockWidget(QDockWidget,ui_dialog): def input_params_list(self): try: - print("input_params_list ", self.input_dict) + #print("input_params_list ", self.input_dict) for c,i in enumerate(self.input_dict): #print(i) if i == None: continue l = QLineEdit(str(self.obj.variables[i]['value'])) + l.setFixedWidth(80) lay = QGridLayout() lay.addWidget(QLabel(self.obj.variables[i]['name']+":"),0,0, alignment=Qt.AlignLeft) lay.addWidget(l,0,1, alignment=Qt.AlignCenter) - lay.addWidget(QLabel(self.obj.variables[i]['unit']),0,2, alignment=Qt.AlignCenter) + lay.addWidget(QLabel(self.obj.variables[i]['unit']),0,2, alignment=Qt.AlignLeft) self.formLayout.addRow(lay) self.input_dict[i] = l except Exception as e: diff --git a/src/main/python/DockWidgets/DockWidgetCompoundSeparator.py b/src/main/python/DockWidgets/DockWidgetCompoundSeparator.py index 4ae503a..26f8fd4 100644 --- a/src/main/python/DockWidgets/DockWidgetCompoundSeparator.py +++ b/src/main/python/DockWidgets/DockWidgetCompoundSeparator.py @@ -63,6 +63,7 @@ class DockWidgetCompoundSeparator(QDockWidget,ui_dialog): combo.setCurrentText(self.obj.variables['SepFact_c']['value'][k]) combo.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) l = QLineEdit(str(self.obj.variables['SepVal_c']['value'][k])) + l.setFixedWidth(80) l.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) self.calculationLayout.addWidget(QLabel(val+" :"), k+1,0, alignment=Qt.AlignLeft) self.calculationLayout.addWidget(combo, k+1, 1, alignment=Qt.AlignCenter) diff --git a/src/main/python/DockWidgets/DockWidgetCompressorExpander.py b/src/main/python/DockWidgets/DockWidgetCompressorExpander.py index 8b23b8e..9a8cb07 100644 --- a/src/main/python/DockWidgets/DockWidgetCompressorExpander.py +++ b/src/main/python/DockWidgets/DockWidgetCompressorExpander.py @@ -70,15 +70,16 @@ class DockWidgetCompressorExpander(QDockWidget,ui_dialog): l = QLineEdit() if self.input_dict[i] != None: l.setText(str(self.input_dict[i])) + l.setFixedWidth(80) lay = QGridLayout() lay.addWidget(QLabel(self.obj.variables[i]['name']+":"),0,0, alignment=Qt.AlignLeft) lay.addWidget(l,0,1, alignment=Qt.AlignCenter) - lay.addWidget(QLabel(self.obj.variables[i]['unit']),0,2, alignment=Qt.AlignCenter) + lay.addWidget(QLabel(self.obj.variables[i]['unit']),0,2, alignment=Qt.AlignLeft) self.formLayout.addRow(lay) self.input_dict[i] = l - self.lines = [line.rstrip('\n') for line in open('thermopackage.txt')] + self.lines = [line.rstrip('\n') for line in open(parentPath+'/python/utils/thermopackage.txt')] for j in self.lines: self.cbTP.addItem(str(j)) self.input_dict['Thermo Package'] = self.cbTP diff --git a/src/main/python/DockWidgets/DockWidgetDistillationColumn.py b/src/main/python/DockWidgets/DockWidgetDistillationColumn.py index 08e5bcd..7895b32 100644 --- a/src/main/python/DockWidgets/DockWidgetDistillationColumn.py +++ b/src/main/python/DockWidgets/DockWidgetDistillationColumn.py @@ -47,6 +47,7 @@ class DockWidgetDistillationColumn(QDockWidget, ui_dialog): # tab 1 l1 = QLineEdit() + l1.setFixedWidth(80) l1.setText(str(self.obj.variables['Nt']['value'])) self.lay1.addWidget(QLabel(self.obj.variables['Nt']['name'] + " :"), 0 ,0, alignment=Qt.AlignLeft) self.lay1.addWidget(l1,0,1, alignment=Qt.AlignLeft) @@ -55,6 +56,7 @@ class DockWidgetDistillationColumn(QDockWidget, ui_dialog): for i in range(self.obj.variables['Ni']['value']): print(i) l = QLineEdit() + l.setFixedWidth(80) if len(self.obj.variables['InT_s']['value']) is not 0: l.setText(str(self.obj.variables['InT_s']['value'][i])) self.lay1.addWidget(QLabel(self.obj.variables['InT_s']['name'] +" " + str(i+1) + " location :"),2*(i+1),0, alignment=Qt.AlignLeft) @@ -75,6 +77,7 @@ class DockWidgetDistillationColumn(QDockWidget, ui_dialog): self.cb5.addItem("Total") self.cb5.addItem("Partial") self.cb5.setCurrentText(self.obj.variables['Ctype']['value']) + for j in self.obj.Cspec_list: self.cb1.addItem(str(j)) self.cb1.setCurrentText(self.obj.variables['C_Spec']['type']) @@ -85,6 +88,18 @@ class DockWidgetDistillationColumn(QDockWidget, ui_dialog): self.cb2.setDisabled(True) self.cb1.currentIndexChanged.connect(self.fun2) + self.le5.setFixedWidth(80) + self.le6.setFixedWidth(80) + self.le7.setFixedWidth(80) + self.le8.setFixedWidth(80) + self.cb1.setFixedWidth(180) + self.cb2.setFixedWidth(80) + self.cb3.setFixedWidth(180) + self.cb4.setFixedWidth(80) + self.cb5.setFixedWidth(80) + self.u2.setAlignment(Qt.AlignLeft) + self.u3.setAlignment(Qt.AlignLeft) + self.input_dict.append(self.cb5) self.input_dict.append(self.le5) self.input_dict.append(self.cb1) @@ -113,7 +128,7 @@ class DockWidgetDistillationColumn(QDockWidget, ui_dialog): self.input_dict.append(self.cb4) self.input_dict.append(self.le8) - self.lines = [line.rstrip('\n') for line in open('thermopackage.txt')] + self.lines = [line.rstrip('\n') for line in open(parentPath+'/python/utils/thermopackage.txt')] for j in self.lines: self.cbTP.addItem(str(j)) self.cbTP.setCurrentText(self.obj.variables['thermo_package']['value']) diff --git a/src/main/python/DockWidgets/DockWidgetFlash.py b/src/main/python/DockWidgets/DockWidgetFlash.py index a2abbeb..c001fe2 100644 --- a/src/main/python/DockWidgets/DockWidgetFlash.py +++ b/src/main/python/DockWidgets/DockWidgetFlash.py @@ -31,7 +31,7 @@ class DockWidgetFlash(QDockWidget,ui_dialog): def input_params_list(self): try: self.l1.setText(self.obj.variables['thermo_package']['name']+":") - self.lines = [line.rstrip('\n') for line in open('thermopackage.txt')] + self.lines = [line.rstrip('\n') for line in open(parentPath+'/python/utils/thermopackage.txt')] for j in self.lines: self.cb1.addItem(str(j)) self.cb1.setCurrentText(self.obj.variables['thermo_package']['value']) @@ -47,6 +47,10 @@ class DockWidgetFlash(QDockWidget,ui_dialog): self.check2.toggled.connect(self.fun) self.check2.setChecked(self.obj.variables['BPdef']['value']) + self.le2.setFixedWidth(80) + self.le3.setFixedWidth(80) + self.cb1.setFixedWidth(80) + self.input_dict = [self.cb1, self.check1, self.le2, self.check2, self.le3] except Exception as e: diff --git a/src/main/python/DockWidgets/DockWidgetMaterialStream.py b/src/main/python/DockWidgets/DockWidgetMaterialStream.py index 684d1df..d2aefb6 100644 --- a/src/main/python/DockWidgets/DockWidgetMaterialStream.py +++ b/src/main/python/DockWidgets/DockWidgetMaterialStream.py @@ -81,7 +81,7 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): l = QLineEdit(str(self.obj.variables['x_pc']['value'][j])) except: l = QLineEdit() - + l.setFixedWidth(100) self.input_dict[i] = "x_pc" lay.addWidget(QLabel(str(compound_selected[j])+":"),j,0, alignment= Qt.AlignLeft) lay.addWidget(l,j,1, alignment=Qt.AlignCenter) @@ -96,7 +96,7 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): l = QLineEdit() if self.input_dict[i] != None: l.setText(str(self.input_dict[i])) - + l.setFixedWidth(80) lay = QGridLayout() if i !='MolFlow': lay.addWidget(QLabel(self.obj.variables[i]['name']+":"),0,0, alignment=Qt.AlignLeft) @@ -104,9 +104,9 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): lay.addWidget(QLabel(i+":"),0,0, alignment=Qt.AlignLeft) lay.addWidget(l,0,1, alignment=Qt.AlignCenter) if(i != 'MolFlow'): - lay.addWidget(QLabel(self.obj.variables[i]['unit']),0,2, alignment=Qt.AlignCenter) + lay.addWidget(QLabel(self.obj.variables[i]['unit']),0,2, alignment=Qt.AlignLeft) else: - lay.addWidget(QLabel("mol/s"),0,2, alignment=Qt.AlignCenter) + lay.addWidget(QLabel("mol/s"),0,2, alignment=Qt.AlignLeft) self.formLayout.addRow(lay) self.input_dict[i] = l diff --git a/src/main/python/DockWidgets/DockWidgetShortcutColumn.py b/src/main/python/DockWidgets/DockWidgetShortcutColumn.py index 33605b4..b627e9d 100644 --- a/src/main/python/DockWidgets/DockWidgetShortcutColumn.py +++ b/src/main/python/DockWidgets/DockWidgetShortcutColumn.py @@ -68,7 +68,7 @@ class DockWidgetShortcutColumn(QDockWidget,ui_dialog): self.l9.setText("Thermo Package :") - self.lines = [line.rstrip('\n') for line in open('thermopackage.txt')] + self.lines = [line.rstrip('\n') for line in open(parentPath+'/python/utils/thermopackage.txt')] for j in self.lines: self.cb6.addItem(str(j)) self.cb6.setCurrentText(self.obj.variables['thermo_package']['value']) diff --git a/src/main/python/DockWidgets/__pycache__/DockWidget.cpython-37.pyc b/src/main/python/DockWidgets/__pycache__/DockWidget.cpython-37.pyc Binary files differindex eced00d..90c3ef9 100644 --- a/src/main/python/DockWidgets/__pycache__/DockWidget.cpython-37.pyc +++ b/src/main/python/DockWidgets/__pycache__/DockWidget.cpython-37.pyc diff --git a/src/main/python/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc b/src/main/python/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc Binary files differindex 14c0665..eed70e1 100644 --- a/src/main/python/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc +++ b/src/main/python/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc diff --git a/src/main/python/DockWidgets/__pycache__/DockWidgetCompressorExpander.cpython-37.pyc b/src/main/python/DockWidgets/__pycache__/DockWidgetCompressorExpander.cpython-37.pyc Binary files differindex 93b8e8d..05d0157 100644 --- a/src/main/python/DockWidgets/__pycache__/DockWidgetCompressorExpander.cpython-37.pyc +++ b/src/main/python/DockWidgets/__pycache__/DockWidgetCompressorExpander.cpython-37.pyc diff --git a/src/main/python/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc b/src/main/python/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc Binary files differindex 9c85f38..a3cba32 100644 --- a/src/main/python/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc +++ b/src/main/python/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc diff --git a/src/main/python/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc b/src/main/python/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc Binary files differindex bfc8375..08f6dae 100644 --- a/src/main/python/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc +++ b/src/main/python/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc diff --git a/src/main/python/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc b/src/main/python/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc Binary files differindex 4f50c8c..abc5f50 100644 --- a/src/main/python/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc +++ b/src/main/python/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc diff --git a/src/main/python/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc b/src/main/python/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc Binary files differindex bcc4d4a..46cd536 100644 --- a/src/main/python/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc +++ b/src/main/python/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc diff --git a/src/main/python/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc b/src/main/python/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc Binary files differindex df9b82e..d23e668 100644 --- a/src/main/python/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc +++ b/src/main/python/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc diff --git a/src/main/python/OMChem/Flowsheet.py b/src/main/python/OMChem/Flowsheet.py index 855c71e..c862299 100644 --- a/src/main/python/OMChem/Flowsheet.py +++ b/src/main/python/OMChem/Flowsheet.py @@ -78,7 +78,7 @@ class Flowsheet(): # print("############### StdOut ################") # print(stdout) self.result_data = [] - print('Simulating '+unitop.name+'...') + #print('Simulating '+unitop.name+'...') csvpath = os.path.join(self.sim_dir_path,unitop.name+'_res.csv') with open(csvpath,'r') as resultFile: csvreader = csv.reader(resultFile,delimiter=',') @@ -240,7 +240,7 @@ class Flowsheet(): mosFile.write("loadFile(\""+unitop.name.lower()+".mo\");\n") mosFile.write("simulate("+unitop.name.lower()+", outputFormat=\"csv\", stopTime=1.0, numberOfIntervals=1);\n") - print("Initiating simulation in Sequential Modular Mode") + #print("Initiating simulation in Sequential Modular Mode") self.omc_path = self.get_omc_path() os.chdir(self.sim_dir_path) sim = os.path.join(self.sim_dir_path,unitop.name.lower()+'.mos') diff --git a/src/main/python/OMChem/__pycache__/Flowsheet.cpython-37.pyc b/src/main/python/OMChem/__pycache__/Flowsheet.cpython-37.pyc Binary files differindex 49a06d7..1a76d03 100644 --- a/src/main/python/OMChem/__pycache__/Flowsheet.cpython-37.pyc +++ b/src/main/python/OMChem/__pycache__/Flowsheet.cpython-37.pyc diff --git a/src/main/python/utils/Streams.py b/src/main/python/utils/Streams.py index 3f9f895..3f13b42 100644 --- a/src/main/python/utils/Streams.py +++ b/src/main/python/utils/Streams.py @@ -398,9 +398,9 @@ class MaterialStream(): except Exception as e: exc_type, exc_obj, exc_tb = sys.exc_info() - print(exc_type,exc_tb.tb_lineno) - print(e) - print('error') + # print(exc_type,exc_tb.tb_lineno) + # print(e) + # print('error') def OM_Flowsheet_Initialize(self,addedcomp): self.OM_data_init = '' diff --git a/src/main/python/utils/UnitOperations.py b/src/main/python/utils/UnitOperations.py index a016c55..2b16c7d 100644 --- a/src/main/python/utils/UnitOperations.py +++ b/src/main/python/utils/UnitOperations.py @@ -64,7 +64,7 @@ class UnitOperation(): return params def param_setter(self,params): - print("param_setter ", params) + #print("param_setter ", params) try: self.mode = list(params.keys())[0] except Exception as e: @@ -167,7 +167,7 @@ class UnitOperation(): self.OM_data_eqn += ('connect(' + strm.name + '.Out,' + self.name + '.In[' + str(strcount) + ']);\n') strcount += 1 else: - print(self.input_stms) + #print(self.input_stms) self.OM_data_eqn += ('connect(' + self.name + '.In,' + self.input_stms[1].name + '.Out);\n') if len(self.output_stms)>1: @@ -176,7 +176,7 @@ class UnitOperation(): self.OM_data_eqn += ('connect(' + strm.name + '.In,' + self.name + '.Out[' + str(strcount) + ']);\n') strcount += 1 else: - print("self.output_stms ", self.output_stms) + #print("self.output_stms ", self.output_stms) self.OM_data_eqn += ('connect(' + self.name + '.Out,' + self.output_stms[1].name + '.In);\n') if self.mode: @@ -231,7 +231,7 @@ class ShortcutColumn(UnitOperation): self.compounds = [c[:c.index('(')] for c in compound_selected] def param_setter(self,params): - print("param_setter ", params) + #print("param_setter ", params) self.variables['HKey']['value'] = self.compounds.index(params[0]) + 1 self.variables['LKey']['value'] = self.compounds.index(params[1]) + 1 self.variables['HKey_x_pc']['value'] = params[2] @@ -298,7 +298,7 @@ class DistillationColumn(UnitOperation): self.compounds = [c[:c.index('(')] for c in compound_selected] def param_setter(self,params): - print("param_setter ", params) + #print("param_setter ", params) temp = 0 self.variables['Nt']['value'] = params[0] for i in range(self.variables['Ni']['value']): @@ -323,7 +323,7 @@ class DistillationColumn(UnitOperation): self.variables['R_Spec']['comp'] = params[temp+8] self.variables['R_Spec']['value'] = params[temp+9] self.variables['thermo_package']['value'] = params[temp+10] - print(self.variables) + #print(self.variables) def OM_Flowsheet_Initialize(self): self.OM_data_init = '' @@ -456,7 +456,7 @@ class CompoundSeparator(UnitOperation): self.compounds = [c[:c.index('(')] for c in compound_selected] def param_setter(self,params): - print("param_setter CompSep ", params) + #print("param_setter CompSep ", params) if (params[0]): self.variables['SepStrm']['value'] = 1 @@ -528,7 +528,7 @@ class Flash(UnitOperation): self.compounds = [c[:c.index('(')] for c in compound_selected] def param_setter(self,params): - print("param_setter ", params) + #print("param_setter ", params) self.variables['thermo_package']['value'] = params[0] self.variables['BTdef']['value'] = params[1] self.variables['Tdef']['value'] = params[2] @@ -601,7 +601,7 @@ class Splitter(UnitOperation): self.compounds = [c[:c.index('(')] for c in compound_selected] def param_setter(self,params): - print("param_setter ", params) + #print("param_setter ", params) self.variables['No']['value'] = int(params[0]) self.variables['CalcType']['value'] = params[1] self.variables['SpecVal_s']['value'] = [float(params[2]), float(params[3])] diff --git a/src/main/python/utils/__pycache__/Streams.cpython-37.pyc b/src/main/python/utils/__pycache__/Streams.cpython-37.pyc Binary files differindex 1b9e678..18287f2 100644 --- a/src/main/python/utils/__pycache__/Streams.cpython-37.pyc +++ b/src/main/python/utils/__pycache__/Streams.cpython-37.pyc diff --git a/src/main/python/utils/__pycache__/UnitOperations.cpython-37.pyc b/src/main/python/utils/__pycache__/UnitOperations.cpython-37.pyc Binary files differindex 3cdf04d..ac4d056 100644 --- a/src/main/python/utils/__pycache__/UnitOperations.cpython-37.pyc +++ b/src/main/python/utils/__pycache__/UnitOperations.cpython-37.pyc |