Merge branch 'dev_robobus-d_241202_6.8.4' into dev_robotaxi-d_241210_6.9.0

# Conflicts:
#	OCH/offline/driver/src/main/java/com/mogo/och/offline/model/OrderModel.java
This commit is contained in:
yangyakun
2024-12-26 15:31:03 +08:00
57 changed files with 822 additions and 142 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

@@ -16,6 +16,42 @@ data class LineInfo(
*/
var multiMap: MutableMap<String,String>? = mutableMapOf(),
val orderId:String?=null
val orderId:String?=null,
)
/**
* 站点包含的线路
*/
var siteInfos:MutableList<BusStationBean> = mutableListOf(),
) {
fun genAutopilotId(): String {
val tempAutopilotId = StringBuilder()
tempAutopilotId.append(lineId)
siteInfos.forEach {
tempAutopilotId.append("_")
tempAutopilotId.append(it.siteId)
}
tempAutopilotId.append("_")
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()
}
fun isFirstStation(start: BusStationBean):Boolean {
return siteInfos.first()==start
}
}

View File

@@ -1,6 +1,15 @@
package com.mogo.och.data.db.exception
class DbException: RuntimeException {
var code:Int = 0
var msg:String = ""
constructor() : super()
constructor(message: String?) : super(message)
constructor(code:Int, message: String) : super("${code}_${message}"){
this.code = code
this.msg = message
}
companion object{
const val NEEDSYNDATA = 10001
}
}