[2.13.0-arch-opt] dispatch upload

This commit is contained in:
zhongchao
2023-02-28 20:13:49 +08:00
parent 85a6305319
commit bdb516ab49
6 changed files with 18 additions and 18 deletions

View File

@@ -41,6 +41,7 @@ class DispatchAutoPilotManager private constructor() :
private const val MSG_SOCKET_TYPE = 501000
private const val MSG_TYPE_SHOW_DIALOG = 0
private const val MSG_TYPE_UPLOAD_AUTOPILOT_STATUS = 1
private const val MSG_TYPE_UPLOAD_AUTOPILOT_ROTTING = 2
val dispatchAutoPilotManager by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
DispatchAutoPilotManager()
@@ -68,6 +69,16 @@ class DispatchAutoPilotManager private constructor() :
getAutoPilotStatusInfo().reason
)
sendEmptyMessageDelayed(MSG_TYPE_UPLOAD_AUTOPILOT_STATUS, 1000L)
} else if(msg.what == MSG_TYPE_UPLOAD_AUTOPILOT_ROTTING){
val data = msg.obj as MessagePad.GlobalPathResp
val list: MutableList<AutopilotRouteInfo.RouteModels> = ArrayList()
for (location in data.wayPointsList) {
val routeModels = AutopilotRouteInfo.RouteModels()
routeModels.lat = location.latitude
routeModels.lon = location.longitude
list.add(routeModels)
}
dispatchServiceModel.uploadAutopilotRoute(list)
}
}
}
@@ -165,14 +176,10 @@ class DispatchAutoPilotManager private constructor() :
if (globalPathResp == null || globalPathResp.wayPointsList.isEmpty()) {
return
}
val list: MutableList<AutopilotRouteInfo.RouteModels> = ArrayList()
for (location in globalPathResp.wayPointsList) {
val routeModels = AutopilotRouteInfo.RouteModels()
routeModels.lat = location.latitude
routeModels.lon = location.longitude
list.add(routeModels)
}
dispatchServiceModel.uploadAutopilotRoute(list)
val message = Message()
message.what = MSG_TYPE_UPLOAD_AUTOPILOT_ROTTING
message.obj = globalPathResp
handler.sendMessage(message)
}
override fun onAutopilotArriveAtStation(arrivalNotification: MessagePad.ArrivalNotification?) {

View File

@@ -76,7 +76,7 @@ class DispatchServiceModel private constructor() {
fun uploadAutopilotRoute(list: List<RouteModels?>?) {
val sn = MoGoAiCloudClientConfig.getInstance().sn
val reportedRoute = ReportedRoute(sn, GsonUtil.jsonFromObject(list))
val map: MutableMap<String, Any> = HashMap()
val map: MutableMap<String, String> = HashMap()
map["sn"] = sn
map["data"] = GsonUtil.jsonFromObject(reportedRoute)
mAdasApiService.uploadAutopilotRoute(map)

View File

@@ -15,7 +15,7 @@ interface IDispatchAdasApiService {
*/
@FormUrlEncoded
@POST("eagle-eye-dns/eagle-eye-dns/dataService/autoDriver/receiveCarPreSetPath")
fun uploadAutopilotRoute(@FieldMap parameters: Map<String, Any>): Observable<BaseData>
fun uploadAutopilotRoute(@FieldMap parameters: Map<String, String>): Observable<BaseData>
/**
* 上报自动驾驶调度处理结果 服务于业务调度

View File

@@ -102,7 +102,6 @@ class IdentifyOriginDataDrawer : Identify {
@SuppressLint("NewApi")
private fun filterTrafficData(trafficData: List<TrackedObject>): HashMap<String, TrackedObject> {
mFilterTrafficData.clear()
trafficDataUuidList.clear()
for (data in trafficData) {
// 过滤掉未知感知数据
if (TrackerSourceColorHelper.filterData(data)) {
@@ -110,13 +109,12 @@ class IdentifyOriginDataDrawer : Identify {
}
var temp: TrackedObject = data
val uuid = "" + data.uuid
//首次过来的数据不添加,首次未添加的感知物在调用完绘制方法后再塞入cache map
val cacheData = mMarkersCaches[uuid]
if (cacheData != null) {
val color = TrackerSourceColorHelper.getDefaultColor(data)
temp = data.toBuilder().setColor(color).build()
mFilterTrafficData[uuid] = temp
}
mFilterTrafficData[uuid] = temp
mMarkersCaches[uuid] = temp
trafficDataUuidList.add(uuid)
}

View File

@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.business.identify;
import android.annotation.SuppressLint;
import android.os.Build;
import android.util.Log;
import androidx.annotation.RequiresApi;