private void tabPanel1_btnCalc_Click(object sender, EventArgs e) { // Collect input data double altitude = double.Parse(tabPanel1_txtAltitude.Text); double Db = double.Parse(tabPanel1_txtDb.Text); double Wb = double.Parse(tabPanel1_txtWb.Text); // Decide if IP or SI if (checkBox1.Checked == false) { // IP units PsychrometricPointIP p1 = new PsychrometricPointIP(altitude); p1.CalcAllUsingDbWb(Db, Wb); tabPanel1_txtRH.Text = p1.RelativeHumidityPercentage.ToString(); tabPanel1_txtTd.Text = p1.DewPointTemperatureInDegF.ToString(); tabPanel1_txtW.Text = p1.HumidityRatioInPoundsPerPound.ToString(); tabPanel1_txtWgrains.Text = p1.HumidityRatioGrainsPerPound.ToString(); tabPanel1_txtV.Text = p1.SpecificVolumeInCubicFeetPerPound.ToString(); tabPanel1_txtH.Text = p1.EnthalpyInBtuPerPound.ToString(); tabPanel1_txtP.Text = p1.AtmosphericPressurePsia.ToString(); } else if (checkBox1.Checked == true) { // SI Units PsychrometricPointSI p2 = new PsychrometricPointSI(altitude); p2.CalcAllUsingDbWb(Db, Wb); tabPanel1_txtRH.Text = p2.RelativeHumidityPercentage.ToString(); tabPanel1_txtTd.Text = p2.DewPointTemperature.ToString(); tabPanel1_txtW.Text = p2.HumidityRatio.ToString(); tabPanel1_txtWgrains.Text = p2.HumidityRatioGramsPerKilogram.ToString(); tabPanel1_txtV.Text = p2.SpecificVolume.ToString(); tabPanel1_txtH.Text = p2.Enthalpy.ToString(); tabPanel1_txtP.Text = p2.AtmosphericPressureKPa.ToString(); } }
private void button1_Click(object sender, EventArgs e) { // Collect Input Data double point1_Db = double.Parse(point1_txtDb.Text); double point1_Wb = double.Parse(point1_txtWb.Text); double point1_Flow = double.Parse(point1_txtFlowRate.Text); double altitude = double.Parse(point1_txtAltitude.Text); double point2_Db = double.Parse(point2_txtDb.Text); double point2_Wb = double.Parse(point2_txtWb.Text); double point2_Flow = double.Parse(point2_txtFlowRate.Text); // Decide if IP or SI if (checkBox1.Checked == false) { // IP Units // Create two psychrometric points PsychrometricPointIP p1 = new PsychrometricPointIP(altitude, point1_Flow); p1.CalcAllUsingDbWb(point1_Db, point1_Wb); PsychrometricPointIP p2 = new PsychrometricPointIP(altitude, point2_Flow); p2.CalcAllUsingDbWb(point2_Db, point2_Wb); // Create the psychrometric mix point PsychrometricAirMixtureIP mix = new PsychrometricAirMixtureIP(p1, p2); // Fill text boxes mix_txtDb.Text = mix.DryBulbTemperatureInDegF.ToString(); mix_txtWb.Text = mix.WetBulbTemperatureInDegF.ToString(); mix_txtRH.Text = mix.RelativeHumidityPercentage.ToString(); mix_txtTd.Text = mix.DewPointTemperatureInDegF.ToString(); mix_txtW.Text = mix.HumidityRatioInPoundsPerPound.ToString(); mix_txtWgrains.Text = mix.HumidityRatioGrainsPerPound.ToString(); mix_txtV.Text = mix.SpecificVolumeInCubicFeetPerPound.ToString(); mix_txtH.Text = mix.EnthalpyInBtuPerPound.ToString(); mix_txtP.Text = mix.AtmosphericPressurePsia.ToString(); } else if (checkBox1.Checked == true) { // SI Units // Create two psychrometric points PsychrometricPointSI p1 = new PsychrometricPointSI(altitude, point1_Flow); p1.CalcAllUsingDbWb(point1_Db, point1_Wb); PsychrometricPointSI p2 = new PsychrometricPointSI(altitude, point2_Flow); p2.CalcAllUsingDbWb(point2_Db, point2_Wb); // Create psychrometric mix point PsychrometricAirMixtureSI mix = new PsychrometricAirMixtureSI(p1, p2); // Fill text boxes mix_txtDb.Text = mix.DryBulbTemperature.ToString(); mix_txtWb.Text = mix.WetBulbTemperature.ToString(); mix_txtRH.Text = mix.RelativeHumidityPercentage.ToString(); mix_txtTd.Text = mix.DewPointTemperature.ToString(); mix_txtW.Text = mix.HumidityRatio.ToString(); mix_txtWgrains.Text = mix.HumidityRatioGramsPerKilogram.ToString(); mix_txtV.Text = mix.SpecificVolume.ToString(); mix_txtH.Text = mix.Enthalpy.ToString(); mix_txtP.Text = mix.AtmosphericPressureKPa.ToString(); } }