diff options
author | pravindalve | 2020-02-14 13:04:30 +0530 |
---|---|---|
committer | GitHub | 2020-02-14 13:04:30 +0530 |
commit | a80b6726f5f70d9a2ec1cbf361e7f607849343bf (patch) | |
tree | 333d34f58255003939e70b800d2cd57e40253b6b /OMChem/CompSep.py | |
parent | 8189de7d424964aac11b81c8297b7af7fcedd2b8 (diff) | |
parent | df141f35dccc6b21fcfa575707c6435a39d0002f (diff) | |
download | Chemical-Simulator-GUI-a80b6726f5f70d9a2ec1cbf361e7f607849343bf.tar.gz Chemical-Simulator-GUI-a80b6726f5f70d9a2ec1cbf361e7f607849343bf.tar.bz2 Chemical-Simulator-GUI-a80b6726f5f70d9a2ec1cbf361e7f607849343bf.zip |
Merge pull request #2 from pravindalve/master
Code restructured, some ui improvizations, undo redo implementation and Binary envelops utility
Diffstat (limited to 'OMChem/CompSep.py')
-rw-r--r-- | OMChem/CompSep.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/OMChem/CompSep.py b/OMChem/CompSep.py index 54b6415..9579498 100644 --- a/OMChem/CompSep.py +++ b/OMChem/CompSep.py @@ -1,11 +1,12 @@ from OMChem.EngStm import EngStm import json class CompSep(): - def __init__(self,CompNames = [],name='compoundseparator',SepFact=['Molar_Flow','Mass_Flow'],SepStrm=1,SepFactValue=[]): + counter = 1 + def __init__(self,CompNames = [],name='CompSep',SepFact=['Molar_Flow','Mass_Flow'],SepStrm=1,SepFactValue=[]): self.SepFact = json.dumps(SepFact).replace('[','{').replace(']','}') self.SepStrm = str(SepStrm) self.SepFactValue = json.dumps(SepFactValue).replace('[','{').replace(']','}') - self.name = name + #self.name = name self.OM_data_eqn = '' self.OM_data_init = '' self.InputStms = [] @@ -13,8 +14,18 @@ class CompSep(): self.type = 'CompSep' self.EngStms = EngStm(name='EngStm') + # new + self.name = name + str(CompSep.counter) + self.no_of_input = 1 + self.no_of_output = 2 + CompSep.counter += 1 + + def getname(self): + return self.name + def modesList(self): - return [] + return [] + def paramgetter(self,mode=None): dict = {"SepStrm":None,"SepFactValue":None,"SepFact":None} return dict @@ -29,7 +40,7 @@ class CompSep(): comp_count = len(addedcomp) self.OM_data_init = self.OM_data_init + 'Simulator.Streams.Energy_Stream '+self.EngStms.name+';\n' self.OM_data_init = self.OM_data_init + ( - "Simulator.Unit_Operations.Compound_Separator " + self.name + "(NOC = " + str(comp_count)) + "Simulator.Unit_Operations.Compound_Separator " + self.name + "(Nc = " + str(comp_count)) self.OM_data_init = self.OM_data_init + (",comp = {") comp = str(addedcomp).strip('[').strip(']') comp = comp.replace("'", "") @@ -42,7 +53,6 @@ class CompSep(): self.InputStms = InputStms self.OutputStms = OutputStms - def OM_Flowsheet_Eqn(self, addedcomp): self.OM_data_eqn = '' comp_count = len(addedcomp) @@ -57,7 +67,6 @@ class CompSep(): sepFac = str(self.SepFactValue).strip('[').strip(']') self.OM_data_eqn = self.OM_data_eqn + (self.name+'.sepFactVal= {'+ sepFac + '};\n') - return self.OM_data_eqn |