unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,unit1,
  StdCtrls,ftdata, Spin,unit3,unit4;

type
  TForm2 = class(TForm)
    CheckBox1: TCheckBox;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    SpinEdit1: TSpinEdit;
    Label1: TLabel;
    Button4: TButton;
    procedure Button1Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure CheckBox1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure SpinEdit1Change(Sender: TObject);
    procedure Button4Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }

  end;

var
  Form2: TForm2;

implementation



{$R *.DFM}


procedure TForm2.Button1Click(Sender: TObject);
begin
{checkbox1.checked:=false; }
a:=0;
form1.FillGraph;
form1.Analyse;
end;

procedure TForm2.FormShow(Sender: TObject);
begin
{form1.show;form3.show;}
ftdata.da:=(strtointdef(spinedit1.text,10)/10)*pi/300;
Button4Click(self);
end;

procedure TForm2.CheckBox1Click(Sender: TObject);
begin
form1.calc:=checkbox1.Checked;
{if form1.calc then BeginThread(nil,0,MYthread,pointer(form1),0,MyThreadId);}
application.OnIdle:=form1.idle;
end;

procedure TForm2.Button2Click(Sender: TObject);
begin
form1.analyse;
form1.calcstep;
form1.showgraph;
end;

procedure TForm2.Button3Click(Sender: TObject);
begin
form4.show;
end;

procedure TForm2.SpinEdit1Change(Sender: TObject);
begin
spinedit1.increment:=1+strtointdef(spinedit1.text,10)div 10;
ftdata.da:=(strtointdef(spinedit1.text,10)/10)*pi/300;

end;

procedure TForm2.Button4Click(Sender: TObject);
begin
with form3 do begin
min:=-1;mid:=0;max:=1;highelement:=maxC-1;table:=@ftdata.table;
show;
left:=0;top:=0;
width:=250;height:=200;
end;
with form3DUP do begin
min:=-pi;mid:=0;max:=pi;highelement:=maxC-1;table:=@ftdata.phases;
show;
left:=form3.left+form3.width;top:=form3.top;
width:=form3.width;height:=200;
end;
with form1 do begin
show;
left:=0;top:=form3.top+form3.height;
height:=150;
with form2 do begin
left:=form3dup.left+form3dup.width;top:=0;
end;
end;
end;
initialization

end.
