Merge branch 'dev_robotaxi-d-app-module_2130_221116_2.13.0' into mutidev_robotaxi-d-app-module_2130_221116_2.13.0_multi_display

This commit is contained in:
donghongyu
2022-12-01 12:23:24 +08:00
12 changed files with 62 additions and 14 deletions

View File

@@ -18,6 +18,7 @@ import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.ui.msgbox.adapter.DriverMsgBoxBubbleAdapter
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import kotlinx.android.synthetic.main.layout_driver_msg_box_bubble.view.*
/**
@@ -53,12 +54,14 @@ class DriverMsgBoxBubbleView @JvmOverloads constructor(
override fun onDataChanged(category: MsgCategory, msgBoxBean: MsgBoxBean) {
if(category == MsgCategory.RECORD_BAG){
//弹出被动录包弹窗
CallerDevaToolsManager.onReceiveBadCaseRecord(msgBoxBean,context as Activity,true)
}else{
dataList.add(msgBoxBean)
driverMsgBoxBubbleAdapter?.setData(dataList)
UiThreadHandler.post {
if(category == MsgCategory.RECORD_BAG){
//弹出被动录包弹窗
CallerDevaToolsManager.onReceiveBadCaseRecord(msgBoxBean,context as Activity,true)
}else{
dataList.add(msgBoxBean)
driverMsgBoxBubbleAdapter?.setData(dataList)
}
}
}

View File

@@ -17,6 +17,7 @@ import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.ui.msgbox.adapter.PassengerMsgBoxBubbleAdapter
import com.mogo.eagle.core.utilcode.util.BarUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import kotlinx.android.synthetic.main.layout_passenger_msg_box_bubble.view.*
/**
@@ -51,11 +52,13 @@ class PassengerMsgBoxBubbleView @JvmOverloads constructor(
}
override fun onDataChanged(category: MsgCategory, msgBoxList: MsgBoxBean) {
if(category == MsgCategory.NOTICE){
if(msgBoxList.type == MsgBoxType.NOTICE || msgBoxList.type == MsgBoxType.V2X
|| msgBoxList.type == MsgBoxType.OBU){
dataList.add(msgBoxList)
passengerMsgBoxBubbleAdapter?.setData(dataList)
UiThreadHandler.post {
if(category == MsgCategory.NOTICE){
if(msgBoxList.type == MsgBoxType.NOTICE || msgBoxList.type == MsgBoxType.V2X
|| msgBoxList.type == MsgBoxType.OBU){
dataList.add(msgBoxList)
passengerMsgBoxBubbleAdapter?.setData(dataList)
}
}
}
}

View File

@@ -28,6 +28,7 @@ import com.mogo.eagle.core.function.api.devatools.IMogoDevaToolsUpgradeListener;
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager;
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsUpgradeListenerManager;
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager;
import com.mogo.eagle.core.function.hmi.R;
import com.mogo.eagle.core.function.msgbox.db.MsgBoxDb;
import com.mogo.eagle.core.function.overview.OverviewDb;
@@ -78,6 +79,7 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
clearMessageBoxTable();
checkMonitorDb();
upgradeProgressListener();
CallerMsgBoxManager.INSTANCE.queryAllMessages(this);
}
@Override

View File

@@ -79,7 +79,7 @@ class OverViewModel(
disposable!!.dispose()
}
// 1分钟查询一次
disposable = Observable.interval(0, 60000, TimeUnit.SECONDS)
disposable = Observable.interval(0, 60000, TimeUnit.MILLISECONDS)
.flatMap {
MoGoRetrofitFactory.getInstance(HostConst.getHost())
.create(OverViewServiceApi::class.java)

View File

@@ -138,10 +138,23 @@ object DataManager {
*/
fun queryAllMessages(context: Context) {
scope.launch {
initCache()
getCacheMessages(context)
}
}
private fun initCache() {
if (cacheNotifyList.isNotEmpty()) {
cacheNotifyList.clear()
}
if (cacheRecordList.isNotEmpty()) {
cacheRecordList.clear()
}
if (cacheSysInfoList.isNotEmpty()) {
cacheSysInfoList.clear()
}
}
private suspend fun getCacheMessages(context: Context): List<MsgBoxBean> = withContext(Dispatchers.IO) {
return@withContext MsgBoxDb.getDb(context)
.monitorDao()

View File

@@ -26,6 +26,10 @@ class MsgBoxProvider : IMsgBoxProvider {
}.start()
}
override fun queryAllMessages(context: Context) {
DataManager.queryAllMessages(context)
}
override fun saveMsg(bean: MsgBoxBean) {
DataManager.saveMsg(bean)
}

View File

@@ -7,6 +7,7 @@ import android.content.Context;
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager;
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.notice.NoticeNormalData;
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData;
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager;
@@ -63,7 +64,8 @@ class NoticeSocketManager {
if (obj == null) {
return;
}
CallerMsgBoxManager.INSTANCE.saveMsgBox(new MsgBoxBean(MsgBoxType.NOTICE,obj));
NoticeFrCloudMsg noticeFromCloudMsg = new NoticeFrCloudMsg(obj, null, 0);
CallerMsgBoxManager.INSTANCE.saveMsgBox(new MsgBoxBean(MsgBoxType.NOTICE, noticeFromCloudMsg));
}
};
@@ -80,7 +82,8 @@ class NoticeSocketManager {
@Override
public void onMsgReceived(NoticeTrafficStylePushData obj) {
CallerLogger.INSTANCE.d(M_NOTICE + TAG, "301001-- 交警类型公告数据:" + GsonUtil.jsonFromObject(obj));
CallerMsgBoxManager.INSTANCE.saveMsgBox(new MsgBoxBean(MsgBoxType.NOTICE,obj));
NoticeFrCloudMsg noticeFromCloudMsg = new NoticeFrCloudMsg(null, obj, 1);
CallerMsgBoxManager.INSTANCE.saveMsgBox(new MsgBoxBean(MsgBoxType.NOTICE, noticeFromCloudMsg));
}
};
}