From 4e123c5f6d74021b8a7e7e435c6610c8a782004d Mon Sep 17 00:00:00 2001 From: wangmingjun Date: Fri, 23 Sep 2022 13:09:58 +0800 Subject: [PATCH 01/11] =?UTF-8?q?[2.11.0/1.6.0]=20bus=E5=8F=B8=E6=9C=BA?= =?UTF-8?q?=E5=B1=8F=E9=80=89=E6=8B=A9=E8=BF=90=E8=90=A5=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=98=BE=E7=A4=BA"=E7=BB=93=E6=9D=9F=E4=BB=BB=E5=8A=A1"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/mogo/och/bus/fragment/BusFragment.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BusFragment.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BusFragment.java index 65237e5915..71e872104d 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BusFragment.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BusFragment.java @@ -167,6 +167,7 @@ public class BusFragment extends BaseBusTabFragment } showStationsPanel(); + showOrHideSwitchLineBtn(false); mLineName.setText(lineName); mTaskTime.setText(getString(R.string.bus_line_time_tag)+ lineTime); @@ -184,16 +185,12 @@ public class BusFragment extends BaseBusTabFragment if (arrivingOrArrivedIndex == stationList.size() - 1 && isArrived){ //切换路线和结束路线按钮切换 - showOrHideSwitchLineBtn(false); - showSlidePanel("单程结束"); setOrRemoveMapMaker(false, BusConst.BUS_END_MAP_MAKER, endStation.getLat() , endStation.getLon(),R.raw.end_marker); }else if (arrivingOrArrivedIndex == 0 && isArrived){ - showOrHideSwitchLineBtn(true); - showSlidePanel("滑动出发"); setOrRemoveMapMaker(true, BusConst.BUS_START_MAP_MAKER, @@ -206,8 +203,6 @@ public class BusFragment extends BaseBusTabFragment showSlidePanel("滑动出发"); } - showOrHideSwitchLineBtn(false); - setOrRemoveMapMaker(false, BusConst.BUS_START_MAP_MAKER, startStation.getLat() , startStation.getLon(),R.raw.star_marker); setOrRemoveMapMaker(true, BusConst.BUS_END_MAP_MAKER, endStation.getLat() From d4937769f986754e31defc4d5a6902e046fd537b Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Mon, 19 Sep 2022 18:19:03 +0800 Subject: [PATCH 02/11] =?UTF-8?q?[Feat]=E4=B9=98=E5=AE=A2=E5=B1=8F?= =?UTF-8?q?=E7=9B=B4=E8=BF=9E=E5=B7=A5=E6=8E=A7=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../autopilot/MoGoAutopilotProvider.kt | 90 ++++++------------ .../call/autopilot/CallerAutoPilotManager.kt | 95 +++++++++++++------ 2 files changed, 98 insertions(+), 87 deletions(-) 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 0e7d380a28..037bcb6bd5 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 @@ -80,7 +80,6 @@ class MoGoAutopilotProvider : // 初始化ADAS 域控制器 CupidLogUtils.setEnableLog(false) msgHandler = TeleMsgHandler() - // TODO 临时方案,根据不同的身份标识,连接不同的工控机IP if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {// 司机 // 注册地图采集功能 CallerMapDataCollectorManager.registerOnMapCollectTaskListener(this) @@ -95,11 +94,11 @@ class MoGoAutopilotProvider : // "192.168.1.102" val options = AdasOptions.Builder() - .setIpcConnectionMode(AdasOptions.IPC_CONNECTION_MODE.FIXATION) - .setIpcFixationIP(AdasManager.getInstance().getIPCFixationIPList(mContext)) - .setClient(false) + .setIpcConnectionMode(AdasOptions.IPC_CONNECTION_MODE.FIXATION) + .setIpcFixationIP(AdasManager.getInstance().getIPCFixationIPList(mContext)) + .setClient(false) // .setSubscribeInterfaceOptions(subscribeInterfaceOptions)// - .build() + .build() AdasManager.getInstance().create(options, MoGoAdasMsgConnectStatusListenerImpl()) NSDNettyManager.getInstance().startNSDNettyServerWithSN(context, object : @@ -130,36 +129,34 @@ class MoGoAutopilotProvider : } }, MoGoAiCloudClientConfig.getInstance().sn) } else { - // 乘客端默认接收绘制全局路径+引导线 - //FunctionBuildConfig.isDemoMode = true - //FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true - // "192.168.1.103" val options = AdasOptions .Builder() - .setClient(true) + .setIpcConnectionMode(AdasOptions.IPC_CONNECTION_MODE.FIXATION) + .setIpcFixationIP(AdasManager.getInstance().getIPCFixationIPList(mContext)) + .setClient(false)// 乘客端直连工控机改为false .build() AdasManager.getInstance().create(options, MoGoAdasMsgConnectStatusListenerImpl()) NSDNettyManager.getInstance() - .searchAndConnectServer(context, MoGoAiCloudClientConfig.getInstance().sn, - AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode), - object : NettyClientListener { - override fun onMessageResponseClient( - msg: MogoProtocolMsg?, - sign: String?, - channel: Channel - ) { - // 乘客端收到adas数据直接解析,后续分发解析后的数据流程同司机端 - msgHandler.handleMsgFromServer(msg, channel) - } + .searchAndConnectServer(context, MoGoAiCloudClientConfig.getInstance().sn, + AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode), + object : NettyClientListener { + override fun onMessageResponseClient( + msg: MogoProtocolMsg?, + sign: String?, + channel: Channel + ) { + // 乘客端收到adas数据直接解析,后续分发解析后的数据流程同司机端 + msgHandler.handleMsgFromServer(msg, channel) + } - override fun onClientStatusConnectChanged( - statusCode: Int, - sign: String?, - channel: Channel - ) { - msgHandler.handleClientConnStatus(statusCode, sign, channel) - } - }) + override fun onClientStatusConnectChanged( + statusCode: Int, + sign: String?, + channel: Channel + ) { + msgHandler.handleClientConnStatus(statusCode, sign, channel) + } + }) } //////////////////////////////////注意先后顺序,AdasManager.getInstance().create后才可以设置监听///////////////////////////////////////////// @@ -169,33 +166,6 @@ class MoGoAutopilotProvider : if (!AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { CallerAutopilotCarConfigListenerManager.addListener(TAG, this) } - 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 - ) - - } - - }); - CallerLogger.i("$M_ADAS_IMPL$TAG", "initServer……") // 同步数据给工控机的服务 AsyncDataToAutopilotServer.INSTANCE.initServer() @@ -324,7 +294,7 @@ class MoGoAutopilotProvider : } override fun recordPackage(type: Int, id: Int, duration: Int, bduration: Int): Boolean { - return AdasManager.getInstance().startRecordPackage(id,duration, type, bduration) + return AdasManager.getInstance().startRecordPackage(id, duration, type, bduration) } override fun stopRecord(type: Int, id: Int): Boolean { @@ -366,7 +336,6 @@ class MoGoAutopilotProvider : } - /** * 演示模式(美化模式)设置只限定于鹰眼 * isEnable = true 开启 @@ -492,7 +461,10 @@ class MoGoAutopilotProvider : if (isEnable) { AdasManager.getInstance().sendAutoPilotModeReq(1, 0, null) } else { - AdasManager.getInstance().sendAutoPilotModeReq(0, 0, null) + // 司机屏才可关闭自动驾驶 + if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { + AdasManager.getInstance().sendAutoPilotModeReq(0, 0, null) + } } } 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 a9d63a6b1b..85e8eb1663 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 @@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.call.autopilot import android.os.SystemClock import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters +import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.constants.MogoServicePaths import com.mogo.eagle.core.data.deva.chain.ChainConstant import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_EAGLE_START_AUTOPILOT @@ -10,6 +11,7 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LO import com.mogo.eagle.core.data.trafficlight.TrafficLightResult import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotProvider import com.mogo.eagle.core.function.call.base.CallerBase +import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils import com.zhjt.service.chain.ChainLog import com.zhjt.service.chain.TracingConstants import kotlin.random.Random @@ -40,7 +42,7 @@ object CallerAutoPilotManager { /** * 断开与工控机的连接 */ - fun disconnectIpc(){ + fun disconnectIpc() { providerApi?.disconnectIpc() } @@ -69,51 +71,70 @@ object CallerAutoPilotManager { * 发送红绿灯数据至工控机 */ fun sendTrafficLightData(trafficLightResult: TrafficLightResult) { - providerApi?.sendTrafficLightData(trafficLightResult) + if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { + providerApi?.sendTrafficLightData(trafficLightResult) + } } /** * 发送 轨迹下载请求 */ fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine) { - providerApi?.sendTrajectoryDownloadReq(autoPilotLine) + if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { + providerApi?.sendTrajectoryDownloadReq(autoPilotLine) + } } /** * 结束自动驾驶 */ fun cancelAutoPilot() { - providerApi?.cancelAutoPilot() + // 司机屏才能取消自动驾驶 + if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { + providerApi?.cancelAutoPilot() + } } /** * 开启域控制器录制bag包 */ fun recordPackage() { - providerApi?.recordPackage(1, Random(SystemClock.elapsedRealtime()).nextInt()) + if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { + providerApi?.recordPackage(1, Random(SystemClock.elapsedRealtime()).nextInt()) + } } - fun recordPackage(duration: Int){ - providerApi?.recordPackage(1, Random(SystemClock.elapsedRealtime()).nextInt(),duration) + fun recordPackage(duration: Int) { + if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { + providerApi?.recordPackage(1, Random(SystemClock.elapsedRealtime()).nextInt(), duration) + } } fun recordPackage(type: Int, id: Int) { - providerApi?.recordPackage(type, id) + if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { + providerApi?.recordPackage(type, id) + } } fun recordPackage(type: Int, id: Int, duration: Int) { - providerApi?.recordPackage(type, id, duration) + if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { + providerApi?.recordPackage(type, id, duration) + } } - fun recordPackage(type: Int, id: Int, duration: Int,bduration: Int){ - providerApi?.recordPackage(type, id, duration, bduration) + fun recordPackage(type: Int, id: Int, duration: Int, bduration: Int) { + if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { + providerApi?.recordPackage(type, id, duration, bduration) + } } /** * 停止录制bag包 */ fun stopRecord(type: Int, id: Int) { - providerApi?.stopRecord(type, id) + if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { + providerApi?.stopRecord(type, id) + } } /** @@ -127,8 +148,8 @@ object CallerAutoPilotManager { /** * ADAS日志开启状态 */ - fun isEnableLog(): Boolean{ - return providerApi?.isEnableLog()?:false + fun isEnableLog(): Boolean { + return providerApi?.isEnableLog() ?: false } @@ -136,11 +157,19 @@ object CallerAutoPilotManager { * speed单位:km/h */ fun setAutoPilotSpeed(speed: Int): Boolean { - return providerApi?.setAutoPilotSpeed(speed) ?: false + // 司机屏才可以设置最大速度 + return if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { + providerApi?.setAutoPilotSpeed(speed) ?: false + } else { + false + } } fun recordCause(key: String?, name: String?, id: String?, reason: String?) { - providerApi?.recordCause(key, name, id, reason) + // 乘客屏不需要记录人工接管原因 + if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { + providerApi?.recordCause(key, name, id, reason) + } } fun setIPCShutDown() { @@ -157,7 +186,9 @@ object CallerAutoPilotManager { * isEnable = false 关闭 */ fun setDemoMode(isEnable: Boolean) { - providerApi?.setDemoMode(isEnable) + if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { + providerApi?.setDemoMode(isEnable) + } } /** @@ -173,8 +204,11 @@ object CallerAutoPilotManager { * isEnable = true 开启 * isEnable = false 关闭 */ - fun setIPCDemoMode(isEnable: Boolean){ - providerApi?.setIPCDemoMode(isEnable) + fun setIPCDemoMode(isEnable: Boolean) { + // 司机屏才能控制美化模式(状态是在客户端维护、管理的) + if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { + providerApi?.setIPCDemoMode(isEnable) + } } /** @@ -182,15 +216,18 @@ object CallerAutoPilotManager { * isEnable = true 开启 * isEnable = false 关闭 */ - fun setRainMode(isEnable: Boolean){ + fun setRainMode(isEnable: Boolean) { providerApi?.setRainMode(isEnable) } /** * 获取数据采集录制模式配置列表 */ - fun getBadCaseConfig(){ - providerApi?.getBadCaseConfig() + fun getBadCaseConfig() { + // 司机屏才能查询数据采集的配置 + if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { + providerApi?.getBadCaseConfig() + } } /** @@ -224,8 +261,10 @@ object CallerAutoPilotManager { /** * 发送工控机所有节点重启命令 */ - fun sendIpcReboot(){ - providerApi?.sendIpcReboot() + fun sendIpcReboot() { + if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { + providerApi?.sendIpcReboot() + } } /** @@ -247,22 +286,22 @@ object CallerAutoPilotManager { /** * 查询工控机基础配置信息 */ - fun getCarConfig(){ + fun getCarConfig() { providerApi?.getCarConfig() } /** * 获取全局路径 */ - fun getGlobalPath(){ + fun getGlobalPath() { providerApi?.getGlobalPath() } /** *获取协议版本 */ - fun getProtocolVersion(): Int{ - return providerApi?.getProtocolVersion() ?:0 + fun getProtocolVersion(): Int { + return providerApi?.getProtocolVersion() ?: 0 } fun connectSpecifiedServer(ip: String) { From 1742d3e8240e45c0885d912286c5ba766268fb3b Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Mon, 19 Sep 2022 19:25:40 +0800 Subject: [PATCH 03/11] =?UTF-8?q?[Fix]=E5=BF=BD=E7=95=A5=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?so=E7=9A=84=E7=9B=91=E6=8E=A7=EF=BC=8C=E6=9A=82=E6=97=B6?= =?UTF-8?q?=E8=A7=A3=E5=86=B3KOOM=E5=B4=A9=E6=BA=83=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/mogo/eagle/core/function/main/MainActivity.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainActivity.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainActivity.java index ba48df44ff..ad61a55aa2 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainActivity.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainActivity.java @@ -304,7 +304,8 @@ public class MainActivity extends MvpActivity implement .setLoopInterval(50000) .setMonitorThreshold(16) .setNativeHeapAllocatedThreshold(0) - .setEnableLocalSymbolic(true) + .setIgnoredSoList(new String[]{"libart", "libc"}) + .setEnableLocalSymbolic(BuildConfig.DEBUG) .setLeakListener(leaks -> { StringBuilder stringBuilder = new StringBuilder(); if (!leaks.isEmpty()) { From e2396364cf20ce81e223d0c44ef5ebd6ea43abe9 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Tue, 20 Sep 2022 14:45:45 +0800 Subject: [PATCH 04/11] =?UTF-8?q?[Fix]=E8=A7=A3=E5=86=B3KOOM=E5=A4=84?= =?UTF-8?q?=E4=BA=8EDebugMode=E5=AF=BC=E8=87=B4=E7=9A=84Java=E5=B4=A9?= =?UTF-8?q?=E6=BA=83=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eagle/core/function/main/KoomInitTask.kt | 24 +++++++++++++++++++ .../function/main/MainMoGoApplication.java | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/KoomInitTask.kt diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/KoomInitTask.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/KoomInitTask.kt new file mode 100644 index 0000000000..4fb06a0f67 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/KoomInitTask.kt @@ -0,0 +1,24 @@ +package com.mogo.eagle.core.function.main + +import android.app.Application +import android.os.Build +import com.kwai.koom.base.CommonConfig +import com.kwai.koom.base.InitTask +import com.kwai.koom.base.MonitorManager + +object KoomInitTask : InitTask { + override fun init(application: Application) { + val config = CommonConfig.Builder() + .setApplication(application) // Set application + .setDebugMode(false) + .setVersionNameInvoker { "1.0.0" } // Set version name, java leak feature use it + .setSdkVersionMatch( + Build.VERSION.SDK_INT <= 31 && Build.VERSION.SDK_INT + >= Build.VERSION_CODES.LOLLIPOP + ) // Set if current sdk version is supported + .build() + + MonitorManager.initCommonConfig(config) + .apply { onApplicationCreate() } + } +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java index ef395d3e67..9560a84570 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java @@ -107,7 +107,7 @@ public abstract class MainMoGoApplication extends AbsMogoApplication { } private void initKoom() { - DefaultInitTask.INSTANCE.init(this); + KoomInitTask.INSTANCE.init(this); } /** From d27b42c0a87dd2b952592cd9b75bf19e0282c2d5 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Tue, 20 Sep 2022 14:46:18 +0800 Subject: [PATCH 05/11] =?UTF-8?q?[Feat]=E4=BF=AE=E6=94=B9=E6=91=84?= =?UTF-8?q?=E5=83=8F=E5=A4=B4=E8=A7=86=E9=A2=91=E7=9A=84=E5=AE=BD=E9=AB=98?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/res/layout/view_camera_list.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_camera_list.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_camera_list.xml index b043efbb09..379e8e32d4 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_camera_list.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_camera_list.xml @@ -5,8 +5,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@color/notice_check_dialog_bg_color" - android:minWidth="777px" - android:minHeight="485px" + android:minWidth="882px" + android:minHeight="550px" app:roundLayoutRadius="30px"> @@ -68,8 +68,8 @@ Date: Wed, 21 Sep 2022 12:14:05 +0800 Subject: [PATCH 06/11] =?UTF-8?q?[Fix]=E8=A7=A3=E5=86=B3=E7=BE=8E=E5=8C=96?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E6=97=B6=E5=BA=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../autopilot/MoGoAutopilotProvider.kt | 13 +++++- .../autopilot/telematic/TeleMsgHandler.kt | 46 +++++++++++++++---- 2 files changed, 49 insertions(+), 10 deletions(-) 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 037bcb6bd5..12fb24808b 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 @@ -344,7 +344,12 @@ class MoGoAutopilotProvider : override fun setDemoMode(isEnable: Boolean) { // 同步给乘客端 if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { - val byteArray = if (isEnable) byteArrayOf(1) else byteArrayOf(0) + val byteArray = if (isEnable) { + "1;${System.currentTimeMillis()}".toByteArray() + } else { + "0;${System.currentTimeMillis()}".toByteArray() + } +// val byteArray = if (isEnable) byteArrayOf(1) else byteArrayOf(0) if (NSDNettyManager.getInstance().isServerStart) { NSDNettyManager.getInstance() .sendMsgToAllClients( @@ -363,7 +368,11 @@ class MoGoAutopilotProvider : override fun setIgnoreConditionDraw(isIgnore: Boolean) { // 同步给乘客端 if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { - val byteArray = if (isIgnore) byteArrayOf(1) else byteArrayOf(0) + val byteArray = if (isIgnore) { + "1;${System.currentTimeMillis()}".toByteArray() + } else { + "0;${System.currentTimeMillis()}".toByteArray() + } if (NSDNettyManager.getInstance().isServerStart) { NSDNettyManager.getInstance() .sendMsgToAllClients( 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 461b9fd7f4..bff0d93ae0 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 @@ -41,6 +41,12 @@ class TeleMsgHandler : IMsgHandler { @Volatile private var isReceiveSN = false + @Volatile + private var demoModeTime = 0L + + @Volatile + private var timestamp = 0L + override fun handleMsgFromServer(msg: MogoProtocolMsg?, channel: Channel?) { msg?.let { when (it.protocolType) { @@ -57,11 +63,23 @@ class TeleMsgHandler : IMsgHandler { } } MogoProtocolMsg.SYNC_MODE_STATUS -> { - FunctionBuildConfig.isDemoMode = when (it.body[0].toInt()) { - 1 -> true - else -> false + val content = String(it.body) + if (content.contains(";")) { + val strArr = content.split(";") + if (strArr.size == 2) { + val currTime = strArr[1].toLong() + if (currTime > demoModeTime) { + FunctionBuildConfig.isDemoMode = when (strArr[0]) { + "1" -> true + else -> false + } + demoModeTime = currTime + invokeNettyConnResult("乘客屏收到的美化模式DemoMode为:${FunctionBuildConfig.isDemoMode}") + } else { + invokeNettyConnResult("乘客屏收到过时的美化模式DemoMode为:${FunctionBuildConfig.isDemoMode}") + } + } } - invokeNettyConnResult("乘客屏收到的美化模式DemoMode为:${FunctionBuildConfig.isDemoMode}") } MogoProtocolMsg.REQ_MAC_ADDRESS -> { val carConfig = MessagePad.CarConfigResp.parseFrom(msg.body) @@ -86,11 +104,23 @@ class TeleMsgHandler : IMsgHandler { } // 美化模式是否忽略条件直接绘制 11 -> { - FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = when (it.body[0].toInt()) { - 1 -> true - else -> false + val content = String(it.body) + if (content.contains(";")) { + val strArr = content.split(";") + if (strArr.size == 2) { + val currTime = strArr[1].toLong() + if (currTime > timestamp) { + FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = when (strArr[0]) { + "1" -> true + else -> false + } + timestamp = currTime + invokeNettyConnResult("乘客屏收到的美化模式isIgnore为:${FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData}") + } else { + invokeNettyConnResult("乘客屏收到过时的美化模式isIgnore为:${FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData}") + } + } } - invokeNettyConnResult("乘客屏收到的美化模式isIgnore为:${FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData}") } else -> { } From 99b9d5acbefdf6491d69698c04f9615dedd58ea5 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Wed, 21 Sep 2022 15:00:14 +0800 Subject: [PATCH 07/11] =?UTF-8?q?[Fix]=E8=A7=A3=E5=86=B3=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E9=A9=BE=E9=A9=B6=E8=BF=87=E7=A8=8B=E4=B8=AD=E6=9D=80=E6=8E=89?= =?UTF-8?q?App=E5=86=8D=E8=BF=9B=E5=85=A5=E5=85=A8=E8=A7=88=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E6=B2=A1=E6=9C=89=E5=85=A8=E5=B1=80=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E8=A7=84=E5=88=92=E7=9A=84=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mogo/eagle/core/function/smp/OverviewMapFragment.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/OverviewMapFragment.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/OverviewMapFragment.java index c1862a7485..86e3cbf6e5 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/OverviewMapFragment.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/OverviewMapFragment.java @@ -11,6 +11,7 @@ import com.mogo.commons.mvp.BaseFragment; import com.mogo.eagle.core.data.constants.MoGoFragmentPaths; import com.mogo.eagle.core.data.map.MogoLatLng; import com.mogo.eagle.core.function.api.map.smp.IMogoSmallMapProvider; +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager; import com.mogo.eagle.core.function.map.R; import com.mogo.eagle.core.function.overview.InfStructureManager; @@ -89,6 +90,8 @@ public class OverviewMapFragment extends BaseFragment @Override public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); + // 主动查一次全局路径规划的数据 + CallerAutoPilotManager.INSTANCE.getGlobalPath(); // queryInfStructure(); } From 4d0625d4c6a9c234a92226e5fccd1fa02495abb1 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Wed, 21 Sep 2022 18:25:33 +0800 Subject: [PATCH 08/11] =?UTF-8?q?[Feat]=E4=BC=98=E5=8C=96=E8=87=AA?= =?UTF-8?q?=E8=BD=A6=E5=88=B0=E5=81=9C=E6=AD=A2=E7=BA=BF=E7=9A=84=E8=B7=9D?= =?UTF-8?q?=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v2x/redlightwarning/LocationUtils.java | 74 +++++++++++++++++++ .../redlightwarning/RedLightWarningManager.kt | 28 ++++++- .../core/MogoTrafficLightManager.kt | 4 + 3 files changed, 102 insertions(+), 4 deletions(-) create mode 100644 core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/redlightwarning/LocationUtils.java diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/redlightwarning/LocationUtils.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/redlightwarning/LocationUtils.java new file mode 100644 index 0000000000..fc062a3f45 --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/redlightwarning/LocationUtils.java @@ -0,0 +1,74 @@ +package com.mogo.eagle.core.function.v2x.redlightwarning; + +public class LocationUtils { + /** + * 地球半径 + */ + private static double EARTH_RADIUS = 6378.137; + + private static double rad( double d ) { + return d * Math.PI / 180.0; + } + + /** + * 计算两点间距离( 单位:米 ) + * @param lat1 + * @param lng1 + * @param lat2 + * @param lng2 + * @return + */ + public static double getDistance( double lat1, double lng1, double lat2, double lng2 ) { + double radLat1 = rad( lat1 ); + double radLat2 = rad(lat2); + double a = radLat1 - radLat2; + double b = rad(lng1) - rad(lng2); + double s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + + Math.cos(radLat1) * Math.cos(radLat2) + * Math.pow(Math.sin(b / 2), 2))); + s = s * EARTH_RADIUS; + s = Math.round(s * 10000d) / 10000d; + s = s * 1000; + return s; + } + + + /** + * 点到直线的最短距离的判断 点(x0,y0) 到由两点组成的线段(x1,y1) ,( x2,y2 )
+ * ( 单位:米 ) + * @param x1 + * @param y1 + * @param x2 + * @param y2 + * @param x0 + * @param y0 + * @return + */ + public static double pointToLine( double x1, double y1, double x2, double y2, double x0, double y0 ) { + double space; + double a, b, c; + a = getDistance(y1, x1, y2, x2);// 线段的长度 + b = getDistance(y1, x1, y0, x0);// (x1,y1)到点的距离 + c = getDistance(y2, x2, y0, x0);// (x2,y2)到点的距离 + if (c <= 0.000001 || b <= 0.000001) { + space = 0; + return space; + } + if (a <= 0.000001) { + space = b; + return space; + } + if (c * c >= a * a + b * b) { + space = b; + return space; + } + if (b * b >= a * a + c * c) { + space = c; + return space; + } + double p = (a + b + c) / 2;// 半周长 + double s = Math.sqrt(p * (p - a) * (p - b) * (p - c));// 海伦公式求面积 + space = 2 * s / a;// 返回点到线的距离(利用三角形面积公式求高) + return space; + } +} diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/redlightwarning/RedLightWarningManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/redlightwarning/RedLightWarningManager.kt index 66acaf96d6..fa0c9d62ae 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/redlightwarning/RedLightWarningManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/redlightwarning/RedLightWarningManager.kt @@ -15,6 +15,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager import com.mogo.eagle.core.function.call.vip.CallVipSetListenerManager +import com.mogo.eagle.core.function.v2x.trafficlight.core.MogoTrafficLightManager import com.mogo.eagle.core.utilcode.util.ThreadUtils import com.mogo.map.navi.IMogoCarLocationChangedListener2 import com.mogo.module.common.MogoApisHandler @@ -23,6 +24,7 @@ import com.zhjt.service_biz.BizConfig import kotlin.math.abs import kotlin.math.ceil import kotlin.math.floor +import kotlin.math.min class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener, @@ -98,10 +100,15 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener, CallerLogger.d("$M_V2X$TAG", "speed is:$speed") if (speed <= 2.5f) return// 小于等于9km/h不处理 // 由于到路口100m时回调不准,手动计算直线距离 - val distance = CallerMapUIServiceManager.getMapUIController()?.calculateLineDistance( - MogoLatLng(it.latitude, it.longitude), - MogoLatLng(trafficLightResult.lat, trafficLightResult.lon) - ) ?: 0f + val roadResult = MogoTrafficLightManager.INSTANCE.getRoadResult() + val distance = if (roadResult != null && roadResult.rectLatLngs.size >= 2) { + getMinDistance(roadResult.rectLatLngs, it.latitude, it.longitude) + } else { + CallerMapUIServiceManager.getMapUIController()?.calculateLineDistance( + MogoLatLng(it.latitude, it.longitude), + MogoLatLng(trafficLightResult.lat, trafficLightResult.lon) + ) ?: 0f + } CallerLogger.d( "$M_V2X$TAG", "路口经度为:${trafficLightResult.lon},纬度为:${trafficLightResult.lat};车的经度为:${it.longitude},纬度为:${it.latitude};两点距离为:${distance}" @@ -163,6 +170,19 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener, } } + private fun getMinDistance(points: List, lat: Double, lon: Double): Float { + // 到路口100m时才计算,赋值一个较大值 + var minValue = 9999.9 + val size = points.size + for (i in 0..size step 2) { + if (i < size) { + // 自车到0-1、2-3、4-5、6-7组成的线段的最小距离 + minValue = min(minValue, LocationUtils.pointToLine(points[i].lon, points[i].lat, points[i+1].lon, points[i+1].lat, lon, lat)) + } + } + return if (minValue > 9999) 0f else minValue.toFloat() + } + /** * 闯红灯预警 */ diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/core/MogoTrafficLightManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/core/MogoTrafficLightManager.kt index 96f39e2222..332fe3ba85 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/core/MogoTrafficLightManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/core/MogoTrafficLightManager.kt @@ -151,6 +151,10 @@ class MogoTrafficLightManager : IMogoCarLocationChangedListener2 { return null } + fun getRoadResult(): RoadIDResult? { + return roadIDResult + } + fun turnLightToGreen( lightId: Int, crossingNo: String, From 1c2b42c5c80eb4ba5ea8d0ff13baeb394f70fba5 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Fri, 23 Sep 2022 14:36:35 +0800 Subject: [PATCH 09/11] =?UTF-8?q?[Feat]=E6=AF=8F10s=E5=8F=B8=E6=9C=BA?= =?UTF-8?q?=E5=B1=8F=E5=90=8C=E6=AD=A5=E4=B8=80=E6=AC=A1=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=88=B0=E6=89=80=E6=9C=89=E4=B9=98=E5=AE=A2=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../autopilot/MoGoAutopilotProvider.kt | 18 +++++++++++-- .../autopilot/telematic/IMsgHandler.kt | 2 ++ .../autopilot/telematic/TeleMsgHandler.kt | 25 ++++++++++++++++--- 3 files changed, 39 insertions(+), 6 deletions(-) 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 12fb24808b..0a8c633f83 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 @@ -54,6 +54,7 @@ import com.zhjt.service.chain.ChainLog import com.zhjt.service.chain.TracingConstants import io.netty.channel.Channel import mogo.telematics.pad.MessagePad +import java.util.* import java.util.concurrent.TimeUnit @@ -69,6 +70,7 @@ class MoGoAutopilotProvider : private val TAG = "MoGoAutoPilotProvider" private var mContext: Context? = null private lateinit var msgHandler: IMsgHandler + private var timer: Timer? = null override val functionName: String get() = TAG @@ -109,11 +111,25 @@ class MoGoAutopilotProvider : override fun onStartServer() { ToastUtils.showShort("司机端服务启动成功!") + if (timer == null) { + timer = Timer() + } + // 10s同步一次数据到乘客屏 + timer!!.schedule(object : TimerTask() { + override fun run() { + // 同步是否开启美化模式 + setDemoMode(FunctionBuildConfig.isDemoMode) + setIgnoreConditionDraw(FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData) + msgHandler.synMsgToAllClients() + } + }, 1000, 10000) invokeNettyConnResult("司机端服务启动成功!") } override fun onStopServer() { ToastUtils.showLong("司机端服务停止!") + timer?.cancel() + timer = null invokeNettyConnResult("司机端服务停止!") } @@ -169,8 +185,6 @@ class MoGoAutopilotProvider : CallerLogger.i("$M_ADAS_IMPL$TAG", "initServer……") // 同步数据给工控机的服务 AsyncDataToAutopilotServer.INSTANCE.initServer() - // 同步是否开启美化模式 - setDemoMode(FunctionBuildConfig.isDemoMode) // 同步是否开启雨天模式 setRainMode(FunctionBuildConfig.isRainMode) } 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 f4d1c9bbab..3f9c72d8fc 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 @@ -17,4 +17,6 @@ interface IMsgHandler { fun synWriteTime() fun getTeleTimeStamp(): Long + + fun synMsgToAllClients() } \ 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 bff0d93ae0..716eab5c48 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 @@ -110,10 +110,11 @@ class TeleMsgHandler : IMsgHandler { if (strArr.size == 2) { val currTime = strArr[1].toLong() if (currTime > timestamp) { - FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = when (strArr[0]) { - "1" -> true - else -> false - } + FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = + when (strArr[0]) { + "1" -> true + else -> false + } timestamp = currTime invokeNettyConnResult("乘客屏收到的美化模式isIgnore为:${FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData}") } else { @@ -273,4 +274,20 @@ class TeleMsgHandler : IMsgHandler { } } } + + override fun synMsgToAllClients() { + if (NSDNettyManager.getInstance().isServerStart) { + val carConfig = AdasManager.getInstance().carConfig + if (carConfig != null) { + val configArray = carConfig.toByteArray() + + NSDNettyManager.getInstance().sendMsgToAllClients( + MogoProtocolMsg( + MogoProtocolMsg.REQ_MAC_ADDRESS, + configArray.size, configArray + ) + ) + } + } + } } \ No newline at end of file From f856d0fc238a5c23a19c813754d6119116c08216 Mon Sep 17 00:00:00 2001 From: zhongchao Date: Fri, 23 Sep 2022 16:44:39 +0800 Subject: [PATCH 10/11] add trace of cloud v2n --- .../trace/TraceManager.kt | 5 ++++- .../core/function/v2x/events/V2XEventManager.kt | 14 ++++++++++++++ .../eagle/core/data/deva/chain/ChainConstant.kt | 3 +++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/trace/TraceManager.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/trace/TraceManager.kt index 5d38abba20..a0c48db9ec 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/trace/TraceManager.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/trace/TraceManager.kt @@ -61,7 +61,8 @@ class TraceManager : IMoGoCloudListener { FwBuild(true, -1, pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_PLANNING_ACTIONS) fwBuildMap[ChainConstant.CHAIN_LINK_LOG_NATIVE_LEAK] = FwBuild(true, -1, pkgName + ChainConstant.CHAIN_LINK_LOG_RECORD_NATIVE_LEAK) - + fwBuildMap[ChainConstant.CHAIN_LINK_LOG_CLOUD_V2N] = + FwBuild(true, -1, pkgName + ChainConstant.CHAIN_LINK_LOG_CLOUD_WEB_SOCKET_V2N) traceInfoCache[ChainConstant.CHAIN_LINK_LOG_CONNECT_STATUS] = @@ -84,6 +85,8 @@ class TraceManager : IMoGoCloudListener { ChainLogParam(true, "ADAS PLANNING 决策行为") traceInfoCache[ChainConstant.CHAIN_LINK_LOG_NATIVE_LEAK] = ChainLogParam(true, "Native Leak Record") + traceInfoCache[ChainConstant.CHAIN_LINK_LOG_CLOUD_V2N] = + ChainLogParam(true, "Cloud WebSocket V2N") FileWriteManager.getInstance() .init(context, MoGoAiCloudClientConfig.getInstance().sn, pkgName, fwBuildMap) diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt index a01193f381..7d436e2693 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt @@ -14,6 +14,10 @@ import com.mogo.cloud.passport.IMoGoTokenCallback import com.mogo.cloud.passport.MoGoAiCloudClient import com.mogo.cloud.passport.MoGoAiCloudClientConfig import com.mogo.commons.network.ParamsUtil +import com.mogo.eagle.core.data.deva.chain.ChainConstant +import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_V2N +import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_CLOUD_SHOW +import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CLOUD_V2N import com.mogo.eagle.core.data.enums.TrafficTypeEnum import com.mogo.eagle.core.data.map.* import com.mogo.eagle.core.data.traffic.TrafficData @@ -76,6 +80,8 @@ import com.shuyu.gsyvideoplayer.model.VideoOptionModel import com.shuyu.gsyvideoplayer.player.IjkPlayerManager import com.shuyu.gsyvideoplayer.player.PlayerFactory import com.shuyu.gsyvideoplayer.utils.GSYVideoType +import com.zhjt.service.chain.ChainLog +import com.zhjt.service.chain.TracingConstants import kotlinx.coroutines.* import kotlinx.coroutines.android.asCoroutineDispatcher import roadwork.Road.RW_PB @@ -433,6 +439,14 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb /** * V2XEvent事件回调 */ + @ChainLog( + linkChainLog = CHAIN_LINK_LOG_CLOUD_V2N, + linkCode = CHAIN_LINK_CLOUD_SHOW, + endpoint = TracingConstants.Endpoint.PAD, + nodeAliasCode = CHAIN_ALIAS_CODE_CLOUD_V2N, + paramIndexes = [0], + clientPkFileName = "sn" + ) override fun onAck(event: V2XEvent) { Log.d("$M_V2X$TAG", "OK->: $event") when (event) { diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/deva/chain/ChainConstant.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/deva/chain/ChainConstant.kt index 2e043376c1..58bc9c50b4 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/deva/chain/ChainConstant.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/deva/chain/ChainConstant.kt @@ -23,6 +23,7 @@ class ChainConstant { const val CHAIN_LINK_LOG_WEB_SOCKET_PLANNING_OBJECTS = 7 const val CHAIN_LINK_LOG_WEB_SOCKET_PLANNING_ACTIONS = 8 const val CHAIN_LINK_LOG_NATIVE_LEAK = 100 + const val CHAIN_LINK_LOG_CLOUD_V2N = 200 const val CHAIN_LINK_LOG_ADAS_INIT = "-eagleInitStatus" const val CHAIN_LINK_LOG_ADAS_GNSS = "-adasWsGnssInfo" @@ -34,6 +35,7 @@ class ChainConstant { const val CHAIN_LINK_LOG_ADAS_PLANNING_OBJECTS = "-adasWsPlanningObj" const val CHAIN_LINK_LOG_ADAS_PLANNING_ACTIONS = "-adasWsPlanningActions" const val CHAIN_LINK_LOG_RECORD_NATIVE_LEAK = "-eagleRecordNativeLeak" + const val CHAIN_LINK_LOG_CLOUD_WEB_SOCKET_V2N = "-eagleCloudWSV2N" const val CHAIN_ALIAS_CODE_MULTI_CONNECT = "CHAIN_ALIAS_CODE_MULTI_CONNECT" const val CHAIN_ALIAS_CODE_ADAS_MESSAGE_CAR_CONFIG = "CHAIN_ALIAS_CODE_CAR_CONFIG" @@ -60,6 +62,7 @@ class ChainConstant { const val CHAIN_ALIAS_CODE_CLOUD_CONNECT_ERROR = "CHAIN_ALIAS_CODE_CLOUD_CONNECT_ERROR" const val CHAIN_ALIAS_CODE_HTTP_DNS_CHANGED = "CHAIN_ALIAS_CODE_HTTP_DNS_CHANGED" const val CHAIN_ALIAS_CODE_FUNC_CONFIG_CHANGED = "CHAIN_ALIAS_CODE_FUNC_CONFIG_CHANGED" + const val CHAIN_ALIAS_CODE_CLOUD_V2N = "CHAIN_ALIAS_CODE_CLOUD_V2N" const val CHAIN_ALIAS_CODE_INIT_ON_MAP_LOADED = "CHAIN_ALIAS_CODE_INIT_ON_MAP_LOADED" const val CHAIN_ALIAS_CODE_INIT_ON_MAP_INIT = "CHAIN_ALIAS_CODE_INIT_ON_MAP_INIT" From 7c36193fcddf258b3ddf797d36160bf26f61fc47 Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Fri, 23 Sep 2022 17:28:40 +0800 Subject: [PATCH 11/11] fixed conflict --- .../eagle/core/function/bindingcar/BindingcarProvider.java | 2 ++ .../mogo/eagle/core/function/main/MainMoGoApplication.java | 2 +- .../core/function/call/devatools/CallerDevaToolsManager.kt | 2 ++ .../core/utilcode/breakpoint/services/DownloadService.java | 3 ++- .../core/utilcode/breakpoint/thread/DownloadThread.java | 5 +++++ 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/bindingcar/BindingcarProvider.java b/core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/bindingcar/BindingcarProvider.java index 24cdbc4766..1e61715f12 100644 --- a/core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/bindingcar/BindingcarProvider.java +++ b/core/function-impl/mogo-core-function-bindingcar/src/main/java/com/mogo/eagle/core/function/bindingcar/BindingcarProvider.java @@ -1,6 +1,7 @@ package com.mogo.eagle.core.function.bindingcar; import android.content.Context; +import android.util.Log; import com.alibaba.android.arouter.facade.annotation.Route; import com.mogo.eagle.core.data.config.FunctionBuildConfig; @@ -57,6 +58,7 @@ public class BindingcarProvider implements IMoGoBindingcarProvider { */ @Override public void getBindingcarInfo(String macAddress, String widevineIDWithMd5) { + Log.d("Upgrade", "getBindingcarInfo macAddress = " + macAddress + "--widevineIDWithMd5 = " + widevineIDWithMd5); mAddress = macAddress; mWidevineIDWithMd5 = widevineIDWithMd5; if (getScreenType() == 1) { //司机屏 diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java index 9560a84570..a966242631 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java @@ -84,7 +84,7 @@ public abstract class MainMoGoApplication extends AbsMogoApplication { MoGoHandAdasMsgManager.getInstance(getBaseContext()).getConfig(); } } - },8000); + },7000); UiThreadHandler.postDelayed(new Runnable() { @Override diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/devatools/CallerDevaToolsManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/devatools/CallerDevaToolsManager.kt index 75ef1f977a..2b79774e54 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/devatools/CallerDevaToolsManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/devatools/CallerDevaToolsManager.kt @@ -146,7 +146,9 @@ object CallerDevaToolsManager { */ fun downLoadPackage(downloadKey: String, downloadUrl: String) { devaToolsProviderApi?.downLoadPackage(downloadKey, downloadUrl) +// Log.d("Update", "downloadKey = $downloadKey --- downloadUrl = $downloadUrl") // devaToolsProviderApi?.downLoadPackage("IntelligentPilot_v2.9.0.1002_20220725_[fPadLenovoOchBus-launcher-qa]_debug.apk", "https://scm-1255510688.cos.ap-beijing.myqcloud.com/test/com.mogo.launcher.f/2.9.0.1002/IntelligentPilot_v2.9.0.1002_20220725_[fPadLenovoOchBus-launcher-qa]_debug.apk") +// devaToolsProviderApi?.downLoadPackage("IntelligentPilot_v2.10.0_20220921_[fPadLenovoOchBus-launcher-qa]_debug.apk", "http://datacollect-1255510688.cos.ap-beijing.myqcloud.com/eagle_eye_apk/a657ca047711d61fe43c5f54a2e3e2dd/IntelligentPilot_v2.10.0_20220921_%5BfPadLenovoOchBus-launcher-qa%5D_debug.apk?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDvGBZgjPVm09B7sjyTPL7najBQMB7baBb%26q-sign-time%3D1663916659%3B1666508659%26q-key-time%3D1663916659%3B1666508659%26q-header-list%3Dhost%26q-url-param-list%3D%26q-signature%3Dd2f97c31465c161ae3960166564affeca5464fbf&filename=/IntelligentPilot_v2.10.0_20220921_[fPadLenovoOchBus-launcher-qa]_debug.apk") } /** diff --git a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/breakpoint/services/DownloadService.java b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/breakpoint/services/DownloadService.java index b5bd2285f0..544ebc8329 100644 --- a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/breakpoint/services/DownloadService.java +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/breakpoint/services/DownloadService.java @@ -147,6 +147,7 @@ public class DownloadService implements InitThread.InitCallBack, DownloadCallBac @Override public void progressCallBack(String url, int length) { IDownload iDownload = callBacks.get(url); + Log.d(DOWN_LOAD_TAG, "iDownload progressCallBack = " + iDownload); if (iDownload != null) { iDownload.onProgress(url, length); } @@ -155,7 +156,7 @@ public class DownloadService implements InitThread.InitCallBack, DownloadCallBac @Override public void threadDownLoadFinished(String url, ThreadBean threadBean) { IDownload iDownload = callBacks.get(url); - Log.d(DOWN_LOAD_TAG, "iDownload = " + iDownload); + Log.d(DOWN_LOAD_TAG, "iDownload threadDownLoadFinished = " + iDownload); if (iDownload != null) { iDownload.onFinished(url, threadBean); } diff --git a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/breakpoint/thread/DownloadThread.java b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/breakpoint/thread/DownloadThread.java index c8f2b05b6c..c20becc8ee 100644 --- a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/breakpoint/thread/DownloadThread.java +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/breakpoint/thread/DownloadThread.java @@ -1,6 +1,10 @@ package com.mogo.eagle.core.utilcode.breakpoint.thread; +import static com.mogo.eagle.core.utilcode.breakpoint.Config.DOWN_LOAD_TAG; + +import android.util.Log; + import com.mogo.eagle.core.utilcode.breakpoint.Config; import com.mogo.eagle.core.utilcode.breakpoint.bean.FileBean; import com.mogo.eagle.core.utilcode.breakpoint.bean.ThreadBean; @@ -51,6 +55,7 @@ public class DownloadThread extends Thread { raf = new RandomAccessFile(file,"rwd"); raf.seek(start); //开始下载 + Log.d(DOWN_LOAD_TAG, "DownloadThread connection.getResponseCode() = " + connection.getResponseCode() + "---threadBean.getUrl() =" + threadBean.getUrl()); if(connection.getResponseCode() == HttpURLConnection.HTTP_PARTIAL){ inputStream = connection.getInputStream(); byte[] bytes = new byte[1024];