public void CreateHumidityChart() { PsychrometricChartModel psychrometricChartModel = this.EvaporationAndDryingSystem.GetPsychrometricChartModel(); HumidityChartForm humidityChartForm = new HumidityChartForm(this, psychrometricChartModel); humidityChartForm.ShowDialog(); }
public HumidityChartForm(Flowsheet flowsheet, PsychrometricChartModel psychrometricChartModel) { // // Required for Windows Form Designer support // InitializeComponent(); this.flowsheet = flowsheet; this.unitSystem = UnitSystemService.GetInstance().CurrentUnitSystem; this.psychrometricChartModel = psychrometricChartModel; this.labelPressureName.InitializeVariable(this.psychrometricChartModel.Pressure); this.textBoxPressureValue.InitializeVariable(flowsheet.ApplicationPrefs, this.psychrometricChartModel.Pressure); this.hcCurrentStateEditor = new HumidityChartCurrentStateEditor(this.flowsheet, psychrometricChartModel.StateStream); this.hcCurrentStateEditor.Location = new Point(0, 254); this.panel.Controls.Add(this.hcCurrentStateEditor); this.hcCurrentStateEditor.Visible = false; this.hcProcessEditor = new HumidityChartProcessEditor(this.flowsheet, psychrometricChartModel.ProcessInputStream, psychrometricChartModel.ProcessOutputStream); this.hcProcessEditor.Location = new Point(0, 254); this.panel.Controls.Add(this.hcProcessEditor); this.hcProcessEditor.Visible = false; this.psychrometricChartModel.HumidityChartChanged += new HumidityChartChangedEventHandler(psychrometricChartModel_HumidityChartChanged); this.psychrometricChartModel.SolveComplete += new SolveCompleteEventHandler(psychrometricChartModel_SolveComplete); UnitSystemService.GetInstance().CurrentUnitSystemChanged += new CurrentUnitSystemChangedEventHandler(HumidityChartForm_CurrentUnitSystemChanged); this.flowsheet.ApplicationPrefs.NumericFormatStringChanged += new NumericFormatStringChangedEventHandler(ApplicationPrefs_NumericFormatStringChanged); // this.currentStateCtrl = new StateControl(this.plotCtrl.Graph); this.currentStateCtrl.Visible = false; this.currentStateCtrl.MouseDown += new MouseEventHandler(currentStateCtrl_MouseDown); this.currentStateCtrl.LocationChanged += new EventHandler(currentStateCtrl_LocationChanged); this.currentStateCtrl.MouseUp += new MouseEventHandler(currentStateCtrl_MouseUp); this.plotCtrl.Graph.Controls.Add(this.currentStateCtrl); this.inStateCtrl = new StateControl(this.plotCtrl.Graph); this.inStateCtrl.Visible = false; this.inStateCtrl.MouseDown += new MouseEventHandler(inStateCtrl_MouseDown); this.inStateCtrl.LocationChanged += new EventHandler(inStateCtrl_LocationChanged); this.inStateCtrl.MouseUp += new MouseEventHandler(inStateCtrl_MouseUp); this.plotCtrl.Graph.Controls.Add(this.inStateCtrl); this.outStateCtrl = new StateControl(this.plotCtrl.Graph); this.outStateCtrl.Visible = false; this.outStateCtrl.MouseDown += new MouseEventHandler(outStateCtrl_MouseDown); this.outStateCtrl.LocationChanged += new EventHandler(outStateCtrl_LocationChanged); this.outStateCtrl.MouseUp += new MouseEventHandler(outStateCtrl_MouseUp); this.plotCtrl.Graph.Controls.Add(this.outStateCtrl); this.plotCtrl.Graph.NumericFormatString = this.flowsheet.ApplicationPrefs.NumericFormatString; this.plotCtrl.InitializePlotControl(this); this.psychrometricChartModel.HCTypeChanged += new HCTypeChangedEventHandler(psychrometricChartModel_HCTypeChanged); if (this.psychrometricChartModel.HCType == HCType.IsenthalpicProcess) { this.radioButtonProcess.Checked = true; } else if (this.psychrometricChartModel.HCType == HCType.GasState) { this.radioButtonState.Checked = true; } HumidityChartTypeChanged(); this.ResizeEnd += new EventHandler(HumidityChartForm_ResizeEnd); }