Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 21st, 2012  |  syntax: None  |  size: 1.50 KB  |  hits: 24  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. procedure TfrmGPS.tmrUploadTimer(Sender: TObject);
  2. var
  3.     Vehicle, URL, Password: String;
  4.     ReportedSpeed: Double;
  5. begin
  6.     try
  7.         tmrUpload.Enabled := False;
  8.         pnlUploading.Color := clYellow;
  9.         pnlUploading.Refresh;
  10.         if chkUploadPosition.Checked and (LatitudeString <> '') then begin
  11.             if ParamCount >= 4 then begin
  12.                 Vehicle := ParamStr(4);
  13.             end else begin
  14.                 Vehicle := 'daveake_Chase';
  15.             end;
  16.  
  17.             Password := 'aurora';
  18.  
  19.             ReportedSpeed := Speed;
  20.             if chkSpeedLimiter.Checked then begin
  21.                 ReportedSpeed := Min(Speed, 112);
  22.             end;
  23.  
  24.  
  25.             URL := 'http://spacenear.us/tracker/track.php' +
  26.                    '?vehicle=' + Vehicle +
  27.                     '&time=' + UTCTime +
  28.                     '&lat=' + FormatFloat('00.000000', Latitude) +
  29.                     '&lon=' + FormatFloat('00.000000', Longitude) +
  30.                     '&speed=' + FormatFloat('0.0', ReportedSpeed) +
  31.                     '&alt=' + FormatFloat('0', Altitude) +
  32.                     '&heading=' + FormatFloat('0', Direction) +
  33.                     '&pass=' + Password;
  34.  
  35.             HttpCli1.URL := URL;
  36.             tmrTimeout.Enabled := True;
  37.             HttpCli1.Get;
  38.             pnlStatus.Color := clLime;
  39.             LastUpload := Now;
  40.         end;
  41.     except
  42.         pnlStatus.Color := clRed;
  43.     end;
  44.     pnlUploading.Color := clGray;
  45.     tmrUpload.Enabled := True;
  46. end;