Merge branch 'dev_arch_opt_3.0' into 'dev_robobus-m1-p-app-module_1.1.0_230112_1.1.0'

Dev arch opt 3.0

See merge request zhjt/AndroidApp/MoGoEagleEye!652
This commit is contained in:
wangmingjun
2023-03-03 15:05:33 +00:00
21 changed files with 255 additions and 292 deletions

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)
}
}
/**
@@ -237,8 +245,7 @@ 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 -> {
@@ -380,33 +387,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 * 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
)
}
MogoObuConstants.STATUS.UPDATE -> { // 更新
}
MogoObuConstants.STATUS.UPDATE -> { // 更新
}
MogoObuConstants.STATUS.DELETE -> { // 删除
CallerLimitingVelocityListenerManager.invokeUnion(
-1,
DataSourceType.OBU
)
}
MogoObuConstants.STATUS.DELETE -> { // 删除
CallerLimitingVelocityListenerManager.invokeUnion(
-1,
DataSourceType.OBU
)
}
}
}

View File

@@ -661,7 +661,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 +806,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

@@ -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

@@ -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

@@ -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

@@ -282,11 +282,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

@@ -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,31 +216,17 @@
android:paddingBottom="25dp"
android:scaleY="1.2"
android:scaleX="1.2"
app:layout_constraintTop_toBottomOf="@id/tbObuToDcView"
app:layout_constraintTop_toBottomOf="@id/tbObuWeaknessTrafficSop"
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_constraintRight_toLeftOf="@id/verticalGuideLine"
/>
<TextView
android:id="@+id/tvSpeedThresholdTitle"
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/tbCloudWeaknessTrafficSop"
android:text="变道速度阈值:"
android:textSize="@dimen/dp_36"
android:textColor="#1A1A1A"

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

@@ -125,11 +125,6 @@ interface IDevaToolsProvider : IProvider {
*/
fun updateUpgradeProgress()
/**
* obu下载进度
*/
fun updateObuUpgradeStatus()
/**
* 展示状态栏
*/

View File

@@ -169,13 +169,6 @@ object CallerDevaToolsManager {
devaToolsProviderApi?.updateUpgradeProgress()
}
/**
* obu下载状态
*/
fun updateObuUpgradeStatus() {
devaToolsProviderApi?.updateObuUpgradeStatus()
}
/**
* 展示状态栏
*/

View File

@@ -66,23 +66,23 @@ SERVICE_BIZ_VERSION=1.2.4
LOGLIB_VERSION=1.5.11
######## MogoAiCloudSDK Version ########
# 网络请求LOGLIB_VERSION
MOGO_NETWORK_VERSION=1.4.5.6
MOGO_NETWORK_VERSION=1.4.5.7
# 鉴权
MOGO_PASSPORT_VERSION=1.4.5.6
MOGO_PASSPORT_VERSION=1.4.5.7
# 常链接
MOGO_SOCKET_VERSION=1.4.5.6
MOGO_SOCKET_VERSION=1.4.5.7
# 数据采集
MOGO_REALTIME_VERSION=1.4.5.6
MOGO_REALTIME_VERSION=1.4.5.7
# 探路,道路事件发布,获取
MOGO_TANLU_VERSION=1.4.5.6
MOGO_TANLU_VERSION=1.4.5.7
# 直播推流
MOGO_LIVE_VERSION=1.4.5.6
MOGO_LIVE_VERSION=1.4.5.7
# 直播拉流
MOGO_TRAFFICLIVE_VERSION=1.4.5.6
MOGO_TRAFFICLIVE_VERSION=1.4.5.7
# 定位服务
MOGO_LOCATION_VERSION=1.4.5.6
MOGO_LOCATION_VERSION=1.4.5.7
# 远程通讯模块
MOGO_TELEMATIC_VERSION=1.4.5.6
MOGO_TELEMATIC_VERSION=1.4.5.7
######## MogoAiCloudSDK Version ########
# 自研地图
MAP_SDK_VERSION=2.10.0.9

View File

@@ -29,6 +29,8 @@ import com.mogo.eagle.core.utilcode.util.ThreadUtils;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.tts.base.IMogoTTS;
import com.mogo.tts.base.IMogoTTSCallback;
import com.mogo.tts.base.LangTtsEntity;
import com.mogo.tts.base.LanguageType;
import com.mogo.tts.base.MultiLangTtsEntity;
import com.mogo.tts.base.PreemptType;
import com.zhidao.auto.platform.voice.VoiceClient;
@@ -443,9 +445,11 @@ public class PadTTS implements IMogoTTS, VoiceClient.VoiceCmdCallBack, OnTtsList
@MainThread
public void speakTTSVoiceWithLevel(String text, int ttsLevel, IMogoTTSCallback callBack) {
if (mHasAuth && mEngine != null) {
mSpeakVoiceMap.put(text, callBack);
if (callBack != null) {
mSpeakVoiceMap.put(text, callBack);
}
speakTTSVoiceWithLevel(text, ttsLevel);
}
speakTTSVoiceWithLevel(text, ttsLevel);
}
// 降序插入Tts(目前Level0、1可排队)
@@ -508,7 +512,15 @@ public class PadTTS implements IMogoTTS, VoiceClient.VoiceCmdCallBack, OnTtsList
@Override
public void speakMultiLangTTSWithLevel(MultiLangTtsEntity ttsEntity, int level, IMogoTTSCallback callback) {
if (mHasAuth && mEngine != null) {
LangTtsEntity entity;
if ((entity = ttsEntity.ttsNext()) != null && entity.getLanguage() == LanguageType.CHINESE) {
if (callback != null) {
mSpeakVoiceMap.put(entity.getTtsContent(), callback);
}
speakTTSVoiceWithLevel(entity.getTtsContent(), level);
}
}
}
/**