绘制每秒一次的车辆

This commit is contained in:
wangcongtao
2020-10-28 14:31:12 +08:00
parent 9da8c1fdee
commit 5385199493
20 changed files with 566 additions and 77 deletions

View File

@@ -2,6 +2,7 @@ package com.mogo.module.common.entity;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import java.util.List;
@@ -11,11 +12,14 @@ import java.util.List;
*/
public class CloudRoadData implements Parcelable {
/**物体类型*/
private int type;
private int type = -1;
private double lat;
private double lon;
private String uuid;
private String sn;
private double speed;
private long systemTime;
@@ -29,53 +33,9 @@ public class CloudRoadData implements Parcelable {
private double distance ;//距离
public List<CloudLocationInfo> coordinates;
private List<CloudLocationInfo> coordinates;
protected CloudRoadData(Parcel in) {
type = in.readInt();
lat = in.readDouble();
lon = in.readDouble();
speed = in.readDouble();
systemTime = in.readLong();
lightStatus = in.readInt();
lightLeftTime = in.readInt();
rtmpUrl = in.readString();
distance = in.readDouble();
coordinates = in.createTypedArrayList(CloudLocationInfo.CREATOR);
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(type);
dest.writeDouble(lat);
dest.writeDouble(lon);
dest.writeDouble(speed);
dest.writeLong(systemTime);
dest.writeInt(lightStatus);
dest.writeInt(lightLeftTime);
dest.writeString(rtmpUrl);
dest.writeDouble(distance);
dest.writeTypedList(coordinates);
}
@Override
public int describeContents() {
return 0;
}
public static final Creator<CloudRoadData> CREATOR = new Creator<CloudRoadData>() {
@Override
public CloudRoadData createFromParcel(Parcel in) {
return new CloudRoadData(in);
}
@Override
public CloudRoadData[] newArray(int size) {
return new CloudRoadData[size];
}
};
public int getType() {
return type;
}
@@ -155,4 +115,70 @@ public class CloudRoadData implements Parcelable {
public void setCoordinates(List<CloudLocationInfo> coordinates) {
this.coordinates = coordinates;
}
public String getUuid() {
return uuid;
}
public String getSn() {
return sn;
}
public String getUniqueKey(){
if (! TextUtils.isEmpty( uuid ) ) {
return uuid;
}
return sn;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel( Parcel dest, int flags ) {
dest.writeInt( this.type );
dest.writeDouble( this.lat );
dest.writeDouble( this.lon );
dest.writeString( this.uuid );
dest.writeString( this.sn );
dest.writeDouble( this.speed );
dest.writeLong( this.systemTime );
dest.writeInt( this.lightStatus );
dest.writeInt( this.lightLeftTime );
dest.writeString( this.rtmpUrl );
dest.writeDouble( this.distance );
dest.writeTypedList( this.coordinates );
}
public CloudRoadData() {
}
protected CloudRoadData( Parcel in ) {
this.type = in.readInt();
this.lat = in.readDouble();
this.lon = in.readDouble();
this.uuid = in.readString();
this.sn = in.readString();
this.speed = in.readDouble();
this.systemTime = in.readLong();
this.lightStatus = in.readInt();
this.lightLeftTime = in.readInt();
this.rtmpUrl = in.readString();
this.distance = in.readDouble();
this.coordinates = in.createTypedArrayList( CloudLocationInfo.CREATOR );
}
public static final Creator< CloudRoadData > CREATOR = new Creator< CloudRoadData >() {
@Override
public CloudRoadData createFromParcel( Parcel source ) {
return new CloudRoadData( source );
}
@Override
public CloudRoadData[] newArray( int size ) {
return new CloudRoadData[size];
}
};
}