Merge branch 'master' into dev_mul_bus_shuttle

This commit is contained in:
wangmingjun
2023-01-13 17:28:40 +08:00
12 changed files with 133 additions and 49 deletions

View File

@@ -323,7 +323,7 @@ class AIDataCollectWindow constructor(activity: Activity) : View.OnTouchListener
// 默认固定位置,靠屏幕右边缘的中间
mWindowManager!!.defaultDisplay.getMetrics(metrics)
mWindowParams!!.x = metrics.widthPixels
mWindowParams!!.y = metrics.heightPixels / 2 - BarUtils.getStatusBarHeight()-350
mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight()-950
mWindowManager!!.addView(mFloatLayout, mWindowParams)
}
}

View File

@@ -338,7 +338,7 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
// 默认固定位置,靠屏幕右边缘的中间
mWindowManager!!.defaultDisplay.getMetrics(metrics)
mWindowParams!!.x = metrics.widthPixels
mWindowParams!!.y = metrics.heightPixels / 2 - BarUtils.getStatusBarHeight()-950
mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight()-950
mWindowManager!!.addView(mFloatLayout, mWindowParams)
//开启录包
if(recordCaseEntity!=null){

View File

@@ -63,9 +63,13 @@ import com.mogo.map.uicontroller.IMogoMapUIController;
import com.rousetime.android_startup.StartupManager;
import com.rousetime.android_startup.model.LoggerLevel;
import com.rousetime.android_startup.model.StartupConfig;
import com.zhjt.mogo_core_function_devatools.monitor.db.CpuInfo;
import com.zhjt.mogo_core_function_devatools.monitor.db.MemInfo;
import com.zhjt.mogo_core_function_devatools.monitor.db.MonitorDb;
import com.zhjt.service.chain.ChainLog;
import com.zhjt.service.chain.TracingConstants;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -271,6 +275,7 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
// 启动Native内存泄漏监测
startLeakMonitor();
}
checkMonitorDb();
}
/**
@@ -309,6 +314,25 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
LeakMonitor.INSTANCE.start();
}
private void checkMonitorDb() {
new Thread(() -> {
long limitId = 50001;
File file = this.getDatabasePath(MonitorDb.INTERNAL_DB_NAME);
try {
if (file != null && file.exists()) {
List<CpuInfo> cpuList = MonitorDb.getDb(this).monitorDao().getAllCPUById(limitId);
List<MemInfo> memList = MonitorDb.getDb(this).monitorDao().getAllMemById(limitId);
// 大于5w条清除
if (cpuList.size() > 0 || memList.size() > 0) {
this.deleteDatabase(MonitorDb.INTERNAL_DB_NAME);
}
}
} catch (Exception e) {
CallerLogger.INSTANCE.e(TAG, e.getMessage());
}
}).start();
}
@ChainLog(
linkChainLog = CHAIN_LINK_LOG_NATIVE_LEAK,
linkCode = CHAIN_LINK_LEAK,

View File

@@ -39,9 +39,6 @@ import com.mogo.eagle.core.utilcode.util.ProcessUtils;
import com.mogo.eagle.core.utilcode.util.SPUtils;
import com.mogo.map.MapApiPath;
import com.zhidao.support.obu.ami.AmiClientManager;
import com.zhjt.mogo_core_function_devatools.monitor.db.CpuInfo;
import com.zhjt.mogo_core_function_devatools.monitor.db.MemInfo;
import com.zhjt.mogo_core_function_devatools.monitor.db.MonitorDb;
import java.io.File;
import java.lang.reflect.Field;
@@ -65,21 +62,22 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
}
start = System.currentTimeMillis();
connectAmiIp();
initOverviewDb();
// Crash 日志收集
initCrashConfig();
initLogConfig();
initTipToast();
initModules();
if (DebugConfig.isDebug()) {
initKoom();
}
//查询是否有版本的更新
queryAppUpgrade();
clearMessageBoxTable();
checkMonitorDb();
if (ProcessUtils.isMainProcess(this)) {
initOverviewDb();
if (DebugConfig.isDebug()) {
initKoom();
}
clearMessageBoxTable();
CallerMsgBoxManager.INSTANCE.queryAllMessages(this);
}
upgradeProgressListener();
CallerMsgBoxManager.INSTANCE.queryAllMessages(this);
}
@Override
@@ -104,35 +102,27 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Date currDate = new Date(System.currentTimeMillis());
String currTimeStr = format.format(currDate);
if (lastLaunchTimeStr != null && !lastLaunchTimeStr.isEmpty()) {
boolean isSameDay = currTimeStr.equals(lastLaunchTimeStr);
// 超过一天需要清除消息盒子中的数据并把时间戳存入SP
if (!isSameDay) {
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);
}
} 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);
}
}).start();
}
private void checkMonitorDb() {
new Thread(() -> {
long limitId = 50001;
List<CpuInfo> cpuList = MonitorDb.getDb(this).monitorDao().getAllCPUById(limitId);
List<MemInfo> memList = MonitorDb.getDb(this).monitorDao().getAllMemById(limitId);
// 大于5w条清除
if (cpuList.size() > 0 || memList.size() > 0) {
this.deleteDatabase(MonitorDb.INTERNAL_DB_NAME);
} catch (Exception e) {
CallerLogger.INSTANCE.e(TAG, e.getMessage());
}
}).start();
}

View File

@@ -18,6 +18,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.api.map.smp.IMogoSmallMapProvider;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
import com.mogo.eagle.core.function.map.R;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
@@ -69,6 +70,7 @@ public class SmallMapFragment extends BaseFragment
mSmallMapDirectionView = mRootView.findViewById(R.id.smallMapDirectionView);
mSmallMapDirectionView.onCreateView(savedInstanceState);
CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG, this);
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG,this);
}
@Override
@@ -88,14 +90,18 @@ public class SmallMapFragment extends BaseFragment
@Override
public void drawablePolyline(List<MogoLatLng> coordinates) {
if (mSmallMapDirectionView != null) {
mSmallMapDirectionView.convert(coordinates);
UiThreadHandler.post(() -> mSmallMapDirectionView.drawablePolyline());
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
mSmallMapDirectionView.convert(coordinates);
mSmallMapDirectionView.drawablePolyline();
}
});
}
}
@Override
public void clearPolyline() {
CallerLogger.INSTANCE.i(M_MAP + TAG, "clearPolyline");
if (mSmallMapDirectionView != null) {
UiThreadHandler.post(() -> mSmallMapDirectionView.clearPolyline());
}
@@ -137,6 +143,7 @@ public class SmallMapFragment extends BaseFragment
int tempStatus = autoPilotStatusInfo.getPilotmode();
CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotStatusResponse:"+tempStatus+" autoPilotStatus:"+autoPilotStatus);
if (tempStatus != 1) {
CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotStatusResponse:"+tempStatus+" clearPolyline");
clearPolyline();
}else if (tempStatus == 1 && autoPilotStatus == 0){
CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotStatusResponse:getGlobalPath");
@@ -170,13 +177,17 @@ public class SmallMapFragment extends BaseFragment
if (globalPathResp == null || globalPathResp.getWayPointsList().size() == 0) {
return;
}
CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotRotting:"+globalPathResp.getWayPointsList().size());
List<MogoLatLng> latLngList = new ArrayList<>();
for (MessagePad.Location routeModel : globalPathResp.getWayPointsList()) {
latLngList.add(new MogoLatLng(routeModel.getLatitude(), routeModel.getLongitude()));
}
if (latLngList.size() > 0) {
CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotRotting:"+"drawablePolyline");
drawablePolyline(latLngList);
} else {
CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotRotting:"+"clearPolyline");
clearPolyline();
}
}

View File

@@ -9,9 +9,11 @@ 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.util.GsonUtils
import com.mogo.eagle.core.utilcode.util.Utils
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
@@ -139,7 +141,11 @@ object DataManager {
fun queryAllMessages(context: Context) {
scope.launch {
initCache()
getCacheMessages(context)
try {
getCacheMessages(context)
} catch (e: Exception) {
CallerLogger.e("DataManager", e.message)
}
}
}
@@ -156,6 +162,7 @@ object DataManager {
}
private suspend fun getCacheMessages(context: Context): List<MsgBoxBean> = withContext(Dispatchers.IO) {
delay(2000)
return@withContext MsgBoxDb.getDb(context)
.monitorDao()
.getAllCachedMessages()

View File

@@ -654,39 +654,59 @@ enum class EventTypeEnum(
return when (poiType) {
//交通检查
TRAFFIC_CHECK.poiType -> {
R.drawable.v_to_x_marker_2
R.drawable.v2x_icon_jiaotongjiancha_vr
}
//封路
ROAD_CLOSED.poiType -> {
R.drawable.v_to_x_marker_16
R.drawable.v2x_icon_fenglu_vr
}
//施工
FOURS_ROAD_WORK.poiType -> {
R.drawable.v_to_x_marker_11
R.drawable.icon_warning_v2x_road_construction
}
//AI施工
AI_ROAD_WORK.poiType -> {
R.drawable.v_to_x_marker_11
R.drawable.icon_warning_v2x_road_construction
}
//拥堵
FOURS_BLOCK_UP.poiType -> {
R.drawable.v_to_x_marker_5
R.drawable.icon_warning_v2x_congestion
}
//积水
FOURS_PONDING.poiType -> {
R.drawable.v_to_x_marker_6
R.drawable.v2x_icon_jishui_vr
}
//浓雾
FOURS_FOG.poiType -> {
R.drawable.v_to_x_marker_9
R.drawable.v2x_icon_nongwu_vr
}
//结冰
FOURS_ICE.poiType -> {
R.drawable.v_to_x_marker_8
R.drawable.v2x_icon_jiebing_vr
}
//事故
FOURS_ACCIDENT.poiType -> {
R.drawable.v_to_x_marker_7
R.drawable.v2x_icon_jiaotongshigu_vr
}
//重大事故
FOURS_ACCIDENT_01.poiType -> {
R.drawable.v2x_icon_jiaotongshigu_vr
}
//特大事故
FOURS_ACCIDENT_02.poiType -> {
R.drawable.v2x_icon_jiaotongshigu_vr
}
//较大事故
FOURS_ACCIDENT_03.poiType -> {
R.drawable.v2x_icon_jiaotongshigu_vr
}
//一般事故
FOURS_ACCIDENT_04.poiType -> {
R.drawable.v2x_icon_jiaotongshigu_vr
}
//轻微事故
FOURS_ACCIDENT_05.poiType -> {
R.drawable.v2x_icon_jiaotongshigu_vr
}
//事故
FOURS_LIVING.poiType -> {
@@ -708,6 +728,30 @@ enum class EventTypeEnum(
ALERT_CAR_TROUBLE_WARNING.poiType -> {
R.drawable.icon_car_red
}
//VIP车辆优先通行已为您变为绿灯
TYPE_VIP_IDENTIFICATION_PASS.poiType -> {
R.drawable.icon_warning_v2x_vip_turn_light
}
//VIP车辆优先通行已为您延长绿灯
TYPE_VIP_IDENTIFICATION_EXTEND.poiType -> {
R.drawable.icon_warning_v2x_vip_turn_light
}
//VIP变灯请求失败
TYPE_VIP_ERROR_IDENTIFICATION.poiType -> {
R.drawable.icon_warning_v2x_vip_turn_light
}
//最优路线
TYPE_OPTIMAL_ROUTE_RECOMMEND.poiType -> {
R.drawable.icon_warning_v2x_optimal_route
}
//鬼探头类型
GHOST_PROBE.poiType -> {
R.drawable.icon_warning_v2x_pedestrian_crossing
}
//接管
TAKE_OVER_EVENT.poiType -> {
R.drawable.icon_warning_take_over
}
else -> {
R.drawable.icon_default
}

View File

@@ -2,4 +2,12 @@ package com.mogo.eagle.core.data.msgbox
import java.io.Serializable
data class V2XMsg(var type: String = "", var content: String? = "", var tts: String? = ""): Serializable
data class V2XMsg(var type: String = "", var content: String? = "", var tts: String? = ""): Serializable {
// 临时解决该问题V2XMsg->json作为主键如果主键一样数据条目不会新增
private var timeStamp: Long = 0
init {
timeStamp = System.currentTimeMillis()
}
}

View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB