All pastes #896885 Raw Edit

Anonymous

public text v1 · immutable
·published 2008-02-09 00:53 UTC
rendered paste body
procedure TControleZTM.OnClockTimer(Sender: TObject);
var
  TempoTotal: Integer;
  Segundos: String;
begin
  case FModoOperacao of
    zmAutomatico:
      begin
        TempoTotal := (FTiAuto.Minutos * 60) + FTiAuto.Segundos;
        Dec(TempoTotal);
        FTiAuto.Minutos := TempoTotal div 60;
        FTiAuto.Segundos := TempoTotal mod 60;
        Segundos := IntToStr(FTiAuto.Segundos);
        if FTiAuto.Segundos<10 then
          Insert('0', Segundos, 1);
        if FTiAuto.Posicoes.IndexOf(Segundos) > -1 then
          Velocidade := Velocidade - FTiAuto.Velocidade;
      end;
    zmManual:
      begin
        TempoTotal := (FTiManual.Minutos * 60) + FTiManual.Segundos;
        Dec(TempoTotal);
        FTiManual.Minutos := TempoTotal div 60;
        FTiManual.Segundos := TempoTotal mod 60;
      end;
  end;
  if TempoTotal = 0 then
    Parar;
end;