From 9f86138b86efebb816a2289bf84b96d688615f41 Mon Sep 17 00:00:00 2001 From: lucaszhao19 Date: Mon, 23 Dec 2019 13:25:49 +0530 Subject: Feature implementation - saving and partial loading --- OMChem/Mixer.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'OMChem/Mixer.py') diff --git a/OMChem/Mixer.py b/OMChem/Mixer.py index 9419de1..b0e0a66 100644 --- a/OMChem/Mixer.py +++ b/OMChem/Mixer.py @@ -1,22 +1,33 @@ class Mixer(): - def __init__(self,name='mixer',NOI=5,Pcal = 'Inlet_Average'): + counter = 1 # + def __init__(self,name='Mixer',NOI=5,Pcal = 'Inlet_Average'): self.NOI = NOI self.Pcal = Pcal - self.name = name self.OM_data_eqn = '' self.OM_data_init = '' self.InputStms = [] self.OutputStms = None self.type = 'Mixer' + # new + self.name = name + str(Mixer.counter) + self.no_of_input = 4 + self.no_of_output = 1 + Mixer.counter += 1 + + def getname(self): + return self.name + def modesList(self): return [] def paramgetter(self,mode=None): dict = {} return dict + def paramsetter(self,dict): self.NOI = dict["NOI"] + def OM_Flowsheet_Init(self, addedcomp): self.OM_data_init = '' comp_count = len(addedcomp) @@ -35,7 +46,6 @@ class Mixer(): self.InputStms = InputStms self.OutputStms = OutputStms - def OM_Flowsheet_Eqn(self, addedcomp): self.OM_data_eqn = '' comp_count = len(addedcomp) @@ -46,4 +56,3 @@ class Mixer(): strcount += 1 self.OM_data_eqn = self.OM_data_eqn + ('connect(' + self.name + '.outlet,' + self.OutputStms[0].name + '.inlet);\n') return self.OM_data_eqn - -- cgit From 8dfb7d836e438035be2284e49554dac36d0af7bf Mon Sep 17 00:00:00 2001 From: SaurabhAgarwala Date: Fri, 3 Jan 2020 15:54:24 +0530 Subject: Made GUI compatible with the new Simulator, abbreviations updated to new convention and few bugs eliminated with code clean up at places --- OMChem/Mixer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OMChem/Mixer.py') diff --git a/OMChem/Mixer.py b/OMChem/Mixer.py index b0e0a66..c726cdc 100644 --- a/OMChem/Mixer.py +++ b/OMChem/Mixer.py @@ -33,7 +33,7 @@ class Mixer(): comp_count = len(addedcomp) self.OM_data_init = self.OM_data_init + ( - "Simulator.Unit_Operations.Mixer " + self.name + "(NOC = " + str(comp_count)) + "Simulator.Unit_Operations.Mixer " + self.name + "(Nc = " + str(comp_count)) self.OM_data_init = self.OM_data_init + (",comp = {") comp = str(addedcomp).strip('[').strip(']') comp = comp.replace("'", "") -- cgit