[6.2.4]merge
This commit is contained in:
@@ -407,4 +407,8 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
override fun block(): IMoGoBlockProvider? = block
|
||||
|
||||
override fun usage(): IMoGoCpuUsageProvider? = usage
|
||||
|
||||
override fun setNetworkMode(isDebug: Boolean) {
|
||||
WeakNetworkStrategy.setDebug(isDebug)
|
||||
}
|
||||
}
|
||||
@@ -4,10 +4,10 @@ import android.content.Context
|
||||
import com.mogo.commons.constants.HostConst
|
||||
import com.mogo.commons.constants.SharedPrefsConstants
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig
|
||||
import com.mogo.eagle.core.data.deva.bindingcar.BindingCarInfo
|
||||
import com.mogo.eagle.core.data.deva.bindingcar.BindingCarRequest
|
||||
import com.mogo.eagle.core.data.deva.bindingcar.ModifyBindingcarInfo
|
||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showBindingCarDialog
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showModifyBindingCarDialog
|
||||
@@ -74,8 +74,19 @@ class BindingCarNetWorkManager private constructor() {
|
||||
.subscribe(object : Observer<BindingCarInfo> {
|
||||
override fun onSubscribe(d: Disposable) {}
|
||||
override fun onNext(info: BindingCarInfo) {
|
||||
if (info != null && info.getData() != null) {
|
||||
bindLog(mapOf("bindResult" to true,"carType" to getDefaultId(),"msg" to info))
|
||||
if (info?.getData() != null) {
|
||||
if ((info.code != 0 && info.code != 200)) {
|
||||
bindLog(mapOf("bindResult" to false, "msg" to info.toString()))
|
||||
return
|
||||
}
|
||||
|
||||
bindLog(
|
||||
mapOf(
|
||||
"bindResult" to true,
|
||||
"carType" to getDefaultId(),
|
||||
"msg" to info
|
||||
)
|
||||
)
|
||||
SharedPrefsMgr.getInstance(context).putString(
|
||||
SharedPrefsConstants.CAR_INFO,
|
||||
GsonUtils.toJson(info.getData())
|
||||
@@ -87,15 +98,22 @@ class BindingCarNetWorkManager private constructor() {
|
||||
}
|
||||
updateCarVrIconRes(info.getData().brandId)
|
||||
} else {
|
||||
SharedPrefsMgr.getInstance(context).putString(SharedPrefsConstants.CAR_INFO, "")
|
||||
e(SceneConstant.M_DEVA + TAG, "getBindingCarInfo data = null ---getDefaultId() : ${getDefaultId()} ")
|
||||
SharedPrefsMgr.getInstance(context)
|
||||
.putString(SharedPrefsConstants.CAR_INFO, "")
|
||||
e(
|
||||
SceneConstant.M_DEVA + TAG,
|
||||
"getBindingCarInfo data = null ---getDefaultId() : ${getDefaultId()} "
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onError(e: Throwable) {
|
||||
SharedPrefsMgr.getInstance(context).putString(SharedPrefsConstants.CAR_INFO, "")
|
||||
bindLog(mapOf("bindResult" to false,"msg" to e.toString()))
|
||||
e(SceneConstant.M_DEVA + TAG, "getBindingCarInfo onError e = " + e.toString() + "---e.getMessage = " + e.message + "---getDefaultId() : ${getDefaultId()}")
|
||||
bindLog(mapOf("bindResult" to false, "msg" to e.toString()))
|
||||
e(
|
||||
SceneConstant.M_DEVA + TAG,
|
||||
"getBindingCarInfo onError e = " + e.toString() + "---e.getMessage = " + e.message + "---getDefaultId() : ${getDefaultId()}"
|
||||
)
|
||||
}
|
||||
|
||||
override fun onComplete() {}
|
||||
@@ -131,14 +149,18 @@ class BindingCarNetWorkManager private constructor() {
|
||||
override fun onSubscribe(d: Disposable) {}
|
||||
override fun onNext(info: ModifyBindingcarInfo) {
|
||||
if (info != null) {
|
||||
if ((info.code != 0 && info.code != 200)) {
|
||||
bindLog(mapOf("bindingStatus" to false, "bindMsg" to info.toString()))
|
||||
return
|
||||
}
|
||||
callBack.invoke(info)
|
||||
bindLog(mapOf("bindingStatus" to true,"bindMsg" to info))
|
||||
bindLog(mapOf("bindingStatus" to true, "bindMsg" to info))
|
||||
updateCarVrIconRes(info.data.brandId)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onError(e: Throwable) {
|
||||
bindLog(mapOf("bindingStatus" to false,"bindMsg" to e.toString()))
|
||||
bindLog(mapOf("bindingStatus" to false, "bindMsg" to e.toString()))
|
||||
}
|
||||
|
||||
override fun onComplete() {}
|
||||
@@ -147,7 +169,7 @@ class BindingCarNetWorkManager private constructor() {
|
||||
|
||||
private fun updateCarVrIconRes(brandId: String?) {
|
||||
d(SceneConstant.M_DEVA + TAG, "CarModelChange : ${DebugConfig.isCarModelChange()}")
|
||||
if(!DebugConfig.isCarModelChange()){
|
||||
if (!DebugConfig.isCarModelChange()) {
|
||||
return
|
||||
}
|
||||
if (brandId == null || brandId.isEmpty()) {
|
||||
@@ -188,7 +210,7 @@ class BindingCarNetWorkManager private constructor() {
|
||||
nodeAliasCode = ChainConstant.CHAIN_CODE_BINDING_CAR,
|
||||
paramIndexes = [0]
|
||||
)
|
||||
private fun bindLog(msg:Map<String,Any>){
|
||||
private fun bindLog(msg: Map<String, Any>) {
|
||||
d(SceneConstant.M_DEVA + TAG, "bindLog : $msg")
|
||||
}
|
||||
|
||||
|
||||
@@ -253,14 +253,6 @@ internal class OverViewImpl(ctx: Context) : IFlow<OverViewStatus>(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 工控机连接状态
|
||||
*/
|
||||
override fun onAutopilotIpcConnectStatusChanged(status: Int, reason: String?) {
|
||||
super.onAutopilotIpcConnectStatusChanged(status, reason)
|
||||
}
|
||||
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
// CallerDevaToolsListenerManager.removeListener(TAG)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.zhjt.mogo_core_function_devatools.status.flow.rtk
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
|
||||
@@ -66,7 +65,7 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
|
||||
check?.takeIf { it.isActive }?.cancel()
|
||||
isOldVersion.set(false)
|
||||
val info = status.healthInfoList?.find { "localization".equals(it.name, true) }
|
||||
Log.d(TAG, "info: $info")
|
||||
CallerLogger.d("$M_DEVA$TAG", "info: $info")
|
||||
if (info != null) {
|
||||
healthInfo.set(info)
|
||||
send(RTKStatus(getDesc(), getCode()))
|
||||
@@ -77,7 +76,7 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
|
||||
check?.takeIf { it.isActive }?.cancel()
|
||||
isOldVersion.set(false)
|
||||
val info = statusInf.healthInfoList?.find { "localization".equals(it.name, true) }
|
||||
Log.d(TAG, "info: $info")
|
||||
CallerLogger.d("$M_DEVA$TAG", "info: $info")
|
||||
if (info != null) {
|
||||
healthInfo.set(info)
|
||||
send(RTKStatus(getDesc(), getCode()))
|
||||
|
||||
@@ -74,8 +74,6 @@ class TraceManager : IMoGoCloudListener, IMoGoAutopilotCarConfigListener {
|
||||
FwBuild(true, -1, pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_TRAFFIC_LIGHT)
|
||||
fwBuildMap[ChainConstant.CHAIN_TYPE_ANR_LEAK] =
|
||||
FwBuild(true, -1, pkgName + ChainConstant.CHAIN_LINK_LOG_RECORD_ANR)
|
||||
fwBuildMap[ChainConstant.CHAIN_TYPE_V2X] =
|
||||
FwBuild(true, -1, pkgName + ChainConstant.CHAIN_LINK_LOG_V2X)
|
||||
fwBuildMap[ChainConstant.CHAIN_TYPE_WEAK_NETWORK] =
|
||||
FwBuild(true, -1, pkgName + ChainConstant.CHAIN_LINK_LOG_RECORD_WEAK_NETWORK)
|
||||
fwBuildMap[ChainConstant.CHAIN_TYPE_OCH] =
|
||||
@@ -98,8 +96,6 @@ class TraceManager : IMoGoCloudListener, IMoGoAutopilotCarConfigListener {
|
||||
ChainLogParam(true, "红绿灯Union数据")
|
||||
traceInfoCache[ChainConstant.CHAIN_TYPE_ANR_LEAK] =
|
||||
ChainLogParam(true, "ANR Record")
|
||||
traceInfoCache[ChainConstant.CHAIN_TYPE_V2X] =
|
||||
ChainLogParam(true, "V2X(V2N/V2I)")
|
||||
traceInfoCache[ChainConstant.CHAIN_TYPE_WEAK_NETWORK] =
|
||||
ChainLogParam(true, "WeakNetWork Record")
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ object WeakNetworkStrategy {
|
||||
private const val TAG = "WeakNetworkStrategy"
|
||||
|
||||
// 记录到链路日志中的时间间隔
|
||||
private const val OUTPUT_TIME_INTERVAL = 15000
|
||||
private const val OUTPUT_TIME_INTERVAL = 2500
|
||||
|
||||
private const val WEAK_HTTP_RTT = 1300
|
||||
|
||||
@@ -23,6 +23,8 @@ object WeakNetworkStrategy {
|
||||
|
||||
private var lastOutputTime = 0L
|
||||
|
||||
private var isDebug = false
|
||||
|
||||
private val lock by lazy {
|
||||
ReentrantReadWriteLock()
|
||||
}
|
||||
@@ -53,6 +55,10 @@ object WeakNetworkStrategy {
|
||||
})
|
||||
}
|
||||
|
||||
fun setDebug(isDebug: Boolean) {
|
||||
this.isDebug = isDebug
|
||||
}
|
||||
|
||||
fun stopListen() {
|
||||
setListener(null)
|
||||
}
|
||||
@@ -63,10 +69,13 @@ object WeakNetworkStrategy {
|
||||
try {
|
||||
val currentTime = System.currentTimeMillis()
|
||||
if (currentTime - lastOutputTime > OUTPUT_TIME_INTERVAL) {
|
||||
if (isDebug) {
|
||||
invokeWeakResult("url为:$url, 耗时为:$timeStamp${if (isFail) " 连接失败!" else ""}")
|
||||
}
|
||||
if (timeStamp >= WEAK_HTTP_RTT) {
|
||||
ToastUtils.showShort("当前网络质量差!")
|
||||
} else if (timeStamp in 300 until WEAK_HTTP_RTT) {
|
||||
invokeWeakResult("url为:$url, 耗时为:$timeStamp${if (isFail) " 连接失败!" else ""}")
|
||||
// invokeWeakResult("url为:$url, 耗时为:$timeStamp${if (isFail) " 连接失败!" else ""}")
|
||||
SdtManager.startActiveCheck()
|
||||
}
|
||||
lastOutputTime = currentTime
|
||||
|
||||
Reference in New Issue
Block a user