Merge branch 'dev_arch_opt_3.0' into dev_robosweeper-d_app-module_221230_1.1.0

# Conflicts:
#	core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/report/IPCReportManager.kt
This commit is contained in:
bxb
2023-03-08 19:25:46 +08:00
87 changed files with 1765 additions and 583 deletions

View File

@@ -14,7 +14,7 @@ interface IDispatchAdasApiService {
* @return [BaseData]
*/
@FormUrlEncoded
@POST("eagle-eye-dns/eagle-eye-dns/dataService/autoDriver/receiveCarPreSetPath")
@POST("eagle-eye-dns/dataService/autoDriver/receiveCarPreSetPath")
fun uploadAutopilotRoute(@FieldMap parameters: Map<String, String>): Observable<BaseData>
/**

View File

@@ -10,7 +10,7 @@ import retrofit2.http.POST
interface ILineUploadApi {
@Headers("Content-type:application/json;charset=UTF-8" )
@POST( "/yycp-data-center-service/carTrack/receiveCarTrack/" )
@POST( "eagle-eye-dns/yycp-data-center-service/carTrack/receiveCarTrack/" )
fun uploadLineId(@Body lineId: LineUploadData): Observable<BaseData>
}

View File

@@ -3,6 +3,7 @@ package com.mogo.eagle.function.biz.v2x.road
import android.content.Context
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.constants.HostConst.DATA_CENTER_HOST
import com.mogo.commons.constants.HostConst.getEagleHost
import com.mogo.eagle.core.data.v2x.LineUploadData
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
@@ -54,7 +55,7 @@ class LineUploadManager private constructor(context: Context) : IMoGoAutopilotSt
private fun uploadLine(lineId: Long) {
val lineUploadData = LineUploadData(lineId, MoGoAiCloudClientConfig.getInstance().sn)
disposable = MoGoRetrofitFactory.getInstance(DATA_CENTER_HOST)
disposable = MoGoRetrofitFactory.getInstance(getEagleHost())
.create(ILineUploadApi::class.java)
.uploadLineId(lineUploadData)
.subscribeOn(Schedulers.io())

View File

@@ -159,9 +159,6 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback,
handleWarningTargetEvent(event.data)
}
is V2XEvent.RoadAI -> {
if (FunctionBuildConfig.isV2NFromCar) {
return
}
handleRoadMarkerEvent(event.data.toRoadMarker())
}
is V2XEvent.RoadEventX -> {
@@ -173,12 +170,16 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback,
}
}
@SuppressLint("NewApi")
@ChainLog(
linkChainLog = CHAIN_LINK_LOG_CLOUD_V2N,
linkCode = CHAIN_LINK_CLOUD,
endpoint = TracingConstants.Endpoint.PAD,
nodeAliasCode = CHAIN_ALIAS_CODE_CLOUD_V2N,
paramIndexes = [0],
clientPkFileName = "sn"
)
override fun onAutopilotIdentifyPlanningObj(planningObjects: List<MessagePad.PlanningObject>?) {
super.onAutopilotIdentifyPlanningObj(planningObjects)
if (!FunctionBuildConfig.isV2NFromCar) {
return
}
planningObjects?.let {
if (it.isNotEmpty()) {
val first = it.stream()

View File

@@ -12,6 +12,7 @@ class AiCloudSocketBizProvider : IMoGoFunctionServerProvider {
get() = "AiCloudSocketBizProvider"
override fun init(context: Context?) {
//todo bus加载
context?.let {
SocketManager.getInstance().init(it, 0.0, 0.0)
SocketManager.getInstance().registerOnMessageListener(401012, V2XMessageListener401012())

View File

@@ -134,8 +134,6 @@ class MoGoAdasListenerImpl : OnAdasListener {
if (gnssInfo != null) {
if (1 == FunctionBuildConfig.gpsProvider) {
// 同步给MAP地图
//CallerMapUIServiceManager.getMapUIController()?.syncLocation2Map(gnssInfo)
// 同步更新经纬度和系统时间至 AutoPilotStatusListener
CallerAutoPilotStatusListenerManager.updateAutoPilotLatLon(
gnssInfo.satelliteTime,
@@ -146,7 +144,6 @@ class MoGoAdasListenerImpl : OnAdasListener {
}
}
/**
* 老底盘信息,透传底盘状态pb参考底盘
* TODO 目前由于M1车型不会在新底盘PB添加新的字段 所以临时保留
@@ -369,7 +366,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
//他车轨迹预测
}
override fun onPointCloud(pointCloud: ByteArray?) {
override fun onPointCloud(header: MessagePad.Header, pointCloud: ByteArray?) {
//点云数据透传
CallerAutopilotPointCloudListenerManager.invokeAutopilotPointCloudDataUpdate(pointCloud)
}
@@ -595,6 +592,16 @@ class MoGoAdasListenerImpl : OnAdasListener {
) {
}
/**
* 清扫车后部摄像头视频 10Hz
*
* @param header 头
* @param data 数据
*/
override fun onBackCameraVideo(header: MessagePad.Header, data: ByteArray) {
CallerSweeperFutianBackCameraVideoListenerManager.invokeSweeperFutianBackCameraVideo(data)
}
/**
* 清扫车指标数据
*

View File

@@ -6,8 +6,6 @@ import com.mogo.eagle.core.data.constants.MoGoConfig
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.data.obu.MogoObuConst
import com.mogo.eagle.core.function.api.datacenter.obu.IMoGoObuProvider
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
import com.mogo.eagle.core.utilcode.util.CommonUtils
@@ -24,13 +22,12 @@ class MoGoObuProvider : IMoGoObuProvider {
get() = TAG
override fun onDestroy() {
MogoObuDcCombineManager.INSTANCE.destoryListener()
}
override fun init(context: Context) {
//obu融合数据
MogoObuDcCombineManager.INSTANCE.init(context)
CallerLogger.d("$M_OBU$TAG", "初始化蘑菇自研OBU…… localIp = " + CommonUtils.getLocalIPAddress())
//bus乘客版本obu功能去掉大理项目需要全部车辆接收不再限制
mContext = context

View File

@@ -56,19 +56,27 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
}
override fun onMoGoObuRsiWarning(rsiWarningData: ObuScene.RsiWarningData) {
onMogoObuDcRsiWarning(rsiWarningData)
if (HmiBuildConfig.isShowObuV2iView) {
onMogoObuDcRsiWarning(rsiWarningData)
}
}
override fun onMoGoObuRsmWarning(rsmWarningData: ObuScene.RsmWarningData) {
onMogoObuDcRsmWarning(rsmWarningData)
if (HmiBuildConfig.isShowObuV2iView) {
onMogoObuDcRsmWarning(rsmWarningData)
}
}
override fun onMoGoObuSpatWarning(spatWarningData: ObuScene.SpatWarningData) {
onMogoObuDcSpatWarning(spatWarningData)
if (HmiBuildConfig.isShowObuV2iView) {
onMogoObuDcSpatWarning(spatWarningData)
}
}
override fun onMoGoObuMapMath(mapMatchData: ObuScene.MapMatchData) {
onMogoObuMapMath(mapMatchData)
if (HmiBuildConfig.isShowObuV2iView) {
onMogoObuMapMath(mapMatchData)
}
}
/**
@@ -119,13 +127,13 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
ttsContent = EventTypeEnumNew.getWarningTts(appId)
alertContent = String.format( //事件才有影响范围
alertContent,
Math.round(rsiWarningData.warningMsgList[0].distance / 100.0).toString(),
Math.round(rsiWarningData.warningMsgList[0].eventRadius / 10.0).toString()
Math.round(rsiWarningData.warningMsgList[0].distance).toString(),
Math.round(rsiWarningData.warningMsgList[0].eventRadius).toString()
)
ttsContent = String.format(
ttsContent,
Math.round(rsiWarningData.warningMsgList[0].distance / 100.0).toString(),
Math.round(rsiWarningData.warningMsgList[0].eventRadius / 10.0).toString()
Math.round(rsiWarningData.warningMsgList[0].distance).toString(),
Math.round(rsiWarningData.warningMsgList[0].eventRadius).toString()
)
}
@@ -202,11 +210,11 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
ttsContent = EventTypeEnumNew.getWarningTts(appId)
alertContent = String.format( //标牌是没有影响范围的
alertContent,
Math.round(rsiWarningData.warningMsgList[0].distance / 100.0).toString()
Math.round(rsiWarningData.warningMsgList[0].distance).toString()
)
ttsContent = String.format(
ttsContent,
Math.round(rsiWarningData.warningMsgList[0].distance / 100.0).toString()
Math.round(rsiWarningData.warningMsgList[0].distance).toString()
)
}
@@ -217,13 +225,13 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
ttsContent = EventTypeEnumNew.getWarningTts(appId)
alertContent = String.format( //事件才有影响范围
alertContent,
Math.round(rsiWarningData.warningMsgList[0].distance / 100.0).toString(),
Math.round(rsiWarningData.warningMsgList[0].eventRadius / 10.0).toString()
Math.round(rsiWarningData.warningMsgList[0].distance).toString(),
Math.round(rsiWarningData.warningMsgList[0].eventRadius).toString()
)
ttsContent = String.format(
ttsContent,
Math.round(rsiWarningData.warningMsgList[0].distance / 100.0).toString(),
Math.round(rsiWarningData.warningMsgList[0].eventRadius / 10.0).toString()
Math.round(rsiWarningData.warningMsgList[0].distance).toString(),
Math.round(rsiWarningData.warningMsgList[0].eventRadius).toString()
)
}
@@ -237,16 +245,18 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
CallerLogger.d(
"${M_OBU}${TAG}",
"MogoObuDcCombineManager ttsContent = $ttsContent --alertContent = $alertContent --appId = $appId ---direction = ${direction.direction} --distance = ${rsiWarningData.warningMsgList[0].distance} ---eventRadius = ${rsiWarningData.warningMsgList[0].eventRadius} --speedMaxLimit = ${rsiWarningData.warningMsgList[0].speedMaxLimit}"
)
"MogoObuDcCombineManager ttsContent = $ttsContent --alertContent = $alertContent --appId = $appId ---direction = ${direction.direction} --distance = ${rsiWarningData.warningMsgList[0].distance} ---eventRadius = ${rsiWarningData.warningMsgList[0].eventRadius} --speedMaxLimit = ${rsiWarningData.warningMsgList[0].speedMaxLimit}")
when (status) {
// 添加
MogoObuConstants.STATUS.ADD -> {
if (alertContent.isEmpty() || ttsContent.isEmpty()) {
return
}
saveObuToDcData(appId, alertContent, ttsContent)
showWarning(appId, alertContent, ttsContent, direction)
//大于10m才提示rsi
if (Math.round(rsiWarningData.warningMsgList[0].distance) > 10) {
saveObuToDcData(appId, alertContent, ttsContent)
showWarning(appId, alertContent, ttsContent, direction)
}
}
MogoObuConstants.STATUS.UPDATE -> { // 更新
@@ -380,33 +390,31 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
* 地图匹配 是OBU算法输出地图匹配结果主车匹配道路哪条路或者哪条车道
*/
fun onMogoObuMapMath(data: ObuScene.MapMatchData?) {
if (HmiBuildConfig.isShowObuLimitSpeedView) {
if (data != null) {
CallerLogger.d(
"${M_OBU}${TAG}",
"MogoObuDcCombineManager onMogoObuMapMath = ${data.status} --speedMaxLimit = ${
Math.round(
(data.speedMaxLimit * 0.02 * 3.6)
)
} --- data.speedMaxLimit = ${data.speedMaxLimit}"
)
when (data.status) {
MogoObuConstants.STATUS.ADD -> { // 添加
CallerLimitingVelocityListenerManager.invokeUnion(
(data.speedMaxLimit * 0.02 * 3.6).roundToInt().toInt(),
DataSourceType.OBU
)
}
if (data != null) {
CallerLogger.d(
"${M_OBU}${TAG}",
"MogoObuDcCombineManager onMogoObuMapMath = ${data.status} --speedMaxLimit = ${
Math.round(
(data.speedMaxLimit * 3.6)
)
} --- data.speedMaxLimit = ${data.speedMaxLimit}"
)
when (data.status) {
MogoObuConstants.STATUS.ADD -> { // 添加
CallerLimitingVelocityListenerManager.invokeUnion(
(data.speedMaxLimit * 3.6).roundToInt(),
DataSourceType.OBU
)
}
MogoObuConstants.STATUS.UPDATE -> { // 更新
}
MogoObuConstants.STATUS.UPDATE -> { // 更新
}
MogoObuConstants.STATUS.DELETE -> { // 删除
CallerLimitingVelocityListenerManager.invokeUnion(
-1,
DataSourceType.OBU
)
}
MogoObuConstants.STATUS.DELETE -> { // 删除
CallerLimitingVelocityListenerManager.invokeUnion(
-1,
DataSourceType.OBU
)
}
}
}
@@ -521,15 +529,15 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
"MogoObuDcCombineManager 绿波通行引导 --------> speed_min = ${currentLight.suggestMinSpeed} --speed_max = ${currentLight.suggestMaxSpeed}"
)
val adviceSpeed =
"${Math.round(currentLight.suggestMinSpeed * 3.6 * 0.02)} - ${
"${Math.round(currentLight.suggestMinSpeed * 3.6)} - ${
Math.round(
currentLight.suggestMaxSpeed * 3.6 * 0.02
currentLight.suggestMaxSpeed * 3.6
)
}"
val adviceSpeedTts =
"${Math.round(currentLight.suggestMinSpeed * 3.6 * 0.02)} - ${
"${Math.round(currentLight.suggestMinSpeed * 3.6)} - ${
Math.round(
currentLight.suggestMaxSpeed * 3.6 * 0.02
currentLight.suggestMaxSpeed * 3.6
)
}"
@@ -566,7 +574,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
}
// 红灯
2, 3 -> {
val red = (currentLight.countDown / 10).toInt()
val red = currentLight.countDown.toInt()
CallerTrafficLightListenerManager.invokeTrafficLightPlusSource(
TrafficLightEnum.RED,
red,
@@ -575,7 +583,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
}
// 绿灯
4, 5, 6 -> {
val green = (currentLight.countDown / 10).toInt()
val green = currentLight.countDown.toInt()
CallerTrafficLightListenerManager.invokeTrafficLightPlusSource(
TrafficLightEnum.GREEN,
green,
@@ -584,7 +592,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
}
// 黄灯
7, 8 -> {
val yellow = (currentLight.countDown / 10).toInt()
val yellow = currentLight.countDown.toInt()
CallerTrafficLightListenerManager.invokeTrafficLightPlusSource(
TrafficLightEnum.YELLOW,
yellow,

View File

@@ -407,6 +407,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
alertContent = EventTypeEnumNew.getWarningContent(appId)
ttsContent = EventTypeEnumNew.getWarningTts(appId)
alertContent = String.format( //标牌是没有影响范围的
alertContent,
Math.round(data.warningMsgList[0].distance).toString()
@@ -455,8 +456,11 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
if (alertContent.isEmpty() || ttsContent.isEmpty()) {
return
}
saveObuData(appId, alertContent, ttsContent)
showWarning(appId, alertContent, ttsContent, direction)
//大于10m才提示rsi
if (Math.round(data.warningMsgList[0].distance) > 10) {
saveObuData(appId, alertContent, ttsContent)
showWarning(appId, alertContent, ttsContent, direction)
}
// 更新数据
TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(data)
@@ -661,7 +665,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
/**
* 构造对应展示数据和场景 根据obu的场景add change delete确定是否展示
* @param appId 使用WarningTypeEnum获取icon、提示内容、tts内容 TODO 添加事件频繁播报拦截
* @param appId 使用WarningTypeEnum获取icon、提示内容、tts内容
* @see com.mogo.module.common.enums.EventTypeEnumNew
* EventTypeEnumNew在定义的id为了防止重复和原始数据是不一样的有对应关系
*/
@@ -806,7 +810,6 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType)
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType
}
}
when (status) {

View File

@@ -50,9 +50,11 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
private var mContext: Context? = null
//是否有AI获取红绿灯灯态
@Volatile
private var hasAiLightStatus: Boolean = false
//obu数据
@Volatile
private var hasObuLightStatus: Boolean = false
fun initServer(context: Context) {

View File

@@ -1,26 +1,35 @@
package com.mogo.eagle.core.function.msgbox
import android.annotation.SuppressLint
import android.content.Context
import android.os.Looper
import com.mogo.eagle.core.data.deva.report.ReportEntity
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.msgbox.*
import com.mogo.eagle.core.data.deva.report.ReportEntity
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager
import com.mogo.eagle.core.function.msgbox.db.MsgBoxDb
import com.mogo.eagle.core.function.msgbox.db.MsgBoxInfo
import com.mogo.eagle.core.utilcode.kotlin.lifeCycleScope
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e
import com.mogo.eagle.core.utilcode.util.GsonUtils
import com.mogo.eagle.core.utilcode.util.ProcessUtils
import com.mogo.eagle.core.utilcode.util.SPUtils
import com.mogo.eagle.core.utilcode.util.Utils
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import java.io.File
import java.text.SimpleDateFormat
import java.util.*
object DataManager {
// private val msgBoxMap: EnumMap<MsgBoxType, MutableList<MsgBoxBean>> = EnumMap(MsgBoxType::class.java)
const val TAG = "DataManager"
// 消失时间5000ms
const val DISMISS_TIME = 5000L
@@ -148,6 +157,10 @@ object DataManager {
* 从本地数据库中查询数据
*/
fun queryAllMessages(context: Context) {
if (!ProcessUtils.isMainProcess(context)) {
return
}
clearMessageBoxTable(context)
scope.launch {
initCache()
try {
@@ -158,6 +171,38 @@ object DataManager {
}
}
@SuppressLint("SimpleDateFormat")
private fun clearMessageBoxTable(context: Context) {
Thread {
val lastLaunchTimeStr = SPUtils.getInstance().getString("last_launch", "")
val format = SimpleDateFormat("yyyy-MM-dd")
val currDate = Date(System.currentTimeMillis())
val currTimeStr = format.format(currDate)
try {
if (lastLaunchTimeStr != null && lastLaunchTimeStr.isNotEmpty()) {
val isSameDay = currTimeStr == lastLaunchTimeStr
// 超过一天需要清除消息盒子中的数据并把时间戳存入SP
if (!isSameDay) {
val file: File = context.getDatabasePath(MsgBoxDb.INTERNAL_DB_NAME)
if (file != null && file.exists()) {
context.deleteDatabase(MsgBoxDb.INTERNAL_DB_NAME)
}
SPUtils.getInstance().put("last_launch", currTimeStr)
}
} else {
// 首次使用App或中途仅删除sp文件
val file: File = context.getDatabasePath(MsgBoxDb.INTERNAL_DB_NAME)
if (file != null && file.exists()) {
context.deleteDatabase(MsgBoxDb.INTERNAL_DB_NAME)
}
SPUtils.getInstance().put("last_launch", currTimeStr)
}
} catch (e: Exception) {
e(TAG, e.message)
}
}.start()
}
private fun initCache() {
if (cacheNotifyList.isNotEmpty()) {
cacheNotifyList.clear()
@@ -170,86 +215,87 @@ object DataManager {
}
}
private suspend fun getCacheMessages(context: Context): List<MsgBoxBean> = withContext(Dispatchers.IO) {
delay(2000)
return@withContext MsgBoxDb.getDb(context)
.monitorDao()
.getAllCachedMessages()
.map { msgInfo ->
val json = msgInfo.bean2Json
when (msgInfo.obj2JsonType) {
MsgBoxType.V2X.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.V2X,
GsonUtils.fromJson(json, V2XMsg::class.java)
).apply {
this.timestamp = msgInfo.timeStamp
withContext(Dispatchers.Main) {
cacheNotifyList.add(this@apply)
private suspend fun getCacheMessages(context: Context): List<MsgBoxBean> =
withContext(Dispatchers.IO) {
delay(2000)
return@withContext MsgBoxDb.getDb(context)
.monitorDao()
.getAllCachedMessages()
.map { msgInfo ->
val json = msgInfo.bean2Json
when (msgInfo.obj2JsonType) {
MsgBoxType.V2X.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.V2X,
GsonUtils.fromJson(json, V2XMsg::class.java)
).apply {
this.timestamp = msgInfo.timeStamp
withContext(Dispatchers.Main) {
cacheNotifyList.add(this@apply)
}
}
}
}
MsgBoxType.OBU.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.OBU,
GsonUtils.fromJson(json, V2XMsg::class.java)
).apply {
this.timestamp = msgInfo.timeStamp
withContext(Dispatchers.Main) {
cacheNotifyList.add(this@apply)
MsgBoxType.OBU.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.OBU,
GsonUtils.fromJson(json, V2XMsg::class.java)
).apply {
this.timestamp = msgInfo.timeStamp
withContext(Dispatchers.Main) {
cacheNotifyList.add(this@apply)
}
}
}
}
MsgBoxType.OPERATION.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.OPERATION,
GsonUtils.fromJson(json, OperationMsg::class.java)
).apply {
this.timestamp = msgInfo.timeStamp
withContext(Dispatchers.Main) {
cacheNotifyList.add(this@apply)
MsgBoxType.OPERATION.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.OPERATION,
GsonUtils.fromJson(json, OperationMsg::class.java)
).apply {
this.timestamp = msgInfo.timeStamp
withContext(Dispatchers.Main) {
cacheNotifyList.add(this@apply)
}
}
}
}
MsgBoxType.REPORT.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.REPORT,
GsonUtils.fromJson(json, ReportEntity::class.java)
).apply {
this.timestamp = msgInfo.timeStamp
withContext(Dispatchers.Main) {
cacheSysInfoList.add(this@apply)
MsgBoxType.REPORT.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.REPORT,
GsonUtils.fromJson(json, ReportEntity::class.java)
).apply {
this.timestamp = msgInfo.timeStamp
withContext(Dispatchers.Main) {
cacheSysInfoList.add(this@apply)
}
}
}
}
MsgBoxType.RECORD.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.RECORD,
GsonUtils.fromJson(json, RecordBagMsg::class.java)
).apply {
this.timestamp = msgInfo.timeStamp
withContext(Dispatchers.Main) {
cacheRecordList.add(this@apply)
MsgBoxType.RECORD.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.RECORD,
GsonUtils.fromJson(json, RecordBagMsg::class.java)
).apply {
this.timestamp = msgInfo.timeStamp
withContext(Dispatchers.Main) {
cacheRecordList.add(this@apply)
}
}
}
}
MsgBoxType.NOTICE.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.NOTICE,
GsonUtils.fromJson(json, NoticeFrCloudMsg::class.java)
).apply {
this.timestamp = msgInfo.timeStamp
withContext(Dispatchers.Main) {
cacheNotifyList.add(this@apply)
MsgBoxType.NOTICE.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.NOTICE,
GsonUtils.fromJson(json, NoticeFrCloudMsg::class.java)
).apply {
this.timestamp = msgInfo.timeStamp
withContext(Dispatchers.Main) {
cacheNotifyList.add(this@apply)
}
}
}
}
else -> {
return@map MsgBoxBean(MsgBoxType.V2X, V2XMsg())
else -> {
return@map MsgBoxBean(MsgBoxType.V2X, V2XMsg())
}
}
}
}
}
}
/**
* 存储到本地数据库
@@ -298,7 +344,8 @@ object DataManager {
fun delMsgBoxBean(context: Context, msgBoxBean: MsgBoxBean) {
scope.launch {
withContext(Dispatchers.Default) {
val msgBoxInfo = MsgBoxInfo(msgBoxBean.bean2Json, msgBoxBean.type.ordinal, msgBoxBean.timestamp)
val msgBoxInfo =
MsgBoxInfo(msgBoxBean.bean2Json, msgBoxBean.type.ordinal, msgBoxBean.timestamp)
MsgBoxDb.getDb(context)
.monitorDao()
.deleteMsg(msgBoxInfo)

View File

@@ -173,9 +173,6 @@ class DevaToolsProvider : IDevaToolsProvider {
override fun updateUpgradeProgress() {
upgradeManager.updateUpgradeProgress(mContext!!)
}
override fun updateObuUpgradeStatus() {
upgradeManager.updateObuUpgradeStatus(mContext!!)
}

View File

@@ -86,10 +86,18 @@ class BindingCarNetWorkManager private constructor() {
SharedPrefsConstants.CAR_INFO,
GsonUtils.toJson(info.getData())
)
} else {
// SharedPrefsMgr.getInstance(context).putString(
// SharedPrefsConstants.CAR_INFO, "null")
e(
SceneConstant.M_BINDING + TAG, "getBindingCarInfo data = null "
)
}
}
override fun onError(e: Throwable) {
// SharedPrefsMgr.getInstance(context).putString(
// SharedPrefsConstants.CAR_INFO, e.message.toString())
e(
SceneConstant.M_BINDING + TAG,
"getBindingCarInfo onError e = " + e.toString() + "---e.getMessage = " + e.message

View File

@@ -9,6 +9,7 @@ import android.content.Intent
import android.content.IntentFilter
import android.view.KeyEvent
import com.mogo.commons.context.ContextHolderUtil
import com.mogo.eagle.core.data.config.HmiBuildConfig
import com.mogo.eagle.core.data.deva.mofang.MfConstants
import com.mogo.eagle.core.function.api.devatools.mofang.IMoGoMoFangListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.sendOperatorChangeLaneLeft
@@ -46,7 +47,6 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
private lateinit var mBluetoothAdapter: BluetoothAdapter
private var isMfConnect: Boolean = false //添加状态判断
private val isShowToast = false //toast 控制,自测使用
private var startPressTime: Long = 0 //开始按键时间
private var isPressEnd = false //按键是否结束
@Volatile
@@ -171,23 +171,23 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
startPressTime = System.currentTimeMillis()
}
e(M_F + "MoFangManager",
"dispatchKeyEvent ------ bluetoothName = $bluetoothName ---code = $keyCode -----action = $action ")
"dispatchKeyEvent ------ bluetoothName = $bluetoothName ---code = $keyCode -----action = $action ---HmiBuildConfig.isShowMfToastView = ${HmiBuildConfig.isShowMfToastView}")
if (keyCode == KeyEvent.KEYCODE_A) { //单击 -1长按无操作AB组合-2
if (action == KeyEvent.ACTION_DOWN) {
pressADownTime = System.currentTimeMillis()
d(M_F + "MoFangManager",
"dispatchKeyEvent A down pressADownTime = " + pressADownTime + "---" + (pressADownTime - startPressTime) + "----isCombinationKey = " + isCombinationKey + "--pressBDownTime = " + pressBDownTime)
if (pressADownTime - startPressTime in (clickTimeInterval + 1) until longPressTime && pressBDownTime > 0) {
if (isShowToast) {
ToastUtils.showShort("方块 A 按AB组合 +1 ")
if (HmiBuildConfig.isShowMfToastView) {
ToastUtils.showShort("方块 A 按AB组合 +1 timeInterval: ${pressADownTime - startPressTime}ms---$pressBDownTime")
}
sendAcc(true, +1.0)
isCombinationKey = 3
}
if (isCombinationKey != 3 && isCombinationKey != 1) {
if (pressADownTime - startPressTime > longPressTimeInterval) {
if (isShowToast) {
ToastUtils.showShort("方块 长按A -2 ")
if (HmiBuildConfig.isShowMfToastView) {
ToastUtils.showShort("方块 长按A -2 timeInterval: ${pressADownTime - startPressTime}ms")
}
sendAcc(true, -2.0)
isCombinationKey = 2
@@ -199,8 +199,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
"dispatchKeyEvent A up pressAUpTime = " + pressAUpTime + "---" + (pressAUpTime - startPressTime) + "--pressBDownTime = " + pressBDownTime + "---isCombinationKey = $isCombinationKey")
if (pressAUpTime - startPressTime < clickTime && isCombinationKey != 3) {
isCombinationKey = 1
if (isShowToast) {
ToastUtils.showShort("方块 单击A -1 ")
if (HmiBuildConfig.isShowMfToastView) {
ToastUtils.showShort("方块 单击A -1 timeInterval: ${pressAUpTime - startPressTime}ms")
}
sendAcc(true, -1.0)
}
@@ -215,16 +215,16 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
"dispatchKeyEvent B down pressBDownTime = " + pressBDownTime + "--差-" + (pressBDownTime - startPressTime) + "---isCombinationKey = " + isCombinationKey + "--pressADownTime = " + pressADownTime
)
if (pressBDownTime - startPressTime > clickTimeInterval && pressBDownTime - startPressTime < longPressTime && pressADownTime > 0) {
if (isShowToast) {
ToastUtils.showShort("方块 B 按AB组合 +1 ")
if (HmiBuildConfig.isShowMfToastView) {
ToastUtils.showShort("方块 B 按AB组合 +1 timeInterval: ${pressBDownTime - startPressTime}ms ---pressADownTime = $pressADownTime ")
}
sendAcc(true, +1.0)
isCombinationKey = 3
}
if (isCombinationKey != 3 && isCombinationKey != 1) {
if (pressBDownTime - startPressTime > longPressTimeInterval) {
if (isShowToast) {
ToastUtils.showShort("方块 长按B 无操作 ")
if (HmiBuildConfig.isShowMfToastView) {
ToastUtils.showShort("方块 长按B 无操作 timeInterval: ${pressBDownTime - startPressTime}ms")
}
isCombinationKey = 2
}
@@ -234,8 +234,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
d(M_F + "MoFangManager",
"dispatchKeyEvent B up pressBUpTime = " + pressBUpTime + "--差-" + (pressBUpTime - startPressTime) + "--pressADownTime = " + pressADownTime + "----isCombinationKey = $isCombinationKey")
if (pressBUpTime - startPressTime < clickTime && isCombinationKey != 3) {
if (isShowToast) {
ToastUtils.showShort("方块 单击B 0 ")
if (HmiBuildConfig.isShowMfToastView) {
ToastUtils.showShort("方块 单击B 0 timeInterval: ${pressBUpTime - startPressTime}ms")
}
sendAcc(false, 0.0)
isCombinationKey = 1
@@ -250,8 +250,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
d(M_F + "MoFangManager",
"dispatchKeyEvent 方块 长按C 无操作 time dif = " + (pressCDownTime - startPressTime))
if (pressCDownTime - startPressTime > longPressTimeInterval) {
if (isShowToast) {
ToastUtils.showShort("方块 长按C 无操作 ")
if (HmiBuildConfig.isShowMfToastView) {
ToastUtils.showShort("方块 长按C 无操作 timeInterval: ${pressCDownTime - startPressTime}ms")
}
}
} else if (action == KeyEvent.ACTION_UP) {
@@ -260,8 +260,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
d(M_F + "MoFangManager",
"dispatchKeyEvent 方块 单击C ← 向左变道 time dif = " + (pressCUpTime - startPressTime))
if (pressCUpTime - startPressTime < clickTime) {
if (isShowToast) {
ToastUtils.showShort("方块 单击C ← 向左变道 ")
if (HmiBuildConfig.isShowMfToastView) {
ToastUtils.showShort("方块 单击C ← 向左变道 timeInterval: ${pressCUpTime - startPressTime}ms")
}
sendOperatorChangeLaneLeft()
}
@@ -272,8 +272,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
d(M_F + "MoFangManager",
"dispatchKeyEvent 方块 长按D 无操作 time dif = " + (pressDDownTime - startPressTime))
if (pressDDownTime - startPressTime > longPressTimeInterval) {
if (isShowToast) {
ToastUtils.showShort("方块 长按D 无操作 ")
if (HmiBuildConfig.isShowMfToastView) {
ToastUtils.showShort("方块 长按D 无操作 timeInterval: ${pressDDownTime - startPressTime}ms")
}
}
} else if (action == KeyEvent.ACTION_UP) {
@@ -282,8 +282,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
d(M_F + "MoFangManager",
"dispatchKeyEvent 方块 单击D → 向右变道 time dif = " + (pressDUpTime - startPressTime))
if (pressDUpTime - startPressTime < clickTime) {
if (isShowToast) {
ToastUtils.showShort("方块 单击D → 向右变道 ")
if (HmiBuildConfig.isShowMfToastView) {
ToastUtils.showShort("方块 单击D → 向右变道 timeInterval: ${pressDUpTime - startPressTime}ms")
}
sendOperatorChangeLaneRight()
}
@@ -294,8 +294,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
d(M_F + "MoFangManager",
"dispatchKeyEvent 方块 长按E 鸣笛 time dif = " + (pressEDownTime - startPressTime))
if (pressEDownTime - startPressTime > longPressTimeInterval) {
if (isShowToast) {
ToastUtils.showShort("方块 长按E 鸣笛 ")
if (HmiBuildConfig.isShowMfToastView) {
ToastUtils.showShort("方块 长按E 鸣笛 timeInterval: ${pressEDownTime - startPressTime}ms")
}
sendOperatorSetHorn(1.0)
if (timerHorn == null) {
@@ -314,8 +314,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
d(M_F + "MoFangManager",
"方块 单击E 开启自动驾驶 time dif = " + (pressEUpTime - startPressTime))
if (pressEUpTime - startPressTime < clickTime) {
if (isShowToast) {
ToastUtils.showShort("方块 单击E 开启自动驾驶 ")
if (HmiBuildConfig.isShowMfToastView) {
ToastUtils.showShort("方块 单击E 开启自动驾驶 timeInterval: ${pressEUpTime - startPressTime}ms")
}
startAutoPilot(getAutoPilotStatusInfo().autopilotControlParameters)
}

View File

@@ -83,7 +83,7 @@ class SceneManager {
}
}
//call back
CallerDevaToolsListenerManager.invokeDevaToolsModuleLogChanges(sceneModuleTAG.map)
// CallerDevaToolsListenerManager.invokeDevaToolsModuleLogChanges(sceneModuleTAG.map)
}
}

View File

@@ -1,8 +1,6 @@
package com.zhjt.mogo_core_function_devatools.upgrade
import android.app.NotificationManager
import android.content.Context
import androidx.core.app.NotificationCompat
import com.elegant.utils.UiThreadHandler
import com.mogo.eagle.core.data.obu.MogoObuConst
import com.mogo.eagle.core.function.api.devatools.IMogoDevaToolsUpgradeListener
@@ -128,31 +126,20 @@ class UpgradeManager : IDownload {
}
/**
* 鹰眼app下载监听 liyz
* 鹰眼app下载监听
*/
fun updateUpgradeProgress(context: Context) {
val builder = NotificationCompat.Builder(context)
// builder.setSmallIcon(R.mipmap.icon1001);//todo emArrow 更换图标,去除地图下载图标的依赖关系
builder.setContentTitle("下载")
builder.setContentText("正在下载")
val manager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
CallerDevaToolsUpgradeListenerManager.addListener(
TAG,
object : IMogoDevaToolsUpgradeListener {
override fun onStart(url: String?) {}
override fun onPause(url: String?) {}
override fun onProgress(url: String?, length: Int) {
builder.setProgress(100, length, false)
manager.notify(0x3, builder.build())
//下载进度提示
builder.setContentText("已下载$length%")
updateStatusBarDownloadView(true, "download", length)
}
override fun onFinished(url: String?) {
builder.setContentText("已下载" + 100 + "%")
UiThreadHandler.postDelayed({
manager.cancel(0x3)
updateStatusBarDownloadView(false, "download", 100)
}, 1000)
}

View File

@@ -98,20 +98,20 @@
</activity>
<activity
android:name="com.mogo.eagle.core.function.main.VideoAdAtc"
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize"
android:enabled="true"
android:exported="true"
android:process=":video_ad"
android:resizeableActivity="false"
android:resumeWhilePausing="true"
android:screenOrientation="landscape"
android:stateNotNeeded="true"
android:theme="@style/Main"
android:windowSoftInputMode="adjustPan|stateHidden">
<!-- <activity-->
<!-- android:name="com.mogo.eagle.core.function.main.VideoAdAtc"-->
<!-- android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize"-->
<!-- android:enabled="true"-->
<!-- android:exported="true"-->
<!-- android:process=":video_ad"-->
<!-- android:resizeableActivity="false"-->
<!-- android:resumeWhilePausing="true"-->
<!-- android:screenOrientation="landscape"-->
<!-- android:stateNotNeeded="true"-->
<!-- android:theme="@style/Main"-->
<!-- android:windowSoftInputMode="adjustPan|stateHidden">-->
</activity>
<!-- </activity>-->
<activity
android:name="com.mogo.eagle.core.function.main.AppListActivity"

View File

@@ -9,6 +9,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.MsgCategory
import com.mogo.eagle.core.data.msgbox.OperationMsg
import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager
@@ -62,6 +63,16 @@ class MMsgBoxBubbleView @JvmOverloads constructor(
mMsgBoxBubbleAdapter?.setData(dataList)
}
}
if(msgBoxList.type == MsgBoxType.OPERATION){
if((msgBoxList.bean as OperationMsg).type == 2){
MsgBoxConfig.noticeList.add(msgBoxList)
if(isShowData){
CallerMsgBoxEventListenerManager.invokeUpdateTipListener(true)
dataList.add(msgBoxList)
mMsgBoxBubbleAdapter?.setData(dataList)
}
}
}
}
}
}

View File

@@ -10,6 +10,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.MsgCategory
import com.mogo.eagle.core.data.msgbox.OperationMsg
import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxEventListener
import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
@@ -64,6 +65,15 @@ class MMsgBoxListView @JvmOverloads constructor(
mMsgBoxListAdapter?.setData(it)
}
}
if(msgBoxList.type == MsgBoxType.OPERATION){
if((msgBoxList.bean as OperationMsg).type == 2){
noticeList?.add(0,msgBoxList)
noticeList?.let {
mMsgBoxListAdapter?.setData(it)
}
}
}
}
}
}

View File

@@ -367,7 +367,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
TimeUtils.millis2String(it[position].timestamp, getHourMinFormat())
holder.tvV2XContent.text = v2XMsg.content
holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable(
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type))
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type))
)
}
}

View File

@@ -28,6 +28,7 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter
private val notice: Int = 1
private val v2x: Int = 2
private val summary: Int = 3
private val operation: Int = 4
var countDownTimer: CountDownTimer?=null
@@ -49,6 +50,10 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_m_msg_box_summary,parent,false)
BubbleSummaryHolder(view)
}
operation -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_m_msg_box_operation,parent,false)
BubbleOperationHolder(view)
}
else -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_m_msg_box_v2x,parent,false)
BubbleV2XHolder(view)
@@ -120,6 +125,13 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter
}
}
}
is BubbleOperationHolder ->{
data?.let {
val operationMsg = it[position].bean as OperationMsg
holder.tvMOperationTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvMOperationContent.text = operationMsg.content
}
}
}
val msgBoxBean: MsgBoxBean = data!![position]
@@ -146,6 +158,8 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter
notice
}else if(data!![position].type == MsgBoxType.V2X && data!![position].sourceType == DataSourceType.SUMMARY){
summary
}else if(data!![position].type == MsgBoxType.OPERATION){
operation
} else{
v2x
}
@@ -175,4 +189,10 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter
var tvMSummaryTime: TextView = itemView.findViewById(R.id.tvMSummaryTime)
}
//通知消息
class BubbleOperationHolder(itemView: View): RecyclerView.ViewHolder(itemView){
var tvMOperationTime: TextView = itemView.findViewById(R.id.tvMOperationTime)
var tvMOperationContent: TextView = itemView.findViewById(R.id.tvMOperationContent)
}
}

View File

@@ -9,10 +9,7 @@ import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
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
import com.mogo.eagle.core.data.msgbox.NoticeFrCloudMsg
import com.mogo.eagle.core.data.msgbox.V2XMsg
import com.mogo.eagle.core.data.msgbox.*
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
import com.mogo.eagle.core.function.hmi.R
@@ -28,6 +25,7 @@ class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter<R
private val notice: Int = 1
private val v2x: Int = 2
private val summary: Int = 3
private val operation: Int = 4
fun setData(data: List<MsgBoxBean>){
this.data = data
@@ -44,6 +42,10 @@ class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter<R
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_m_msg_list_summary,parent,false)
ListSummaryHolder(view)
}
operation -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_m_msg_list_operation,parent,false)
ListOperationHolder(view)
}
else -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_m_msg_list_v2x,parent,false)
ListV2XHolder(view)
@@ -111,6 +113,13 @@ class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter<R
}
}
}
is ListOperationHolder -> {
data?.let {
val operationMsg = it[position].bean as OperationMsg
holder.tvMOperationTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvMOperationContent.text = operationMsg.content
}
}
}
}
@@ -121,7 +130,9 @@ class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter<R
notice
}else if(data!![position].type == MsgBoxType.V2X && data!![position].sourceType == DataSourceType.SUMMARY){
summary
} else{
}else if(data!![position].type == MsgBoxType.OPERATION){
operation
}else{
v2x
}
}
@@ -149,4 +160,10 @@ class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter<R
var tvMSummaryTime: TextView = itemView.findViewById(R.id.tvMSummaryTime)
}
//运营消息
class ListOperationHolder(itemView: View): RecyclerView.ViewHolder(itemView){
var tvMOperationTime: TextView = itemView.findViewById(R.id.tvMOperationTime)
var tvMOperationContent: TextView = itemView.findViewById(R.id.tvMOperationContent)
}
}

View File

@@ -9,6 +9,7 @@ import android.graphics.Color
import android.os.Build
import android.text.Html
import android.util.AttributeSet
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import androidx.annotation.RequiresApi
@@ -21,6 +22,7 @@ import chassis.Chassis
import chassis.ChassisStatesOuterClass
import com.mogo.cloud.passport.MoGoAiCloudClient
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.constants.SharedPrefsConstants
import com.mogo.commons.debug.DebugConfig
import com.mogo.commons.module.status.MogoStatusManager
import com.mogo.eagle.core.data.app.AppConfigInfo
@@ -76,6 +78,8 @@ import com.mogo.eagle.core.utilcode.util.*
import com.mogo.map.uicontroller.VisualAngleMode
import com.mogo.map.uicontroller.VisualAngleMode.*
import kotlinx.android.synthetic.main.view_debug_setting.view.*
import kotlinx.android.synthetic.main.view_debug_setting.view.tbRouteDynamicEffect
import kotlinx.android.synthetic.main.view_sop_setting.view.*
import kotlinx.coroutines.launch
import mogo.telematics.pad.MessagePad
import mogo_msg.MogoReportMsg
@@ -123,6 +127,7 @@ internal class DebugSettingView @JvmOverloads constructor(
private var logInfoView: LogInfoView? = null
private var logViewAttach = false
@Volatile
private var mAutoPilotStatusInfo: AutopilotStatusInfo? = null
private var mGnssInfo: MogoLocation? = null
@@ -132,15 +137,19 @@ internal class DebugSettingView @JvmOverloads constructor(
private var accelerationThresholdNum: Double = 0.0
// 感知识别「已知类型」数据个数
@Volatile
private var mIdentifyDataSize = 0
// 感知识别「未知类型」数据个数
@Volatile
private var mUnknownIdentifyDataSize = 0
// 引导线点个数
@Volatile
private var mTrajectoryInfoSize = 0
// 全局路径规划点个数
@Volatile
private var mRouteInfoSize = 0
//日志过滤标签集合
@@ -208,7 +217,6 @@ internal class DebugSettingView @JvmOverloads constructor(
CallerChassisGearStateListenerManager.addListener(TAG, this)
CallerChassisSteeringStateListenerManager.addListener(TAG, this)
CallerChassisThrottleStateListenerManager.addListener(TAG, this)
//添加 开发套件工具接口 监听
CallerDevaToolsListenerManager.addListener(TAG, this)
//添加 底盘灯光数据 监听
@@ -259,6 +267,7 @@ internal class DebugSettingView @JvmOverloads constructor(
CallerChassisLamplightListenerManager.removeListener(TAG)
// 移除 obu获取信息 监听
CallerObuInfoListenerManager.removeListener(TAG)
// 移除 业务配置监听
CallerDevaToolsFuncConfigListenerManager.unRegisterDevaToolsFuncConfigListener(
FuncBizConfig.FOUNDATION,
@@ -296,21 +305,22 @@ internal class DebugSettingView @JvmOverloads constructor(
}
}
/**
* 魔戒控制
*/
tbMojie.setOnCheckedChangeListener { buttonView, isChecked ->
if (isChecked) {
buttonView.setCompoundDrawables(null, null, iconDown, null)
btnOpenAllGestures.visibility = View.VISIBLE
tbOpenMfView.visibility = View.VISIBLE
} else {
buttonView.setCompoundDrawables(null, null, iconRight, null)
btnOpenAllGestures.visibility = View.GONE
tbOpenMfView.visibility = View.GONE
}
}
btnOpenAllGestures.setOnClickListener {
CallerMapUIServiceManager.getMapUIController()?.setAllGesturesEnabled(true)
/**
* 蘑方控制 默认关闭
*/
tbOpenMfView.isChecked = HmiBuildConfig.isShowMfToastView
tbOpenMfView.setOnCheckedChangeListener { _, isChecked ->
HmiBuildConfig.isShowMfToastView = isChecked
}
/**
@@ -361,6 +371,7 @@ internal class DebugSettingView @JvmOverloads constructor(
swDevelopMode.visibility = View.GONE
}
}
/**
* 开发者模式
*/
@@ -634,12 +645,6 @@ internal class DebugSettingView @JvmOverloads constructor(
FunctionBuildConfig.isBeautyMode = isChecked
}
tbV2NFromCar.isChecked = FunctionBuildConfig.isV2NFromCar
//v2n车端预警
tbV2NFromCar.setOnCheckedChangeListener { _, isChecked ->
FunctionBuildConfig.isV2NFromCar = isChecked
}
tbDrawAiCloudFusion.isChecked = FunctionBuildConfig.isDrawAiCloudFusion
//云端感知绘制
tbDrawAiCloudFusion.setOnCheckedChangeListener { _, isChecked ->
@@ -1597,6 +1602,7 @@ internal class DebugSettingView @JvmOverloads constructor(
tvAutopilotInfo.text = autopilotJson
tvIpcInfo.text = autopilotJson
tvIpcInfoKey.text = autopilotJson
tvCmdbCarInfoContent.text = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.CAR_INFO)
tvCarInfo.text =
"GPS时间${(mGnssInfo?.satelliteTime?.times(1000))?.toLong()}\n" +
@@ -2056,4 +2062,5 @@ internal class DebugSettingView @JvmOverloads constructor(
override fun onObuDeviceId(obuDeviceId: String) {
mObuDeviceId = obuDeviceId
}
}

View File

@@ -73,11 +73,11 @@ internal class SOPSettingView @JvmOverloads constructor(
/**
* obu弱势交通控制
*/
tbObuWeaknessTrafficSop.isChecked = HmiBuildConfig.isShowObuWeaknessTrafficView
tbObuWeaknessTrafficSop.setOnCheckedChangeListener { _, isChecked ->
// 默认开启
HmiBuildConfig.isShowObuWeaknessTrafficView = !isChecked
}
// tbObuWeaknessTrafficSop.isChecked = HmiBuildConfig.isShowObuWeaknessTrafficView
// tbObuWeaknessTrafficSop.setOnCheckedChangeListener { _, isChecked ->
// // 默认开启
// HmiBuildConfig.isShowObuWeaknessTrafficView = !isChecked
// }
/**
* 云端弱势交通控制
@@ -88,14 +88,6 @@ internal class SOPSettingView @JvmOverloads constructor(
HmiBuildConfig.isShowCloudWeaknessTrafficView = isChecked
}
/**
* 限速数据来源开关
*/
tbRoadLimitSpeedSop.setOnCheckedChangeListener { _, isChecked ->
// 默认关闭
HmiBuildConfig.isShowObuLimitSpeedView = isChecked
}
/**
* obu V2V开关默认打开
*/

View File

@@ -1,36 +0,0 @@
package com.mogo.eagle.core.function.hmi.ui.setting
import android.content.Context
import android.util.AttributeSet
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
/**
* @author XuXinChao
* @description fix java.lang.IndexOutOfBoundsException检测到不一致。视图持有者适配器positionViewHolder无效
* @since: 2022/6/7
*/
class WrapContentLinearLayoutManager : LinearLayoutManager {
constructor(context: Context?) : super(context) {}
constructor(context: Context?, orientation: Int, reverseLayout: Boolean) : super(
context,
orientation,
reverseLayout
) {}
constructor(
context: Context?,
attrs: AttributeSet?,
defStyleAttr: Int,
defStyleRes: Int
) : super(context, attrs, defStyleAttr, defStyleRes) {}
override fun onLayoutChildren(recycler: RecyclerView.Recycler?, state: RecyclerView.State?) {
try {
super.onLayoutChildren(recycler, state)
} catch (e: IndexOutOfBoundsException) {
e.printStackTrace()
}
}
}

View File

@@ -51,6 +51,7 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor(
private var clickListener: ClickListener? = null
private var keyBoardUtil: KeyBoardUtil? = null
@Volatile
private var connectStatus = false
private var lastTime = 0L

View File

@@ -40,6 +40,7 @@ class PncActionsView @JvmOverloads constructor(
@Volatile
private var mTrafficLightResult: TrafficLightResult? = null
@Volatile
private var mAutoPilotStatusInfo: AutopilotStatusInfo? = null
private val bgResources: Int

View File

@@ -11,6 +11,7 @@ import android.view.View
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import kotlin.math.abs
@@ -139,17 +140,19 @@ class BatteryView : View , IMoGoSkinModeChangeListener {
}
override fun onSkinModeChange(skinMode: Int) {
when (skinMode) {
0 -> {
batteryColor = resources.getColor(R.color.color_27FFFFFF)
powerColor = Color.WHITE
}
1 -> {
batteryColor = resources.getColor(R.color.color_1E111111)
powerColor = resources.getColor(R.color.color_2C2E30)
ThreadUtils.runOnUiThread {
when (skinMode) {
0 -> {
batteryColor = resources.getColor(R.color.color_27FFFFFF)
powerColor = Color.WHITE
}
1 -> {
batteryColor = resources.getColor(R.color.color_1E111111)
powerColor = resources.getColor(R.color.color_2C2E30)
}
}
invalidate()
}
invalidate()
}
override fun onAttachedToWindow() {

View File

@@ -29,7 +29,9 @@ class CheckSystemView @JvmOverloads constructor(
const val TAG = "CheckSystemView"
}
@Volatile
private var connectStatus = false //是否连接工控机
@Volatile
private var autopilotStatus: Int? = null //自动驾驶状态 0代表不可自动驾驶,1代表可自动驾驶,2代表自动驾驶中
private var dockerRebootDialog: DockerRebootDialog? = null

View File

@@ -27,6 +27,7 @@ class SpeedPanelView @JvmOverloads constructor(
var mContext: Context
var mSpeedChartView: SpeedChartView
@Volatile
var mLatLng: MogoLocation? = null
init {

View File

@@ -14,6 +14,7 @@ import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.util.BarUtils
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import kotlinx.android.synthetic.main.view_status_bar.view.*
import java.util.concurrent.CopyOnWriteArrayList
@@ -55,9 +56,11 @@ class StatusBarView @JvmOverloads constructor(
}
override fun onSkinModeChange(skinMode: Int) {
when (skinMode) {
0 -> setStatusBarDarkOrLight(false)
1 -> setStatusBarDarkOrLight(true)
ThreadUtils.runOnUiThread {
when (skinMode) {
0 -> setStatusBarDarkOrLight(false)
1 -> setStatusBarDarkOrLight(true)
}
}
}

View File

@@ -31,6 +31,7 @@ class VersionNameView @JvmOverloads constructor(
const val TAG = "VersionNameView"
}
@Volatile
private var dockerVersion: String? = null //工控机版本
init{

View File

@@ -293,11 +293,13 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
}
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
val status = autoPilotStatusInfo.ipcConnStatus
if (mLastStatus != status) {
val statusInfo = autoPilotStatusInfo.clone()
rvConnectInfo.post { updateConnectInfoView(statusInfo) }
mLastStatus = status
UiThreadHandler.post {
val status = autoPilotStatusInfo.ipcConnStatus
if (mLastStatus != status) {
val statusInfo = autoPilotStatusInfo.clone()
rvConnectInfo.post { updateConnectInfoView(statusInfo) }
mLastStatus = status
}
}
}

View File

@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.main;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Process;
@@ -18,20 +17,15 @@ import com.mogo.eagle.core.data.constants.MogoServicePaths;
import com.mogo.eagle.core.function.api.chat.biz.ChatConsts;
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager;
import com.mogo.eagle.core.function.msgbox.db.MsgBoxDb;
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
import com.mogo.eagle.core.utilcode.mogo.AppLaunchTimeUtils;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.ProcessUtils;
import com.mogo.eagle.core.utilcode.util.SPUtils;
import java.io.File;
import java.lang.reflect.Field;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* 默认初始化一些基础服务配置 todo 分离 msgBox去自己的模块中 --- 扶风
* 默认初始化一些基础服务配置
*/
public abstract class MainMoGoApplication extends AbsMogoApplication {
@@ -50,12 +44,8 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
initLogConfig();
initTipToast();
initModules();
if (ProcessUtils.isMainProcess(this)) {
clearMessageBoxTable();
CallerMsgBoxManager.INSTANCE.queryAllMessages(this);
}
CallerMsgBoxManager.INSTANCE.queryAllMessages(this);
CallerDevaToolsManager.INSTANCE.updateUpgradeProgress();
CallerDevaToolsManager.INSTANCE.updateObuUpgradeStatus();
}
@Override
@@ -64,38 +54,6 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
return true;
}
@SuppressLint("SimpleDateFormat")
private void clearMessageBoxTable() {
new Thread(() -> {
String lastLaunchTimeStr = SPUtils.getInstance().getString("last_launch", "");
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Date currDate = new Date(System.currentTimeMillis());
String currTimeStr = format.format(currDate);
try {
if (lastLaunchTimeStr != null && !lastLaunchTimeStr.isEmpty()) {
boolean isSameDay = currTimeStr.equals(lastLaunchTimeStr);
// 超过一天需要清除消息盒子中的数据并把时间戳存入SP
if (!isSameDay) {
File file = this.getDatabasePath(MsgBoxDb.INTERNAL_DB_NAME);
if (file != null && file.exists()) {
this.deleteDatabase(MsgBoxDb.INTERNAL_DB_NAME);
}
SPUtils.getInstance().put("last_launch", currTimeStr);
}
} else {
// 首次使用App或中途仅删除sp文件
File file = this.getDatabasePath(MsgBoxDb.INTERNAL_DB_NAME);
if (file != null && file.exists()) {
this.deleteDatabase(MsgBoxDb.INTERNAL_DB_NAME);
}
SPUtils.getInstance().put("last_launch", currTimeStr);
}
} catch (Exception e) {
CallerLogger.INSTANCE.e(TAG, e.getMessage());
}
}).start();
}
/**
* 初始化异常采集配置
*/
@@ -126,11 +84,11 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_V2X_OBU_MOGO, "IMoGoObuProvider"));
// BIZ
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_FUNC_BIZ, "IMoGoNoticeProvider"));
// todo 后置 车聊聊IM
// 后置 车聊聊IM
MogoModulePaths.addModuleFunctionServer(new MogoModule(ChatConsts.CHAT_PROVIDER_PATH, ChatConsts.CHAT_MODULE_NAME));
// 司机身份专属
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
// todo 后置 地图数据收集模块
// 后置 地图数据收集模块
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_MAP_DATA_COLLECT_PROVIDER, "MoGoMapDataCollector"));
}
CallerLogger.INSTANCE.i(M_HMI + TAG, "App launch timer cost " + (System.currentTimeMillis() - start) + "ms");
@@ -141,7 +99,7 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
super.attachBaseContext(base);
/*如果是主进程**/
// if (ProcessUtils.isMainProcess(this)) {
AppLaunchTimeUtils.beginTimeCalculate(AppLaunchTimeUtils.COLD_START);
AppLaunchTimeUtils.beginTimeCalculate(AppLaunchTimeUtils.COLD_START);
// }
BoostMultiDex.install(base);
AbsMogoApplication.sApp = this;

View File

@@ -11,19 +11,19 @@ import com.mogo.eagle.core.widget.TextureVideoView
*/
class VideoAdAtc : AppCompatActivity() {
private lateinit var svpFrame: TextureVideoView
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_video_ad_atc)
svpFrame = findViewById(R.id.svp_frame)
val url = "android.resource://" + packageName + "/" + R.raw.mogo_ad
svpFrame.videoPath = url
svpFrame.start()
BarUtils.hideStatusBarAndSticky(this.window)
}
// private lateinit var svpFrame: TextureVideoView
//
// override fun onCreate(savedInstanceState: Bundle?) {
// super.onCreate(savedInstanceState)
// setContentView(R.layout.activity_video_ad_atc)
//
// svpFrame = findViewById(R.id.svp_frame)
//
// val url = "android.resource://" + packageName + "/" + R.raw.mogo_ad
// svpFrame.videoPath = url
// svpFrame.start()
//
// BarUtils.hideStatusBarAndSticky(this.window)
// }
}

View File

@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="450dp"
android:layout_height="110dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#FFFFFFFF"
app:roundLayoutRadius="@dimen/dp_18"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginBottom="@dimen/dp_10">
<ImageView
android:id="@+id/ivMOperationImage"
android:layout_width="@dimen/dp_83"
android:layout_height="@dimen/dp_83"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginStart="@dimen/dp_13"
android:src="@drawable/icon_msg_box_operation_stop"
/>
<TextView
android:id="@+id/tvMOperationTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:textColor="#99203555"
android:textSize="18dp"
android:layout_marginEnd="@dimen/dp_20"
/>
<TextView
android:id="@+id/tvMOperationContent"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/ivMOperationImage"
app:layout_constraintRight_toLeftOf="@id/tvMOperationTime"
android:gravity="start"
android:textColor="#FF203555"
android:textSize="20dp"
android:layout_marginStart="@dimen/dp_13"
android:layout_marginEnd="@dimen/dp_13"
/>
</com.mogo.eagle.core.widget.RoundConstraintLayout>

View File

@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_100"
xmlns:app="http://schemas.android.com/apk/res-auto">
<ImageView
android:id="@+id/ivMOperationImage"
android:layout_width="@dimen/dp_68"
android:layout_height="@dimen/dp_68"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginStart="@dimen/dp_16"
android:src="@drawable/icon_msg_box_operation_stop"
/>
<TextView
android:id="@+id/tvMOperationTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:textColor="#FF4A5B76"
android:textSize="@dimen/dp_18"
android:layout_marginEnd="@dimen/dp_10"
/>
<TextView
android:id="@+id/tvMOperationContent"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/ivMOperationImage"
app:layout_constraintRight_toLeftOf="@id/tvMOperationTime"
android:gravity="start"
android:textColor="#FF203555"
android:textSize="@dimen/dp_20"
android:layout_marginStart="@dimen/dp_16"
android:layout_marginEnd="@dimen/dp_16"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -206,6 +206,29 @@
android:layout_height="1dp"
android:background="#F0F0F0" />
<TextView
android:id="@+id/tvCmdbCarInfo"
style="@style/DebugSettingText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="车辆信息: " />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0" />
<TextView
android:id="@+id/tvCmdbCarInfoContent"
style="@style/DebugSettingText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minLines="5" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0" />
<ToggleButton
android:id="@+id/tbIsDemoMode"
android:layout_width="match_parent"
@@ -242,18 +265,6 @@
android:textOn="关闭感知优化模式"
android:textSize="@dimen/dp_24" />
<ToggleButton
android:id="@+id/tbV2NFromCar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:padding="@dimen/dp_20"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="开启车端V2N预警"
android:textOn="关闭车端V2N预警"
android:textSize="@dimen/dp_24" />
<ToggleButton
android:id="@+id/tbDrawAiCloudFusion"
android:layout_width="match_parent"
@@ -298,21 +309,22 @@
android:background="@drawable/radio_button_normal_background_right"
android:drawableEnd="@drawable/icon_right"
android:padding="@dimen/dp_20"
android:textOff="魔戒控制"
android:textOn="魔戒控制"
android:textOff="蘑方控制"
android:textOn="蘑方控制"
android:textSize="@dimen/dp_24" />
<Button
android:id="@+id/btnOpenAllGestures"
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/tbOpenMfView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="@dimen/dp_20"
android:text="开启手势滑动"
android:textSize="@dimen/dp_24"
android:text="打开蘑方按键Toast"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
android:layout_marginLeft="10dp"
android:scaleY="1"
android:scaleX="1"
/>
<Button
android:id="@+id/btnIpcReboot"

View File

@@ -163,11 +163,13 @@
app:layout_constraintRight_toRightOf="parent"
/>
<!--这个后面产品会统一去掉-->
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/tbObuToDcView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="OBU到工控机V2I显示"
android:visibility="gone"
android:paddingTop="25dp"
android:paddingBottom="25dp"
android:scaleY="1.2"
@@ -200,7 +202,7 @@
android:paddingBottom="25dp"
android:scaleY="1.2"
android:scaleX="1.2"
app:layout_constraintTop_toBottomOf="@id/tbObuToDcView"
app:layout_constraintTop_toBottomOf="@id/tbObuV2vView"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/verticalGuideLine"
/>
@@ -214,23 +216,9 @@
android:paddingBottom="25dp"
android:scaleY="1.2"
android:scaleX="1.2"
app:layout_constraintTop_toBottomOf="@id/tbObuToDcView"
app:layout_constraintLeft_toRightOf="@id/verticalGuideLine"
app:layout_constraintRight_toRightOf="parent"
/>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/tbRoadLimitSpeedSop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="路侧限速提醒"
android:paddingTop="25dp"
android:paddingBottom="25dp"
android:scaleY="1.2"
android:scaleX="1.2"
app:layout_constraintTop_toBottomOf="@id/tbCloudWeaknessTrafficSop"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/tbObuWeaknessTrafficSop"
app:layout_constraintRight_toLeftOf="@id/verticalGuideLine"
app:layout_constraintLeft_toLeftOf="parent"
/>
<TextView
@@ -238,7 +226,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/tbRoadLimitSpeedSop"
app:layout_constraintTop_toBottomOf="@id/tbIPCReport"
android:text="变道速度阈值:"
android:textSize="@dimen/dp_36"
android:textColor="#1A1A1A"

View File

@@ -23,7 +23,7 @@ public class SpeedLimitDataManager implements IMoGoChassisLocationGCJ02Listener
private final static String TAG = "SpeedLimitDataManager";
private static volatile SpeedLimitDataManager instance;
private MogoLocation mLocation;
private volatile MogoLocation mLocation;
private SpeedLimitDataManager() {
}

View File

@@ -1,6 +1,7 @@
package com.mogo.eagle.core.function.business.ai.net
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.constants.HostConst
import com.mogo.commons.debug.DebugConfig
import com.mogo.eagle.core.data.BaseResponse
import com.mogo.eagle.core.function.business.ai.AiCloudIdentifyDataManager.Companion.END_METRE
@@ -27,7 +28,7 @@ class AiCloudIdentifyNetWorkModel {
return host
}
private fun getNetWorkApi(baseUrl: String = getHost()): IAiCloudIdentifyApiService {
private fun getNetWorkApi(baseUrl: String = HostConst.getEagleHost()): IAiCloudIdentifyApiService {
return MoGoRetrofitFactory.getInstanceNoCallAdapter(baseUrl)
.create(IAiCloudIdentifyApiService::class.java)
}

View File

@@ -8,6 +8,6 @@ import retrofit2.http.POST
interface IAiCloudIdentifyApiService {
@Headers("Content-type:application/json;charset=UTF-8")
@POST("yycp-c-v2x-service/dataFusion/remoteDrivingSet")
@POST("eagle-eye-dns/yycp-c-v2x-service/dataFusion/remoteDrivingSet")
suspend fun identifyRange(@Body map: MutableMap<String, Any>): BaseResponse<Any>
}

View File

@@ -1,10 +1,10 @@
package com.mogo.eagle.core.function.smp
import android.content.Context
import android.util.Log
import com.amap.api.maps.CoordinateConverter
import com.amap.api.maps.model.LatLng
import com.mogo.eagle.core.utilcode.util.CoordinateUtils
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils
import io.reactivex.Observable
import io.reactivex.ObservableOnSubscribe
import io.reactivex.android.schedulers.AndroidSchedulers
@@ -35,7 +35,7 @@ object MarkerDrawerManager {
var lastArrivedIndex: Int = -1
@Volatile
var lonLat = Pair(0.0, 0.0)
var lonLatHeading = Triple(0.0, 0.0, 0.0)
var callback: Callback? = null
@@ -59,16 +59,17 @@ object MarkerDrawerManager {
private fun getLoopCalCarObservable(): Observable<Int> {
return Observable.create(ObservableOnSubscribe { emitter ->
if (emitter.isDisposed) return@ObservableOnSubscribe
loopRouteAndWipe(planningPoints, lonLat.first, lonLat.second)
loopRouteAndWipe(planningPoints, lonLatHeading.first, lonLatHeading.second, lonLatHeading.third)
emitter.onComplete()
})
}
private fun loopRouteAndWipe(routePoints: List<LatLng>?, lon: Double, lat: Double) {
private fun loopRouteAndWipe(routePoints: List<LatLng>?, lon: Double, lat: Double, heading: Double) {
if (routePoints != null && routePoints.isNotEmpty()) {
val arrivedIndex: Int = getArrivedPointIndex(routePoints, lon, lat)
val newPointList = ArrayList<LatLng>()
val arrivedIndex: Int = getArrivedPointIndex(routePoints, newPointList, lon, lat, heading)
if (arrivedIndex != -1 && lastArrivedIndex != arrivedIndex) {
callback?.onLocationChanged(routePoints, arrivedIndex)
callback?.onLocationChanged(newPointList, arrivedIndex)
lastArrivedIndex = arrivedIndex
}
}
@@ -90,8 +91,10 @@ object MarkerDrawerManager {
*/
private fun getArrivedPointIndex(
routePoints: List<LatLng>,
newPoints: MutableList<LatLng>,
realLon: Double,
realLat: Double
realLat: Double,
heading: Double
): Int {
var currentIndex = 0 //记录疑似点
if (routePoints.isNotEmpty()) {
@@ -100,6 +103,7 @@ object MarkerDrawerManager {
var baseDiffDis = CoordinateUtils.calculateLineDistance(
realLon, realLat, baseLatLng.longitude, baseLatLng.latitude
) // lon,lat, prelon, prelat
// val lastIndex = if (lastArrivedIndex >= 1 && lastArrivedIndex <= routePoints.size - 1) lastArrivedIndex else 1
for (i in 1 until routePoints.size) {
val latLng = routePoints[i]
val diff = CoordinateUtils.calculateLineDistance(
@@ -107,12 +111,17 @@ object MarkerDrawerManager {
)
if (baseDiffDis > diff) {
baseDiffDis = diff
currentIndex = i
// 距离最近的时候判断是否走过
if (DrivingDirectionUtils.getDegreeOfCar2Poi2(realLon, realLat, latLng.longitude, latLng.latitude, heading) >= 90) {
currentIndex = i
}
}
}
return currentIndex
newPoints.addAll(routePoints)
newPoints.add(currentIndex + 1, LatLng(realLat, realLon))
return currentIndex + 1
}
return currentIndex
return 0
}
/**

View File

@@ -4,7 +4,6 @@ import android.content.Context
import android.graphics.Color
import android.os.Bundle
import android.util.AttributeSet
import android.util.Log
import android.view.LayoutInflater
import android.view.MotionEvent
import android.widget.RelativeLayout
@@ -52,6 +51,7 @@ class SmallMapView @JvmOverloads constructor(
private var mContext: Context? = null
private var mLocation: MogoLocation? = null
@Volatile
private var autoPilotStatus = 0
companion object {
@@ -216,7 +216,7 @@ class SmallMapView @JvmOverloads constructor(
uiSettings?.setAllGesturesEnabled(false) // 所有手势
uiSettings?.isMyLocationButtonEnabled = false // 显示默认的定位按钮
uiSettings?.setLogoBottomMargin(-150) //设置Logo下边界距离屏幕底部的边距,设置为负值即可
mAMap?.setOnMapLoadedListener(AMap.OnMapLoadedListener {
mAMap?.setOnMapLoadedListener {
CallerLogger.d(
SceneConstant.M_MAP + TAG,
"smp---onMapLoaded"
@@ -237,7 +237,7 @@ class SmallMapView @JvmOverloads constructor(
mAMapNaviView!!.width / 2,
mAMapNaviView!!.height / 2
)
})
}
}
private fun coordinateConverterFrom84(mContext: Context?, mogoLatLng: MogoLatLng): LatLng {
@@ -283,36 +283,39 @@ class SmallMapView @JvmOverloads constructor(
if (mCarMarker == null) {
return
}
val currentLatLng = LatLng(mLocation!!.latitude, mLocation!!.longitude)
val bearing = floor(mLocation!!.heading).toFloat()
//更新车辆位置
mCarMarker!!.position = currentLatLng
if (mCoordinatesLatLng.size > 1) {
// 结束位置
val endLatLng = mCoordinatesLatLng[mCoordinatesLatLng.size - 1]
val calculateDistance = CoordinateUtils.calculateLineDistance(
endLatLng.latitude, endLatLng.longitude,
currentLatLng.latitude, currentLatLng.longitude
)
CallerLogger.d(
SceneConstant.M_MAP + TAG,
"calculateDistance=$calculateDistance"
)
if (calculateDistance <= 5) {
UiThreadHandler.post {
val currentLatLng = LatLng(mLocation!!.latitude, mLocation!!.longitude)
val bearing = floor(mLocation!!.heading).toFloat()
//更新车辆位置
mCarMarker!!.position = currentLatLng
if (mCoordinatesLatLng.size > 1) {
// 结束位置
val endLatLng = mCoordinatesLatLng[mCoordinatesLatLng.size - 1]
val calculateDistance = CoordinateUtils.calculateLineDistance(
endLatLng.latitude, endLatLng.longitude,
currentLatLng.latitude, currentLatLng.longitude
)
CallerLogger.d(
SceneConstant.M_MAP + TAG, "onChassisLocationGCJ02 -----> calculateDistance <= 5 ")
clearPolyline()
mCoordinatesLatLng.clear()
SceneConstant.M_MAP + TAG,
"calculateDistance=$calculateDistance"
)
if (calculateDistance <= 5) {
CallerLogger.d(
SceneConstant.M_MAP + TAG, "onChassisLocationGCJ02 -----> calculateDistance <= 5 ")
clearPolyline()
mCoordinatesLatLng.clear()
}
}
val cameraPosition: CameraPosition =
CameraPosition.Builder()
.target(mCarMarker!!.position)
.tilt(0f)
.bearing(bearing)
.zoom(zoomLevel.toFloat())
.build()
mAMap?.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition))
}
val cameraPosition: CameraPosition =
CameraPosition.Builder()
.target(mCarMarker!!.position)
.tilt(0f)
.bearing(bearing)
.zoom(zoomLevel.toFloat())
.build()
mAMap?.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition))
}
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {

View File

@@ -36,7 +36,7 @@ import com.mogo.eagle.core.function.smp.MakerWithCount
import com.mogo.eagle.core.function.smp.MarkerDrawerManager
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.callback
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.coordinateConverterWgsToGcj
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.lonLat
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.lonLatHeading
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.planningPoints
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.startLoopCalCarLocation
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.updateRoutePoints
@@ -636,6 +636,8 @@ class OverMapView @JvmOverloads constructor(
texIndexList.clear()
}
for (i in coordinates.indices) {
// 线段数比点数少一个
if (i == 0) continue
if (i <= locIndex) {
if (isClearArrived) {
textureList.add(transparentBitmap)
@@ -647,7 +649,7 @@ class OverMapView @JvmOverloads constructor(
// 未走过的纹理
textureList.add(unArrivedBitmap)
}
texIndexList.add(i)
texIndexList.add(i - 1)
}
if (mAMap != null && coordinates.size > 2) {
//设置线段纹理
@@ -670,7 +672,7 @@ class OverMapView @JvmOverloads constructor(
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
gnssInfo?.let {
mLocation = it
lonLat = Pair(it.longitude, it.latitude)
lonLatHeading = Triple(it.longitude, it.latitude, it.heading)
drawCarMarker(it)
if (isFirstLocation) {
displayCustomOverView()