From 435e7b37d511a73a9a6b66592d4c9eab52bea224 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Wed, 18 May 2022 18:55:37 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=E8=B0=83=E8=AF=95=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=A4=9A=E5=B1=8F=E7=9A=84=E5=8F=91=E9=80=81?= =?UTF-8?q?=E6=88=96=E6=8E=A5=E6=94=B6=E6=95=B0=E6=8D=AE=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=88=B3=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../function/autopilot/MoGoAutopilotProvider.kt | 17 +++++++++++++++++ .../function/hmi/ui/setting/DebugSettingView.kt | 13 +++++++++++++ .../src/main/res/layout/view_debug_setting.xml | 11 +++++++++++ .../mogo/eagle/core/data/app/AppConfigInfo.kt | 2 ++ .../api/autopilot/IMoGoAutopilotProvider.kt | 6 ++++++ .../call/autopilot/CallerAutoPilotManager.kt | 8 +++++++- 6 files changed, 56 insertions(+), 1 deletion(-) 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 e60e35f76a..7ebf5cdf0f 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 @@ -67,6 +67,8 @@ class MoGoAutopilotProvider : private var mContext: Context? = null @Volatile private var isFirstDisc = true + @Volatile + private var wrTimeStamp = 0L override val functionName: String get() = TAG @@ -189,6 +191,7 @@ class MoGoAutopilotProvider : AdasManager.getInstance().setOnMultiDeviceListener { bytes -> // 发送数据给乘客端 if (NSDNettyManager.getInstance().isServerStart) { + synWriteTime() NSDNettyManager.getInstance() .sendMsgToAllClients(MogoProtocolMsg(NORMAL_DATA, bytes.size, bytes)) } else { @@ -477,6 +480,7 @@ class MoGoAutopilotProvider : when (it.protocolType) { NORMAL_DATA -> { try { + synWriteTime() AdasManager.getInstance().decoderRaw(it.body) } catch (e: Exception) { e.printStackTrace() @@ -552,4 +556,17 @@ class MoGoAutopilotProvider : private fun invokeNettyConnResult(status: String) { CallerLogger.d("$M_ADAS_IMPL$TAG", status) } + + /** + * 记录最新的司机屏发送数据的时间戳 + * 或乘客屏解析数据的时间戳 + */ + @Synchronized + private fun synWriteTime() { + wrTimeStamp = System.currentTimeMillis() + } + + override fun getTeleTimeStamp(): Long { + return wrTimeStamp + } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt index d9e31975a5..3ffa267298 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt @@ -67,6 +67,7 @@ import com.zhidao.easysocket.utils.L import kotlinx.android.synthetic.main.view_debug_setting.view.* import mogo.telematics.pad.MessagePad import mogo_msg.MogoReportMsg +import java.text.SimpleDateFormat import java.util.* import kotlin.collections.ArrayList import kotlin.math.abs @@ -1336,6 +1337,7 @@ class DebugSettingView @JvmOverloads constructor( else -> { } } + AppConfigInfo.teleTimeStamp = CallerAutoPilotManager.getTeleTimeStamp() /** * 设备绑定关系 @@ -1477,6 +1479,17 @@ class DebugSettingView @JvmOverloads constructor( }" ) + tvTelematicTimeStamp.text = Html.fromHtml( + "${ + when { + AppConfigInfo.isDriver -> { + "司机屏发送数据" + } + else -> "乘客屏接收数据" + } + }的最新时间为:${SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Date(AppConfigInfo.teleTimeStamp))}" + ) + tvLocationEnabled.text = Html.fromHtml( "Pad定位服务开启状态:${ if (DeviceUtils.isLocationEnabled()) { diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml index bad0df9dd3..67f4f1cbcc 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml @@ -486,6 +486,17 @@ android:layout_height="1dp" android:background="#F0F0F0" /> + + + + -------------------应用信息--------------------
" + "应用名称:${appName}
" + diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotProvider.kt index 1e3d65fd13..2737da0c8f 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotProvider.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotProvider.kt @@ -165,4 +165,10 @@ interface IMoGoAutopilotProvider : IMoGoFunctionServerProvider { * @param actionCode 上报字段code */ fun getReportActionDesc(actionCode:String): String + + /** + * 记录最新的司机屏发送数据的时间戳 + * 或乘客屏解析数据的时间戳 + */ + fun getTeleTimeStamp(): Long } \ No newline at end of file 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 9d5e36e582..13e19f76d9 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 @@ -220,5 +220,11 @@ object CallerAutoPilotManager { return providerApi?.getReportActionDesc(actionCode) } - + /** + * 记录最新的司机屏发送数据的时间戳 + * 或乘客屏解析数据的时间戳 + */ + fun getTeleTimeStamp(): Long { + return providerApi?.getTeleTimeStamp() ?: 0L + } } \ No newline at end of file