69 lines
1.5 KiB
Java
69 lines
1.5 KiB
Java
package com.safemobile.lib;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import android.util.Log;
|
|
|
|
public class SuperVehicle extends Vehicle{
|
|
|
|
public double lat=0;
|
|
public double lng=0;
|
|
public boolean needUpdate=false;
|
|
public int speed=0;
|
|
public long timeGMT=0;
|
|
public String Address="";
|
|
public boolean isON=false;
|
|
|
|
public SuperVehicle(long sc_id, String imei, long lp, String name, long driver_id, int time_route, int GPS_reporting_interval, int is_stolen)
|
|
{
|
|
super(sc_id, imei, lp, name, driver_id, time_route, GPS_reporting_interval,
|
|
is_stolen);
|
|
// TODO Auto-generated constructor stub
|
|
}
|
|
|
|
public void SetDataFromLastPos(Double _lat,Double _lng,long _time,int _speed,String _Address,Boolean _isON)
|
|
{
|
|
try
|
|
{
|
|
lat = _lat;
|
|
lng = _lng;
|
|
timeGMT = _time;
|
|
speed = _speed;
|
|
Address = _Address;
|
|
isON = _isON;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Log.d("Erorr", "Contert Error:"+ex.toString());
|
|
}
|
|
}
|
|
|
|
public void SetNewPosition(Double _lat,Double _lng,long _time,int _speed)
|
|
{
|
|
try
|
|
{
|
|
lat = _lat;
|
|
lng = _lng;
|
|
timeGMT = _time;
|
|
speed = _speed;
|
|
isON = true;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Log.d("Erorr", "Contert Error:"+ex.toString());
|
|
}
|
|
}
|
|
|
|
public String GetUnixTimeDisplay()
|
|
{
|
|
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss dd-MMM");
|
|
|
|
return sdf.format(timeGMT*1000);
|
|
}
|
|
|
|
public String toString()
|
|
{
|
|
return "name: " + name + "imei: " + imei + " | LAT: " + lat + " | LNG: " + lng + " | speed: " + speed + " | timeGMT: " + timeGMT + " | Address: " + Address + " | isON: " + isON;
|
|
}
|
|
}
|