internal double GetCpOfAbsoluteDryMaterial(double tempValue) { EvaporationAndDryingSystem mySystem = this.unitOpSystem as EvaporationAndDryingSystem; DryingMaterial dryingMat = mySystem.DryingMaterial; double cs = Constants.NO_VALUE; if (dryingMat.MaterialType == MaterialType.GenericMaterial) { cs = dryingMat.SpecificHeatOfAbsoluteDryMaterial; } else if (dryingMat.MaterialType == MaterialType.GenericFood) { cs = GenericFoodPropCalculator.GetAbsoluteDryCp((CompositeSubstance)dryingMat.AbsoluteDryMaterial, tempValue); } else { throw new ApplicationException("Material Type has not been supported yet!"); } if (cs == Constants.NO_VALUE && specificHeat.HasValue && moistureContentDryBase.HasValue) { double x = moistureContentDryBase.Value; double cw = MoistureProperties.GetSpecificHeatOfLiquid(); if (tempValue != Constants.NO_VALUE) { cw = MoistureProperties.GetSpecificHeatOfLiquid(tempValue); } cs = (specificHeat.Value * (1.0 + x) - x * cw); } return(cs); }
public Flowsheet(FlowsheetSettings newFlowsheetSettings, FlowsheetPreferences flowsheetPrefs, ApplicationPreferences appPrefs) { // // Required for Windows Form Designer support // InitializeComponent(); this.flowsheetPrefs = flowsheetPrefs; this.appPrefs = appPrefs; DryingGas dg = DryingGasCatalog.Instance.GetDryingGas(newFlowsheetSettings.DryingGasName); if (dg == null) { //string message = "You need to set a drying gas in Materials / New Process Settings first!"; //MessageBox.Show(message, "New Flowsheet Error", MessageBoxButtons.OK, MessageBoxIcon.Error); dg = DryingGasCatalog.Instance.GetDryingGas("Air"); } DryingMaterial dm = DryingMaterialCatalog.Instance.GetDryingMaterial(newFlowsheetSettings.DryingMaterialName); if (dm == null) { string message = "You need to choose a drying material for the new flowsheet to be created first! (go to Materials / Set Default Flowsheet Settings)"; MessageBox.Show(message, "New Flowsheet Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } this.evapAndDryingSystem = new EvaporationAndDryingSystem(UI.NEW_SYSTEM, dm, dg); this.connectionManager = new ConnectionManager(this); this.customEditor = new ProsimoUI.CustomEditor.CustomEditor(this); Init(); }
public virtual void SetObjectData() { int persistedClassVersion = info.GetInt32("ClassPersistenceVersionFlowsheet"); this.evapAndDryingSystem = (EvaporationAndDryingSystem)Storable.RecallStorableObject(info, context, "EvaporationAndDryingSystem", typeof(EvaporationAndDryingSystem)); //this.appPrefs = (ApplicationPreferences)Storable.RecallStorableObject(info, context, "ApplicationPreferences", typeof(ApplicationPreferences)); this.customEditor = (ProsimoUI.CustomEditor.CustomEditor)Storable.RecallStorableObject(info, context, "CustomEditor", typeof(ProsimoUI.CustomEditor.CustomEditor)); //this.connectionManager = (ConnectionManager)Storable.RecallStorableObject(info, context, "ConnectionManager", typeof(ConnectionManager)); ArrayList connections = info.GetValue("Connections", typeof(ArrayList)) as ArrayList; if (connections != null) { foreach (SolvableConnection sc in connections) { sc.SetObjectData(); } } this.flowsheetPrefs = (FlowsheetPreferences)Storable.RecallStorableObject(info, context, "FlowsheetPrefs", typeof(FlowsheetPreferences)); ArrayList persistedControls = info.GetValue("PersistedControls", typeof(ArrayList)) as ArrayList; RestoreSolvableControls(persistedControls, connections); InitializeComponent(); Init(); if (persistedClassVersion <= 1) { RecallInitialization(); } }
public Flowsheet(NewSystemPreferences newSystemPrefs, EvaporationAndDryingSystem system) { // // Required for Windows Form Designer support // InitializeComponent(); this.newSystemPrefs = newSystemPrefs; UnitSystemCatalog catalog = UnitSystemService.GetInstance().GetUnitSystemCatalog(); UnitSystem us = catalog.Get("SI-2"); UnitSystemService.GetInstance().CurrentUnitSystem = us; this.currentUnitSystemName = us.Name; this.MultipleSelection = false; this.Activity = FlowsheetActivity.Default; if (system == null) { DryingGas dg = DryingGasCatalog.GetInstance().GetDryingGas(newSystemPrefs.DryingGasName); if (dg == null) { dg = DryingGasCatalog.GetInstance().GetDryingGas("Air"); } DryingMaterial dm = DryingMaterialCatalog.GetInstance().GetDryingMaterial(newSystemPrefs.DryingMaterialName); if (dm == null) { dm = DryingMaterialCatalog.GetInstance().GetDryingMaterial("Generic Material"); } this.evapAndDryingSystem = new EvaporationAndDryingSystem("New System", dm, dg); } else { this.evapAndDryingSystem = system; } this.evapAndDryingSystem.SystemChanged += new SystemChangedEventHandler(evapAndDryingSystem_SystemChanged); this.evapAndDryingSystem.CalculationStarted += new CalculationStartedEventHandler(evapAndDryingSystem_CalculationStarted); this.evapAndDryingSystem.CalculationEnded += new CalculationEndedEventHandler(evapAndDryingSystem_CalculationEnded); this.connectionManager = new ConnectionManager(this); this.customEditor = new ProsimoUI.CustomEditor.CustomEditor(this); this.streamManager = new StreamManager(this); this.unitOpManager = new UnitOpManager(this); UI ui = new UI(); this.BackColor = ui.FLOWSHEET_COLOR; this.NumericFormat = NumericFormat.FixedPoint; this.DecimalPlaces = "3"; this.Version = new FlowsheetVersion(); this.KeyDown += new KeyEventHandler(Flowsheet_KeyDown); this.KeyUp += new KeyEventHandler(Flowsheet_KeyUp); UnitSystemService.GetInstance().CurrentUnitSystemChanged += new CurrentUnitSystemChangedEventHandler(Flowsheet_CurrentUnitSystemChanged); this.IsDirty = false; }
public FormulaEditorForm(EvaporationAndDryingSystem evapAndDryingSystem) { // // Required for Windows Form Designer support // InitializeComponent(); this.evapAndDryingSystem = evapAndDryingSystem; this.PopulateUnitOpList(evapAndDryingSystem); }
private void PopulateStreamList(EvaporationAndDryingSystem evapAndDryingSystem) { IEnumerator e = evapAndDryingSystem.GetStreamList().GetEnumerator(); while (e.MoveNext()) { ProcessStreamBase psb = (ProcessStreamBase)e.Current; this.solvableVariablesControlStream.ListBoxSolvable.Items.Add(psb); } }
public SystemNameForm(EvaporationAndDryingSystem system) { // // Required for Windows Form Designer support // InitializeComponent(); this.system = system; this.textBoxName.Text = system.Name; }
private void PopulateParameterStreamList(EvaporationAndDryingSystem system) { this.solvableVariablesControlParameter.ProcessVarListType = ProcessVariableListType.Specified; IEnumerator e = system.GetStreamList().GetEnumerator(); while (e.MoveNext()) { ProcessStreamBase psb = (ProcessStreamBase)e.Current; this.solvableVariablesControlParameter.ListBoxSolvable.Items.Add(psb); } }
public PlotsForm(EvaporationAndDryingSystem system) { // // Required for Windows Form Designer support // InitializeComponent(); this.system = system; this.plotsControl.InitializeTheControl(this.system.PlotCatalog); // do this first this.EnableDisableButtons(); this.plotsControl.ListViewPlots.SelectedIndexChanged += new EventHandler(ListViewPlots_SelectedIndexChanged); }
public FormulaEditorForm(Flowsheet flowsheet, EvaporationAndDryingSystem evapAndDryingSystem) { // // Required for Windows Form Designer support // InitializeComponent(); this.flowsheet = flowsheet; this.evapAndDryingSystem = evapAndDryingSystem; this.PopulateUnitOpList(evapAndDryingSystem); this.ResizeEnd += new EventHandler(FormulaEditorForm_ResizeEnd); }
private void PopulateUnitOpList(EvaporationAndDryingSystem evapAndDryingSystem) { IEnumerator e = evapAndDryingSystem.GetUnitOpList().GetEnumerator(); while (e.MoveNext()) { UnitOperation uo = (UnitOperation)e.Current; if (!(uo is Recycle)) { this.solvableVariablesControlUnitOp.ListBoxSolvable.Items.Add(uo); } } }
private double CalculateCp(double temperature) { double cp = Constants.NO_VALUE; if (massConcentration.HasValue && massConcentration.Value <= 1.0e-6) { if (vaporFraction.HasValue && vaporFraction.Value > 0.9999) { cp = GetGasCp(temperature); } else if (temperature != Constants.NO_VALUE && pressure.HasValue) { if (temperature < GetBoilingPoint(pressure.Value)) { cp = MoistureProperties.GetSpecificHeatOfLiquid(temperature); } else if (temperature > GetBoilingPoint(pressure.Value)) { cp = MoistureProperties.GetSpecificHeatOfVapor(temperature); } } } // else if (massConcentration.Value > 1.0e-6 && specificHeatDryBase.HasValue) { // //double cm = specificHeatAbsDry.Value + moistureContentDryBase.Value * liquidCp; // cp = specificHeatDryBase.Value / (1.0 + moistureContentDryBase.Value); // } //} else if (DryingMaterial.MaterialType == MaterialType.GenericFood) { //if (DryingMaterial.MaterialType == MaterialType.GenericFood) { cp = GenericFoodPropCalculator.GetCp(materialComponents.Components, temperature); } else if (DryingMaterial.MaterialType == MaterialType.SpecialFood && massConcentration.HasValue) { cp = SpecialFoodPropCalculator.GetCp(DryingMaterial.Name, massConcentration.Value, temperature); } if (cp == Constants.NO_VALUE && moistureContentDryBase.HasValue) { EvaporationAndDryingSystem mySystem = this.unitOpSystem as EvaporationAndDryingSystem; DryingMaterial dryingMat = mySystem.DryingMaterial; if (dryingMat.SpecificHeatOfAbsoluteDryMaterial != Constants.NO_VALUE) { double moistureLiquidCp = MoistureProperties.GetSpecificHeatOfLiquid(temperature); cp = dryingMat.SpecificHeatOfAbsoluteDryMaterial + moistureContentDryBase.Value * moistureLiquidCp; cp = cp / (1.0 + moistureContentDryBase.Value); } } return(cp); }
public Flowsheet(NewProcessSettings newProcessSettings, ApplicationPreferences appPrefs, EvaporationAndDryingSystem system) { // // Required for Windows Form Designer support // InitializeComponent(); this.newProcessSettings = newProcessSettings; this.appPrefs = appPrefs; this.MultipleSelection = false; SetFlowsheetActivity(FlowsheetActivity.Default); if (system == null) { DryingGas dg = DryingGasCatalog.GetInstance().GetDryingGas(newProcessSettings.DryingGasName); if (dg == null) { // string message = "You need to set a drying gas in Materials / New Process Settings first!"; // MessageBox.Show(message, "New Flowsheet Error", MessageBoxButtons.OK, MessageBoxIcon.Error); dg = DryingGasCatalog.GetInstance().GetDryingGas("Air"); } DryingMaterial dm = DryingMaterialCatalog.GetInstance().GetDryingMaterial(newProcessSettings.DryingMaterialName); if (dm == null) { string message = "You need to choose a drying material for the new flowsheet to be created first! (go to Materials / New Flowsheet Settings)"; MessageBox.Show(message, "New Flowsheet Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } this.evapAndDryingSystem = new EvaporationAndDryingSystem(UI.NEW_SYSTEM, dm, dg); } else { this.evapAndDryingSystem = system; } this.evapAndDryingSystem.SystemChanged += new SystemChangedEventHandler(evapAndDryingSystem_SystemChanged); this.evapAndDryingSystem.CalculationStarted += new CalculationStartedEventHandler(evapAndDryingSystem_CalculationStarted); this.evapAndDryingSystem.CalculationEnded += new CalculationEndedEventHandler(evapAndDryingSystem_CalculationEnded); this.evapAndDryingSystem.NameChanged += new NameChangedEventHandler(evapAndDryingSystem_NameChanged); this.connectionManager = new ConnectionManager(this); this.customEditor = new ProsimoUI.CustomEditor.CustomEditor(this); this.streamManager = new StreamManager(this); this.unitOpManager = new UnitOpManager(this); this.BackColor = Color.White; this.Version = new FlowsheetVersion(); this.IsDirty = false; }
private void PopulateUnitOpList(EvaporationAndDryingSystem evapAndDryingSystem) { IEnumerator e = evapAndDryingSystem.GetUnitOpList().GetEnumerator(); while (e.MoveNext()) { Solvable solvable = (Solvable)e.Current; if (!(solvable is Recycle)) { ListViewSolvableItem item = new ListViewSolvableItem(solvable); this.listViewUnitOps.Items.Add(item); } } }
//private static Flowsheet UnpersistFlowsheet1_01(NewProcessSettings newProcessSettings, ApplicationPreferences appPrefs, ArrayList persistedItems, string flowsheetName) { private static Flowsheet UnpersistFlowsheet1_01(ArrayList persistedItems, string flowsheetName, ApplicationPreferences appPrefs) { Flowsheet flowsheet = null; foreach (object obj in persistedItems) { if (obj is EvaporationAndDryingSystem) { EvaporationAndDryingSystem persisted = (EvaporationAndDryingSystem)obj; persisted.SetSystemFileName(flowsheetName); // call this before SetObjectData() persisted.SetObjectData(); //flowsheet = new Flowsheet(newProcessSettings, appPrefs, persisted); flowsheet = new Flowsheet(persisted, appPrefs); } else if (obj is SolvableControl) { SolvableControl persistedCtrl = (SolvableControl)obj; persistedCtrl.Flowsheet = flowsheet; persistedCtrl.SetObjectData(); //string solvableName = (string)persistedCtrl.NameControl.Text; //Solvable solvable = flowsheet.EvaporationAndDryingSystem.GetSolvable(solvableName); //persistedCtrl.Solvable = solvable; flowsheet.Controls.Add(persistedCtrl); } else if (obj is SolvableConnection) { SolvableConnection persistedDc = (SolvableConnection)obj; persistedDc.Flowsheet = flowsheet; persistedDc.SetObjectData(); persistedDc.UpdateConnection(); flowsheet.ConnectionManager.AddConnection(persistedDc); } else if (obj is FlowsheetPreferences) { FlowsheetPreferences flowsheetPrefs = obj as FlowsheetPreferences; flowsheetPrefs.SetObjectData(); flowsheet.BackColor = flowsheetPrefs.BackColor; } else if (obj is ProsimoUI.CustomEditor.CustomEditor) { ProsimoUI.CustomEditor.CustomEditor persistedEditor = (ProsimoUI.CustomEditor.CustomEditor)obj; persistedEditor.Flowsheet = flowsheet; persistedEditor.SetObjectData(); } } return(flowsheet); }
public Flowsheet(EvaporationAndDryingSystem system, ApplicationPreferences appPrefs) { // // Required for Windows Form Designer support // InitializeComponent(); this.evapAndDryingSystem = system; this.appPrefs = appPrefs; this.connectionManager = new ConnectionManager(this); this.customEditor = new ProsimoUI.CustomEditor.CustomEditor(this); Init(); }
public FlowsheetOptionsForm(Flowsheet flowsheet) { // // Required for Windows Form Designer support // InitializeComponent(); if (flowsheet != null) { this.flowsheet = flowsheet; EvaporationAndDryingSystem system = this.flowsheet.EvaporationAndDryingSystem; this.textBoxDryingGas.Text = system.DryingGas.ToString(); this.textBoxDryingMaterial.Text = system.DryingMaterial.ToString(); this.SetPreferences(); this.ResizeEnd += new EventHandler(FlowsheetOptionsForm_ResizeEnd); } }
internal double GetCpOfAbsoluteDryMaterial(double tempValue) { EvaporationAndDryingSystem mySystem = this.unitOpSystem as EvaporationAndDryingSystem; DryingMaterial dryingMat = mySystem.DryingMaterial; double cs = dryingMat.SpecificHeatOfAbsoluteDryMaterial; if (cs == Constants.NO_VALUE && specificHeat.HasValue && moistureContentDryBase.HasValue) { double x = moistureContentDryBase.Value; double cw = MoistureProperties.GetSpecificHeatOfLiquid(); if (tempValue != Constants.NO_VALUE) { cw = MoistureProperties.GetSpecificHeatOfLiquid(tempValue); } cs = (specificHeat.Value * (1.0 + x) - x * cw); } return(cs); }
public AddPlot2DForm(EvaporationAndDryingSystem system) { // // Required for Windows Form Designer support // InitializeComponent(); this.PopulateIndependentVarStreamList(system); this.PopulateDependentVarStreamList(system); this.PopulateParameterStreamList(system); this.Text = "New Plot"; this.p2dCache = new Plot2DCache(system.PlotCatalog); this.textBoxName.Text = "New Plot"; this.p2dCache.IncludeParameterVariable = this.checkBoxIncludeParamVar.Checked; this.UpdateTheUI(); this.tabControl.SelectedTab = this.tabPageIndependentVar; }
public CustomizeFlowsheetForm(Flowsheet flowsheet) { // // Required for Windows Form Designer support // InitializeComponent(); if (flowsheet != null) { this.flowsheet = flowsheet; EvaporationAndDryingSystem system = this.flowsheet.EvaporationAndDryingSystem; // SelectSolvablesControl selectSolvablesControl = new SelectSolvablesControl(flowsheet); selectSolvablesControl.Location = new Point(4, 4); this.panel.Controls.Add(selectSolvablesControl); this.ResizeEnd += new EventHandler(CustomizeFlowsheetForm_ResizeEnd); } }
public FlowsheetOptionsForm(Flowsheet flowsheet) { // // Required for Windows Form Designer support // InitializeComponent(); if (flowsheet != null) { this.flowsheet = flowsheet; EvaporationAndDryingSystem system = this.flowsheet.EvaporationAndDryingSystem; this.textBoxDryingGas.Text = system.DryingGas.ToString(); this.textBoxDryingMaterial.Text = system.DryingMaterial.ToString(); this.SetPreferences(); // SelectSolvablesControl selectSolvablesControl = new SelectSolvablesControl(flowsheet); selectSolvablesControl.Location = new Point(4, 4); this.tabPageEditor.Controls.Add(selectSolvablesControl); this.ResizeEnd += new EventHandler(FlowsheetOptionsForm_ResizeEnd); } }
public FlowsheetPreferencesForm(Flowsheet flowsheet) { // // Required for Windows Form Designer support // InitializeComponent(); if (flowsheet != null) { this.flowsheet = flowsheet; EvaporationAndDryingSystem system = this.flowsheet.EvaporationAndDryingSystem; this.textBoxDryingGas.Text = system.DryingGas.ToString(); this.textBoxDryingMaterial.Text = system.DryingMaterial.ToString(); this.SetPreferences(); // unitSystemsCtrl = new UnitSystemsControl(); this.tabPageUnits.Controls.Add(unitSystemsCtrl); unitSystemsCtrl.Location = new Point(0, 0); UnitSystem unitSystem = unitSystemsCtrl.GetSelectedUnitSystem(); int selIdx = unitSystemsCtrl.GetSelectedIndex(); this.buttonCurrentUnitSys.Enabled = false; if (selIdx >= 0) { if (unitSystem != null) { this.buttonCurrentUnitSys.Enabled = true; } } UnitSystem currentUnitSystem = UnitSystemService.GetInstance().CurrentUnitSystem; this.labelCurrent.Text = this.CURRENT_UNIT_SYS + currentUnitSystem.Name; unitSystemsCtrl.SelectedUnitSystemChanged += new SelectedUnitSystemChangedEventHandler(unitSystemsCtrl_SelectedUnitSystemChanged); // SelectSolvablesControl selectSolvablesControl = new SelectSolvablesControl(flowsheet); selectSolvablesControl.Location = new Point(4, 4); this.tabPageEditor.Controls.Add(selectSolvablesControl); this.domainUpDownDecPlaces.SelectedItem = this.flowsheet.DecimalPlaces; if (this.flowsheet.NumericFormat.Equals(NumericFormat.FixedPoint)) { this.radioButtonFixedPoint.Checked = true; } else if (this.flowsheet.NumericFormat.Equals(NumericFormat.Scientific)) { this.radioButtonScientific.Checked = true; } } /* * else * { * // 0 = types * // 1 = unit systems * // 2 = show in editor * // 3 = numeric format * this.tabControlPrefs.Controls.RemoveAt(3); * this.tabControlPrefs.Controls.RemoveAt(2); * this.tabControlPrefs.Controls.RemoveAt(1); * * this.groupBoxHeatExchangerInletType.Visible = false; * this.groupBoxUnitOpCreation.Visible = false; * this.groupBoxTeeMixerValveStreamsType.Visible = false; * } */ }
private Flowsheet SetFlowsheetContent(NewProcessSettings newProcessSettings, ApplicationPreferences appPrefs, ArrayList items, string flowsheetName) { Flowsheet flowsheet = null; IEnumerator e = items.GetEnumerator(); while (e.MoveNext()) { object obj = e.Current; if (obj is EvaporationAndDryingSystem) { EvaporationAndDryingSystem persisted = (EvaporationAndDryingSystem)obj; persisted.SetSystemFileName(flowsheetName); // call this before SetObjectData() persisted.SetObjectData(); flowsheet = new Flowsheet(newProcessSettings, appPrefs, persisted); } else if (obj is GasStreamControl) { GasStreamControl persistedCtrl = (GasStreamControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); DryingGasStream stream = flowsheet.EvaporationAndDryingSystem.GetGasStream(solvableName); GasStreamControl newCtrl = new GasStreamControl(flowsheet, new Point(0, 0), stream); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is MaterialStreamControl) { MaterialStreamControl persistedCtrl = (MaterialStreamControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); DryingMaterialStream stream = flowsheet.EvaporationAndDryingSystem.GetMaterialStream(solvableName); MaterialStreamControl newCtrl = new MaterialStreamControl(flowsheet, new Point(0, 0), stream); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is DryerControl) { DryerControl persistedCtrl = (DryerControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); Dryer uo = flowsheet.EvaporationAndDryingSystem.GetDryer(solvableName); DryerControl newCtrl = new DryerControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is HeatExchangerControl) { HeatExchangerControl persistedCtrl = (HeatExchangerControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); HeatExchanger uo = flowsheet.EvaporationAndDryingSystem.GetHeatExchanger(solvableName); HeatExchangerControl newCtrl = new HeatExchangerControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is CycloneControl) { CycloneControl persistedCtrl = (CycloneControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); Cyclone uo = flowsheet.EvaporationAndDryingSystem.GetCyclone(solvableName); CycloneControl newCtrl = new CycloneControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is EjectorControl) { EjectorControl persistedCtrl = (EjectorControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); Ejector uo = flowsheet.EvaporationAndDryingSystem.GetEjector(solvableName); EjectorControl newCtrl = new EjectorControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is WetScrubberControl) { WetScrubberControl persistedCtrl = (WetScrubberControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); WetScrubber uo = flowsheet.EvaporationAndDryingSystem.GetWetScrubber(solvableName); WetScrubberControl newCtrl = new WetScrubberControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is ScrubberCondenserControl) { ScrubberCondenserControl persistedCtrl = (ScrubberCondenserControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); ScrubberCondenser uo = flowsheet.EvaporationAndDryingSystem.GetScrubberCondenser(solvableName); ScrubberCondenserControl newCtrl = new ScrubberCondenserControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is MixerControl) { MixerControl persistedCtrl = (MixerControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); Mixer uo = flowsheet.EvaporationAndDryingSystem.GetMixer(solvableName); MixerControl newCtrl = new MixerControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is TeeControl) { TeeControl persistedCtrl = (TeeControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); Tee uo = flowsheet.EvaporationAndDryingSystem.GetTee(solvableName); TeeControl newCtrl = new TeeControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is FlashTankControl) { FlashTankControl persistedCtrl = (FlashTankControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); FlashTank uo = flowsheet.EvaporationAndDryingSystem.GetFlashTank(solvableName); FlashTankControl newCtrl = new FlashTankControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is FanControl) { FanControl persistedCtrl = (FanControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); Fan uo = flowsheet.EvaporationAndDryingSystem.GetFan(solvableName); FanControl newCtrl = new FanControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is ValveControl) { ValveControl persistedCtrl = (ValveControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); Valve uo = flowsheet.EvaporationAndDryingSystem.GetValve(solvableName); ValveControl newCtrl = new ValveControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is BagFilterControl) { BagFilterControl persistedCtrl = (BagFilterControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); BagFilter uo = flowsheet.EvaporationAndDryingSystem.GetBagFilter(solvableName); BagFilterControl newCtrl = new BagFilterControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is AirFilterControl) { AirFilterControl persistedCtrl = (AirFilterControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); AirFilter uo = flowsheet.EvaporationAndDryingSystem.GetAirFilter(solvableName); AirFilterControl newCtrl = new AirFilterControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is CompressorControl) { CompressorControl persistedCtrl = (CompressorControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); Compressor uo = flowsheet.EvaporationAndDryingSystem.GetCompressor(solvableName); CompressorControl newCtrl = new CompressorControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is HeaterControl) { HeaterControl persistedCtrl = (HeaterControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); Heater uo = flowsheet.EvaporationAndDryingSystem.GetHeater(solvableName); HeaterControl newCtrl = new HeaterControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is CoolerControl) { CoolerControl persistedCtrl = (CoolerControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); Cooler uo = flowsheet.EvaporationAndDryingSystem.GetCooler(solvableName); CoolerControl newCtrl = new CoolerControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is ElectrostaticPrecipitatorControl) { ElectrostaticPrecipitatorControl persistedCtrl = (ElectrostaticPrecipitatorControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); ElectrostaticPrecipitator uo = flowsheet.EvaporationAndDryingSystem.GetElectrostaticPrecipitator(solvableName); ElectrostaticPrecipitatorControl newCtrl = new ElectrostaticPrecipitatorControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is PumpControl) { PumpControl persistedCtrl = (PumpControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); Pump uo = flowsheet.EvaporationAndDryingSystem.GetPump(solvableName); PumpControl newCtrl = new PumpControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is RecycleControl) { RecycleControl persistedCtrl = (RecycleControl)obj; string solvableName = (string)persistedCtrl.SerializationInfo.GetValue("SolvableName", typeof(string)); Recycle uo = flowsheet.EvaporationAndDryingSystem.GetRecycle(solvableName); RecycleControl newCtrl = new RecycleControl(flowsheet, new Point(0, 0), uo); newCtrl.SetObjectData(persistedCtrl.SerializationInfo, persistedCtrl.StreamingContext); flowsheet.Controls.Add(newCtrl); } else if (obj is SolvableConnection) { SolvableConnection persistedDc = (SolvableConnection)obj; SolvableConnection dc = new SolvableConnection(flowsheet); dc.SetObjectData(persistedDc.SerializationInfo, persistedDc.StreamingContext); flowsheet.ConnectionManager.Connections.Add(dc); } else if (obj is FlowsheetPreferences) { FlowsheetPreferences flowsheetPrefs = obj as FlowsheetPreferences; flowsheetPrefs.SetObjectData(flowsheetPrefs.SerializationInfo, flowsheetPrefs.StreamingContext); flowsheet.BackColor = flowsheetPrefs.BackColor; } else if (obj is ProsimoUI.CustomEditor.CustomEditor) { ProsimoUI.CustomEditor.CustomEditor persistedEditor = (ProsimoUI.CustomEditor.CustomEditor)obj; flowsheet.CustomEditor.SetObjectData(persistedEditor.SerializationInfo, persistedEditor.StreamingContext); } } if (this.CheckFlowsheetVersion(items, flowsheet)) { flowsheet.IsDirty = false; } else { flowsheet = null; } return(flowsheet); }