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 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 Init() { this.MultipleSelection = false; SetFlowsheetActivity(FlowsheetActivity.Default); 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.streamManager = new StreamManager(this); this.unitOpManager = new UnitOpManager(this); this.BackColor = Color.White; this.Version = new FlowsheetVersion(); this.IsDirty = false; }