[3.4.0] fix bug of ui in pnc action view and door status invoke, remove dispatch upload autopilot status
This commit is contained in:
zhongchao
2023-07-25 16:28:33 +08:00
parent a7b2528d4b
commit 5e37881e37
11 changed files with 27 additions and 88 deletions

View File

@@ -15,7 +15,6 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener
import com.mogo.eagle.core.function.api.hmi.autopilot.IMoGoCheckAutoPilotBtnListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getState
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
@@ -49,8 +48,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
private const val MSG_TYPE_UPLOAD_AUTOPILOT_ROTTING = 1
val dispatchAutoPilotManager by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
DispatchAutoPilotManager()
@@ -72,9 +70,6 @@ class DispatchAutoPilotManager private constructor() :
val msgData: DispatchAdasAutoPilotLocReceiverBean =
msg.obj as DispatchAdasAutoPilotLocReceiverBean
CallerHmiManager.showDispatchDialog(msgData)
} else if (msg.what == MSG_TYPE_UPLOAD_AUTOPILOT_STATUS) {
dispatchServiceModel.uploadAutopilotStatus(getState(), "")
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()
@@ -99,7 +94,6 @@ class DispatchAutoPilotManager private constructor() :
CallerPlanningRottingListenerManager.addListener(TAG, this)
// 添加 ADAS状态 监听
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
handler.sendEmptyMessageDelayed(MSG_TYPE_UPLOAD_AUTOPILOT_STATUS, 1000L)
}
fun release() {

View File

@@ -5,7 +5,6 @@ import com.mogo.commons.constants.HostConst
import com.mogo.commons.context.ContextHolderUtil
import com.mogo.eagle.core.data.BaseData
import com.mogo.eagle.core.data.autopilot.AutopilotRouteInfo.RouteModels
import com.mogo.eagle.core.data.autopilot.AutopilotStatus
import com.mogo.eagle.core.data.biz.dispatch.ReportDispatchResult
import com.mogo.eagle.core.data.biz.dispatch.ReportedRoute
import com.mogo.eagle.core.network.MoGoRetrofitFactory
@@ -38,43 +37,6 @@ class DispatchServiceModel private constructor() {
IDispatchAdasApiService::class.java
)
/**
* 上报自动驾驶状态
*/
fun uploadAutopilotStatus(state: Int, reason: String?) {
val autopilotStatus = AutopilotStatus()
autopilotStatus.action = "autopilotstate"
val valuesBean = AutopilotStatus.ValuesBean()
valuesBean.state = state
valuesBean.reason = reason
autopilotStatus.values = valuesBean
val sn = MoGoAiCloudClientConfig.getInstance().sn
val reportedRoute = ReportedRoute(
sn,
autopilotStatus.values
)
val map: MutableMap<String, Any> = HashMap()
map["sn"] = sn
map["data"] = GsonUtil.jsonFromObject(reportedRoute)
mAdasApiService.uploadAutopilotState(map)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(object :
SubscribeImpl<BaseData>(RequestOptions.create(ContextHolderUtil.getContext())) {
override fun onNext(o: BaseData) {
super.onNext(o)
}
override fun onError(e: Throwable) {
super.onError(e)
}
override fun onSuccess(o: BaseData) {
super.onSuccess(o)
}
})
}
/**
* 上报自动驾驶路线
*

View File

@@ -27,13 +27,4 @@ interface IDispatchAdasApiService {
@POST("eagle-eye-dns/dataService/autoDriver/receiverDestSiteResult")
fun uploadDispatchResult(@FieldMap parameters: MutableMap<String, Any>): Observable<BaseData>
/**
* 上报自动驾驶状态 服务于业务调度
*
* @param parameters map
* @return [BaseData]
*/
@FormUrlEncoded
@POST("eagle-eye-dns/dataService/autoDriver/receiveAutopilotState")
fun uploadAutopilotState(@FieldMap parameters: MutableMap<String, Any>): Observable<BaseData>
}

View File

@@ -44,6 +44,7 @@ class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
private var mThreadHandler: Handler? = null
//todo 优化looper需要考虑回调数据线程同步
fun initServer(context: Context) {
mContext = context
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, this)

View File

@@ -26,14 +26,12 @@ class TrafficLightNetWorkModel {
onError: ((String) -> Unit),
) {
request<BaseResponse<RoadIDResult>>("requestRoadID") {
val map = hashMapOf<String, String>()
start {
val roadIDRequestData = RoadIDRequestData(tileID, lat, lon, bearing)
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
map["data"] = GsonUtils.toJson(roadIDRequestData)
}
loader {
apiCall {
val map = hashMapOf<String, String>()
val roadIDRequestData = RoadIDRequestData(tileID, lat, lon, bearing)
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
map["data"] = GsonUtils.toJson(roadIDRequestData)
getNetWorkApi().getFrontRoadID(map)
}
}
@@ -74,12 +72,12 @@ class TrafficLightNetWorkModel {
if (roadId == null) {
return@start
}
val trafficLightRequestData = TrafficLightRequestData(lat, lon, bearing, roadId)
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
map["data"] = GsonUtils.toJson(trafficLightRequestData)
}
loader {
apiCall {
val trafficLightRequestData = TrafficLightRequestData(lat, lon, bearing, roadId!!)
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
map["data"] = GsonUtils.toJson(trafficLightRequestData)
getNetWorkApi().getTrafficLight(map)
}
}
@@ -112,14 +110,12 @@ class TrafficLightNetWorkModel {
) {
request<BaseResponse<TrafficLightControl>> {
val map = hashMapOf<String, String>()
start {
val trafficLightRequestData =
ChangeLightRequestData(lightId, crossingNo, heading, controlTime)
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
map["data"] = GsonUtils.toJson(trafficLightRequestData)
}
loader {
apiCall {
val trafficLightRequestData =
ChangeLightRequestData(lightId, crossingNo, heading, controlTime)
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
map["data"] = GsonUtils.toJson(trafficLightRequestData)
getNetWorkApi().changeLight(map)
}
}