public int plot_by_DBT_HR_process_diagram(double DBT, double HR)
{
/*
*We need to cal x-asis which is given by DBT
*/
// MessageBox.Show("reached here dbt=" + DBT + ", hr = " + HR);
int x_axis = (int)DBT;
//here the HR is relative humidity like 20%,30% etc os phi = 0.3 for 30%
double phi = HR;
//we need to calculate the y-axis value
/*For y axis the value has to be pulled from the t_pg text file....
*/
//lets create two arraylist to add those and store it in the arraylist
ArrayList temperature_value = new ArrayList();
ArrayList pg_value_from_txtfile = new ArrayList();
//--Copying the ref temp and humidity to temporary arraylist
temperature_value = t;
pg_value_from_txtfile = pg;
double patm = form1Object.AirPressureFromDB * 0.001;//in kpa//101.235;//constant..we will make it take as input later...
//double rair = 0.287;//rideburg constant i guess
double wg_calc = 0;
double pg_value = 0.000000;
//now for corresponding DBT lets calculate constant value pg..
try
{
for (int i = 0; i < temperature_value.Count; i++)
{
///x-axis contains the DBT
if (DBT == Double.Parse(temperature_value[i].ToString()))
{
//if matched find the corresponding pg_value
pg_value = Double.Parse(pg_value_from_txtfile[i].ToString());
break;//break out of loop.
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
//now calc the y axis.
//wg_calc = 622 * pg_value / (patm - pg_value);
wg_calc = (622 * phi * pg_value / (patm - phi * pg_value));
//MessageBox.Show("pg_value=" + pg_value + ",wg_calc" + wg_calc);
double y_axis = wg_calc;
plot_on_graph_values_process_diagram(DBT, HR, x_axis, y_axis);
//MessageBox.Show("reached series print" +series1.ToString());
// index++;
return 0;
}