unit main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Values, StdCtrls, ComCtrls, ImgList, ToolWin, ExtCtrls;
type
TForm1 =
class(TForm)
Button1: TButton;
Button2: TButton;
sdMain: TSaveDialog;
Button3: TButton;
odMain: TOpenDialog;
Memo1: TMemo;
Timer1: TTimer;
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject;
var Action: TCloseAction);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
v : TResultTable;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
randomize;
v := TResultTable.Create(0,100,1,10);
end;
procedure TForm1.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
v.Destroy;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
x,y : integer;
begin
randomize;
for y := 1
to 10
do
begin
x := -v.Resolution;
while x < v.MaxLambda-v.Resolution
do
begin
x := x + v.Resolution;
v.AddValue(x,random(5000)/1000)
end;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
sl : TStringList;
x,y : Integer;
begin
if sdMain.Execute
then
begin
sl := TStringList.Create;
for y := 1
to 10
do
begin
x := -v.Resolution;
while x < v.MaxLambda-v.Resolution
do
begin
x := x + v.Resolution;
sl.Add(FloatToStr(v.GetValue(x,y)))
end;
end;
sl.SaveToFile(sdMain.Filename+'
.sfkj');
sl.Destroy;
end;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
if odMain.Execute
then
begin
memo1.Lines.LoadFromFile(odMain.FileName);
end;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Label2.Visible:= true
end;
end.