[routing]
[fea] [bus、接驳、班车 验路模式 UI 流程完成]
This commit is contained in:
@@ -1,191 +1,84 @@
|
||||
package com.mogo.och.data.bean;
|
||||
package com.mogo.och.data.bean
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters.AutoPilotLonLat
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import java.util.Objects
|
||||
|
||||
/**
|
||||
* 单个网约车小巴车站信息
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class BusStationBean {
|
||||
private int siteId;
|
||||
@SerializedName(value = "name",alternate = {"siteName"})
|
||||
private String name;
|
||||
private String nameKr;
|
||||
private int seq;
|
||||
private double gcjLon; //高德
|
||||
private double gcjLat; //高德
|
||||
@SerializedName(value = "lon",alternate = {"wgs84Lon"})
|
||||
private double lon; //高精坐标
|
||||
@SerializedName(value = "lat",alternate = {"wgs84Lat"})
|
||||
private double lat; //高精坐标
|
||||
private int drivingStatus;//行驶信息,0初始值;1已经过;2当前站;3未到站
|
||||
private boolean leaving;// 为出发false 出发true
|
||||
private String introduction;// 站点简介
|
||||
private boolean isPlayTts;
|
||||
private int pointType; // 1:途径点 2:禁行点 3:站点
|
||||
private List<SiteIntroduce> videoList;
|
||||
open class BusStationBean {
|
||||
var siteId: Int = 0
|
||||
|
||||
public String getNameKr() {
|
||||
return nameKr;
|
||||
@JvmField
|
||||
@SerializedName(value = "name", alternate = ["siteName"])
|
||||
var name: String? = null
|
||||
var nameKr: String? = null
|
||||
var seq: Int = 0
|
||||
@JvmField
|
||||
var gcjLon: Double = 0.0 //高德
|
||||
@JvmField
|
||||
var gcjLat: Double = 0.0 //高德
|
||||
|
||||
@SerializedName(value = "lon", alternate = ["wgs84Lon"])
|
||||
var lon: Double = 0.0 //高精坐标
|
||||
|
||||
@SerializedName(value = "lat", alternate = ["wgs84Lat"])
|
||||
var lat: Double = 0.0 //高精坐标
|
||||
@JvmField
|
||||
var drivingStatus: Int = 0 //行驶信息,0初始值;1已经过;2当前站;3未到站
|
||||
var isLeaving: Boolean = false // 为出发false 出发true
|
||||
var introduction: String? = null // 站点简介
|
||||
var isPlayTts: Boolean = false
|
||||
var pointType: Int = 0 // 1:途径点 2:禁行点 3:站点
|
||||
var videoList: List<SiteIntroduce>? = null
|
||||
|
||||
var passPoints: List<BusStationBean>? = null // 用于算路的经停点
|
||||
var blackPoints: List<BusStationBean>? = null // 用于算路的黑名單點
|
||||
|
||||
|
||||
override fun equals(o: Any?): Boolean {
|
||||
if (this === o) return true
|
||||
if (o == null || javaClass != o.javaClass) return false
|
||||
|
||||
val that = o as BusStationBean
|
||||
return siteId == that.siteId && seq == that.seq && java.lang.Double.compare(
|
||||
gcjLon,
|
||||
that.gcjLon
|
||||
) == 0 && java.lang.Double.compare(
|
||||
gcjLat,
|
||||
that.gcjLat
|
||||
) == 0 && java.lang.Double.compare(lon, that.lon) == 0 && java.lang.Double.compare(
|
||||
lat,
|
||||
that.lat
|
||||
) == 0 && drivingStatus == that.drivingStatus && isLeaving == that.isLeaving && isPlayTts == that.isPlayTts && pointType == that.pointType && name == that.name
|
||||
&& nameKr == that.nameKr
|
||||
&& introduction == that.introduction
|
||||
&& videoList == that.videoList
|
||||
}
|
||||
|
||||
public void setNameKr(String nameKr) {
|
||||
this.nameKr = nameKr;
|
||||
override fun hashCode(): Int {
|
||||
var result = siteId
|
||||
result = 31 * result + Objects.hashCode(name)
|
||||
result = 31 * result + Objects.hashCode(nameKr)
|
||||
result = 31 * result + seq
|
||||
result = 31 * result + java.lang.Double.hashCode(gcjLon)
|
||||
result = 31 * result + java.lang.Double.hashCode(gcjLat)
|
||||
result = 31 * result + java.lang.Double.hashCode(lon)
|
||||
result = 31 * result + java.lang.Double.hashCode(lat)
|
||||
result = 31 * result + drivingStatus
|
||||
result = 31 * result + java.lang.Boolean.hashCode(isLeaving)
|
||||
result = 31 * result + Objects.hashCode(introduction)
|
||||
result = 31 * result + java.lang.Boolean.hashCode(isPlayTts)
|
||||
result = 31 * result + pointType
|
||||
result = 31 * result + Objects.hashCode(videoList)
|
||||
return result
|
||||
}
|
||||
|
||||
public int getSiteId() {
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public int getSeq() {
|
||||
return seq;
|
||||
}
|
||||
|
||||
public double getGcjLon() {
|
||||
return gcjLon;
|
||||
}
|
||||
|
||||
public double getGcjLat() {
|
||||
return gcjLat;
|
||||
}
|
||||
|
||||
public double getLon() {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public double getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public int getDrivingStatus() {
|
||||
return drivingStatus;
|
||||
}
|
||||
|
||||
public boolean isLeaving() {
|
||||
return leaving;
|
||||
}
|
||||
|
||||
public void setSiteId(int siteId) {
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setSeq(int seq) {
|
||||
this.seq = seq;
|
||||
}
|
||||
|
||||
public void setGcjLon(double gcjLon) {
|
||||
this.gcjLon = gcjLon;
|
||||
}
|
||||
|
||||
public void setGcjLat(double gcjLat) {
|
||||
this.gcjLat = gcjLat;
|
||||
}
|
||||
|
||||
public void setLon(double lon) {
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
public void setLat(double lat) {
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public void setDrivingStatus(int drivingStatus) {
|
||||
this.drivingStatus = drivingStatus;
|
||||
}
|
||||
|
||||
public void setLeaving(boolean leaving) {
|
||||
this.leaving = leaving;
|
||||
}
|
||||
|
||||
public String getIntroduction() {
|
||||
return introduction;
|
||||
}
|
||||
|
||||
public void setIntroduction(String introduction) {
|
||||
this.introduction = introduction;
|
||||
}
|
||||
|
||||
public boolean isPlayTts() {
|
||||
return isPlayTts;
|
||||
}
|
||||
|
||||
public void setPlayTts(boolean playTts) {
|
||||
isPlayTts = playTts;
|
||||
}
|
||||
|
||||
public List<SiteIntroduce> getVideoList() {
|
||||
return videoList;
|
||||
}
|
||||
|
||||
public void setVideoList(List<SiteIntroduce> videoList) {
|
||||
this.videoList = videoList;
|
||||
}
|
||||
|
||||
public int getPointType() {
|
||||
return pointType;
|
||||
}
|
||||
|
||||
public void setPointType(int pointType) {
|
||||
this.pointType = pointType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
BusStationBean that = (BusStationBean) o;
|
||||
return siteId == that.siteId
|
||||
&& seq == that.seq
|
||||
&& Double.compare(gcjLon, that.gcjLon) == 0
|
||||
&& Double.compare(gcjLat, that.gcjLat) == 0
|
||||
&& Double.compare(lon, that.lon) == 0
|
||||
&& Double.compare(lat, that.lat) == 0
|
||||
&& drivingStatus == that.drivingStatus
|
||||
&& leaving == that.leaving && isPlayTts == that.isPlayTts
|
||||
&& pointType == that.pointType
|
||||
&& Objects.equals(name, that.name)
|
||||
&& Objects.equals(nameKr, that.nameKr)
|
||||
&& Objects.equals(introduction, that.introduction)
|
||||
&& Objects.equals(videoList, that.videoList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = siteId;
|
||||
result = 31 * result + Objects.hashCode(name);
|
||||
result = 31 * result + Objects.hashCode(nameKr);
|
||||
result = 31 * result + seq;
|
||||
result = 31 * result + Double.hashCode(gcjLon);
|
||||
result = 31 * result + Double.hashCode(gcjLat);
|
||||
result = 31 * result + Double.hashCode(lon);
|
||||
result = 31 * result + Double.hashCode(lat);
|
||||
result = 31 * result + drivingStatus;
|
||||
result = 31 * result + Boolean.hashCode(leaving);
|
||||
result = 31 * result + Objects.hashCode(introduction);
|
||||
result = 31 * result + Boolean.hashCode(isPlayTts);
|
||||
result = 31 * result + pointType;
|
||||
result = 31 * result + Objects.hashCode(videoList);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
override fun toString(): String {
|
||||
return "BusStationBean{" +
|
||||
"siteId=" + siteId +
|
||||
", name='" + name + '\'' +
|
||||
@@ -196,19 +89,81 @@ public class BusStationBean {
|
||||
", lon=" + lon +
|
||||
", lat=" + lat +
|
||||
", drivingStatus=" + drivingStatus +
|
||||
", leaving=" + leaving +
|
||||
", leaving=" + isLeaving +
|
||||
", introduction='" + introduction + '\'' +
|
||||
", isPlayTts=" + isPlayTts +
|
||||
", pointType=" + pointType +
|
||||
", videoList=" + videoList +
|
||||
'}';
|
||||
'}'
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public MogoLocation toMogoLocation() {
|
||||
MogoLocation result = new MogoLocation();
|
||||
result.setLatitude(gcjLat);
|
||||
result.setLongitude(gcjLon);
|
||||
return result;
|
||||
fun toMogoLocation(): MogoLocation {
|
||||
val result = MogoLocation()
|
||||
result.latitude = gcjLat
|
||||
result.longitude = gcjLon
|
||||
return result
|
||||
}
|
||||
|
||||
fun getWayBlackLatLons(
|
||||
): Pair<MutableList<AutoPilotLonLat>, MutableList<AutoPilotLonLat>> {
|
||||
val wayLatLons = mutableListOf<AutoPilotLonLat>()
|
||||
// 途经点
|
||||
if (!passPoints.isNullOrEmpty()) {
|
||||
for (mogoLatLng in passPoints!!) {
|
||||
wayLatLons.add(
|
||||
AutoPilotLonLat(
|
||||
mogoLatLng.lat,
|
||||
mogoLatLng.lon,
|
||||
when (mogoLatLng.pointType) {
|
||||
1 -> {//途径点
|
||||
false
|
||||
}
|
||||
|
||||
2 -> {//禁行点
|
||||
false
|
||||
}
|
||||
|
||||
3 -> {//站点
|
||||
true
|
||||
}
|
||||
|
||||
else -> {
|
||||
false
|
||||
}
|
||||
}
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
val blackLatLons = mutableListOf<AutoPilotLonLat>()
|
||||
// 黑名单点
|
||||
if (!blackPoints.isNullOrEmpty()) {
|
||||
for (mogoLatLng in blackPoints!!) {
|
||||
blackLatLons.add(
|
||||
AutoPilotLonLat(
|
||||
mogoLatLng.lat,
|
||||
mogoLatLng.lon,
|
||||
when (mogoLatLng.pointType) {
|
||||
1 -> {//途径点
|
||||
false
|
||||
}
|
||||
|
||||
2 -> {//禁行点
|
||||
false
|
||||
}
|
||||
|
||||
3 -> {//站点
|
||||
true
|
||||
}
|
||||
|
||||
else -> {
|
||||
false
|
||||
}
|
||||
}
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
return Pair(wayLatLons,blackLatLons)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ data class ContraiInfo(
|
||||
blackLatLons.add(
|
||||
AutoPilotLonLat(
|
||||
mogoLatLng.lat,
|
||||
mogoLatLng.lat,
|
||||
mogoLatLng.lon,
|
||||
when (mogoLatLng.pointType) {
|
||||
1 -> {//途径点
|
||||
false
|
||||
|
||||
Reference in New Issue
Block a user