function TForm1.Bool(val: integer): boolean; begin if val = 1 then Bool := false else Bool := true; end;
procedure TForm1.Timer1Timer(Sender: TObject); begin
hhALed1.Value := Bool(Io379.getbit(3));
hhALed2.Value := Bool(Io379.getbit(4));
hhALed3.Value := Bool(Io379.getbit(5));
hhALed4.Value := Bool(Io379.getbit(6));
hhALed5.Value := not Bool(Io379.getbit(7));
hhALed6.Value := not Bool(Io37A.getbit(3));
hhALed7.Value := not Bool(Io378.getbit(1));
hhALed8.Value := not Bool(Io378.getbit(2));
if (hhALed1.Value=true) and (hhALed4.Value=false) then
hhAled7.Value:=true;
if (hhALed4.Value=true) and (hhALed1.Value=false) then
hhAled7.Value:=false;
if hhALed7.Value=true then begin
linha1.Brush.Color:=$00EDD7B1;
linha2.Brush.Color:=$00EDD7B1; endelsebegin
linha1.Brush.Color:=clWhite;
linha2.Brush.Color:=clWhite; end;
if (hhALed4.value=true) and (hhALed1.value=false) then
hhALed8.value:=true;
if (hhALed3.value=true) or (hhALed4.value=false) then
hhALed8.value:=false;
if (hhALed1.value=true) and (hhALed2.value=false) and
(hhALed3.value=false) then
caixa1.progress:=5 else if (hhALed1.value=true) and (hhALed2.value=true) and
(hhALed3.value=false) then
caixa1.progress:=50 else if (hhALed1.value=true) and (hhALed2.value=true) and
(hhALed3.value=true) then
caixa1.progress:=95 else
caixa1.progress:=0;
if (hhALed4.value=true) and (hhALed5.value=false) and
(hhALed6.value=false) then
caixa2.progress:=5 else if (hhALed4.value=true) and (hhALed5.value=true) and
(hhALed6.value=false) then
caixa2.progress:=50 else if (hhALed4.value=true) and (hhALed5.value=true) and
(hhALed6.value=true) then
caixa2.progress:=95 else
caixa2.progress:=0;
if hhALed8.value=true then
linha3.Brush.color:=$00EDD7B1 else
linha3.Brush.color:=clWhite;
if hhALed7.Value=true then
io378.setbit(1) else
io378.clrbit(1); if hhALed8.Value=true then
io378.setbit(2) else
io378.clrbit(2); end;
procedure TForm1.FormShow(Sender: TObject); begin
IO379.reset;
IO378.reset;
IO37A.reset; end;
procedure TForm1.Sair1Click(Sender: TObject); begin
close; end;
procedure TForm1.Sobre1Click(Sender: TObject); begin
form2.showmodal; end;
procedure TForm1.BitBtn2Click(Sender: TObject); begin
io378.setbit(2); end;
procedure TForm1.BitBtn3Click(Sender: TObject); begin
io378.setbit(1); end;
procedure TForm1.BitBtn4Click(Sender: TObject); begin if hhALed5.value=true then begin
io378.setbit(2);
io378.clrbit(1); end; if hhAled4.value=false then begin
io378.setbit(1);
io378.clrbit(2); end; end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction); begin
IO379.reset;
IO378.reset;
IO37A.reset; end;
procedure TForm1.BitBtn5Click(Sender: TObject); begin
io378.clrbit(1);
io378.clrbit(2); end;