diff --git a/OCH/mogo-och-taxi-passenger/src/main/res/layout/taxi_p_base_fragment.xml b/OCH/mogo-och-taxi-passenger/src/main/res/layout/taxi_p_base_fragment.xml index 7fd5dbf2fc..899dac7440 100644 --- a/OCH/mogo-och-taxi-passenger/src/main/res/layout/taxi_p_base_fragment.xml +++ b/OCH/mogo-och-taxi-passenger/src/main/res/layout/taxi_p_base_fragment.xml @@ -35,11 +35,10 @@ { - // TODO: 2021/12/9 CallerHmiManager.INSTANCE.showToolsView(); }); diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/dispatch/DispatchAutoPilotManager.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/dispatch/DispatchAutoPilotManager.kt index 6acdcc1515..3fe8bac6bd 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/dispatch/DispatchAutoPilotManager.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/dispatch/DispatchAutoPilotManager.kt @@ -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 = 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() { diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/dispatch/network/DispatchServiceModel.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/dispatch/network/DispatchServiceModel.kt index 0b1d759469..6f0264cbe3 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/dispatch/network/DispatchServiceModel.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/dispatch/network/DispatchServiceModel.kt @@ -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 = HashMap() - map["sn"] = sn - map["data"] = GsonUtil.jsonFromObject(reportedRoute) - mAdasApiService.uploadAutopilotState(map) - .subscribeOn(Schedulers.io()) - .observeOn(AndroidSchedulers.mainThread()) - .subscribe(object : - SubscribeImpl(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) - } - }) - } - /** * 上报自动驾驶路线 * diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/dispatch/network/IDispatchAdasApiService.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/dispatch/network/IDispatchAdasApiService.kt index 2e1ff638f6..c16ec3e0f6 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/dispatch/network/IDispatchAdasApiService.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/dispatch/network/IDispatchAdasApiService.kt @@ -27,13 +27,4 @@ interface IDispatchAdasApiService { @POST("eagle-eye-dns/dataService/autoDriver/receiverDestSiteResult") fun uploadDispatchResult(@FieldMap parameters: MutableMap): Observable - /** - * 上报自动驾驶状态 服务于业务调度 - * - * @param parameters map - * @return [BaseData] - */ - @FormUrlEncoded - @POST("eagle-eye-dns/dataService/autoDriver/receiveAutopilotState") - fun uploadAutopilotState(@FieldMap parameters: MutableMap): Observable } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/trafficlight/core/MogoTrafficLightManager.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/trafficlight/core/MogoTrafficLightManager.kt index 7bb917b61c..6d82e9399e 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/trafficlight/core/MogoTrafficLightManager.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/trafficlight/core/MogoTrafficLightManager.kt @@ -44,6 +44,7 @@ class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener { private var mThreadHandler: Handler? = null + //todo 优化looper,需要考虑回调数据线程同步 fun initServer(context: Context) { mContext = context CallerChassisLocationGCJ02ListenerManager.addListener(TAG, this) diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/trafficlight/network/TrafficLightNetWorkModel.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/trafficlight/network/TrafficLightNetWorkModel.kt index a96f1e89d7..1646e6a7d2 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/trafficlight/network/TrafficLightNetWorkModel.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/trafficlight/network/TrafficLightNetWorkModel.kt @@ -26,14 +26,12 @@ class TrafficLightNetWorkModel { onError: ((String) -> Unit), ) { request>("requestRoadID") { - val map = hashMapOf() - start { - val roadIDRequestData = RoadIDRequestData(tileID, lat, lon, bearing) - map["sn"] = MoGoAiCloudClientConfig.getInstance().sn - map["data"] = GsonUtils.toJson(roadIDRequestData) - } loader { apiCall { + val map = hashMapOf() + 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> { val map = hashMapOf() - 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) } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/PncActionsView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/PncActionsView.kt index 96a920d185..aadf84df1d 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/PncActionsView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/PncActionsView.kt @@ -40,7 +40,6 @@ class PncActionsView @JvmOverloads constructor( private var mTrafficLightResult: TrafficLightResult? = null private val bgResources: Int - private val topMargin: Float private val txtSize: Float init { @@ -50,10 +49,6 @@ class PncActionsView @JvmOverloads constructor( R.styleable.PncActionsView_background_resource, R.drawable.pnc_actions_bg ) - topMargin = a.getDimension( - R.styleable.PncActionsView_pnc_top_margin, - resources.getDimension(R.dimen.dp_30) - ) txtSize = a.getDimension( R.styleable.PncActionsView_pnc_size, resources.getDimension(R.dimen.dp_34) @@ -63,7 +58,6 @@ class PncActionsView @JvmOverloads constructor( override fun onAttachedToWindow() { super.onAttachedToWindow() - (tvHmiPncActions.layoutParams as MarginLayoutParams).topMargin = topMargin.toInt() tvHmiPncActions.setTextSize(COMPLEX_UNIT_PX, txtSize) CallerAutoPilotStatusListenerManager.addListener(TAG, this) @@ -81,7 +75,7 @@ class PncActionsView @JvmOverloads constructor( override fun onAutopilotStatusResponse(state: Int) { if (state != STATUS_AUTOPILOT_RUNNING) { UiThreadHandler.post { - this.background = null + tvHmiPncActions.background = null tvHmiPncActions.text = "" } } @@ -117,15 +111,15 @@ class PncActionsView @JvmOverloads constructor( } // update view if (actions.isNullOrEmpty()) { - this.background = null + tvHmiPncActions.background = null tvHmiPncActions.text = "" } else { - this.background = + tvHmiPncActions.background = AppCompatResources.getDrawable(context, bgResources) tvHmiPncActions.text = actions } } else { - this.background = null + tvHmiPncActions.background = null tvHmiPncActions.text = "" } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_pnc_actions.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_pnc_actions.xml index 7314ec144c..83a75850b2 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_pnc_actions.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_pnc_actions.xml @@ -2,12 +2,15 @@ + android:layout_height="match_parent"> - diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisDoorStateListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisDoorStateListenerManager.kt index 65714818ad..3db1192539 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisDoorStateListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisDoorStateListenerManager.kt @@ -4,7 +4,7 @@ import chassis.Chassis import chassis.VehicleStateOuterClass import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisDoorStateListener import com.mogo.eagle.core.function.call.base.CallerBase -import java.util.* +import java.util.concurrent.CopyOnWriteArrayList import kotlin.properties.Delegates /** @@ -12,7 +12,7 @@ import kotlin.properties.Delegates */ object CallerChassisDoorStateListenerManager : CallerBase() { - private val listCache = Collections.emptyList() + private val listCache = CopyOnWriteArrayList() private var frontLeft by Delegates.observable(0) { _, oldV, newV -> if (oldV != newV) { @@ -55,6 +55,7 @@ object CallerChassisDoorStateListenerManager : CallerBase) { + listCache.clear() listCache.addAll(doorList) doorList.forEach { when (it.number) {