//==================================//
// ARDUINO veri sistem entegrasyonu                 //
//                                                                              //                   
// M. Turhan Coban                                                //
//==================================//
import java.io.*;
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import javax.swing.table.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.event.*;
import java.awt.geom.*;
import java.awt.Graphics;
public class dials1 extends JPanel 
{ private static final long serialVersionUID = 7859657L;
 public analogDialP tp[];
 JPanel jp;
 JPanel jp1;
 JTextArea output;
public dials1(String s1,String unit,String s[],double td[],double tmin,double tmax,double teta1_rad,double teta2_rad)
{ 
  int n=td.length;
  tp=new analogDialP[n];
  jp=new JPanel();
  jp1=new JPanel();
  jp.setLayout(new GridLayout(1,1));
 for(int i=0;i<n;i++)
 {  
	 tp[i]=new analogDialP(s[i],unit,tmin,tmax,teta1_rad,teta2_rad,5,10);tp[i].setx(td[i]);jp.add(tp[i]);}
    String ss="Arduino DS18S20 digital termometer";
    Color c=this.getBackground();
    output=new JTextArea(ss);
    output.setBackground(c);
    this.setLayout(new BorderLayout());
    add(output,BorderLayout.NORTH);
    add(jp,BorderLayout.CENTER);	
}
public dials1(String s1,String unit[],String s[],double td[],double tmin,double tmax,double teta1_rad,double teta2_rad)
{ 
  int n=td.length;
  tp=new analogDialP[n];
  jp=new JPanel();
  jp1=new JPanel();
  jp.setLayout(new GridLayout(1,1));
 for(int i=0;i<n;i++)
 {  
	 tp[i]=new analogDialP(s[i],unit[i],tmin,tmax,teta1_rad,teta2_rad,5,10);tp[i].setx(td[i]);jp.add(tp[i]);}
    String ss="Arduino DS18S20 digital termometre";
    Color c=this.getBackground();
    output=new JTextArea(ss);
    output.setBackground(c);
    this.setLayout(new BorderLayout());
    add(output,BorderLayout.NORTH);
    add(jp,BorderLayout.CENTER);	
}
public  void setData(double td[])
{ int n=td.length;
  for(int i=0;i<n;i++)
  {tp[i].setx(td[i]);}
  repaint();
}

}
