summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ComponentSelector.py4
-rw-r--r--OMChem/Flowsheet.py25
-rw-r--r--Simulator/Databases/Databases.py1
-rw-r--r--Undo.datbin41926 -> 3757 bytes
4 files changed, 20 insertions, 10 deletions
diff --git a/ComponentSelector.py b/ComponentSelector.py
index c5ba6f5..79edef4 100644
--- a/ComponentSelector.py
+++ b/ComponentSelector.py
@@ -111,8 +111,8 @@ class ComponentSelector(QDialog,ui_dialog):
self.CAS=self.obj.get_value(self.comp,'CAS')
self.name=self.comp
- self.molecular_formula=self.obj.get_value(self.comp,'Smiles')
- self.molecular_weight=self.obj.get_value(self.comp,'MolecularWeight')
+ self.molecular_formula=self.obj.get_value(self.comp, 'StructureFormula')
+ self.molecular_weight=self.obj.get_value(self.comp, 'MolecularWeight')
dict={'CAS':self.CAS,'Name':self.name,'Molecular Formula':self.molecular_formula,'Molecular Weight':self.molecular_weight}
#converted everything to a dictionary which will be passes to addtable
diff --git a/OMChem/Flowsheet.py b/OMChem/Flowsheet.py
index 4fb0459..a61cd52 100644
--- a/OMChem/Flowsheet.py
+++ b/OMChem/Flowsheet.py
@@ -100,14 +100,23 @@ class Flowsheet():
self.sim_method = 'Eqn'
self.data.append("model Flowsheet\n")
- for c in self.compounds:
- ucase = c.title()
- lcase = c.lower()
- self.data.append("parameter database." + ucase +' '+ ucase + "; \n")
+ tempCompounds = self.compounds
+ for c in tempCompounds:
+ CompName = c
+ CompName = CompName.replace(" ", "")
+ CompName = CompName.replace("-", "")
+ CompName = CompName.replace(",", "")
+ CompName = CompName.replace("1", "One")
+ CompName = CompName.replace("2", "Two")
+ CompName = CompName.replace("3", "Three")
+ CompName = CompName.replace("4", "Four")
+ CompName = CompName.replace("5", "Five")
+ self.data.append("parameter database." + CompName +' '+ CompName + "; \n")
+ tempCompounds[tempCompounds.index(c)] = CompName
- self.data.append("parameter Integer Nc = " + str(len(self.compounds)) + ";\n")
+ self.data.append("parameter Integer Nc = " + str(len(tempCompounds)) + ";\n")
self.data.append("parameter Simulator.Files.ChemsepDatabase.GeneralProperties C[Nc] = {" +
- str(self.compounds).strip('[').strip(']').replace("'", "") + "};\n")
+ str(tempCompounds).strip('[').strip(']').replace("'", "") + "};\n")
for unitop in self.unit_operations:
if unitop.type != 'MaterialStream':
@@ -185,9 +194,9 @@ class Flowsheet():
self.data.append("model "+unitop.name.lower()+'\n')
for c in self.compounds:
- ucase = c.title()
+ c = c.title()
lcase = c.lower()
- self.data.append("parameter Simulator.Files.Chemsep_Database." + ucase +' '+ ucase + "; \n")
+ self.data.append("parameter Simulator.Files.Chemsep_Database." + c +' '+ c + "; \n")
self.data.append(unitop.OM_Flowsheet_Initialize())
diff --git a/Simulator/Databases/Databases.py b/Simulator/Databases/Databases.py
index 4b3a4c6..d6e0b46 100644
--- a/Simulator/Databases/Databases.py
+++ b/Simulator/Databases/Databases.py
@@ -60,6 +60,7 @@ class ChemsepDatabase():
CompName = CompName.replace("3","Three")
CompName = CompName.replace("4","Four")
CompName = CompName.replace("5","Five")
+
CAS = comp.getElementsByTagName("CAS")[0].getAttribute("value")
CriticalTemp = comp.getElementsByTagName("CriticalTemperature")[0].getAttribute("value")
CriticalPres = comp.getElementsByTagName("CriticalPressure")[0].getAttribute("value")
diff --git a/Undo.dat b/Undo.dat
index 0ccd67c..c101b89 100644
--- a/Undo.dat
+++ b/Undo.dat
Binary files differ