remix the aiCloudSocketData

This commit is contained in:
zhongchao
2021-05-25 15:55:08 +08:00
parent 716e02a9cb
commit 4010c27dbe
40 changed files with 1127 additions and 854 deletions

View File

@@ -0,0 +1,314 @@
package com.mogo.service.locationinfo;
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.RequiresApi;
import java.util.Objects;
/**
* 自车定位信息
*/
public class CloudLocationInfo implements Parcelable {
/**
* 纬度
*/
private double lat;
/**
* 经度
*/
private double lon;
/**
* 车头方向
*/
private double heading;
/**
* 系统时间
*/
private long systemTime;
/**
* 卫星时间
*/
private long satelliteTime;
/**
* 海拔
*/
private double alt;
/**
* 车速
*/
private double speed;
/**
* 车辆类型
* 0:普通车辆、家用车
*/
private int vehicleType = 0;
/**
* 道路ID
*/
private String roadId;
/**
* 车道ID-2D路段
*/
private String laneId;
/**
* 车道号中心线编号为0中心线右侧编号为负数3车道通行Road的车道编号0-1-2-3
*/
private int laneNum;
/**
* 限速
*/
private double rateLimiting;
/**
* 瓦片id
*/
private String tileId;
/**
* 车道宽度
*/
private double roadWidth;
public CloudLocationInfo() {
}
public CloudLocationInfo(CloudLocationInfo info) {
this.lat = info.getLat();
this.lon = info.getLon();
this.heading = info.getHeading();
this.systemTime = System.currentTimeMillis();
this.satelliteTime = System.currentTimeMillis();
this.alt = info.alt;
this.speed = info.speed;
this.vehicleType = info.vehicleType;
this.roadId = info.roadId;
this.laneId = info.laneId;
this.laneNum = info.laneNum;
this.rateLimiting = info.rateLimiting;
this.tileId = info.tileId;
this.roadWidth = info.roadWidth;
}
protected CloudLocationInfo(Parcel in) {
lat = in.readDouble();
lon = in.readDouble();
heading = in.readDouble();
systemTime = in.readLong();
satelliteTime = in.readLong();
alt = in.readDouble();
speed = in.readDouble();
vehicleType = in.readInt();
roadId = in.readString();
laneId = in.readString();
laneNum = in.readInt();
rateLimiting = in.readDouble();
tileId = in.readString();
roadWidth = in.readDouble();
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeDouble(lat);
dest.writeDouble(lon);
dest.writeDouble(heading);
dest.writeLong(systemTime);
dest.writeLong(satelliteTime);
dest.writeDouble(alt);
dest.writeDouble(speed);
dest.writeInt(vehicleType);
dest.writeString(roadId);
dest.writeString(laneId);
dest.writeInt(laneNum);
dest.writeDouble(rateLimiting);
dest.writeString(tileId);
dest.writeDouble(roadWidth);
}
@Override
public int describeContents() {
return 0;
}
public static final Creator<CloudLocationInfo> CREATOR = new Creator<CloudLocationInfo>() {
@Override
public CloudLocationInfo createFromParcel(Parcel in) {
return new CloudLocationInfo(in);
}
@Override
public CloudLocationInfo[] newArray(int size) {
return new CloudLocationInfo[size];
}
};
public double getLat() {
return lat;
}
public void setLat(double lat) {
this.lat = lat;
}
public double getLon() {
return lon;
}
public void setLon(double lon) {
this.lon = lon;
}
public double getHeading() {
return heading;
}
public void setHeading(double heading) {
this.heading = heading;
}
public long getSystemTime() {
return systemTime;
}
public void setSystemTime(long systemTime) {
this.systemTime = systemTime;
}
public long getSatelliteTime() {
return satelliteTime;
}
public void setSatelliteTime(long satelliteTime) {
this.satelliteTime = satelliteTime;
}
public double getAlt() {
return alt;
}
public void setAlt(double alt) {
this.alt = alt;
}
public double getSpeed() {
return speed;
}
public void setSpeed(double speed) {
this.speed = speed;
}
public int getVehicleType() {
return vehicleType;
}
public void setVehicleType(int vehicleType) {
this.vehicleType = vehicleType;
}
public String getRoadId() {
return roadId;
}
public void setRoadId(String roadId) {
this.roadId = roadId;
}
public String getLaneId() {
return laneId;
}
public void setLaneId(String laneId) {
this.laneId = laneId;
}
public int getLaneNum() {
return laneNum;
}
public void setLaneNum(int laneNum) {
this.laneNum = laneNum;
}
public double getRateLimiting() {
return rateLimiting;
}
public void setRateLimiting(double rateLimiting) {
this.rateLimiting = rateLimiting;
}
public String getTileId() {
return tileId;
}
public void setTileId(String tileId) {
this.tileId = tileId;
}
public double getRoadWidth() {
return roadWidth;
}
public void setRoadWidth(double roadWidth) {
this.roadWidth = roadWidth;
}
@Override
public String toString() {
return "CloudLocationInfo{" +
"lat=" + lat +
", lon=" + lon +
", heading=" + heading +
", systemTime=" + systemTime +
", satelliteTime=" + satelliteTime +
", alt=" + alt +
", speed=" + speed +
", vehicleType=" + vehicleType +
", roadId='" + roadId + '\'' +
", laneId='" + laneId + '\'' +
", laneNum=" + laneNum +
", rateLimiting=" + rateLimiting +
", tileId=" + tileId +
", roadWidth=" + roadWidth +
'}';
}
public String print() {
return "CloudLocation{ lon: " + lon + " lat: " + lat + " heading: " + heading + " speed: "
+ speed + " vehicleType: " + vehicleType + "}";
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CloudLocationInfo that = (CloudLocationInfo) o;
return Double.compare(that.lat, lat) == 0 &&
Double.compare(that.lon, lon) == 0;
}
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
@Override
public int hashCode() {
return Objects.hash(lat, lon);
}
}