[Update]调试面板增加多屏的发送或接收数据的时间戳显示
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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 -> "乘客屏接收数据"
|
||||
}
|
||||
}的最新时间为:<font color='red'>${SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Date(AppConfigInfo.teleTimeStamp))}"
|
||||
)
|
||||
|
||||
tvLocationEnabled.text = Html.fromHtml(
|
||||
"Pad定位服务开启状态:${
|
||||
if (DeviceUtils.isLocationEnabled()) {
|
||||
|
||||
@@ -486,6 +486,17 @@
|
||||
android:layout_height="1dp"
|
||||
android:background="#F0F0F0" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTelematicTimeStamp"
|
||||
style="@style/DebugSettingText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#F0F0F0" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLocationEnabled"
|
||||
style="@style/DebugSettingText"
|
||||
|
||||
Reference in New Issue
Block a user