Merge branch 'dev_robotaxi-d_230809_6.0.0' into 6.0.0merge2master
# Conflicts: # OCH/sweeper/sweeper-cloud/src/main/java/com/mogo/och/sweepercloud/model/SweeperTaskModel.java # libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasChannel.java # libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/OnAdasListener.java
This commit is contained in:
@@ -52,7 +52,7 @@ android {
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation rootProject.ext.dependencies.kotlinstdlibjdk7
|
||||
implementation rootProject.ext.dependencies.kotlinstdlib
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.mogo.eagle.function.biz.v2x.trafficlight.core.MogoTrafficLightManager
|
||||
import com.mogo.eagle.function.biz.v2x.v2n.V2XEventManager
|
||||
import com.mogo.eagle.function.biz.v2x.v2n.V2XPoiLoader.Companion.v2xPoiLoader
|
||||
import com.mogo.eagle.function.biz.v2x.v2n.pnc.*
|
||||
import com.mogo.eagle.function.biz.v2x.v2n.utils.V2XEventAnalyticsManager
|
||||
import com.mogo.eagle.function.biz.v2x.vip.VipCarManager
|
||||
|
||||
@Route(path = MogoServicePaths.PATH_FUNC_BIZ)
|
||||
@@ -53,6 +54,7 @@ class FuncBizProvider : IMoGoFuncBizProvider {
|
||||
|
||||
V2NIdentifyDrawer.init()
|
||||
// RedLightWarningManager.INSTANCE.listenTrafficLight()
|
||||
V2XEventAnalyticsManager.init()
|
||||
}
|
||||
|
||||
override fun feedBackNoticeTraffic(infoId: String, sn: String, accept: Int) {
|
||||
@@ -140,5 +142,6 @@ class FuncBizProvider : IMoGoFuncBizProvider {
|
||||
V2xObuEventManager.release()
|
||||
V2NIdentifyDrawer.unInit()
|
||||
// RedLightWarningManager.INSTANCE.onDestroy()
|
||||
V2XEventAnalyticsManager.onDestroy()
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,6 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener
|
||||
import com.mogo.eagle.core.function.api.hmi.autopilot.IMoGoCheckAutoPilotBtnListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getState
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
@@ -49,8 +48,7 @@ class DispatchAutoPilotManager private constructor() :
|
||||
|
||||
private const val MSG_SOCKET_TYPE = 501000
|
||||
private const val MSG_TYPE_SHOW_DIALOG = 0
|
||||
private const val MSG_TYPE_UPLOAD_AUTOPILOT_STATUS = 1
|
||||
private const val MSG_TYPE_UPLOAD_AUTOPILOT_ROTTING = 2
|
||||
private const val MSG_TYPE_UPLOAD_AUTOPILOT_ROTTING = 1
|
||||
|
||||
val dispatchAutoPilotManager by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
DispatchAutoPilotManager()
|
||||
@@ -72,9 +70,6 @@ class DispatchAutoPilotManager private constructor() :
|
||||
val msgData: DispatchAdasAutoPilotLocReceiverBean =
|
||||
msg.obj as DispatchAdasAutoPilotLocReceiverBean
|
||||
CallerHmiManager.showDispatchDialog(msgData)
|
||||
} else if (msg.what == MSG_TYPE_UPLOAD_AUTOPILOT_STATUS) {
|
||||
dispatchServiceModel.uploadAutopilotStatus(getState(), "")
|
||||
sendEmptyMessageDelayed(MSG_TYPE_UPLOAD_AUTOPILOT_STATUS, 1000L)
|
||||
} else if(msg.what == MSG_TYPE_UPLOAD_AUTOPILOT_ROTTING){
|
||||
val data = msg.obj as MessagePad.GlobalPathResp
|
||||
val list: MutableList<AutopilotRouteInfo.RouteModels> = ArrayList()
|
||||
@@ -99,7 +94,6 @@ class DispatchAutoPilotManager private constructor() :
|
||||
CallerPlanningRottingListenerManager.addListener(TAG, this)
|
||||
// 添加 ADAS状态 监听
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
handler.sendEmptyMessageDelayed(MSG_TYPE_UPLOAD_AUTOPILOT_STATUS, 1000L)
|
||||
}
|
||||
|
||||
fun release() {
|
||||
@@ -127,8 +121,9 @@ class DispatchAutoPilotManager private constructor() :
|
||||
//同步调用路线下载逻辑
|
||||
adasAutoPilotLocReceiverBean?.let {
|
||||
if(it.type == 1){
|
||||
val mAutoPilotLine = AutopilotControlParameters.AutoPilotLine(it.lineId.toLong(),it.trajUrl,it.trajMd5,it.stopUrl,it.stopMd5,it.timestamp,
|
||||
it.vehicleModel,it.trajUrl_dpqp,it.trajMd5_dpqp,it.stopUrl_dpqp,it.stopMd5_dpqp,it.timestamp_dpqp)
|
||||
val mAutoPilotLine = AutopilotControlParameters.AutoPilotLine(it.lineId.toLong(), it.lineName,
|
||||
it.trajUrl,it.trajMd5,it.stopUrl,it.stopMd5,it.timestamp, it.vehicleModel,
|
||||
it.trajUrl_dpqp,it.trajMd5_dpqp,it.stopUrl_dpqp,it.stopMd5_dpqp,it.timestamp_dpqp)
|
||||
CallerAutoPilotControlManager.sendTrajectoryDownloadReq(mAutoPilotLine)
|
||||
CallerLogger.i("$M_BIZ$TAG","调用路线下载逻辑")
|
||||
}
|
||||
@@ -182,7 +177,7 @@ class DispatchAutoPilotManager private constructor() :
|
||||
ToastUtils.showShort("endLocAddress数据为空")
|
||||
return
|
||||
}
|
||||
val currentAutoPilotLine = AutopilotControlParameters.AutoPilotLine(it.lineId.toLong(),it.trajUrl,it.trajMd5,
|
||||
val currentAutoPilotLine = AutopilotControlParameters.AutoPilotLine(it.lineId.toLong(),it.lineName,it.trajUrl,it.trajMd5,
|
||||
it.stopUrl,it.stopMd5,it.timestamp,it.vehicleModel,it.trajUrl_dpqp+"",it.trajMd5_dpqp+"",it.stopUrl_dpqp+"",
|
||||
it.stopMd5_dpqp,it.timestamp_dpqp)
|
||||
currentAutopilot.autoPilotLine = currentAutoPilotLine
|
||||
@@ -224,8 +219,13 @@ class DispatchAutoPilotManager private constructor() :
|
||||
onSuccess = {
|
||||
//取消自动驾驶
|
||||
CallerAutoPilotControlManager.cancelAutoPilot()
|
||||
isDispatch = false
|
||||
ToastUtils.showShort("云调度取消确认成功")
|
||||
CallerLogger.i("$M_BIZ$TAG","stopAffirm 取消自动驾驶")
|
||||
}, onError = {})
|
||||
}, onError = {error ->
|
||||
ToastUtils.showShort("停止调度确认失败${error}")
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import com.mogo.commons.constants.HostConst
|
||||
import com.mogo.commons.context.ContextHolderUtil
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotRouteInfo.RouteModels
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatus
|
||||
import com.mogo.eagle.core.data.biz.dispatch.ReportDispatchResult
|
||||
import com.mogo.eagle.core.data.biz.dispatch.ReportedRoute
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
@@ -38,43 +37,6 @@ class DispatchServiceModel private constructor() {
|
||||
IDispatchAdasApiService::class.java
|
||||
)
|
||||
|
||||
/**
|
||||
* 上报自动驾驶状态
|
||||
*/
|
||||
fun uploadAutopilotStatus(state: Int, reason: String?) {
|
||||
val autopilotStatus = AutopilotStatus()
|
||||
autopilotStatus.action = "autopilotstate"
|
||||
val valuesBean = AutopilotStatus.ValuesBean()
|
||||
valuesBean.state = state
|
||||
valuesBean.reason = reason
|
||||
autopilotStatus.values = valuesBean
|
||||
val sn = MoGoAiCloudClientConfig.getInstance().sn
|
||||
val reportedRoute = ReportedRoute(
|
||||
sn,
|
||||
autopilotStatus.values
|
||||
)
|
||||
val map: MutableMap<String, Any> = HashMap()
|
||||
map["sn"] = sn
|
||||
map["data"] = GsonUtil.jsonFromObject(reportedRoute)
|
||||
mAdasApiService.uploadAutopilotState(map)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(object :
|
||||
SubscribeImpl<BaseData>(RequestOptions.create(ContextHolderUtil.getContext())) {
|
||||
override fun onNext(o: BaseData) {
|
||||
super.onNext(o)
|
||||
}
|
||||
|
||||
override fun onError(e: Throwable) {
|
||||
super.onError(e)
|
||||
}
|
||||
|
||||
override fun onSuccess(o: BaseData) {
|
||||
super.onSuccess(o)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 上报自动驾驶路线
|
||||
*
|
||||
|
||||
@@ -27,13 +27,4 @@ interface IDispatchAdasApiService {
|
||||
@POST("eagle-eye-dns/dataService/autoDriver/receiverDestSiteResult")
|
||||
fun uploadDispatchResult(@FieldMap parameters: MutableMap<String, Any>): Observable<BaseData>
|
||||
|
||||
/**
|
||||
* 上报自动驾驶状态 服务于业务调度
|
||||
*
|
||||
* @param parameters map
|
||||
* @return [BaseData]
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("eagle-eye-dns/dataService/autoDriver/receiveAutopilotState")
|
||||
fun uploadAutopilotState(@FieldMap parameters: MutableMap<String, Any>): Observable<BaseData>
|
||||
}
|
||||
@@ -60,7 +60,7 @@ class CronTaskManager {
|
||||
* 请求路口一定范围内的设备信息(包含:摄像头、灯)
|
||||
*/
|
||||
private fun requestDeviceList() {
|
||||
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()?.let { location ->
|
||||
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02().let { location ->
|
||||
disposable = MoGoRetrofitFactory.getInstance(HostConst.getEagleHost())
|
||||
.create(ICameraListServices::class.java)
|
||||
.getDeviceList(location.longitude, location.latitude, 500)
|
||||
@@ -80,7 +80,7 @@ class CronTaskManager {
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe({
|
||||
cameraList = it
|
||||
// CallerLogger.d("$M_BIZ$TAG", "requestDeviceList返回结果为:$it")
|
||||
// CallerLogger.d("$M_BIZ$TAG", "requestDeviceList返回结果为:$it")
|
||||
}, {
|
||||
it.printStackTrace()
|
||||
CallerLogger.e(
|
||||
@@ -88,8 +88,6 @@ class CronTaskManager {
|
||||
"requestDeviceList:message is:${it.message}, cause is:${it.cause}"
|
||||
)
|
||||
})
|
||||
}?: run {
|
||||
CallerLogger.e("$M_BIZ$TAG", "CurrentLocation is null!")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.eagle.function.biz.v2x.obu
|
||||
|
||||
import android.content.Context
|
||||
import com.mogo.eagle.core.data.enums.CommunicationType
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
@@ -10,6 +11,7 @@ import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuSaveMessageListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.function.biz.v2x.v2n.utils.V2XEventAnalyticsManager
|
||||
|
||||
/**
|
||||
* 处理obu分发出来,在消息盒子展示的消息
|
||||
@@ -36,8 +38,10 @@ object V2xObuEventManager : IMoGoObuSaveMessageListener {
|
||||
* @param content 事件内容
|
||||
* @param tts 事件语音播报 //30秒内同一个事件只出现一次 TODO 临时添加,后面宏宇统一在数据中心处理
|
||||
*/
|
||||
override fun onMoGoObuSaveMessage(type: String, content: String, tts: String, sourceType: DataSourceType) {
|
||||
override fun onMoGoObuSaveMessage(type: String, content: String, tts: String, sourceType: DataSourceType,communicationType: CommunicationType) {
|
||||
if (content.isNotEmpty()) {
|
||||
//消息埋点
|
||||
V2XEventAnalyticsManager.receiveV2XEvent(type,content,tts,sourceType,communicationType)
|
||||
if (obuDataMap.containsKey(type)) {
|
||||
val oldTime = obuDataMap[type]
|
||||
oldTime?.let {
|
||||
@@ -56,12 +60,15 @@ object V2xObuEventManager : IMoGoObuSaveMessageListener {
|
||||
V2XMsg(
|
||||
type,
|
||||
content,
|
||||
tts
|
||||
tts,
|
||||
communicationType.name
|
||||
)
|
||||
).apply {
|
||||
this.sourceType = sourceType
|
||||
}
|
||||
)
|
||||
//消息埋点
|
||||
V2XEventAnalyticsManager.triggerV2XEvent(type,content,tts,sourceType,communicationType)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -211,7 +211,8 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
V2XMsg(
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.content,
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.tts
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.tts,
|
||||
""
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -243,7 +244,8 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
V2XMsg(
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
content,
|
||||
tts
|
||||
tts,
|
||||
""
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.eagle.function.biz.v2x.trafficlight.core
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Handler
|
||||
import android.os.HandlerThread
|
||||
import android.os.Looper
|
||||
import com.mogo.eagle.core.data.biz.trafficlight.RoadIDResult
|
||||
import com.mogo.eagle.core.data.biz.trafficlight.TrafficLightControl
|
||||
@@ -13,7 +14,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02Lis
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
||||
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_LOOP_SEARCH_CROSS_ROAD
|
||||
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_LOOP_SEARCH_TRAFFIC_LIGHT
|
||||
@@ -34,11 +34,15 @@ class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
|
||||
|
||||
private var mContext: Context? = null
|
||||
private val trafficLightNetWorkModel = TrafficLightNetWorkModel()
|
||||
@Volatile
|
||||
private var mLocation: MogoLocation? = null
|
||||
@Volatile
|
||||
private var roadIDResult: RoadIDResult? = null
|
||||
@Volatile
|
||||
private var trafficLightResult: TrafficLightResult? = null
|
||||
|
||||
private var inRange: Boolean = false
|
||||
@Volatile
|
||||
private var firstLoopCrossRoad: Boolean = true //开启循环请求路口
|
||||
|
||||
private var mThreadHandler: Handler? = null
|
||||
@@ -54,10 +58,8 @@ class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
|
||||
}
|
||||
firstLoopCrossRoad = false
|
||||
mLocation?.let { it ->
|
||||
val tileId = CallerMapUIServiceManager.getMapUIController()
|
||||
?.getTileId(it.longitude, it.latitude) ?: 0
|
||||
trafficLightNetWorkModel.requestRoadID(
|
||||
tileId, it.latitude, it.longitude, it.heading,
|
||||
it.latitude, it.longitude, it.heading,
|
||||
{
|
||||
mThreadHandler?.sendEmptyMessage(MSG_WHAT_STOP_SEARCH_CROSS_ROAD)
|
||||
roadIDResult = it
|
||||
|
||||
@@ -36,7 +36,7 @@ class TrafficLightThreadHandler : Handler {
|
||||
when (msg.what) {
|
||||
MSG_WHAT_LOOP_SEARCH_CROSS_ROAD -> {
|
||||
//handler轮询,后续从地图处获取到车道线(前提获取车道线没有异步调用),来优化轮询时长
|
||||
sendEmptyMessageDelayed(MSG_WHAT_LOOP_SEARCH_CROSS_ROAD,300L)
|
||||
sendEmptyMessageDelayed(MSG_WHAT_LOOP_SEARCH_CROSS_ROAD,700L)
|
||||
loopSearchCrossRoad?.invoke()
|
||||
}
|
||||
MSG_WHAT_STOP_SEARCH_CROSS_ROAD -> {
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.commons.constants.HostConst
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.eagle.core.data.biz.trafficlight.*
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.mogo.eagle.core.network.apiCall
|
||||
import com.mogo.eagle.core.network.cancel
|
||||
@@ -18,7 +19,6 @@ class TrafficLightNetWorkModel {
|
||||
}
|
||||
|
||||
fun requestRoadID(
|
||||
tileID: Long,
|
||||
lat: Double,
|
||||
lon: Double,
|
||||
bearing: Double,
|
||||
@@ -26,14 +26,14 @@ class TrafficLightNetWorkModel {
|
||||
onError: ((String) -> Unit),
|
||||
) {
|
||||
request<BaseResponse<RoadIDResult>>("requestRoadID") {
|
||||
val map = hashMapOf<String, String>()
|
||||
start {
|
||||
val roadIDRequestData = RoadIDRequestData(tileID, lat, lon, bearing)
|
||||
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
|
||||
map["data"] = GsonUtils.toJson(roadIDRequestData)
|
||||
}
|
||||
loader {
|
||||
apiCall {
|
||||
val tileId = CallerMapUIServiceManager.getMapUIController()
|
||||
?.getTileId(lon, lat) ?: 0
|
||||
val map = hashMapOf<String, String>()
|
||||
val roadIDRequestData = RoadIDRequestData(tileId, lat, lon, bearing)
|
||||
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
|
||||
map["data"] = GsonUtils.toJson(roadIDRequestData)
|
||||
getNetWorkApi().getFrontRoadID(map)
|
||||
}
|
||||
}
|
||||
@@ -74,12 +74,12 @@ class TrafficLightNetWorkModel {
|
||||
if (roadId == null) {
|
||||
return@start
|
||||
}
|
||||
val trafficLightRequestData = TrafficLightRequestData(lat, lon, bearing, roadId)
|
||||
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
|
||||
map["data"] = GsonUtils.toJson(trafficLightRequestData)
|
||||
}
|
||||
loader {
|
||||
apiCall {
|
||||
val trafficLightRequestData = TrafficLightRequestData(lat, lon, bearing, roadId!!)
|
||||
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
|
||||
map["data"] = GsonUtils.toJson(trafficLightRequestData)
|
||||
getNetWorkApi().getTrafficLight(map)
|
||||
}
|
||||
}
|
||||
@@ -112,14 +112,12 @@ class TrafficLightNetWorkModel {
|
||||
) {
|
||||
request<BaseResponse<TrafficLightControl>> {
|
||||
val map = hashMapOf<String, String>()
|
||||
start {
|
||||
val trafficLightRequestData =
|
||||
ChangeLightRequestData(lightId, crossingNo, heading, controlTime)
|
||||
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
|
||||
map["data"] = GsonUtils.toJson(trafficLightRequestData)
|
||||
}
|
||||
loader {
|
||||
apiCall {
|
||||
val trafficLightRequestData =
|
||||
ChangeLightRequestData(lightId, crossingNo, heading, controlTime)
|
||||
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
|
||||
map["data"] = GsonUtils.toJson(trafficLightRequestData)
|
||||
getNetWorkApi().changeLight(map)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,6 +113,8 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback,
|
||||
v2XMessageEntity.content = v2XRoadEventEntity
|
||||
V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity)
|
||||
V2XBizTrace.onAck("巡航处理 handlerMessage v2XMessageEntity", " $v2XMessageEntity")
|
||||
}else{
|
||||
V2XBizTrace.onAck("事件未触发", mapOf("roadEvent" to v2XRoadEventEntity, "distance" to distance))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -297,8 +299,11 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback,
|
||||
|
||||
private fun sendToMsgBox(count: Int) {
|
||||
val msgBoxBean =
|
||||
MsgBoxBean(MsgBoxType.V2X, V2XMsg("", "查询到当前全程共${count}个事件", ""))
|
||||
MsgBoxBean(MsgBoxType.V2X, V2XMsg("", "查询到当前全程共${count}个事件", "",CommunicationType.V2N.name))
|
||||
msgBoxBean.sourceType = DataSourceType.SUMMARY
|
||||
CallerMsgBoxManager.saveMsgBox(msgBoxBean)
|
||||
//消息埋点
|
||||
V2XEventAnalyticsManager.triggerV2XEvent("summary","查询到当前全程共${count}个事件",
|
||||
"",DataSourceType.AICLOUD,CommunicationType.V2N)
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.mogo.eagle.function.biz.v2x.v2n
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.enums.CommunicationType
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
@@ -16,6 +17,7 @@ import com.mogo.eagle.function.biz.v2x.v2n.network.V2XRefreshModel
|
||||
import com.mogo.eagle.function.biz.v2x.v2n.network.callback.IV2XCallback
|
||||
import com.mogo.eagle.function.biz.v2x.v2n.network.callback.IV2XRefreshCallback
|
||||
import com.mogo.eagle.function.biz.v2x.v2n.utils.DistanceUtils
|
||||
import com.mogo.eagle.function.biz.v2x.v2n.utils.V2XEventAnalyticsManager
|
||||
import java.util.concurrent.CopyOnWriteArrayList
|
||||
import java.util.concurrent.TimeUnit
|
||||
import java.util.concurrent.atomic.AtomicReference
|
||||
@@ -156,9 +158,12 @@ class V2XPoiLoader private constructor() {
|
||||
val size = it?.size ?: 0
|
||||
if (size > 0) {
|
||||
val msgBoxBean =
|
||||
MsgBoxBean(MsgBoxType.V2X, V2XMsg("", "查询到当前全程共${size}个事件", ""))
|
||||
MsgBoxBean(MsgBoxType.V2X, V2XMsg("", "查询到当前全程共${size}个事件", "",CommunicationType.V2N.name))
|
||||
msgBoxBean.sourceType = DataSourceType.SUMMARY
|
||||
CallerMsgBoxManager.saveMsgBox(msgBoxBean)
|
||||
//消息埋点
|
||||
V2XEventAnalyticsManager.triggerV2XEvent("summary","查询到当前全程共${size}个事件",
|
||||
"",DataSourceType.AICLOUD,CommunicationType.V2N)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.os.*
|
||||
import androidx.core.util.*
|
||||
import com.mogo.eagle.core.data.config.*
|
||||
import com.mogo.eagle.core.data.enums.*
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum.ALERT_WARNING_TOP
|
||||
import com.mogo.eagle.core.data.map.entity.*
|
||||
import com.mogo.eagle.core.data.msgbox.*
|
||||
@@ -21,6 +22,7 @@ import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.mogo.eagle.function.biz.v2x.V2XBizTrace
|
||||
import com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.airoad.*
|
||||
import com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.airoad.AiRoadMarker.Marker
|
||||
import com.mogo.eagle.function.biz.v2x.v2n.utils.V2XEventAnalyticsManager
|
||||
import mogo.telematics.pad.MessagePad.Header
|
||||
import mogo.telematics.pad.MessagePad.TrackedObject
|
||||
import mogo.v2x.MogoV2X
|
||||
@@ -77,11 +79,11 @@ internal object V2NIdentifyDrawer {
|
||||
val alertContent = getAlertContent(poiType, distance.toDouble())
|
||||
val ttsContent = getTtsContent(poiType, distance.toDouble())
|
||||
V2XBizTrace.onAck("V2NIdentifyDrawer","绘制poi事件:$poiType")
|
||||
saveMsgBox(MsgBoxBean(V2X, V2XMsg(poiType, alertContent, ttsContent)))
|
||||
saveMsgBox(MsgBoxBean(V2X, V2XMsg(poiType, alertContent, ttsContent,CommunicationType.V2N.name)))
|
||||
CallerHmiManager.warningV2X(poiType, alertContent, ttsContent, object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {
|
||||
super.onShow()
|
||||
CallerVisualAngleManager.changeAngle(RoadEvent)
|
||||
CallerVisualAngleManager.changeAngle(RoadEvent(itx.longitude, itx.latitude, itx.angle))
|
||||
}
|
||||
|
||||
override fun onDismiss() {
|
||||
@@ -89,6 +91,9 @@ internal object V2NIdentifyDrawer {
|
||||
CallerVisualAngleManager.changeAngle(Default())
|
||||
}
|
||||
}, ALERT_WARNING_TOP, 10000, false)
|
||||
//消息埋点
|
||||
V2XEventAnalyticsManager.triggerV2XEvent(poiType, alertContent, ttsContent,
|
||||
DataSourceType.AICLOUD,CommunicationType.V2N)
|
||||
}
|
||||
}.receive()
|
||||
}
|
||||
@@ -132,11 +137,11 @@ internal object V2NIdentifyDrawer {
|
||||
val distance = CoordinateUtils.calculateLineDistance(lon, lat, car.longitude, car.latitude)
|
||||
val alertContent = getAlertContent(poiType, distance.toDouble())
|
||||
val ttsContent = getTtsContent(poiType, distance.toDouble())
|
||||
saveMsgBox(MsgBoxBean(V2X, V2XMsg(poiType, alertContent, ttsContent)))
|
||||
saveMsgBox(MsgBoxBean(V2X, V2XMsg(poiType, alertContent, ttsContent,CommunicationType.V2N.name)))
|
||||
CallerHmiManager.warningV2X(poiType, alertContent, ttsContent, object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {
|
||||
super.onShow()
|
||||
CallerVisualAngleManager.changeAngle(RoadEvent)
|
||||
CallerVisualAngleManager.changeAngle(RoadEvent(lon, lat, car.heading))
|
||||
}
|
||||
|
||||
override fun onDismiss() {
|
||||
@@ -144,6 +149,9 @@ internal object V2NIdentifyDrawer {
|
||||
CallerVisualAngleManager.changeAngle(Default())
|
||||
}
|
||||
}, ALERT_WARNING_TOP, 10000, false)
|
||||
//消息埋点
|
||||
V2XEventAnalyticsManager.triggerV2XEvent(poiType, alertContent, ttsContent,
|
||||
DataSourceType.AICLOUD,CommunicationType.V2N)
|
||||
}
|
||||
}.receive()
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class V2XScenarioManager implements IV2XScenarioManager {
|
||||
|
||||
@Override
|
||||
public void handlerMessage(V2XMessageEntity v2XMessageEntity) {
|
||||
CallerLogger.INSTANCE.d(M_V2X + TAG, "处理V2X场景:" + (v2XMessageEntity == null ? "null" : v2XMessageEntity.toString()));
|
||||
CallerLogger.d(M_V2X + TAG, "处理V2X场景:" + (v2XMessageEntity == null ? "null" : v2XMessageEntity.toString()));
|
||||
try {
|
||||
synchronized (V2XScenarioManager.class) {
|
||||
// 展示
|
||||
@@ -72,7 +72,7 @@ public class V2XScenarioManager implements IV2XScenarioManager {
|
||||
|
||||
default:
|
||||
mV2XScenario = null;
|
||||
CallerLogger.INSTANCE.e(M_V2X + TAG, "当前V2X消息类型未定义:" + v2XMessageEntity);
|
||||
CallerLogger.e(M_V2X + TAG, "当前V2X消息类型未定义:" + v2XMessageEntity);
|
||||
return;
|
||||
}
|
||||
// 展示最新的消息
|
||||
|
||||
@@ -62,7 +62,7 @@ public class V2XRoadEventMarker implements IV2XMarker<V2XRoadEventEntity> {
|
||||
String id = entity.getLocation().getLon() + "_" + entity.getLocation().getLat();
|
||||
MarkerRemoveManager.INSTANCE.addMarker(new MarkerWrapper(id, entity.getLocation().getLon(), entity.getLocation().getLat(), 0, markers, null, null));
|
||||
} else {
|
||||
CallerLogger.INSTANCE.d(M_V2X + "RWJ", "V2XRoadEventMarker:" + entity.getPoiType() + "--- return empty marker");
|
||||
CallerLogger.d(M_V2X + "RWJ", "V2XRoadEventMarker:" + entity.getPoiType() + "--- return empty marker");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.road;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.data.enums.CommunicationType;
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType;
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew;
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum;
|
||||
import com.mogo.eagle.core.data.map.entity.MarkerExploreWay;
|
||||
@@ -23,6 +25,7 @@ import com.mogo.eagle.function.biz.v2x.v2n.scenario.view.IV2XMarker;
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.function.biz.v2x.v2n.utils.V2XEventAnalyticsManager;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -45,7 +48,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
|
||||
@Override
|
||||
public void init(V2XMessageEntity<V2XRoadEventEntity> v2XMessageEntity) {
|
||||
try {
|
||||
V2XBizTrace.Companion.onAck("v2XMessageEntity",GsonUtil.jsonFromObject(v2XMessageEntity));
|
||||
V2XBizTrace.Companion.onAck("v2XMessageEntity",v2XMessageEntity);
|
||||
V2XRoadEventEntity v2XRoadEventEntity = v2XMessageEntity.getContent();
|
||||
if (v2XRoadEventEntity != null) {
|
||||
if (!isSameScenario(v2XMessageEntity)) {
|
||||
@@ -125,12 +128,14 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
|
||||
MsgBoxType.V2X,
|
||||
new V2XMsg(poiType,
|
||||
alarmText,
|
||||
ttsText)
|
||||
ttsText,CommunicationType.V2N.name())
|
||||
)
|
||||
);
|
||||
CallerHmiManager.INSTANCE.warningV2X(poiType, alarmText,
|
||||
ttsText, this,WarningDirectionEnum.ALERT_WARNING_TOP,
|
||||
TimeUnit.SECONDS.toMillis(5), false);
|
||||
//消息埋点
|
||||
V2XEventAnalyticsManager.INSTANCE.triggerV2XEvent(poiType,alarmText,ttsText, DataSourceType.AICLOUD, CommunicationType.V2N);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,13 +158,16 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
|
||||
|
||||
@Override
|
||||
public void onShow() {
|
||||
if (isNeedChangeAngle()) {
|
||||
CallerVisualAngleManager.INSTANCE.changeAngle(RoadEvent.INSTANCE);
|
||||
}
|
||||
V2XMessageEntity<V2XRoadEventEntity> entity = getV2XMessageEntity();
|
||||
if (entity != null) {
|
||||
V2XRoadEventEntity content = entity.getContent();
|
||||
if (content != null) {
|
||||
if (isNeedChangeAngle()) {
|
||||
MarkerLocation location = content.getLocation();
|
||||
if (location != null) {
|
||||
CallerVisualAngleManager.INSTANCE.changeAngle(new RoadEvent(content.getLocation().getLon(), content.getLocation().getLat(), content.getLocation().getAngle(), false));
|
||||
}
|
||||
}
|
||||
if (entity.isNeedAddLine() && !EventTypeEnumNew.TYPE_SOCKET_ROAD_CONGESTION.getPoiType().equals(content.getPoiType())) {
|
||||
drawPOI();
|
||||
}
|
||||
|
||||
@@ -8,6 +8,9 @@ import android.text.SpannableStringBuilder;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.util.Log;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.eagle.core.data.enums.CommunicationType;
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType;
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew;
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
@@ -23,6 +26,8 @@ import com.mogo.eagle.function.biz.v2x.v2n.scenario.impl.AbsV2XScenario;
|
||||
import com.mogo.eagle.function.biz.v2x.v2n.scenario.view.IV2XMarker;
|
||||
import com.mogo.eagle.core.data.v2x.V2XWarningTarget;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.function.biz.v2x.v2n.utils.V2XEventAnalyticsManager;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Locale;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -45,7 +50,7 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMoGoChas
|
||||
|
||||
@Override
|
||||
public void init(@Nullable V2XMessageEntity v2XMessageEntity) {
|
||||
CallerLogger.INSTANCE.d(M_V2X + TAG, "----- init -----:\n" + (v2XMessageEntity == null ? "null" : v2XMessageEntity.toString()));
|
||||
CallerLogger.d(M_V2X + TAG, "----- init -----:\n" + (v2XMessageEntity == null ? "null" : v2XMessageEntity.toString()));
|
||||
try {
|
||||
setV2XMessageEntity(v2XMessageEntity);
|
||||
if (v2XMessageEntity != null && v2XMessageEntity.getContent() instanceof V2XWarningTarget) {
|
||||
@@ -59,9 +64,9 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMoGoChas
|
||||
|
||||
@Override
|
||||
public void show() {
|
||||
CallerLogger.INSTANCE.d(M_V2X + TAG, "----- show --- 1 --:\n" + (mMarkerEntity == null ? "null" : mMarkerEntity.toString()));
|
||||
CallerLogger.d(M_V2X + TAG, "----- show --- 1 --:\n" + (mMarkerEntity == null ? "null" : mMarkerEntity.toString()));
|
||||
if (mMarkerEntity != null) {
|
||||
CallerLogger.INSTANCE.d(M_V2X + TAG, "----- show --- 2 --:\n" + mMarkerEntity);
|
||||
CallerLogger.d(M_V2X + TAG, "----- show --- 2 --:\n" + mMarkerEntity);
|
||||
String v2xType = getV2XTypeForFrontWarning(mMarkerEntity);
|
||||
V2XMessageEntity entity = getV2XMessageEntity();
|
||||
if (!v2xType.equals("0")) {
|
||||
@@ -75,13 +80,16 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMoGoChas
|
||||
MsgBoxType.V2X,
|
||||
new V2XMsg(v2xType + "",
|
||||
getAlertContentForFrontWarning(mMarkerEntity).toString(),
|
||||
mMarkerEntity.getTts())
|
||||
mMarkerEntity.getTts(),CommunicationType.V2N.name())
|
||||
)
|
||||
);
|
||||
CallerHmiManager.INSTANCE.warningV2X(v2xType + "",
|
||||
getAlertContentForFrontWarning(mMarkerEntity), mMarkerEntity.getTts(),
|
||||
this,getDirection(),
|
||||
TimeUnit.SECONDS.toMillis(5), false);
|
||||
//消息埋点
|
||||
V2XEventAnalyticsManager.INSTANCE.triggerV2XEvent(v2xType,getAlertContentForFrontWarning(mMarkerEntity).toString(),
|
||||
mMarkerEntity.getTts(), DataSourceType.AICLOUD, CommunicationType.V2N);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -118,13 +126,13 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMoGoChas
|
||||
IV2XMarker marker = getV2XMarker();
|
||||
if (marker != null && mMarkerEntity != null) {
|
||||
marker.drawPOI(mMarkerEntity);
|
||||
CallerLogger.INSTANCE.d(M_V2X + TAG, "drawPOI");
|
||||
CallerLogger.d(M_V2X + TAG, "drawPOI");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearPOI() {
|
||||
CallerLogger.INSTANCE.d(M_V2X + TAG, "----- clearPOI -----");
|
||||
CallerLogger.d(M_V2X + TAG, "----- clearPOI -----");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -59,12 +59,12 @@
|
||||
// @Override
|
||||
// public void drawPOI(Object entity) {
|
||||
// try {
|
||||
// CallerLogger.INSTANCE.d(M_V2X + TAG, "===drawPOI");
|
||||
// CallerLogger.d(M_V2X + TAG, "===drawPOI");
|
||||
// mCloundWarningInfo = (V2XWarningTarget) entity;
|
||||
// drawLineWithEntity();
|
||||
//
|
||||
// } catch (Exception e) {
|
||||
// CallerLogger.INSTANCE.d(M_V2X + TAG, e.toString());
|
||||
// CallerLogger.d(M_V2X + TAG, e.toString());
|
||||
// }
|
||||
//
|
||||
// }
|
||||
@@ -115,14 +115,14 @@
|
||||
// //衡阳交付-取消划线需求,只渲染识别物红色模型移动过程
|
||||
// //handleStopLine();
|
||||
// }, 0);
|
||||
// CallerLogger.INSTANCE.d(M_V2X + TAG, "显示时间为++" + showTime + "识别物类型:" +
|
||||
// CallerLogger.d(M_V2X + TAG, "显示时间为++" + showTime + "识别物类型:" +
|
||||
// String.valueOf(mCloundWarningInfo.getType()));
|
||||
//
|
||||
// } else { //无停止线
|
||||
// CallerLogger.INSTANCE.d(M_V2X + TAG, "无停止线");
|
||||
// CallerLogger.d(M_V2X + TAG, "无停止线");
|
||||
// WorkThreadHandler.getInstance().postDelayed(() -> {
|
||||
// /* 衡阳交付-取消划线需求,只渲染识别物红色模型移动过程
|
||||
// CallerLogger.INSTANCE.d(M_V2X + TAG, "无停止线" + mCloundWarningInfo.toString());
|
||||
// CallerLogger.d(M_V2X + TAG, "无停止线" + mCloundWarningInfo.toString());
|
||||
// //绘制识别物与交汇点连线,并且更新连线数据
|
||||
// drawOtherObjectLine(mCloundWarningInfo);
|
||||
// //二轮车和行人的渲染和移动
|
||||
@@ -130,7 +130,7 @@
|
||||
// if (carLocation.lat != 0 && carLocation.lon != 0) {
|
||||
// drawSelfCarLine(carLocation.lon, carLocation.lat, bearing);
|
||||
// } else {
|
||||
// CallerLogger.INSTANCE.d(M_V2X + TAG, "数据为空carLocation == null");
|
||||
// CallerLogger.d(M_V2X + TAG, "数据为空carLocation == null");
|
||||
// }
|
||||
// */
|
||||
// Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerService()).renderWarningMoveMarker(mCloundWarningInfo.getLon()
|
||||
@@ -153,7 +153,7 @@
|
||||
// MogoLatLng startLatLng = new MogoLatLng(carLocation.lat, carLocation.lon);
|
||||
// MogoLatLng endLatLng = new MogoLatLng(middleLocationInStopLine.lat, middleLocationInStopLine.lon);
|
||||
// double angle = Trigonometric.getAngle(startLatLng.lon, startLatLng.lat, endLatLng.lon, endLatLng.lat);
|
||||
// CallerLogger.INSTANCE.d(M_V2X + TAG, "angle==" + String.valueOf(angle));
|
||||
// CallerLogger.d(M_V2X + TAG, "angle==" + String.valueOf(angle));
|
||||
// return angle;
|
||||
// }
|
||||
//
|
||||
@@ -166,14 +166,14 @@
|
||||
// startLatLng, MogoLatLng mogoLatLng) {
|
||||
// if (info != null) {
|
||||
// double angle = Trigonometric.getAngle(startLatLng.lon, startLatLng.lat, mogoLatLng.lon, mogoLatLng.lat);
|
||||
// CallerLogger.INSTANCE.d(M_V2X + TAG, "angle==drawRedWarningLineFrontOfStopLine:" + String.valueOf(angle));
|
||||
// CallerLogger.d(M_V2X + TAG, "angle==drawRedWarningLineFrontOfStopLine:" + String.valueOf(angle));
|
||||
// IMoGoStopPolylineManager stopPolyLineMnager = BridgeApi.INSTANCE.v2xStopPolyline();
|
||||
// if (stopPolyLineMnager != null) {
|
||||
// IMogoPolyline polyLine = stopPolyLineMnager.getMogoStopPolyline();
|
||||
// MogoLatLng endLatlng = new MogoLatLng(mogoLatLng.lat, mogoLatLng.lon);
|
||||
// MogoLatLng addMiddleLoc = Trigonometric.getNewLocation(startLatLng.lon, startLatLng.lat, 25, angle);
|
||||
// if (polyLine != null) {
|
||||
// CallerLogger.INSTANCE.d(M_V2X + TAG, "drawStopLine polyLine != null");
|
||||
// CallerLogger.d(M_V2X + TAG, "drawStopLine polyLine != null");
|
||||
// polyLine.setPoints(Arrays.asList(startLatLng, addMiddleLoc, endLatlng));
|
||||
// polyLine.setTransparency(0.5f);
|
||||
// } else {
|
||||
@@ -184,11 +184,11 @@
|
||||
// locations.add(endLatlng);
|
||||
// lineInfo.setLocations(locations);
|
||||
// lineInfo.setHeading(info.getHeading());
|
||||
// CallerLogger.INSTANCE.d(TAG, "drawStopLine width = " + info.getRoadwidth());
|
||||
// CallerLogger.d(TAG, "drawStopLine width = " + info.getRoadwidth());
|
||||
// lineInfo.setWidth(info.getRoadwidth() * 14 + 5);
|
||||
// stopPolyLineMnager.drawStopPolyline(BridgeApi.INSTANCE.context(), lineInfo);
|
||||
// }
|
||||
// CallerLogger.INSTANCE.d(M_V2X + TAG, "停止线前方50m区域的三个坐标点是:" + startLatLng.lon + "," + startLatLng.lat +
|
||||
// CallerLogger.d(M_V2X + TAG, "停止线前方50m区域的三个坐标点是:" + startLatLng.lon + "," + startLatLng.lat +
|
||||
// "中间点坐标:" + addMiddleLoc.lon + "," + addMiddleLoc.lat
|
||||
// + "终点" + endLatlng.lon + "," + endLatlng.lat);
|
||||
// }
|
||||
@@ -199,7 +199,7 @@
|
||||
//
|
||||
// public void clearAllLine() {
|
||||
// UiThreadHandler.postDelayed(() -> {
|
||||
// CallerLogger.INSTANCE.d(M_V2X + TAG, "清除所有预警线的时间是:" + String.valueOf(showTime));
|
||||
// CallerLogger.d(M_V2X + TAG, "清除所有预警线的时间是:" + String.valueOf(showTime));
|
||||
// //清除识别物到碰撞点预警线
|
||||
// IMoGoPersonWarnPolylineManager personStopPolyLineManager = BridgeApi.INSTANCE.v2xPersonWarnPolyline();
|
||||
// if (personStopPolyLineManager != null) {
|
||||
@@ -251,10 +251,10 @@
|
||||
// }
|
||||
// fillPoints.add(y);
|
||||
// } else {
|
||||
// CallerLogger.INSTANCE.d(M_V2X + TAG, "停止线数据不存在");
|
||||
// CallerLogger.d(M_V2X + TAG, "停止线数据不存在");
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// CallerLogger.INSTANCE.e(M_V2X + TAG, "exception : " + e);
|
||||
// CallerLogger.e(M_V2X + TAG, "exception : " + e);
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
@@ -294,7 +294,7 @@
|
||||
// * */
|
||||
// private MogoLatLng getMiddleLocationInStopLine() {
|
||||
// if (carLocation.lat == 0 || carLocation.lon == 0) {
|
||||
// CallerLogger.INSTANCE.d(M_V2X + TAG, "获取不到车的位置");
|
||||
// CallerLogger.d(M_V2X + TAG, "获取不到车的位置");
|
||||
// }
|
||||
// MogoLatLng newLocation = new MogoLatLng(0, 0);
|
||||
// if (mCloundWarningInfo != null && mCloundWarningInfo.getStopLines() != null && mCloundWarningInfo.getStopLines().size() > 1) {
|
||||
@@ -304,7 +304,7 @@
|
||||
// double angle = Trigonometric.getAngle(x.getLat(), x.getLat(), y.getLon(), y.getLat());
|
||||
// newLocation = Trigonometric.getNewLocation(x.getLon(), x.getLat(), distance * 0.5, angle);
|
||||
// } else {
|
||||
// CallerLogger.INSTANCE.d(M_V2X + TAG, "停止线返回坐标点数量不正确" + mCloundWarningInfo.getStopLines().size());
|
||||
// CallerLogger.d(M_V2X + TAG, "停止线返回坐标点数量不正确" + mCloundWarningInfo.getStopLines().size());
|
||||
// }
|
||||
// return newLocation;
|
||||
// }
|
||||
@@ -316,7 +316,7 @@
|
||||
// * lat 自车纬度
|
||||
// */
|
||||
// public void drawSelfCarLine(double lon, double lat, float bearing) {
|
||||
// CallerLogger.INSTANCE.d(M_V2X + TAG, "drawSelfCarLine");
|
||||
// CallerLogger.d(M_V2X + TAG, "drawSelfCarLine");
|
||||
// if (!isSelfLineClear) {
|
||||
// if (mCloundWarningInfo != null) {
|
||||
// IMoGoWarnPolylineManager warnPolyLineManager = BridgeApi.INSTANCE.v2xWarnPolyline();
|
||||
@@ -342,7 +342,7 @@
|
||||
// //扩展点为了渐变色添加
|
||||
// addMiddleLoc = Trigonometric.getNewLocation(startLatlng.getLon(), startLatlng.getLat(), distance / 2,
|
||||
// Trigonometric.getAngle(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat));
|
||||
// CallerLogger.INSTANCE.d(M_V2X + TAG, "angle==扩展点为了渐变色添加:" +
|
||||
// CallerLogger.d(M_V2X + TAG, "angle==扩展点为了渐变色添加:" +
|
||||
// String.valueOf(Trigonometric.getAngle(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat)));
|
||||
// if (mogoPolyline != null) {
|
||||
// mogoPolyline.setPoints(Arrays.asList(startLatlng, addMiddleLoc, endLatlng));
|
||||
@@ -360,9 +360,9 @@
|
||||
// info.setHasStopLines(mCloundWarningInfo.getStopLines().size() > 0);
|
||||
// }
|
||||
// warnPolyLineManager.drawWarnPolyline(BridgeApi.INSTANCE.context(), info);
|
||||
// CallerLogger.INSTANCE.d(M_V2X + TAG, "自车前方第一条线" + "起点:" + startLatlng + "中间点:" + addMiddleLoc + "终点:" + endLatlng);
|
||||
// CallerLogger.d(M_V2X + TAG, "自车前方第一条线" + "起点:" + startLatlng + "中间点:" + addMiddleLoc + "终点:" + endLatlng);
|
||||
// }
|
||||
// CallerLogger.INSTANCE.d(M_V2X + TAG, "自车为起点绘制 自车;" + startLatlng.lon + "," + startLatlng.lat +
|
||||
// CallerLogger.d(M_V2X + TAG, "自车为起点绘制 自车;" + startLatlng.lon + "," + startLatlng.lat +
|
||||
// "中间扩展点" + addMiddleLoc.lon + "," + addMiddleLoc.lat + "终点:" + endLatlng.lon + "," + endLatlng.lat);
|
||||
// } else {
|
||||
// clearAllLine();
|
||||
@@ -375,7 +375,7 @@
|
||||
// */
|
||||
// private void drawOtherObjectLine(V2XWarningTarget info) {
|
||||
// if (info != null) {
|
||||
// CallerLogger.INSTANCE.d(M_V2X + TAG, "info != null");
|
||||
// CallerLogger.d(M_V2X + TAG, "info != null");
|
||||
// IMoGoPersonWarnPolylineManager personWarnPolylineManager = BridgeApi.INSTANCE.v2xPersonWarnPolyline();
|
||||
// if (personWarnPolylineManager == null) {
|
||||
// return;
|
||||
@@ -387,7 +387,7 @@
|
||||
// MogoLatLng addMiddleLoc = Trigonometric.getNewLocation(startLatlng.getLon(), startLatlng.getLat(), distance / 2,
|
||||
// Trigonometric.getAngle(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat));//补点
|
||||
// if (polyLine != null) {
|
||||
// CallerLogger.INSTANCE.d(M_V2X + TAG, "目标物与碰撞点连线 != null");
|
||||
// CallerLogger.d(M_V2X + TAG, "目标物与碰撞点连线 != null");
|
||||
// polyLine.setPoints(Arrays.asList(startLatlng, addMiddleLoc, endLatlng));
|
||||
// polyLine.setTransparency(0.5f);
|
||||
// } else {
|
||||
@@ -402,10 +402,10 @@
|
||||
// lineInfo.setHeading(info.getHeading());
|
||||
// lineInfo.setWidth(info.getRoadwidth() * 14 + 5);
|
||||
// personWarnPolylineManager.drawPersonWarnPolyline(BridgeApi.INSTANCE.context(), lineInfo);
|
||||
// CallerLogger.INSTANCE.d(M_V2X + TAG, "目标物与预碰撞点画线点为" + "起点:" + startLatlng + "中间点:" + addMiddleLoc + "终点:" + endLatlng);
|
||||
// CallerLogger.d(M_V2X + TAG, "目标物与预碰撞点画线点为" + "起点:" + startLatlng + "中间点:" + addMiddleLoc + "终点:" + endLatlng);
|
||||
// }
|
||||
// } else {
|
||||
// CallerLogger.INSTANCE.e(M_V2X + TAG, "info == null");
|
||||
// CallerLogger.e(M_V2X + TAG, "info == null");
|
||||
// clearAllLine();
|
||||
// }
|
||||
// }
|
||||
@@ -415,14 +415,14 @@
|
||||
// float distance = CoordinateUtils.calculateLineDistance(
|
||||
// startLatLng.lon, startLatLng.lat, endLatLng.lon, endLatLng.lat);
|
||||
// double rotate = Trigonometric.getAngle(startLatLng.lon, startLatLng.lat, endLatLng.lon, endLatLng.lat);
|
||||
// CallerLogger.INSTANCE.d(M_V2X + TAG, "添加小箭头--目标物与预碰撞点之间的距离是" + String.valueOf(distance));
|
||||
// CallerLogger.d(M_V2X + TAG, "添加小箭头--目标物与预碰撞点之间的距离是" + String.valueOf(distance));
|
||||
// if (distance > 5) {
|
||||
// int count = (int) (distance / 5);
|
||||
// for (int i = 0; i < count; i++) {
|
||||
// MogoLatLng newLo = Trigonometric.getNewLocation(
|
||||
// startLatLng.getLon(), startLatLng.getLat(), 5 * (i + 1), Trigonometric.getAngle(startLatLng.lon, startLatLng.lat, endLatLng.lon, endLatLng.lat));
|
||||
// Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerService()).drawerArrowsMarkerWithLocation(newLo, WARNING_ARROWS, 10, new Double(rotate).intValue());
|
||||
// CallerLogger.INSTANCE.d(M_V2X + TAG, "小箭头位置" + newLo);
|
||||
// CallerLogger.d(M_V2X + TAG, "小箭头位置" + newLo);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
@@ -441,6 +441,6 @@
|
||||
// //衡阳交付-取消划线需求,只渲染识别物红色模型移动过程
|
||||
// //drawSelfCarLine(latLng.getLongitude(), latLng.getLatitude(), latLng.getBearing());
|
||||
// }
|
||||
// CallerLogger.INSTANCE.d(M_V2X + TAG, "车辆行驶轨迹" + latLng.getLongitude() + "," + latLng.getLatitude());
|
||||
// CallerLogger.d(M_V2X + TAG, "车辆行驶轨迹" + latLng.getLongitude() + "," + latLng.getLatitude());
|
||||
// }
|
||||
//}
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.mogo.eagle.function.biz.v2x.v2n.utils
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.commons.utils.MogoAnalyticUtils
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.enums.CommunicationType
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
|
||||
import com.mogo.eagle.core.function.api.biz.IFuncBizProvider
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.biz.CallerFuncBizListenerManager
|
||||
import com.mogo.eagle.core.utilcode.util.AppUtils
|
||||
import com.mogo.eagle.core.utilcode.util.DateTimeUtils
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
|
||||
/**
|
||||
* V2X消息播报埋点统计
|
||||
*/
|
||||
object V2XEventAnalyticsManager: IMoGoChassisLocationWGS84Listener,IFuncBizProvider{
|
||||
|
||||
private const val TAG = "V2XEventAnalyticsManager"
|
||||
private val hasInit by lazy { AtomicBoolean(false) }
|
||||
|
||||
private const val EVENT_KEY_RECEIVE_V2X_MSG ="event_key_receive_v2x_msg" //鹰眼接收到的V2X事件埋点关键字
|
||||
private const val EVENT_KEY_V2X_MSG_EVENT = "event_key_v2x_msg_event" //消息盒子播报V2X事件埋点关键字
|
||||
|
||||
private const val EVENT_PARAMS_POI_TYPE = "poiType" //事件类型
|
||||
private const val EVENT_PARAMS_CONTENT ="content" // 事件内容
|
||||
private const val EVENT_PARAMS_TTS_CONTENT ="ttsContent" // 语音播报内容
|
||||
private const val EVENT_PARAMS_DISPLAY_TIME ="displayTime" // 展示时间
|
||||
private const val EVENT_PARAMS_DATA_SOURCE ="dataSource" // 数据来源
|
||||
private const val EVENT_PARAMS_COMMUNICATION_TYPE ="communicationType" //通信类型
|
||||
private const val EVENT_PARAMS_PLATE_NUMBER ="plateNumber" // 车牌号
|
||||
private const val EVENT_PARAMS_CAR_SN ="carSn" // 鹰眼SN
|
||||
private const val EVENT_PARAMS_EYE_VERSION ="eyeVersion" // 鹰眼版本
|
||||
private const val EVENT_PARAMS_LONGITUDE ="longitude" // 经度
|
||||
private const val EVENT_PARAMS_LATITUDE ="latitude" // 纬度
|
||||
private const val EVENT_PARAMS_HEADING ="heading" // 航向角
|
||||
|
||||
private var longitude: Double?=null //经度
|
||||
private var latitude: Double?=null //纬度
|
||||
private var heading: Double?=null //航向角
|
||||
|
||||
private var oldTime = System.currentTimeMillis()
|
||||
|
||||
fun init(){
|
||||
if (hasInit.compareAndSet(false, true)){
|
||||
registerListener()
|
||||
}
|
||||
}
|
||||
|
||||
private fun registerListener(){
|
||||
// 添加 ADAS车辆状态&定位 监听
|
||||
CallerChassisLocationWGS84ListenerManager.addListener(TAG, this)
|
||||
CallerFuncBizListenerManager.addListener(TAG,this)
|
||||
}
|
||||
|
||||
private fun unRegisterListener(){
|
||||
// 移除 ADAS车辆状态&定位 监听
|
||||
CallerChassisLocationWGS84ListenerManager.removeListener(TAG)
|
||||
CallerFuncBizListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
override fun onAttrZombieAnalyticsEvent() {
|
||||
val timeDiff = (System.currentTimeMillis() - oldTime)/1000
|
||||
if(timeDiff<30){
|
||||
return
|
||||
}
|
||||
oldTime = System.currentTimeMillis()
|
||||
triggerV2XEvent("ATTR_ZOMBIE","感知数据-僵尸车状态下发","",DataSourceType.TELEMATIC,CommunicationType.V2V)
|
||||
}
|
||||
|
||||
/**
|
||||
* 收到V2X消息埋点(鹰眼收到事件)
|
||||
*/
|
||||
fun receiveV2XEvent(poiType: String,content: String?,ttsContent: String?,
|
||||
dataSource: DataSourceType,communicationType: CommunicationType){
|
||||
val msgEventParams = HashMap<String,Any>()
|
||||
msgEventParams[EVENT_PARAMS_POI_TYPE] = poiType //事件类型
|
||||
msgEventParams[EVENT_PARAMS_CONTENT] = content?:"" //事件内容
|
||||
msgEventParams[EVENT_PARAMS_TTS_CONTENT] = ttsContent?:"" //语音播报内容
|
||||
msgEventParams[EVENT_PARAMS_DISPLAY_TIME] = DateTimeUtils.getTimeText(
|
||||
System.currentTimeMillis(), DateTimeUtils.yyyy_MM_dd_HH_mm_ss) //展示时间
|
||||
msgEventParams[EVENT_PARAMS_DATA_SOURCE] = dataSource.name //数据来源
|
||||
msgEventParams[EVENT_PARAMS_COMMUNICATION_TYPE] = communicationType.name //通信类型
|
||||
msgEventParams[EVENT_PARAMS_PLATE_NUMBER] = AppConfigInfo.plateNumber //车牌号
|
||||
msgEventParams[EVENT_PARAMS_CAR_SN] = MoGoAiCloudClientConfig.getInstance().sn //鹰眼SN
|
||||
msgEventParams[EVENT_PARAMS_EYE_VERSION] = AppUtils.getAppVersionName() //鹰眼版本
|
||||
msgEventParams[EVENT_PARAMS_LONGITUDE] = "$longitude" //经度
|
||||
msgEventParams[EVENT_PARAMS_LATITUDE] = "$latitude" //纬度
|
||||
msgEventParams[EVENT_PARAMS_HEADING] = "$heading" //航向角
|
||||
MogoAnalyticUtils.track(EVENT_KEY_RECEIVE_V2X_MSG,msgEventParams)
|
||||
}
|
||||
|
||||
/**
|
||||
* 触发V2X消息埋点(播报事件)
|
||||
*/
|
||||
fun triggerV2XEvent(poiType: String,content: String?,ttsContent: String?,
|
||||
dataSource: DataSourceType,communicationType: CommunicationType){
|
||||
val msgEventParams = HashMap<String,Any>()
|
||||
msgEventParams[EVENT_PARAMS_POI_TYPE] = poiType //事件类型
|
||||
msgEventParams[EVENT_PARAMS_CONTENT] = content?:"" //事件内容
|
||||
msgEventParams[EVENT_PARAMS_TTS_CONTENT] = ttsContent?:"" //语音播报内容
|
||||
msgEventParams[EVENT_PARAMS_DISPLAY_TIME] = DateTimeUtils.getTimeText(
|
||||
System.currentTimeMillis(), DateTimeUtils.yyyy_MM_dd_HH_mm_ss) //展示时间
|
||||
msgEventParams[EVENT_PARAMS_DATA_SOURCE] = dataSource.name //数据来源
|
||||
msgEventParams[EVENT_PARAMS_COMMUNICATION_TYPE] = communicationType.name //通信类型
|
||||
msgEventParams[EVENT_PARAMS_PLATE_NUMBER] = AppConfigInfo.plateNumber //车牌号
|
||||
msgEventParams[EVENT_PARAMS_CAR_SN] = MoGoAiCloudClientConfig.getInstance().sn //鹰眼SN
|
||||
msgEventParams[EVENT_PARAMS_EYE_VERSION] = AppUtils.getAppVersionName() //鹰眼版本
|
||||
msgEventParams[EVENT_PARAMS_LONGITUDE] = "$longitude" //经度
|
||||
msgEventParams[EVENT_PARAMS_LATITUDE] = "$latitude" //纬度
|
||||
msgEventParams[EVENT_PARAMS_HEADING] = "$heading" //航向角
|
||||
MogoAnalyticUtils.track(EVENT_KEY_V2X_MSG_EVENT,msgEventParams)
|
||||
}
|
||||
|
||||
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
|
||||
gnssInfo.let {
|
||||
longitude = it.longitude
|
||||
latitude = it.latitude
|
||||
heading = it.heading
|
||||
}
|
||||
}
|
||||
|
||||
fun onDestroy(){
|
||||
if (hasInit.compareAndSet(true, false)){
|
||||
unRegisterListener()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,6 +13,8 @@ import com.mogo.eagle.core.data.biz.trafficlight.currentRoadTrafficLight
|
||||
import com.mogo.eagle.core.data.biz.trafficlight.isGreen
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_VIP
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2N
|
||||
import com.mogo.eagle.core.data.enums.CommunicationType
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
@@ -29,6 +31,7 @@ import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.eagle.function.biz.v2x.V2XBizTrace
|
||||
import com.mogo.eagle.function.biz.v2x.trafficlight.core.MogoTrafficLightManager
|
||||
import com.mogo.eagle.function.biz.v2x.v2n.utils.V2XEventAnalyticsManager
|
||||
import com.mogo.eagle.function.biz.v2x.vip.network.VipNetWorkModel
|
||||
import com.zhjt.service_biz.BizConfig
|
||||
|
||||
@@ -268,9 +271,11 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
Log.d("MsgBox-VipCarManager", "alertContent或ttsContent为空!")
|
||||
}
|
||||
CallerMsgBoxManager.saveMsgBox(
|
||||
MsgBoxBean(MsgBoxType.V2X, V2XMsg(v2xType, alertContent.toString(), ttsContent))
|
||||
MsgBoxBean(MsgBoxType.V2X, V2XMsg(v2xType, alertContent.toString(), ttsContent,CommunicationType.V2N.name))
|
||||
)
|
||||
CallerHmiManager.warningV2X(v2xType, alertContent, ttsContent, isFromObu = false)
|
||||
V2XEventAnalyticsManager.triggerV2XEvent(v2xType, alertContent.toString(),
|
||||
ttsContent,DataSourceType.AICLOUD,CommunicationType.V2N)
|
||||
}
|
||||
|
||||
fun destroy() {
|
||||
|
||||
@@ -589,8 +589,8 @@ object MoGoChatFacade: IMoGoChatFacade {
|
||||
it.cardIdAge = mySelf.get().age
|
||||
it.cardIdSex = mySelf.get().sex
|
||||
it.cityName = mySelf.get().city
|
||||
it.lat = location?.latitude ?: 0.0
|
||||
it.lon = location?.longitude ?: 0.0
|
||||
it.lat = location.latitude
|
||||
it.lon = location.longitude
|
||||
})
|
||||
if (response.code != 0 && response.code != 200) {
|
||||
send(AnswerState.Error(AnswerState.CODE_ANSWER_API_REQ_FAIL, "[Answer] - ${response.msg}", mutableMapOf<String, String>().also {
|
||||
@@ -818,8 +818,8 @@ object MoGoChatFacade: IMoGoChatFacade {
|
||||
it.nickName = user.name
|
||||
it.headImgUrl = user.icon
|
||||
it.carInfo = user.brand
|
||||
it.lat = location?.latitude ?: 0.0
|
||||
it.lon = location?.longitude ?: 0.0
|
||||
it.lat = location.latitude
|
||||
it.lon = location.longitude
|
||||
})
|
||||
val code = response.code
|
||||
if (code != 0 && code != 200) {
|
||||
@@ -966,8 +966,8 @@ object MoGoChatFacade: IMoGoChatFacade {
|
||||
it.cardIdAge = mySelf.get().age
|
||||
it.cardIdSex = mySelf.get().sex
|
||||
it.cityName = mySelf.get().city
|
||||
it.lat = location?.latitude ?: 0.0
|
||||
it.lon = location?.longitude ?: 0.0
|
||||
it.lat = location.latitude
|
||||
it.lon = location.longitude
|
||||
})
|
||||
if (response.code != 0 && response.code != 200) {
|
||||
send(JoinState.Error(AnswerState.CODE_ANSWER_API_REQ_FAIL, "[JoinTeam] - ${response.msg}", mutableMapOf<String, String>().also {
|
||||
|
||||
@@ -70,10 +70,8 @@ internal class ChatServiceModel {
|
||||
val sn = MoGoAiCloudClientConfig.getInstance().sn
|
||||
|
||||
val location = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
if (location != null) {
|
||||
params.lon = location.longitude
|
||||
params.lat = location.latitude
|
||||
}
|
||||
params.lon = location.longitude
|
||||
params.lat = location.latitude
|
||||
Logger.d(ChatConsts.TAG, "connectStatusParam:$params")
|
||||
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
|
||||
map["data"] = Gson().toJson(params)
|
||||
|
||||
@@ -7,6 +7,7 @@ import bag_manager.BagManagerOuterClass
|
||||
import chassis.SpecialVehicleTaskCmdOuterClass
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.autopilot.toAutoPilotLine
|
||||
import com.mogo.eagle.core.data.autopilot.toRouteInfo
|
||||
@@ -17,6 +18,7 @@ import com.mogo.eagle.core.data.constants.MoGoConfig
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.data.deva.badcase.BagManagerEntity
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ADAS_SEND
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_MULTI_CONNECT
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_SOURCE_ADAS
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_TYPE_INIT_STATUS
|
||||
@@ -96,14 +98,15 @@ class MoGoAutopilotControlProvider :
|
||||
override fun init(context: Context) {
|
||||
CallerLogger.i("$M_D_C$TAG", "初始化工控机连接……")
|
||||
mContext = context
|
||||
// 初始化ADAS 域控制器
|
||||
CupidLogUtils.setEnableLog(false)
|
||||
msgHandler = TeleMsgHandler()
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {// 司机
|
||||
// 注册地图采集功能
|
||||
CallerMapDataCollectorManager.registerOnMapCollectTaskListener(this)
|
||||
runCatching {
|
||||
// 初始化ADAS 域控制器
|
||||
CupidLogUtils.setEnableLog(false)
|
||||
msgHandler = TeleMsgHandler()
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {// 司机
|
||||
// 注册地图采集功能
|
||||
CallerMapDataCollectorManager.registerOnMapCollectTaskListener(this)
|
||||
|
||||
// 配置默认关闭的连接topic
|
||||
// 配置默认关闭的连接topic
|
||||
// val messageTypes: MutableSet<MessageType> = HashSet()
|
||||
// messageTypes.add(MessageType.TYPE_RECEIVE_POINT_CLOUD)
|
||||
// val subscribeInterfaceOptions = SubscribeInterfaceOptions.newBuilder()
|
||||
@@ -111,125 +114,134 @@ class MoGoAutopilotControlProvider :
|
||||
// .setType(Constants.SUBSCRIBE_TYPE.UNSUBSCRIBE)
|
||||
// .setMessageTypes(messageTypes).build()
|
||||
|
||||
// "192.168.1.102"
|
||||
val options = AdasOptions.Builder()
|
||||
.setIpcConnectionMode(AdasOptions.IPC_CONNECTION_MODE.FIXATION)
|
||||
.setIpcFixationIP(AdasManager.getInstance().getIPCFixationIPList(mContext))
|
||||
.setClient(false)
|
||||
.setUnableLaunchAutopilotGear(FunctionBuildConfig.unableLaunchAutopilotGear)
|
||||
// "192.168.1.102"
|
||||
val options = AdasOptions.Builder()
|
||||
.setIpcConnectionMode(AdasOptions.IPC_CONNECTION_MODE.FIXATION)
|
||||
.setIpcFixationIP(AdasManager.getInstance().getIPCFixationIPList(mContext))
|
||||
.setClient(false)
|
||||
.setUnableLaunchAutopilotGear(FunctionBuildConfig.unableLaunchAutopilotGear)
|
||||
// .setSubscribeInterfaceOptions(subscribeInterfaceOptions)//
|
||||
.build()
|
||||
.build()
|
||||
|
||||
AdasManager.getInstance().create(options, MoGoAdasMsgConnectStatusListenerImpl())
|
||||
//////////////////////////////////注意先后顺序,AdasManager.getInstance().create后才可以设置监听/////////////////////////////////////////////
|
||||
// 监听ADAS-SDK获取到的工控机数据
|
||||
AdasManager.getInstance().setOnAdasListener(MoGoAdasListenerImpl())
|
||||
NSDNettyManager.getInstance().startNSDNettyServerWithSN(context, object :
|
||||
NettyServerListener<MogoProtocolMsg> {
|
||||
override fun onMessageResponseServer(msg: MogoProtocolMsg?, channel: Channel?) {
|
||||
msgHandler.handleMsgFromClient(msg, channel)
|
||||
}
|
||||
|
||||
override fun onStartServer() {
|
||||
ToastUtils.showShort("司机端服务启动成功!")
|
||||
if (timer == null) {
|
||||
timer = Timer()
|
||||
AdasManager.getInstance().create(context, options, MoGoAdasMsgConnectStatusListenerImpl())
|
||||
//////////////////////////////////注意先后顺序,AdasManager.getInstance().create后才可以设置监听/////////////////////////////////////////////
|
||||
// 监听ADAS-SDK获取到的工控机数据
|
||||
AdasManager.getInstance().setOnAdasListener(MoGoAdasListenerImpl())
|
||||
NSDNettyManager.getInstance().startNSDNettyServerWithSN(context, object :
|
||||
NettyServerListener<MogoProtocolMsg> {
|
||||
override fun onMessageResponseServer(msg: MogoProtocolMsg?, channel: Channel?) {
|
||||
msgHandler.handleMsgFromClient(msg, channel)
|
||||
}
|
||||
// 10s同步一次数据到乘客屏
|
||||
timer!!.schedule(object : TimerTask() {
|
||||
override fun run() {
|
||||
// 同步是否开启美化模式
|
||||
setDemoMode(FunctionBuildConfig.isDemoMode)
|
||||
setIgnoreConditionDraw(FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData)
|
||||
msgHandler.synMsgToAllClients()
|
||||
|
||||
override fun onStartServer() {
|
||||
ToastUtils.showShort("司机端服务启动成功!")
|
||||
if (timer == null) {
|
||||
timer = Timer()
|
||||
}
|
||||
}, 1000, 10000)
|
||||
invokeNettyConnResult("司机端服务启动成功!")
|
||||
CallerTelematicStatusListenerManager.invokeServerStatusChanged(true)
|
||||
}
|
||||
|
||||
override fun onStopServer() {
|
||||
ToastUtils.showLong("司机端服务停止!")
|
||||
timer?.cancel()
|
||||
timer = null
|
||||
invokeNettyConnResult("司机端服务停止!")
|
||||
CallerTelematicStatusListenerManager.invokeServerStatusChanged(false)
|
||||
}
|
||||
|
||||
override fun onChannelConnect(channel: Channel?) {
|
||||
msgHandler.handleClientConn2Server(channel)
|
||||
}
|
||||
|
||||
override fun onChannelDisConnect(channel: Channel?) {
|
||||
CallerLogger.d("$M_D_C$TAG", "onChannelDisConnect")
|
||||
}
|
||||
|
||||
override fun onReceiveClientSign(channel: Channel?, sn: String?) {
|
||||
}
|
||||
}, MoGoAiCloudClientConfig.getInstance().sn)
|
||||
} else {
|
||||
NSDNettyManager.getInstance()
|
||||
.searchAndConnectServer(context, MoGoAiCloudClientConfig.getInstance().sn,
|
||||
AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode),
|
||||
object : NettyClientListener<MogoProtocolMsg> {
|
||||
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)
|
||||
}
|
||||
})
|
||||
}
|
||||
msgHandler.setListener(object : EventListener {
|
||||
override fun connectDevice(isSupportMulti: Boolean) {
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
if (!isInit) {
|
||||
isInit = true
|
||||
// 转发工控机数据给乘客屏
|
||||
listenDeviceData()
|
||||
// 10s同步一次数据到乘客屏
|
||||
timer!!.schedule(object : TimerTask() {
|
||||
override fun run() {
|
||||
// 同步是否开启美化模式
|
||||
setDemoMode(FunctionBuildConfig.isDemoMode)
|
||||
setIgnoreConditionDraw(FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData)
|
||||
msgHandler.synMsgToAllClients()
|
||||
}
|
||||
}, 1000, 10000)
|
||||
invokeNettyConnResult("司机端服务启动成功!")
|
||||
CallerTelematicStatusListenerManager.invokeServerStatusChanged(true)
|
||||
}
|
||||
} else {
|
||||
if (!isInit) {
|
||||
isInit = true
|
||||
UiThreadHandler.post {
|
||||
if (isSupportMulti) {
|
||||
// 直连工控机
|
||||
directConnect()
|
||||
} else {
|
||||
val options = AdasOptions
|
||||
.Builder()
|
||||
.setClient(true)
|
||||
.setUnableLaunchAutopilotGear(FunctionBuildConfig.unableLaunchAutopilotGear)
|
||||
.build()
|
||||
AdasManager.getInstance()
|
||||
.create(options, MoGoAdasMsgConnectStatusListenerImpl())
|
||||
// 监听ADAS-SDK获取到的工控机数据
|
||||
AdasManager.getInstance().setOnAdasListener(MoGoAdasListenerImpl())
|
||||
// 接收司机屏发过来的感知、定位等数据
|
||||
listenDeviceData()
|
||||
|
||||
override fun onStopServer() {
|
||||
ToastUtils.showLong("司机端服务停止!")
|
||||
timer?.cancel()
|
||||
timer = null
|
||||
invokeNettyConnResult("司机端服务停止!")
|
||||
CallerTelematicStatusListenerManager.invokeServerStatusChanged(false)
|
||||
}
|
||||
|
||||
override fun onChannelConnect(channel: Channel?) {
|
||||
msgHandler.handleClientConn2Server(channel)
|
||||
}
|
||||
|
||||
override fun onChannelDisConnect(channel: Channel?) {
|
||||
CallerLogger.d("$M_D_C$TAG", "onChannelDisConnect")
|
||||
}
|
||||
|
||||
override fun onReceiveClientSign(channel: Channel?, sn: String?) {
|
||||
sn?.let {
|
||||
invokeNettyConnResult("连接成功的乘客屏sn为:$it")
|
||||
}
|
||||
}
|
||||
}, MoGoAiCloudClientConfig.getInstance().sn)
|
||||
} else {
|
||||
NSDNettyManager.getInstance()
|
||||
.searchAndConnectServer(context, MoGoAiCloudClientConfig.getInstance().sn,
|
||||
AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode),
|
||||
object : NettyClientListener<MogoProtocolMsg> {
|
||||
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)
|
||||
}
|
||||
})
|
||||
}
|
||||
msgHandler.setListener(object : EventListener {
|
||||
override fun connectDevice(isSupportMulti: Boolean) {
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
if (!isInit) {
|
||||
isInit = true
|
||||
// 转发工控机数据给乘客屏
|
||||
listenDeviceData()
|
||||
}
|
||||
} else {
|
||||
if (!isInit) {
|
||||
isInit = true
|
||||
UiThreadHandler.post {
|
||||
if (isSupportMulti) {
|
||||
// 直连工控机
|
||||
directConnect(context)
|
||||
} else {
|
||||
val options = AdasOptions
|
||||
.Builder()
|
||||
.setClient(true)
|
||||
.setUnableLaunchAutopilotGear(FunctionBuildConfig.unableLaunchAutopilotGear)
|
||||
.build()
|
||||
AdasManager.getInstance()
|
||||
.create(context, options, MoGoAdasMsgConnectStatusListenerImpl())
|
||||
// 监听ADAS-SDK获取到的工控机数据
|
||||
AdasManager.getInstance().setOnAdasListener(MoGoAdasListenerImpl())
|
||||
// 接收司机屏发过来的感知、定位等数据
|
||||
listenDeviceData()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
CallerAutopilotCarConfigListenerManager.addListener(TAG, this)
|
||||
CallerLogger.i("$M_D_C$TAG", "initServer……")
|
||||
// 同步数据给工控机的服务
|
||||
AsyncDataToAutopilotServer.INSTANCE.initServer()
|
||||
}.onFailure { throwable ->
|
||||
if (DebugConfig.isDebug()) {
|
||||
ToastUtils.showLong("AutoPilot出现异常,请立即处理!")
|
||||
}
|
||||
})
|
||||
CallerAutopilotCarConfigListenerManager.addListener(TAG, this)
|
||||
CallerLogger.i("$M_D_C$TAG", "initServer……")
|
||||
// 同步数据给工控机的服务
|
||||
AsyncDataToAutopilotServer.INSTANCE.initServer()
|
||||
throwable.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
private fun directConnect() {
|
||||
private fun directConnect(context: Context) {
|
||||
val options = AdasOptions
|
||||
.Builder()
|
||||
.setIpcConnectionMode(AdasOptions.IPC_CONNECTION_MODE.FIXATION)
|
||||
@@ -237,7 +249,7 @@ class MoGoAutopilotControlProvider :
|
||||
.setClient(false)// 乘客端直连工控机改为false
|
||||
.setUnableLaunchAutopilotGear(FunctionBuildConfig.unableLaunchAutopilotGear)
|
||||
.build()
|
||||
AdasManager.getInstance().create(options, MoGoAdasMsgConnectStatusListenerImpl())
|
||||
AdasManager.getInstance().create(context, options, MoGoAdasMsgConnectStatusListenerImpl())
|
||||
//////////////////////////////////注意先后顺序,AdasManager.getInstance().create后才可以设置监听/////////////////////////////////////////////
|
||||
// 监听ADAS-SDK获取到的工控机数据
|
||||
AdasManager.getInstance().setOnAdasListener(MoGoAdasListenerImpl())
|
||||
@@ -406,6 +418,10 @@ class MoGoAutopilotControlProvider :
|
||||
AdasManager.getInstance().sendTrajectoryDownloadReq(autoPilotLine.toAutoPilotLine())
|
||||
}
|
||||
|
||||
override fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, downloadType: Int) {
|
||||
AdasManager.getInstance().sendTrajectoryDownloadReq(autoPilotLine.toAutoPilotLine(), downloadType)
|
||||
}
|
||||
|
||||
override fun cancelAutoPilot() {
|
||||
if (AdasManager.getInstance().ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.CONNECTED) {
|
||||
AdasManager.getInstance().sendAutoPilotModeReq(0, 1, null)
|
||||
@@ -537,6 +553,12 @@ class MoGoAutopilotControlProvider :
|
||||
* isEnable = true 开启
|
||||
* isEnable = false 关闭
|
||||
*/
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_TYPE_SOCKET_AUTOPILOT,
|
||||
linkCode = CHAIN_SOURCE_ADAS,
|
||||
nodeAliasCode = CHAIN_CODE_ADAS_SEND,
|
||||
paramIndexes = [0]
|
||||
)
|
||||
override fun setIPCDemoMode(isEnable: Boolean) {
|
||||
if (isEnable) {
|
||||
AdasManager.getInstance().sendDemoModeReq(1)
|
||||
@@ -545,11 +567,12 @@ class MoGoAutopilotControlProvider :
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 雨天模式
|
||||
* isEnable = true 开启
|
||||
* isEnable = false 关闭
|
||||
*/
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_TYPE_SOCKET_AUTOPILOT,
|
||||
linkCode = CHAIN_SOURCE_ADAS,
|
||||
nodeAliasCode = CHAIN_CODE_ADAS_SEND,
|
||||
paramIndexes = [0]
|
||||
)
|
||||
override fun setRainMode(isEnable: Boolean) {
|
||||
if (isEnable) {
|
||||
AdasManager.getInstance().sendRainModeReq(1)
|
||||
@@ -564,6 +587,12 @@ class MoGoAutopilotControlProvider :
|
||||
* isEnable = false 关闭
|
||||
* @return boolean
|
||||
*/
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_TYPE_SOCKET_AUTOPILOT,
|
||||
linkCode = CHAIN_SOURCE_ADAS,
|
||||
nodeAliasCode = CHAIN_CODE_ADAS_SEND,
|
||||
paramIndexes = [0]
|
||||
)
|
||||
override fun sendDetouring(isEnable: Boolean): Boolean {
|
||||
return if (isEnable) {
|
||||
AdasManager.getInstance().sendDetouring(1)
|
||||
@@ -595,6 +624,34 @@ class MoGoAutopilotControlProvider :
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 故障减速停车策路开关
|
||||
* isEnable = true 使用故障减速停车策略
|
||||
* isEnable = false 关闭故障减速停车策略
|
||||
* @return boolean
|
||||
*/
|
||||
override fun sendBreakdownSlowDown(isEnable: Boolean): Boolean {
|
||||
return if (isEnable) {
|
||||
AdasManager.getInstance().sendBreakdownSlowDown(1)
|
||||
} else {
|
||||
AdasManager.getInstance().sendBreakdownSlowDown(0)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 融合模式
|
||||
*
|
||||
* @param cmd 1:全融合模式 2:盲区模式 3:超视距模式 4:透传模式 5:纯路侧模式,默认1
|
||||
* @return boolean
|
||||
*/
|
||||
override fun sendFusionMode(cmd: Int): Boolean {
|
||||
return AdasManager.getInstance().sendFusionMode(cmd)
|
||||
}
|
||||
|
||||
override fun sendSetParamReq(param: Map<AdasConstants.MapSystemParamType, Any>): Boolean {
|
||||
return AdasManager.getInstance().sendSetParamReq(param)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全部参数
|
||||
* 结果回调{@link OnAdasListener#onGetParamResp(MessagePad.Header, MessagePad.SetParamReq, AdasParam)}
|
||||
@@ -612,8 +669,8 @@ class MoGoAutopilotControlProvider :
|
||||
* @param paramType 参数类型:libraries/mogo-adas-data/src/main/proto/personal/adas_constants.proto
|
||||
* @return boolean
|
||||
*/
|
||||
override fun sendGetParamReq(paramType: AdasConstants.MapSystemParamType): Boolean {
|
||||
return AdasManager.getInstance().sendGetParamReq(paramType)
|
||||
override fun sendGetParamReq(vararg paramType: AdasConstants.MapSystemParamType): Boolean {
|
||||
return AdasManager.getInstance().sendGetParamReq(*paramType)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -730,13 +787,34 @@ class MoGoAutopilotControlProvider :
|
||||
}
|
||||
|
||||
/**
|
||||
* 控制V2N数据给车端PnC
|
||||
* @param switchCmd true为发给PnC,false为不发给PnC
|
||||
* 控制V2I进PnC
|
||||
*
|
||||
* @param switchCmd true:发给Pnc和鹰眼,false:不发给PnC和鹰眼
|
||||
* @return boolean
|
||||
*/
|
||||
override fun sendV2iToPncCmd(switchCmd: Boolean) {
|
||||
AdasManager.getInstance().sendV2iToPncCmd(switchCmd)
|
||||
}
|
||||
|
||||
/**
|
||||
* 控制V2N进PnC
|
||||
*
|
||||
* @param switchCmd true:发给PnC,false:不发给PnC
|
||||
* @return boolean
|
||||
*/
|
||||
override fun sendV2nToPncCmd(switchCmd: Boolean) {
|
||||
AdasManager.getInstance().sendV2nToPncCmd(switchCmd)
|
||||
}
|
||||
|
||||
/**
|
||||
* 盲区数据开关
|
||||
*
|
||||
* @param switchCmd 数据开关
|
||||
* @return boolean
|
||||
*/
|
||||
override fun sendBlindAreaCmd(switchCmd: Boolean) {
|
||||
AdasManager.getInstance().sendBlindAreaCmd(switchCmd)
|
||||
}
|
||||
/**
|
||||
* 向左变道
|
||||
*/
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ADAS_ABILITY
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ADAS_ARRIVE
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ADAS_GUARDIAN
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ADAS_RECORD
|
||||
@@ -30,6 +31,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.invokeAutopilotGuardian
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.invokeAutopilotSNRequest
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.invokeAutopilotStatusRespByQuery
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.invokeSystemStatus
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.updateAutoPilotDockerInfo
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.updateAutoPilotStatus
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotActionsListenerManager.invokeAutopilotAbility
|
||||
@@ -55,6 +57,7 @@ import com.zhidao.support.adas.high.OnAdasListener
|
||||
import com.zhjt.mogo.adas.data.bean.AdasParam
|
||||
import com.zhidao.support.adas.high.common.ProtocolStatus
|
||||
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics
|
||||
import com.zhjt.mogo.adas.data.bean.UnableAutopilotReason
|
||||
import com.zhjt.mogo.adas.data.sweeper.SweeperCloudTask
|
||||
import com.zhjt.mogo.adas.data.sweeper.bootable.SweeperBootable
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.SweeperTask
|
||||
@@ -75,6 +78,7 @@ import perception.TrafficLightOuterClass
|
||||
import planning.RoboSweeperTaskIndexOuterClass
|
||||
import prediction.Prediction
|
||||
import record_cache.RecordPanelOuterClass
|
||||
import system_master.SsmInfo
|
||||
import system_master.SystemStatusInfo
|
||||
|
||||
/**
|
||||
@@ -171,6 +175,8 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
CallerChassisThrottleStateListenerManager.invokeAutopilotThrottle(vehicleState.throttle)
|
||||
//刹车
|
||||
CallerChassisBrakeStateListenerManager.invokeAutopilotBrake(vehicleState.brake)
|
||||
//车门
|
||||
CallerChassisDoorStateListenerManager.invokeAutopilotDoorState(vehicleState.doorStateList)
|
||||
//电量
|
||||
if (vehicleState.hasBmsSoc()) {
|
||||
CallerBatteryManagementSystemListenerManager.invokeBatteryManagementSystemStates(
|
||||
@@ -323,7 +329,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
//todo 新增稳定设备类型需要添加,目的避免在nuc设备上使用此类功能
|
||||
private val limit = DeviceUtils.isLenovoModel() || DeviceUtils.isEB5Model()
|
||||
override fun onPointCloud(header: MessagePad.Header, pointCloud: ByteArray?) {
|
||||
if(limit){
|
||||
if (limit) {
|
||||
//点云数据透传
|
||||
CallerAutopilotPointCloudListenerManager.invokeAutopilotPointCloudDataUpdate(pointCloud)
|
||||
}
|
||||
@@ -436,6 +442,10 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
invokeAutopilotStatusRespByQuery(statusInfo)
|
||||
}
|
||||
|
||||
override fun onSystemStatus(header: MessagePad.Header?, statusInf: SsmInfo.SsmStatusInf?) {
|
||||
invokeSystemStatus(statusInf)
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据采集配置应答
|
||||
*/
|
||||
@@ -564,8 +574,19 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
* @param sysTime 当前时间戳
|
||||
* @param taskInfo 数据
|
||||
*/
|
||||
override fun onSweeperFutianCloudTask(header: MessagePad.Header, messageType: SweeperCloudTask.MessageType, reqNo: String?, sysTime: Long, taskInfo: SweeperTask.TaskInfo?) {
|
||||
CallerSweeperFutianCloudTaskListenerManager.invokeSweeperFutianCloudTask(messageType, reqNo, sysTime, taskInfo)
|
||||
override fun onSweeperFutianCloudTask(
|
||||
header: MessagePad.Header,
|
||||
messageType: SweeperCloudTask.MessageType,
|
||||
reqNo: String?,
|
||||
sysTime: Long,
|
||||
taskInfo: SweeperTask.TaskInfo?
|
||||
) {
|
||||
CallerSweeperFutianCloudTaskListenerManager.invokeSweeperFutianCloudTask(
|
||||
messageType,
|
||||
reqNo,
|
||||
sysTime,
|
||||
taskInfo
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -577,8 +598,19 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
* @param sysTime 当前时间戳
|
||||
* @param taskConfirm 数据
|
||||
*/
|
||||
override fun onSweeperFutianCloudTaskConfirm(header: MessagePad.Header, messageType: SweeperCloudTask.MessageType, reqNo: String?, sysTime: Long, taskConfirm: SweeperTaskConfirm.TaskConfirm?) {
|
||||
CallerSweeperFutianCloudTaskListenerManager.invokeSweeperFutianCloudTaskConfirm(messageType, reqNo, sysTime, taskConfirm)
|
||||
override fun onSweeperFutianCloudTaskConfirm(
|
||||
header: MessagePad.Header,
|
||||
messageType: SweeperCloudTask.MessageType,
|
||||
reqNo: String?,
|
||||
sysTime: Long,
|
||||
taskConfirm: SweeperTaskConfirm.TaskConfirm?
|
||||
) {
|
||||
CallerSweeperFutianCloudTaskListenerManager.invokeSweeperFutianCloudTaskConfirm(
|
||||
messageType,
|
||||
reqNo,
|
||||
sysTime,
|
||||
taskConfirm
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -590,8 +622,19 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
* @param sysTime 当前时间戳
|
||||
* @param taskStatusPush 数据
|
||||
*/
|
||||
override fun onSweeperFutianCloudTaskStatus(header: MessagePad.Header, messageType: SweeperCloudTask.MessageType, reqNo: String?, sysTime: Long, taskStatusPush: SweeperTaskStatus.TaskStatusPush?) {
|
||||
CallerSweeperFutianCloudTaskListenerManager.invokeSweeperFutianCloudTaskStatus(messageType, reqNo, sysTime, taskStatusPush)
|
||||
override fun onSweeperFutianCloudTaskStatus(
|
||||
header: MessagePad.Header,
|
||||
messageType: SweeperCloudTask.MessageType,
|
||||
reqNo: String?,
|
||||
sysTime: Long,
|
||||
taskStatusPush: SweeperTaskStatus.TaskStatusPush?
|
||||
) {
|
||||
CallerSweeperFutianCloudTaskListenerManager.invokeSweeperFutianCloudTaskStatus(
|
||||
messageType,
|
||||
reqNo,
|
||||
sysTime,
|
||||
taskStatusPush
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -603,8 +646,19 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
* @param sysTime 当前时间戳
|
||||
* @param stopTaskReq 数据
|
||||
*/
|
||||
override fun onSweeperFutianCloudTaskStop(header: MessagePad.Header, messageType: SweeperCloudTask.MessageType, reqNo: String?, sysTime: Long, stopTaskReq: SweeperTaskStop.StopTaskReq?) {
|
||||
CallerSweeperFutianCloudTaskListenerManager.invokeSweeperFutianCloudTaskStop(messageType, reqNo, sysTime, stopTaskReq)
|
||||
override fun onSweeperFutianCloudTaskStop(
|
||||
header: MessagePad.Header,
|
||||
messageType: SweeperCloudTask.MessageType,
|
||||
reqNo: String?,
|
||||
sysTime: Long,
|
||||
stopTaskReq: SweeperTaskStop.StopTaskReq?
|
||||
) {
|
||||
CallerSweeperFutianCloudTaskListenerManager.invokeSweeperFutianCloudTaskStop(
|
||||
messageType,
|
||||
reqNo,
|
||||
sysTime,
|
||||
stopTaskReq
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -617,8 +671,19 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
* @param sysTime 当前时间戳
|
||||
* @param suspendResumeTaskResp 数据
|
||||
*/
|
||||
override fun onSweeperFutianCloudTaskSuspendResume(header: MessagePad.Header, messageType: SweeperCloudTask.MessageType, reqNo: String?, sysTime: Long, suspendResumeTaskResp: SweeperTaskSuspendResume.SuspendResumeTaskResp?) {
|
||||
CallerSweeperFutianCloudTaskListenerManager.invokeSweeperFutianCloudTaskSuspendResume(messageType, reqNo, sysTime, suspendResumeTaskResp)
|
||||
override fun onSweeperFutianCloudTaskSuspendResume(
|
||||
header: MessagePad.Header,
|
||||
messageType: SweeperCloudTask.MessageType,
|
||||
reqNo: String?,
|
||||
sysTime: Long,
|
||||
suspendResumeTaskResp: SweeperTaskSuspendResume.SuspendResumeTaskResp?
|
||||
) {
|
||||
CallerSweeperFutianCloudTaskListenerManager.invokeSweeperFutianCloudTaskSuspendResume(
|
||||
messageType,
|
||||
reqNo,
|
||||
sysTime,
|
||||
suspendResumeTaskResp
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -630,8 +695,19 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
* @param sysTime 当前时间戳
|
||||
* @param isBootableResp 数据
|
||||
*/
|
||||
override fun onSweeperFutianCloudBootable(header: MessagePad.Header, messageType: SweeperCloudTask.MessageType, reqNo: String?, sysTime: Long, isBootableResp: SweeperBootable.IsBootableResp?) {
|
||||
CallerSweeperFutianCloudTaskListenerManager.invokeSweeperFutianCloudBootable(messageType, reqNo, sysTime, isBootableResp)
|
||||
override fun onSweeperFutianCloudBootable(
|
||||
header: MessagePad.Header,
|
||||
messageType: SweeperCloudTask.MessageType,
|
||||
reqNo: String?,
|
||||
sysTime: Long,
|
||||
isBootableResp: SweeperBootable.IsBootableResp?
|
||||
) {
|
||||
CallerSweeperFutianCloudTaskListenerManager.invokeSweeperFutianCloudBootable(
|
||||
messageType,
|
||||
reqNo,
|
||||
sysTime,
|
||||
isBootableResp
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -643,8 +719,19 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
* @param sysTime 当前时间戳
|
||||
* @param bigTaskStatusPush 数据
|
||||
*/
|
||||
override fun onSweeperFutianCloudBigTaskStatus(header: MessagePad.Header, messageType: SweeperCloudTask.MessageType, reqNo: String?, sysTime: Long, bigTaskStatusPush: SweeperBigTaskStatus.BigTaskStatusPush?) {
|
||||
CallerSweeperFutianCloudTaskListenerManager.invokeSweeperFutianCloudBigTaskStatus(messageType, reqNo, sysTime, bigTaskStatusPush)
|
||||
override fun onSweeperFutianCloudBigTaskStatus(
|
||||
header: MessagePad.Header,
|
||||
messageType: SweeperCloudTask.MessageType,
|
||||
reqNo: String?,
|
||||
sysTime: Long,
|
||||
bigTaskStatusPush: SweeperBigTaskStatus.BigTaskStatusPush?
|
||||
) {
|
||||
CallerSweeperFutianCloudTaskListenerManager.invokeSweeperFutianCloudBigTaskStatus(
|
||||
messageType,
|
||||
reqNo,
|
||||
sysTime,
|
||||
bigTaskStatusPush
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -744,7 +831,11 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
* @param getParamResp 配置参数
|
||||
* @param adasParam 解析后的配置参数
|
||||
*/
|
||||
override fun onGetParamResp(header: MessagePad.Header, getParamResp: MessagePad.SetParamReq, adasParam: AdasParam) {
|
||||
override fun onGetParamResp(
|
||||
header: MessagePad.Header,
|
||||
getParamResp: MessagePad.SetParamReq,
|
||||
adasParam: AdasParam
|
||||
) {
|
||||
CallerAutopilotGetParamResponseDispatcher.dispatchResponse(header, getParamResp, adasParam)
|
||||
}
|
||||
|
||||
@@ -766,8 +857,24 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
* 是否可以启动自动驾驶
|
||||
* 使用方法查看:app_ipc_monitoring/uiMainActivity/onAutopilotAbility
|
||||
*/
|
||||
override fun onAutopilotAbility(isAutopilotAbility: Boolean, unableAutopilotReason: String?) {
|
||||
invokeAutopilotAbility(isAutopilotAbility, unableAutopilotReason)
|
||||
override fun onAutopilotAbility(
|
||||
isAutopilotAbility: Boolean,
|
||||
unableAutopilotReasons: ArrayList<UnableAutopilotReason>?
|
||||
) {
|
||||
if (unableAutopilotReasons != null && unableAutopilotReasons.size > 0) {
|
||||
autopilotAbilityCheck(isAutopilotAbility, unableAutopilotReasons.toString())
|
||||
}
|
||||
invokeAutopilotAbility(isAutopilotAbility, unableAutopilotReasons)
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_TYPE_SOCKET_AUTOPILOT,
|
||||
linkCode = CHAIN_SOURCE_ADAS,
|
||||
nodeAliasCode = CHAIN_CODE_ADAS_ABILITY,
|
||||
paramIndexes = [0, 1]
|
||||
)
|
||||
private fun autopilotAbilityCheck(isAutopilotAbility: Boolean, reason: String) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.cloud.IMoGoCloudListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotActionsListenerManager
|
||||
import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
@@ -37,13 +38,11 @@ class MoGoAdasMsgConnectStatusListenerImpl :
|
||||
|
||||
init {
|
||||
CallerCloudListenerManager.addListener(TAG, this)
|
||||
CallerAutopilotActionsListenerManager.setConnected(AdasManager.getInstance().ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.CONNECTED)
|
||||
}
|
||||
|
||||
override fun onConnectionIPCStatus(ipcConnectionStatus: Int, reason: String?) {
|
||||
CallerAutoPilotStatusListenerManager.invokeAutoPilotIPCStatusChanged(
|
||||
ipcConnectionStatus,
|
||||
reason
|
||||
)
|
||||
CallerAutopilotActionsListenerManager.setConnected(ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.CONNECTED)
|
||||
AppConfigInfo.connectStatusDescribe = reason
|
||||
when (ipcConnectionStatus) {
|
||||
Constants.IPC_CONNECTION_STATUS.CONNECTED -> {
|
||||
@@ -100,6 +99,7 @@ class MoGoAdasMsgConnectStatusListenerImpl :
|
||||
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().ipcConnStatus = ipcConnectionStatus
|
||||
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().connectStatusDescribe = reason
|
||||
CallerAutoPilotStatusListenerManager.invokeAutoPilotStatus()
|
||||
CallerAutoPilotStatusListenerManager.invokeAutoPilotIPCStatusChanged(ipcConnectionStatus, reason)
|
||||
}
|
||||
|
||||
override fun onCompatibility(versionCompatibility: VersionCompatibility?) {
|
||||
|
||||
@@ -41,6 +41,7 @@ object MoGoLocationDispatcher :
|
||||
/**
|
||||
* 最后一次高德定位返回的位置信息
|
||||
*/
|
||||
@Volatile
|
||||
private var lastGaoDeLocation: MogoLocation = MogoLocation()
|
||||
|
||||
fun initListener() {
|
||||
|
||||
@@ -2,18 +2,20 @@ package com.mogo.eagle.core.function.datacenter.obu
|
||||
|
||||
import android.content.Context
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.data.enums.CommunicationType
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
import com.mogo.eagle.core.data.enums.TrafficLightEnum
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
|
||||
import com.mogo.eagle.core.data.obu.MogoObuConst
|
||||
import com.mogo.eagle.core.function.api.datacenter.obu.IMoGoObuWarningMapListener
|
||||
import com.mogo.eagle.core.function.api.datacenter.obu.IMoGoObuWarningRsiListener
|
||||
import com.mogo.eagle.core.function.api.datacenter.obu.IMoGoObuWarningRsmListener
|
||||
import com.mogo.eagle.core.function.api.datacenter.obu.IMoGoObuWarningSpatListener
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.*
|
||||
import com.mogo.eagle.core.function.api.map.angle.*
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.map.*
|
||||
import com.mogo.eagle.core.function.call.obu.*
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||
@@ -292,11 +294,11 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
|
||||
}
|
||||
//大于10m,才提示rsi,超速不限制
|
||||
if (appId == "6666") {
|
||||
saveObuToDcData(appId, alertContent, ttsContent)
|
||||
saveObuToDcData(appId, alertContent, ttsContent,CommunicationType.V2I)
|
||||
showWarning(appId, alertContent, ttsContent, direction)
|
||||
} else {
|
||||
if (Math.round(rsiWarningData.warningMsgList[0].distance) > 10) {
|
||||
saveObuToDcData(appId, alertContent, ttsContent)
|
||||
saveObuToDcData(appId, alertContent, ttsContent,CommunicationType.V2I)
|
||||
showWarning(appId, alertContent, ttsContent, direction)
|
||||
}
|
||||
}
|
||||
@@ -304,7 +306,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
|
||||
|
||||
MogoObuShowConstants.STATUS.UPDATE -> { // 更新
|
||||
if(EventTypeEnumNew.TYPE_USECASE_ID_SLW.poiType == appId){
|
||||
saveObuToDcData(appId, alertContent, ttsContent)
|
||||
saveObuToDcData(appId, alertContent, ttsContent,CommunicationType.V2I)
|
||||
showWarning(appId, alertContent, ttsContent, direction)
|
||||
}
|
||||
}
|
||||
@@ -396,8 +398,18 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
|
||||
if (alertContent.isEmpty() || ttsContent.isEmpty()) {
|
||||
return
|
||||
}
|
||||
saveObuToDcData(v2xType, alertContent, ttsContent)
|
||||
showWarning(v2xType, alertContent, ttsContent, direction)
|
||||
saveObuToDcData(v2xType, alertContent, ttsContent,CommunicationType.V2I)
|
||||
showWarning(v2xType, alertContent, ttsContent, direction, object : IMoGoWarningStatusListener {
|
||||
|
||||
override fun onShow() {
|
||||
CallerVisualAngleManager.changeAngle(CrossRoad(true))
|
||||
}
|
||||
|
||||
override fun onDismiss() {
|
||||
super.onDismiss()
|
||||
CallerVisualAngleManager.changeAngle(CrossRoad(false))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
MogoObuShowConstants.STATUS.UPDATE -> {// 更新
|
||||
@@ -566,7 +578,8 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
|
||||
saveObuToDcData(
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
|
||||
alertContent,
|
||||
ttsContent
|
||||
ttsContent,
|
||||
CommunicationType.V2I
|
||||
)
|
||||
showWarning(
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
|
||||
@@ -608,7 +621,8 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
|
||||
saveObuToDcData(
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
alertContentNew,
|
||||
ttsContentNew
|
||||
ttsContentNew,
|
||||
CommunicationType.V2I
|
||||
)
|
||||
showWarning(
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
@@ -664,12 +678,13 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
|
||||
/**
|
||||
* 保存obu通过工控机传输的数据到消息盒子
|
||||
*/
|
||||
private fun saveObuToDcData(type: String, content: String, tts: String) {
|
||||
private fun saveObuToDcData(type: String, content: String, tts: String,communicationType: CommunicationType) {
|
||||
CallerObuSaveMessageListenerManager.invokeObuSaveMessage(
|
||||
type,
|
||||
content,
|
||||
tts,
|
||||
DataSourceType.TELEMATIC
|
||||
DataSourceType.TELEMATIC,
|
||||
communicationType
|
||||
)
|
||||
}
|
||||
|
||||
@@ -680,9 +695,10 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
|
||||
type: String,
|
||||
content: String,
|
||||
tts: String,
|
||||
direction: WarningDirectionEnum
|
||||
direction: WarningDirectionEnum,
|
||||
listener: IMoGoWarningStatusListener? = null
|
||||
) {
|
||||
CallerHmiManager.warningV2X(type, content, tts, null, direction, isFromObu = true)
|
||||
CallerHmiManager.warningV2X(type, content, tts, listener, direction, isFromObu = true)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,8 +7,7 @@ import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.data.enums.*
|
||||
import com.mogo.eagle.core.data.obu.MogoObuConst
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.api.map.angle.Default
|
||||
import com.mogo.eagle.core.function.api.map.angle.TooClose
|
||||
import com.mogo.eagle.core.function.api.map.angle.*
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
@@ -578,11 +577,11 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
|
||||
}
|
||||
//大于10m,才提示rsi。超速不限制
|
||||
if (appId == "6666") {
|
||||
saveObuData(appId, alertContent, ttsContent)
|
||||
saveObuData(appId, alertContent, ttsContent,CommunicationType.V2I)
|
||||
showWarning(appId, alertContent, ttsContent, direction)
|
||||
} else {
|
||||
if (Math.round(data.warningMsgList[0].distance) > 10) {
|
||||
saveObuData(appId, alertContent, ttsContent)
|
||||
saveObuData(appId, alertContent, ttsContent,CommunicationType.V2I)
|
||||
showWarning(appId, alertContent, ttsContent, direction)
|
||||
}
|
||||
}
|
||||
@@ -596,7 +595,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
|
||||
|
||||
MogoObuShowConstants.STATUS.UPDATE -> { // 更新
|
||||
if(EventTypeEnumNew.TYPE_USECASE_ID_SLW.poiType == appId){
|
||||
saveObuData(appId, alertContent, ttsContent)
|
||||
saveObuData(appId, alertContent, ttsContent,CommunicationType.V2I)
|
||||
showWarning(appId, alertContent, ttsContent, direction)
|
||||
}
|
||||
}
|
||||
@@ -702,7 +701,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
|
||||
if (alertContent.isEmpty() || ttsContent.isEmpty()) {
|
||||
return
|
||||
}
|
||||
saveObuData(v2xType, alertContent, ttsContent)
|
||||
saveObuData(v2xType, alertContent, ttsContent,CommunicationType.V2I)
|
||||
showWarning(v2xType, alertContent, ttsContent, direction)
|
||||
}
|
||||
|
||||
@@ -803,7 +802,6 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
|
||||
var alertContent = ""
|
||||
var ttsContent = ""
|
||||
var v2xType = appId
|
||||
var changeVisualAngle = false
|
||||
when (appId) {
|
||||
//前向碰撞预警
|
||||
MogoObuShowConstants.V2X_WARNING_TYPE.FCW.toString() -> {
|
||||
@@ -849,7 +847,6 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT
|
||||
) { //左后
|
||||
changeVisualAngle = true
|
||||
ttsContent = String.format(ttsContent, "左")
|
||||
alertContent = String.format(alertContent, "左")
|
||||
} else if (
|
||||
@@ -857,7 +854,6 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT
|
||||
) { //右后
|
||||
changeVisualAngle = true
|
||||
ttsContent = String.format(ttsContent, "右")
|
||||
alertContent = String.format(alertContent, "右")
|
||||
}
|
||||
@@ -945,21 +941,22 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
|
||||
)
|
||||
if (level == 2 || level == 3) {
|
||||
//不显示弹框,其它保留
|
||||
saveObuData(v2xType, alertContent, ttsContent)
|
||||
saveObuData(v2xType, alertContent, ttsContent,CommunicationType.V2V)
|
||||
CallerHmiManager.warningV2X(v2xType,
|
||||
alertContent,
|
||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {
|
||||
super.onShow()
|
||||
if (changeVisualAngle) {
|
||||
CallerVisualAngleManager.changeAngle(TooClose)
|
||||
if (appId == MogoObuShowConstants.V2X_WARNING_TYPE.BSW.toString()) {
|
||||
//盲区预警,展示近视角
|
||||
CallerVisualAngleManager.changeAngle(CrossRoad(true))
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDismiss() {
|
||||
if (changeVisualAngle) {
|
||||
CallerVisualAngleManager.changeAngle(Default())
|
||||
if (appId == MogoObuShowConstants.V2X_WARNING_TYPE.BSW.toString()) {
|
||||
//盲区预警,取消近视角
|
||||
CallerVisualAngleManager.changeAngle(CrossRoad(false))
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1055,7 +1052,8 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
|
||||
saveObuData(
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
|
||||
alertContent,
|
||||
ttsContent
|
||||
ttsContent,
|
||||
CommunicationType.V2I
|
||||
)
|
||||
showWarning(
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
|
||||
@@ -1106,7 +1104,8 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
|
||||
saveObuData(
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
alertContentNew,
|
||||
ttsContentNew
|
||||
ttsContentNew,
|
||||
CommunicationType.V2I
|
||||
)
|
||||
showWarning(
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
@@ -1162,12 +1161,13 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
|
||||
/**
|
||||
* 保存obu直连数据到消息盒子
|
||||
*/
|
||||
private fun saveObuData(type: String, content: String, tts: String) {
|
||||
private fun saveObuData(type: String, content: String, tts: String,communicationType: CommunicationType) {
|
||||
CallerObuSaveMessageListenerManager.invokeObuSaveMessage(
|
||||
type,
|
||||
content,
|
||||
tts,
|
||||
DataSourceType.OBU
|
||||
DataSourceType.OBU,
|
||||
communicationType
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import perception.TrafficLightOuterClass
|
||||
import perception.TrafficLightOuterClass.TrafficLight
|
||||
@@ -65,7 +66,8 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
|
||||
//obu数据
|
||||
@Volatile
|
||||
private var hasObuLightStatus: Boolean = false
|
||||
|
||||
//红绿灯定时器,超时未更新隐藏红绿灯
|
||||
@Volatile
|
||||
private var lightCountDownTimer: CountDownTimer? = null
|
||||
private var lastLightTime: Long = System.currentTimeMillis()
|
||||
|
||||
@@ -88,28 +90,6 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
|
||||
)
|
||||
if (!hasObuLightStatus) {
|
||||
if (!hasAiLightStatus) {
|
||||
|
||||
lastLightTime = System.currentTimeMillis()
|
||||
if (lightCountDownTimer == null) {
|
||||
lightCountDownTimer = object : CountDownTimer(300000, 1000) {
|
||||
override fun onTick(millisUntilFinished: Long) {
|
||||
if ((System.currentTimeMillis() - lastLightTime) > 1000) {
|
||||
//隐藏红绿灯显示
|
||||
hide("感知倒计时结束隐藏", DataSourceType.TELEMATIC)
|
||||
lightCountDownTimer?.cancel()
|
||||
lightCountDownTimer = null
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFinish() {
|
||||
lightCountDownTimer?.cancel()
|
||||
lightCountDownTimer = null
|
||||
}
|
||||
|
||||
}
|
||||
lightCountDownTimer?.start()
|
||||
}
|
||||
|
||||
trafficLights?.let { it ->
|
||||
var light: TrafficLight? = null
|
||||
if (it.hasStraight()) {
|
||||
@@ -232,7 +212,7 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
|
||||
}
|
||||
|
||||
/**
|
||||
* 红绿灯数据
|
||||
* OBU红绿灯数据
|
||||
*/
|
||||
@ChainLog(
|
||||
linkChainLog = ChainConstant.CHAIN_TYPE_SOCKET_TRAFFIC_LIGHT,
|
||||
@@ -253,6 +233,33 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
|
||||
"${SceneConstant.M_D_C}${TAG}",
|
||||
"onTrafficLightPlusSource ----- light = $light ---remain = $remain ---lightSource = $lightSource ---hasObuLightStatus = $hasObuLightStatus ---hasAiLightStatus = $hasAiLightStatus"
|
||||
)
|
||||
|
||||
//倒计时,超时还未更新数据则隐藏红绿灯
|
||||
lastLightTime = System.currentTimeMillis()
|
||||
if (lightCountDownTimer == null) {
|
||||
UiThreadHandler.post{
|
||||
lightCountDownTimer = object : CountDownTimer(300000, 1000) {
|
||||
override fun onTick(millisUntilFinished: Long) {
|
||||
if ((System.currentTimeMillis() - lastLightTime) > 1500) {
|
||||
//隐藏红绿灯显示
|
||||
hide("倒计时结束隐藏", lightSource)
|
||||
lightCountDownTimer?.cancel()
|
||||
lightCountDownTimer = null
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFinish() {
|
||||
//隐藏红绿灯显示
|
||||
hide("倒计时结束隐藏", lightSource)
|
||||
lightCountDownTimer?.cancel()
|
||||
lightCountDownTimer = null
|
||||
}
|
||||
|
||||
}
|
||||
lightCountDownTimer?.start()
|
||||
}
|
||||
}
|
||||
|
||||
CallerTrafficLightListenerManager.showTrafficLight(light, lightSource)
|
||||
if (remain == -1) {
|
||||
CallerTrafficLightListenerManager.disableTrafficLightCountDown()
|
||||
|
||||
@@ -71,7 +71,7 @@ android {
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation rootProject.ext.dependencies.kotlinstdlibjdk7
|
||||
implementation rootProject.ext.dependencies.kotlinstdlib
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
implementation rootProject.ext.dependencies.mogologlib
|
||||
@@ -87,8 +87,6 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.androidxrecyclerview
|
||||
implementation rootProject.ext.dependencies.flexbox
|
||||
implementation rootProject.ext.dependencies.androidautoSize
|
||||
implementation rootProject.ext.dependencies.koomnative
|
||||
implementation rootProject.ext.dependencies.koomxhook
|
||||
implementation rootProject.ext.dependencies.mofang_runtime
|
||||
implementation rootProject.ext.dependencies.log_runtime
|
||||
implementation group: "com.tencent.matrix", name: "matrix-android-lib", version: MATRIX_VERSION, changing: true
|
||||
@@ -97,6 +95,8 @@ dependencies {
|
||||
implementation group: "com.tencent.matrix", name: "matrix-io-canary", version: MATRIX_VERSION, changing: true
|
||||
implementation group: "com.tencent.matrix", name: "matrix-hooks", version: MATRIX_VERSION, changing: true
|
||||
implementation rootProject.ext.dependencies.weak_network
|
||||
// implementation rootProject.ext.dependencies.btrace
|
||||
api rootProject.ext.dependencies.block_detector
|
||||
|
||||
implementation project(':foudations:mogo-commons')
|
||||
implementation project(':core:mogo-core-utils')
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.mogo.eagle.core.data.deva.scene.SceneTAG
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.function.api.devatools.IDevaToolsProvider
|
||||
import com.mogo.eagle.core.function.api.devatools.apm.*
|
||||
import com.mogo.eagle.core.function.api.devatools.block.*
|
||||
import com.mogo.eagle.core.function.api.devatools.strict.*
|
||||
import com.mogo.eagle.core.function.api.devatools.download.*
|
||||
import com.mogo.eagle.core.function.api.devatools.logcat.*
|
||||
@@ -40,10 +41,10 @@ import com.mogo.weak.network.SdtManager
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.BadCaseManager
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
||||
import com.zhjt.mogo_core_function_devatools.binding.*
|
||||
import com.zhjt.mogo_core_function_devatools.block.*
|
||||
import com.zhjt.mogo_core_function_devatools.env.EnvChangeManager
|
||||
import com.zhjt.mogo_core_function_devatools.funcconfig.FuncConfigCenter.Companion.bizConfigCenter
|
||||
import com.zhjt.mogo_core_function_devatools.funcconfig.FuncConfigImpl
|
||||
import com.zhjt.mogo_core_function_devatools.koom.KoomInitTask
|
||||
import com.zhjt.mogo_core_function_devatools.logcat.*
|
||||
import com.zhjt.mogo_core_function_devatools.logcatch.MogoLogCatchManager
|
||||
import com.zhjt.mogo_core_function_devatools.lookaround.*
|
||||
@@ -83,6 +84,8 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
|
||||
private val logRecordProvider by lazy { MoGoLogRecordProviderImpl() }
|
||||
|
||||
private val block by lazy { MoGoBlockProviderImpl() }
|
||||
|
||||
@Volatile
|
||||
private var mDockerVersion: String? = null
|
||||
|
||||
@@ -94,7 +97,6 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
//链路相关
|
||||
traceManager.init(mContext!!)
|
||||
if (DebugConfig.isDebug()) {
|
||||
KoomInitTask.init(AbsMogoApplication.getApp())
|
||||
initMatrix()
|
||||
}
|
||||
ttsManager.initTts(mContext!!) //todo 扶风 优化
|
||||
@@ -122,6 +124,11 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
logRecordProvider.init(it)
|
||||
logRecordProvider.start()
|
||||
}
|
||||
|
||||
mContext?.also {
|
||||
block.init(it)
|
||||
block.start()
|
||||
}
|
||||
}
|
||||
|
||||
override fun checkMonitorDb() {
|
||||
@@ -285,6 +292,10 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
iPCReportManager.showReportListWindow(context, isShow)
|
||||
}
|
||||
|
||||
override fun getReportWindowStatus(): Boolean {
|
||||
return iPCReportManager.getReportWindowStatus()
|
||||
}
|
||||
|
||||
override fun downLoadPackage(type: DownloadType, downloadKey: String, downloadUrl: String) {
|
||||
upgradeManager.downLoadPackage(mContext!!,type, downloadKey, downloadUrl)
|
||||
}
|
||||
@@ -377,4 +388,6 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
override fun mofang(): IMoGoMoFangProvider = mofangProvider
|
||||
|
||||
override fun logRecord(): IMoGoLogRecordProvider = logRecordProvider
|
||||
|
||||
override fun block(): IMoGoBlockProvider? = null
|
||||
}
|
||||
@@ -6,7 +6,6 @@ import android.graphics.Color
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.os.Handler
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -19,6 +18,8 @@ import com.mogo.eagle.core.data.deva.badcase.SubBagEntity
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.zhidao.loglib.download.DownloadManager
|
||||
@@ -116,7 +117,7 @@ class BadCaseManagerView @JvmOverloads constructor(
|
||||
if(bagManagerList.size>0){
|
||||
bagManagerEntity.reqType = 3
|
||||
bagManagerEntity.keyReq = bagManagerList[0].key
|
||||
Log.i("sendBagManagerCmd","bagManagerEntity.keyReq="+bagManagerEntity.keyReq)
|
||||
CallerLogger.i(M_DEVA+"sendBagManagerCmd","bagManagerEntity.keyReq="+bagManagerEntity.keyReq)
|
||||
CallerAutoPilotControlManager.sendBagManagerCmd(bagManagerEntity)
|
||||
|
||||
bagUploadDialog = BagUploadDialog(context)
|
||||
@@ -237,24 +238,24 @@ class BadCaseManagerView @JvmOverloads constructor(
|
||||
override fun onBagManagerResult(bagManager: BagManagerOuterClass.BagManager) {
|
||||
super.onBagManagerResult(bagManager)
|
||||
UiThreadHandler.post {
|
||||
Log.i(TAG,"onBagManagerResult Start")
|
||||
Log.i(TAG,"keyReq="+bagManager.keyReq)
|
||||
Log.i(TAG,"reqType="+bagManager.reqType)
|
||||
Log.i(TAG,"uploadCosResp stat="+bagManager.uploadCosResp.stat)
|
||||
Log.i(TAG,"descReq description="+bagManager.descReq.description
|
||||
CallerLogger.i(M_DEVA + TAG,"onBagManagerResult Start")
|
||||
CallerLogger.i(M_DEVA + TAG,"keyReq="+bagManager.keyReq)
|
||||
CallerLogger.i(M_DEVA + TAG,"reqType="+bagManager.reqType)
|
||||
CallerLogger.i(M_DEVA + TAG,"uploadCosResp stat="+bagManager.uploadCosResp.stat)
|
||||
CallerLogger.i(M_DEVA + TAG,"descReq description="+bagManager.descReq.description
|
||||
+" audioUrl="+bagManager.descReq.audioUrl
|
||||
+" reportBI="+bagManager.descReq.reportBI
|
||||
+" hasAudio="+bagManager.descReq.hasAudio)
|
||||
for(logBag in bagManager.bagsInfoRespList){
|
||||
Log.i(TAG,"bagPath="+logBag.bagPath)
|
||||
Log.i(TAG,"timestamp="+logBag.timestamp)
|
||||
Log.i(TAG,"description="+logBag.description)
|
||||
Log.i(TAG,"key="+logBag.key)
|
||||
Log.i(TAG,"mergeStat="+logBag.mergeStat)
|
||||
Log.i(TAG,"totalSize="+logBag.totalSize)
|
||||
Log.i(TAG,"uploadStat="+logBag.uploadStat)
|
||||
CallerLogger.i(M_DEVA + TAG,"bagPath="+logBag.bagPath)
|
||||
CallerLogger.i(M_DEVA + TAG,"timestamp="+logBag.timestamp)
|
||||
CallerLogger.i(M_DEVA + TAG,"description="+logBag.description)
|
||||
CallerLogger.i(M_DEVA + TAG,"key="+logBag.key)
|
||||
CallerLogger.i(M_DEVA + TAG,"mergeStat="+logBag.mergeStat)
|
||||
CallerLogger.i(M_DEVA + TAG,"totalSize="+logBag.totalSize)
|
||||
CallerLogger.i(M_DEVA + TAG,"uploadStat="+logBag.uploadStat)
|
||||
}
|
||||
Log.i(TAG,"onBagManagerResult End")
|
||||
CallerLogger.i(M_DEVA + TAG,"onBagManagerResult End")
|
||||
|
||||
//获取空间使用信息
|
||||
if(bagManager.reqType == 1){
|
||||
@@ -367,7 +368,7 @@ class BadCaseManagerView @JvmOverloads constructor(
|
||||
//执行下一个上传Bag命令
|
||||
bagManagerEntity.reqType = 3
|
||||
bagManagerEntity.keyReq = bagManagerList[0].key
|
||||
Log.i("sendBagManagerCmd","bagManagerEntity.keyReq="+bagManagerEntity.keyReq)
|
||||
CallerLogger.i("sendBagManagerCmd","bagManagerEntity.keyReq="+bagManagerEntity.keyReq)
|
||||
CallerAutoPilotControlManager.sendBagManagerCmd(bagManagerEntity)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ import com.mogo.eagle.core.utilcode.util.TimeUtils.millis2String
|
||||
import com.zhidao.loglib.call.LogInfoManagerFactory
|
||||
import com.zhidao.loglib.upload.OnUploadListener
|
||||
import com.zhidao.loglib.upload.UploadManager
|
||||
import com.zhidao.loglib.util.FileUtil
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.BadCaseAnalyticsManager
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.BadCaseManager
|
||||
@@ -249,14 +250,18 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
val singlePath = "/mnt/sdcard/mogo/DataCollection/${audioFileName}.wav"
|
||||
val file = File(singlePath)
|
||||
if(file.exists()){
|
||||
LogInfoManagerFactory.createAudioUpload(mActivity.applicationContext,"Audio",singlePath,
|
||||
LogInfoManagerFactory.createAudioUpload(mActivity.applicationContext,
|
||||
TAG, MoGoAiCloudClientConfig.getInstance().sn,singlePath,
|
||||
object : OnUploadListener {
|
||||
override fun onUploadSuccess(filePath: String, downloadUrl: String) {
|
||||
override fun onUploadSuccess(key: String, filePath: String, downloadUrl: String) {
|
||||
CallerLogger.d("$M_DEVA$TAG", "语音文件上传成功:downloadUrl=$downloadUrl")
|
||||
//将语音文件上传Cos监听移除
|
||||
removeUploadListener(singlePath)
|
||||
//上传到服务器
|
||||
upload(downloadUrl)
|
||||
if(key == TAG){
|
||||
FileUtil.deleteFile(File(filePath))
|
||||
}
|
||||
}
|
||||
|
||||
override fun onUploadFail(filePath: String) {
|
||||
|
||||
@@ -40,6 +40,7 @@ import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import com.zhidao.loglib.upload.UploadManager
|
||||
import com.zhidao.loglib.util.FileUtil
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.BadCaseAnalyticsManager
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
@@ -211,14 +212,18 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
val singlePath = "/mnt/sdcard/mogo/DataCollection/${audioFileName}.wav"
|
||||
val file = File(singlePath)
|
||||
if(file.exists()){
|
||||
LogInfoManagerFactory.createAudioUpload(mActivity.applicationContext,"Audio",singlePath,
|
||||
LogInfoManagerFactory.createAudioUpload(mActivity.applicationContext,
|
||||
TAG, MoGoAiCloudClientConfig.getInstance().sn,singlePath,
|
||||
object : OnUploadListener {
|
||||
override fun onUploadSuccess(filePath: String, downloadUrl: String) {
|
||||
override fun onUploadSuccess(key: String, filePath: String, downloadUrl: String) {
|
||||
CallerLogger.d("$M_DEVA$TAG", "语音文件上传成功:downloadUrl=$downloadUrl")
|
||||
//将语音文件上传Cos监听移除
|
||||
removeUploadListener(singlePath)
|
||||
//上传到服务器
|
||||
upload(downloadUrl)
|
||||
if(key == TAG){
|
||||
FileUtil.deleteFile(File(filePath))
|
||||
}
|
||||
}
|
||||
|
||||
override fun onUploadFail(filePath: String) {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.record;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_DEVA;
|
||||
|
||||
import android.media.AudioRecord;
|
||||
import android.media.MediaRecorder;
|
||||
import android.os.Environment;
|
||||
@@ -164,8 +166,7 @@ public class RecordHelper {
|
||||
mp3EncodeThread = new Mp3EncodeThread(resultFile, bufferSize, currentConfig);
|
||||
mp3EncodeThread.start();
|
||||
} catch (Exception e) {
|
||||
// Log.e(e, TAG, e.getMessage());
|
||||
CallerLogger.INSTANCE.d("$M_DEVA$TAG", e.getMessage());
|
||||
CallerLogger.d(M_DEVA+TAG, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,14 +177,14 @@ public class RecordHelper {
|
||||
AudioRecordThread() {
|
||||
bufferSize = AudioRecord.getMinBufferSize(currentConfig.getSampleRate(),
|
||||
currentConfig.getChannelConfig(), currentConfig.getEncodingConfig()) * RECORD_AUDIO_BUFFER_TIMES;
|
||||
CallerLogger.INSTANCE.d("$M_DEVA$TAG", "record buffer size = %s", bufferSize);
|
||||
CallerLogger.d("$M_DEVA$TAG", "record buffer size = %s", bufferSize);
|
||||
audioRecord = new AudioRecord(MediaRecorder.AudioSource.MIC, currentConfig.getSampleRate(),
|
||||
currentConfig.getChannelConfig(), currentConfig.getEncodingConfig(), bufferSize);
|
||||
if (currentConfig.getFormat() == RecordConfig.RecordFormat.MP3) {
|
||||
if (mp3EncodeThread == null) {
|
||||
initMp3EncoderThread(bufferSize);
|
||||
} else {
|
||||
CallerLogger.INSTANCE.e("$M_DEVA$TAG", "mp3EncodeThread != null, 请检查代码");
|
||||
CallerLogger.e("$M_DEVA$TAG", "mp3EncodeThread != null, 请检查代码");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -205,7 +206,7 @@ public class RecordHelper {
|
||||
private void startPcmRecorder() {
|
||||
state = RecordState.RECORDING;
|
||||
notifyState();
|
||||
CallerLogger.INSTANCE.d("$M_DEVA$TAG", "开始录制 Pcm");
|
||||
CallerLogger.d("$M_DEVA$TAG", "开始录制 Pcm");
|
||||
FileOutputStream fos = null;
|
||||
try {
|
||||
fos = new FileOutputStream(tmpFile);
|
||||
@@ -223,7 +224,7 @@ public class RecordHelper {
|
||||
if (state == RecordState.STOP) {
|
||||
makeFile();
|
||||
} else {
|
||||
CallerLogger.INSTANCE.i("$M_DEVA$TAG", "暂停!");
|
||||
CallerLogger.i("$M_DEVA$TAG", "暂停!");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
notifyError("录音失败");
|
||||
@@ -239,7 +240,7 @@ public class RecordHelper {
|
||||
if (state != RecordState.PAUSE) {
|
||||
state = RecordState.IDLE;
|
||||
notifyState();
|
||||
CallerLogger.INSTANCE.d("$M_DEVA$TAG", "录音结束");
|
||||
CallerLogger.d("$M_DEVA$TAG", "录音结束");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,7 +268,7 @@ public class RecordHelper {
|
||||
notifyState();
|
||||
stopMp3Encoded();
|
||||
} else {
|
||||
CallerLogger.INSTANCE.d("$M_DEVA$TAG", "暂停");
|
||||
CallerLogger.d("$M_DEVA$TAG", "暂停");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -282,7 +283,7 @@ public class RecordHelper {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
CallerLogger.INSTANCE.e("$M_DEVA$TAG", "mp3EncodeThread is null, 代码业务流程有误,请检查!! ");
|
||||
CallerLogger.e("$M_DEVA$TAG", "mp3EncodeThread is null, 代码业务流程有误,请检查!! ");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -301,7 +302,7 @@ public class RecordHelper {
|
||||
break;
|
||||
}
|
||||
notifyFinish();
|
||||
CallerLogger.INSTANCE.i("$M_DEVA$TAG", "录音完成! path: %s ; 大小:%s", resultFile.getAbsoluteFile(), resultFile.length());
|
||||
CallerLogger.i("$M_DEVA$TAG", "录音完成! path: %s ; 大小:%s", resultFile.getAbsoluteFile(), resultFile.length());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -353,7 +354,7 @@ public class RecordHelper {
|
||||
inputStream.close();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, e.getMessage());
|
||||
CallerLogger.e(M_DEVA + TAG, e.getMessage());
|
||||
return false;
|
||||
} finally {
|
||||
try {
|
||||
@@ -376,7 +377,7 @@ public class RecordHelper {
|
||||
|
||||
private String getFilePath(String fileName) {
|
||||
if (!FileUtils.createOrExistsDir(ROOT_PATH)) {
|
||||
CallerLogger.INSTANCE.w("$M_DEVA$TAG", "文件夹创建失败:%s", ROOT_PATH);
|
||||
CallerLogger.w("$M_DEVA$TAG", "文件夹创建失败:%s", ROOT_PATH);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -387,7 +388,7 @@ public class RecordHelper {
|
||||
|
||||
private String getTempFilePath() {
|
||||
if (!FileUtils.createOrExistsDir(TEMP_PATH)) {
|
||||
CallerLogger.INSTANCE.e("$M_DEVA$TAG", "文件夹创建失败:%s", TEMP_PATH);
|
||||
CallerLogger.e("$M_DEVA$TAG", "文件夹创建失败:%s", TEMP_PATH);
|
||||
}
|
||||
String fileName = String.format(Locale.getDefault(), "tmp_%s", FileUtils.getNowString(new SimpleDateFormat("yyyyMMddHHmmssSSS", Locale.SIMPLIFIED_CHINESE)));
|
||||
return String.format(Locale.getDefault(), "%s%s.pcm", TEMP_PATH, fileName);
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.record.mp3;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_DEVA;
|
||||
|
||||
import android.media.MediaExtractor;
|
||||
import android.media.MediaFormat;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.FileUtils;
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.record.RecordConfig;
|
||||
|
||||
@@ -34,7 +36,7 @@ public class Mp3Utils {
|
||||
long duration = mf.getLong(MediaFormat.KEY_DURATION) / 1000L;
|
||||
return duration;
|
||||
} catch (IOException e) {
|
||||
Log.e(TAG, e.getMessage());
|
||||
CallerLogger.e(M_DEVA +TAG, e.getMessage());
|
||||
} finally {
|
||||
if (mex != null) {
|
||||
mex.release();
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.zhjt.mogo_core_function_devatools.binding
|
||||
import android.annotation.*
|
||||
import android.content.Context
|
||||
import android.text.TextUtils
|
||||
import android.util.*
|
||||
import com.elegant.utils.UiThreadHandler
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.commons.constants.SharedPrefsConstants
|
||||
@@ -18,7 +17,7 @@ import com.mogo.eagle.core.function.call.obu.CallerObuApiManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils.isDriver
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils.isPassenger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.zhjt.mogo_core_function_devatools.upgrade.IPCUpgradeManager.Companion.ipcUpgradeManager
|
||||
import com.zhjt.mogo_core_function_devatools.upgrade.ObuUpgradeAppNetWorkManager
|
||||
@@ -61,9 +60,9 @@ object BindingCarManager : IMoGoAutopilotCarConfigListener {
|
||||
}
|
||||
|
||||
override fun onAutopilotCarConfig(carConfigResp: MessagePad.CarConfigResp) {
|
||||
CallerLogger.d("${SceneConstant.M_DEVA}${TAG}", "onAutopilotCarConfig ----------> ")
|
||||
CallerLogger.d("${M_DEVA}${TAG}", "onAutopilotCarConfig ----------> ")
|
||||
if (!TextUtils.isEmpty(carConfigResp.macAddress)) {
|
||||
CallerLogger.d("${SceneConstant.M_DEVA}${TAG}",
|
||||
CallerLogger.d("${M_DEVA}${TAG}",
|
||||
"onAutopilotCarConfig carConfigResp.macAddress = ${carConfigResp.macAddress} ")
|
||||
getBindingCarInfo(carConfigResp.macAddress, MoGoAiCloudClientConfig.getInstance().sn)
|
||||
}
|
||||
@@ -89,7 +88,7 @@ object BindingCarManager : IMoGoAutopilotCarConfigListener {
|
||||
queryObuUpgrade(obuVersion)
|
||||
}
|
||||
}
|
||||
CallerLogger.d("${SceneConstant.M_DEVA}${TAG}",
|
||||
CallerLogger.d("${M_DEVA}${TAG}",
|
||||
"getBindingcarInfo macAddress = $macAddress--widevineIDWithMd5 = $widevineIDWithMd5 ---screenType = $screenType"
|
||||
)
|
||||
SharedPrefsMgr.getInstance(mContext!!).putString(SharedPrefsConstants.APP_MAC, macAddress)
|
||||
@@ -179,10 +178,10 @@ object BindingCarManager : IMoGoAutopilotCarConfigListener {
|
||||
* 查询app是否需要升级
|
||||
*/
|
||||
fun queryAppUpgrade() {
|
||||
Log.d("UPGRADE", "---- 1 ----")
|
||||
CallerLogger.d(M_DEVA+"UPGRADE", "---- 1 ----")
|
||||
var macAddress = mAddress
|
||||
if (TextUtils.isEmpty(macAddress)) {
|
||||
Log.d("UPGRADE", "---- 2 ----")
|
||||
CallerLogger.d(M_DEVA+"UPGRADE", "---- 2 ----")
|
||||
macAddress = SharedPrefsMgr.getInstance(mContext!!)
|
||||
.getString(SharedPrefsConstants.APP_MAC)
|
||||
}
|
||||
@@ -190,7 +189,7 @@ object BindingCarManager : IMoGoAutopilotCarConfigListener {
|
||||
if (!TextUtils.equals(macAddress, mAddress)) {
|
||||
mAddress = macAddress
|
||||
}
|
||||
Log.d("UPGRADE", "---- 3 ----[mac: $macAddress]")
|
||||
CallerLogger.d(M_DEVA+"UPGRADE", "---- 3 ----[mac: $macAddress]")
|
||||
UpgradeAppNetWorkManager.instance
|
||||
?.getAppUpgradeInfo(mContext, macAddress, role.toString() + "")
|
||||
}
|
||||
@@ -202,9 +201,9 @@ object BindingCarManager : IMoGoAutopilotCarConfigListener {
|
||||
*/
|
||||
fun queryObuUpgrade(obuVersionName: String) {
|
||||
mObuVersion = obuVersionName
|
||||
CallerLogger.d("${SceneConstant.M_DEVA}${MogoObuConst.TAG_UPGRADE_OBU}", "screenType = $screenType ----role = $role")
|
||||
CallerLogger.d("${M_DEVA}${MogoObuConst.TAG_UPGRADE_OBU}", "screenType = $screenType ----role = $role")
|
||||
if (screenType == 1) {
|
||||
CallerLogger.d("${SceneConstant.M_DEVA}${MogoObuConst.TAG_UPGRADE_OBU}","queryObuUpgrade isConnected = ${CallerObuApiManager.isConnected()} --- mAddress = $mAddress")
|
||||
CallerLogger.d("${M_DEVA}${MogoObuConst.TAG_UPGRADE_OBU}","queryObuUpgrade isConnected = ${CallerObuApiManager.isConnected()} --- mAddress = $mAddress")
|
||||
ObuUpgradeAppNetWorkManager.instance?.getObuUpgradeInfo(if(!mAddress.isNullOrEmpty()) mAddress else SharedPrefsMgr.getInstance(mContext!!).getString(SharedPrefsConstants.APP_MAC), obuVersionName)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.zhjt.mogo_core_function_devatools.block
|
||||
|
||||
import com.mogo.eagle.core.data.deva.chain.*
|
||||
import com.zhjt.service.chain.*
|
||||
|
||||
internal class MainBlockLinkedLog {
|
||||
|
||||
fun record(extra: Map<String, List<String>>) {
|
||||
try {
|
||||
recordInternal(extra)
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = ChainConstant.CHAIN_TYPE_HMI,
|
||||
linkCode = ChainConstant.CHAIN_SOURCE_HMI,
|
||||
nodeAliasCode = ChainConstant.CHAIN_CODE_MAIN_BLOCK,
|
||||
paramIndexes = [0]
|
||||
)
|
||||
private fun recordInternal(extra: Map<String, List<String>>) {}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.zhjt.mogo_core_function_devatools.block
|
||||
|
||||
import android.content.*
|
||||
import android.util.*
|
||||
import android.view.*
|
||||
import androidx.metrics.performance.*
|
||||
import com.mogo.eagle.core.block.runtime.*
|
||||
import com.mogo.eagle.core.block.runtime.config.*
|
||||
import com.mogo.eagle.core.block.runtime.config.recorder.*
|
||||
import com.mogo.eagle.core.block.runtime.config.recorder.IMessageRecorder.OnDumpListener
|
||||
import com.mogo.eagle.core.block.runtime.listener.*
|
||||
import com.mogo.eagle.core.block.runtime.report.*
|
||||
import com.mogo.eagle.core.function.api.devatools.block.*
|
||||
import java.util.concurrent.TimeUnit.SECONDS
|
||||
|
||||
internal class MoGoBlockProviderImpl: IMoGoBlockProvider, IBlockListener {
|
||||
|
||||
@Volatile
|
||||
private var hasInit = false
|
||||
|
||||
private val linkedLog by lazy { MainBlockLinkedLog() }
|
||||
|
||||
override fun init(ctx: Context) {
|
||||
BlockDetector.init(BlockMetrics.Builder()
|
||||
.context(ctx)
|
||||
.multiplier(2.0f)
|
||||
.isDebug(false)
|
||||
.period(5, SECONDS)
|
||||
.junkRateThreshold(0.8f)
|
||||
.recorder(null, 1000, 512)
|
||||
.build())
|
||||
hasInit = true
|
||||
}
|
||||
|
||||
override fun hasInit(): Boolean {
|
||||
return hasInit
|
||||
}
|
||||
|
||||
override fun start() {
|
||||
BlockDetector.start()
|
||||
BlockDetector.addListener(this)
|
||||
}
|
||||
|
||||
override fun onBlockReport(info: ReportInfo) {
|
||||
Log.d("BLOCK", "--- onBlockReport ---: ${info.frames.size}")
|
||||
val map = mutableMapOf<String, List<String>>()
|
||||
map["frames"] = info.frames.map { "$it" }
|
||||
BlockDetector.recorder().dump(object: OnDumpListener {
|
||||
override fun OnDumped(data: Map<Int, List<String>>) {
|
||||
map["history"] = data[0] ?: emptyList()
|
||||
map["pending"] = data[1] ?: emptyList()
|
||||
linkedLog.record(map)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun monitor(window: Window) {
|
||||
BlockDetector.monitor(window)
|
||||
}
|
||||
|
||||
override fun pause(window: Window) {
|
||||
BlockDetector.pause(window)
|
||||
}
|
||||
|
||||
override fun addState(window: Window, key: String, status: String) {
|
||||
val holder = PerformanceMetricsState.getHolderForHierarchy(window.decorView)
|
||||
holder.state?.putState(key, status)
|
||||
}
|
||||
|
||||
override fun resume(window: Window) {
|
||||
BlockDetector.resume(window)
|
||||
}
|
||||
|
||||
override fun pop(window: Window) {
|
||||
BlockDetector.pop(window)
|
||||
}
|
||||
|
||||
override fun stop() {
|
||||
BlockDetector.removeListener(this)
|
||||
BlockDetector.stop()
|
||||
}
|
||||
|
||||
override fun recorder(): IMessageRecorder {
|
||||
|
||||
return BlockDetector.recorder()
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package com.zhjt.mogo_core_function_devatools.koom
|
||||
|
||||
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() }
|
||||
}
|
||||
}
|
||||
@@ -1,25 +1,44 @@
|
||||
package com.zhjt.mogo_core_function_devatools.logcat
|
||||
|
||||
import android.content.*
|
||||
import android.os.Build
|
||||
import android.os.Process
|
||||
import android.util.*
|
||||
import android.os.SystemClock
|
||||
import android.util.Log
|
||||
import com.mogo.aicloud.services.socket.IMogoOnMessageListener
|
||||
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.core.log.record.*
|
||||
import com.mogo.core.log.record.config.*
|
||||
import com.mogo.core.log.record.config.crash.*
|
||||
import com.mogo.core.log.record.config.state.IStateProvider
|
||||
import com.mogo.core.log.record.model.UploadError
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.function.api.devatools.logcat.*
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.zhidao.loglib.bean.RemoteLogPushContent
|
||||
import com.zhjt.mogo_core_function_devatools.logcat.config.LogRecordConfig
|
||||
import com.zhjt.mogo_core_function_devatools.logcat.uploader.*
|
||||
import kotlinx.coroutines.*
|
||||
import java.io.*
|
||||
import java.util.concurrent.TimeUnit.MINUTES
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
import java.util.concurrent.atomic.AtomicLong
|
||||
|
||||
internal class MoGoLogRecordProviderImpl: IMoGoLogRecordProvider {
|
||||
internal class MoGoLogRecordProviderImpl: IMoGoLogRecordProvider,
|
||||
IMogoOnMessageListener<RemoteLogPushContent> {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "MoGoLogRecordProviderImpl"
|
||||
}
|
||||
|
||||
private val flag by lazy { AtomicBoolean(false) }
|
||||
|
||||
private val scope by lazy { CoroutineScope(Dispatchers.IO + SupervisorJob()) }
|
||||
|
||||
private val uploadThreshold by lazy { MINUTES.toMillis(1) } //全量日志的上传的安全时间,在此时间内,上传任务只会触发一次
|
||||
|
||||
private val lastUploadTime by lazy { AtomicLong(0) }
|
||||
|
||||
override fun init(context: Context) {
|
||||
val zipDir = File(context.getExternalFilesDir(null), "logcat/zip")
|
||||
LogcatManager.init(LogcatConfig.Builder().context(context)
|
||||
@@ -28,32 +47,121 @@ internal class MoGoLogRecordProviderImpl: IMoGoLogRecordProvider {
|
||||
.recordDir(File(context.getExternalFilesDir(null), "logcat"))
|
||||
.pid(Process.myPid())
|
||||
.generateZipDir(zipDir.absolutePath)
|
||||
.stateProvider(object : IStateProvider {
|
||||
override fun provide(divider:String?): Map<String, Any?> {
|
||||
return mutableMapOf<String, Any?>().also { itx ->
|
||||
itx["build_sdk_version"] = Build.VERSION.SDK_INT
|
||||
itx["build_device"] = Build.DEVICE
|
||||
itx["build_host"] = Build.HOST
|
||||
itx["build_id"] = Build.ID
|
||||
itx["build_host"] = Build.HOST
|
||||
itx["build_brand"] = Build.BRAND
|
||||
itx["build_model"] = Build.MODEL
|
||||
itx["build_product"] = Build.PRODUCT
|
||||
itx["build_board"] = Build.BOARD
|
||||
itx["build_bootloader"] = Build.BOOTLOADER
|
||||
itx["${divider}-1"] = divider
|
||||
itx["应用名称"] = AppConfigInfo.appName
|
||||
itx["应用版本名称"] = AppConfigInfo.appVersionName
|
||||
itx["应用版本号"] = AppConfigInfo.appVersionCode
|
||||
itx["渠道"] = AppConfigInfo.flavor
|
||||
itx["GIT分支"] = AppConfigInfo.workingBranchName
|
||||
itx["GIT分支HASH"] = AppConfigInfo.workingBranchHash
|
||||
itx["${divider}-2"] = divider
|
||||
itx["MAP-SDK版本"] = AppConfigInfo.mapSdkVersion
|
||||
itx["MAP-OPT-SDK版本"] = AppConfigInfo.mapSdkOptVersion
|
||||
itx["ADAS-SDK版本"] = AppConfigInfo.adasSdkVersion
|
||||
itx["${divider}-3"] = divider
|
||||
itx["OBU-SDk版本"] = AppConfigInfo.obuSdkVersion
|
||||
itx["OBU-INFO"] = AppConfigInfo.obuInfo
|
||||
itx["${divider}-4"] = divider
|
||||
itx["数字版权ID"] = AppConfigInfo.widevineIDMd5
|
||||
itx["设备唯一标识"] = AppConfigInfo.uniqueDeviceId
|
||||
itx["中台分配的SN"] = AppConfigInfo.mogoSN
|
||||
itx["中台分配的令牌"] = AppConfigInfo.mogoToken
|
||||
itx["当前网络连接模式"] = AppConfigInfo.netMode
|
||||
itx["网络是否正常"] = AppConfigInfo.isConnectNet
|
||||
itx["Socket是否正常"] = AppConfigInfo.isConnectSocket
|
||||
itx["ADAS连接是否正常"] = AppConfigInfo.isConnectAutopilot
|
||||
itx["OBU连接是否正常"] = AppConfigInfo.isConnectObu
|
||||
itx["连接工控机状态描述"] = AppConfigInfo.connectStatusDescribe
|
||||
itx["${divider}-5"] = divider
|
||||
itx["是否司机端"] = AppConfigInfo.isDriver
|
||||
itx["是否是乘客端"] = !AppConfigInfo.isDriver
|
||||
if (!AppConfigInfo.isDriver) {
|
||||
itx["当前车机是乘客屏,对应的司机屏SN"] = AppConfigInfo.serverSn
|
||||
}
|
||||
itx["司乘屏连接状态"] = AppConfigInfo.isConnectedNetty
|
||||
itx["${divider}-6"] = divider
|
||||
itx["车牌号"] = AppConfigInfo.plateNumber
|
||||
itx["mac"] = AppConfigInfo.iPCMacAddress
|
||||
itx["docker版本"] = AppConfigInfo.dockerVersion
|
||||
itx["协议版本号"] = AppConfigInfo.protocolVersionNumber
|
||||
itx["${divider}-7"] = divider
|
||||
itx["角色"] = AppConfigInfo.role
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
.crashConfig(CrashConfig.Builder()
|
||||
.enabled(true)
|
||||
.crashDir(File(context.getExternalFilesDir(null), "logcat/crash"))
|
||||
.javaCrash(true)
|
||||
.anr(true)
|
||||
.nativeCrash(true)
|
||||
.build())
|
||||
.uploader(LogRecordUploader()))
|
||||
scope.launch {
|
||||
try {
|
||||
if (zipDir.exists()) {
|
||||
zipDir.listFiles()?.forEach {
|
||||
it.delete()
|
||||
}
|
||||
}
|
||||
zipDir.takeIf { it.exists() }?.deleteRecursively()
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun target(): Class<RemoteLogPushContent> {
|
||||
return RemoteLogPushContent::class.java
|
||||
}
|
||||
|
||||
override fun onMsgReceived(obj: RemoteLogPushContent?) {
|
||||
Log.d(TAG, "--- onMsgReceived --: $obj")
|
||||
if (obj == null) return
|
||||
val endTime = System.currentTimeMillis()
|
||||
val startTime = when(obj.type) {
|
||||
LogRecordConfig.ALL_LOG_15_MINUTES -> endTime - MINUTES.toMillis(15)
|
||||
LogRecordConfig.ALL_LOG_30_MINUTES -> endTime - MINUTES.toMillis(30)
|
||||
LogRecordConfig.ALL_LOG_45_MINUTES -> endTime - MINUTES.toMillis(45)
|
||||
LogRecordConfig.ALL_LOG_60_MINUTES -> endTime - MINUTES.toMillis(60)
|
||||
LogRecordConfig.ALL_LOG_120_MINUTES -> endTime - MINUTES.toMillis(120)
|
||||
LogRecordConfig.ALL_LOG_SAME_DAY -> endTime - (endTime % 86400000)
|
||||
LogRecordConfig.ALL_LOG -> 0
|
||||
else -> endTime
|
||||
}
|
||||
Log.d(TAG, "--- onMsgReceived -- 1: $startTime, $endTime")
|
||||
if (startTime < endTime) {
|
||||
val now = System.currentTimeMillis()
|
||||
val last = lastUploadTime.get()
|
||||
if (last <= 0) {
|
||||
lastUploadTime.set(System.currentTimeMillis())
|
||||
}
|
||||
if (last > 0 && (now - last) <= uploadThreshold) {
|
||||
return
|
||||
}
|
||||
lastUploadTime.set(System.currentTimeMillis())
|
||||
scope.launch {
|
||||
LogcatManager.upload(startTime, endTime)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun start() {
|
||||
if (flag.get()) {
|
||||
return
|
||||
}
|
||||
flag.set(true)
|
||||
MogoAiCloudSocketManager.getInstance(AbsMogoApplication.getApp().applicationContext)
|
||||
.registerOnMessageListener(LogRecordConfig.LOG_RECORD_TYPE, this)
|
||||
LogcatManager.start()
|
||||
}
|
||||
|
||||
@@ -61,18 +169,32 @@ internal class MoGoLogRecordProviderImpl: IMoGoLogRecordProvider {
|
||||
if (!flag.get()) {
|
||||
return
|
||||
}
|
||||
MogoAiCloudSocketManager.getInstance(AbsMogoApplication.getApp().applicationContext)
|
||||
.unregisterOnMessageListener(LogRecordConfig.LOG_RECORD_TYPE, this)
|
||||
flag.set(false)
|
||||
LogcatManager.stop()
|
||||
}
|
||||
|
||||
override fun upload(startTime: Long, endTime: Long) {
|
||||
scope.launch {
|
||||
val result = LogcatManager.upload(startTime, endTime)
|
||||
Log.d(TAG, "上传日志:[startTime:$startTime, endTime: $endTime], 结果: $result")
|
||||
}
|
||||
}
|
||||
|
||||
override fun export(): File? {
|
||||
return LogcatManager.export()
|
||||
}
|
||||
|
||||
override fun upload(): Unit = runBlocking {
|
||||
val state = LogcatManager.upload(0, System.currentTimeMillis())
|
||||
if (state is UploadError) {
|
||||
throw AssertionError(state.toString())
|
||||
}
|
||||
}
|
||||
|
||||
override fun testJavaCrash(runOnNewThread: Boolean) {
|
||||
LogcatManager.testJavaCrash(runOnNewThread)
|
||||
}
|
||||
|
||||
override fun testNativeCrash(runOnNewThread: Boolean) {
|
||||
LogcatManager.testNativeCrash(runOnNewThread)
|
||||
}
|
||||
|
||||
override fun testAnrCrash() {
|
||||
SystemClock.sleep(15000)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.zhjt.mogo_core_function_devatools.logcat.config
|
||||
|
||||
internal class LogRecordConfig {
|
||||
|
||||
companion object{
|
||||
|
||||
/**
|
||||
* 长链下行数据的消息类型
|
||||
*/
|
||||
const val LOG_RECORD_TYPE = 500002
|
||||
|
||||
|
||||
/**
|
||||
* 全量日志抓取: 上传从收到抓取指令往前15分钟的日志
|
||||
*/
|
||||
const val ALL_LOG_15_MINUTES = 1
|
||||
|
||||
/**
|
||||
* 全量日志抓取: 上传从收到抓取指令往前30分钟的日志
|
||||
*/
|
||||
const val ALL_LOG_30_MINUTES = 2
|
||||
|
||||
/**
|
||||
* 全量日志抓取: 上传从收到抓取指令往前45分钟的日志
|
||||
*/
|
||||
const val ALL_LOG_45_MINUTES = 3
|
||||
|
||||
/**
|
||||
* 全量日志抓取: 上传从收到抓取指令往前60分钟的日志
|
||||
*/
|
||||
const val ALL_LOG_60_MINUTES = 4
|
||||
|
||||
/**
|
||||
* 全量日志抓取: 上传从收到抓取指令往前120分钟的日志
|
||||
*/
|
||||
const val ALL_LOG_120_MINUTES = 5
|
||||
|
||||
/**
|
||||
* 全量日志抓取: 上传从收到抓取指令往前当天的日志
|
||||
*/
|
||||
const val ALL_LOG_SAME_DAY = 6
|
||||
|
||||
/**
|
||||
* 全量日志抓取: 上传从收到抓取指令之前所有的日志
|
||||
*/
|
||||
const val ALL_LOG = 7
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,71 @@
|
||||
package com.zhjt.mogo_core_function_devatools.logcat.uploader
|
||||
|
||||
import android.util.Log
|
||||
import com.mogo.core.log.record.config.uploader.*
|
||||
import com.mogo.core.log.record.model.*
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.zhidao.cosupload.callback.CosStatusCallback
|
||||
import com.zhidao.cosupload.callback.CosStatusCallbackManager
|
||||
import com.zhidao.cosupload.model.CallbackData
|
||||
import com.zhidao.loglib.upload.UploadManager
|
||||
import kotlinx.coroutines.asCoroutineDispatcher
|
||||
import kotlinx.coroutines.channels.Channel
|
||||
import kotlinx.coroutines.flow.filter
|
||||
import kotlinx.coroutines.flow.first
|
||||
import kotlinx.coroutines.flow.flow
|
||||
import kotlinx.coroutines.flow.flowOn
|
||||
|
||||
internal class LogRecordUploader: ILogcatUploader {
|
||||
internal class LogRecordUploader : ILogcatUploader {
|
||||
|
||||
override suspend fun upload(startTime: Long, endTime: Long, generatedZipPath: String): UploadState {
|
||||
throw AssertionError("Not Implementation")
|
||||
companion object {
|
||||
private const val TAG = "LogRecordUploader"
|
||||
}
|
||||
|
||||
override suspend fun upload(startTime: Long, endTime: Long, generatedZipPath: String): UploadState =
|
||||
flow {
|
||||
Log.d(TAG, "---- 开始上传 --- 1 ---")
|
||||
val channel = Channel<UploadState>()
|
||||
CosStatusCallbackManager.getInstance().register(object : CosStatusCallback {
|
||||
|
||||
override fun onStartUpload(data: CallbackData?) {
|
||||
if (data?.localPath == generatedZipPath) {
|
||||
Log.d(TAG, "---- onStartUpload ---: $data")
|
||||
}
|
||||
}
|
||||
|
||||
override fun uploadCosCompleted(data: CallbackData?) {
|
||||
if (data?.localPath == generatedZipPath) {
|
||||
Log.d(TAG, "---- uploadCosCompleted ---: $data")
|
||||
channel.trySend(UploadSuccess)
|
||||
CosStatusCallbackManager.getInstance().unregister(this)
|
||||
}
|
||||
}
|
||||
|
||||
override fun uploadCosFailed(data: CallbackData?) {
|
||||
if (data?.localPath == generatedZipPath) {
|
||||
Log.d(TAG, "---- uploadCosFailed ---: $data")
|
||||
channel.trySend(UploadError(Reason(data.exception)))
|
||||
CosStatusCallbackManager.getInstance().unregister(this)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onProgress(data: CallbackData?) {
|
||||
if (data?.localPath == generatedZipPath) {
|
||||
Log.d(TAG, "---- onProgress ---: $data")
|
||||
}
|
||||
}
|
||||
})
|
||||
try {
|
||||
UploadManager.getInstance().uploadSingleFile(generatedZipPath)
|
||||
} catch (t: Throwable) {
|
||||
Log.d(TAG, "---- 上传失败 ---: ${t.message}")
|
||||
channel.send(UploadError(Reason(t.message ?: "")))
|
||||
}
|
||||
val iterator = channel.iterator()
|
||||
while (iterator.hasNext()) {
|
||||
val next = iterator.next()
|
||||
emit(next)
|
||||
}
|
||||
}.flowOn(ThreadUtils.getIoPool().asCoroutineDispatcher()).filter { it is UploadError || it == UploadSuccess }.first()
|
||||
|
||||
}
|
||||
@@ -18,6 +18,7 @@ import com.mogo.eagle.core.function.api.map.deva.IMoGoMapDevaProvider
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapDevaListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.LogLevel
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
@@ -223,6 +224,7 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
|
||||
config.isShowDebugLog = true
|
||||
config.isShowNetDebugLog = true
|
||||
}
|
||||
CallerMapUIServiceManager.getMapUIController()?.setDebugMode(true)
|
||||
CallerAutoPilotControlManager.setEnableLog(true)
|
||||
}
|
||||
|
||||
@@ -236,6 +238,7 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
|
||||
config.isShowDebugLog = false
|
||||
config.isShowNetDebugLog = false
|
||||
}
|
||||
CallerMapUIServiceManager.getMapUIController()?.setDebugMode(false)
|
||||
CallerAutoPilotControlManager.setEnableLog(false)
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ import kotlinx.coroutines.flow.*
|
||||
import mogo.telematics.pad.MessagePad.Header
|
||||
import mogo.telematics.pad.MessagePad.SetParamReq
|
||||
import java.util.concurrent.atomic.AtomicInteger
|
||||
import kotlin.concurrent.*
|
||||
|
||||
internal class MoGoLookAroundProviderImpl: IMoGoLookAroundProvider, IMoGoBackCameraVideoListener, IMoGoRoboBusJinlvM1StitchedVideoListener, IMoGoGetParamResponseListener {
|
||||
|
||||
@@ -69,7 +68,9 @@ internal class MoGoLookAroundProviderImpl: IMoGoLookAroundProvider, IMoGoBackCam
|
||||
private fun sendReqForParamPeriod() {
|
||||
scope.launch {
|
||||
while (targetX.get() == 0 || targetY.get() == 0) {
|
||||
CallerAutoPilotControlManager.sendGetParamReq(AdasConstants.MapSystemParamType.M1_STITCHED_VIDEO_SELF_VEHICLE_PARAM)
|
||||
if(CallerAutoPilotStatusListenerManager.isConnect()){
|
||||
CallerAutoPilotControlManager.sendGetParamReq(AdasConstants.MapSystemParamType.M1_STITCHED_VIDEO_SELF_VEHICLE_PARAM)
|
||||
}
|
||||
delay(2000)
|
||||
}
|
||||
}.also {
|
||||
|
||||
@@ -15,6 +15,12 @@ internal class MoFangAnalyticUtils {
|
||||
const val EVENT_SUB_CONNECT_SUCCESS = "event_sub_connect_success"
|
||||
const val EVENT_SUB_START_DISCONNECT = "event_sub_start_disconnect"
|
||||
const val EVENT_SUB_DISCONNECT_SUCCESS = "event_sub_disconnect_success"
|
||||
const val EVENT_SUB_DISCONNECT_SLEEP = "event_sub_disconnect_sleep"
|
||||
const val EVENT_SUB_BLUETOOTH_SETTING_REQ = "event_sub_ble_set_req"
|
||||
const val EVENT_SUB_BLUETOOTH_OPEN_DENY = "event_sub_ble_open_deny"
|
||||
const val EVENT_SUB_BLUETOOTH_OPEN_AGREE = "event_sub_ble_open_agree"
|
||||
const val EVENT_SUB_IS_VALID = "event_sub_is_ipt_valid"
|
||||
const val EVENT_SUB_IS_INVALID = "event_sub_is_ipt_invalid"
|
||||
|
||||
// 魔方电量
|
||||
const val EVENT_BATTERY = "event_mofang_battery"
|
||||
|
||||
@@ -200,7 +200,7 @@ internal class MoFangCommandExecutor {
|
||||
handler.removeMessages(MSG_WHAT_KEY_CODE_AL)
|
||||
handler.sendMessage(Message.obtain().also {
|
||||
it.what = MSG_WHAT_KEY_CODE_A
|
||||
it.obj = -1.0
|
||||
it.obj = -1.2
|
||||
})
|
||||
linkedLog?.record(mapOf("发送[A]:${System.currentTimeMillis()}" to "${whatToString(MSG_WHAT_KEY_CODE_A)}"))
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@ import com.mogo.core.mofang.connect.listener.*
|
||||
import com.mogo.eagle.core.function.api.devatools.mofang.*
|
||||
import com.mogo.eagle.core.function.api.devatools.mofang.IMoGoMoFangProvider.OnMoFangStatusListener
|
||||
import com.mogo.eagle.core.utilcode.floating.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.zhjt.mogo_core_function_devatools.mofang.MoFangAnalyticUtils.Companion.EVENT_BATTERY
|
||||
import com.zhjt.mogo_core_function_devatools.mofang.MoFangAnalyticUtils.Companion.EVENT_BATTERY_VALUE
|
||||
@@ -26,16 +28,20 @@ import com.zhjt.mogo_core_function_devatools.mofang.MoFangAnalyticUtils.Companio
|
||||
import com.zhjt.mogo_core_function_devatools.mofang.MoFangAnalyticUtils.Companion.EVENT_INPUT_SUB_KEYCODE
|
||||
import com.zhjt.mogo_core_function_devatools.mofang.MoFangAnalyticUtils.Companion.EVENT_INPUT_SUB_TYPE
|
||||
import com.zhjt.mogo_core_function_devatools.mofang.MoFangAnalyticUtils.Companion.EVENT_MOFANG_CONNECT
|
||||
import com.zhjt.mogo_core_function_devatools.mofang.MoFangAnalyticUtils.Companion.EVENT_SUB_BLUETOOTH_OPEN_AGREE
|
||||
import com.zhjt.mogo_core_function_devatools.mofang.MoFangAnalyticUtils.Companion.EVENT_SUB_BLUETOOTH_OPEN_DENY
|
||||
import com.zhjt.mogo_core_function_devatools.mofang.MoFangAnalyticUtils.Companion.EVENT_SUB_BLUETOOTH_SETTING_REQ
|
||||
import com.zhjt.mogo_core_function_devatools.mofang.MoFangAnalyticUtils.Companion.EVENT_SUB_CONNECT_SUCCESS
|
||||
import com.zhjt.mogo_core_function_devatools.mofang.MoFangAnalyticUtils.Companion.EVENT_SUB_DISCONNECT_SLEEP
|
||||
import com.zhjt.mogo_core_function_devatools.mofang.MoFangAnalyticUtils.Companion.EVENT_SUB_DISCONNECT_SUCCESS
|
||||
import com.zhjt.mogo_core_function_devatools.mofang.MoFangAnalyticUtils.Companion.EVENT_SUB_IS_INVALID
|
||||
import com.zhjt.mogo_core_function_devatools.mofang.MoFangAnalyticUtils.Companion.EVENT_SUB_IS_VALID
|
||||
import com.zhjt.mogo_core_function_devatools.mofang.MoFangAnalyticUtils.Companion.EVENT_SUB_START_CONNECT
|
||||
import com.zhjt.mogo_core_function_devatools.mofang.MoFangAnalyticUtils.Companion.EVENT_SUB_START_DISCONNECT
|
||||
import kotlinx.coroutines.*
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
import java.util.concurrent.atomic.AtomicInteger
|
||||
import java.util.concurrent.atomic.AtomicReference
|
||||
|
||||
internal class MoGoMoFangProviderImpl: IMoGoMoFangProvider, OnMoFangDeviceListener {
|
||||
|
||||
@@ -177,7 +183,7 @@ internal class MoGoMoFangProviderImpl: IMoGoMoFangProvider, OnMoFangDeviceListen
|
||||
override fun onBluetoothKeyBoardCombineClicked(vararg keyCodes: Int) {
|
||||
val keycodesText = keyCodes.joinToString(",") { KeyEvent.keyCodeToString(it).replace("KEYCODE_", "", true) }
|
||||
if (isTest.get()) {
|
||||
showToast("组合键[$keycodesText]触发了")
|
||||
showToast("[$keycodesText]")
|
||||
}
|
||||
try {
|
||||
MoFangAnalyticUtils.track(EVENT_INPUT, mutableMapOf(EVENT_INPUT_SUB_KEYCODE to keycodesText, EVENT_INPUT_SUB_TYPE to "3"))
|
||||
@@ -192,7 +198,8 @@ internal class MoGoMoFangProviderImpl: IMoGoMoFangProvider, OnMoFangDeviceListen
|
||||
|
||||
override fun onBluetoothKeyBoardLongClicked(keyCode: Int) {
|
||||
if (isTest.get()) {
|
||||
showToast("长按键[${KeyEvent.keyCodeToString(keyCode).replace("KEYCODE_", "", true)}]触发了")
|
||||
val key = KeyEvent.keyCodeToString(keyCode).replace("KEYCODE_", "", true)
|
||||
showToast("[$key$key]")
|
||||
}
|
||||
try {
|
||||
MoFangAnalyticUtils.track(EVENT_INPUT, mutableMapOf(EVENT_INPUT_SUB_KEYCODE to keyCode.toString(), EVENT_INPUT_SUB_TYPE to "2"))
|
||||
@@ -210,7 +217,7 @@ internal class MoGoMoFangProviderImpl: IMoGoMoFangProvider, OnMoFangDeviceListen
|
||||
override fun onBluetoothKeyboardClicked(keyCode: Int) {
|
||||
val keycodeText = KeyEvent.keyCodeToString(keyCode)
|
||||
if (isTest.get()) {
|
||||
showToast("单击键[${keycodeText.replace("KEYCODE_", "", true)}]触发了")
|
||||
showToast("[${keycodeText.replace("KEYCODE_", "", true)}]")
|
||||
}
|
||||
try {
|
||||
MoFangAnalyticUtils.track(EVENT_INPUT, mutableMapOf(EVENT_INPUT_SUB_KEYCODE to keyCode.toString(), EVENT_INPUT_SUB_TYPE to "1"))
|
||||
@@ -261,7 +268,8 @@ internal class MoGoMoFangProviderImpl: IMoGoMoFangProvider, OnMoFangDeviceListen
|
||||
override fun onBluetoothKeyboardEvent(event: KeyEvent) { }
|
||||
|
||||
override fun onBluetoothKeyboardInputInvalid() {
|
||||
Log.d(TAG, "--- onBluetoothKeyboardInputInvalid ---")
|
||||
CallerLogger.d(M_DEVA+TAG, "--- onBluetoothKeyboardInputInvalid ---")
|
||||
MoFangAnalyticUtils.track(EVENT_MOFANG_CONNECT, mutableMapOf(EVENT_SUB_IS_INVALID to "${System.currentTimeMillis()}"))
|
||||
linkedLog.record(mapOf("callback" to "onBluetoothKeyboardInputInvalid"))
|
||||
UiThreadHandler.post {
|
||||
listeners.values.forEach {
|
||||
@@ -271,22 +279,26 @@ internal class MoGoMoFangProviderImpl: IMoGoMoFangProvider, OnMoFangDeviceListen
|
||||
}
|
||||
|
||||
override fun onBluetoothKeyboardInputValid() {
|
||||
Log.d(TAG, "--- onBluetoothKeyboardInputValid ---")
|
||||
CallerLogger.d(M_DEVA+TAG, "--- onBluetoothKeyboardInputValid ---")
|
||||
MoFangAnalyticUtils.track(EVENT_MOFANG_CONNECT, mutableMapOf(EVENT_SUB_IS_VALID to "${System.currentTimeMillis()}"))
|
||||
linkedLog.record(mapOf("callback" to "onBluetoothKeyboardInputValid"))
|
||||
}
|
||||
|
||||
override fun onBluetoothOpenAgreed() {
|
||||
Log.d(TAG, "--- onBluetoothOpenAgreed ---")
|
||||
CallerLogger.d(M_DEVA+TAG, "--- onBluetoothOpenAgreed ---")
|
||||
MoFangAnalyticUtils.track(EVENT_MOFANG_CONNECT, mutableMapOf(EVENT_SUB_BLUETOOTH_OPEN_AGREE to "${System.currentTimeMillis()}"))
|
||||
linkedLog.record(mapOf("callback" to "onBluetoothOpenAgreed"))
|
||||
}
|
||||
|
||||
override fun onBluetoothOpenDenied() {
|
||||
Log.d(TAG, "--- onBluetoothOpenDenied ---")
|
||||
CallerLogger.d(M_DEVA+TAG, "--- onBluetoothOpenDenied ---")
|
||||
MoFangAnalyticUtils.track(EVENT_MOFANG_CONNECT, mutableMapOf(EVENT_SUB_BLUETOOTH_OPEN_DENY to "${System.currentTimeMillis()}"))
|
||||
linkedLog.record(mapOf("callback" to "onBluetoothOpenDenied"))
|
||||
}
|
||||
|
||||
override fun onBluetoothSettingRequest() {
|
||||
Log.d(TAG, "--- onBluetoothSettingRequest ---")
|
||||
CallerLogger.d(M_DEVA+TAG, "--- onBluetoothSettingRequest ---")
|
||||
MoFangAnalyticUtils.track(EVENT_MOFANG_CONNECT, mutableMapOf(EVENT_SUB_BLUETOOTH_SETTING_REQ to "${System.currentTimeMillis()}"))
|
||||
linkedLog.record(mapOf("callback" to "onBluetoothSettingRequest"))
|
||||
UiThreadHandler.post {
|
||||
Toast.makeText(Utils.getApp(), "检测到魔方未正确连接,请在系统蓝牙设置页面,找到魔方并配对连接...", Toast.LENGTH_SHORT).show()
|
||||
@@ -294,7 +306,8 @@ internal class MoGoMoFangProviderImpl: IMoGoMoFangProvider, OnMoFangDeviceListen
|
||||
}
|
||||
|
||||
override fun onBluetoothKeyboardAbnormalDisconnected(status: Int) {
|
||||
Log.d(TAG, "--- onBluetoothKeyboardAbnormalDisconnected(status: $status) ---")
|
||||
CallerLogger.d(M_DEVA+TAG, "--- onBluetoothKeyboardAbnormalDisconnected(status: $status) ---")
|
||||
MoFangAnalyticUtils.track(EVENT_MOFANG_CONNECT, mutableMapOf(EVENT_SUB_DISCONNECT_SLEEP to "${System.currentTimeMillis()}"))
|
||||
linkedLog.record(mapOf("callback" to "onBluetoothKeyboardAbnormalDisconnected:$status"))
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,8 @@ class IPCReportManager : IMoGoAutopilotStatusListener {
|
||||
private var ipcErrorReportList = arrayListOf<ReportEntity>() //错误上报列表
|
||||
private var ipcWarningReportList = arrayListOf<ReportEntity>() //警告上报列表
|
||||
|
||||
private var ipcReportWindowIsShow = false //IPC上报窗口是否处于展示状态
|
||||
|
||||
companion object{
|
||||
const val TAG ="IPCReportManager"
|
||||
val iPCReportManager: IPCReportManager by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
@@ -55,16 +57,31 @@ class IPCReportManager : IMoGoAutopilotStatusListener {
|
||||
fun showReportListWindow(context: Context, isShow: Boolean){
|
||||
if(isShow){
|
||||
//打开工控机上报列表
|
||||
reportListFloatWindow =
|
||||
ReportListFloatWindow(context as Activity)
|
||||
reportListFloatWindow?.showFloatWindow()
|
||||
reportListFloatWindow?.refreshData(reportList)
|
||||
if(reportListFloatWindow == null){
|
||||
reportListFloatWindow =
|
||||
ReportListFloatWindow(context as Activity)
|
||||
}
|
||||
reportListFloatWindow?.let {
|
||||
it.showFloatWindow()
|
||||
it.refreshData(reportList)
|
||||
ipcReportWindowIsShow = true
|
||||
}
|
||||
}else {
|
||||
//关闭工控机上报列表
|
||||
reportListFloatWindow?.hideFloatWindow()
|
||||
reportListFloatWindow?.let {
|
||||
it.hideFloatWindow()
|
||||
ipcReportWindowIsShow = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取窗口展示状态
|
||||
*/
|
||||
fun getReportWindowStatus(): Boolean{
|
||||
return ipcReportWindowIsShow
|
||||
}
|
||||
|
||||
/**
|
||||
*工控机监控节点上报
|
||||
*/
|
||||
|
||||
@@ -69,22 +69,20 @@ class ReportListFloatWindow constructor(activity: Activity) : View.OnTouchListen
|
||||
mInViewY = motionEvent.y
|
||||
// 获取相对屏幕的坐标,即以屏幕左上角为原点
|
||||
mDownInScreenX = motionEvent.rawX
|
||||
mDownInScreenY = motionEvent.rawY - BarUtils.getStatusBarHeight()
|
||||
mDownInScreenY = motionEvent.rawY
|
||||
mInScreenX = motionEvent.rawX
|
||||
mInScreenY = motionEvent.rawY - BarUtils.getStatusBarHeight()
|
||||
mInScreenY = motionEvent.rawY
|
||||
|
||||
}
|
||||
MotionEvent.ACTION_MOVE -> {
|
||||
// 更新浮动窗口位置参数
|
||||
mInScreenX = motionEvent.rawX
|
||||
mInScreenY = motionEvent.rawY - BarUtils.getStatusBarHeight()
|
||||
mInScreenY = motionEvent.rawY
|
||||
mWindowParams!!.x = (mInScreenX - mInViewX).toInt()
|
||||
mWindowParams!!.y = (mInScreenY - mInViewY).toInt()
|
||||
// 手指移动的时候更新小悬浮窗的位置
|
||||
mWindowManager!!.updateViewLayout(mFloatLayout, mWindowParams)
|
||||
}
|
||||
// MotionEvent.ACTION_UP -> // 如果手指离开屏幕时,xDownInScreen和xInScreen相等,且yDownInScreen和yInScreen相等,则视为触发了单击事件。
|
||||
// if (mDownInScreenX === mInScreenX && mDownInScreenY === mInScreenY) {
|
||||
// }
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ class SceneManager {
|
||||
init {
|
||||
//过滤所需条件
|
||||
sceneModuleTAG.map[ADAS] = SceneModule(true, M_D_C)
|
||||
sceneModuleTAG.map[DEVA] = SceneModule(false, M_DEVA)
|
||||
sceneModuleTAG.map[DEVA] = SceneModule(true, M_DEVA)
|
||||
sceneModuleTAG.map[HMI] = SceneModule(false, M_HMI)
|
||||
sceneModuleTAG.map[OBU] = SceneModule(true, M_OBU)
|
||||
sceneModuleTAG.map[V2X] = SceneModule(true, M_V2X)
|
||||
|
||||
@@ -128,13 +128,13 @@ internal class OverViewImpl(ctx: Context) : IFlow<OverViewStatus>(ctx),
|
||||
override fun onGranted() {
|
||||
Log.d(TAG,"权限: ${Manifest.permission.ACCESS_FINE_LOCATION} 被授予了....")
|
||||
if (isLocationEnabled()) {
|
||||
isGpsException = true
|
||||
send(OverViewStatus(true))
|
||||
CallerDevaToolsListenerManager.invokeGpsStatus(false)
|
||||
} else {
|
||||
isGpsException = false
|
||||
checkIfNotException()
|
||||
CallerDevaToolsListenerManager.invokeGpsStatus(true)
|
||||
} else {
|
||||
isGpsException = true
|
||||
send(OverViewStatus(true))
|
||||
CallerDevaToolsListenerManager.invokeGpsStatus(false)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.zhjt.mogo_core_function_devatools.status.flow.IFlow
|
||||
import kotlinx.coroutines.Job
|
||||
import mogo_msg.MogoReportMsg.MogoReportMessage
|
||||
import planning.RoboSweeperTaskIndexOuterClass
|
||||
import system_master.SsmInfo
|
||||
import system_master.SystemStatusInfo.StatusInfo
|
||||
import java.util.concurrent.atomic.AtomicInteger
|
||||
|
||||
@@ -39,7 +40,7 @@ internal class CanImpl(ctx: Context) :
|
||||
private val state: AtomicInteger by lazy { AtomicInteger(Int.MIN_VALUE) }
|
||||
|
||||
override fun onCreate() {
|
||||
send(CanStatus(CallerAutoPilotControlManager.isConnected()))
|
||||
send(CanStatus(CallerAutoPilotStatusListenerManager.isConnect()))
|
||||
|
||||
CallerChassisAccStateListenerManager.addListener(TAG, this)
|
||||
CallerChassisBrakeStateListenerManager.addListener(TAG, this)
|
||||
@@ -57,7 +58,7 @@ internal class CanImpl(ctx: Context) :
|
||||
|
||||
private fun isCanEnabled(): Boolean {
|
||||
val code = CallerAutoPilotStatusListenerManager.getAutoPilotReportMessageCode()
|
||||
return CallerAutoPilotControlManager.isConnected() && code != "EHW_CAN" && (state.get() == Int.MIN_VALUE || state.get() == 0)
|
||||
return CallerAutoPilotStatusListenerManager.isConnect() && code != "EHW_CAN" && (state.get() == Int.MIN_VALUE || state.get() == 0)
|
||||
}
|
||||
|
||||
|
||||
@@ -115,6 +116,14 @@ internal class CanImpl(ctx: Context) :
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSystemStatus(statusInf: SsmInfo.SsmStatusInf) {
|
||||
val state = statusInf.healthInfoList?.find { "can_adapter".equals(it.name, true) }?.state?.ordinal
|
||||
Log.d(TAG, "state: $state")
|
||||
if (state != null) {
|
||||
this.state.set(state)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
job?.safeCancel()
|
||||
|
||||
@@ -28,7 +28,7 @@ internal class IpcImpl(ctx: Context): IFlow<IpcStatus>(ctx), IMoGoAutopilotStatu
|
||||
}
|
||||
|
||||
private fun checkAndSend() {
|
||||
send(IpcStatus(CallerAutoPilotControlManager.isConnected()))
|
||||
send(IpcStatus(CallerAutoPilotStatusListenerManager.isConnect()))
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
|
||||
@@ -16,7 +16,8 @@ import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
import system_master.SystemStatusInfo.HealthInfo
|
||||
import system_master.SsmInfo
|
||||
import system_master.SsmBase.HealthInfo
|
||||
import system_master.SystemStatusInfo.StatusInfo
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
import java.util.concurrent.atomic.AtomicReference
|
||||
@@ -42,7 +43,7 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
|
||||
CallerLogger.d("$M_DEVA$TAG", "-- onCreate --")
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
CallerChassisLocationWGS84ListenerManager.addListener(TAG, this)
|
||||
if (CallerAutoPilotControlManager.isConnected()) {
|
||||
if (CallerAutoPilotStatusListenerManager.isConnect()) {
|
||||
check()
|
||||
}
|
||||
}
|
||||
@@ -52,7 +53,7 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
|
||||
return
|
||||
}
|
||||
check?.takeIf { it.isActive }?.cancel()
|
||||
launch(Dispatchers.Unconfined) {
|
||||
launch(Dispatchers.Default) {
|
||||
CallerAutoPilotControlManager.sendStatusQueryReq()
|
||||
delay(5000)
|
||||
isOldVersion.set(true)
|
||||
@@ -72,25 +73,35 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
|
||||
}
|
||||
}
|
||||
|
||||
override fun onSystemStatus(statusInf: SsmInfo.SsmStatusInf) {
|
||||
check?.takeIf { it.isActive }?.cancel()
|
||||
isOldVersion.set(false)
|
||||
val info = statusInf.healthInfoList?.find { "localization".equals(it.name, true) }
|
||||
Log.d(TAG, "info: $info")
|
||||
if (info != null) {
|
||||
healthInfo.set(info)
|
||||
send(RTKStatus(getDesc(), getCode()))
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotIpcConnectStatusChanged(status: Int, reason: String?) {
|
||||
super.onAutopilotIpcConnectStatusChanged(status, reason)
|
||||
if (!CallerAutoPilotControlManager.isConnected()) {
|
||||
if (!CallerAutoPilotStatusListenerManager.isConnect()) {
|
||||
CallerLogger.d("$M_DEVA$TAG", "工控机断开了....")
|
||||
healthInfo.set(null)
|
||||
send(RTKStatus("", -1))
|
||||
}
|
||||
|
||||
if (CallerAutoPilotControlManager.isConnected() && check == null && !isOldVersion.get()) {
|
||||
if (CallerAutoPilotStatusListenerManager.isConnect() && check == null && !isOldVersion.get()) {
|
||||
check()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
|
||||
if (isOldVersion.get()) {
|
||||
if (isRTKEnabled()) {
|
||||
if ((timeOutCheck == null || timeOutCheck?.isCompleted == true) && isRTKEnabled()) {
|
||||
send(RTKStatus("RTK", 0))
|
||||
timeOutCheck?.takeIf { it.isActive }?.cancel()
|
||||
launch(Dispatchers.Unconfined) {
|
||||
launch(Dispatchers.Default) {
|
||||
delay(4000)
|
||||
send(RTKStatus("", -1))
|
||||
}.also {
|
||||
@@ -103,7 +114,7 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
|
||||
private fun isRTKEnabled(): Boolean {
|
||||
val code = CallerAutoPilotStatusListenerManager.getAutoPilotReportMessageCode()
|
||||
val gnssInfo = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
||||
return CallerAutoPilotControlManager.isConnected() && (
|
||||
return CallerAutoPilotStatusListenerManager.isConnect() && (
|
||||
code != "EHW_RTK" &&
|
||||
code != "EHW_GNSS" &&
|
||||
code != "ESYS_RTK_STATUS_FAULT" &&
|
||||
|
||||
@@ -58,7 +58,7 @@ internal class TracingImpl(ctx: Context): IFlow<TracingStatus>(ctx), IMoGoAutopi
|
||||
super.onAutopilotIpcConnectStatusChanged(status, reason)
|
||||
try {
|
||||
if (ipcConnectStatus.get() != status) {
|
||||
if (!CallerAutoPilotControlManager.isConnected()) {
|
||||
if (!CallerAutoPilotStatusListenerManager.isConnect()) {
|
||||
old = UNKNOWN
|
||||
send(TracingStatus(UNKNOWN))
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ internal class StatusModel : ViewModel() {
|
||||
const val TAG = "StatusModel"
|
||||
val DEFAULTS = Pair(null, ArrayList<Status>().also {
|
||||
it += OverViewStatus()
|
||||
it += IpcStatus(CallerAutoPilotControlManager.isConnected())
|
||||
it += IpcStatus(CallerAutoPilotStatusListenerManager.isConnect())
|
||||
it += CanStatus(false)
|
||||
// it += TracingStatus(UNKNOWN)
|
||||
it += RTKStatus("", -1)
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.zhjt.mogo_core_function_devatools.status.entity.IpcStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.Status
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.TracingStatus.Tracing.*
|
||||
import com.zhjt.mogo_core_function_devatools.status.ui.adapter.StatusAdapter.StatusViewHolder
|
||||
import me.jessyan.autosize.AutoSizeCompat
|
||||
|
||||
internal class StatusAdapter(val ctx: Context, var data: ArrayList<Status>): RecyclerView.Adapter<StatusViewHolder>() {
|
||||
|
||||
@@ -27,6 +28,7 @@ internal class StatusAdapter(val ctx: Context, var data: ArrayList<Status>): Rec
|
||||
StatusViewHolder(LayoutInflater.from(ctx).inflate(R.layout.layout_status_bar_item, parent, false))
|
||||
|
||||
override fun onBindViewHolder(holder: StatusViewHolder, position: Int) {
|
||||
AutoSizeCompat.autoConvertDensityOfGlobal(holder.itemView.resources)
|
||||
holder.bind(data[position])
|
||||
}
|
||||
|
||||
@@ -100,6 +102,10 @@ internal class StatusAdapter(val ctx: Context, var data: ArrayList<Status>): Rec
|
||||
}
|
||||
"SLAM" ->
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_slam_good)
|
||||
"VSLAM" ->
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_vslam_good)
|
||||
"VAL" ->
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_val_good)
|
||||
else ->
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_rtk_unknow)
|
||||
}
|
||||
|
||||
@@ -85,19 +85,19 @@ class TraceManager : IMoGoCloudListener, IMoGoAutopilotCarConfigListener {
|
||||
|
||||
|
||||
traceInfoCache[ChainConstant.CHAIN_TYPE_INIT_STATUS] =
|
||||
ChainLogParam(true, "ADAS连接状态")
|
||||
ChainLogParam(true, "INIT状态")
|
||||
traceInfoCache[ChainConstant.CHAIN_TYPE_GNSS] =
|
||||
ChainLogParam(true, "ADAS自车定位")
|
||||
traceInfoCache[ChainConstant.CHAIN_TYPE_SOCKET_AUTOPILOT] =
|
||||
ChainLogParam(true, "ADAS自动驾驶链路(包含: 自动驾驶状态交互,全局路径,到站提醒,节点状态,异常上报,PNC)")
|
||||
traceInfoCache[ChainConstant.CHAIN_TYPE_SOCKET_DATA_TRACKED] =
|
||||
ChainLogParam(true, "ADAS感知物体")
|
||||
ChainLogParam(true, "云感知物体")
|
||||
traceInfoCache[ChainConstant.CHAIN_TYPE_SOCKET_TRAJECTORY] =
|
||||
ChainLogParam(false, "ADAS车前引导线")
|
||||
traceInfoCache[ChainConstant.CHAIN_TYPE_SOCKET_VEHICLE] =
|
||||
ChainLogParam(false, "ADAS车辆底盘数据")
|
||||
traceInfoCache[ChainConstant.CHAIN_TYPE_SOCKET_TRAFFIC_LIGHT] =
|
||||
ChainLogParam(true, "ADAS红绿灯数据")
|
||||
ChainLogParam(true, "红绿灯Union数据")
|
||||
traceInfoCache[ChainConstant.CHAIN_TYPE_HMI] =
|
||||
ChainLogParam(true, "人机交互行为")
|
||||
traceInfoCache[ChainConstant.CHAIN_TYPE_ANR_LEAK] =
|
||||
@@ -109,8 +109,6 @@ class TraceManager : IMoGoCloudListener, IMoGoAutopilotCarConfigListener {
|
||||
traceInfoCache[ChainConstant.CHAIN_TYPE_WEAK_NETWORK] =
|
||||
ChainLogParam(true, "WeakNetWork Record")
|
||||
|
||||
MoGoAiCloudClientConfig.getInstance()
|
||||
|
||||
FileWriteManager.getInstance()
|
||||
.init(context, "", pkgName, fwBuildMap)
|
||||
FileWriteManager.getInstance().registerListener { type ->
|
||||
|
||||
@@ -20,6 +20,7 @@ class StartUpTraceNetWorkModel {
|
||||
private var retryTime = 0
|
||||
private var success: ((String) -> Unit)? = null
|
||||
private var error: ((String) -> Unit)? = null
|
||||
@Volatile
|
||||
private var traceId: String = ""
|
||||
|
||||
fun report(
|
||||
@@ -39,14 +40,14 @@ class StartUpTraceNetWorkModel {
|
||||
if (id != null) {
|
||||
traceId = id
|
||||
}
|
||||
val configUpload = AppConfigInfo.toConfigUpload()
|
||||
val data = GsonUtils.toJson(configUpload)
|
||||
map =
|
||||
GsonUtils.fromJson(data, object : TypeToken<MutableMap<String, Any>>() {}.type)
|
||||
map["id"] = traceId
|
||||
}
|
||||
loader {
|
||||
apiCall {
|
||||
val configUpload = AppConfigInfo.toConfigUpload()
|
||||
val data = GsonUtils.toJson(configUpload)
|
||||
map =
|
||||
GsonUtils.fromJson(data, object : TypeToken<MutableMap<String, Any>>() {}.type)
|
||||
map["id"] = traceId
|
||||
getNetWorkApi().report(map)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ class MoGoUpgradeProviderImpl: IMoGoUpgradeProvider {
|
||||
val record = Record(AppUtils.getAppVersionName(), sn, mac, type, isSupportPatch, time = System.currentTimeMillis())
|
||||
UpgradeDbHelper.insertRecord(record)
|
||||
try {
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_start" to GsonUtils.toJson(record)))
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_start" to record))
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
@@ -38,7 +38,7 @@ class MoGoUpgradeProviderImpl: IMoGoUpgradeProvider {
|
||||
val record = CheckRecord(AppUtils.getAppVersionName(), START, time = System.currentTimeMillis())
|
||||
UpgradeDbHelper.insertCheckRecord(record)
|
||||
try {
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_request_start" to GsonUtils.toJson(record)))
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_request_start" to record))
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
@@ -48,7 +48,7 @@ class MoGoUpgradeProviderImpl: IMoGoUpgradeProvider {
|
||||
val record = CheckRecord(AppUtils.getAppVersionName(), SUCCESS, response, time = System.currentTimeMillis())
|
||||
UpgradeDbHelper.insertCheckRecord(record)
|
||||
try {
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_request_success" to GsonUtils.toJson(record)))
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_request_success" to record))
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
@@ -67,7 +67,7 @@ class MoGoUpgradeProviderImpl: IMoGoUpgradeProvider {
|
||||
val record = UpgradeRecord(fromVersionName = AppUtils.getAppVersionName(), toVersionName = newVersionName, fromMd5 = AppUtils.getAppApkMd5(), toMD5 = newMd5, type = getType(type), time = System.currentTimeMillis())
|
||||
UpgradeDbHelper.insertUpgradeRecord(record)
|
||||
try {
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_record" to GsonUtils.toJson(record)))
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_record" to record))
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
@@ -77,7 +77,7 @@ class MoGoUpgradeProviderImpl: IMoGoUpgradeProvider {
|
||||
val record = DownloadRecord(versionName = AppUtils.getAppVersionName(), status = DownloadStart, downloadUrl = downloadUrl, time = System.currentTimeMillis())
|
||||
UpgradeDbHelper.insertDownloadRecord(record)
|
||||
try {
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_download_start" to GsonUtils.toJson(record)))
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_download_start" to record))
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
@@ -87,7 +87,7 @@ class MoGoUpgradeProviderImpl: IMoGoUpgradeProvider {
|
||||
val record = DownloadRecord(versionName = AppUtils.getAppVersionName(), status = DownloadPause, downloadUrl = downloadUrl, time = System.currentTimeMillis())
|
||||
UpgradeDbHelper.insertDownloadRecord(record)
|
||||
try {
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_download_pause" to GsonUtils.toJson(record)))
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_download_pause" to record))
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
@@ -97,7 +97,7 @@ class MoGoUpgradeProviderImpl: IMoGoUpgradeProvider {
|
||||
val record = DownloadRecord(versionName = AppUtils.getAppVersionName(), status = DownloadFailed, failReason = error, downloadUrl = downloadUrl, time = System.currentTimeMillis())
|
||||
UpgradeDbHelper.insertDownloadRecord(record)
|
||||
try {
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_download_failed" to GsonUtils.toJson(record)))
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_download_failed" to record))
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
@@ -107,7 +107,7 @@ class MoGoUpgradeProviderImpl: IMoGoUpgradeProvider {
|
||||
val record = DownloadRecord(versionName = AppUtils.getAppVersionName(), status = DownloadComplete, downloadUrl = downloadUrl, time = System.currentTimeMillis())
|
||||
UpgradeDbHelper.insertDownloadRecord(record)
|
||||
try {
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_download_success" to GsonUtils.toJson(record)))
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_download_success" to record))
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
@@ -117,7 +117,7 @@ class MoGoUpgradeProviderImpl: IMoGoUpgradeProvider {
|
||||
val record = InstallRecord(version = AppUtils.getAppVersionName(), status = InstallStart, time = System.currentTimeMillis())
|
||||
UpgradeDbHelper.insertInstallRecord(record)
|
||||
try {
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_install_start" to GsonUtils.toJson(record)))
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_install_start" to record))
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
@@ -127,7 +127,7 @@ class MoGoUpgradeProviderImpl: IMoGoUpgradeProvider {
|
||||
val record = InstallRecord(version = AppUtils.getAppVersionName(), status = SourceMd5CheckStart, time = System.currentTimeMillis())
|
||||
UpgradeDbHelper.insertInstallRecord(record)
|
||||
try {
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_check_source_md5_start" to GsonUtils.toJson(record)))
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_check_source_md5_start" to record))
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
@@ -137,7 +137,7 @@ class MoGoUpgradeProviderImpl: IMoGoUpgradeProvider {
|
||||
val record = InstallRecord(version = AppUtils.getAppVersionName(), status = SourceMd5CheckFailed, failReason = error, time = System.currentTimeMillis())
|
||||
UpgradeDbHelper.insertInstallRecord(record)
|
||||
try {
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_check_source_md5_failed" to GsonUtils.toJson(record)))
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_check_source_md5_failed" to record))
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
@@ -147,7 +147,7 @@ class MoGoUpgradeProviderImpl: IMoGoUpgradeProvider {
|
||||
val record = InstallRecord(version = AppUtils.getAppVersionName(), status = SourceMd5CheckSuccess, time = System.currentTimeMillis())
|
||||
UpgradeDbHelper.insertInstallRecord(record)
|
||||
try {
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_check_source_md5_success" to GsonUtils.toJson(record)))
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_check_source_md5_success" to record))
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
@@ -157,7 +157,7 @@ class MoGoUpgradeProviderImpl: IMoGoUpgradeProvider {
|
||||
val record = InstallRecord(version = AppUtils.getAppVersionName(), status = ApplyPatchStart, time = System.currentTimeMillis())
|
||||
UpgradeDbHelper.insertInstallRecord(record)
|
||||
try {
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_apply_patch_start" to GsonUtils.toJson(record)))
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_apply_patch_start" to record))
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
@@ -167,7 +167,7 @@ class MoGoUpgradeProviderImpl: IMoGoUpgradeProvider {
|
||||
val record = InstallRecord(version = AppUtils.getAppVersionName(), status = ApplyPatchFailed, failReason = error, time = System.currentTimeMillis())
|
||||
UpgradeDbHelper.insertInstallRecord(record)
|
||||
try {
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_apply_patch_failed" to GsonUtils.toJson(record)))
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_apply_patch_failed" to record))
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
@@ -177,7 +177,7 @@ class MoGoUpgradeProviderImpl: IMoGoUpgradeProvider {
|
||||
val record = InstallRecord(version = AppUtils.getAppVersionName(), status = ApplyPatchSuccess, time = System.currentTimeMillis())
|
||||
UpgradeDbHelper.insertInstallRecord(record)
|
||||
try {
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_apply_patch_success" to GsonUtils.toJson(record)))
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_apply_patch_success" to record))
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
@@ -187,7 +187,7 @@ class MoGoUpgradeProviderImpl: IMoGoUpgradeProvider {
|
||||
val record = InstallRecord(version = AppUtils.getAppVersionName(), status = TargetMd5CheckStart, time = System.currentTimeMillis())
|
||||
UpgradeDbHelper.insertInstallRecord(record)
|
||||
try {
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_check_target_md5_start" to GsonUtils.toJson(record)))
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_check_target_md5_start" to record))
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
@@ -197,7 +197,7 @@ class MoGoUpgradeProviderImpl: IMoGoUpgradeProvider {
|
||||
val record = InstallRecord(version = AppUtils.getAppVersionName(), status = TargetMd5CheckFailed, failReason = error, time = System.currentTimeMillis())
|
||||
UpgradeDbHelper.insertInstallRecord(record)
|
||||
try {
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_check_target_md5_failed" to GsonUtils.toJson(record)))
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_check_target_md5_failed" to record))
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
@@ -207,7 +207,7 @@ class MoGoUpgradeProviderImpl: IMoGoUpgradeProvider {
|
||||
val record = InstallRecord(version = AppUtils.getAppVersionName(), status = TargetMd5CheckSuccess, time = System.currentTimeMillis())
|
||||
UpgradeDbHelper.insertInstallRecord(record)
|
||||
try {
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_check_target_md5_success" to GsonUtils.toJson(record)))
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_check_target_md5_success" to record))
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
@@ -217,7 +217,7 @@ class MoGoUpgradeProviderImpl: IMoGoUpgradeProvider {
|
||||
val record = InstallRecord(version = AppUtils.getAppVersionName(), status = InstallFailed, code = code, failReason = error, time = System.currentTimeMillis())
|
||||
UpgradeDbHelper.insertInstallRecord(record)
|
||||
try {
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_install_failed" to GsonUtils.toJson(record)))
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_install_failed" to record))
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
@@ -249,7 +249,7 @@ class MoGoUpgradeProviderImpl: IMoGoUpgradeProvider {
|
||||
itx["step_3"] = all.downloads?.sortedBy { it.status.ordinal }?.mapIndexed { index, r -> "$index" to GsonUtils.toJson(r) } ?: emptyList()
|
||||
itx["step_4"] = all.installs?.let { ArrayList<InstallRecord>(it) + InstallRecord(success.versionName, InstallSuccess, 0) }?.sortedBy { it.status.ordinal }?.mapIndexed { index, r -> "$index" to GsonUtils.toJson(r) } ?: emptyList()
|
||||
try {
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_success" to GsonUtils.toJson(all)))
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_success" to all))
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
@@ -265,7 +265,7 @@ class MoGoUpgradeProviderImpl: IMoGoUpgradeProvider {
|
||||
itx["step_3"] = all.downloads?.sortedBy { it.status.ordinal }?.mapIndexed { index, r -> "$index" to GsonUtils.toJson(r) } ?: emptyList()
|
||||
itx["step_4"] = all.installs?.sortedBy { it.status.ordinal }?.mapIndexed { index, r -> "$index" to GsonUtils.toJson(r) } ?: emptyList()
|
||||
try {
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_failed" to GsonUtils.toJson(all)))
|
||||
onUpgradeRecordLinkLog(mapOf("upgrade_failed" to all))
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
@@ -301,5 +301,5 @@ class MoGoUpgradeProviderImpl: IMoGoUpgradeProvider {
|
||||
nodeAliasCode = ChainConstant.CHAIN_CODE_UPGRADE_APP,
|
||||
paramIndexes = [0]
|
||||
)
|
||||
private fun onUpgradeRecordLinkLog(extra: Map<String, String>) {}
|
||||
private fun onUpgradeRecordLinkLog(extra: Map<String, Any>) {}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.zhjt.mogo_core_function_devatools.weaknetwork
|
||||
|
||||
import androidx.annotation.Keep
|
||||
|
||||
@Keep
|
||||
data class DetectResult(var details: List<PingResult>?) {
|
||||
|
||||
data class PingResult(
|
||||
var detectType: Int,
|
||||
var errorCode: Int,
|
||||
var networkType: Int,
|
||||
var detectIp: String?,
|
||||
var port: Int,
|
||||
var rttStr: String?,
|
||||
var pingLossRate: String?
|
||||
)
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.zhjt.mogo_core_function_devatools.weaknetwork
|
||||
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.weak.network.StubImpl
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
|
||||
@@ -12,7 +13,22 @@ class DetectResultImpl: StubImpl.ReportDetectResultListener {
|
||||
}
|
||||
|
||||
override fun onDetectResult(resultsJson: String?) {
|
||||
resultsJson?.let { invokeWeakResult(it) }
|
||||
resultsJson?.let { json ->
|
||||
kotlin.runCatching {
|
||||
val result = GsonUtils.fromJson(json, DetectResult::class.java)
|
||||
val size = result.details?.size ?: 0
|
||||
var rttSum = 0.0
|
||||
result?.details?.forEach { pingResult ->
|
||||
pingResult.rttStr?.let {
|
||||
rttSum += it.toDouble()
|
||||
}
|
||||
}
|
||||
if (rttSum > 0 && size > 0) {
|
||||
Log.d(TAG, "avg of rtt is:${rttSum / size}ms")
|
||||
}
|
||||
}
|
||||
invokeWeakResult(json)
|
||||
}
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.mogo.cloud.network.WeakNetworkManager
|
||||
import com.mogo.cloud.network.WeakNetworkManager.setListener
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.weak.network.SdtManager
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock
|
||||
@@ -16,6 +17,10 @@ object WeakNetworkStrategy {
|
||||
// 记录到链路日志中的时间间隔
|
||||
private const val OUTPUT_TIME_INTERVAL = 15000
|
||||
|
||||
private const val WEAK_HTTP_RTT = 1300
|
||||
|
||||
private const val VERY_CONSUMING_TIME_URL = "/yycp-launcherSnapshot/launcherSnapshot/querySnapshotSync"
|
||||
|
||||
private var lastOutputTime = 0L
|
||||
|
||||
private val lock by lazy {
|
||||
@@ -33,6 +38,7 @@ object WeakNetworkStrategy {
|
||||
fun startListen() {
|
||||
setListener(object : WeakNetworkManager.OnWeakHttpListener {
|
||||
override fun onHttpRttReceived(hashCode: Int, url: String, timeStamp: Long) {
|
||||
if (VERY_CONSUMING_TIME_URL in url) return
|
||||
outputLog(url, timeStamp)
|
||||
}
|
||||
|
||||
@@ -57,8 +63,12 @@ object WeakNetworkStrategy {
|
||||
try {
|
||||
val currentTime = System.currentTimeMillis()
|
||||
if (currentTime - lastOutputTime > OUTPUT_TIME_INTERVAL) {
|
||||
invokeWeakResult("url为:$url, 耗时为:$timeStamp${if (isFail) " 连接失败!" else ""}")
|
||||
SdtManager.startActiveCheck()
|
||||
if (timeStamp >= WEAK_HTTP_RTT) {
|
||||
ToastUtils.showShort("当前网络质量差!")
|
||||
} else if (timeStamp in 300 until WEAK_HTTP_RTT) {
|
||||
invokeWeakResult("url为:$url, 耗时为:$timeStamp${if (isFail) " 连接失败!" else ""}")
|
||||
SdtManager.startActiveCheck()
|
||||
}
|
||||
lastOutputTime = currentTime
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 5.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 7.8 KiB |
@@ -50,7 +50,7 @@ android {
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation rootProject.ext.dependencies.kotlinstdlibjdk7
|
||||
implementation rootProject.ext.dependencies.kotlinstdlib
|
||||
implementation rootProject.ext.dependencies.androidxccorektx
|
||||
implementation rootProject.ext.dependencies.androidxappcompat
|
||||
implementation rootProject.ext.dependencies.androidxconstraintlayout
|
||||
@@ -72,6 +72,7 @@ dependencies {
|
||||
|
||||
implementation rootProject.ext.dependencies.android_start_up
|
||||
implementation rootProject.ext.dependencies.cicle_indicator
|
||||
implementation rootProject.ext.dependencies.koomjava
|
||||
implementation rootProject.ext.dependencies.koomnative
|
||||
implementation rootProject.ext.dependencies.koomxhook
|
||||
api project(':test:crashreport-apmbyte')
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.mogo.eagle.core.function.hmi">
|
||||
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.CALL_PHONE" />
|
||||
|
||||
@@ -53,14 +53,14 @@ public class BaseFloatDialog extends Dialog {
|
||||
|
||||
@Override
|
||||
public void show() {
|
||||
CallerLogger.INSTANCE.d(TAG, "onShow====");
|
||||
CallerLogger.d(TAG, "onShow====");
|
||||
super.show();
|
||||
setWindowSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dismiss() {
|
||||
CallerLogger.INSTANCE.d( TAG, "onDismiss====");
|
||||
CallerLogger.d( TAG, "onDismiss====");
|
||||
super.dismiss();
|
||||
}
|
||||
private void setWindowSize(){
|
||||
|
||||
@@ -20,10 +20,12 @@ import com.mogo.eagle.core.data.enums.WarningDirectionEnum
|
||||
import com.mogo.eagle.core.data.map.Infrastructure
|
||||
import com.mogo.eagle.core.data.biz.notice.NoticeNormalData
|
||||
import com.mogo.eagle.core.data.biz.notice.NoticeTrafficStylePushData
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoHmiProvider
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.call.hmi.*
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerV2XWarningListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerTurnLightListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.ui.camera.RoadVideoDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.lookaround.*
|
||||
import com.mogo.eagle.core.function.hmi.ui.notice.DispatchDialogManager
|
||||
@@ -36,6 +38,8 @@ import com.mogo.eagle.core.function.hmi.ui.tools.AdUpgradeDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.tools.ModifyBindingCarDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.tools.ToBindingCarDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.tools.UpgradeAppDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.utils.HmiActionLog
|
||||
import com.mogo.eagle.core.function.hmi.ui.vehicle.TurnLightViewStatus
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
|
||||
import com.mogo.eagle.core.utilcode.floating.*
|
||||
import com.mogo.eagle.core.utilcode.kotlin.safeCancel
|
||||
@@ -128,7 +132,7 @@ class MoGoHmiProvider : IMoGoHmiProvider {
|
||||
return
|
||||
}
|
||||
listener?.onShow()
|
||||
CallerV2XWarningListenerManager.show(v2xType, direction, expireTime)
|
||||
//CallerV2XWarningListenerManager.show(v2xType, direction, expireTime)
|
||||
CallerLogger.d(
|
||||
"$M_HMI$TAG",
|
||||
"--- show v2x dialog 1 ---: info -> v2x-type: $v2xType : expireTime: $expireTime"
|
||||
@@ -203,11 +207,11 @@ class MoGoHmiProvider : IMoGoHmiProvider {
|
||||
}
|
||||
|
||||
override fun showWarning(v2xType: String, direction: WarningDirectionEnum, expireTime: Long) {
|
||||
CallerV2XWarningListenerManager.show(v2xType, direction, expireTime)
|
||||
//CallerV2XWarningListenerManager.show(v2xType, direction, expireTime)
|
||||
}
|
||||
|
||||
override fun dismissWarning(direction: WarningDirectionEnum) {
|
||||
CallerV2XWarningListenerManager.dismiss(direction)
|
||||
//CallerV2XWarningListenerManager.dismiss(direction)
|
||||
}
|
||||
|
||||
override fun showDispatchDialog(msgData: DispatchAdasAutoPilotLocReceiverBean) {
|
||||
@@ -281,12 +285,14 @@ class MoGoHmiProvider : IMoGoHmiProvider {
|
||||
|
||||
override fun showToBindingCarDialog() {
|
||||
if (context != null) {
|
||||
HmiActionLog.hmiAction(TAG, "showToBindingCarDialog")
|
||||
ToBindingCarDialog.show(context)
|
||||
}
|
||||
}
|
||||
|
||||
override fun showModifyBindingCarDialog() {
|
||||
if (context != null) {
|
||||
HmiActionLog.hmiAction(TAG, "showModifyBindingCarDialog")
|
||||
ModifyBindingCarDialog.show(context)
|
||||
}
|
||||
}
|
||||
@@ -356,4 +362,35 @@ class MoGoHmiProvider : IMoGoHmiProvider {
|
||||
override fun showStatusSummaryDialog() {
|
||||
context?.let { StatusView.statusView.toggle(it) }
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示红绿灯
|
||||
*/
|
||||
override fun showTrafficLightView() {
|
||||
HmiBuildConfig.isShowTrafficLightView = false
|
||||
}
|
||||
|
||||
/**
|
||||
* 隐藏红绿灯
|
||||
*/
|
||||
override fun hideTrafficLightView() {
|
||||
HmiBuildConfig.isShowTrafficLightView = true
|
||||
CallerTrafficLightListenerManager.disableTrafficLight()
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示转向灯
|
||||
*/
|
||||
override fun showTurnLightView() {
|
||||
HmiBuildConfig.isShowTurnLightView = true
|
||||
}
|
||||
|
||||
/**
|
||||
* 隐藏转向灯
|
||||
*/
|
||||
override fun hideTurnLightView() {
|
||||
HmiBuildConfig.isShowTurnLightView = false
|
||||
CallerTurnLightListenerManager.invokeHideTurnLightView()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -111,17 +111,14 @@ class M1LookAroundView: SurfaceView, SurfaceHolder.Callback, Runnable, IMoGoChas
|
||||
override fun run() {
|
||||
var isTimedBlock = false
|
||||
try {
|
||||
Log.d(TAG, "--- 1 ---")
|
||||
if (!isSurfaceValid) {
|
||||
isTimedBlock = true
|
||||
return
|
||||
}
|
||||
if (this.surfaceWidth <= 0 || this.surfaceHeight <= 0) {
|
||||
Log.d(TAG, "--- 2 ---")
|
||||
isTimedBlock = true
|
||||
return
|
||||
}
|
||||
Log.d(TAG, "--- 3 ---")
|
||||
val data = this.data ?: return
|
||||
val targetX = data.targetX
|
||||
val targetY = data.targetY
|
||||
@@ -134,28 +131,21 @@ class M1LookAroundView: SurfaceView, SurfaceHolder.Callback, Runnable, IMoGoChas
|
||||
val bytes = data.data
|
||||
if (bytes == null) {
|
||||
isTimedBlock = true
|
||||
Log.d(TAG, "--- 4 ---")
|
||||
return
|
||||
}
|
||||
Log.d(TAG, "--- 5 ---")
|
||||
val canvas = holder.lockCanvas()
|
||||
try {
|
||||
if (canvas == null) {
|
||||
Log.d(TAG, "--- 6 ---")
|
||||
isTimedBlock = true
|
||||
return
|
||||
}
|
||||
//1. 绘制图片
|
||||
var startTime = SystemClock.elapsedRealtime()
|
||||
val bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.size)
|
||||
Log.d(TAG, "--- cost for decode bitmap: ${SystemClock.elapsedRealtime() - startTime}ms.")
|
||||
if (bitmap == null) {
|
||||
Log.d(TAG, "--- 7 ---")
|
||||
isTimedBlock = true
|
||||
return
|
||||
}
|
||||
try {
|
||||
startTime = SystemClock.elapsedRealtime()
|
||||
canvas.save()
|
||||
canvas.scale(scaleX, scaleY)
|
||||
canvas.drawBitmap(bitmap, 0f, 0f, bitmapPaint)
|
||||
@@ -164,10 +154,8 @@ class M1LookAroundView: SurfaceView, SurfaceHolder.Callback, Runnable, IMoGoChas
|
||||
if (!bitmap.isRecycled) {
|
||||
bitmap.recycle()
|
||||
}
|
||||
Log.d(TAG, "--- draw decoded bitmap cost: ${SystemClock.elapsedRealtime() - startTime}ms.")
|
||||
}
|
||||
//2. 绘制车的信息
|
||||
Log.d(TAG, "--- 8 ---")
|
||||
val newTargetX = targetX * scaleX
|
||||
val newTargetY = targetY * scaleY
|
||||
val newTargetWidth = targetWidth * scaleX
|
||||
@@ -238,7 +226,6 @@ class M1LookAroundView: SurfaceView, SurfaceHolder.Callback, Runnable, IMoGoChas
|
||||
//2.2 绘制车周围盲区标定
|
||||
canvas.save()
|
||||
canvas.translate(newTargetX + newTargetWidth * 0.5f, newTargetY)
|
||||
Log.d(TAG, "--- 9 ---:[$targetX:$newTargetX, $targetY:$newTargetY, $targetWidth:$newTargetWidth, $targetHeight:$newTargetHeight]")
|
||||
val halfTargetWidth = newTargetWidth * 0.5f
|
||||
var startX = -halfTargetWidth
|
||||
var startY = BROKE_LINE_LENGTH
|
||||
@@ -341,7 +328,6 @@ class M1LookAroundView: SurfaceView, SurfaceHolder.Callback, Runnable, IMoGoChas
|
||||
}
|
||||
|
||||
override fun onAutopilotSteeringData(steering: Float) {
|
||||
Log.d(TAG, "--- onAutopilotSteeringData --: steering: $steering")
|
||||
this.steering = steering
|
||||
}
|
||||
}
|
||||
@@ -88,7 +88,7 @@ class DriverMsgBoxBubbleView @JvmOverloads constructor(
|
||||
}
|
||||
if(isShowData){
|
||||
if(category == MsgCategory.RECORD_BAG){
|
||||
if(!FunctionBuildConfig.isDemoMode){
|
||||
if(!FunctionBuildConfig.isDemoMode && FunctionBuildConfig.isShowBagRecordWindow){
|
||||
//弹出被动录包弹窗
|
||||
CallerDevaToolsManager.onReceiveBadCaseRecord(msgBoxBean,context as Activity,true)
|
||||
CallerMsgBoxEventListenerManager.invokeUpdateTipListener(true)
|
||||
|
||||
@@ -4,7 +4,9 @@ import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.DividerItemDecoration
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
@@ -55,6 +57,11 @@ class MMsgBoxListView @JvmOverloads constructor(
|
||||
//获取通知消息列表
|
||||
noticeList= CallerMsgBoxManager.getCachedNotifyData() as ArrayList<MsgBoxBean>?
|
||||
noticeList = noticeList?.let { ArrayList(it.reversed()) }
|
||||
if(noticeList.isNullOrEmpty()){
|
||||
ivMsgEmpty.visibility = View.VISIBLE
|
||||
}else{
|
||||
ivMsgEmpty.visibility = View.GONE
|
||||
}
|
||||
noticeList?.let {
|
||||
mMsgBoxListAdapter?.setData(it)
|
||||
}
|
||||
@@ -68,6 +75,9 @@ class MMsgBoxListView @JvmOverloads constructor(
|
||||
|| msgBoxList.type == MsgBoxType.OBU || msgBoxList.type == MsgBoxType.OPERATION){
|
||||
noticeList?.add(0,msgBoxList)
|
||||
noticeList?.let {
|
||||
if(it.isNotEmpty() && ivMsgEmpty.isVisible){
|
||||
ivMsgEmpty.visibility = View.GONE
|
||||
}
|
||||
mMsgBoxListAdapter?.setData(it)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.core.content.res.ResourcesCompat
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
import com.mogo.eagle.core.data.msgbox.*
|
||||
@@ -78,8 +79,8 @@ class BusPassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerV
|
||||
val v2XMsg = msgBoxBean.msgBoxBean.bean as V2XMsg
|
||||
holder.tvBusPV2XTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat())
|
||||
holder.tvBusPV2XContent.text = v2XMsg.content
|
||||
holder.ivBusPV2XImage.setImageDrawable(activity.resources.getDrawable(
|
||||
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
|
||||
holder.ivBusPV2XImage.setImageDrawable(
|
||||
ResourcesCompat.getDrawable(activity.resources,EventTypeEnumNew.getUpdateIconRes(v2XMsg.type),null))
|
||||
holder.tvBusPV2XTitle.text = EventTypeEnumNew.getEventTitle(v2XMsg.type)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.content.res.ResourcesCompat
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
@@ -193,12 +194,16 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
|
||||
val v2XMsg = msgBoxBean.bean as V2XMsg
|
||||
holder.tvV2XTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat())
|
||||
holder.tvV2XContent.text = v2XMsg.content
|
||||
holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable(
|
||||
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
|
||||
holder.ivV2XImage.setImageDrawable(ResourcesCompat.getDrawable(activity.resources,EventTypeEnumNew.getUpdateIconRes(v2XMsg.type),null))
|
||||
holder.clV2XLayout.setOnClickListener {
|
||||
CallerMsgBoxEventListenerManager.invokeBubbleV2XListener(msgBoxBean)
|
||||
}
|
||||
holder.tvV2XTitle.text = EventTypeEnumNew.getEventTitle(v2XMsg.type)
|
||||
if(v2XMsg.communicationType.isNullOrEmpty()){
|
||||
holder.tvV2XTitle.text = EventTypeEnumNew.getEventTitle(v2XMsg.type)
|
||||
}else{
|
||||
holder.tvV2XTitle.text = String.format(activity.resources.getString(R.string.v2x_title_content),
|
||||
v2XMsg.communicationType,EventTypeEnumNew.getEventTitle(v2XMsg.type))
|
||||
}
|
||||
}
|
||||
}
|
||||
is BubbleSummaryHolder -> {
|
||||
@@ -231,18 +236,23 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
|
||||
|
||||
override fun getItemViewType(position: Int): Int {
|
||||
return if(data!![position].msgBoxBean.type == MsgBoxType.OPERATION){
|
||||
if((data!![position].msgBoxBean.bean as OperationMsg).type == 0){
|
||||
//运营平台还车通知
|
||||
operationReturn
|
||||
}else if((data!![position].msgBoxBean.bean as OperationMsg).type == 1){
|
||||
//运营平台靠边停车
|
||||
operationStop
|
||||
}else if((data!![position].msgBoxBean.bean as OperationMsg).type == 3){
|
||||
//车门开启关闭失败
|
||||
operationDoorSwitchFail
|
||||
} else{
|
||||
//普通运营平台
|
||||
operation
|
||||
when ((data!![position].msgBoxBean.bean as OperationMsg).type) {
|
||||
0 -> {
|
||||
//运营平台还车通知
|
||||
operationReturn
|
||||
}
|
||||
1 -> {
|
||||
//运营平台靠边停车
|
||||
operationStop
|
||||
}
|
||||
3 -> {
|
||||
//车门开启关闭失败
|
||||
operationDoorSwitchFail
|
||||
}
|
||||
else -> {
|
||||
//普通运营平台
|
||||
operation
|
||||
}
|
||||
}
|
||||
}else if(data!![position].msgBoxBean.type == MsgBoxType.REPORT){
|
||||
report
|
||||
@@ -289,7 +299,7 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
|
||||
//Notice
|
||||
class BubbleNoticeHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var ivNoticeImage: ImageView = itemView.findViewById(R.id.ivNoticeImage)
|
||||
var tvNoticeTitle: TextView = itemView.findViewById(R.id.tvNoticeTitle)
|
||||
// var tvNoticeTitle: TextView = itemView.findViewById(R.id.tvNoticeTitle)
|
||||
var tvNoticeTime: TextView = itemView.findViewById(R.id.tvNoticeTime)
|
||||
var tvNoticeCheck: TextView = itemView.findViewById(R.id.tvNoticeCheck)
|
||||
var tvNoticeContent: TextView = itemView.findViewById(R.id.tvNoticeContent)
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.core.content.res.ResourcesCompat
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
@@ -45,9 +46,9 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
|
||||
private val summary: Int = 8
|
||||
|
||||
//Error
|
||||
val RESULT_AUTOPILOT_DISABLE = "RESULT_AUTOPILOT_DISABLE"
|
||||
val RESULT_AUTOPILOT_SYSTEM_UNSTARTED = "RESULT_AUTOPILOT_SYSTEM_UNSTARTED"
|
||||
val RESULT_REMOTEPILOT_DISABLE = "RESULT_REMOTEPILOT_DISABLE"
|
||||
private val RESULT_AUTOPILOT_DISABLE = "RESULT_AUTOPILOT_DISABLE"
|
||||
private val RESULT_AUTOPILOT_SYSTEM_UNSTARTED = "RESULT_AUTOPILOT_SYSTEM_UNSTARTED"
|
||||
private val RESULT_REMOTEPILOT_DISABLE = "RESULT_REMOTEPILOT_DISABLE"
|
||||
|
||||
fun setData(data: List<MsgBoxBean>) {
|
||||
this.data = data
|
||||
@@ -382,10 +383,13 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
|
||||
holder.tvV2XTime.text =
|
||||
TimeUtils.millis2String(it[position].timestamp, getHourMinFormat())
|
||||
holder.tvV2XContent.text = v2XMsg.content
|
||||
holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable(
|
||||
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type))
|
||||
)
|
||||
holder.tvV2XTitle.text = EventTypeEnumNew.getEventTitle(v2XMsg.type)
|
||||
holder.ivV2XImage.setImageDrawable(ResourcesCompat.getDrawable(activity.resources,EventTypeEnumNew.getUpdateIconRes(v2XMsg.type),null))
|
||||
if(v2XMsg.communicationType.isNullOrEmpty()){
|
||||
holder.tvV2XTitle.text = EventTypeEnumNew.getEventTitle(v2XMsg.type)
|
||||
}else{
|
||||
holder.tvV2XTitle.text = String.format(activity.resources.getString(R.string.v2x_title_content),
|
||||
v2XMsg.communicationType,EventTypeEnumNew.getEventTitle(v2XMsg.type))
|
||||
}
|
||||
}
|
||||
}
|
||||
is MsgBoxSummary -> {
|
||||
@@ -404,18 +408,23 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
|
||||
|
||||
override fun getItemViewType(position: Int): Int {
|
||||
return if (data!![position].type == MsgBoxType.OPERATION) {
|
||||
if((data!![position].bean as OperationMsg).type == 0){
|
||||
//运营平台还车通知
|
||||
operationReturn
|
||||
}else if((data!![position].bean as OperationMsg).type == 1){
|
||||
//运营平台靠边停车
|
||||
operationStop
|
||||
}else if((data!![position].bean as OperationMsg).type == 3){
|
||||
//开关门失败
|
||||
operationDoorSwitchFail
|
||||
} else{
|
||||
//普通运营平台
|
||||
operation
|
||||
when ((data!![position].bean as OperationMsg).type) {
|
||||
0 -> {
|
||||
//运营平台还车通知
|
||||
operationReturn
|
||||
}
|
||||
1 -> {
|
||||
//运营平台靠边停车
|
||||
operationStop
|
||||
}
|
||||
3 -> {
|
||||
//开关门失败
|
||||
operationDoorSwitchFail
|
||||
}
|
||||
else -> {
|
||||
//普通运营平台
|
||||
operation
|
||||
}
|
||||
}
|
||||
} else if (data!![position].type == MsgBoxType.NOTICE) {
|
||||
notice
|
||||
@@ -486,7 +495,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
|
||||
//Notice
|
||||
class MsgBoxNotice(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
var ivNoticeImage: ImageView = itemView.findViewById(R.id.ivNoticeImage)
|
||||
var tvNoticeTitle: TextView = itemView.findViewById(R.id.tvNoticeTitle)
|
||||
// var tvNoticeTitle: TextView = itemView.findViewById(R.id.tvNoticeTitle)
|
||||
var tvNoticeTime: TextView = itemView.findViewById(R.id.tvNoticeTime)
|
||||
var tvNoticeCheck: TextView = itemView.findViewById(R.id.tvNoticeCheck)
|
||||
var tvNoticeContent: TextView = itemView.findViewById(R.id.tvNoticeContent)
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.core.content.res.ResourcesCompat
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
import com.mogo.eagle.core.data.msgbox.*
|
||||
@@ -80,8 +81,7 @@ class MBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter<Re
|
||||
val v2XMsg = msgBoxBean.msgBoxBean.bean as V2XMsg
|
||||
holder.tvMV2XTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat())
|
||||
holder.tvMV2XContent.text = v2XMsg.content
|
||||
holder.ivMV2XImage.setImageDrawable(activity.resources.getDrawable(
|
||||
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
|
||||
holder.ivMV2XImage.setImageDrawable(ResourcesCompat.getDrawable(activity.resources,EventTypeEnumNew.getUpdateIconRes(v2XMsg.type),null))
|
||||
holder.tvMV2XTitle.text = EventTypeEnumNew.getEventTitle(v2XMsg.type)
|
||||
}
|
||||
}
|
||||
@@ -107,19 +107,23 @@ class MBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter<Re
|
||||
override fun getItemCount() = data?.size ?: 0
|
||||
|
||||
override fun getItemViewType(position: Int): Int {
|
||||
return if(data!![position].msgBoxBean.type == MsgBoxType.NOTICE){
|
||||
notice
|
||||
}else if(data!![position].msgBoxBean.type == MsgBoxType.OPERATION){
|
||||
operation
|
||||
} else{
|
||||
v2x
|
||||
return when (data!![position].msgBoxBean.type) {
|
||||
MsgBoxType.NOTICE -> {
|
||||
notice
|
||||
}
|
||||
MsgBoxType.OPERATION -> {
|
||||
operation
|
||||
}
|
||||
else -> {
|
||||
v2x
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Notice
|
||||
class BubbleNoticeHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var ivMNoticeImage: ImageView = itemView.findViewById(R.id.ivMNoticeImage)
|
||||
var tvMNoticeTitle: TextView = itemView.findViewById(R.id.tvMNoticeTitle)
|
||||
// var ivMNoticeImage: ImageView = itemView.findViewById(R.id.ivMNoticeImage)
|
||||
// var tvMNoticeTitle: TextView = itemView.findViewById(R.id.tvMNoticeTitle)
|
||||
var tvMNoticeContent: TextView = itemView.findViewById(R.id.tvMNoticeContent)
|
||||
var tvMNoticeTime: TextView = itemView.findViewById(R.id.tvMNoticeTime)
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.core.content.res.ResourcesCompat
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
@@ -105,8 +106,7 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter
|
||||
val v2XMsg = msgBoxBean.bean as V2XMsg
|
||||
holder.tvMV2XTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat())
|
||||
holder.tvMV2XContent.text = v2XMsg.content
|
||||
holder.ivMV2XImage.setImageDrawable(activity.resources.getDrawable(
|
||||
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
|
||||
holder.ivMV2XImage.setImageDrawable(ResourcesCompat.getDrawable(activity.resources,EventTypeEnumNew.getUpdateIconRes(v2XMsg.type),null))
|
||||
holder.clMVeXLayout.setOnClickListener {
|
||||
CallerMsgBoxEventListenerManager.invokeBubbleV2XListener(msgBoxBean)
|
||||
}
|
||||
@@ -168,7 +168,7 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter
|
||||
//Notice
|
||||
class BubbleNoticeHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var ivMNoticeImage: ImageView = itemView.findViewById(R.id.ivMNoticeImage)
|
||||
var tvMNoticeTitle: TextView = itemView.findViewById(R.id.tvMNoticeTitle)
|
||||
// var tvMNoticeTitle: TextView = itemView.findViewById(R.id.tvMNoticeTitle)
|
||||
var tvMNoticeContent: TextView = itemView.findViewById(R.id.tvMNoticeContent)
|
||||
var tvMNoticeCheck: TextView = itemView.findViewById(R.id.tvMNoticeCheck)
|
||||
var tvMNoticeTime: TextView = itemView.findViewById(R.id.tvMNoticeTime)
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.core.content.res.ResourcesCompat
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
@@ -98,8 +99,7 @@ class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter<R
|
||||
val v2XMsg = msgBoxBean.bean as V2XMsg
|
||||
holder.tvMV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
|
||||
holder.tvMV2XContent.text = v2XMsg.content
|
||||
holder.ivMV2XImage.setImageDrawable(activity.resources.getDrawable(
|
||||
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
|
||||
holder.ivMV2XImage.setImageDrawable(ResourcesCompat.getDrawable(activity.resources,EventTypeEnumNew.getUpdateIconRes(v2XMsg.type),null))
|
||||
holder.tvMV2XTitle.text = EventTypeEnumNew.getEventTitle(v2XMsg.type)
|
||||
}
|
||||
}
|
||||
@@ -145,7 +145,7 @@ class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter<R
|
||||
//Notice
|
||||
class ListNoticeHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var ivMNoticeImage: ImageView = itemView.findViewById(R.id.ivMNoticeImage)
|
||||
var tvMNoticeTitle: TextView = itemView.findViewById(R.id.tvMNoticeTitle)
|
||||
// var tvMNoticeTitle: TextView = itemView.findViewById(R.id.tvMNoticeTitle)
|
||||
var tvMNoticeContent: TextView = itemView.findViewById(R.id.tvMNoticeContent)
|
||||
var tvMNoticeCheck: TextView = itemView.findViewById(R.id.tvMNoticeCheck)
|
||||
var tvMNoticeTime: TextView = itemView.findViewById(R.id.tvMNoticeTime)
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.core.content.res.ResourcesCompat
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
@@ -68,13 +69,7 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView
|
||||
val noticeNormalData = noticeFrCloudMsg.noticeNormalData
|
||||
holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat())
|
||||
holder.tvPassengerNoticeContent.text = noticeNormalData?.content
|
||||
GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform(
|
||||
GlideRoundedCornersTransform(
|
||||
20f,
|
||||
GlideRoundedCornersTransform.CornerType.ALL
|
||||
)
|
||||
).into(holder.ivPassengerNoticeImage)
|
||||
holder.tvPassengerNoticeCheck.setOnClickListener {
|
||||
holder.clPassengerLayout.setOnClickListener {
|
||||
//云公告
|
||||
noticeNormalData?.let { it1 -> CallerHmiManager.showNoticeNormalData(it1) }
|
||||
}
|
||||
@@ -82,13 +77,7 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView
|
||||
val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData
|
||||
holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat())
|
||||
holder.tvPassengerNoticeContent.text = noticeTrafficStylePushData?.content
|
||||
GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).optionalTransform(
|
||||
GlideRoundedCornersTransform(
|
||||
20f,
|
||||
GlideRoundedCornersTransform.CornerType.ALL
|
||||
)
|
||||
).into(holder.ivPassengerNoticeImage)
|
||||
holder.tvPassengerNoticeCheck.setOnClickListener {
|
||||
holder.clPassengerLayout.setOnClickListener {
|
||||
//云公告
|
||||
noticeTrafficStylePushData?.let { it1 -> CallerHmiManager.showTrafficBanner(it1) }
|
||||
}
|
||||
@@ -100,14 +89,11 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView
|
||||
data?.let {
|
||||
val msgBoxBean = it[position].msgBoxBean
|
||||
val v2XMsg = msgBoxBean.bean as V2XMsg
|
||||
holder.tvPassengerV2XTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat())
|
||||
holder.tvPassengerV2XContent.text = v2XMsg.content
|
||||
holder.ivPassengerV2XImage.setImageDrawable(activity.resources.getDrawable(
|
||||
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
|
||||
holder.ivPassengerV2XImage.setImageDrawable(ResourcesCompat.getDrawable(activity.resources,EventTypeEnumNew.getUpdateIconRes(v2XMsg.type),null))
|
||||
holder.clPassengerVeXLayout.setOnClickListener {
|
||||
CallerMsgBoxEventListenerManager.invokeBubbleV2XListener(msgBoxBean)
|
||||
}
|
||||
holder.tvPassengerV2XTitle.text = EventTypeEnumNew.getEventTitle(v2XMsg.type)
|
||||
}
|
||||
}
|
||||
is BubbleSummaryHolder -> {
|
||||
@@ -155,20 +141,16 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView
|
||||
|
||||
//Notice
|
||||
class BubbleNoticeHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var ivPassengerNoticeImage: ImageView = itemView.findViewById(R.id.ivPassengerNoticeImage)
|
||||
var tvPassengerNoticeTitle: TextView = itemView.findViewById(R.id.tvPassengerNoticeTitle)
|
||||
var tvPassengerNoticeContent: TextView = itemView.findViewById(R.id.tvPassengerNoticeContent)
|
||||
var tvPassengerNoticeCheck: TextView = itemView.findViewById(R.id.tvPassengerNoticeCheck)
|
||||
var tvPassengerNoticeTime: TextView = itemView.findViewById(R.id.tvPassengerNoticeTime)
|
||||
var clPassengerLayout: RoundCanClickConstraintLayout = itemView.findViewById(R.id.clPassengerLayout)
|
||||
}
|
||||
|
||||
//OBU、V2X
|
||||
class BubbleV2XHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var ivPassengerV2XImage: ImageView = itemView.findViewById(R.id.ivPassengerV2XImage)
|
||||
var tvPassengerV2XTime: TextView = itemView.findViewById(R.id.tvPassengerV2XTime)
|
||||
var tvPassengerV2XContent: TextView = itemView.findViewById(R.id.tvPassengerV2XContent)
|
||||
var clPassengerVeXLayout: RoundCanClickConstraintLayout = itemView.findViewById(R.id.clPassengerVeXLayout)
|
||||
var tvPassengerV2XTitle: TextView = itemView.findViewById(R.id.tvPassengerV2XTitle)
|
||||
}
|
||||
|
||||
//汇总消息
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.core.content.res.ResourcesCompat
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
@@ -95,8 +96,7 @@ class PassengerMsgBoxListAdapter(private val activity: Activity): RecyclerView.A
|
||||
val v2XMsg = msgBoxBean.bean as V2XMsg
|
||||
holder.tvPassengerV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
|
||||
holder.tvPassengerV2XContent.text = v2XMsg.content
|
||||
holder.ivPassengerV2XImage.setImageDrawable(activity.resources.getDrawable(
|
||||
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
|
||||
holder.ivPassengerV2XImage.setImageDrawable(ResourcesCompat.getDrawable(activity.resources,EventTypeEnumNew.getUpdateIconRes(v2XMsg.type),null))
|
||||
holder.tvPassengerV2XTitle.text = EventTypeEnumNew.getEventTitle(v2XMsg.type)
|
||||
}
|
||||
}
|
||||
@@ -130,7 +130,7 @@ class PassengerMsgBoxListAdapter(private val activity: Activity): RecyclerView.A
|
||||
//Notice
|
||||
class ListNoticeHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var ivPassengerNoticeImage: ImageView = itemView.findViewById(R.id.ivPassengerNoticeImage)
|
||||
var tvPassengerNoticeTitle: TextView = itemView.findViewById(R.id.tvPassengerNoticeTitle)
|
||||
// var tvPassengerNoticeTitle: TextView = itemView.findViewById(R.id.tvPassengerNoticeTitle)
|
||||
var tvPassengerNoticeContent: TextView = itemView.findViewById(R.id.tvPassengerNoticeContent)
|
||||
var tvPassengerNoticeCheck: TextView = itemView.findViewById(R.id.tvPassengerNoticeCheck)
|
||||
var tvPassengerNoticeTime: TextView = itemView.findViewById(R.id.tvPassengerNoticeTime)
|
||||
|
||||
@@ -142,7 +142,7 @@ public class RoundedDrawable extends Drawable {
|
||||
drawable.draw(canvas);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
CallerLogger.INSTANCE.w(M_HMI + TAG, "Failed to create bitmap from drawable!");
|
||||
CallerLogger.w(M_HMI + TAG, "Failed to create bitmap from drawable!");
|
||||
bitmap = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -273,7 +273,7 @@ public class RoundedImageView extends AppCompatImageView {
|
||||
try {
|
||||
d = rsrc.getDrawable(mResource);
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.w(M_HMI + TAG, "Unable to find resource : " + mResource + " exception : " + e);
|
||||
CallerLogger.w(M_HMI + TAG, "Unable to find resource : " + mResource + " exception : " + e);
|
||||
// Don't try again.
|
||||
mResource = 0;
|
||||
}
|
||||
@@ -311,7 +311,7 @@ public class RoundedImageView extends AppCompatImageView {
|
||||
try {
|
||||
d = rsrc.getDrawable(mBackgroundResource);
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.w(M_HMI + TAG, "Unable to find resource : " + mBackgroundResource + " exception : " + e);
|
||||
CallerLogger.w(M_HMI + TAG, "Unable to find resource : " + mBackgroundResource + " exception : " + e);
|
||||
// Don't try again.
|
||||
mBackgroundResource = 0;
|
||||
}
|
||||
|
||||
@@ -89,6 +89,7 @@ import kotlin.collections.component3
|
||||
import kotlin.collections.component4
|
||||
import kotlin.collections.set
|
||||
import kotlin.math.abs
|
||||
import kotlin.system.exitProcess
|
||||
|
||||
|
||||
/**
|
||||
@@ -745,6 +746,9 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
CallerAutoPilotControlManager.sendIpcReboot()
|
||||
ToastUtils.showLong("重启命令已发送")
|
||||
}
|
||||
btnAppReboot.onClick {
|
||||
killApp()
|
||||
}
|
||||
//只在司机端设置工控机节点重启功能
|
||||
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
btnIpcReboot.visibility = View.GONE
|
||||
@@ -895,6 +899,12 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
//初始化ADAS日志开关状态
|
||||
tbADASLog.isChecked = CallerAutoPilotControlManager.isEnableLog()
|
||||
|
||||
//如果工控机异常上报列表窗口为展示状态,则显示上报异常布局
|
||||
if(CallerDevaToolsManager.getReportWindowStatus()){
|
||||
reportMsgLayout.visibility = View.VISIBLE
|
||||
tbReportMore.isChecked = true
|
||||
}
|
||||
|
||||
//查看上报历史列表
|
||||
tbReportMore.setOnCheckedChangeListener { _, isChecked ->
|
||||
clickListener?.showReportListWindow(isChecked)
|
||||
@@ -1371,27 +1381,19 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
v.visibility = View.INVISIBLE
|
||||
logLoadingView?.visibility = View.VISIBLE
|
||||
v.scope.launch(Dispatchers.IO) {
|
||||
val file = CallerDevaToolsManager.logcat()?.export()
|
||||
if (file != null && file.exists()) {
|
||||
withContext(Dispatchers.Main) {
|
||||
var activity = AppStateManager.currentActivity()
|
||||
while (activity == null) {
|
||||
delay(2000)
|
||||
activity = AppStateManager.currentActivity()
|
||||
if (activity != null) {
|
||||
break
|
||||
}
|
||||
}
|
||||
activity?.startActivity(Intent.createChooser(Intent().also {
|
||||
it.action = Intent.ACTION_SEND
|
||||
it.type = "application/zip"
|
||||
it.putExtra(Intent.EXTRA_STREAM, FileProvider.getUriForFile(activity, "${activity.packageName}.fileProvider", file))
|
||||
}, "分享全量日志压缩包到"))
|
||||
}
|
||||
} else {
|
||||
ToastUtils.showShort("全量日志压缩文件生成失败")
|
||||
var isUploadSuccess = false
|
||||
try {
|
||||
CallerDevaToolsManager.logcat()?.upload()
|
||||
isUploadSuccess = true
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
withContext(Dispatchers.Main) {
|
||||
if (isUploadSuccess) {
|
||||
ToastUtils.showShort("上传成功")
|
||||
} else {
|
||||
ToastUtils.showShort("上传失败")
|
||||
}
|
||||
logLoadingView?.visibility = View.INVISIBLE
|
||||
exportAllLogs?.visibility = View.VISIBLE
|
||||
}
|
||||
@@ -1573,6 +1575,13 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
tvGitBranchInfo.text = "Git分支:${AppConfigInfo.workingBranchName}"
|
||||
tvAppBuildTimeInfo.text = "版本构建时间:${AppConfigInfo.appBuildTime}"
|
||||
|
||||
if(tbBeautyMode.isVisible){
|
||||
val version = ParseVersionUtils.parseVersion(true, CallerAutoPilotStatusListenerManager.getDockerVersion())
|
||||
if(version >= 30100 && AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)){
|
||||
tbBeautyMode.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 状态中心
|
||||
*/
|
||||
@@ -2022,6 +2031,17 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
private fun killApp() {
|
||||
Intent(Intent.ACTION_MAIN).apply {
|
||||
addCategory(Intent.CATEGORY_HOME)
|
||||
flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
context.startActivity(this)
|
||||
Process.killProcess(Process.myPid())
|
||||
exitProcess(0)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 初始化上报
|
||||
*/
|
||||
|
||||
@@ -11,12 +11,14 @@ import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig
|
||||
import com.mogo.eagle.core.data.multidisplay.TelematicConstant
|
||||
import com.mogo.eagle.core.data.obu.MogoObuConst
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoGetParamResponseListener
|
||||
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsFuncConfigListener
|
||||
import com.mogo.eagle.core.function.api.devatools.mofang.*
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.FUNC_MODE_DEMO
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.FUNC_MODE_RAIN
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotGetParamResponseDispatcher
|
||||
import com.mogo.eagle.core.function.call.devatools.*
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuApiManager
|
||||
@@ -25,11 +27,13 @@ import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.ui.utils.HmiActionLog.Companion.hmiAction
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.zhjt.mogo.adas.data.AdasConstants
|
||||
import com.zhjt.mogo.adas.data.bean.AdasParam
|
||||
import kotlinx.android.synthetic.main.view_sop_setting.view.*
|
||||
import kotlinx.android.synthetic.main.view_sop_setting.view.tbRouteDynamicEffect
|
||||
import mogo.telematics.pad.MessagePad
|
||||
|
||||
/**
|
||||
* SOP设置窗口
|
||||
@@ -39,7 +43,8 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoDevaToolsFuncConfigListener,
|
||||
IViewControlListener, IMoGoMoFangProvider.OnMoFangStatusListener {
|
||||
IViewControlListener, IMoGoMoFangProvider.OnMoFangStatusListener,
|
||||
IMoGoGetParamResponseListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "SOPSettingView"
|
||||
@@ -101,6 +106,16 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
FunctionBuildConfig.isV2NPnc = isChecked
|
||||
}
|
||||
|
||||
tbV2iPnc.isChecked = FunctionBuildConfig.isV2IPnc
|
||||
tbV2iPnc.setOnCheckedChangeListener{ compoundButton, isChecked ->
|
||||
if(!compoundButton.isPressed){
|
||||
return@setOnCheckedChangeListener
|
||||
}
|
||||
hmiAction("SOP V2I场景进PNC, ",isChecked)
|
||||
CallerAutoPilotControlManager.sendV2iToPncCmd(isChecked)
|
||||
FunctionBuildConfig.isV2IPnc = isChecked
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认打开
|
||||
*/
|
||||
@@ -147,14 +162,13 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
tbTrafficLight.isChecked = HmiBuildConfig.isShowTrafficLightView
|
||||
tbTrafficLight.isChecked = !HmiBuildConfig.isShowTrafficLightView
|
||||
tbTrafficLight.setOnCheckedChangeListener { _, isChecked ->
|
||||
hmiAction("SOP 红绿灯标识开关, ",isChecked)
|
||||
if (!isChecked) {
|
||||
HmiBuildConfig.isShowTrafficLightView = false
|
||||
if (isChecked) {
|
||||
CallerHmiManager.showTrafficLightView()
|
||||
} else {
|
||||
HmiBuildConfig.isShowTrafficLightView = true
|
||||
CallerTrafficLightListenerManager.disableTrafficLight()
|
||||
CallerHmiManager.hideTrafficLightView()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,6 +260,56 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
//弱网减速停车
|
||||
tbWeakNetSlowDown.isChecked = FunctionBuildConfig.isWeakNetSlowDown
|
||||
tbWeakNetSlowDown.setOnCheckedChangeListener{_, isChecked ->
|
||||
FunctionBuildConfig.isWeakNetSlowDown = isChecked
|
||||
CallerAutoPilotControlManager.sendWeakNetSlowDown(isChecked)
|
||||
hmiAction("SOP 弱网减速停车, ",isChecked)
|
||||
}
|
||||
|
||||
//故障减速停车
|
||||
tbFaultSlowDown.isChecked = FunctionBuildConfig.isFaultSlowDown
|
||||
tbFaultSlowDown.setOnCheckedChangeListener{_, isChecked ->
|
||||
FunctionBuildConfig.isFaultSlowDown = isChecked
|
||||
CallerAutoPilotControlManager.sendBreakdownSlowDown(isChecked)
|
||||
hmiAction("SOP 故障减速停车, ",isChecked)
|
||||
}
|
||||
|
||||
//是否展示被动触发的录包弹窗(自动驾驶下出现问题触发的录包)
|
||||
tbShowBagRecordWindow.isChecked = FunctionBuildConfig.isShowBagRecordWindow
|
||||
tbShowBagRecordWindow.setOnCheckedChangeListener{_, isChecked ->
|
||||
FunctionBuildConfig.isShowBagRecordWindow = isChecked
|
||||
hmiAction("SOP 是否展示被动触发的录包弹窗, ",isChecked)
|
||||
}
|
||||
//融合模式
|
||||
rgFusionMode.setOnCheckedChangeListener { _, p1 ->
|
||||
when(p1){
|
||||
//全融合模式
|
||||
R.id.rbFullIntegration ->{
|
||||
FunctionBuildConfig.fusionMode = 1
|
||||
}
|
||||
//盲区模式
|
||||
R.id.rbBlind ->{
|
||||
FunctionBuildConfig.fusionMode = 2
|
||||
}
|
||||
//超视距模式
|
||||
R.id.rbBeyondSight ->{
|
||||
FunctionBuildConfig.fusionMode = 3
|
||||
}
|
||||
//透传模式
|
||||
R.id.rbTransparent ->{
|
||||
FunctionBuildConfig.fusionMode = 4
|
||||
}
|
||||
//纯路侧模式
|
||||
R.id.rbPureRoad ->{
|
||||
FunctionBuildConfig.fusionMode = 5
|
||||
}
|
||||
}
|
||||
CallerAutoPilotControlManager.sendFusionMode(FunctionBuildConfig.fusionMode)
|
||||
}
|
||||
|
||||
|
||||
//变道绕障的目标障碍物速度阈值
|
||||
tvSpeed.text = "${FunctionBuildConfig.detouringSpeed} m/s"
|
||||
ivSpeedReduce.setOnClickListener {
|
||||
@@ -338,8 +402,9 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
FuncBizConfig.FOUNDATION, TAG, true, this
|
||||
)
|
||||
CallerHmiViewControlListenerManager.addListener(TAG,this)
|
||||
// 开启定时查询速度
|
||||
// Timer().schedule(timerTaskRefresh, Date(), 500)
|
||||
CallerAutopilotGetParamResponseDispatcher.addListener(TAG, this)
|
||||
//查询融合模式
|
||||
CallerAutoPilotControlManager.sendGetParamReq(AdasConstants.MapSystemParamType.FUSION_MODE)
|
||||
}
|
||||
|
||||
override fun updateFuncMode(tag: String, boolean: Boolean) {
|
||||
@@ -357,12 +422,7 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
// 移除 业务配置监听
|
||||
CallerDevaToolsFuncConfigListenerManager.unRegisterDevaToolsFuncConfigListener(FuncBizConfig.FOUNDATION, TAG)
|
||||
CallerHmiViewControlListenerManager.removeListener(TAG)
|
||||
// try {
|
||||
// timerTaskRefresh.cancel()
|
||||
// } catch (e: Exception) {
|
||||
// e.printStackTrace()
|
||||
// }
|
||||
|
||||
CallerAutopilotGetParamResponseDispatcher.removeListener(TAG)
|
||||
CallerDevaToolsManager.mofang()?.unRegisterMoFangStatusListener(this)
|
||||
}
|
||||
|
||||
@@ -433,4 +493,40 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
override fun onMoFangCombineClicked(vararg keyCodes: Int) {}
|
||||
|
||||
override fun onMoFangStatusError(msg: String) {}
|
||||
|
||||
/**
|
||||
* 工控机配置参数获取
|
||||
*/
|
||||
override fun onGetParamResp(
|
||||
header: MessagePad.Header,
|
||||
getParamResp: MessagePad.SetParamReq,
|
||||
adasParam: AdasParam
|
||||
) {
|
||||
//融合模式
|
||||
ThreadUtils.runOnUiThread {
|
||||
FunctionBuildConfig.fusionMode = adasParam.fusionMode
|
||||
when(FunctionBuildConfig.fusionMode){
|
||||
1->{
|
||||
//全融合模式
|
||||
rgFusionMode.check(R.id.rbFullIntegration)
|
||||
}
|
||||
2->{
|
||||
//盲区模式
|
||||
rgFusionMode.check(R.id.rbBlind)
|
||||
}
|
||||
3->{
|
||||
//超视距模式
|
||||
rgFusionMode.check(R.id.rbBeyondSight)
|
||||
}
|
||||
4->{
|
||||
//透传模式
|
||||
rgFusionMode.check(R.id.rbTransparent)
|
||||
}
|
||||
5->{
|
||||
//纯路侧模式
|
||||
rgFusionMode.check(R.id.rbPureRoad)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import android.view.View
|
||||
import android.widget.FrameLayout
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.deva.bindingcar.IPCUpgradeStateInfo
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig
|
||||
import com.mogo.eagle.core.data.temp.EventLogout
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
@@ -24,6 +25,7 @@ import com.mogo.eagle.core.function.msgbox.MsgBoxConfig
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.zhjt.service_biz.BizConfig
|
||||
import kotlinx.android.synthetic.main.view_auto_pilot_check.view.*
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
@@ -149,9 +151,17 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
if (AppConfigInfo.isConnectAutopilot) {
|
||||
CallerAutoPilotControlManager.getCarConfig()
|
||||
}
|
||||
// if (maxAcceleration > 0) {
|
||||
|
||||
initSpeedSetView()
|
||||
initOchView()
|
||||
}
|
||||
|
||||
@BizConfig(FuncBizConfig.FOUNDATION, "", FuncBizConfig.BIZ_LIMIT_SPEED_SET)
|
||||
private fun initSpeedSetView(){
|
||||
// if (maxAcceleration > 0) {
|
||||
// tvAcceleration.text = "加速度 $maxAcceleration m/s²"
|
||||
// }
|
||||
clSpeedSet.visibility = View.VISIBLE
|
||||
tvAcceleration.text = "每次调整车速±5km/h,点击确定生效"
|
||||
if (speedLimit > 0) {
|
||||
etInputSpeed.setText(speedLimit.toString())
|
||||
@@ -176,7 +186,7 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
svLayout.post {
|
||||
svLayout.fullScroll(View.FOCUS_DOWN)
|
||||
}
|
||||
if (!CallerAutoPilotStatusListenerManager.getConnectStates()) {
|
||||
if (!CallerAutoPilotStatusListenerManager.isConnect()) {
|
||||
ToastUtils.showShort("设置车速失败,请启动域控制器")
|
||||
keyBoardUtil?.hideKeyboard()
|
||||
return@setOnTouchListener true
|
||||
@@ -237,8 +247,6 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
etInputSpeed.setSelection(speedLimit.toString().length)
|
||||
}catch (_:Exception){}
|
||||
}
|
||||
|
||||
initOchView()
|
||||
}
|
||||
|
||||
private fun initOchView() {
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.mogo.commons.module.status.StatusDescriptor
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.utils.HmiActionLog
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
|
||||
|
||||
@@ -56,10 +57,12 @@ class ToBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifecycle
|
||||
cancelTv = findViewById(R.id.tv_to_bindingcar_cancel)
|
||||
|
||||
confirmTv?.setOnClickListener {
|
||||
HmiActionLog.hmiAction(TAG,"toBindingCar")
|
||||
toBindingCar()
|
||||
}
|
||||
|
||||
cancelTv?.setOnClickListener {
|
||||
HmiActionLog.hmiAction(TAG,"dismiss")
|
||||
dismiss()
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ class PncActionsView @JvmOverloads constructor(
|
||||
private var mTrafficLightResult: TrafficLightResult? = null
|
||||
|
||||
private val bgResources: Int
|
||||
private val topMargin: Float
|
||||
private val txtSize: Float
|
||||
|
||||
init {
|
||||
@@ -50,10 +49,6 @@ class PncActionsView @JvmOverloads constructor(
|
||||
R.styleable.PncActionsView_background_resource,
|
||||
R.drawable.pnc_actions_bg
|
||||
)
|
||||
topMargin = a.getDimension(
|
||||
R.styleable.PncActionsView_pnc_top_margin,
|
||||
resources.getDimension(R.dimen.dp_30)
|
||||
)
|
||||
txtSize = a.getDimension(
|
||||
R.styleable.PncActionsView_pnc_size,
|
||||
resources.getDimension(R.dimen.dp_34)
|
||||
@@ -63,7 +58,6 @@ class PncActionsView @JvmOverloads constructor(
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
(tvHmiPncActions.layoutParams as MarginLayoutParams).topMargin = topMargin.toInt()
|
||||
tvHmiPncActions.setTextSize(COMPLEX_UNIT_PX, txtSize)
|
||||
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
@@ -81,7 +75,7 @@ class PncActionsView @JvmOverloads constructor(
|
||||
override fun onAutopilotStatusResponse(state: Int) {
|
||||
if (state != STATUS_AUTOPILOT_RUNNING) {
|
||||
UiThreadHandler.post {
|
||||
this.background = null
|
||||
tvHmiPncActions.background = null
|
||||
tvHmiPncActions.text = ""
|
||||
}
|
||||
}
|
||||
@@ -117,15 +111,15 @@ class PncActionsView @JvmOverloads constructor(
|
||||
}
|
||||
// update view
|
||||
if (actions.isNullOrEmpty()) {
|
||||
this.background = null
|
||||
tvHmiPncActions.background = null
|
||||
tvHmiPncActions.text = ""
|
||||
} else {
|
||||
this.background =
|
||||
tvHmiPncActions.background =
|
||||
AppCompatResources.getDrawable(context, bgResources)
|
||||
tvHmiPncActions.text = actions
|
||||
}
|
||||
} else {
|
||||
this.background = null
|
||||
tvHmiPncActions.background = null
|
||||
tvHmiPncActions.text = ""
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,8 +11,11 @@ import android.view.animation.Animation
|
||||
import android.widget.ImageView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import chassis.Chassis
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener
|
||||
import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTurnLightListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerTurnLightListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import kotlinx.android.synthetic.main.view_turn_light_status.view.*
|
||||
@@ -27,7 +30,8 @@ open class TurnLightViewStatus @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoChassisLamplightListener {
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoChassisLamplightListener,
|
||||
IMoGoTurnLightListener {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "TurnLightViewStatus"
|
||||
@@ -41,11 +45,21 @@ open class TurnLightViewStatus @JvmOverloads constructor(
|
||||
init {
|
||||
val typedArray = context.obtainStyledAttributes(attrs, R.styleable.TurnLightView)
|
||||
val dayLight = typedArray.getBoolean(R.styleable.TurnLightView_day_light_mode, false)
|
||||
if (dayLight) {
|
||||
LayoutInflater.from(context)
|
||||
.inflate(R.layout.view_turn_light_status_daytime, this, true)
|
||||
} else {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_turn_light_status, this, true)
|
||||
val user = typedArray.getInt(R.styleable.TurnLightView_user,0)
|
||||
if(user!=0){
|
||||
when(user){
|
||||
1 ->{
|
||||
LayoutInflater.from(context)
|
||||
.inflate(R.layout.view_turn_light_status_taxi_p, this, true)
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (dayLight) {
|
||||
LayoutInflater.from(context)
|
||||
.inflate(R.layout.view_turn_light_status_daytime, this, true)
|
||||
} else {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_turn_light_status, this, true)
|
||||
}
|
||||
}
|
||||
visible = typedArray.getBoolean(R.styleable.TurnLightView_visible, false)
|
||||
if (visible) {
|
||||
@@ -59,18 +73,33 @@ open class TurnLightViewStatus @JvmOverloads constructor(
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerChassisLamplightListenerManager.addListener(TAG, this)
|
||||
CallerTurnLightListenerManager.addListener(TAG,this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerChassisLamplightListenerManager.removeListener(TAG)
|
||||
CallerTurnLightListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
override fun hideTurnLightView() {
|
||||
ThreadUtils.runOnUiThread{
|
||||
if (!isDisappear) {
|
||||
isDisappear = true
|
||||
isLeftLight = false
|
||||
isRightLight = false
|
||||
animationDisappear()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch?) {
|
||||
super.onAutopilotLightSwitchData(lightSwitch)
|
||||
lightSwitch?.let {
|
||||
ThreadUtils.runOnUiThread {
|
||||
setTurnLight(it)
|
||||
if(HmiBuildConfig.isShowTurnLightView){
|
||||
lightSwitch?.let {
|
||||
ThreadUtils.runOnUiThread {
|
||||
setTurnLight(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import android.widget.LinearLayout
|
||||
import com.mogo.eagle.core.function.api.devatools.mofang.*
|
||||
import com.mogo.eagle.core.function.call.devatools.*
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import kotlinx.android.synthetic.main.view_blue_tooth.view.*
|
||||
|
||||
/**
|
||||
@@ -26,6 +27,9 @@ open class BlueToothView: LinearLayout, IMoGoMoFangProvider.OnMoFangStatusListen
|
||||
LayoutInflater.from(context).inflate(R.layout.view_blue_tooth
|
||||
, this, true)
|
||||
visibility = View.GONE
|
||||
|
||||
clipChildren = false
|
||||
clipToPadding = false
|
||||
}
|
||||
|
||||
companion object{
|
||||
@@ -58,6 +62,21 @@ open class BlueToothView: LinearLayout, IMoGoMoFangProvider.OnMoFangStatusListen
|
||||
if (it.visibility != View.VISIBLE) {
|
||||
it.visibility = View.VISIBLE
|
||||
}
|
||||
val oldTextColor = it.currentTextColor
|
||||
if (battery <= 30) {
|
||||
if (oldTextColor != Color.RED) {
|
||||
it.setTextColor(Color.RED)
|
||||
ivMoFangStatus?.drawable?.setTint(Color.RED)
|
||||
postDelayed({
|
||||
ToastUtils.showShort("蘑方处于低电状态, 请及时充电")
|
||||
}, 5000)
|
||||
}
|
||||
} else {
|
||||
if (oldTextColor != Color.WHITE) {
|
||||
it.setTextColor(Color.WHITE)
|
||||
ivMoFangStatus?.drawable?.setTint(Color.WHITE)
|
||||
}
|
||||
}
|
||||
it.text = "${battery}%"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,205 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.RelativeLayout
|
||||
import com.mogo.commons.utils.MogoAnalyticUtils
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils.OnNetworkStatusChangedListener
|
||||
import com.mogo.eagle.core.utilcode.util.SpanUtils
|
||||
import kotlinx.android.synthetic.main.view_connect_status.view.tvADASStatus
|
||||
import kotlinx.android.synthetic.main.view_connect_status.view.tvNetStatus
|
||||
|
||||
/**
|
||||
* 当前APP的各种连接状态展示
|
||||
* 网络连接、ADAS、外网
|
||||
*/
|
||||
class ConnectStatusView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : RelativeLayout(context, attrs, defStyleAttr), IMoGoAutopilotStatusListener {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "ConnectStatusView"
|
||||
}
|
||||
|
||||
private var onNetworkStatusChangedListener: OnNetworkStatusChangedListener
|
||||
|
||||
// 断开网络的次数
|
||||
private var disconnectNetCount = 0
|
||||
private var disconnectNetTime = 0L
|
||||
|
||||
// 断开ADAS的次数
|
||||
private var disconnectADASCount = 0
|
||||
private var disconnectADASTime = 0L
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_connect_status, this, true)
|
||||
val netSpan = SpanUtils.with(tvNetStatus)
|
||||
netSpan.append("网络连接:")
|
||||
if (NetworkUtils.isConnected()) {
|
||||
netSpan.append("已连接")
|
||||
.setForegroundColor(Color.GREEN)
|
||||
} else {
|
||||
disconnectNetCount++
|
||||
netSpan.append("已断开")
|
||||
.setForegroundColor(Color.RED)
|
||||
netSpan.append("| 断链次数:")
|
||||
.append("$disconnectNetCount")
|
||||
.setForegroundColor(Color.RED)
|
||||
}
|
||||
netSpan.create()
|
||||
|
||||
onNetworkStatusChangedListener = object : OnNetworkStatusChangedListener {
|
||||
override fun onDisconnected() {
|
||||
disconnectNetCount++
|
||||
disconnectNetTime = System.currentTimeMillis()
|
||||
val netSpan = SpanUtils.with(tvNetStatus)
|
||||
netSpan.append("网络连接:")
|
||||
.append("已断开")
|
||||
.setForegroundColor(Color.RED)
|
||||
netSpan.append("| 断链次数:")
|
||||
.append("$disconnectNetCount")
|
||||
.setForegroundColor(Color.RED)
|
||||
netSpan.create()
|
||||
//netSpan.append("断开时常").append("$disconnectNetCount").setForegroundColor(Color.RED)
|
||||
|
||||
// 统计代码
|
||||
val properties: MutableMap<String, Any> = HashMap()
|
||||
properties["连接状态"] = "已断开"
|
||||
properties["重连次数"] = "$disconnectNetCount"
|
||||
MogoAnalyticUtils.track("SYS_NET_STATUS", properties)
|
||||
|
||||
}
|
||||
|
||||
override fun onConnected(networkType: NetworkUtils.NetworkType?) {
|
||||
// 统计代码
|
||||
val properties: MutableMap<String, Any> = HashMap()
|
||||
properties["连接状态"] = "已连接"
|
||||
properties["重连次数"] = "$disconnectNetCount"
|
||||
|
||||
val netSpan = SpanUtils.with(tvNetStatus)
|
||||
netSpan.append("网络连接:")
|
||||
.append("已连接")
|
||||
.setForegroundColor(Color.GREEN)
|
||||
netSpan.append("| 断链次数:")
|
||||
.append("$disconnectNetCount")
|
||||
.setForegroundColor(Color.RED)
|
||||
if (disconnectNetTime != 0L) {
|
||||
netSpan.append("| 断开时常:")
|
||||
.append("${(System.currentTimeMillis() - disconnectNetTime) / 1000} s")
|
||||
.setForegroundColor(Color.RED)
|
||||
properties["断开时常"] =
|
||||
"${(System.currentTimeMillis() - disconnectNetTime) / 1000} s"
|
||||
}
|
||||
netSpan.create()
|
||||
|
||||
MogoAnalyticUtils.track("SYS_NET_STATUS", properties)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotIpcConnectStatusChanged(status: Int, reason: String?) {
|
||||
super.onAutopilotIpcConnectStatusChanged(status, reason)
|
||||
tvADASStatus.post {
|
||||
when (status) {
|
||||
IPC_CONNECTION_STATUS.CONNECTED -> {
|
||||
// 统计代码
|
||||
val properties: MutableMap<String, Any> = HashMap()
|
||||
properties["连接状态"] = "已连接"
|
||||
properties["重连次数"] = "$disconnectADASCount"
|
||||
|
||||
val adasSpan = SpanUtils.with(tvADASStatus)
|
||||
adasSpan.append("ADAS连接:")
|
||||
.append("已连接")
|
||||
.setForegroundColor(Color.GREEN)
|
||||
adasSpan.append("| 重连次数:")
|
||||
.append("$disconnectADASCount")
|
||||
.setForegroundColor(Color.RED)
|
||||
|
||||
if (disconnectADASTime != 0L) {
|
||||
adasSpan.append("| 断开时常:")
|
||||
.append("${(System.currentTimeMillis() - disconnectADASTime) / 1000} s")
|
||||
.setForegroundColor(Color.RED)
|
||||
properties["断开时常"] =
|
||||
"${(System.currentTimeMillis() - disconnectADASTime) / 1000} s"
|
||||
}
|
||||
adasSpan.create()
|
||||
|
||||
MogoAnalyticUtils.track("IPC_CONNECTION_STATUS", properties)
|
||||
}
|
||||
|
||||
IPC_CONNECTION_STATUS.DISCONNECTED -> {
|
||||
disconnectADASCount++
|
||||
disconnectADASTime = System.currentTimeMillis()
|
||||
val adasSpan = SpanUtils.with(tvADASStatus)
|
||||
|
||||
// 统计代码
|
||||
val properties: MutableMap<String, Any> = HashMap()
|
||||
properties["连接状态"] = "已断开"
|
||||
properties["重连次数"] = "$disconnectADASCount"
|
||||
|
||||
MogoAnalyticUtils.track("IPC_CONNECTION_STATUS", properties)
|
||||
|
||||
adasSpan.append("ADAS连接:")
|
||||
.append("已断开")
|
||||
.setForegroundColor(Color.RED)
|
||||
|
||||
adasSpan.append("| 重连次数:")
|
||||
.append("$disconnectADASCount")
|
||||
.setForegroundColor(Color.RED)
|
||||
adasSpan.create()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
NetworkUtils.registerNetworkStatusChangedListener(onNetworkStatusChangedListener)
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
NetworkUtils.unregisterNetworkStatusChangedListener(onNetworkStatusChangedListener)
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
interface IPC_CONNECTION_STATUS {
|
||||
companion object {
|
||||
/**
|
||||
* 已连接
|
||||
*/
|
||||
const val CONNECTED = 0x00
|
||||
|
||||
/**
|
||||
* 未连接
|
||||
*/
|
||||
const val DISCONNECTED = 0x01
|
||||
|
||||
/**
|
||||
* 正在连接
|
||||
*/
|
||||
const val CONNECTING = 0x02
|
||||
|
||||
/**
|
||||
* 正在搜索IP
|
||||
*/
|
||||
const val SEARCH_ADDRESS = 0x03
|
||||
|
||||
/**
|
||||
* 找不到可用IP 传入的IP不可用或固定IP列表中所有IP不可用
|
||||
*/
|
||||
const val NOT_FOUND_ADDRESS = 0x04
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -57,7 +57,8 @@ class RomaBusView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
setOnClickListener {
|
||||
if (ClickUtils.isClickTooFrequent(this,1200)) {
|
||||
if (ClickUtils.isClickTooFrequent(this,2500)) {
|
||||
ToastUtils.showShort("不要频繁点击哦~")
|
||||
return@setOnClickListener
|
||||
}
|
||||
if(!click){
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.os.Message
|
||||
import android.text.Html
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.util.TypedValue
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.function.api.map.roma.IMoGoRomaListener
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRomaListener
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import kotlinx.android.synthetic.main.view_roma_distance.view.*
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
class RomaDistanceView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoRomaListener {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "RomaDistanceView"
|
||||
}
|
||||
|
||||
private var disChangeColor = false
|
||||
private var dis: Int = 0
|
||||
private val mHandler = object : Handler(Looper.getMainLooper()) {
|
||||
override fun handleMessage(msg: Message) {
|
||||
super.handleMessage(msg)
|
||||
if (msg.what == 1) {
|
||||
if (dis != 0) {
|
||||
if (romaDistanceBg.visibility == View.GONE) {
|
||||
romaDistanceBg.visibility = View.VISIBLE
|
||||
}
|
||||
if (disChangeColor) {
|
||||
romaDistanceMeter.text =
|
||||
Html.fromHtml("<font color='#293449'>漫游距离</font><font color='#0752C3'>${dis}米</font>")
|
||||
} else {
|
||||
romaDistanceMeter.text = "漫游距离${dis}米"
|
||||
}
|
||||
}
|
||||
}
|
||||
sendEmptyMessageDelayed(1, 1000)
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_roma_distance, this, true)
|
||||
val a = context.obtainStyledAttributes(
|
||||
attrs,
|
||||
R.styleable.RomaDistanceView,
|
||||
defStyleAttr,
|
||||
0
|
||||
)
|
||||
val distanceBg = a.getResourceId(R.styleable.RomaDistanceView_roma_distance_bg, 0)
|
||||
if (distanceBg != 0) {
|
||||
romaDistanceBg.background = resources.getDrawable(distanceBg)
|
||||
}
|
||||
val txtSize = a.getInteger(R.styleable.RomaDistanceView_roma_txt_size, 35)
|
||||
romaDistanceMeter.setTextSize(
|
||||
TypedValue.COMPLEX_UNIT_PX,
|
||||
AutoSizeUtils.dp2px(getContext(), txtSize.toFloat()).toFloat()
|
||||
)
|
||||
val txtDisColor = a.getBoolean(R.styleable.RomaDistanceView_roma_change_dis_color, false)
|
||||
disChangeColor = txtDisColor
|
||||
a.recycle()
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerMapRomaListener.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun romaStatus(status: Boolean) {
|
||||
super.romaStatus(status)
|
||||
if (status) {
|
||||
mHandler.sendEmptyMessageDelayed(1, 500)
|
||||
} else {
|
||||
mHandler.removeMessages(1)
|
||||
romaDistanceBg.visibility = View.GONE
|
||||
romaDistanceMeter.text = ""
|
||||
dis = 0
|
||||
}
|
||||
}
|
||||
|
||||
override fun romaDistance(distance: String) {
|
||||
super.romaDistance(distance)
|
||||
dis = distance.toDouble().toInt()
|
||||
Log.i(TAG, "romaDistance:$dis")
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerMapRomaListener.removeListener(TAG)
|
||||
}
|
||||
}
|
||||
@@ -42,7 +42,8 @@ class RomaPassengerView @JvmOverloads constructor(
|
||||
normalRes = a.getResourceId(R.styleable.RomaPassengerView_roma_close, 0)
|
||||
a.recycle()
|
||||
setOnClickListener {
|
||||
if (ClickUtils.isClickTooFrequent(this,1200)) {
|
||||
if (ClickUtils.isClickTooFrequent(this,2500)) {
|
||||
ToastUtils.showShort("不要频繁点击哦~")
|
||||
return@setOnClickListener
|
||||
}
|
||||
if(!click){
|
||||
|
||||
@@ -55,7 +55,8 @@ class RomaTaxiView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
setOnClickListener {
|
||||
if (ClickUtils.isClickTooFrequent(this,1200)) {
|
||||
if (ClickUtils.isClickTooFrequent(this,2500)) {
|
||||
ToastUtils.showShort("不要频繁点击哦~")
|
||||
return@setOnClickListener
|
||||
}
|
||||
if(!click){
|
||||
@@ -84,6 +85,7 @@ class RomaTaxiView @JvmOverloads constructor(
|
||||
ll_roma_bg.setBackgroundResource(R.drawable.romabg_press_select_bg)
|
||||
}
|
||||
ivRomaView.setBackgroundResource(R.drawable.roma_press_select_bg)
|
||||
|
||||
} else {
|
||||
romaMode = false
|
||||
if(normalRes!=0){
|
||||
|
||||
@@ -2,12 +2,12 @@ package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.enums.TrafficLightEnum
|
||||
@@ -21,7 +21,7 @@ import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils.*
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import kotlinx.android.synthetic.main.hmi_view_traffic_light.view.*
|
||||
|
||||
@@ -46,9 +46,24 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
||||
private var mLightSourceDivider: View? = null
|
||||
private var mCurrentLightId = TrafficLightEnum.BLACK
|
||||
|
||||
private var trafficLightUser = 0 //0:默认;1:Taxi乘客屏肤色
|
||||
|
||||
init{
|
||||
context?.let {
|
||||
val typedArray = it.obtainStyledAttributes(attrs, R.styleable.TrafficLightView)
|
||||
trafficLightUser = typedArray.getInt(R.styleable.TrafficLightView_traffic_light_user,0)
|
||||
typedArray.recycle()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
LayoutInflater.from(context).inflate(R.layout.hmi_view_traffic_light, this, true)
|
||||
if(trafficLightUser==1){
|
||||
LayoutInflater.from(context).inflate(R.layout.hmi_view_traffic_light_taxi_p, this, true)
|
||||
}else{
|
||||
LayoutInflater.from(context).inflate(R.layout.hmi_view_traffic_light, this, true)
|
||||
}
|
||||
mLightIconIV = findViewById(R.id.hmi_traffic_light_iv)
|
||||
mLightIconBG = findViewById(R.id.hmi_traffic_light_bg)
|
||||
mLightTimeTV = findViewById(R.id.hmi_traffic_light_time_tv)
|
||||
@@ -58,6 +73,12 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
||||
CallerSkinModeListenerManager.addListener(TAG, this)
|
||||
CallerTrafficLightListenerManager.addListener(TAG, this)
|
||||
CallerHmiViewControlListenerManager.addListener(TrafficLightView_TAG, this)
|
||||
|
||||
if(trafficLightUser==1){
|
||||
hmi_traffic_light_bg.setBackgroundResource(R.drawable.traffic_light_bg_taxi_p)
|
||||
hmi_traffic_light_source.setTextColor(ContextCompat.getColor(context,R.color.color_FF213757))
|
||||
hmi_traffic_light_divider.setBackgroundColor(ContextCompat.getColor(context,R.color.color_CC5C71AB))
|
||||
}
|
||||
}
|
||||
|
||||
override fun visible(v: Int) {
|
||||
@@ -73,17 +94,17 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
override fun onSkinModeChange(skinMode: Int) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
runOnUiThread {
|
||||
when (skinMode) {
|
||||
0 -> {
|
||||
hmi_traffic_light_bg.setBackgroundResource(R.drawable.traffic_light_bg)
|
||||
hmi_traffic_light_source.setTextColor(resources.getColor(R.color.color_FFFFFF))
|
||||
hmi_traffic_light_divider.setBackgroundColor(resources.getColor(R.color.color_FFFFFF))
|
||||
hmi_traffic_light_source.setTextColor(ContextCompat.getColor(context,R.color.color_FFFFFF))
|
||||
hmi_traffic_light_divider.setBackgroundColor(ContextCompat.getColor(context,R.color.color_FFFFFF))
|
||||
}
|
||||
1 -> {
|
||||
hmi_traffic_light_bg.setBackgroundResource(R.drawable.traffic_light_bg_day_light)
|
||||
hmi_traffic_light_source.setTextColor(resources.getColor(R.color.color_2D3E5F))
|
||||
hmi_traffic_light_divider.setBackgroundColor(resources.getColor(R.color.color_2D3E5F))
|
||||
hmi_traffic_light_source.setTextColor(ContextCompat.getColor(context,R.color.color_2D3E5F))
|
||||
hmi_traffic_light_divider.setBackgroundColor(ContextCompat.getColor(context,R.color.color_2D3E5F))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -168,12 +189,22 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
||||
if (redNum > 0) {
|
||||
resetView()
|
||||
mLightTimeTV!!.setVertical(true)
|
||||
mLightTimeTV!!.setColorList(
|
||||
intArrayOf(
|
||||
resources.getColor(R.color.hmi_traffic_light_red_color_up),
|
||||
resources.getColor(R.color.hmi_traffic_light_red_color_down)
|
||||
if(trafficLightUser == 1){
|
||||
mLightTimeTV!!.setColorList(
|
||||
intArrayOf(
|
||||
ContextCompat.getColor(context,R.color.color_FF384D6E),
|
||||
ContextCompat.getColor(context,R.color.color_FF384D6E)
|
||||
)
|
||||
)
|
||||
)
|
||||
}else{
|
||||
mLightTimeTV!!.setColorList(
|
||||
intArrayOf(
|
||||
ContextCompat.getColor(context,R.color.hmi_traffic_light_red_color_up),
|
||||
ContextCompat.getColor(context,R.color.hmi_traffic_light_red_color_down)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
mLightTimeTV!!.text = redNum.toString()
|
||||
} else {
|
||||
disableTrafficLightCountDown()
|
||||
@@ -188,12 +219,21 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
||||
if (greenNum > 0) {
|
||||
resetView()
|
||||
mLightTimeTV!!.setVertical(true)
|
||||
mLightTimeTV!!.setColorList(
|
||||
intArrayOf(
|
||||
resources.getColor(R.color.hmi_traffic_light_green_color_up),
|
||||
resources.getColor(R.color.hmi_traffic_light_green_color_down)
|
||||
if(trafficLightUser == 1){
|
||||
mLightTimeTV!!.setColorList(
|
||||
intArrayOf(
|
||||
ContextCompat.getColor(context,R.color.color_FF384D6E),
|
||||
ContextCompat.getColor(context,R.color.color_FF384D6E)
|
||||
)
|
||||
)
|
||||
)
|
||||
}else{
|
||||
mLightTimeTV!!.setColorList(
|
||||
intArrayOf(
|
||||
ContextCompat.getColor(context,R.color.hmi_traffic_light_green_color_up),
|
||||
ContextCompat.getColor(context,R.color.hmi_traffic_light_green_color_down)
|
||||
)
|
||||
)
|
||||
}
|
||||
mLightTimeTV!!.text = greenNum.toString()
|
||||
} else {
|
||||
disableTrafficLightCountDown()
|
||||
@@ -208,12 +248,21 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
||||
if (yellowNum > 0) {
|
||||
resetView()
|
||||
mLightTimeTV!!.setVertical(true)
|
||||
mLightTimeTV!!.setColorList(
|
||||
intArrayOf(
|
||||
resources.getColor(R.color.hmi_traffic_light_yellow_color_up),
|
||||
resources.getColor(R.color.hmi_traffic_light_yellow_color_down)
|
||||
if(trafficLightUser == 1){
|
||||
mLightTimeTV!!.setColorList(
|
||||
intArrayOf(
|
||||
ContextCompat.getColor(context,R.color.color_FF384D6E),
|
||||
ContextCompat.getColor(context,R.color.color_FF384D6E)
|
||||
)
|
||||
)
|
||||
)
|
||||
}else{
|
||||
mLightTimeTV!!.setColorList(
|
||||
intArrayOf(
|
||||
ContextCompat.getColor(context,R.color.hmi_traffic_light_yellow_color_up),
|
||||
ContextCompat.getColor(context,R.color.hmi_traffic_light_yellow_color_down)
|
||||
)
|
||||
)
|
||||
}
|
||||
mLightTimeTV!!.text = yellowNum.toString()
|
||||
} else {
|
||||
disableTrafficLightCountDown()
|
||||
@@ -231,28 +280,40 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
||||
private fun updateTrafficLightIcon(lightId: TrafficLightEnum, lightSource: DataSourceType) {
|
||||
when (lightId) {
|
||||
TrafficLightEnum.RED -> {
|
||||
mLightIconIV!!.setBackgroundResource(R.drawable.hmi_light_red_nor)
|
||||
if(trafficLightUser == 1){
|
||||
mLightIconIV!!.setBackgroundResource(R.drawable.hmi_light_red_taxi_p)
|
||||
}else{
|
||||
mLightIconIV!!.setBackgroundResource(R.drawable.hmi_light_red_nor)
|
||||
}
|
||||
this@SingleTrafficLightView.visibility = VISIBLE
|
||||
}
|
||||
TrafficLightEnum.YELLOW -> {
|
||||
mLightIconIV!!.setBackgroundResource(R.drawable.hmi_lightyellow_nor)
|
||||
if(trafficLightUser == 1){
|
||||
mLightIconIV!!.setBackgroundResource(R.drawable.hmi_lightyellow_taxi_p)
|
||||
}else{
|
||||
mLightIconIV!!.setBackgroundResource(R.drawable.hmi_lightyellow_nor)
|
||||
}
|
||||
this@SingleTrafficLightView.visibility = VISIBLE
|
||||
}
|
||||
TrafficLightEnum.GREEN -> {
|
||||
mLightIconIV!!.setBackgroundResource(R.drawable.hmi_light_green_nor)
|
||||
if(trafficLightUser == 1){
|
||||
mLightIconIV!!.setBackgroundResource(R.drawable.hmi_light_green_taxi_p)
|
||||
}else{
|
||||
mLightIconIV!!.setBackgroundResource(R.drawable.hmi_light_green_nor)
|
||||
}
|
||||
this@SingleTrafficLightView.visibility = VISIBLE
|
||||
}
|
||||
else -> this@SingleTrafficLightView.visibility = GONE
|
||||
}
|
||||
when (lightSource) {
|
||||
DataSourceType.AICLOUD -> {
|
||||
mLightSourceTV!!.text = "云端下发"
|
||||
mLightSourceTV!!.text = context.getString(R.string.light_source_ai_cloud)
|
||||
}
|
||||
DataSourceType.TELEMATIC -> {
|
||||
mLightSourceTV!!.text = "自车感知"
|
||||
mLightSourceTV!!.text = context.getString(R.string.light_source_perception)
|
||||
}
|
||||
DataSourceType.OBU -> {
|
||||
mLightSourceTV!!.text = "OBU"
|
||||
mLightSourceTV!!.text = context.getString(R.string.light_source_obu)
|
||||
}
|
||||
else -> {
|
||||
mLightSourceTV!!.visibility = GONE
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget;
|
||||
|
||||
import static com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING;
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
@@ -28,7 +27,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerChassisGearStateListene
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisSteeringStateListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisThrottleStateListenerManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -153,11 +151,9 @@ public class TrafficDataView extends ConstraintLayout implements
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotSteeringData(float steering) {
|
||||
CallerLogger.INSTANCE.d(M_HMI +TAG, "steering原始值====" + steering);
|
||||
if (Math.abs(steering) < 1) {
|
||||
steering = 0;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_HMI +TAG, "steering忽略小数点后====" + (int) steering);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -166,7 +162,6 @@ public class TrafficDataView extends ConstraintLayout implements
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotGearData(@NotNull Chassis.GearPosition gear) {
|
||||
CallerLogger.INSTANCE.d(M_HMI +TAG, "司机屏档位" + gear);
|
||||
ThreadUtils.runOnUiThread(() -> {
|
||||
if (tapPositionView != null) {
|
||||
tapPositionView.updateWithGear(gear);
|
||||
@@ -176,13 +171,11 @@ public class TrafficDataView extends ConstraintLayout implements
|
||||
|
||||
@Override
|
||||
public void onAutopilotBrake(float brake) {
|
||||
CallerLogger.INSTANCE.d(M_HMI +TAG, "刹车:" + brake);
|
||||
mBrake = brake;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotThrottle(float throttle) {
|
||||
CallerLogger.INSTANCE.d(M_HMI +TAG, "油门:" + throttle);
|
||||
mThrottle = throttle;
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -1,33 +1,41 @@
|
||||
package com.mogo.eagle.core.function.main
|
||||
|
||||
import android.Manifest
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.provider.Settings
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.*
|
||||
import android.widget.FrameLayout
|
||||
import androidx.core.app.ActivityCompat
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.kwai.koom.base.MonitorManager.addMonitorConfig
|
||||
import com.kwai.koom.javaoom.monitor.OOMHprofUploader
|
||||
import com.kwai.koom.javaoom.monitor.OOMMonitor
|
||||
import com.kwai.koom.javaoom.monitor.OOMMonitorConfig
|
||||
import com.kwai.koom.javaoom.monitor.OOMReportUploader
|
||||
import com.kwai.koom.nativeoom.leakmonitor.LeakListener
|
||||
import com.kwai.koom.nativeoom.leakmonitor.LeakMonitor.start
|
||||
import com.kwai.koom.nativeoom.leakmonitor.LeakMonitorConfig
|
||||
import com.kwai.koom.nativeoom.leakmonitor.LeakRecord
|
||||
import com.mogo.commons.utils.MogoAnalyticUtils
|
||||
import com.mogo.commons.context.ContextHolderUtil
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.commons.mvp.MvpActivity
|
||||
import com.mogo.commons.utils.MogoAnalyticUtils
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoRequestActivityHandler
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiFloatViewManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getMapUIController
|
||||
import com.mogo.eagle.core.function.call.setting.CallerRequestActivityHandleManager
|
||||
import com.mogo.eagle.core.function.call.startup.CallerStartUpManager.initStageTwo
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
|
||||
@@ -46,6 +54,8 @@ import com.mogo.map.listener.MogoMapListenerHandler.Companion.mogoMapListenerHan
|
||||
import com.mogo.map.uicontroller.EnumMapUI
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import kotlinx.android.synthetic.main.module_main_activity_main.*
|
||||
import java.io.File
|
||||
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -55,7 +65,7 @@ import kotlinx.android.synthetic.main.module_main_activity_main.*
|
||||
* 描述:加载各个模块
|
||||
*/
|
||||
open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||
IMoGoAutopilotStatusListener {
|
||||
IMoGoAutopilotStatusListener, IMoGoRequestActivityHandler {
|
||||
|
||||
companion object {
|
||||
protected const val TAG = "MainActivity"
|
||||
@@ -92,14 +102,15 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||
private fun injectStatusBar() {
|
||||
val decorView = this.window.decorView as? FrameLayout ?: return
|
||||
val contentView =
|
||||
(decorView.findViewById<View>(android.R.id.content) as? ViewGroup)?.getChildAt(0) ?: return
|
||||
(decorView.findViewById<View>(android.R.id.content) as? ViewGroup)?.getChildAt(0)
|
||||
?: return
|
||||
contentView.fitsSystemWindows = false
|
||||
decorView.clipToPadding = false
|
||||
var statusBarView = decorView.findViewWithTag<View>("status_bar")
|
||||
if (statusBarView == null) {
|
||||
val statusBar = CallerHmiFloatViewManager.getView(this)
|
||||
statusBarView = statusBar?:StatusBarView(this)
|
||||
statusBarView.setTag("status_bar")
|
||||
statusBarView = statusBar ?: StatusBarView(this)
|
||||
statusBarView.tag = "status_bar"
|
||||
}
|
||||
val statusBarLP = FrameLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
@@ -115,7 +126,8 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||
private fun injectFloatView() {
|
||||
val decorView = this.window.decorView as? FrameLayout ?: return
|
||||
val contentView =
|
||||
(decorView.findViewById<View>(android.R.id.content) as? ViewGroup)?.getChildAt(0) ?: return
|
||||
(decorView.findViewById<View>(android.R.id.content) as? ViewGroup)?.getChildAt(0)
|
||||
?: return
|
||||
contentView.fitsSystemWindows = false
|
||||
decorView.clipToPadding = false
|
||||
var floatContainer = decorView.findViewWithTag<View>("float_container")
|
||||
@@ -137,6 +149,7 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||
ContextHolderUtil.holdContext(this)
|
||||
// 监听工控机连接信息
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
CallerRequestActivityHandleManager.addListener(TAG, this)
|
||||
initStageTwo()
|
||||
// 加载模块
|
||||
mPresenter!!.postLoadModuleMsg()
|
||||
@@ -197,7 +210,7 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||
override fun onMapLoaded() {
|
||||
// 延时加载其他模块
|
||||
window.decorView.post {
|
||||
MogoStatusManager.getInstance().setScreenCoverMode(TAG,true)
|
||||
MogoStatusManager.getInstance().setScreenCoverMode(TAG, true)
|
||||
HdMapBuildConfig.isMapLoaded = true
|
||||
mPresenter!!.delayOperations()
|
||||
loadFunctionFragment()
|
||||
@@ -231,6 +244,22 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||
}
|
||||
|
||||
private fun startLeakMonitor() {
|
||||
val oomMonitorConfig = OOMMonitorConfig.Builder()
|
||||
.setEnableHprofDumpAnalysis(true)
|
||||
.setHprofUploader(object : OOMHprofUploader {
|
||||
override fun upload(file: File, type: OOMHprofUploader.HprofType) {
|
||||
|
||||
}
|
||||
})
|
||||
.setReportUploader(object : OOMReportUploader {
|
||||
override fun upload(file: File, content: String) {
|
||||
printLeakMsg("OOMLeak--$content")
|
||||
}
|
||||
})
|
||||
.build()
|
||||
addMonitorConfig(oomMonitorConfig)
|
||||
OOMMonitor.startLoop(true, false, 5_000L)
|
||||
|
||||
val leakMonitorConfig: LeakMonitorConfig = LeakMonitorConfig.Builder()
|
||||
.setLoopInterval(50000)
|
||||
.setMonitorThreshold(16)
|
||||
@@ -324,6 +353,7 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
CallerRequestActivityHandleManager.removeListener(TAG)
|
||||
mogoMapListenerHandler.unregisterHostMapListener(TAG)
|
||||
val mapUIController = getMapUIController()
|
||||
mapUIController?.destroy()
|
||||
@@ -335,6 +365,19 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||
ProcessUtils.killAllBackgroundProcesses()
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = ChainConstant.CHAIN_TYPE_INIT_STATUS,
|
||||
linkCode = ChainConstant.CHAIN_SOURCE_INIT,
|
||||
nodeAliasCode = ChainConstant.CHAIN_CODE_REQUEST_PERMISSION,
|
||||
paramIndexes = [0, 1]
|
||||
)
|
||||
override fun handleRequestPermission(tag: String, permission: String) {
|
||||
super.handleRequestPermission(tag, permission)
|
||||
val intent = Intent(permission, Uri.parse("package:$packageName"))
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
override fun onRequestPermissionsResult(
|
||||
requestCode: Int,
|
||||
permissions: Array<String>,
|
||||
|
||||
@@ -53,7 +53,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
EventBus.getDefault().register(this);
|
||||
CallerLogger.INSTANCE.i(M_HMI + TAG, "onCreate");
|
||||
CallerLogger.i(M_HMI + TAG, "onCreate");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -99,7 +99,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
@Override
|
||||
protected void loadOthersModules() {
|
||||
super.loadOthersModules();
|
||||
CallerLogger.INSTANCE.d(M_MAIN + TAG, "loadOthersModules");
|
||||
CallerLogger.d(M_MAIN + TAG, "loadOthersModules");
|
||||
loadOCHModule();
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
paramIndexes = {0}
|
||||
)
|
||||
private void traceStartUp(String content) {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, content);
|
||||
CallerLogger.d(M_HMI + TAG, content);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user