unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Timer1: TTimer;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Button1: TButton;
Button2: TButton;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
Label14: TLabel;
Label15: TLabel;
Label16: TLabel;
Label17: TLabel;
Label18: TLabel;
Label19: TLabel;
Label20: TLabel;
Label21: TLabel;
Label22: TLabel;
Label23: TLabel;
Label24: TLabel;
Label25: TLabel;
Label26: TLabel;
Label27: TLabel;
Label28: TLabel;
procedure Timer1Timer(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
tobrabzadK1, tobrabzadK2, tobrabzadK3: Integer;
TimeNow, NachProg, KonProg, WorkTime: TDateTime;
Vremy,tpostzad, tnachrab : Integer;
tnachobrK1, tnachobrK2, tnachobrK3 : Integer;
tkonobrK1, tkonobrK2, tkonobrK3 : Integer;
ksostfonK2, ksostfonK3, K1sost, K2sost,K3sost: Boolean;
tnachfonzadK2 , tnachfonzadK3, tpreryvfonzadK2, tpreryvfonzadK3 : Integer;
tobshobrzadK1, tobshobrzadK2, tobshobrzadK13 : Integer;
EH1, EH2, EH3, EmaxH1, EmaxH2, EmaxH3 : Integer;
shetfonzadK2, schetfonzadK3, schetzadK1, schetzadK2, schetzadK3 : Integer;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
NachProg := Time;
Label3.Caption := TimeToStr(NachProg);
tpostzad :=4+random(5);
tobrabzadK1 := 4+random(5);
tobrabzadK2 := 3+random(5);
tobrabzadK3 := 5+random(8);
Label8.Caption := IntToStr(tpostzad);
tnachrab := Vremy;
ksostfonK2:=true;
ksostfonK3 :=true;
K1sost :=true;
K2sost :=true;
K3sost := true;
EH1 :=0;
EH2 :=0;
EH3 :=0;
tpostzad :=0;
tnachobrK1 :=0;
tnachobrK2 :=0;
tnachobrK3 :=0;
tkonobrK1 :=0;
tkonobrK2 :=0;
tkonobrK3 :=0;
Label10.Caption := IntToStr(tnachrab);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
KonProg := Time;
Label7.Caption := TimeToStr(KonProg);
WorkTime := KonProg-NachProg;
Label6.Caption := TimeToStr(WorkTime);
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
TimeNow := Time;
Label1.Caption := TimeToStr(TimeNow);
Vremy := Vremy+1;
Label9.Caption := IntToStr(Vremy);
Label28.Caption := IntToStr(Vremy-tnachrab);
if (tpostzad <= Vremy - tnachrab) then
begin
if K1sost = false then
begin
EH1 := EH1+1;
Label20.Caption := IntToStr(EH1);
end
else
begin
tnachobrK1 := Vremy;
K1sost := false;
end
end
end;
end.