//======================================================
// Numerical Analysis package in java
// Plot (Çizim ) programı
// Dr. Turhan Coban
// EGE Üniversitesi Mühendislik Fakultesi, Makina Bölümü
// turhan.coban@mail.ege.edu.tr
// =====================================================
/*
 * Swing version.
 */

import java.lang.Integer;
import java.awt.*;
import java.awt.event.*;
import java.awt.font.*;
import java.awt.geom.*;
import java.awt.image.*;
import javax.swing.*;
import java.util.Locale;
import java.text.*;
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.table.*;
//import java.io.*;
//import Plot2D;
//import PlotShapesSW;
//import BasicWindowMonitor;

public class PlotWetAir extends JFrame implements ItemListener,ActionListener, MouseListener,MouseMotionListener
{
  Container contentPane;
  JPanel inputPanel;
  JPanel outputPanel;
  JPanel totalPanel;
  JLabel l1[]=new JLabel[5];           // Label prompt unit
  JLabel l2[]=new JLabel[5];           // Label prompt unit
  JTextField t1[]=new JTextField[4];
  JComboBox c1[]=new JComboBox[2];
  JTextArea output;
  JTable jt;
  wetairModel wam;
  wetair wa;
  double aa[]=new double[14];  //controls wet air output variables
  public String unit;
  public String pair;
  public double v1;
  public double v2;
  public double P;
  protected StringTokenizer token;
  String s1[]={"SI","EN"};
  String s2[]={"tdb_w","tdb_twb","tdb_rh","tdb_tdew","tdb_pv","tdb_dos","tdb_h","tdb_s","w_rh","w_h"};
  Color bg;  
  double xx[];
  double yy[];
  int xn;
  String line="";
  private String s="";
	f2 ff=new f2();
	boolean inAnApplet = true;
    final static String KONTROLPANEL = "Control Page       ";
    final static String    PLOTPANEL = "Plot page         ";
    final static String   Psikometri = "Pyschrometry data ";
    public Plot2D jta;
    double xi1,yi1,xi2,yi2,xi,yi;
    JTable ajt,ajt2;          //table
    JTextArea textA;           //Text Area 
    JLabel altbar;           //writing area   
    JLabel promptXmin;       // Label prompt in Xmin field
    JLabel promptXmax;       // Label prompt in Xmax field
    JLabel promptYmin;       // Label prompt in Ymin field
    JLabel promptYmax;       // Label prompt in Ymax field
    JLabel promptLabel;      // Label prompt Plot Label
    JLabel promptXLabel;     // Label prompt Plot XLabel
    JLabel promptYLabel;     // Label prompt Plot YLabel
    JLabel promptXntic;      // Label prompt in Xmin field
    JLabel promptYntic;      // Label prompt in Xmax field
    JLabel promptXgridon;    // Label prompt in Ymin field
    JLabel promptYgridon;    // Label prompt in Ymax field
    JTextField inputXmin;    // input field Xmin
    JTextField inputXmax;    // input field Xmax
    JTextField inputYmin;    // input field Ymin
    JTextField inputYmax;    // input field Ymax
    JTextField inputLabel;   // input field Label
    JTextField inputXLabel;  // input field XLabel
    JTextField inputYLabel;  // input field YLabel
    JTextField inputXntic;   // input field xntic
    JTextField inputYntic;   // input field yntic
    JCheckBox inputXgridon;  // input field xgridon
    JCheckBox inputYgridon;  // input field ygridon
    JButton printButton; 

    public void setP(double ppi)
    {
    P=ppi;
	}
    

   
   public void setArea()
   {
    String s="";
    s+="Dr. Turhan Çoban, \n";
    s+="Ege Üniversitesi, Mühendislik Bilimleri Fak., Makina Bölümü\n";
    s+="phone : 90(232)3434000-5387\n";
    s+="email : turhan.coban@mail.ege.edu.tr\n";
    s+="web   : www.axtelsoft.com/turhan.coban\n";   
    //note if you would like to list additional information on the screen
    //add to string s
    output.setText(s);
    wam.setValues(unit,pair,v1,v2,P);
    output.setBackground(contentPane.getBackground());
   }
 
    public PlotWetAir(Plot1 pi)
    {   
    super(pi.label);
    xx=new double[200];
    yy=new double[200];
    xn=0;
    String s="";
    s+="Dr. M. Turhan Çoban, \n";
    s+="Ege Üniversitesi, Mühendislik Bilimleri Fak., Makina Bölümü\n";
    s+="phone : 90(232)3434000-5387\n";
    s+="email : turhan.coban@mail.ege.edu.tr\n";
    s+="web   : www.axtelsoft.com/turhan.coban\n";   
    //note if you would like to list additional information on the screen
    //add to string s
    output=new JTextArea(s);    
    contentPane = getContentPane();
    output.setBackground(contentPane.getBackground());
    JTabbedPane tabbedPane = new JTabbedPane();
    bg=contentPane.getBackground();
        promptXmin=new JLabel("Xmin ");
        inputXmin=new JTextField(5);
        promptXmax=new JLabel("Xmax ");
        inputXmax=new JTextField(5);
        promptYmin=new JLabel("Ymin ");
        inputYmin=new JTextField(5);
        promptYmax=new JLabel("Ymax ");
        inputYmax=new JTextField(5);
        //*******
        promptLabel=new  JLabel("           Plot başlığı     : ");
        promptXLabel=new JLabel("           x ekseni başlığı : ");
        promptYLabel=new JLabel("           y ekseni başlığı : ");
        inputLabel=new JTextField(30);
        inputXLabel=new JTextField(30);
        inputYLabel=new JTextField(30);
        //*******
        promptXntic=new JLabel("X tik no");
        inputXntic=new JTextField(5);
        promptYntic=new  JLabel("Y tik no");
        inputYntic=new JTextField(5);
        promptXgridon=new JLabel("X grid (küçük kare)");
        inputXgridon=new JCheckBox(" ");
        promptYgridon=new JLabel("Y grid (küçük kare)");
        inputYgridon=new JCheckBox(" ");
        textA=new JTextArea(line,10,30);
        //*******
        JPanel pane1 = new JPanel()
        {
        public Dimension getPrefferedSize()
        {
            Dimension size=super.getPreferredSize();
            size.width=800;
            return size;
        }
        };
        pane1.add(output,BorderLayout.NORTH);
        JPanel mpane=new JPanel();
        mpane.setLayout(new GridLayout(1,8));
        altbar=new JLabel();
        mpane.add(altbar,BorderLayout.SOUTH);
        mpane.add(promptXmin);
        mpane.add(inputXmin);
        mpane.add(promptXmax);
        mpane.add(inputXmax);
        mpane.add(promptYmin);
        mpane.add(inputYmin);
        mpane.add(promptYmax);
        mpane.add(inputYmax);
        pane1.add(mpane,BorderLayout.NORTH);
        JPanel xpane=new JPanel();
        xpane.setLayout(new GridLayout(1,8));
        xpane.add(promptXntic);
        xpane.add(inputXntic);
        xpane.add(promptYntic);
        xpane.add(inputYntic);
        xpane.add(promptXgridon);
        xpane.add(inputXgridon);
        xpane.add(promptYgridon);
        xpane.add(inputYgridon);
        pane1.add(xpane,BorderLayout.NORTH);
        //********
        JPanel lpane=new JPanel();
        lpane.setLayout(new GridLayout(3,2));
        lpane.add(promptLabel);
        lpane.add(inputLabel);
        lpane.add(promptXLabel);
        lpane.add(inputXLabel);
        lpane.add(promptYLabel);
        lpane.add(inputYLabel);
        pane1.add(lpane,BorderLayout.SOUTH);
        //*********
        inputXmin.addActionListener(this);
        inputXmax.addActionListener(this);
        inputYmin.addActionListener(this);
        inputYmax.addActionListener(this);
        inputLabel.addActionListener(this);
        inputXLabel.addActionListener(this);
        inputYLabel.addActionListener(this);
        inputXntic.addActionListener(this);
        inputYntic.addActionListener(this);
        inputXgridon.addItemListener(this);
        inputYgridon.addItemListener(this);
        jta=new Plot2D(pi);
        inputXmin.setText(Double.toString(jta.p1.xmin));
        inputXmax.setText(Double.toString(jta.p1.xmax));
        inputYmin.setText(Double.toString(jta.p1.ymin));
        inputYmax.setText(Double.toString(jta.p1.ymax));
        inputXntic.setText(Integer.toString(jta.p1.xntic));
        inputYntic.setText(Integer.toString(jta.p1.yntic));
        inputLabel.setText(jta.p1.label);
        inputXLabel.setText(jta.p1.xlabel);
        inputYLabel.setText(jta.p1.ylabel);
        printButton=new JButton("Yazdır");
        JPanel pane2 = new JPanel();
        JPanel pane3 = new JPanel();
        pane2.setLayout(new BorderLayout());
        altbar=new JLabel();
        pane2.add(altbar,BorderLayout.SOUTH);
        pane2.addMouseListener(this);
        pane2.addMouseMotionListener(this);
        
        pane1.add(printButton,BorderLayout.SOUTH);
        printButton.addActionListener(this);
        wam=new wetairModel("SI","tdb_w",20.0,0.004,P);
        line=wam.readName()+"\n";
        line+=wam.readUnit()+"\n";        
        //wam2=new wetairModel("SI","tdb_w",40.0,0.01,P);
        //ajt=new JTable(wam);
        //ajt2=new JTable(wam2);
        
        pane2.add(jta,BorderLayout.CENTER);
        //pane2.add(ajt,BorderLayout.WEST);
        //pane1.add(ajt,BorderLayout.SOUTH);
        textA=new JTextArea(line,10,80);
        JScrollPane textAP=new JScrollPane(textA);        
        wa=new wetair();
        unit="SI";
        pair="tdb_w";
        v1=20.0;
        v2=0.015;
        P=1.01325;
        wa.setUnit(unit);
        wam=new wetairModel(unit,pair,v1,v2,P);
    inputPanel=new JPanel();
    inputPanel.setLayout(new GridLayout(5,3));
    outputPanel=new JPanel();
    outputPanel.setLayout(new BorderLayout());
    totalPanel=new JPanel();
    totalPanel.setLayout(new BorderLayout());
    l1[0]=new JLabel("unit");
    l1[1]=new JLabel("select known property pair : ");
    l1[2]=new JLabel("Pressure");
    l1[3]=new JLabel(" dry bulb Temperature");
    l1[4]=new JLabel(" wet bulb Temperature");
    l2[0]=new JLabel("");
    l2[1]=new JLabel("");
    l2[2]=new JLabel(" bars");
    l2[3]=new JLabel(" degree C");
    l2[4]=new JLabel(" kg vapor/kg mix.");
    c1[0]=new JComboBox(s1);
    c1[1]=new JComboBox(s2);
    t1[0]=new JTextField(""+P);
    t1[1]=new JTextField(""+v1);
    t1[2]=new JTextField(""+v2);
    t1[3] = new JTextField();
    t1[3].setText(pair);
    inputPanel.add(l1[0]);
    inputPanel.add(c1[0]);
    inputPanel.add(l2[0]);
    inputPanel.add(l1[1]);
    inputPanel.add(c1[1]);
    inputPanel.add(t1[3]);
    inputPanel.add(l1[2]);
    inputPanel.add(t1[0]);
    inputPanel.add(l2[2]);
    inputPanel.add(l1[3]);
    inputPanel.add(t1[1]);
    inputPanel.add(l2[3]);
    inputPanel.add(l1[4]);
    inputPanel.add(t1[2]);
    inputPanel.add(l2[4]);
    t1[0].setBackground(bg);
    t1[1].setBackground(bg);
    t1[2].setBackground(bg);
    t1[3].setBackground(bg);
    t1[0].setFont(l1[0].getFont());
    t1[1].setFont(l1[0].getFont());
    t1[2].setFont(l1[0].getFont());
    t1[3].setFont(l1[0].getFont());
    c1[0].setBackground(bg);
    c1[1].setBackground(bg);
    c1[0].addItemListener(this);
    c1[1].addItemListener(this);
    t1[0].addActionListener(this);
    t1[1].addActionListener(this);
    t1[2].addActionListener(this);
    t1[3].addActionListener(this);
    output=new JTextArea();
    setArea();
    jt=new JTable(wam);
    jt.setBackground(bg);
    jt.setFont(l1[0].getFont());
    output.setFont(l1[0].getFont());
    output.setForeground(l1[0].getForeground());
    outputPanel.add(output,BorderLayout.NORTH);
    outputPanel.add(jt,BorderLayout.SOUTH);
    totalPanel.add(inputPanel,BorderLayout.NORTH);
    totalPanel.add(outputPanel,BorderLayout.SOUTH);        
        pane3.add(totalPanel);
        textA.setBackground(bg);
        pane3.add(textAP,BorderLayout.SOUTH);
        tabbedPane.addTab(PLOTPANEL,    pane2);
        tabbedPane.addTab(KONTROLPANEL, pane1);
        tabbedPane.addTab(Psikometri, pane3);
        contentPane.add(  tabbedPane, BorderLayout.CENTER);
    }

    public void itemStateChanged(ItemEvent e)
    {
    inputXmin.setText(Double.toString(jta.p1.xmin));
    inputXmax.setText(Double.toString(jta.p1.xmax));
    inputYmin.setText(Double.toString(jta.p1.ymin));
    inputYmax.setText(Double.toString(jta.p1.ymax));
    inputXntic.setText(Integer.toString(jta.p1.xntic));
    inputYntic.setText(Integer.toString(jta.p1.yntic));
    Object source=e.getItemSelectable();
    if(source==inputXgridon)
    {
     if (e.getStateChange() == ItemEvent.DESELECTED)
     {
     jta.p1.xgridon=0;
     }
     else
     {
      jta.p1.xgridon=1;
     }
    }
    else if(source==inputYgridon)
    {
     if (e.getStateChange() == ItemEvent.DESELECTED)
     {
     jta.p1.ygridon=0;
     }
     else
     {
      jta.p1.ygridon=1;
     }
    }
    inputLabel.setText(jta.p1.label);
    inputXLabel.setText(jta.p1.xlabel);
    inputYLabel.setText(jta.p1.ylabel);
      unit=(String)c1[0].getSelectedItem();
  pair=(String)c1[1].getSelectedItem();
  int loc=pair.indexOf('_');
  String ss1=pair.substring(0,loc);
  String ss2=pair.substring((loc+1),pair.length());
  t1[3].setText(pair);
  if(ss1.equals("tdb")) l1[3].setText(" dry bulb Temperature ");
  else if(ss1.equals("w")) l1[3].setText(" specific humidity ");
  if(ss2.equals("twb")) l1[4].setText(" wet bulb Temperature ");
  else if(ss2.equals("rh")) l1[4].setText(" relative humidity ");
  else if(ss2.equals("w")) l1[4].setText(" specific humidity ");
  else if(ss2.equals("tdew")) l1[4].setText(" dew point Temperature ");
  else if(ss2.equals("pv")) l1[4].setText(" vapor pressure ");
  else if(ss2.equals("dos")) l1[4].setText(" degree of saturation ");
  else if(ss2.equals("h")) l1[4].setText(" enthalpy ");
  else if(ss2.equals("s")) l1[4].setText(" entropy ");

  if(unit.equals("SI"))
  {
  l2[2].setText(" bars");
  if(ss1.equals("tdb")) l2[3].setText(" degree C ");
  else if(ss1.equals("w")) l2[3].setText(" kg water vapor/kg dry air");
  if(ss2.equals("twb")) l2[4].setText(" degree C");
  else if(ss2.equals("rh")) l2[4].setText(" ");
  else if(ss2.equals("w")) l2[4].setText(" kg water vapor/kg dry air");
  else if(ss2.equals("tdew")) l2[4].setText(" degree C");
  else if(ss2.equals("pv")) l2[4].setText(" bars");
  else if(ss2.equals("dos")) l2[4].setText(" ");
  else if(ss2.equals("h")) l2[4].setText(" KJ/kg dry air");
  else if(ss2.equals("s")) l2[4].setText(" KJ/K kg dry air");
  }
  else
  {
  l2[2].setText(" lbf/in^2 (psia)");
  if(ss1.equals("tdb")) l2[3].setText(" degree F ");
  else if(ss1.equals("w")) l2[3].setText(" lbm water vapor/lbm dry air");
  if(ss2.equals("twb")) l2[4].setText(" degree F");
  else if(ss2.equals("rh")) l2[4].setText(" ");
  else if(ss2.equals("w")) l2[4].setText(" lbm water vapor/lbm dry air");
  else if(ss2.equals("tdew")) l2[4].setText(" degree F");
  else if(ss2.equals("pv")) l2[4].setText(" lbf/in^2 (psia)");
  else if(ss2.equals("dos")) l2[4].setText(" ");
  else if(ss2.equals("h")) l2[4].setText(" BTU/lbm dry air");
  else if(ss2.equals("s")) l2[4].setText(" BTU/R lbm dry air");
  }
  t1[1].setText("");
  t1[2].setText("");
  jta.yenidenciz();
  repaint();
    }


  
    public void actionPerformed(ActionEvent e)
    {
    if (e.getSource()==printButton )
    {
    jta.yazdir();
    }
    Double valXmin=new Double(inputXmin.getText());
    jta.p1.xmin=valXmin.doubleValue();
    Double valXmax=new Double(inputXmax.getText());
    jta.p1.xmax=valXmax.doubleValue();
    Double valYmin=new Double(inputYmin.getText());
    jta.p1.ymin=valYmin.doubleValue();
    Double valYmax=new Double(inputYmax.getText());
    jta.p1.ymax=valYmax.doubleValue();
    //*****
    Integer valXntic=new Integer(inputXntic.getText());
    jta.p1.xntic=valXntic.intValue();
    Integer valYntic=new Integer(inputYntic.getText());
    jta.p1.yntic=valYntic.intValue();
    //*****
    jta.p1.label=inputLabel.getText();
    jta.p1.xlabel=inputXLabel.getText();
    jta.p1.ylabel=inputYLabel.getText();
    jta.yenidenciz();
    if(e.getSource()==t1[3])
  {
  String st1=(String)c1[1].getSelectedItem();
  pair=st1;
  String st2=t1[3].getText();
     for(int j=0;j<s2.length;j++)
     {
        if(s2[j].equals(st2))
        {   pair=st2;
            c1[1].setSelectedItem(st2);
            break;
        }
     }
  }
  else
  {
  Double V0=new Double(t1[0].getText());
  P=V0.doubleValue();
  Double V1=new Double(t1[1].getText());
  v1=V1.doubleValue();
  Double V2=new Double(t1[2].getText());
  v2=V2.doubleValue();
  wam.setValues(unit,pair,v1,v2,P);
  aa=wa.property(pair,v1,v2,P);
  xi=aa[1];
  yi=aa[5];
  xn++;
  xx[xn-1]=xi;yy[xn-1]=yi;
  jta.setXY(xx,yy,xn);
  line=wam.readValue()+"\n";
  textA.append(line);
  System.out.print(line);   
  jta.yenidenciz();
  //setArea();
  repaint();
  }
}      
      public static void plot(Plot1 pi)
      {
      //take plot data from pi object
	  PlotWetAir pencere= new PlotWetAir(pi);
      pencere.addWindowListener(new BasicWindowMonitor());
      pencere.setSize(1000,800);
      pencere.setVisible(true);
      }

      public static void plot(Plot1 pi,double Pi)
      {
      //take plot data from pi object
	  PlotWetAir pencere= new PlotWetAir(pi);
	  pencere.setP(Pi);
      pencere.addWindowListener(new BasicWindowMonitor());
      pencere.setSize(1000,800);
      pencere.setVisible(true);
      }


      public void degerleriGir(String e,int x,int y)
      {
      s=e;
      xi=jta.p1.xmin+(double)(x-jta.p1.xabsmin)/(double)jta.p1.abswidth*(jta.p1.xmax-jta.p1.xmin);
      yi=jta.p1.ymin-(double)(y-jta.p1.yabsmin-jta.p1.absheight)/(double)jta.p1.absheight*(jta.p1.ymax-jta.p1.ymin);
      xn++;
      xx[xn-1]=xi;yy[xn-1]=yi;
      jta.setXY(xx,yy,xn);
      altbar.setText(e+" ["+toString(xi,5,2)+" , "+toString(yi,6,4)+"] ");
      wam.setValues(unit,"tdb_w",xi,yi,P);
      line=wam.readValue()+"\n";
      textA.append(line);
      pair="tdb_w";
      int loc=pair.indexOf('_');
      String ss1=pair.substring(0,loc);
      String ss2=pair.substring((loc+1),pair.length());
      t1[3].setText(pair);
      t1[1].setText(""+xi);
      t1[2].setText(""+yi);
      ss1="tdb";
      l1[3].setText(" dry bulb Temperature ");
      ss2="w";
      l1[4].setText(" specific humidity ");
      l2[2].setText(" bars");
      l2[3].setText(" degree C ");
      l2[4].setText(" kg water vapor/kg dry air");
  t1[1].setText(""+xi);
  t1[2].setText(""+yi);
  System.out.print(line);   
  jta.yenidenciz();
  repaint();
  }
      
      public void degerleriGir1(String e,int x,int y)
      {
      s=e;
      xi1=jta.p1.xmin+(double)(x-jta.p1.xabsmin)/(double)jta.p1.abswidth*(jta.p1.xmax-jta.p1.xmin);
      yi1=jta.p1.ymin-(double)(y-jta.p1.yabsmin-jta.p1.absheight)/(double)jta.p1.absheight*(jta.p1.ymax-jta.p1.ymin);
      altbar.setText(e+" ["+toString(xi1,5,2)+" , "+toString(yi1,6,4)+"] ");
      }
      
 public void mouseClicked(MouseEvent e)

 {  }

 public void mousePressed(MouseEvent e)
 { 
   degerleriGir("Basıldı",e.getX(),e.getY());
 }

  public void mouseReleased(MouseEvent e)
 { 
 }

 public void mouseEntered(MouseEvent e)
 { }

 public void mouseExited(MouseEvent e)
 { }

//MouseMotionListener (fare hareket dinleyicisi) metotlari

 public void mouseDragged(MouseEvent e)
 {degerleriGir1("Fare tuş basılı hareket ediyor",e.getX(),e.getY());}
 
 public void mouseMoved(MouseEvent e)
 {degerleriGir1("Fare hareket ediyor",e.getX(),e.getY());}
 
 public static String toString(double left, int w, int d)
  // converts a double to a string with given width and decimals.
  {
	NumberFormat df=NumberFormat.getInstance(Locale.US);
	df.setMaximumFractionDigits(d);
    df.setMinimumFractionDigits(d);
    df.setGroupingUsed(false);
    String s = df.format(left);
    while (s.length() < w)
      s = " " + s;
    if (s.length() > w)
    {
        s = "";
        for (int i=0; i<w; i++)
          s = s + "-";
    }
    return s;
 }
      public static void main(String[] args)
      {
       /* wet air return variables 
       aa[0]=P;
       aa[1]=v1;
       aa[2]=ap[2];
       aa[3]=pv;
       aa[4]=Pa;
       aa[5]=w;
       aa[6]=rh;
       aa[7]=dos;
       aa[8]=h;
       aa[9]=s;
  aa[10]=tdp;
  aa[11]=ha;
  aa[12]=hv;
  aa[13]=w*hv;
  //options for input selection switch   "tdb_twb"  dry bulb - wet bulb temperatures
  //                                     "tdb_rh"   dry bulb temperature - relative humidity
  //                                     "tdb_w"    dry bulb temperature - specific humidity
  //                                     "tdb_tdew" dry bulb temperature - dew point temperature
  //                                     "tdb_pv"   dry bulb temperature - water vapor pressure
  //                                     "tdb_dos"  dry bulb temperature - degree of saturation
  //                                     "tdb_h"    dry bulb temperature - enthalpy
  //                                     "tdb_s"    dry bulb temperature - enthropy
  //                                     "w_rh"     specific humidity    - relative humifdity
  //                                     "w_h"      specific humidity    -  enthalpy
  */
     wetair w=new wetair();
     double aa[]=new double[14];  
     double bb[]=new double[14];  
	 f2 ff=new f2();
	 double x1[][]=new double[62][51];
	 double y1[][]=new double[62][51];
     //initilise as a function plot
     double P=1.01325;
     int i,j;
     i=0;
     double h;
     for(double rh=0.1;rh<=1.0;rh+=0.1)
     {   j=0;
         for(double t=0.0;t<=50.0;t+=1.0)
         {
	     aa=w.property("tdb_rh",t,rh,P);
	     h=aa[8];
	        if(rh>0.99) 
            { 
	        h=aa[8];
            x1[11+j][0]=t;y1[11+j][0]=aa[5];bb=w.property("w_h",0.0,h,P);
            x1[11+j][1]=bb[10];y1[11+j][1]=0.0;
            }
	        x1[i][j]=t;
            y1[i][j]=aa[5];
	        j++;
            }
         i++;
     }
     Plot1 pp=new Plot1(x1,y1);
     pp.setPlabel("Psikometri");
     pp.setXlabel("T C kuru termometre sıcaklıgı");
     pp.setYlabel("w mutlak nem kg nem/kg kuru hava");
     pp.setMinMax(0.0,50.0,0,0.05);
     pp.setXgrid(1);
     pp.setYgrid(1);
     plot(pp,P);
     }
 }

