[fea]
[all]
[first_autopilot_flag 和线路相关、下载轨迹order_id 规则变更]
This commit is contained in:
yangyakun
2024-12-26 15:07:57 +08:00
parent 8ac498006d
commit 81a302e474
12 changed files with 135 additions and 57 deletions

View File

@@ -1,5 +1,7 @@
package com.mogo.och.data.bean
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters.AutoPilotLonLat
data class ContraiInfo(
/**
* 线路id
@@ -34,4 +36,67 @@ data class ContraiInfo(
var passPoints: MutableList<BusStationBean>?=null, // 用于算路的经停点
var blackPoints: MutableList<BusStationBean>?=null, // 用于算路的黑名單點
val source:Int = 1, //轨迹来源1 录制2 自主计算
)
){
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.lat,
when (mogoLatLng.pointType) {
1 -> {//途径点
false
}
2 -> {//禁行点
false
}
3 -> {//站点
true
}
else -> {
false
}
}
)
)
}
}
return Pair(wayLatLons,blackLatLons)
}
}

View File

@@ -35,4 +35,19 @@ data class LineInfo(
tempAutopilotId.append(orderId)
return tempAutopilotId.toString()
}
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false
other as LineInfo
return lineId == other.lineId
}
override fun hashCode(): Int {
return lineId.hashCode()
}
}