From cc23efd9efedcae4b63dbd71b0a8bc13eb4840da Mon Sep 17 00:00:00 2001 From: wangmingjun Date: Sat, 8 Oct 2022 19:08:34 +0800 Subject: [PATCH 1/7] =?UTF-8?q?[2.10.0]=20taxi=E5=8F=B8=E6=9C=BA=E7=AB=AF?= =?UTF-8?q?=E7=BE=8E=E5=8C=96=E6=A8=A1=E5=BC=8F=E4=BC=98=E5=8C=96=EF=BC=9A?= =?UTF-8?q?=E7=BE=8E=E5=8C=96=E6=A8=A1=E5=BC=8F=E4=B8=8B=EF=BC=8C=20?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E9=A9=BE=E9=A9=B6=E6=8C=89=E9=92=AE=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E5=92=8C=E5=BC=95=E5=AF=BC=E7=BA=BF=E6=B6=88=E5=A4=B1?= =?UTF-8?q?=E6=98=AF=E5=9C=A8=E8=AE=A2=E5=8D=95=E5=8F=96=E6=B6=88=E6=88=96?= =?UTF-8?q?=E8=80=85=E8=AE=A2=E5=8D=95=E5=AE=8C=E6=88=90=EF=BC=9B=20?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E8=B5=B7=E8=87=AA=E9=A9=BE=E6=98=AF=E5=9C=A8?= =?UTF-8?q?=E5=88=B0=E8=BE=BE=E7=9B=AE=E7=9A=84=E5=9C=B0=E6=97=B6=E5=80=99?= =?UTF-8?q?=E5=8F=96=E6=B6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mogo/och/taxi/model/TaxiModel.java | 23 +++++++++++-------- .../och/taxi/network/TaxiServiceManager.java | 2 +- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/TaxiModel.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/TaxiModel.java index d18442ea0f..b651855d3f 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/TaxiModel.java +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/TaxiModel.java @@ -787,13 +787,17 @@ public class TaxiModel { TaxiTrajectoryManager.getInstance().syncTrajectoryInfo(); SharedPrefsMgr.getInstance(mContext).putString(TaxiConst.SP_KEY_OCH_TAXI_ORDER, GsonUtil.jsonFromObject(data)); - if (FunctionBuildConfig.isDemoMode - && mCurrentOCHOrder.orderStatus == TaxiOrderStatusEnum.OnTheWayToEnd.getCode()) { - // 当美化模式(演示模式)开启时: 订单对应自动驾驶开启后,置true - FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true; - CallerAutoPilotManager.INSTANCE.setIgnoreConditionDraw(true); - CallerAutoPilotManager.INSTANCE.setIPCDemoMode(true); - CallerLogger.INSTANCE.d(M_TAXI + TAG, "美化模式-ignore:置为true(更新本地order信息)"); + if (FunctionBuildConfig.isDemoMode) { + if (mCurrentOCHOrder.orderStatus == TaxiOrderStatusEnum.OnTheWayToEnd.getCode()){ + // 当美化模式(演示模式)开启时: 订单对应自动驾驶开启后,置true + FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true; + CallerAutoPilotManager.INSTANCE.setIgnoreConditionDraw(true); + CallerAutoPilotManager.INSTANCE.setIPCDemoMode(true); + CallerLogger.INSTANCE.d(M_TAXI + TAG, "美化模式-ignore:置为true(更新本地order信息)"); + } + if (mCurrentOCHOrder.orderStatus == TaxiOrderStatusEnum.ArriveAtEnd.getCode()){ + CallerAutoPilotManager.INSTANCE.setIPCDemoMode(false); + } } } @@ -1165,8 +1169,9 @@ public class TaxiModel { if (FunctionBuildConfig.isDemoMode) { // 当美化模式(演示模式)开启时: 到达目的地,置false - FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false; - CallerAutoPilotManager.INSTANCE.setIgnoreConditionDraw(false); + // 2022.10.08 到达目的地时候取消自动起自驾, 服务完成取消引导线和自动驾驶按钮状态 +// FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false; +// CallerAutoPilotManager.INSTANCE.setIgnoreConditionDraw(false); CallerAutoPilotManager.INSTANCE.setIPCDemoMode(false); CallerLogger.INSTANCE.d(M_TAXI + TAG, "美化模式-ignore:置为false(到达目的地)"); } diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/network/TaxiServiceManager.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/network/TaxiServiceManager.java index 5c209c7b87..1d99bce35c 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/network/TaxiServiceManager.java +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/network/TaxiServiceManager.java @@ -425,7 +425,7 @@ public class TaxiServiceManager { ,orderNo,loc)) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) - .subscribe(getSubscribeImpl(context, callback, "arriveTerminal")); + .subscribe(getSubscribeImpl(context, callback, "orderCompleted")); } From ca6ababced154ad1412efee0fb46b13e1ed8e11c Mon Sep 17 00:00:00 2001 From: yangyakun Date: Sat, 8 Oct 2022 19:35:51 +0800 Subject: [PATCH 2/7] =?UTF-8?q?[fix]=20=E6=9B=B4=E6=8D=A2=E4=B8=8A?= =?UTF-8?q?=E4=B8=8B=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/module/biz/presenter/OchCommonLoginPresenter.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/biz/presenter/OchCommonLoginPresenter.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/biz/presenter/OchCommonLoginPresenter.kt index 49b8446a77..4f607084b2 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/biz/presenter/OchCommonLoginPresenter.kt +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/biz/presenter/OchCommonLoginPresenter.kt @@ -82,10 +82,10 @@ class OchCommonLoginPresenter(view: TaxiLoginDialogFragment?) : }, { CallerLogger.d(SceneConstant.M_TAXI_P + TAG, "倒计时onError:${it}") it.printStackTrace() - mView?.setCountDownText(context.getString(R.string.module_och_taxi_login_get_code),true) + mView?.setCountDownText(AbsMogoApplication.getApp().getString(R.string.module_och_taxi_login_get_code),true) }, { CallerLogger.d(SceneConstant.M_TAXI_P + TAG, "倒计时onComplete") - mView?.setCountDownText(context.getString(R.string.module_och_taxi_login_get_code),true) + mView?.setCountDownText(AbsMogoApplication.getApp().getString(R.string.module_och_taxi_login_get_code),true) }) } From ac32d101cb5c9d35be010c9c1edec400b09bbab5 Mon Sep 17 00:00:00 2001 From: zhongchao Date: Sun, 9 Oct 2022 12:21:59 +0800 Subject: [PATCH 3/7] remove lig --- libraries/mogo-map/src/main/java/com/mogo/map/AMapWrapper.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/AMapWrapper.java b/libraries/mogo-map/src/main/java/com/mogo/map/AMapWrapper.java index 62b68b7e55..b727c2b217 100644 --- a/libraries/mogo-map/src/main/java/com/mogo/map/AMapWrapper.java +++ b/libraries/mogo-map/src/main/java/com/mogo/map/AMapWrapper.java @@ -3,7 +3,6 @@ package com.mogo.map; import android.annotation.SuppressLint; import android.content.Context; import android.graphics.Point; -import android.util.Log; import android.util.Pair; import com.mogo.eagle.core.data.config.FunctionBuildConfig; @@ -117,7 +116,6 @@ public class AMapWrapper implements IMogoMap { optionsArrayList.forEach((s, trackedObject) -> { MarkerSimpleData markerOptions = ObjectUtils.fromTrafficData(trackedObject); if (markerOptions != null) { - Log.i("EmArrow0926","markerOpt : " + markerOptions.toString()); markerOptionsArrayList.add(markerOptions); } }); From 9667ff224bde3cb3b164aa0fb2734b8f9f8df768 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Sun, 9 Oct 2022 19:28:40 +0800 Subject: [PATCH 4/7] =?UTF-8?q?[Fix]=E5=85=BC=E5=AE=B92.3.0=E7=9A=84docker?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../autopilot/MoGoAutopilotProvider.kt | 95 ++++++++++++++++--- .../autopilot/telematic/EventListener.kt | 5 + .../autopilot/telematic/IMsgHandler.kt | 2 + .../autopilot/telematic/TeleMsgHandler.kt | 7 ++ 4 files changed, 94 insertions(+), 15 deletions(-) create mode 100644 core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/telematic/EventListener.kt diff --git a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutopilotProvider.kt b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutopilotProvider.kt index 8f783ae662..86b6f769f0 100644 --- a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutopilotProvider.kt +++ b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutopilotProvider.kt @@ -25,6 +25,7 @@ import com.mogo.eagle.core.function.autopilot.adapter.MoGoAdasListenerImpl import com.mogo.eagle.core.function.autopilot.adapter.MoGoAdasMsgConnectStatusListenerImpl import com.mogo.eagle.core.function.autopilot.adapter.MoGoHandAdasMsgManager import com.mogo.eagle.core.function.autopilot.server.AsyncDataToAutopilotServer +import com.mogo.eagle.core.function.autopilot.telematic.EventListener import com.mogo.eagle.core.function.autopilot.telematic.IMsgHandler import com.mogo.eagle.core.function.autopilot.telematic.TeleMsgHandler import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager @@ -72,6 +73,8 @@ class MoGoAutopilotProvider : private var mContext: Context? = null private lateinit var msgHandler: IMsgHandler private var timer: Timer? = null + @Volatile + private var isInit = false override val functionName: String get() = TAG @@ -146,13 +149,24 @@ class MoGoAutopilotProvider : } }, MoGoAiCloudClientConfig.getInstance().sn) } else { - val options = AdasOptions - .Builder() - .setIpcConnectionMode(AdasOptions.IPC_CONNECTION_MODE.FIXATION) - .setIpcFixationIP(AdasManager.getInstance().getIPCFixationIPList(mContext)) - .setClient(false)// 乘客端直连工控机改为false - .build() - AdasManager.getInstance().create(options, MoGoAdasMsgConnectStatusListenerImpl()) + msgHandler.setListener(object : EventListener { + override fun connectDevice(isSupportMulti: Boolean) { + if (!isInit) { + isInit = true + if (isSupportMulti) { + // 直连工控机 + directConnect() + } else { + val options = AdasOptions + .Builder() + .setClient(true) + .build() + AdasManager.getInstance().create(options, MoGoAdasMsgConnectStatusListenerImpl()) + listenDeviceData() + } + } + } + }) NSDNettyManager.getInstance() .searchAndConnectServer(context, MoGoAiCloudClientConfig.getInstance().sn, AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode), @@ -179,10 +193,7 @@ class MoGoAutopilotProvider : // 监听ADAS-SDK获取到的工控机数据(乘客也需注册) AdasManager.getInstance().setOnAdasListener(MoGoAdasListenerImpl()) - // 乘客屏监听工控机基础信息回调 - if (!AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { - CallerAutopilotCarConfigListenerManager.addListener(TAG, this) - } + CallerAutopilotCarConfigListenerManager.addListener(TAG, this) CallerLogger.i("$M_ADAS_IMPL$TAG", "initServer……") // 同步数据给工控机的服务 AsyncDataToAutopilotServer.INSTANCE.initServer() @@ -190,6 +201,47 @@ class MoGoAutopilotProvider : setRainMode(FunctionBuildConfig.isRainMode) } + private fun directConnect() { + val options = AdasOptions + .Builder() + .setIpcConnectionMode(AdasOptions.IPC_CONNECTION_MODE.FIXATION) + .setIpcFixationIP(AdasManager.getInstance().getIPCFixationIPList(mContext)) + .setClient(false)// 乘客端直连工控机改为false + .build() + AdasManager.getInstance().create(options, MoGoAdasMsgConnectStatusListenerImpl()) + } + + /** + * 司机屏转发工控机发过来的数据,乘客屏接收解析后的数据保持原流程不变 + */ + private fun listenDeviceData() { + AdasManager.getInstance().setOnMultiDeviceListener(object : OnMultiDeviceListener { + override fun onForwardingDriverIPCMessage(bytes: ByteArray?) { + if (bytes == null) + return + // 发送数据给乘客端 + if (NSDNettyManager.getInstance().isServerStart) { + msgHandler.synWriteTime() + NSDNettyManager.getInstance() + .sendMsgToAllClients(MogoProtocolMsg(NORMAL_DATA, bytes.size, bytes)) + } else { + CallerLogger.d("$M_ADAS_IMPL$TAG", "司机端Server未启动!") + } + } + + override fun onForwardingPassengerIPCMessage(bytes: ByteArray?) { + if (bytes == null) + return + NSDNettyManager.getInstance() + .sendMogoProtocolMsgToServer( + MogoProtocolMsg(NORMAL_DATA, bytes.size, bytes), + null + ) + } + + }) + } + /** * 连接自动驾驶域控制器 * @@ -561,10 +613,23 @@ class MoGoAutopilotProvider : } override fun onAutopilotCarConfig(carConfigResp: MessagePad.CarConfigResp) { - // 乘客屏才监听 - CallerBindingcarManager.getBindingcarProvider() - .getBindingcarInfo(carConfigResp.macAddress, MoGoAiCloudClientConfig.getInstance().sn) - invokeNettyConnResult("乘客屏车牌号:${carConfigResp.plateNumber},Mac地址为:${carConfigResp.macAddress}") + if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { + if (!isInit) { + isInit = true + if (carConfigResp.dockVersion.contains("2.3.0")) {// 不支持多连接 + // 司机屏转发工控机发过来的数据 + listenDeviceData() + } + } + msgHandler.synMsgToAllClients() + } else {// 乘客屏 + CallerBindingcarManager.getBindingcarProvider() + .getBindingcarInfo( + carConfigResp.macAddress, + MoGoAiCloudClientConfig.getInstance().sn + ) + invokeNettyConnResult("乘客屏车牌号:${carConfigResp.plateNumber},Mac地址为:${carConfigResp.macAddress}") + } } @ChainLog( diff --git a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/telematic/EventListener.kt b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/telematic/EventListener.kt new file mode 100644 index 0000000000..381a39a613 --- /dev/null +++ b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/telematic/EventListener.kt @@ -0,0 +1,5 @@ +package com.mogo.eagle.core.function.autopilot.telematic + +interface EventListener { + fun connectDevice(isSupportMulti: Boolean) +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/telematic/IMsgHandler.kt b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/telematic/IMsgHandler.kt index 3f9c72d8fc..2e9c751e2e 100644 --- a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/telematic/IMsgHandler.kt +++ b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/telematic/IMsgHandler.kt @@ -19,4 +19,6 @@ interface IMsgHandler { fun getTeleTimeStamp(): Long fun synMsgToAllClients() + + fun setListener(eventListener: EventListener?) } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/telematic/TeleMsgHandler.kt b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/telematic/TeleMsgHandler.kt index 716eab5c48..78a8bad488 100644 --- a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/telematic/TeleMsgHandler.kt +++ b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/telematic/TeleMsgHandler.kt @@ -47,6 +47,8 @@ class TeleMsgHandler : IMsgHandler { @Volatile private var timestamp = 0L + private var listener: EventListener? = null + override fun handleMsgFromServer(msg: MogoProtocolMsg?, channel: Channel?) { msg?.let { when (it.protocolType) { @@ -86,6 +88,7 @@ class TeleMsgHandler : IMsgHandler { AppConfigInfo.plateNumber = carConfig.plateNumber AppConfigInfo.iPCMacAddress = carConfig.macAddress AppConfigInfo.dockerVersion = carConfig.dockVersion + listener?.connectDevice(!carConfig.dockVersion.contains("2.3.0")) invokeNettyConnResult( "司机屏发送给乘客屏配置信息为:${ TextFormat.printer().escapingNonAscii(false).printToString(carConfig) @@ -255,6 +258,10 @@ class TeleMsgHandler : IMsgHandler { return wrTimeStamp } + override fun setListener(eventListener: EventListener?) { + listener = eventListener + } + private fun reqServerSN() { if (NettyTcpClient.sSERVER_SN.isNullOrEmpty()) { ProcessLifecycleOwner.get().lifecycleScope.launch { From 503755609bb4bfa4a3f39aa4ed41645d5d6aa769 Mon Sep 17 00:00:00 2001 From: donghongyu Date: Mon, 10 Oct 2022 11:42:14 +0800 Subject: [PATCH 5/7] =?UTF-8?q?[Change]=20A=E3=80=81=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=9C=80=E5=90=8E=E4=B8=80=E6=AC=A1=E5=90=AF=E5=8A=A8=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E9=A9=BE=E9=A9=B6=E5=8F=82=E6=95=B0=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=EF=BC=8C=E6=B3=A8=E6=84=8F=EF=BC=8C=E5=AE=9E=E6=97=B6=E5=9B=9E?= =?UTF-8?q?=E8=B0=83=E5=92=8C=E4=B8=BB=E5=8A=A8=E6=9F=A5=E8=AF=A2=E5=87=BA?= =?UTF-8?q?=E6=9D=A5=E5=AF=B9=E5=8F=AF=E8=83=BD=E4=B8=BAnull=E5=8D=B3?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E8=A1=8C=E7=A8=8B=E4=BF=A1=E6=81=AF=EF=BC=8C?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E5=81=9A=E5=A5=BD=E5=AE=B9=E9=94=99=EF=BC=8C?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=96=B9=E6=B3=95=EF=BC=9A=201=E3=80=81?= =?UTF-8?q?=E5=AE=9E=E6=97=B6=E7=9B=91=E5=90=AC=EF=BC=9A=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E7=9B=91=E5=90=AC=E6=8E=A5=E5=8F=A3=EF=BC=8CIMoGoAutopilotStat?= =?UTF-8?q?usListener::onAutopilotStatusResponse(autoPilotStatusInfo:=20Au?= =?UTF-8?q?topilotStatusInfo)=EF=BC=8C=E6=B3=A8=E5=86=8C=E5=8F=98=E5=8C=96?= =?UTF-8?q?=E7=9B=91=E5=90=ACCallerAutoPilotStatusListenerManager.INSTANCE?= =?UTF-8?q?.addListener(TAG,=20this);=202=E3=80=81=E5=8D=95=E6=AC=A1?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=EF=BC=9A=20CallerAutoPilotStatusListenerMana?= =?UTF-8?q?ger.INSTANCE.getAutoPilotStatusInfo().getAutopilotControlParame?= =?UTF-8?q?ters()=203=E3=80=81TODO=20@=E6=96=87=E5=90=9B=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E5=9C=A8Taxi=E8=A1=8C=E7=A8=8B=E7=BB=93=E6=9D=9F=E5=92=8CBus?= =?UTF-8?q?=E8=B7=91=E5=AE=8C=E6=9C=80=E5=90=8E=E4=B8=80=E7=AB=99=E5=90=8E?= =?UTF-8?q?=E5=AF=B9=E6=95=B0=E6=8D=AE=E8=BF=9B=E8=A1=8C=E6=B8=85=E7=A9=BA?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: donghongyu --- .../core/data/autopilot/AutopilotStatusInfo.kt | 7 ++++++- .../call/autopilot/CallerAutoPilotManager.kt | 4 ++++ .../CallerAutoPilotStatusListenerManager.kt | 17 +++++++++++++---- .../core/function/call/autopilot/REEADME.md | 6 ++++++ 4 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/REEADME.md diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutopilotStatusInfo.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutopilotStatusInfo.kt index 4cdacb92d6..f0dd46a78b 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutopilotStatusInfo.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutopilotStatusInfo.kt @@ -85,12 +85,17 @@ open class AutopilotStatusInfo : Serializable, Cloneable { // 默认未连接 var ipcConnStatus = 0x01 + /** + * 记录最后一次启动自动驾驶需要的参数,结束自动驾驶后设置为null + */ + var autopilotControlParameters: AutopilotControlParameters? = null + override fun toString(): String { return "connectIP=$connectIP, connectPort=$connectPort, " + "connectStatus=$connectStatus, connectDescribe=$connectStatusDescribe, version=$version, dockVersion=$dockVersion," + " locationStatus=$locationStatus), locationLat=$locationLat, locationLon=$locationLon," + " satelliteTime=$satelliteTime, speed=$speed, state=$state, reason=$reason, camera=$camera," + - " radar=$radar, rtk=$rtk, pilotmode=$pilotmode, ipcConnStatus=$ipcConnStatus" + " radar=$radar, rtk=$rtk, pilotmode=$pilotmode, ipcConnStatus=$ipcConnStatus, autopilotControlParameters=$autopilotControlParameters" } public override fun clone(): AutopilotStatusInfo { diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotManager.kt index 56bb110906..a941d04ea8 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotManager.kt @@ -67,6 +67,8 @@ object CallerAutoPilotManager { return } providerApi?.startAutoPilot(controlParameters) + // 更新记录在全局的控制参数 + CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(controlParameters) } /** @@ -94,6 +96,8 @@ object CallerAutoPilotManager { // 司机屏才能取消自动驾驶 if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { providerApi?.cancelAutoPilot() + // 更新记录在全局的控制参数 + CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(null) } } diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt index 5f0625073a..061c1347ca 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt @@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.call.autopilot import android.util.* import androidx.annotation.Nullable +import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener import com.mogo.eagle.core.function.call.base.CallerBase @@ -24,7 +25,7 @@ object CallerAutoPilotStatusListenerManager : CallerBase() { // 存储所有注册了监听的对象,invokeXXXX进行遍历回调,将信息同步 private val M_AUTOPILOT_STATUS_LISTENERS: ConcurrentHashMap = - ConcurrentHashMap() + ConcurrentHashMap() @Volatile private var autoPilotMessageCode: String = "" @@ -93,8 +94,8 @@ object CallerAutoPilotStatusListenerManager : CallerBase() { * @param listener 监听回调 */ fun addListener( - @Nullable tag: String, - @Nullable listener: IMoGoAutopilotStatusListener + @Nullable tag: String, + @Nullable listener: IMoGoAutopilotStatusListener ) { if (M_AUTOPILOT_STATUS_LISTENERS.containsKey(tag)) { return @@ -201,10 +202,18 @@ object CallerAutoPilotStatusListenerManager : CallerBase() { */ fun invokeAutopilotStatusRespByQuery(statusInfo: SystemStatusInfo.StatusInfo?) { statusInfo?.also { - M_AUTOPILOT_STATUS_LISTENERS.forEach{ itx -> + M_AUTOPILOT_STATUS_LISTENERS.forEach { itx -> val listener = itx.value listener.onAutopilotStatusRespByQuery(it) } } } + + /** + * 更新自动驾驶控制参数,结束自动驾驶时候需要更新为null,且更新时候同时触发onAutopilotStatusResponse回调 + */ + fun updateAutopilotControlParameters(autopilotControlParameters: AutopilotControlParameters? = null) { + mAutopilotStatusInfo.autopilotControlParameters = autopilotControlParameters + invokeAutoPilotStatus(mAutopilotStatusInfo) + } } \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/REEADME.md b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/REEADME.md new file mode 100644 index 0000000000..6d3fa01f95 --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/REEADME.md @@ -0,0 +1,6 @@ +#### CallerAutoPilotStatusListenerManager 管理自动驾驶中的状态及参数信息 + +AutopilotStatusInfo: +连接信息 +实时经纬度、速度、车辆硬件状态 +最后一次启动自动驾驶时候的启动参数 AutopilotControlParameters From f7b2fdd01463193dfa7ba67e6171a3bbfb7289b6 Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Mon, 10 Oct 2022 15:17:34 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E5=9F=9F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo/eagle/core/function/BindHostConst.kt | 26 +++++++++++++++++++ .../appupgrade/network/UpgradeApiService.java | 2 +- .../network/UpgradeAppNetWorkManager.java | 13 +++------- .../module/common/constants/HostConst.java | 3 --- 4 files changed, 30 insertions(+), 14 deletions(-) create mode 100644 core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/BindHostConst.kt diff --git a/core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/BindHostConst.kt b/core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/BindHostConst.kt new file mode 100644 index 0000000000..04bf67be17 --- /dev/null +++ b/core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/BindHostConst.kt @@ -0,0 +1,26 @@ +package com.mogo.eagle.core.function + +import com.mogo.commons.debug.DebugConfig + +/** + * cmdb 域名 + */ +class BindHostConst { + + companion object { + private const val UPGRADE_APP_HOST_DEV = "https://eagle-qa.zhidaozhixing.com/" + private const val UPGRADE_APP_HOST = "http://eagle-mis.zhidaozhixing.com/" + + @JvmStatic + fun getBaseUrl(): String { + return when (DebugConfig.getNetMode()) { + DebugConfig.NET_MODE_DEV -> UPGRADE_APP_HOST_DEV + DebugConfig.NET_MODE_QA -> UPGRADE_APP_HOST_DEV + DebugConfig.NET_MODE_DEMO -> UPGRADE_APP_HOST + DebugConfig.NET_MODE_RELEASE -> UPGRADE_APP_HOST + else -> UPGRADE_APP_HOST + } + } + } + +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/appupgrade/network/UpgradeApiService.java b/core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/appupgrade/network/UpgradeApiService.java index b18c08508d..bfed267d94 100644 --- a/core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/appupgrade/network/UpgradeApiService.java +++ b/core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/appupgrade/network/UpgradeApiService.java @@ -21,7 +21,7 @@ public interface UpgradeApiService { * @return {@link UpgradeAppInfo} */ @Headers("Content-Type:application/json;charset=UTF-8") - @POST("/eagleEye-mis/config/versionInfo") + @POST("eagleEye-mis/config/versionInfo") // Observable getUpgradeInfo(@Query("resources") String res, @Body RequestBody requestBody); Observable getUpgradeInfo(@Body RequestBody requestBody); diff --git a/core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/appupgrade/network/UpgradeAppNetWorkManager.java b/core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/appupgrade/network/UpgradeAppNetWorkManager.java index 2f58262dfe..fd4ec34bb6 100644 --- a/core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/appupgrade/network/UpgradeAppNetWorkManager.java +++ b/core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/appupgrade/network/UpgradeAppNetWorkManager.java @@ -4,20 +4,13 @@ import android.content.Context; import android.util.Log; import com.mogo.cloud.passport.MoGoAiCloudClientConfig; -import com.mogo.commons.constants.SharedPrefsConstants; -import com.mogo.eagle.core.data.bindingcar.BindingcarInfo; -import com.mogo.eagle.core.data.bindingcar.ModifyBindingcarInfo; import com.mogo.eagle.core.data.bindingcar.UpgradeAppInfo; -import com.mogo.eagle.core.function.api.bindingcar.BindingcarCallBack; +import com.mogo.eagle.core.function.BindHostConst; import com.mogo.eagle.core.function.call.hmi.CallerHmiManager; import com.mogo.eagle.core.network.MoGoRetrofitFactory; import com.mogo.eagle.core.network.utils.GsonUtil; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; -import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr; -import com.mogo.eagle.core.utilcode.mogo.toast.TipToast; import com.mogo.eagle.core.utilcode.util.AppUtils; -import com.mogo.eagle.core.utilcode.util.GsonUtils; -import com.mogo.module.common.constants.HostConst; import io.reactivex.Observer; import io.reactivex.android.schedulers.AndroidSchedulers; @@ -39,7 +32,7 @@ public class UpgradeAppNetWorkManager { private UpgradeAppNetWorkManager() { - mUpgradeApiService = MoGoRetrofitFactory.getInstance(HostConst.UPGRADE_APP_HOST) + mUpgradeApiService = MoGoRetrofitFactory.getInstance(BindHostConst.getBaseUrl()) .create(UpgradeApiService.class); } @@ -64,7 +57,7 @@ public class UpgradeAppNetWorkManager { String sn = MoGoAiCloudClientConfig.getInstance().getSn(); int versionCode = AppUtils.getAppVersionCode(); CallerLogger.INSTANCE.d(TAG, "getAppUpgradeInfo mac = " + mac + "---type = " + screenType + "---sn = " + sn + "---versionCode =" + versionCode); - Log.d("Upgrade", "mac = " + mac + "---type = " + screenType + "---sn = " + sn + "---versionCode =" + versionCode); + Log.d(TAG, "mac = " + mac + "---type = " + screenType + "---sn = " + sn + "---versionCode =" + versionCode); UpgradeAppRequest request = new UpgradeAppRequest(sn, mac, screenType); RequestBody requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), GsonUtil.jsonFromObject(request)); mUpgradeApiService.getUpgradeInfo(requestBody) diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/HostConst.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/HostConst.java index 1a9fad34fd..df45519ece 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/HostConst.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/constants/HostConst.java @@ -22,7 +22,4 @@ public class HostConst { public static final String BINDING_SN_HOST = "https://mygateway.zhidaozhixing.com/cmdbapi/"; //中台提供的接口服务 public static final String BINDING_SN_HOST_TEST = "https://mygateway.zhidaozhixing.com/cmdbapitest/"; //中台提供的接口服务测试 -// public static final String UPGRADE_APP_HOST = "http://10.0.200.12:32423?/"; - public static final String UPGRADE_APP_HOST = "https://eagle-qa.zhidaozhixing.com/"; - } From 39b37149cd92f36171a8d7ea7d8fcee585813758 Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Mon, 10 Oct 2022 15:33:07 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E5=BC=80=E5=90=AF=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E9=A9=BE=E9=A9=B6=E4=BC=A0=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eagle/core/function/main/MainLauncherActivity.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java index 57a75e5d82..f2bf122979 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java @@ -26,6 +26,7 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig; import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider; import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager; +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager; import com.mogo.eagle.core.function.hmi.R; import com.mogo.eagle.core.function.main.moujie.BluetoothMonitorReceiver; @@ -218,7 +219,9 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis if (currentTime - oldTime > 6) { SharedPrefsMgr.getInstance(getContext()).putLong("old_time_up", System.currentTimeMillis() / 1000); // ToastUtils.showShort("长按 ↑↑↑ 开启自动驾驶"); - CallerAutoPilotManager.INSTANCE.setControlAutopilotCarAuto(true); +// CallerAutoPilotManager.INSTANCE.setControlAutopilotCarAuto(true); + CallerAutoPilotManager.INSTANCE.startAutoPilot(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getAutopilotControlParameters()); + } return true; @@ -337,7 +340,8 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis } else if (event.getAction() == KeyEvent.ACTION_UP) { if (numberE == 1) { // ToastUtils.showShort("方块 单击E 开启自动驾驶 "); - CallerAutoPilotManager.INSTANCE.setControlAutopilotCarAuto(true); +// CallerAutoPilotManager.INSTANCE.setControlAutopilotCarAuto(true); + CallerAutoPilotManager.INSTANCE.startAutoPilot(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getAutopilotControlParameters()); } numberE = 0; isLongPressE = false;