117
procedure bCommandClick(Sender: TObject);
private
{ Private declarations }
FLift : TLift;
procedure LiftOnProcess(Sender: TObject);
public
{ Public declarations }
end;
var
fMain: TfMain;
implementation
{$R *.dfm}
procedure TfMain.bCallClick(Sender: TObject);
begin
fCommandMaker.Lift := FLift;
fCommandMaker.Caption := bCall.Caption;
if fCommandMaker.ShowModal = mrOk then
begin
FLift.AddCall(fCommandMaker.Level);
end;
end;
procedure TfMain.bCommandClick(Sender: TObject);
begin
fCommandMaker.Lift := FLift;
fCommandMaker.Caption := bCommand.Caption;
if fCommandMaker.ShowModal = mrOk then
begin
FLift.AddCommand(fCommandMaker.Level);
end;
end;
procedure TfMain.FormCreate(Sender: TObject);
begin
FLift := TLift.Create;
FLift.OnProcess := LiftOnProcess;
end;
procedure TfMain.LiftOnProcess(Sender: TObject);
var
Lift : TLift;
begin
//
Lift := Sender as TLift;
cbLiftState.ItemIndex := Ord(Lift.LiftState);
cbLiftMoving.ItemIndex := Ord(Lift.LiftMoving);
tbLevel.Max := Lift.HighLevel;
tbLevel.Min := Lift.LowLevel;
lLowLevel.Caption := IntToStr(Lift.LowLevel);
lHighLevel.Caption := IntToStr(Lift.HighLevel);
tbLevel.Position := Lift.HighLevel - Lift.Level + 1;
lLevel.Caption := IntToStr(Lift.Level);
if Lift.WaitTime > 0 then