This commit is contained in:
tongchenfei
2020-10-27 17:50:28 +08:00
parent 6339f604b8
commit dad639fe8a
3 changed files with 142 additions and 60 deletions

View File

@@ -21,9 +21,9 @@ public class CloudRoadData implements Parcelable {
private long systemTime;
/**红绿灯状态 1红 2绿 3黄*/
private Integer lightStatus;//
private int lightStatus;//
/**红绿灯剩余时间 读秒*/
private Integer lightLeftTime;
private int lightLeftTime;
/**视频流直播地址*/
private String rtmpUrl;//
@@ -31,22 +31,15 @@ public class CloudRoadData implements Parcelable {
public List<CloudLocationInfo> coordinates;
protected CloudRoadData(Parcel in) {
type = in.readInt();
lat = in.readDouble();
lon = in.readDouble();
speed = in.readDouble();
systemTime = in.readLong();
if (in.readByte() == 0) {
lightStatus = null;
} else {
lightStatus = in.readInt();
}
if (in.readByte() == 0) {
lightLeftTime = null;
} else {
lightLeftTime = in.readInt();
}
lightStatus = in.readInt();
lightLeftTime = in.readInt();
rtmpUrl = in.readString();
distance = in.readDouble();
coordinates = in.createTypedArrayList(CloudLocationInfo.CREATOR);
@@ -59,18 +52,8 @@ public class CloudRoadData implements Parcelable {
dest.writeDouble(lon);
dest.writeDouble(speed);
dest.writeLong(systemTime);
if (lightStatus == null) {
dest.writeByte((byte) 0);
} else {
dest.writeByte((byte) 1);
dest.writeInt(lightStatus);
}
if (lightLeftTime == null) {
dest.writeByte((byte) 0);
} else {
dest.writeByte((byte) 1);
dest.writeInt(lightLeftTime);
}
dest.writeInt(lightStatus);
dest.writeInt(lightLeftTime);
dest.writeString(rtmpUrl);
dest.writeDouble(distance);
dest.writeTypedList(coordinates);
@@ -92,4 +75,84 @@ public class CloudRoadData implements Parcelable {
return new CloudRoadData[size];
}
};
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
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 getSpeed() {
return speed;
}
public void setSpeed(double speed) {
this.speed = speed;
}
public long getSystemTime() {
return systemTime;
}
public void setSystemTime(long systemTime) {
this.systemTime = systemTime;
}
public int getLightStatus() {
return lightStatus;
}
public void setLightStatus(int lightStatus) {
this.lightStatus = lightStatus;
}
public int getLightLeftTime() {
return lightLeftTime;
}
public void setLightLeftTime(int lightLeftTime) {
this.lightLeftTime = lightLeftTime;
}
public String getRtmpUrl() {
return rtmpUrl;
}
public void setRtmpUrl(String rtmpUrl) {
this.rtmpUrl = rtmpUrl;
}
public double getDistance() {
return distance;
}
public void setDistance(double distance) {
this.distance = distance;
}
public List<CloudLocationInfo> getCoordinates() {
return coordinates;
}
public void setCoordinates(List<CloudLocationInfo> coordinates) {
this.coordinates = coordinates;
}
}

View File

@@ -16,10 +16,10 @@ class MogoSnapshotSetData implements Parcelable {
private String msgId;
private Long time;
private long time;
//过期时间
private Long expire;
private long expire;
//总数据集合
private List<CloudRoadData> allList;
@@ -30,16 +30,8 @@ class MogoSnapshotSetData implements Parcelable {
protected MogoSnapshotSetData(Parcel in) {
msgId = in.readString();
if (in.readByte() == 0) {
time = null;
} else {
time = in.readLong();
}
if (in.readByte() == 0) {
expire = null;
} else {
expire = in.readLong();
}
time = in.readLong();
expire = in.readLong();
allList = in.createTypedArrayList(CloudRoadData.CREATOR);
trafficLight = in.readParcelable(CloudRoadData.class.getClassLoader());
}
@@ -47,18 +39,8 @@ class MogoSnapshotSetData implements Parcelable {
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(msgId);
if (time == null) {
dest.writeByte((byte) 0);
} else {
dest.writeByte((byte) 1);
dest.writeLong(time);
}
if (expire == null) {
dest.writeByte((byte) 0);
} else {
dest.writeByte((byte) 1);
dest.writeLong(expire);
}
dest.writeLong(time);
dest.writeLong(expire);
dest.writeTypedList(allList);
dest.writeParcelable(trafficLight, flags);
}
@@ -90,4 +72,44 @@ class MogoSnapshotSetData implements Parcelable {
", trafficLight=" + trafficLight +
'}';
}
public String getMsgId() {
return msgId;
}
public void setMsgId(String msgId) {
this.msgId = msgId;
}
public long getTime() {
return time;
}
public void setTime(long time) {
this.time = time;
}
public long getExpire() {
return expire;
}
public void setExpire(long expire) {
this.expire = expire;
}
public List<CloudRoadData> getAllList() {
return allList;
}
public void setAllList(List<CloudRoadData> allList) {
this.allList = allList;
}
public CloudRoadData getTrafficLight() {
return trafficLight;
}
public void setTrafficLight(CloudRoadData trafficLight) {
this.trafficLight = trafficLight;
}
}