Merge branch 'dev_robotaxi-d-app-module_2132_221223_2.13.2' into test_robotaxi-d-app-module_2132_221223_2.13.2.1

This commit is contained in:
lixiaopeng
2023-01-13 00:07:54 +08:00
78 changed files with 1806 additions and 976 deletions

View File

@@ -32,6 +32,7 @@ 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.call.map.CallerMapLocationListenerManager;
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
@@ -520,6 +521,8 @@ public class BusOrderModel {
stationList, arrivingOrArrivedStationIndex, false);
}
updateAutopilotControlParameters();
CallerSmpManager.startQueryV2XEvents(); //选择路线后开启
}
}

View File

@@ -4,6 +4,7 @@ import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.os.Looper;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

View File

@@ -34,6 +34,7 @@ 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.call.map.CallerMapLocationListenerManager;
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
@@ -829,6 +830,7 @@ public class TaxiModel {
}
updateAutopilotControlParameters();
CallerSmpManager.startQueryV2XEvents();
}
if (mCurrentOCHOrder.orderStatus == TaxiOrderStatusEnum.ArriveAtEnd.getCode()){
if (FunctionBuildConfig.isDemoMode) {

View File

@@ -31,7 +31,9 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager;
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
@@ -43,6 +45,7 @@ import com.mogo.och.common.module.utils.AnimatorDrawableUtil;
import com.mogo.och.taxi.R;
import java.util.Arrays;
import java.util.Objects;
import mogo.telematics.pad.MessagePad;
import record_cache.RecordPanelOuterClass;
@@ -176,18 +179,18 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
try {
if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isLongSight()) {
// 2.11.0去掉
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp()) .visibleAllMarkers();
CallerVisualAngleManager.INSTANCE.updateLongSightLevel(false);
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(true);
MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_medium);
} else if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isMediumSight()) {
// 2.11.0去掉
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
// .inVisibleWithoutMarkers(DataTypes.TYPE_MARKER_ADAS, TaxiConst.TYPE_MARKER_TAXI_ORDER);
CallerVisualAngleManager.INSTANCE.updateLongSightLevel(true);
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false);
MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_long);
} else {
// 2.11.0去掉
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp()) .visibleAllMarkers();
MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_medium);
}

View File

@@ -18,6 +18,7 @@ class ThreadOptStartup: AndroidStartup<Boolean>() {
/*.dump(DumpConfig.Builder()
.dumpLogFilePath(File(context.getExternalFilesDir(null), "thread_dump_log_${ SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.ROOT).format(Date()) }.txt").absolutePath)
.dumpPeriod(5, SECONDS)
.threadRunThreshold(10, SECONDS)
.build())*/)
return true
}

View File

@@ -13,7 +13,6 @@
android:id="@+id/module_carchatting_call_head"
android:layout_width="@dimen/module_call_chat_calling_iv_hawk_eye_width_height"
android:layout_height="@dimen/module_call_chat_calling_iv_hawk_eye_width_height"
android:scaleType="centerInside"
android:src="@mipmap/module_carchatting_hawk_eye_default_head_img"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -25,7 +24,6 @@
android:layout_width="@dimen/module_call_chat_hawk_eye_circle_btn_size"
android:layout_height="@dimen/module_call_chat_hawk_eye_circle_btn_size"
android:layout_marginEnd="@dimen/module_call_chat_calling_iv_hawk_eye_margin_left_right"
android:scaleType="centerInside"
android:src="@mipmap/module_carchatting_launcher_calling_hangup"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"

View File

@@ -12,7 +12,6 @@
android:id="@+id/module_carchatting_call_head"
android:layout_width="@dimen/module_call_chat_incoming_aisdk_tag_width"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/module_carchatting_aicloud_incoming"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -26,7 +25,6 @@
android:layout_marginEnd="@dimen/module_call_chat_calling_iv_hawk_eye_margin_left_right"
android:layout_marginRight="@dimen/module_call_chat_state_incoming_hawk_eye_call_margin_right"
android:clickable="true"
android:scaleType="centerInside"
android:src="@mipmap/module_callchatting_launcher_incoming_answer"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/module_carchatting_incoming_hangUp"
@@ -39,7 +37,6 @@
android:layout_height="@dimen/module_call_chat_hawk_eye_incoming_circle_btn_size"
android:layout_marginEnd="@dimen/module_call_chat_calling_iv_hawk_eye_margin_left_right"
android:clickable="true"
android:scaleType="centerInside"
android:src="@mipmap/module_callchatting_launcher_incoming_hangup"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"

View File

@@ -56,8 +56,8 @@ class V2XLimitingVelocityBroadcastReceiver : BroadcastReceiver() {
*
* @param limitingVelocitySpeed 限速速度
*/
private fun dispatchShowWaring(limitingVelocitySpeed: Int) {
CallerHmiManager.showLimitingVelocity(limitingVelocitySpeed)
private fun dispatchShowWaring(limitingVelocitySpeed: Int) { // TODO liyz
CallerHmiManager.showLimitingVelocity(limitingVelocitySpeed, 3)
}
/**

View File

@@ -76,7 +76,7 @@ class V2XWarningBroadcastReceiver : BroadcastReceiver() {
tag: String?
) {
if (EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType == v2xType.toString()) {
CallerHmiManager.showLimitingVelocity(1)
CallerHmiManager.showLimitingVelocity(1, 4)
}
if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) {
Log.d("MsgBox-V2XWarningBR", "alertContent或ttsContent为空!")

View File

@@ -1082,18 +1082,26 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
/**
* 控制展示限速标志及内容
*/
override fun showLimitingVelocity(limitingSpeed: Int) {
override fun showLimitingVelocity(limitingSpeed: Int, limitSpeedSource: Int) {
// 控制 限速UI 展示
if (HmiBuildConfig.isShowLimitingVelocityView) {
if (limitingSpeed > 0) {
mViewLimitingVelocity?.visibility = View.VISIBLE
mViewLimitingVelocity?.updateLimitingSpeed(limitingSpeed)
mViewLimitingVelocity?.updateLimitingSpeed(limitingSpeed, limitSpeedSource)
tvLimitingSource?.visibility = View.VISIBLE
if (limitSpeedSource == 1) {
tvLimitingSource.text = "MAP"
} else if (limitSpeedSource == 2) {
tvLimitingSource.text = "RSU"
}
} else {
mViewLimitingVelocity?.visibility = View.INVISIBLE
mViewLimitingVelocity?.updateLimitingSpeed(0)
mViewLimitingVelocity?.updateLimitingSpeed(0, limitSpeedSource)
tvLimitingSource?.visibility = View.INVISIBLE
}
} else {
disableLimitingVelocity()
tvLimitingSource?.visibility = View.GONE
}
}
@@ -1102,7 +1110,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
*/
override fun disableLimitingVelocity() {
mViewLimitingVelocity?.visibility = View.GONE
mViewLimitingVelocity?.updateLimitingSpeed(0)
mViewLimitingVelocity?.updateLimitingSpeed(0, 1)
}
/**
@@ -1461,14 +1469,14 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
override fun showToBindingcarDialog() {
if (toBindingCarDialog == null) {
toBindingCarDialog = ToBindingCarDialog(requireContext())
toBindingCarDialog = ToBindingCarDialog(ContextHolderUtil.getContext())
}
toBindingCarDialog!!.showToBindingcarDialog()
}
override fun showModifyBindingcarDialog() {
if (modifyBindingCarDialog == null) {
modifyBindingCarDialog = ModifyBindingCarDialog(requireContext())
modifyBindingCarDialog = ModifyBindingCarDialog(ContextHolderUtil.getContext())
}
modifyBindingCarDialog!!.showModifyBindingcarDialog()
}

View File

@@ -33,6 +33,7 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
private val notice: Int = 2
private val v2x: Int = 3
private val report: Int = 4
private val summary: Int = 5
var countDownTimer: CountDownTimer?=null
private var changeViewListener: ChangeViewListener?=null
@@ -46,91 +47,107 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
if(viewType == operation){
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_operation,parent,false)
return BubbleOperationHolder(view)
}else if(viewType == report){
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_report,parent,false)
return BubbleReportHolder(view)
}else if(viewType == notice){
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_notice,parent,false)
return BubbleNoticeHolder(view)
}else{
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_v2x,parent,false)
return BubbleV2XHolder(view)
when (viewType) {
operation -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_operation,parent,false)
return BubbleOperationHolder(view)
}
report -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_report,parent,false)
return BubbleReportHolder(view)
}
notice -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_notice,parent,false)
return BubbleNoticeHolder(view)
}
summary -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_box_summary,parent,false)
return BubbleSummaryHolder(view)
}
else -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_v2x,parent,false)
return BubbleV2XHolder(view)
}
}
}
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
if(holder is BubbleOperationHolder){
data?.let {
val operationMsg = it[position].bean as OperationMsg
holder.tvBubbleOperationTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvBubbleOperationContent.text = operationMsg.content
}
}else if(holder is BubbleReportHolder){
data?.let {
val reportEntity = it[position].bean as ReportEntity
holder.tvBubbleReportTime.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}"
holder.tvBubbleReceiveTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
var resultStr = "类型:"
for (result in reportEntity.resultList){
resultStr = "${resultStr}${CallerAutoPilotManager.getReportResultDesc(result)}"
when (holder) {
is BubbleOperationHolder -> {
data?.let {
val operationMsg = it[position].bean as OperationMsg
holder.tvBubbleOperationTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvBubbleOperationContent.text = operationMsg.content
}
holder.tvBubbleReportType.text = resultStr
}
}else if(holder is BubbleNoticeHolder){
data?.let {
val msgBoxBean = it[position].bean
val noticeFrCloudMsg = msgBoxBean as NoticeFrCloudMsg
if(noticeFrCloudMsg.type == 0){
val noticeNormalData = noticeFrCloudMsg.noticeNormalData
holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvNoticeContent.text = noticeNormalData?.content
GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
)
).into(holder.ivNoticeImage)
holder.tvNoticeCheck.setOnClickListener {
//云公告
if (noticeNormalData != null) {
CallerHmiManager.showNoticeNormalData(noticeNormalData)
}
is BubbleReportHolder -> {
data?.let {
val reportEntity = it[position].bean as ReportEntity
holder.tvBubbleReportTime.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}"
holder.tvBubbleReceiveTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
var resultStr = "类型:"
for (result in reportEntity.resultList){
resultStr = "${resultStr}${CallerAutoPilotManager.getReportResultDesc(result)}"
}
}else if(noticeFrCloudMsg.type == 1){
val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData
holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvNoticeContent.text = noticeTrafficStylePushData?.content
GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
)
).into(holder.ivNoticeImage)
holder.tvNoticeCheck.setOnClickListener {
//云公告
if (noticeTrafficStylePushData != null) {
CallerHmiManager.showTrafficBanner(noticeTrafficStylePushData)
holder.tvBubbleReportType.text = resultStr
}
}
is BubbleNoticeHolder -> {
data?.let {
val msgBoxBean = it[position].bean
val noticeFrCloudMsg = msgBoxBean as NoticeFrCloudMsg
if(noticeFrCloudMsg.type == 0){
val noticeNormalData = noticeFrCloudMsg.noticeNormalData
holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvNoticeContent.text = noticeNormalData?.content
GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
)
).into(holder.ivNoticeImage)
holder.tvNoticeCheck.setOnClickListener {
//云公告
if (noticeNormalData != null) {
CallerHmiManager.showNoticeNormalData(noticeNormalData)
}
}
}else if(noticeFrCloudMsg.type == 1){
val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData
holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvNoticeContent.text = noticeTrafficStylePushData?.content
GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
)
).into(holder.ivNoticeImage)
holder.tvNoticeCheck.setOnClickListener {
//云公告
if (noticeTrafficStylePushData != null) {
CallerHmiManager.showTrafficBanner(noticeTrafficStylePushData)
}
}
}
}
}
}else if(holder is BubbleV2XHolder){
data?.let {
val msgBoxBean = it[position]
val v2XMsg = msgBoxBean.bean as V2XMsg
holder.tvV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvV2XContent.text = v2XMsg.content
if(msgBoxBean.type == MsgBoxType.OBU){
holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable(
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
}else{
is BubbleV2XHolder -> {
data?.let {
val msgBoxBean = it[position]
val v2XMsg = msgBoxBean.bean as V2XMsg
holder.tvV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvV2XContent.text = v2XMsg.content
holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable(
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
}
}
is BubbleSummaryHolder -> {
data?.let {
val summaryMsg = it[position].bean as V2XMsg
holder.tvSummaryTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvSummaryContent.text = summaryMsg.content
}
}
}
val msgBoxBean: MsgBoxBean = data!![position]
@@ -155,14 +172,16 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
override fun getItemCount() = data?.size ?: 0
override fun getItemViewType(position: Int): Int {
if(data!![position].type == MsgBoxType.OPERATION){
return operation
return if(data!![position].type == MsgBoxType.OPERATION){
operation
}else if(data!![position].type == MsgBoxType.REPORT){
return report
report
}else if(data!![position].type == MsgBoxType.NOTICE){
return notice
}else{
return v2x
notice
}else if(data!![position].type == MsgBoxType.V2X && data!![position].sourceType == DataSourceType.SUMMARY){
summary
} else{
v2x
}
}
@@ -195,6 +214,12 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
var tvV2XContent: TextView = itemView.findViewById(R.id.tvV2XContent)
}
//汇总消息
class BubbleSummaryHolder(itemView: View): RecyclerView.ViewHolder(itemView){
var tvSummaryContent: TextView = itemView.findViewById(R.id.tvSummaryContent)
var tvSummaryTime: TextView = itemView.findViewById(R.id.tvSummaryTime)
}
fun setChangeListener(listener: ChangeViewListener){
changeViewListener = listener
}

View File

@@ -34,10 +34,9 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
private val operation: Int = 1
private val notice: Int = 2
private val v2x: Int = 3
private val obu: Int = 4
private val report: Int = 5
private val record: Int = 6
private val traffic: Int = 7
private val summary: Int = 8
//Error
val RESULT_AUTOPILOT_DISABLE = "RESULT_AUTOPILOT_DISABLE"
@@ -50,177 +49,195 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
if(viewType == record){
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_bad_case,parent,false)
return BadCaseHolder(view)
}else if(viewType == report){
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_box_ipc_report,parent,false)
return MsgBoxIpcReportHolder(view)
}else if(viewType == operation){
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_box_operation,parent,false)
return MsgBoxOperation(view)
}else if(viewType == notice){
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_box_notice,parent,false)
return MsgBoxNotice(view)
}else{
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_box_v2x,parent,false)
return MsgBoxV2X(view)
when (viewType) {
record -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_bad_case,parent,false)
return BadCaseHolder(view)
}
report -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_box_ipc_report,parent,false)
return MsgBoxIpcReportHolder(view)
}
operation -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_box_operation,parent,false)
return MsgBoxOperation(view)
}
notice -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_box_notice,parent,false)
return MsgBoxNotice(view)
}
summary -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_box_summary,parent,false)
return MsgBoxSummary(view)
}
else -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_box_v2x,parent,false)
return MsgBoxV2X(view)
}
}
}
@SuppressLint("SetTextI18n")
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
if(holder is BadCaseHolder){
data?.let {
holder.tvBagReceiveTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvBagRecordTime.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}"
val msgBoxBean = it[position]
holder.tvRecordCheck.setOnClickListener {
//打开被动录包弹窗
CallerDevaToolsManager.onReceiveBadCaseRecord(msgBoxBean,activity,false)
when (holder) {
is BadCaseHolder -> {
data?.let {
holder.tvBagReceiveTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvBagRecordTime.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}"
val msgBoxBean = it[position]
holder.tvRecordCheck.setOnClickListener {
//打开被动录包弹窗
CallerDevaToolsManager.onReceiveBadCaseRecord(msgBoxBean,activity,false)
}
}
}
}else if(holder is MsgBoxIpcReportHolder){
data?.let { it ->
holder.tvReportTimeNormal.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}"
holder.tvReportTimeOpen.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}"
val reportEntity = (it[position].bean as ReportEntity)
if(reportEntity.resultList.contains(RESULT_AUTOPILOT_DISABLE)
|| reportEntity.resultList.contains(RESULT_AUTOPILOT_SYSTEM_UNSTARTED)
|| reportEntity.resultList.contains(RESULT_REMOTEPILOT_DISABLE)){
//Error
holder.ivReportImageNormal.setImageDrawable(getDrawable(R.drawable.icon_report_error_normal))
holder.ivReportImageOpen.setImageDrawable(getDrawable(R.drawable.icon_report_error_open))
holder.tvReportLevelNormal.text = "Error"
holder.tvReportLevelOpen.text = "Error"
}else{
//Warning
holder.ivReportImageNormal.setImageDrawable(getDrawable(R.drawable.icon_report_warning_normal))
holder.ivReportImageOpen.setImageDrawable(getDrawable(R.drawable.icon_report_warning_open))
holder.tvReportLevelNormal.text = "Warning"
holder.tvReportLevelOpen.text = "Warning"
}
holder.tvReportTimeNormal.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}"
holder.tvReportTimeOpen.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}"
holder.tvReportTime.text =TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
var resultStr = "类型:"
for (result in reportEntity.resultList){
resultStr = "${resultStr}${CallerAutoPilotManager.getReportResultDesc(result)}"
}
holder.tvReportTypeNormal.text = resultStr
holder.tvReportTypeOpen.text = resultStr
holder.tvReportReasonOpen.text = "原因:${reportEntity.msg}"
var actionStr = ""
for (action in reportEntity.actionsList){
actionStr = "${actionStr}${CallerAutoPilotManager.getReportActionDesc(action)}"
}
holder.tvReportActionOpen.text = "建议操作:$actionStr"
holder.tvStatusSelect.setOnClickListener {
if(holder.tvReportLevelNormal.isVisible){
holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds(getDrawable(R.drawable.icon_msg_close),null,null,null)
holder.ivReportImageNormal.visibility = View.GONE
holder.tvReportLevelNormal.visibility = View.GONE
holder.tvReportTimeNormal.visibility = View.GONE
holder.tvReportTypeNormal.visibility = View.GONE
holder.ivReportImageOpen.visibility = View.VISIBLE
holder.tvReportLevelOpen.visibility = View.VISIBLE
holder.tvReportTimeOpen.visibility = View.VISIBLE
holder.tvReportTypeOpen.visibility = View.VISIBLE
holder.tvReportReasonOpen.visibility = View.VISIBLE
holder.tvReportActionOpen.visibility = View.VISIBLE
is MsgBoxIpcReportHolder -> {
data?.let { it ->
holder.tvReportTimeNormal.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}"
holder.tvReportTimeOpen.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}"
val reportEntity = (it[position].bean as ReportEntity)
if(reportEntity.resultList.contains(RESULT_AUTOPILOT_DISABLE)
|| reportEntity.resultList.contains(RESULT_AUTOPILOT_SYSTEM_UNSTARTED)
|| reportEntity.resultList.contains(RESULT_REMOTEPILOT_DISABLE)){
//Error
holder.ivReportImageNormal.setImageDrawable(getDrawable(R.drawable.icon_report_error_normal))
holder.ivReportImageOpen.setImageDrawable(getDrawable(R.drawable.icon_report_error_open))
holder.tvReportLevelNormal.text = "Error"
holder.tvReportLevelOpen.text = "Error"
}else{
holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds(getDrawable(R.drawable.icon_msg_open),null,null,null)
holder.ivReportImageNormal.visibility = View.VISIBLE
holder.tvReportLevelNormal.visibility = View.VISIBLE
holder.tvReportTimeNormal.visibility = View.VISIBLE
holder.tvReportTypeNormal.visibility = View.VISIBLE
//Warning
holder.ivReportImageNormal.setImageDrawable(getDrawable(R.drawable.icon_report_warning_normal))
holder.ivReportImageOpen.setImageDrawable(getDrawable(R.drawable.icon_report_warning_open))
holder.tvReportLevelNormal.text = "Warning"
holder.tvReportLevelOpen.text = "Warning"
}
holder.tvReportTimeNormal.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}"
holder.tvReportTimeOpen.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}"
holder.tvReportTime.text =TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
var resultStr = "类型:"
for (result in reportEntity.resultList){
resultStr = "${resultStr}${CallerAutoPilotManager.getReportResultDesc(result)}"
}
holder.tvReportTypeNormal.text = resultStr
holder.tvReportTypeOpen.text = resultStr
holder.tvReportReasonOpen.text = "原因:${reportEntity.msg}"
var actionStr = ""
for (action in reportEntity.actionsList){
actionStr = "${actionStr}${CallerAutoPilotManager.getReportActionDesc(action)}"
}
holder.tvReportActionOpen.text = "建议操作:$actionStr"
holder.tvStatusSelect.setOnClickListener {
if(holder.tvReportLevelNormal.isVisible){
holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds(getDrawable(R.drawable.icon_msg_close),null,null,null)
holder.ivReportImageNormal.visibility = View.GONE
holder.tvReportLevelNormal.visibility = View.GONE
holder.tvReportTimeNormal.visibility = View.GONE
holder.tvReportTypeNormal.visibility = View.GONE
holder.ivReportImageOpen.visibility = View.GONE
holder.tvReportLevelOpen.visibility = View.GONE
holder.tvReportTimeOpen.visibility = View.GONE
holder.tvReportTypeOpen.visibility = View.GONE
holder.tvReportReasonOpen.visibility = View.GONE
holder.tvReportActionOpen.visibility = View.GONE
holder.ivReportImageOpen.visibility = View.VISIBLE
holder.tvReportLevelOpen.visibility = View.VISIBLE
holder.tvReportTimeOpen.visibility = View.VISIBLE
holder.tvReportTypeOpen.visibility = View.VISIBLE
holder.tvReportReasonOpen.visibility = View.VISIBLE
holder.tvReportActionOpen.visibility = View.VISIBLE
}else{
holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds(getDrawable(R.drawable.icon_msg_open),null,null,null)
holder.ivReportImageNormal.visibility = View.VISIBLE
holder.tvReportLevelNormal.visibility = View.VISIBLE
holder.tvReportTimeNormal.visibility = View.VISIBLE
holder.tvReportTypeNormal.visibility = View.VISIBLE
holder.ivReportImageOpen.visibility = View.GONE
holder.tvReportLevelOpen.visibility = View.GONE
holder.tvReportTimeOpen.visibility = View.GONE
holder.tvReportTypeOpen.visibility = View.GONE
holder.tvReportReasonOpen.visibility = View.GONE
holder.tvReportActionOpen.visibility = View.GONE
}
}
}
}
}else if(holder is MsgBoxOperation){
data?.let {
val operationMsg = it[position].bean as OperationMsg
holder.tvOperationContentNormal.text = operationMsg.content
holder.tvOperationContentOpen.text = operationMsg.content
holder.tvOperationTime.text = TimeUtils.millis2String(operationMsg.timestamp,getHourMinFormat())
holder.tvOperationStatusSelect.setOnClickListener {
if(holder.ivOperationImageNormal.isVisible){
holder.tvOperationStatusSelect.setCompoundDrawablesWithIntrinsicBounds(getDrawable(R.drawable.icon_msg_close),null,null,null)
holder.ivOperationImageNormal.visibility = View.GONE
holder.tvOperationTitleNormal.visibility = View.GONE
holder.tvOperationContentNormal.visibility = View.GONE
is MsgBoxOperation -> {
data?.let {
val operationMsg = it[position].bean as OperationMsg
holder.tvOperationContentNormal.text = operationMsg.content
holder.tvOperationContentOpen.text = operationMsg.content
holder.tvOperationTime.text = TimeUtils.millis2String(operationMsg.timestamp,getHourMinFormat())
holder.tvOperationStatusSelect.setOnClickListener {
if(holder.ivOperationImageNormal.isVisible){
holder.tvOperationStatusSelect.setCompoundDrawablesWithIntrinsicBounds(getDrawable(R.drawable.icon_msg_close),null,null,null)
holder.ivOperationImageNormal.visibility = View.GONE
holder.tvOperationTitleNormal.visibility = View.GONE
holder.tvOperationContentNormal.visibility = View.GONE
holder.ivOperationImageOpen.visibility = View.VISIBLE
holder.tvOperationTitleOpen.visibility = View.VISIBLE
holder.tvOperationContentOpen.visibility = View.VISIBLE
}else{
holder.tvOperationStatusSelect.setCompoundDrawablesWithIntrinsicBounds(getDrawable(R.drawable.icon_msg_open),null,null,null)
holder.ivOperationImageNormal.visibility = View.VISIBLE
holder.tvOperationTitleNormal.visibility = View.VISIBLE
holder.tvOperationContentNormal.visibility = View.VISIBLE
holder.ivOperationImageOpen.visibility = View.VISIBLE
holder.tvOperationTitleOpen.visibility = View.VISIBLE
holder.tvOperationContentOpen.visibility = View.VISIBLE
}else{
holder.tvOperationStatusSelect.setCompoundDrawablesWithIntrinsicBounds(getDrawable(R.drawable.icon_msg_open),null,null,null)
holder.ivOperationImageNormal.visibility = View.VISIBLE
holder.tvOperationTitleNormal.visibility = View.VISIBLE
holder.tvOperationContentNormal.visibility = View.VISIBLE
holder.ivOperationImageOpen.visibility = View.GONE
holder.tvOperationTitleOpen.visibility = View.GONE
holder.tvOperationContentOpen.visibility = View.GONE
holder.ivOperationImageOpen.visibility = View.GONE
holder.tvOperationTitleOpen.visibility = View.GONE
holder.tvOperationContentOpen.visibility = View.GONE
}
}
}
}
}else if(holder is MsgBoxNotice){
data?.let {
val noticeFrCloudMsg = it[position].bean as NoticeFrCloudMsg
if(noticeFrCloudMsg.type == 0){
val noticeNormalData = noticeFrCloudMsg.noticeNormalData
holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvNoticeContent.text = noticeNormalData?.content
GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
)
).into(holder.ivNoticeImage)
holder.tvNoticeCheck.setOnClickListener {
//云公告
noticeNormalData?.let { it1 -> CallerHmiManager.showNoticeNormalData(it1) }
is MsgBoxNotice -> {
data?.let {
val noticeFrCloudMsg = it[position].bean as NoticeFrCloudMsg
if(noticeFrCloudMsg.type == 0){
val noticeNormalData = noticeFrCloudMsg.noticeNormalData
holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvNoticeContent.text = noticeNormalData?.content
GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
)
).into(holder.ivNoticeImage)
holder.tvNoticeCheck.setOnClickListener {
//云公告
noticeNormalData?.let { it1 -> CallerHmiManager.showNoticeNormalData(it1) }
}
}else if(noticeFrCloudMsg.type == 1){
val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData
holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvNoticeContent.text = noticeTrafficStylePushData?.content
GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
)
).into(holder.ivNoticeImage)
holder.tvNoticeCheck.setOnClickListener {
//云公告
noticeTrafficStylePushData?.let { it1 -> CallerHmiManager.showTrafficBanner(it1) }
}
}
}else if(noticeFrCloudMsg.type == 1){
val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData
holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvNoticeContent.text = noticeTrafficStylePushData?.content
GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
)
).into(holder.ivNoticeImage)
holder.tvNoticeCheck.setOnClickListener {
//云公告
noticeTrafficStylePushData?.let { it1 -> CallerHmiManager.showTrafficBanner(it1) }
}
}
}
}
}else if(holder is MsgBoxV2X){
data?.let {
val msgBoxBean = it[position]
val v2XMsg = msgBoxBean.bean as V2XMsg
holder.tvV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvV2XContent.text = v2XMsg.content
if(msgBoxBean.type == MsgBoxType.OBU){
holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable(
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
}else{
is MsgBoxV2X -> {
data?.let {
val msgBoxBean = it[position]
val v2XMsg = msgBoxBean.bean as V2XMsg
holder.tvV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvV2XContent.text = v2XMsg.content
holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable(
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
}
}
is MsgBoxSummary -> {
data?.let {
val summaryMsg = it[position].bean as V2XMsg
holder.tvSummaryTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvSummaryContent.text = summaryMsg.content
}
}
}
}
@@ -228,15 +245,19 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
override fun getItemViewType(position: Int): Int {
return when(data!![position].type){
MsgBoxType.OPERATION -> operation
MsgBoxType.NOTICE -> notice
MsgBoxType.V2X -> v2x
MsgBoxType.OBU -> obu
MsgBoxType.REPORT -> report
MsgBoxType.RECORD -> record
MsgBoxType.TRAFFIC -> traffic
}
return if(data!![position].type == MsgBoxType.OPERATION){
operation
}else if(data!![position].type == MsgBoxType.NOTICE){
notice
}else if(data!![position].type == MsgBoxType.V2X && data!![position].sourceType == DataSourceType.SUMMARY){
summary
}else if(data!![position].type == MsgBoxType.REPORT){
report
}else if(data!![position].type == MsgBoxType.RECORD){
record
}else{
v2x
}
}
//录包实体
@@ -290,5 +311,11 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
var tvV2XContent: TextView = itemView.findViewById(R.id.tvV2XContent)
}
//汇总消息
class MsgBoxSummary(itemView: View): RecyclerView.ViewHolder(itemView){
var tvSummaryContent: TextView = itemView.findViewById(R.id.tvSummaryContent)
var tvSummaryTime: TextView = itemView.findViewById(R.id.tvSummaryTime)
}
}

View File

@@ -9,12 +9,8 @@ import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
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.utilcode.mogo.glide.GlideApp
import com.mogo.eagle.core.data.notice.NoticeNormalData
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.function.hmi.R
@@ -33,6 +29,7 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView
private val notice: Int = 1
private val v2x: Int = 2
private val summary: Int = 3
var countDownTimer: CountDownTimer?=null
@@ -45,65 +42,82 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
if(viewType == notice){
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_passenger_msg_box_notice,parent,false)
return BubbleNoticeHolder(view)
}else{
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_passenger_msg_box_v2x,parent,false)
return BubbleV2XHolder(view)
return when (viewType) {
notice -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_passenger_msg_box_notice,parent,false)
BubbleNoticeHolder(view)
}
summary -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_passenger_msg_box_summary,parent,false)
BubbleSummaryHolder(view)
}
else -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_passenger_msg_box_v2x,parent,false)
BubbleV2XHolder(view)
}
}
}
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
if(holder is BubbleNoticeHolder){
data?.let {
val noticeFrCloudMsg = it[position].bean as NoticeFrCloudMsg
if(noticeFrCloudMsg.type == 0){
val noticeNormalData = noticeFrCloudMsg.noticeNormalData
holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvPassengerNoticeContent.text = noticeNormalData?.content
GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
)
).into(holder.ivPassengerNoticeImage)
holder.tvPassengerNoticeCheck.setOnClickListener {
//云公告
noticeNormalData?.let { it1 -> CallerHmiManager.showNoticeNormalData(it1) }
when (holder) {
is BubbleNoticeHolder -> {
data?.let {
val noticeFrCloudMsg = it[position].bean as NoticeFrCloudMsg
if(noticeFrCloudMsg.type == 0){
val noticeNormalData = noticeFrCloudMsg.noticeNormalData
holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvPassengerNoticeContent.text = noticeNormalData?.content
GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
)
).into(holder.ivPassengerNoticeImage)
holder.tvPassengerNoticeCheck.setOnClickListener {
//云公告
noticeNormalData?.let { it1 -> CallerHmiManager.showNoticeNormalData(it1) }
}
}else if(noticeFrCloudMsg.type == 1){
val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData
holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvPassengerNoticeContent.text = noticeTrafficStylePushData?.content
GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
)
).into(holder.ivPassengerNoticeImage)
holder.tvPassengerNoticeCheck.setOnClickListener {
//云公告
noticeTrafficStylePushData?.let { it1 -> CallerHmiManager.showTrafficBanner(it1) }
}
}
}else if(noticeFrCloudMsg.type == 1){
val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData
holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvPassengerNoticeContent.text = noticeTrafficStylePushData?.content
GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
)
).into(holder.ivPassengerNoticeImage)
holder.tvPassengerNoticeCheck.setOnClickListener {
//云公告
noticeTrafficStylePushData?.let { it1 -> CallerHmiManager.showTrafficBanner(it1) }
}
}
}
}
}else if(holder is BubbleV2XHolder){
data?.let {
val msgBoxBean = it[position]
val v2XMsg = msgBoxBean.bean as V2XMsg
holder.tvPassengerV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvPassengerV2XContent.text = v2XMsg.content
if(msgBoxBean.type == MsgBoxType.OBU){
holder.ivPassengerV2XImage.setImageDrawable(activity.resources.getDrawable(
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
}else{
is BubbleV2XHolder -> {
data?.let {
val msgBoxBean = it[position]
val v2XMsg = msgBoxBean.bean as V2XMsg
holder.tvPassengerV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvPassengerV2XContent.text = v2XMsg.content
holder.ivPassengerV2XImage.setImageDrawable(activity.resources.getDrawable(
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
}
}
is BubbleSummaryHolder -> {
data?.let {
val summaryMsg= it[position].bean as V2XMsg
holder.tvPassengerSummaryTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvPassengerSummaryContent.text = summaryMsg.content
holder.tvPassengerSummaryCheck.setOnClickListener {
//跳转全览模式
CallerHmiManager.showSmallFragment()
}
}
}
}
val msgBoxBean: MsgBoxBean = data!![position]
countDownTimer =object: CountDownTimer(CallerMsgBoxManager.getDismissTime(),1000){
override fun onTick(p0: Long) {
@@ -124,10 +138,12 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView
override fun getItemCount() = data?.size ?: 0
override fun getItemViewType(position: Int): Int {
if(data!![position].type == MsgBoxType.NOTICE){
return notice
}else{
return v2x
return if(data!![position].type == MsgBoxType.NOTICE){
notice
}else if(data!![position].type == MsgBoxType.V2X && data!![position].sourceType == DataSourceType.SUMMARY){
summary
} else{
v2x
}
}
@@ -147,4 +163,11 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView
var tvPassengerV2XContent: TextView = itemView.findViewById(R.id.tvPassengerV2XContent)
}
//汇总消息
class BubbleSummaryHolder(itemView: View): RecyclerView.ViewHolder(itemView){
var tvPassengerSummaryContent: TextView = itemView.findViewById(R.id.tvPassengerSummaryContent)
var tvPassengerSummaryCheck: TextView = itemView.findViewById(R.id.tvPassengerSummaryCheck)
var tvPassengerSummaryTime: TextView = itemView.findViewById(R.id.tvPassengerSummaryTime)
}
}

View File

@@ -8,11 +8,7 @@ import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
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.notice.NoticeNormalData
import com.mogo.eagle.core.data.msgbox.*
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp
@@ -31,6 +27,7 @@ class PassengerMsgBoxListAdapter(private val activity: Activity): RecyclerView.A
private val notice: Int = 1
private val v2x: Int = 2
private val summary: Int = 3
fun setData(data: List<MsgBoxBean>){
this.data = data
@@ -38,73 +35,91 @@ class PassengerMsgBoxListAdapter(private val activity: Activity): RecyclerView.A
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
return if(viewType == notice){
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_passenger_msg_list_notice,parent,false)
ListNoticeHolder(view)
}else{
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_passenger_msg_list_v2x,parent,false)
ListV2XHolder(view)
return when (viewType) {
notice -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_passenger_msg_list_notice,parent,false)
ListNoticeHolder(view)
}
summary -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_passenger_msg_list_summary,parent,false)
ListSummaryHolder(view)
}
else -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_passenger_msg_list_v2x,parent,false)
ListV2XHolder(view)
}
}
}
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
if(holder is ListNoticeHolder){
data?.let {
val noticeFrCloudMsg = it[position].bean as NoticeFrCloudMsg
if(noticeFrCloudMsg.type == 0){
val noticeNormalData = noticeFrCloudMsg.noticeNormalData
holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvPassengerNoticeContent.text = noticeNormalData?.content
GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
)
).into(holder.ivPassengerNoticeImage)
holder.tvPassengerNoticeCheck.setOnClickListener {
//云公告
noticeNormalData?.let { it1 -> CallerHmiManager.showNoticeNormalData(it1) }
}
}else if(noticeFrCloudMsg.type == 1){
val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData
holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvPassengerNoticeContent.text = noticeTrafficStylePushData?.content
GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
)
).into(holder.ivPassengerNoticeImage)
holder.tvPassengerNoticeCheck.setOnClickListener {
//云公告
noticeTrafficStylePushData?.let { it1 -> CallerHmiManager.showTrafficBanner(it1) }
when (holder) {
is ListNoticeHolder -> {
data?.let {
val noticeFrCloudMsg = it[position].bean as NoticeFrCloudMsg
if(noticeFrCloudMsg.type == 0){
val noticeNormalData = noticeFrCloudMsg.noticeNormalData
holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvPassengerNoticeContent.text = noticeNormalData?.content
GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
)
).into(holder.ivPassengerNoticeImage)
holder.tvPassengerNoticeCheck.setOnClickListener {
//云公告
noticeNormalData?.let { it1 -> CallerHmiManager.showNoticeNormalData(it1) }
}
}else if(noticeFrCloudMsg.type == 1){
val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData
holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvPassengerNoticeContent.text = noticeTrafficStylePushData?.content
GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
)
).into(holder.ivPassengerNoticeImage)
holder.tvPassengerNoticeCheck.setOnClickListener {
//云公告
noticeTrafficStylePushData?.let { it1 -> CallerHmiManager.showTrafficBanner(it1) }
}
}
}
}
}else if(holder is ListV2XHolder){
data?.let {
val msgBoxBean = it[position]
val v2XMsg = msgBoxBean.bean as V2XMsg
holder.tvPassengerV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvPassengerV2XContent.text = v2XMsg.content
if(msgBoxBean.type == MsgBoxType.OBU){
holder.ivPassengerV2XImage.setImageDrawable(activity.resources.getDrawable(
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
}else{
is ListV2XHolder -> {
data?.let {
val msgBoxBean = it[position]
val v2XMsg = msgBoxBean.bean as V2XMsg
holder.tvPassengerV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvPassengerV2XContent.text = v2XMsg.content
holder.ivPassengerV2XImage.setImageDrawable(activity.resources.getDrawable(
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
}
}
is ListSummaryHolder -> {
data?.let {
val summaryMsg= it[position].bean as V2XMsg
holder.tvPassengerSummaryTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvPassengerSummaryContent.text = summaryMsg.content
holder.tvPassengerSummaryCheck.setOnClickListener {
//跳转全览模式
CallerHmiManager.showSmallFragment()
}
}
}
}
}
override fun getItemCount() = data?.size ?: 0
override fun getItemViewType(position: Int): Int {
if(data!![position].type == MsgBoxType.NOTICE){
return notice
}else{
return v2x
return if(data!![position].type == MsgBoxType.NOTICE){
notice
}else if(data!![position].type == MsgBoxType.V2X && data!![position].sourceType == DataSourceType.SUMMARY){
summary
} else{
v2x
}
}
@@ -124,4 +139,11 @@ class PassengerMsgBoxListAdapter(private val activity: Activity): RecyclerView.A
var tvPassengerV2XContent: TextView = itemView.findViewById(R.id.tvPassengerV2XContent)
}
//汇总消息
class ListSummaryHolder(itemView: View): RecyclerView.ViewHolder(itemView){
var tvPassengerSummaryContent: TextView = itemView.findViewById(R.id.tvPassengerSummaryContent)
var tvPassengerSummaryCheck: TextView = itemView.findViewById(R.id.tvPassengerSummaryCheck)
var tvPassengerSummaryTime: TextView = itemView.findViewById(R.id.tvPassengerSummaryTime)
}
}

View File

@@ -20,8 +20,8 @@ class LimitingVelocityView @JvmOverloads constructor(
LayoutInflater.from(context).inflate(R.layout.view_limiting_speed_vr, this, true)
}
override fun updateLimitingSpeed(limitingSpeed: Int) {
super.updateLimitingSpeed(limitingSpeed)
override fun updateLimitingSpeed(limitingSpeed: Int, limitSource: Int) {
super.updateLimitingSpeed(limitingSpeed, limitSource)
tvLimitingVelocity.text = "$limitingSpeed"
}
}

View File

@@ -18,6 +18,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingCarListenerManager
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsUpgradeListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showUpgradeDialog
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger

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

@@ -38,9 +38,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;
@@ -77,7 +74,6 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
initKoom();
}
clearMessageBoxTable();
checkMonitorDb();
CallerMsgBoxManager.INSTANCE.queryAllMessages(this);
}
upgradeProgressListener();
@@ -105,35 +101,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

@@ -182,6 +182,20 @@
app:layout_goneMarginTop="40dp"
tools:visibility="gone" />
<!--限速来源-->
<TextView
android:id="@+id/tvLimitingSource"
android:layout_width="120dp"
android:layout_height="35dp"
android:gravity="center"
android:text=""
android:textColor="@color/notice_text_blue"
android:textSize="@dimen/dp_30"
android:layout_marginEnd="40dp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/viewLimitingVelocity" />
<!--消息盒子司机端选择入口-->
<CheckBox
android:id="@+id/cbMsgBoxDriver"

View File

@@ -0,0 +1,63 @@
<?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="804px"
android:layout_height="160px"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#53000000"
app:roundLayoutRadius="24px"
android:layout_gravity="center_horizontal"
android:layout_marginStart="30px"
android:layout_marginEnd="30px"
android:layout_marginTop="7px"
android:layout_marginBottom="7px"
>
<ImageView
android:id="@+id/ivSummaryImage"
android:layout_width="140px"
android:layout_height="130px"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginStart="15px"
android:src="@drawable/icon_notice_default"
/>
<TextView
android:id="@+id/tvSummaryTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="蘑菇小助手"
android:textColor="#FFFFFFFF"
android:textSize="32px"
app:layout_constraintLeft_toRightOf="@id/ivSummaryImage"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/tvSummaryContent"
android:layout_marginStart="15px"
/>
<TextView
android:id="@+id/tvSummaryContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="@id/tvSummaryTitle"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvSummaryTitle"
android:gravity="start"
android:textColor="#B3FFFFFF"
android:textSize="28px"
/>
<TextView
android:id="@+id/tvSummaryTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/tvSummaryTitle"
app:layout_constraintBottom_toBottomOf="@id/tvSummaryTitle"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginEnd="25px"
android:textColor="#80FFFFFF"
android:textSize="24px"
/>
</com.mogo.eagle.core.widget.RoundConstraintLayout>

View File

@@ -0,0 +1,83 @@
<?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="650dp"
android:layout_height="160dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#465878"
app:roundLayoutRadius="24dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
>
<ImageView
android:id="@+id/ivPassengerSummaryImage"
android:layout_width="160dp"
android:layout_height="160dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:src="@drawable/icon_passenger_operation"
/>
<TextView
android:id="@+id/tvPassengerSummaryTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="蘑菇小助手"
android:textColor="#FFFFFFFF"
android:textSize="36dp"
android:layout_marginStart="20dp"
app:layout_constraintLeft_toRightOf="@id/ivPassengerSummaryImage"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/tvPassengerSummaryContent"
/>
<TextView
android:id="@+id/tvPassengerSummaryContent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textColor="#FFFFFFFF"
android:textSize="28dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="@id/tvPassengerSummaryTitle"
app:layout_constraintTop_toBottomOf="@id/tvPassengerSummaryTitle"
app:layout_constraintRight_toRightOf="@id/tvPassengerSummaryTime"
android:gravity="start"
/>
<TextView
android:id="@+id/tvPassengerSummaryCheck"
android:layout_width="140dp"
android:layout_height="160dp"
android:text="查 看"
android:textColor="#FF84D4FF"
android:textSize="28dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:gravity="center"
/>
<View
android:layout_width="1dp"
android:layout_height="80dp"
android:background="#5E70A6"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toLeftOf="@id/tvPassengerSummaryCheck"
/>
<TextView
android:id="@+id/tvPassengerSummaryTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFFFF"
android:textSize="26dp"
app:layout_constraintTop_toTopOf="@id/tvPassengerSummaryTitle"
app:layout_constraintBottom_toBottomOf="@id/tvPassengerSummaryTitle"
app:layout_constraintRight_toLeftOf="@id/tvPassengerSummaryCheck"
android:layout_marginEnd="20dp"
/>
</com.mogo.eagle.core.widget.RoundConstraintLayout>

View File

@@ -0,0 +1,78 @@
<?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="150dp"
xmlns:app="http://schemas.android.com/apk/res-auto">
<ImageView
android:id="@+id/ivPassengerSummaryImage"
android:layout_width="96dp"
android:layout_height="96dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:src="@drawable/icon_passenger_operation"
/>
<TextView
android:id="@+id/tvPassengerSummaryTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="蘑菇小助手"
android:textColor="#FFFFFFFF"
android:textSize="36dp"
android:layout_marginStart="20dp"
app:layout_constraintLeft_toRightOf="@id/ivPassengerSummaryImage"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/tvPassengerSummaryContent"
/>
<TextView
android:id="@+id/tvPassengerSummaryContent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textColor="#FFFFFFFF"
android:textSize="28dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvPassengerSummaryTitle"
app:layout_constraintLeft_toLeftOf="@id/tvPassengerSummaryTitle"
app:layout_constraintRight_toRightOf="@id/tvPassengerSummaryTime"
android:gravity="start"
/>
<TextView
android:id="@+id/tvPassengerSummaryCheck"
android:layout_width="140dp"
android:layout_height="150dp"
android:text="查 看"
android:textColor="#FF84D4FF"
android:textSize="28dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:gravity="center"
/>
<View
android:layout_width="1dp"
android:layout_height="80dp"
android:background="#5E70A6"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toLeftOf="@id/tvPassengerSummaryCheck"
/>
<TextView
android:id="@+id/tvPassengerSummaryTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFFFF"
android:textSize="26dp"
app:layout_constraintTop_toTopOf="@id/tvPassengerSummaryTitle"
app:layout_constraintBottom_toBottomOf="@id/tvPassengerSummaryTitle"
app:layout_constraintRight_toLeftOf="@id/tvPassengerSummaryCheck"
android:layout_marginEnd="20dp"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -3,7 +3,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/tvLimitingVelocity"
@@ -16,7 +17,5 @@
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_60"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"
/>
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon" />
</LinearLayout>

View File

@@ -86,7 +86,7 @@ class AiCloudIdentifyDataManager : IMogoMapListener {
}
else -> {
showAiCloud = false
CallerMapIdentifyManager.clearAiCloudRoma()
MapIdentifySubscriber.instance.clearAiCloudRoma()
}
}
}

View File

@@ -19,10 +19,10 @@ class AiCloudIdentifyNetWorkModel {
}
private fun getHost(): String {
var host = "https://dzt-city.zhidaozhixing.com"
var host = "http://dzt-city.zhidaozhixing.com"
when (DebugConfig.getNetMode()) {
DebugConfig.NET_MODE_DEV,
DebugConfig.NET_MODE_QA -> host = "https://dzt-qa-city.zhidaozhixing.com"
DebugConfig.NET_MODE_QA -> host = "http://dzt-qa-city.zhidaozhixing.com"
}
return host
}

View File

@@ -1,16 +1,14 @@
package com.mogo.eagle.core.function.business.identify
import android.annotation.SuppressLint
import android.util.Log
import androidx.collection.ArraySet
import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.module.status.MogoStatusManager
import com.mogo.eagle.core.data.traffic.TrafficData
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.w
import com.mogo.map.MogoMarkerManager
import mogo.telematics.pad.MessagePad.PlanningObject
import mogo.telematics.pad.MessagePad.TrackedObject
import mogo.yycp.api.proto.SocketDownData
import java.util.concurrent.ConcurrentHashMap
import mogo.yycp.api.proto.SocketDownData
class IdentifyAiCloudDataDrawer : Identify {
@@ -86,6 +84,7 @@ class IdentifyAiCloudDataDrawer : Identify {
val uuid = "" + data.uuid
mMarkersCaches[uuid] = data
trafficDataUuidList.add(uuid)
Log.d("emArrow","add uuid:${uuid.hashCode()}")
mFilterTrafficData[uuid] = data
}
return mFilterTrafficData
@@ -93,14 +92,14 @@ class IdentifyAiCloudDataDrawer : Identify {
@SuppressLint("NewApi")
override fun clearAiMarker() {
if(trafficDataUuidList.size == 0){
return
}
for (uuid in trafficDataUuidList) {
trafficDataUuidList.clear()
mMarkersCaches.forEach { (uuid, _) ->
mMarkersCaches.remove(uuid)
MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
.removeMarker(uuid.hashCode().toString())
Log.d("emArrow","remove uuid:${uuid.hashCode()}")
}
trafficDataUuidList.clear()
mFilterTrafficData.clear()
}
}

View File

@@ -63,8 +63,8 @@ class MapIdentifySubscriber private constructor() : IMoGoIdentifyListener, IMoGo
try {
if (FunctionBuildConfig.isDrawIdentifyData) {
ThreadUtils.getSinglePool().execute {
aiCloudDataDrawer.renderAiCloudResult(cloudData)
// IdentifyFactory.renderAiCloudResult(cloudData)
// aiCloudDataDrawer.renderAiCloudResult(cloudData)
IdentifyFactory.renderAiCloudResult(cloudData)
}
} else {
clearAiCloudRoma()
@@ -74,9 +74,9 @@ class MapIdentifySubscriber private constructor() : IMoGoIdentifyListener, IMoGo
}
}
override fun clearAiCloudRoma() {
aiCloudDataDrawer.clearAiMarker()
// IdentifyFactory.clearAiMarker()
fun clearAiCloudRoma() {
// aiCloudDataDrawer.clearAiMarker()
IdentifyFactory.clearAiMarker()
}
override fun onAutopilotIdentifyPlanningObj(planningObjects: List<MessagePad.PlanningObject>?) {

View File

@@ -39,7 +39,10 @@ data class V2XEvent(
var radius: Double,
@SerializedName("poiType")
var poiType: String?
var poiType: String?,
@SerializedName("coordinateType")
var coordinateType:Int? = null
)
@Keep

View File

@@ -268,7 +268,13 @@ public class AMapCustomView
if (center != null) {
center.getLon();
MarkerOptions markerOption = new MarkerOptions();
LatLng latLng = MarkerDrawerManager.INSTANCE.coordinateConverterWgsToGcj(mContext, center.getLat(), center.getLon());
LatLng latLng;
if (event.getCoordinateType() == null || event.getCoordinateType() == 0) {
latLng = new LatLng(center.getLat(), center.getLon());
} else {
// wgs84坐标系需转成高德坐标系
latLng = MarkerDrawerManager.INSTANCE.coordinateConverterWgsToGcj(mContext, center.getLat(), center.getLon());
}
markerOption.position(latLng);
markerOption.anchor(0.13f, 1f);
markerOption.icon(BitmapDescriptorFactory.fromBitmap(getV2XBitmap(event.getPoiType())));

View File

@@ -8,6 +8,7 @@ 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
@@ -139,7 +140,11 @@ object DataManager {
fun queryAllMessages(context: Context) {
scope.launch {
initCache()
getCacheMessages(context)
try {
getCacheMessages(context)
} catch (e: Exception) {
CallerLogger.e("DataManager", e.message)
}
}
}

View File

@@ -441,8 +441,8 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
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 -> { // 添加
CallerHmiManager.showLimitingVelocity(Math.round((data.speedMaxLimit*0.02*3.6)).toInt())
MogoObuConstants.STATUS.ADD -> { // 添加 TODO
CallerHmiManager.showLimitingVelocity(Math.round((data.speedMaxLimit*0.02*3.6)).toInt(), 2)
}
MogoObuConstants.STATUS.UPDATE -> { // 更新
@@ -547,7 +547,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
1 -> { //闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT 一个红灯周期只显示一次
if (!isShowRunRedLight) {
isShowRunRedLight = true
CallerHmiManager.disableWarningV2X(2.toString())
CallerHmiManager.disableWarningV2X(1667.toString())
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType)
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType)
CallerLogger.d("${M_OBU}${TAG}","MogoObuDcCombineManager changeTrafficLightStatus 闯红灯 --------> ttsContent = $ttsContent ---alertContent = $alertContent ")
@@ -573,7 +573,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
2 -> { //绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION 一个绿灯周期只显示一次
if (!isShowGreenWave) {
isShowGreenWave = true
CallerHmiManager.disableWarningV2X(1.toString())
CallerHmiManager.disableWarningV2X(1666.toString())
CallerLogger.d(
"${M_OBU}${TAG}",
"MogoObuDcCombineManager 绿波通行引导 --------> speed_min = ${currentLight.suggestMinSpeed} --speed_max = ${currentLight.suggestMaxSpeed}")

View File

@@ -692,6 +692,7 @@ class MogoPrivateObuManager private constructor() {
ObuConstants.STATUS.DELETE -> {
// 移除顶部弹窗
CallerHmiManager.disableWarningTrafficLight()
Log.e("liyz", "old obu delete ------>")
// CallerHmiManager.disableWarningV2X(appId.toString())
}
}

View File

@@ -20,6 +20,7 @@ import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.TooC
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager
import com.mogo.eagle.core.function.call.obu.CallerObuTrafficLightListenerManager
import com.mogo.eagle.core.function.call.v2x.CallObuLimitingSpeedListenerManager
import com.mogo.eagle.core.function.obu.mogo.utils.TrafficDataConvertUtilsNew
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
@@ -171,44 +172,44 @@ class MogoPrivateObuNewManager private constructor() {
override fun onMogoObuRvWarning(data: MogoObuRvWarningData) {
super.onMogoObuRvWarning(data)
// if (HmiBuildConfig.isShowObuV2vView) { //TODO 临时需要关闭v2v开关
mObuStatusInfo.obuRvStatus = true
CallerObuListenerManager.invokeListener(mObuStatusInfo)
if (!data.warningMsg.warningData.isNullOrEmpty()) {
// 更新数据远车数据之前要匹配uuid
TrafficDataConvertUtilsNew.cvxRvInfoIndInfo2TrafficData(data)?.let {
CallerMapUIServiceManager.getMarkerService()?.updateITrafficLocationInfo(it)
}
mObuStatusInfo.obuRvStatus = true
CallerObuListenerManager.invokeListener(mObuStatusInfo)
if (!data.warningMsg.warningData.isNullOrEmpty()) {
// 更新数据远车数据之前要匹配uuid
TrafficDataConvertUtilsNew.cvxRvInfoIndInfo2TrafficData(data)?.let {
CallerMapUIServiceManager.getMarkerService()?.updateITrafficLocationInfo(it)
}
CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", data.toString())
data.let {
//预警信息,预警类型 threat_level 2、3
var status = data.status
data.vehBasicsMsg?.let {
//预警方位
val direction = getMessageDirection(data.vehBasicsMsg.targetPosition)
//处理预警类型
var appId = ""
var level = -1
data.warningMsg?.let {
if (data.warningMsg.warningData != null && data.warningMsg.warningData.size > 0) {
level = data.warningMsg.warningData[0].warningLevel
appId = data.warningMsg.warningData[0].warningType.toString()
}
CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", data.toString())
data.let {
//预警信息,预警类型 threat_level 2、3
var status = data.status
data.vehBasicsMsg?.let {
//预警方位
val direction = getMessageDirection(data.vehBasicsMsg.targetPosition)
//处理预警类型
var appId = ""
var level = -1
data.warningMsg?.let {
if (data.warningMsg.warningData != null && data.warningMsg.warningData.size > 0) {
level = data.warningMsg.warningData[0].warningLevel
appId = data.warningMsg.warningData[0].warningType.toString()
}
}
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
"onMogoObuRvWarning target_classification = ${
getMessageDirection(data.vehBasicsMsg.targetPosition)
} --- direction = $direction --- appId = $appId ---level = $level -- status = $status"
)
//拼凑数据
if (appId != null) {
handleSdkObu(appId, direction, status, level, data)
}
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
"onMogoObuRvWarning target_classification = ${
getMessageDirection(data.vehBasicsMsg.targetPosition)
} --- direction = $direction --- appId = $appId ---level = $level -- status = $status"
)
//拼凑数据
if (appId != null) {
handleSdkObu(appId, direction, status, level, data)
}
}
}
}
// }
}
@@ -217,42 +218,43 @@ class MogoPrivateObuNewManager private constructor() {
*/
override fun onMogoObuSpatWarning(data: MogoObuSpatWarningData) {
super.onMogoObuSpatWarning(data)
if (data?.lights != null && data.lights.isNotEmpty()
) {
if (data != null) {
// if (HmiBuildConfig.isShowObuV2iView) {
handlerTrafficLight(
data.warningType,
data.status,
data.lights
)
handlerTrafficLight(
data.warningType,
data.status,
data.lights
)
// }
}
}
/**
* RSI预警信息 CvxRtiThreatIndInfo(交通标志预警(前方限速、前方学校等等),交通事件预警(前方拥堵、前方积水等等))
* RSI预警信息 onMogoObuRsiWarning(交通标志预警(前方限速、前方学校等等),交通事件预警(前方拥堵、前方积水等等))
*/
override fun onMogoObuRsiWarning(data: MogoObuRsiWarningData) {
super.onMogoObuRsiWarning(data)
// if (HmiBuildConfig.isShowObuV2iView) {
if (data != null && data.warningMsg != null && data.warningMsg.size > 0) {
var alertContent = ""
var ttsContent = ""
var appId = data.warningMsg[0].sceneType.toString()
val status = data.status
val level = data.warningMsg[0].warningLevel
val direction = getMessageDirection(data.warningMsg[0].targetPosition)
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
"onMogoObuRsiWarning appId = $appId --status = $status --level = $level -- eventSerialNum = ${data.warningMsg[0].eventSerialNum} ---signSerialNum = ${data.warningMsg[0].signSerialNum} --- direction = $direction -- targetPosition = ${data.warningMsg[0].targetPosition}"
)
if (data != null && data.warningMsg != null && data.warningMsg.size > 0) {
var alertContent = ""
var ttsContent = ""
var appId = data.warningMsg[0].sceneType.toString()
val status = data.status
val level = data.warningMsg[0].warningLevel
val direction = getMessageDirection(data.warningMsg[0].targetPosition)
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
"onMogoObuRsiWarning appId = $appId --status = $status --level = $level -- eventSerialNum = ${data.warningMsg[0].eventSerialNum} ---signSerialNum = ${data.warningMsg[0].signSerialNum} --- direction = $direction -- targetPosition = ${data.warningMsg[0].targetPosition}"
)
if (appId != "0") {
when (appId) {
// 道路危险情况预警
MogoObuConstants.RSI_SCENE_TYPE.HLW.toString() -> {
when (data.warningMsg[0].eventSerialNum) {
MogoObuConstants.RTE.RTI_TYPE_BREAKDOWN -> {//车辆故障
appId = EventTypeEnumNew.TYPE_USECASE_ID_BREAKDOWN_WARNING.poiType
appId =
EventTypeEnumNew.TYPE_USECASE_ID_BREAKDOWN_WARNING.poiType
}
MogoObuConstants.RTE.RTI_TYPE_ROAD_WATER -> { //道路积水
appId = EventTypeEnumNew.FOURS_PONDING.poiType
@@ -337,7 +339,8 @@ class MogoPrivateObuNewManager private constructor() {
appId = EventTypeEnumNew.TYPE_USECASE_ID_ROAD_NO_TOOTING.poiType
}
MogoObuConstants.RTS.RTI_TYPE_SPEED_LIMIT -> { //限速
appId = EventTypeEnumNew.TYPE_USECASE_ID_ROAD_SPEED_LIMIT.poiType
appId =
EventTypeEnumNew.TYPE_USECASE_ID_ROAD_SPEED_LIMIT.poiType
}
// MogoObuConstants.RTS.RTI_TYPE_GO_STRAIGHT_TURN_RIGHT -> { //直行或右转
// appId =
@@ -400,7 +403,11 @@ class MogoPrivateObuNewManager private constructor() {
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
"new onMogoObuRsiWarning appId = $appId --- ttsContent = $ttsContent --alertContent = $alertContent -- eventSerialNum = ${data.warningMsg[0].eventSerialNum} ---signSerialNum = ${data.warningMsg[0].signSerialNum} ---direction = ${direction.direction} --distance = ${Math.round(data.warningMsg[0].distance)} ---eventRadius = ${Math.round(data.warningMsg[0].eventRadius)} --speedMaxLimit = ${data.warningMsg[0].speedMaxLimit.toInt()}"
"new onMogoObuRsiWarning appId = $appId --- ttsContent = $ttsContent --alertContent = $alertContent -- eventSerialNum = ${data.warningMsg[0].eventSerialNum} ---signSerialNum = ${data.warningMsg[0].signSerialNum} ---direction = ${direction.direction} --distance = ${
Math.round(
data.warningMsg[0].distance
)
} ---eventRadius = ${Math.round(data.warningMsg[0].eventRadius)} --speedMaxLimit = ${data.warningMsg[0].speedMaxLimit.toInt()}"
)
when (status) {
MogoObuConstants.STATUS.ADD -> { // 添加
@@ -456,6 +463,7 @@ class MogoPrivateObuNewManager private constructor() {
}
}
}
}
// }
}
@@ -473,99 +481,105 @@ class MogoPrivateObuNewManager private constructor() {
) {
super.onMogoObuRsmWarning(data)
// if (HmiBuildConfig.isShowObuV2iView) {
if (HmiBuildConfig.isShowObuWeaknessTrafficView) {
// 交通参与者类型 0x0:未知 UNKNOWN | 1机动车 2:非机动车 NON_MOTOR | 3:行人 PEDESTRIAN 4:obu
if (data != null && data.participant != null) {
var v2xType = ""
if (data.participant.ptcType == 1) { //机动车
v2xType =
EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES.poiType
} else if (data.participant.ptcType == 2) { //非机动车
v2xType =
EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_NOT_MOTOR_VEHICLES.poiType
} else if (data.participant.ptcType == 3) { //行人
v2xType =
EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_PERSON.poiType
} else { //未知
v2xType = EventTypeEnumNew.TYPE_ERROR.poiType
}
val ttsContent = EventTypeEnumNew.getWarningTts(v2xType)
val alertContent =
EventTypeEnumNew.getWarningContent(v2xType)
var level = -1
val direction = getMessageDirection(data.participant.targetPosition)
if (data.warningMsg != null && data.warningMsg.warningData != null && data.warningMsg.warningData.size > 0) {
level = data.warningMsg.warningData[0].warningLevel //默认是1个
CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
"onMogoObuRsmWarning ---status---> ${data.status} ---data.warningMsg.warningData[0].status = ${data.warningMsg.warningData[0].status} ---v2xType = $v2xType ---alertContent = $alertContent ---ttsContent = $ttsContent "
)
if (HmiBuildConfig.isShowObuWeaknessTrafficView) {
// 交通参与者类型 0x0:未知 UNKNOWN | 1机动车 2:非机动车 NON_MOTOR | 3:行人 PEDESTRIAN 4:obu
if (data != null && data.participant != null) {
var v2xType = ""
if (data.participant.ptcType == 1) { //机动车
v2xType =
EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES.poiType
} else if (data.participant.ptcType == 2) { //非机动车
v2xType =
EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_NOT_MOTOR_VEHICLES.poiType
} else if (data.participant.ptcType == 3) { //行人
v2xType =
EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_PERSON.poiType
} else { //未知
v2xType = EventTypeEnumNew.TYPE_ERROR.poiType
}
val ttsContent = EventTypeEnumNew.getWarningTts(v2xType)
val alertContent =
EventTypeEnumNew.getWarningContent(v2xType)
var level = -1
val direction = getMessageDirection(data.participant.targetPosition)
if (data.warningMsg != null && data.warningMsg.warningData != null && data.warningMsg.warningData.size > 0) {
level = data.warningMsg.warningData[0].warningLevel //默认是1个
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
"onMogoObuRsmWarning ---status---> ${data.status} ---data.warningMsg.warningData[0].status = ${data.warningMsg.warningData[0].status} ---v2xType = $v2xType ---alertContent = $alertContent ---ttsContent = $ttsContent "
)
when (data.warningMsg.warningData[0].status) {
MogoObuConstants.STATUS.ADD -> { // 添加
when (data.warningMsg.warningData[0].status) {
MogoObuConstants.STATUS.ADD -> { // 添加
// if (level == 2 || level == 3) { //不考虑level
//显示警告红边
CallerHmiManager.showWarning(direction)
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X,
V2XMsg(
v2xType,
alertContent,
ttsContent
//显示警告红边
CallerHmiManager.showWarning(direction)
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X,
V2XMsg(
v2xType,
alertContent,
ttsContent
)
).apply {
sourceType = DataSourceType.OBU
}
)
CallerHmiManager.warningV2X(
v2xType,
alertContent,
ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
(v2xType + direction.direction),//使用当前事件类型+方向记录tag当发生变化的时候关闭当前弹出新的
object : IMoGoWarningStatusListener {
override fun onDismiss() {
// 关闭警告红边
CallerHmiManager.showWarning(
WarningDirectionEnum.ALERT_WARNING_NON
)
).apply {
sourceType = DataSourceType.OBU
}
)
CallerHmiManager.warningV2X(
v2xType,
alertContent,
ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
(v2xType + direction.direction),//使用当前事件类型+方向记录tag当发生变化的时候关闭当前弹出新的
object : IMoGoWarningStatusListener {
override fun onDismiss() {
// 关闭警告红边
CallerHmiManager.showWarning(
WarningDirectionEnum.ALERT_WARNING_NON
)
}
},
true,
5000L
)
},
true,
5000L
)
// }
// 更新数据
TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data)?.let {
CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "add cvxPtcThreatIndInfo2TrafficData ---it---> $it")
// 更新数据
TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data)
?.let {
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
"add cvxPtcThreatIndInfo2TrafficData ---it---> $it"
)
CallerMapUIServiceManager.getMarkerService()
?.updateITrafficThreatLevelInfo(it)
}
}
}
MogoObuConstants.STATUS.UPDATE -> {// 更新
}
MogoObuConstants.STATUS.UPDATE -> {// 更新
}
// 删除
MogoObuConstants.STATUS.DELETE -> {
// 关闭警告红边
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
// 更新数据 TODO 删除原来的改变颜色删除marker。不影响别的模型添加
TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data)
?.let {
// 事件结束,还原交通参与者颜色
it.threatLevel = 0x01
CallerMapUIServiceManager.getMarkerService()
?.updateITrafficThreatLevelInfo(it)
}
// 删除
MogoObuConstants.STATUS.DELETE -> {
// 关闭警告红边
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
// 更新数据 TODO 删除原来的改变颜色删除marker。不影响别的模型添加
TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data)
?.let {
// 事件结束,还原交通参与者颜色
it.threatLevel = 0x01
CallerMapUIServiceManager.getMarkerService()
?.updateITrafficThreatLevelInfo(it)
}
//删除弱势交通元素
CallerMapUIServiceManager.getMarkerService()?.removeCvxRvInfoIndInfo(data.participant.ptcId.toString())
}
//删除弱势交通元素
CallerMapUIServiceManager.getMarkerService()
?.removeCvxRvInfoIndInfo(data.participant.ptcId.toString())
}
}
}
}
}
// }
}
@@ -574,16 +588,20 @@ class MogoPrivateObuNewManager private constructor() {
*/
override fun onMogoObuMapMath(data: MogoObuMapMathData?) {
super.onMogoObuMapMath(data)
if(isShowObuLimitSpeedView) {
// if (isShowObuLimitSpeedView) {
if (data != null) {
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
"onMogoObuMapMath = ${data.status} --speedMaxLimit = ${Math.round((data.speedMaxLimit*3.6))}")
"onMogoObuMapMath = ${data.status} --speedMaxLimit = ${Math.round((data.speedMaxLimit * 3.6))}"
)
Log.d("liyz", "obu onMogoObuMapMath status = ${data.status} --speedMaxLimit = ${Math.round((data.speedMaxLimit * 3.6))}")
when (data.status) {
MogoObuConstants.STATUS.ADD -> { // 添加
UiThreadHandler.post {
if(data.speedMaxLimit > 0) {
CallerHmiManager.showLimitingVelocity(Math.round((data.speedMaxLimit*3.6)).toInt())
if (data.speedMaxLimit > 0) {
// CallerHmiManager.showLimitingVelocity(
// Math.round((data.speedMaxLimit * 3.6)).toInt(), 2)
CallObuLimitingSpeedListenerManager.invokeOnObuLimitingSpeedChange(Math.round((data.speedMaxLimit * 3.6)).toInt())
}
}
}
@@ -593,50 +611,51 @@ class MogoPrivateObuNewManager private constructor() {
MogoObuConstants.STATUS.DELETE -> { // 删除
UiThreadHandler.post {
CallerHmiManager.disableLimitingVelocity()
// CallerHmiManager.disableLimitingVelocity()
CallObuLimitingSpeedListenerManager.invokeOnObuLimitingSpeedChange(-1)
}
}
}
}
}
// }
}
}
}
}
/**
* 获取消息的方位 车辆相关
*/
private fun getMessageDirection(targetClassification: Int): WarningDirectionEnum {
/**
* 获取消息的方位 车辆相关
*/
private fun getMessageDirection(targetClassification: Int): WarningDirectionEnum {
// CallerLogger.d("$M_OBU${TAG_MOGO_NEW_OBU}", "预警红边:预警方向->$targetClassification")
return when (targetClassification) {
MogoObuConstants.VEH_TARGET_POSITION.AHEAD_IN_LANE,
MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_TOP //正前方
return when (targetClassification) {
MogoObuConstants.VEH_TARGET_POSITION.AHEAD_IN_LANE,
MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_TOP //正前方
MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_BOTTOM //正后方
MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_BOTTOM //正后方
MogoObuConstants.VEH_TARGET_POSITION.INTERSECTION_RIGHT -> WarningDirectionEnum.ALERT_WARNING_RIGHT //正右方
MogoObuConstants.VEH_TARGET_POSITION.INTERSECTION_RIGHT -> WarningDirectionEnum.ALERT_WARNING_RIGHT //正右方
MogoObuConstants.VEH_TARGET_POSITION.INTERSECTION_LEFT -> WarningDirectionEnum.ALERT_WARNING_LEFT //正左方
MogoObuConstants.VEH_TARGET_POSITION.INTERSECTION_LEFT -> WarningDirectionEnum.ALERT_WARNING_LEFT //正左方
MogoObuConstants.VEH_TARGET_POSITION.AHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.AHEAD_FAR_LEFT,
MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_LEFT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAR_LEFT
-> WarningDirectionEnum.ALERT_WARNING_TOP_LEFT //左前方
MogoObuConstants.VEH_TARGET_POSITION.AHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.AHEAD_FAR_LEFT,
MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_LEFT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAR_LEFT
-> WarningDirectionEnum.ALERT_WARNING_TOP_LEFT //左前方
MogoObuConstants.VEH_TARGET_POSITION.AHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.AHEAD_FAR_RIGHT,
MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAT_RIGHT
-> WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT //右前方
MogoObuConstants.VEH_TARGET_POSITION.AHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.AHEAD_FAR_RIGHT,
MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAT_RIGHT
-> WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT //右前方
MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_LEFT,
-> WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT //左后方
MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_LEFT,
-> WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT //左后方
MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_RIGHT,
-> WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT //右后方
MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_RIGHT,
-> WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT //右后方
MogoObuConstants.VEH_TARGET_POSITION.UNCLASSIFIED -> WarningDirectionEnum.ALERT_WARNING_NON //未知
else -> WarningDirectionEnum.ALERT_WARNING_ALL
}
MogoObuConstants.VEH_TARGET_POSITION.UNCLASSIFIED -> WarningDirectionEnum.ALERT_WARNING_NON //未知
else -> WarningDirectionEnum.ALERT_WARNING_ALL
}
}
/**
* 构造对应展示数据和场景 根据obu的场景add change delete确定是否展示
@@ -783,7 +802,7 @@ class MogoPrivateObuNewManager private constructor() {
// 关闭警告红边
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
// 移除顶部弹窗
// CallerHmiManager.disableWarningV2X((appId + direction.direction))
// CallerHmiManager.disableWarningV2X((appId + direction.direction))
//更新周边车辆进行预警颜色变换,车辆实时移动和变色
TrafficDataConvertUtilsNew.cvxV2vThreatIndInfo2TrafficData(info)?.let {
it.threatLevel = 0x01
@@ -807,7 +826,9 @@ class MogoPrivateObuNewManager private constructor() {
MogoObuConstants.STATUS.ADD,
MogoObuConstants.STATUS.UPDATE
-> {
changeTrafficLightStatus(appId, lights)
if (lights != null && lights.isNotEmpty()) {
changeTrafficLightStatus(appId, lights)
}
}
// 删除
MogoObuConstants.STATUS.DELETE -> {
@@ -843,16 +864,21 @@ class MogoPrivateObuNewManager private constructor() {
)
// 闯红灯预警,绿波通行和闯红灯是互斥的
when (appId) {
0x0 -> {//不可用 V2I_RLVW_VIOLATION_TYPE_UNAVAILABLE 无效
0 -> {//不可用 V2I_RLVW_VIOLATION_TYPE_UNAVAILABLE 无效
}
0x1 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT 一个红灯周期只显示一次
1 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT 一个红灯周期只显示一次
if (!isShowRunRedLight) {
isShowRunRedLight = true
CallerHmiManager.disableWarningV2X(0x2.toString())
CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}","changeTrafficLightStatus 闯红灯 --------> ")
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType)
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType)
CallerHmiManager.disableWarningV2X(1667.toString())
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
"changeTrafficLightStatus 闯红灯 --------> "
)
ttsContent =
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType)
alertContent =
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType)
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X,
@@ -867,31 +893,39 @@ class MogoPrivateObuNewManager private constructor() {
)
CallerHmiManager.warningV2X(
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, alertContent, ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, null, true, 5000L)
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
alertContent,
ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
null,
true,
5000L
)
}
}
0x2 -> { //绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION 一个绿灯周期只显示一次 100m的时候
2 -> { //绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION 一个绿灯周期只显示一次 100m的时候
if (!isShowGreenWave) {
isShowGreenWave = true
CallerHmiManager.disableWarningV2X(0x1.toString())
CallerHmiManager.disableWarningV2X(1666.toString())
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
"new changeTrafficLightStatus speed_min = ${currentLight.suggestMinSpeed} --speed_max = ${currentLight.suggestMaxSpeed} --TYPE_USECASE_ID_IVP_GREEN ---alertContent = $alertContent ---ttsContent = $ttsContent"
)
val adviceSpeed =
"${currentLight.suggestMinSpeed} - ${currentLight.suggestMaxSpeed}"
"${Math.round(currentLight.suggestMinSpeed*3.6)} - ${Math.round(currentLight.suggestMaxSpeed*3.6)}"
val adviceSpeedTts =
"${currentLight.suggestMinSpeed}${currentLight.suggestMaxSpeed}"
"${Math.round(currentLight.suggestMinSpeed*3.6)}${Math.round(currentLight.suggestMaxSpeed*3.6)}"
ttsContent =
String.format(
EventTypeEnumNew.getWarningTts(appId.toString()),
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
adviceSpeedTts
)
alertContent =
String.format(
EventTypeEnumNew.getWarningContent(appId.toString()),
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
adviceSpeed
)
@@ -927,7 +961,7 @@ class MogoPrivateObuNewManager private constructor() {
when (currentLight.light) {
// 灯光不可用
0 -> {
// CallerHmiManager.showWarningTrafficLight(0, 3)
// CallerHmiManager.showWarningTrafficLight(0, 3)
CallerObuTrafficLightListenerManager.invokeObuTrafficLight(0)
}
// 红灯
@@ -937,7 +971,7 @@ class MogoPrivateObuNewManager private constructor() {
isRedLight = true
}
isGreenLight = false
// CallerHmiManager.showWarningTrafficLight(1, 3)
// CallerHmiManager.showWarningTrafficLight(1, 3)
CallerObuTrafficLightListenerManager.invokeObuTrafficLight(1)
val red = currentLight.countDown.toInt()
CallerHmiManager.changeCountdownRed(red)
@@ -950,7 +984,7 @@ class MogoPrivateObuNewManager private constructor() {
isGreenLight = true
}
isRedLight = false
// CallerHmiManager.showWarningTrafficLight(3, 3)
// CallerHmiManager.showWarningTrafficLight(3, 3)
CallerObuTrafficLightListenerManager.invokeObuTrafficLight(3)
val green = currentLight.countDown.toInt()
CallerHmiManager.changeCountdownGreen(green)
@@ -959,10 +993,10 @@ class MogoPrivateObuNewManager private constructor() {
// 黄灯
7, 8 -> {
CallerHmiManager.disableWarningV2X(appId.toString())
// CallerHmiManager.showWarningTrafficLight(2, 3)
// CallerHmiManager.showWarningTrafficLight(2, 3)
CallerObuTrafficLightListenerManager.invokeObuTrafficLight(2)
val yellow = currentLight.countDown.toInt()
CallerHmiManager.changeCountdownYellow(yellow)
}
}
}
}

View File

@@ -4,16 +4,17 @@ import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.constants.MogoServicePaths.PATH_V2X_MODULE
import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider
import com.mogo.eagle.core.function.api.v2x.IV2XEventProvider
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightManager
import com.mogo.eagle.core.function.v2x.events.V2XEventManager
import com.mogo.eagle.core.function.v2x.speedlimit.SpeedLimitDataManager
import com.mogo.eagle.core.function.v2x.speedlimit.SpeedLimitDispatcher
import com.mogo.eagle.core.function.v2x.trafficlight.core.TrafficLightDispatcher
import com.mogo.eagle.core.function.v2x.vip.VipCarManager
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
@Route(path = PATH_V2X_MODULE)
class V2XProvider : IMoGoFunctionServerProvider {
class V2XProvider : IV2XEventProvider {
override val functionName: String
get() = "V2XProvider"
@@ -23,6 +24,7 @@ class V2XProvider : IMoGoFunctionServerProvider {
VipCarManager.INSTANCE.initServer(context)
SpeedLimitDataManager.getInstance().start()
TrafficLightDispatcher.INSTANCE.initServer(context)
SpeedLimitDispatcher.INSTANCE.initLimit(context)
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
//不处理
@@ -33,6 +35,10 @@ class V2XProvider : IMoGoFunctionServerProvider {
// RedLightWarningManager.INSTANCE.listenTrafficLight()
}
override fun queryWholeRoadEvents() {
V2XEventManager.queryWholeRoadEvents()
}
override fun onDestroy() {
VipCarManager.INSTANCE.destroy()
TrafficLightDispatcher.INSTANCE.destroy()

View File

@@ -1,13 +1,12 @@
package com.mogo.eagle.core.function.v2x.events
import android.annotation.SuppressLint
import android.content.*
import android.os.*
import android.provider.Settings.System
import android.util.*
import androidx.localbroadcastmanager.content.*
import com.mogo.cloud.commons.utils.*
import com.mogo.cloud.passport.*
import com.mogo.commons.constants.HostConst
import com.mogo.commons.module.ServiceConst.CARD_TYPE_ROAD_CONDITION
import com.mogo.commons.module.status.IMogoStatusChangedListener
import com.mogo.commons.module.status.MogoStatusManager
@@ -25,6 +24,7 @@ import com.mogo.eagle.core.data.map.entity.MarkerExploreWay
import com.mogo.eagle.core.data.map.entity.MarkerShowEntity
import com.mogo.eagle.core.data.map.entity.V2XMessageEntity
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity
import com.mogo.eagle.core.data.msgbox.DataSourceType
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.V2XMsg
@@ -32,6 +32,7 @@ import com.mogo.eagle.core.data.traffic.*
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
import com.mogo.eagle.core.function.api.hmi.warning.*
import com.mogo.eagle.core.function.api.map.listener.*
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
import com.mogo.eagle.core.function.call.hmi.*
import com.mogo.eagle.core.function.call.map.*
@@ -61,6 +62,8 @@ import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerCardResult
import com.mogo.eagle.core.function.v2x.internal.data.V2XOptimalRoute
import com.mogo.eagle.core.function.v2x.internal.data.V2XWarningTarget
import com.mogo.eagle.core.function.v2x.internal.event.V2XEvent
import com.mogo.eagle.core.function.v2x.road.V2XEventServiceApi
import com.mogo.eagle.core.network.MoGoRetrofitFactory
import com.mogo.eagle.core.network.utils.*
import com.mogo.eagle.core.utilcode.mogo.logger.*
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
@@ -76,6 +79,9 @@ import com.shuyu.gsyvideoplayer.model.*
import com.shuyu.gsyvideoplayer.player.*
import com.shuyu.gsyvideoplayer.utils.*
import com.zhjt.service.chain.*
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
import kotlinx.coroutines.*
import kotlinx.coroutines.android.*
import mogo.telematics.pad.MessagePad
@@ -98,6 +104,8 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
// 记录历史行驶轨迹,用于车行驶方向计算,只保留两个数据
private val historyPath = arrayOfNulls<MogoLocation>(2)
var v2xEventDisposable: Disposable? = null
fun init(context: Context) {
BridgeApi.init(context)
if (hasInit.compareAndSet(false, true)) {
@@ -106,7 +114,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
V2XManager.init(V2XConfig.Builder().also {
it.aiCloudConfig(MoGoAiCloudClientConfig.getInstance())
it.context(context)
it.loggable(false)
it.loggable(true)
it.distanceForTriggerRefresh(200f) //行驶超过200包含刷新道路周边信息短链请求
it.durationForTriggerRefresh(
60,
@@ -364,7 +372,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
)
if (v2XRoadEventEntity != null) {
val distance = v2XRoadEventEntity.distance
val min = if (EventTypeEnumNew.AI_ROAD_WORK.poiType == v2XRoadEventEntity.poiType) 0 else 5
val min = if (EventTypeEnumNew.isCloudSocketEvent(v2XRoadEventEntity.poiType)) 0 else 5
CallerLogger.d(
"$M_V2X$TAG",
"--- trigger show before ---:data=>[${location.longitude}, ${location.latitude}, ${location.speed}], distance: $distance, minDistance: $min, poiType: ${v2XRoadEventEntity.poiType}"
@@ -448,6 +456,10 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
}
handleRoadMarkerEvent(event.data.toRoadMarker())
}
is V2XEvent.RoadEventX -> {
handleRoadMarkerEvent(event.data.toRoadMarker())
}
}
}
@@ -466,7 +478,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
// 1004 -> { //V2N_RSM,静止事件,包括异常停车、异常静止障碍物
// }
1005 -> { //V2N_RSI,施工事件,包括锥桶或者挡板围城的施工场景,是个多边形包围区域
EventTypeEnumNew.AI_ROAD_WORK.poiType
EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.poiType
}
1007 -> { //三角牌
EventTypeEnumNew.FOURS_ACCIDENT_04.poiType
@@ -670,6 +682,63 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
}
}
fun queryWholeRoadEvents() {
if (v2xEventDisposable != null && !v2xEventDisposable!!.isDisposed) {
v2xEventDisposable!!.dispose()
}
val sn = MoGoAiCloudClientConfig.getInstance().sn
val lineId = getLineId()
if (lineId > 0) {
realQueryV2xEvents(lineId.toString(), sn)
} else {
UiThreadHandler.postDelayed({
realQueryV2xEvents(getLineId().toString(), sn)
}, 500)
}
}
private fun realQueryV2xEvents(lineId: String, sn: String) {
v2xEventDisposable = MoGoRetrofitFactory.getInstance(HostConst.getHost())
.create(V2XEventServiceApi::class.java)
.queryAllV2XEventsByLineId(lineId, sn)
.map {
if (it.code == 200 || it.code == 0) {
CallerLogger.d(M_V2X + TAG, "请求成功size为${it.result?.v2XEventList?.size}")
return@map it.result?.v2XEventList
} else {
CallerLogger.d(M_V2X + TAG, "请求失败code为${it.code}")
return@map ArrayList()
}
}
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe {
val size = it?.size ?: 0
if (size > 0) {
val msgBoxBean = MsgBoxBean(MsgBoxType.V2X, V2XMsg("", "查询到当前全程共${size}个事件", ""))
msgBoxBean.sourceType = DataSourceType.SUMMARY
CallerMsgBoxManager.saveMsgBox(msgBoxBean)
}
}
}
private fun getLineId(): Long {
var lineId: Long = -1
val parameter = CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo()
.autopilotControlParameters
if (parameter != null) {
if (parameter.autoPilotLine != null) {
lineId = parameter.autoPilotLine!!.lineId
CallerLogger.d(M_V2X + TAG, "lineId为:$lineId")
} else {
CallerLogger.d(M_V2X + TAG, "parameter.autoPilotLine为null")
}
} else {
CallerLogger.d(M_V2X + TAG, "parameter为null")
}
return lineId
}
override fun onFail(msg: String) {
CallerLogger.e("$M_V2X$TAG", "Error: $msg")
}

View File

@@ -1,5 +1,8 @@
package com.mogo.eagle.core.function.v2x.events.alarm;
import android.util.Log;
import com.facebook.common.logging.LoggingDelegate;
import com.mogo.eagle.core.data.enums.EventTypeEnumNew;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.data.map.entity.MarkerLocation;
@@ -24,7 +27,7 @@ import io.netty.util.internal.ConcurrentSet;
public class V2XAlarmServer {
// 记录道路播报的事件
private static ConcurrentSet<V2XRoadEventEntity> showedEvents = new ConcurrentSet<>();
private static final ConcurrentSet<V2XRoadEventEntity> showedEvents = new ConcurrentSet<>();
/**
* 获取当前车辆前方距离最近的道路事件
*/
@@ -32,6 +35,7 @@ public class V2XAlarmServer {
CopyOnWriteArrayList<V2XRoadEventEntity> v2XRoadEventEntityList,
MogoLocation currentLocation) {
try {
Log.d("RWJ", "getDriveFrontAlarmEvent --- 1 ---" + currentLocation );
if (!showedEvents.isEmpty()) {
Iterator<V2XRoadEventEntity> iterator = showedEvents.iterator();
while (iterator.hasNext()) {
@@ -48,15 +52,18 @@ public class V2XAlarmServer {
}
}
}
Log.d("RWJ", "getDriveFrontAlarmEvent --- 2 ---" + currentLocation);
if (currentLocation != null && v2XRoadEventEntityList != null) {
// 因为集合是按照距离排序后的所以这里检索出来第一个就发出警告
for (V2XRoadEventEntity v2XRoadEventEntity : v2XRoadEventEntityList) {
// 0、道路事件必须有朝向角度>=0;
Log.d("RWJ", "entity:" + v2XRoadEventEntity.getLocation());
if (v2XRoadEventEntity.getLocation().getAngle() >= 0) {
// 计算车辆距离指定气泡的距离
MarkerLocation eventLocation = v2XRoadEventEntity.getLocation();
// 1、判断是否到达了触发距离,20 ~ 500,
double distance = v2XRoadEventEntity.getDistance();
Log.d("RWJ", "distance:" + distance);
if (distance <= 500) {
if (EventTypeEnumNew.GHOST_PROBE.getPoiType().equals(v2XRoadEventEntity.getPoiType())) {
if (distance > 25) {
@@ -67,22 +74,33 @@ public class V2XAlarmServer {
double carBearing = currentLocation.getBearing();
double eventBearing = eventLocation.getAngle();
double diffAngle = DrivingDirectionUtils.getAngleDiff(carBearing, eventBearing);
if (diffAngle < 20) {
Log.d("RWJ", "car_bearing:" + carBearing + ",eventBearing:" + eventBearing + ",diffAngle:" + diffAngle);
if (diffAngle >= 0 && diffAngle <= 20) {
// 3、计算当前车辆行驶方向与事件位置之间夹角《20度保证道路事件在车辆前方
double eventAngle = DrivingDirectionUtils.getDegreeOfCar2Poi(
currentLocation.getLongitude(),
currentLocation.getLatitude(),
eventLocation.getLon(),
eventLocation.getLat(),
(int) currentLocation.getBearing()
);
if (0 <= eventAngle && eventAngle <= 20) {
if (showedEvents.contains(v2XRoadEventEntity)) {
return null;
}
showedEvents.add(v2XRoadEventEntity);
return v2XRoadEventEntity;
// double eventAngle = DrivingDirectionUtils.getDegreeOfCar2Poi(
// currentLocation.getLongitude(),
// currentLocation.getLatitude(),
// eventLocation.getLon(),
// eventLocation.getLat(),
// (int) currentLocation.getBearing()
// );
//
// Log.d("RWJ", "eventAngle:" + eventAngle);
// if (0 <= eventAngle && eventAngle <= 20) {
// if (showedEvents.contains(v2XRoadEventEntity)) {
// return null;
// }
// Log.d("RWJ", "showed---");
// showedEvents.add(v2XRoadEventEntity);
// return v2XRoadEventEntity;
// }
if (showedEvents.contains(v2XRoadEventEntity)) {
return null;
}
Log.d("RWJ", "showed---");
showedEvents.add(v2XRoadEventEntity);
return v2XRoadEventEntity;
}
}
}
@@ -90,6 +108,7 @@ public class V2XAlarmServer {
}
} catch (Exception e) {
e.printStackTrace();
Log.w("RWJ", "error: " + e.getMessage());
}
return null;
}

View File

@@ -36,9 +36,4 @@ public class SurroundingConstruction implements Serializable {
construtList.add(item);
}
public String getTypeNameTTS(String type) {
String typeName = "请查看周边的";
typeName += EventTypeEnumNew.getTypeNameTTS(type);
return typeName + "信息";
}
}

View File

@@ -199,7 +199,7 @@ class TestPanelBroadcastReceiver : BroadcastReceiver() {
val v2XMessageEntity = V2XMessageEntity<V2XRoadEventEntity>()
v2XMessageEntity.type = V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING
v2XMessageEntity.content =
trackedObj.toRoadMarker(EventTypeEnumNew.AI_ROAD_WORK.poiType).toV2XRoadEventEntity()
trackedObj.toRoadMarker(EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.poiType).toV2XRoadEventEntity()
v2XMessageEntity.isShowState = true
V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity)
}

View File

@@ -7,6 +7,8 @@ import com.mogo.eagle.core.data.map.entity.V2XMessageEntity;
import com.mogo.eagle.core.function.v2x.events.scenario.IV2XScenario;
import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker;
import java.util.concurrent.atomic.AtomicReference;
/**
* author : donghongyu
* e-mail : 1358506549@qq.com
@@ -17,7 +19,7 @@ import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker;
public abstract class AbsV2XScenario<T> implements IV2XScenario {
protected String TAG = "AbsV2XScenario";
private IV2XMarker mV2XMarker;
private V2XMessageEntity<T> mV2XMessageEntity;
private static final AtomicReference<V2XMessageEntity> mV2XMessageEntity = new AtomicReference<>();
protected AbsV2XScenario() {
}
@@ -33,7 +35,6 @@ public abstract class AbsV2XScenario<T> implements IV2XScenario {
* 释放资源
*/
public void release() {
mV2XMessageEntity = null;
mV2XMarker = null;
}
@@ -46,19 +47,19 @@ public abstract class AbsV2XScenario<T> implements IV2XScenario {
}
public void setV2XMessageEntity(@Nullable V2XMessageEntity<T> mV2XMessageEntity) {
this.mV2XMessageEntity = mV2XMessageEntity;
this.mV2XMessageEntity.set(mV2XMessageEntity);
}
public V2XMessageEntity<T> getV2XMessageEntity() {
return mV2XMessageEntity;
return mV2XMessageEntity.get();
}
@Override
public boolean isSameScenario(@Nullable V2XMessageEntity v2XMessageEntity) {
if (mV2XMessageEntity == null) {
V2XMessageEntity old = mV2XMessageEntity.get();
if (old == null) {
return false;
}
return mV2XMessageEntity.equals(v2XMessageEntity);
return old.equals(v2XMessageEntity);
}
}

View File

@@ -21,6 +21,8 @@ import com.mogo.map.MogoMapUIController;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.map.uicontroller.VisualAngleMode;
import java.util.concurrent.atomic.AtomicReference;
/**
* author : donghongyu
* e-mail : 1358506549@qq.com

View File

@@ -29,7 +29,6 @@ import com.mogo.map.overlay.*
import io.netty.util.internal.*
import java.lang.Runnable
import java.util.*
import java.util.concurrent.*
import java.util.concurrent.atomic.*
import kotlin.collections.ArrayList
@@ -59,27 +58,13 @@ object AiRoadMarker {
val poi = this.marker.get()
val car = this.carLocation.get()
if (poi != null && car != null) {
val distance = DrivingDirectionUtils.distance(car.first, car.second, poi.poi_lon, poi.poi_lat) * 10000
val distance = CoordinateUtils.calculateLineDistance(car.first, car.second, poi.poi_lon, poi.poi_lat)
if (distance < 500) {
unMarker(poi)
}
}
}
private val checkV2NExpiredTask = Runnable {
val poi = this.marker.get()
val car = this.carLocation.get()
if (poi != null && car != null) {
val distance = CoordinateUtils.calculateLineDistance(car.first, car.second, poi.poi_lon, poi.poi_lat)
Logger.d(TAG, "receive --- checkV2N --- distance: $distance")
if (distance > 200) {
unMarker(poi)
}else{
checkV2NExpired()
}
}
}
private val onClearAllMarker = object : OnClearAllMarker {
override fun onClearAllMarkers() {
@@ -125,28 +110,6 @@ object AiRoadMarker {
})
}
private val onRoadListener = object : OnRoadListener {
private var roadId = ""
private var hasCrossRoad = false
override fun onRoadIdInfo(roadId: String) {
Logger.d(TAG, "--- onRoadInfo --- roadId: $roadId")
val oldRoadId = this.roadId
if (oldRoadId != roadId) {
if (hasCrossRoad) {
hasCrossRoad = false
}
}
this.roadId = roadId
}
override fun onStopLineInfo(info: StopLine) {
Logger.d(TAG, "--- onStopLineInfo --- info: $info")
if (!hasCrossRoad) {
hasCrossRoad = true
}
}
}
private val onLocationListener = object : IMoGoMapLocationListener {
override fun onLocationChanged(location: MogoLocation?, from: Int, isGps: Boolean) {
@@ -163,102 +126,105 @@ object AiRoadMarker {
}
private fun onCreate() {
CallerMapRoadListenerManager.registerRoadListener(TAG, onRoadListener)
CallMarkersClearManager.addAllMarkersClearListener(TAG, onClearAllMarker)
CallerMapLocationListenerManager.addListener(TAG, onLocationListener, true)
}
private fun onDestroy() {
CallerMapRoadListenerManager.unRegisterRoadListener(TAG)
CallMarkersClearManager.removeAllMarkersClearListener(TAG)
CallerMapLocationListenerManager.removeListener(TAG, true)
removeLine()
}
fun marker(marker: Marker, drawMarker: Boolean) {
fun marker(marker: Marker, drawMarker: Boolean, drawRoadLine: Boolean = false) {
handler.removeCallbacks(checkExpiredTask)
val location = carLocation.get() ?: return
if (markers.contains(marker)) {
Logger.d(TAG, "--- enqueue --- cache hit ---")
Logger.d(TAG, "--- maker --- cache hit ---")
return
}
Logger.d(TAG, "--- marker ---:${marker}")
synchronized(markers) {
markers += marker
}
this.marker.set(marker)
//施工中心点前方的自车行驶方向上300米距离
val l1 = MogoMap.getInstance().mogoMap.getCenterLineRangeInfo(marker.poi_lon, marker.poi_lat, location.third.toFloat(), 300f)
//施工中心点后方的自车行驶方向上300米距离
Logger.d(TAG, "--- marker --- 3 --- l1: $l1")
val l2 = MogoMap.getInstance().mogoMap.getCenterLineRangeInfo(marker.poi_lon, marker.poi_lat, location.third.toFloat(), -300f)
if (l1.points.isEmpty() || l2.points.isEmpty()) {
Logger.d(TAG, "--- marker --- 3 --- return ----")
synchronized(markers) {
markers.remove(marker)
}
return
}
Logger.d(TAG, "--- marker --- 4 --- l2: $l2")
val points = LinkedList<MogoLatLng>()
if (l2 != null && l2.points.isNotEmpty()) {
points.addAll(l2.points.reversed().map {
MogoLatLng(it.second, it.first)
})
}
val centerX= marker.poi_lon
val centerY = marker.poi_lat
Logger.d(TAG, "--- marker --- 5 --- marker: $marker")
val farthestPoint = marker.polygon?.let {
var find: Pair<Double, Double> = Pair(centerX, centerY)
var min = Long.MAX_VALUE
for (p in it) {
val angle = DrivingDirectionUtils.getDegreeOfCar2Poi2(centerX, centerY, p.first, p.second, location.third)
if (angle < min) {
min = angle
find = p
}
}
MogoLatLng(find.second, find.first)
} ?: MogoLatLng(centerY, centerX)
marker.farthestPoint = Pair(farthestPoint.lon, farthestPoint.lat)
Logger.d(TAG, "--- marker --- 6 --- marker: $marker")
if (l1 != null && l1.points.isNotEmpty()) {
for (l in l1.points) {
if (DrivingDirectionUtils.getDegreeOfCar2Poi2(farthestPoint.lon, farthestPoint.lat, l.first, l.second, location.third + 180) < 90L) {
points.add(l.let { MogoLatLng(it.second, it.first) })
}
}
}
if (points.size <= 1) {
synchronized(markers) {
markers.remove(marker)
}
return
}
removeLine()
if (drawMarker) {
marker.entity?.apply { V2XAiRoadEventMarker.drawMarkers(this) }
}
val evaluator = ArgbEvaluator()
val interceptor = DecelerateInterpolator(1.5f)
val total = points.size
val colors = ArrayList<Int>()
(0..total).forEach { i ->
colors += evaluator.evaluate(interceptor.getInterpolation(i * 1f / total), START_COLOR, END_COLOR) as Int
}
var line = line.get()
options.points(points)
options.colorValues(colors)
Logger.d(TAG, "--- marker --- 7 --- points: ${points.size}")
if (line == null || line.isDestroyed) {
val l = overlayManager.addPolyline(options)
this.line.set(l)
line = l
if (drawRoadLine) {
//施工中心点前方的自车行驶方向上300米距离
val l1 = MogoMap.getInstance().mogoMap.getCenterLineRangeInfo(marker.poi_lon, marker.poi_lat, location.third.toFloat(), 300f)
//施工中心点后方的自车行驶方向上300米距离
Logger.d(TAG, "--- marker --- 3 --- l1: $l1")
val l2 = MogoMap.getInstance().mogoMap.getCenterLineRangeInfo(marker.poi_lon, marker.poi_lat, location.third.toFloat(), -300f)
if (l1.points.isEmpty() || l2.points.isEmpty()) {
Logger.d(TAG, "--- marker --- 3 --- return ----")
synchronized(markers) {
markers.remove(marker)
}
return
}
Logger.d(TAG, "--- marker --- 4 --- l2: $l2")
val points = LinkedList<MogoLatLng>()
if (l2 != null && l2.points.isNotEmpty()) {
points.addAll(l2.points.reversed().map {
MogoLatLng(it.second, it.first)
})
}
val centerX= marker.poi_lon
val centerY = marker.poi_lat
Logger.d(TAG, "--- marker --- 5 --- marker: $marker")
val farthestPoint = marker.polygon?.let {
var find: Pair<Double, Double> = Pair(centerX, centerY)
var min = Long.MAX_VALUE
for (p in it) {
val angle = DrivingDirectionUtils.getDegreeOfCar2Poi2(centerX, centerY, p.first, p.second, location.third)
if (angle < min) {
min = angle
find = p
}
}
MogoLatLng(find.second, find.first)
} ?: MogoLatLng(centerY, centerX)
marker.farthestPoint = Pair(farthestPoint.lon, farthestPoint.lat)
Logger.d(TAG, "--- marker --- 6 --- marker: $marker")
if (l1 != null && l1.points.isNotEmpty()) {
for (l in l1.points) {
if (DrivingDirectionUtils.getDegreeOfCar2Poi2(farthestPoint.lon, farthestPoint.lat, l.first, l.second, location.third + 180) < 90L) {
points.add(l.let { MogoLatLng(it.second, it.first) })
}
}
}
if (points.size <= 1) {
synchronized(markers) {
markers.remove(marker)
}
return
}
removeLine()
val evaluator = ArgbEvaluator()
val interceptor = DecelerateInterpolator(1.5f)
val total = points.size
val colors = ArrayList<Int>()
(0..total).forEach { i ->
colors += evaluator.evaluate(interceptor.getInterpolation(i * 1f / total), START_COLOR, END_COLOR) as Int
}
var line = line.get()
options.points(points)
options.colorValues(colors)
Logger.d(TAG, "--- marker --- 7 --- points: ${points.size}")
if (line == null || line.isDestroyed) {
val l = overlayManager.addPolyline(options)
this.line.set(l)
line = l
} else {
line.setOption(options)
}
if (!line.isVisible) {
line.isVisible = true
}
} else {
line.setOption(options)
}
if (!line.isVisible) {
line.isVisible = true
removeLine()
}
}
@@ -287,7 +253,7 @@ object AiRoadMarker {
val poi = this.marker.get()
val car = this.carLocation.get()
if (poi != null && car != null) {
val distance = DrivingDirectionUtils.distance(car.first, car.second, marker.poi_lon, marker.poi_lat) * 10000
val distance = CoordinateUtils.calculateLineDistance(car.first, car.second, marker.poi_lon, marker.poi_lat)
Logger.d(TAG, "receive --- 2 ---:car:[${car.first}, ${car.second}] -> poi:[${marker.poi_lon}, ${marker.poi_lat}] --> distance:$distance")
if (distance < 500) {
checkExpired()
@@ -306,32 +272,13 @@ object AiRoadMarker {
handler.postDelayed(checkExpiredTask, 10000)
}
fun receiveV2N(marker: Marker) {
Logger.d(TAG, "receive --- 1 ---")
val car = this.carLocation.get()
if (car != null) {
val distance = DrivingDirectionUtils.distance(car.first, car.second, marker.poi_lon, marker.poi_lat) * 10000
Logger.d(TAG, "receive --- 2 ---:car:[${car.first}, ${car.second}] -> poi:[${marker.poi_lon}, ${marker.poi_lat}] --> distance:$distance")
if (distance < 500) {
checkV2NExpired()
} else {
handler.removeCallbacks(checkV2NExpiredTask)
}
} else {
checkV2NExpired()
}
}
private fun checkV2NExpired() {
handler.removeCallbacks(checkV2NExpiredTask)
handler.postDelayed(checkV2NExpiredTask, 5000)
}
data class Marker(
val id: String,
val poiType: String,
val poi_lat: Double,
val poi_lon: Double,
val poi_angle: Double,
val polygon: List<Pair<Double, Double>>?,
val polygon: List<Pair<Double, Double>>? = null,
var farthestPoint: Pair<Double, Double>? = null,
var entity: V2XRoadEventEntity? = null
) {
@@ -340,15 +287,12 @@ object AiRoadMarker {
if (this === other) return true
if (javaClass != other?.javaClass) return false
other as Marker
if (poi_lat != other.poi_lat) return false
if (poi_lon != other.poi_lon) return false
if (id != other.id) return false
return true
}
override fun hashCode(): Int {
var result = poi_lat.hashCode()
result = 31 * result + poi_lon.hashCode()
return result
return id.hashCode()
}
}
}

View File

@@ -1,5 +1,7 @@
package com.mogo.eagle.core.function.v2x.events.scenario.scene.road;
import android.util.Log;
import androidx.core.util.Pair;
import com.mogo.eagle.core.data.enums.EventTypeEnumNew;
@@ -11,6 +13,8 @@ import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XMarkerManager;
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XPolylineManager;
import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.AiRoadMarker;
import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker;
import com.mogo.eagle.core.network.utils.GsonUtil;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@@ -31,8 +35,12 @@ public class V2XRoadEventMarker implements IV2XMarker<V2XRoadEventEntity> {
if (marker != null) {
marker.clearAlarmPOI();
if (entity != null) {
if (!Objects.equals(entity.getPoiType(), EventTypeEnumNew.AI_ROAD_WORK.getPoiType())
&& !Objects.equals(entity.getPoiType(), EventTypeEnumNew.FOURS_ACCIDENT_04.getPoiType())) {
Log.d("RWJ", "V2XRoadEventMarker:" + entity.getPoiType());
if (!Objects.equals(entity.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType())
&& !Objects.equals(entity.getPoiType(), EventTypeEnumNew.FOURS_ACCIDENT_04.getPoiType())
&& !Objects.equals(entity.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_JINGZHI.getPoiType())
&& !Objects.equals(entity.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_CONGESTION.getPoiType())
&& !Objects.equals(entity.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGU.getPoiType())) {
AiRoadMarker.Marker prev = mMarker;
if (prev != null) {
AiRoadMarker.INSTANCE.unMarker(prev);
@@ -46,6 +54,7 @@ public class V2XRoadEventMarker implements IV2XMarker<V2XRoadEventEntity> {
mMarker = null;
}
MarkerExploreWay noveltyInfo = entity.getNoveltyInfo();
Log.d("RWJ", "V2XRoadEventMarker -> noveltyInfo:" + noveltyInfo);
if (noveltyInfo != null && noveltyInfo.extras != null) {
List<Pair<Double, Double>> polygons = new ArrayList<>();
Pair<Double, Double> gpsLocation = null;
@@ -80,11 +89,10 @@ public class V2XRoadEventMarker implements IV2XMarker<V2XRoadEventEntity> {
if (!polygons.isEmpty() && gpsLocation != null) {
MarkerLocation location = noveltyInfo.getLocation();
AiRoadMarker.Marker m = new AiRoadMarker.Marker(gpsLocation.second, gpsLocation.first, location.getAngle(), polygons, null, entity);
AiRoadMarker.Marker m = new AiRoadMarker.Marker(noveltyInfo.getInfoId(), noveltyInfo.getPoiType(), gpsLocation.second, gpsLocation.first, location.getAngle(), polygons, null, entity);
mMarker = m;
AiRoadMarker.INSTANCE.marker(m, true);
AiRoadMarker.INSTANCE.marker(m, true, isDrawRoadLine(m.getPoiType()));
}
}
}
}
@@ -94,6 +102,10 @@ public class V2XRoadEventMarker implements IV2XMarker<V2XRoadEventEntity> {
}
}
private boolean isDrawRoadLine(String poiType) {
return EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType().equals(poiType);
}
@Override
public void clearPOI() {
// 移除线

View File

@@ -1,13 +1,15 @@
package com.mogo.eagle.core.function.v2x.events.scenario.scene.road;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X;
import android.util.Log;
import com.mogo.cloud.commons.utils.CoordinateUtils;
import com.mogo.commons.analytics.AnalyticsUtils;
import com.mogo.eagle.core.data.enums.EventTypeEnumNew;
import com.mogo.eagle.core.data.enums.WarningDirectionEnum;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.data.map.entity.MarkerExploreWay;
import com.mogo.eagle.core.data.map.entity.MarkerLocation;
import com.mogo.eagle.core.data.map.entity.V2XMessageEntity;
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity;
import com.mogo.eagle.core.data.msgbox.MsgBoxBean;
@@ -15,6 +17,7 @@ import com.mogo.eagle.core.data.msgbox.MsgBoxType;
import com.mogo.eagle.core.data.msgbox.V2XMsg;
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager;
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager;
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst;
@@ -22,7 +25,6 @@ import com.mogo.eagle.core.function.v2x.events.manager.V2XStatusManager;
import com.mogo.eagle.core.function.v2x.events.scenario.impl.AbsV2XScenario;
import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker;
import com.mogo.eagle.core.network.utils.GsonUtil;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
@@ -44,7 +46,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
@Override
public void init(V2XMessageEntity<V2XRoadEventEntity> v2XMessageEntity) {
try {
CallerLogger.INSTANCE.d(M_V2X + TAG, "v2XMessageEntity:" + GsonUtil.jsonFromObject(v2XMessageEntity));
Log.d(TAG, "v2XMessageEntity:" + GsonUtil.jsonFromObject(v2XMessageEntity));
V2XRoadEventEntity v2XRoadEventEntity = v2XMessageEntity.getContent();
if (v2XRoadEventEntity != null) {
if (v2XMessageEntity.isShowState()) {
@@ -99,20 +101,39 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
V2XRoadEventEntity content = entity != null ? entity.getContent() : null;
if (content != null) {
// //显示警告红边
if (content.getAlarmContent() == null || content.getAlarmContent().isEmpty()
|| content.getTts() == null || content.getTts().isEmpty()) {
String alarmText = content.getAlarmContent();
String ttsText = content.getTts();
if (alarmText == null || alarmText.isEmpty()
|| ttsText == null || ttsText.isEmpty()) {
Log.d("MsgBox-V2XRoadScenario", "alertContent或ttsContent为空!");
}
String poiType = content.getPoiType();
if (EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType().equals(poiType) ||
EventTypeEnumNew.TYPE_SOCKET_ROAD_JINGZHI.getPoiType().equals(poiType) ||
EventTypeEnumNew.TYPE_SOCKET_ROAD_CONGESTION.getPoiType().equals(poiType) ||
EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGU.getPoiType().equals(poiType)) {
MogoLocation carLocation = CallerMapLocationListenerManager.INSTANCE.getCurrentLocation();
MarkerExploreWay noveltyInfo = content.getNoveltyInfo();
if (carLocation != null && noveltyInfo != null) {
MarkerLocation eventLocation = noveltyInfo.getLocation();
if (eventLocation != null) {
double distance = CoordinateUtils.calculateLineDistance(carLocation.getLongitude(), carLocation.getLatitude(), eventLocation.getLon(), eventLocation.getLat());
alarmText = String.format(alarmText, Math.round(distance) + "");
ttsText = String.format(ttsText, Math.round(distance) + "");
}
}
}
CallerMsgBoxManager.INSTANCE.saveMsgBox(
new MsgBoxBean(
MsgBoxType.V2X,
new V2XMsg(content.getPoiType(),
content.getAlarmContent(),
content.getTts())
new V2XMsg(poiType,
alarmText,
ttsText)
)
);
CallerHmiManager.INSTANCE.warningV2X(content.getPoiType(), content.getAlarmContent(),
content.getTts(), TAG, this, !entity.isOnlyShow(),
CallerHmiManager.INSTANCE.warningV2X(poiType, alarmText,
ttsText, TAG, this, !entity.isOnlyShow(),
TimeUnit.SECONDS.toMillis(5));
}
}

View File

@@ -40,7 +40,7 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMoGoMapL
private WarningDirectionEnum mDirection;
public V2XFrontWarningScenario() {
setV2XMarker(sV2XWarningMarker);
//setV2XMarker(sV2XWarningMarker);
}
@Override

View File

@@ -1,17 +1,14 @@
package com.mogo.eagle.core.function.v2x.events.utils
import androidx.core.util.Pair
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.enums.EventTypeEnumNew.Companion.isRoadEvent
import com.mogo.eagle.core.data.map.entity.MarkerExploreWay
import com.mogo.eagle.core.data.map.entity.MarkerLocation
import com.mogo.eagle.core.data.map.entity.MarkerUserInfo
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity
import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.AiRoadMarker
import com.mogo.eagle.core.function.v2x.internal.data.MarkerExploreWayItem
import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerCardResult
import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerExploreWay
import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerLocation
import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerUserInfo
import com.mogo.eagle.core.function.v2x.internal.data.*
import com.mogo.map.MogoMap
import mogo.telematics.pad.MessagePad
import roadwork.Road
@@ -82,6 +79,9 @@ fun Road.RW_PB.toRoadMarker(): V2XMarkerCardResult =
)
}
}
val centerX = this.roadwork?.center?.point?.lon ?: 0.0
val centerY = this.roadwork?.center?.point?.lat ?: 0.0
val id = "${centerX}_${centerY}"
l1.exploreWay = ArrayList<V2XMarkerExploreWay>().also { l2 ->
l2.add(V2XMarkerExploreWay().also { l3 ->
l3.poiType = this.roadwork?.poiType?.toString()
@@ -95,17 +95,54 @@ fun Road.RW_PB.toRoadMarker(): V2XMarkerCardResult =
l4.lat = p.lat
l4.angle = this.roadwork?.center?.road?.bearing?.toDouble() ?: 0.0
}
l3.infoId = id
})
}
AiRoadMarker.receive(
AiRoadMarker.Marker(id, EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.poiType,
this.roadwork?.center?.point?.lat ?: 0.0,
this.roadwork?.center?.point?.lon ?: 0.0,
this.roadwork?.center?.road?.bearing?.toDouble() ?: 0.0,
)
)
}
fun V2XRoadXData.toRoadMarker(): V2XMarkerCardResult =
V2XMarkerCardResult().also { l1 ->
this.polygon?.takeIf { it.isNotEmpty() }?.also { old ->
l1.extras = HashMap<String, List<Pair<Double, Double>>>().also { extra ->
extra["polygon"] = old.map { d ->
Pair(d.lon, d.lat)
}
extra["gps_location"] = listOf(Pair(this.center?.lon ?: 0.0, this.center?.lat ?: 0.0))
}
}
l1.exploreWay = ArrayList<V2XMarkerExploreWay>().also { l2 ->
l2.add(V2XMarkerExploreWay().also { l3 ->
l3.poiType = this.poiType
l3.generateTime = this.detectTime ?: 0L
l3.location = V2XMarkerLocation().also { l4 ->
val p = MogoMap.getInstance().mogoMap.switchLonLat(
this.center?.lon ?: 0.0,
this.center?.lat ?: 0.0
)
l4.lon = p.lon
l4.lat = p.lat
l4.angle = this.centerRoad?.bearing ?: 0.0
}
l3.infoId = this.index
})
}
AiRoadMarker.receive(
AiRoadMarker.Marker(
this.roadwork?.center?.point?.lat ?: 0.0,
this.roadwork?.center?.point?.lon ?: 0.0,
this.roadwork?.center?.road?.bearing?.toDouble() ?: 0.0,
null,
null,
null
this.index.toString(),
this.poiType ?: "",
this.center?.lat ?: 0.0,
this.center?.lon ?: 0.0,
this.centerRoad?.bearing ?: 0.0
)
)
}
@@ -118,6 +155,7 @@ fun MessagePad.TrackedObject.toRoadMarker(poiType: String): V2XMarkerCardResult
extra["gps_location"] = listOf(Pair(this.longitude, this.latitude))
}
}
val id = "${this.longitude}_${this.latitude}"
l1.exploreWay = ArrayList<V2XMarkerExploreWay>().also { l2 ->
l2.add(V2XMarkerExploreWay().also { l3 ->
l3.poiType = poiType
@@ -129,11 +167,11 @@ fun MessagePad.TrackedObject.toRoadMarker(poiType: String): V2XMarkerCardResult
l4.lat = p.lat
l4.angle = this.heading
}
l3.infoId = id
})
}
AiRoadMarker.receiveV2N(
AiRoadMarker.Marker(this.latitude, this.longitude, this.heading, null, null, null)
AiRoadMarker.receive(
AiRoadMarker.Marker(id, poiType, this.latitude, this.longitude, this.heading, null, null, null)
)
}

View File

@@ -11,11 +11,11 @@ import com.mogo.eagle.core.function.v2x.internal.event.V2XEvent
import com.mogo.eagle.core.function.v2x.internal.http.V2XRefreshModel
import com.mogo.eagle.core.function.v2x.internal.http.callback.IV2XRefreshCallback
import com.mogo.eagle.core.function.v2x.internal.logger.Logger
import com.mogo.eagle.core.function.v2x.internal.socket.*
import com.mogo.eagle.core.function.v2x.internal.socket.V2XMessageListener_401012
import com.mogo.eagle.core.function.v2x.internal.socket.V2XMessageListener_401018
import com.mogo.eagle.core.function.v2x.internal.socket.V2XMessageListener_402000
import com.mogo.eagle.core.function.v2x.internal.socket.V2XMessageListener_404000
import com.mogo.eagle.core.function.v2x.internal.socket.V2XMessageListener_503000
import com.mogo.eagle.core.function.v2x.internal.utils.DistanceUtils
import java.util.concurrent.CopyOnWriteArrayList
import java.util.concurrent.atomic.AtomicBoolean
@@ -131,7 +131,8 @@ object V2XManager {
SocketManager.getInstance().registerOnMessageListener(401018, V2XMessageListener_401018(cbs))
SocketManager.getInstance().registerOnMessageListener(402000, V2XMessageListener_402000(cbs))
SocketManager.getInstance().registerOnMessageListener(404000, V2XMessageListener_404000(cbs))
SocketManager.getInstance().registerOnMessageListener(503000, V2XMessageListener_503000(cbs))
//SocketManager.getInstance().registerOnMessageListener(503000, V2XMessageListener_503000(cbs))
SocketManager.getInstance().registerOnMessageListener(70001, V2XMessageListener_70001(cbs))
handler.post(refreshTask)
}
}

View File

@@ -434,8 +434,10 @@ class V2XMarkerExploreWay: Serializable {
*/
var infoCheckNode = 0
var coordinateType: Int? = null
override fun toString(): String {
return "V2XMarkerExploreWay(infoId=$infoId, type=$type, poiType=$poiType, sn=$sn, location=$location, direction=$direction, canLive=$canLive, fileType=$fileType, addr=$addr, generateTime=$generateTime, cityName=$cityName, distance=$distance, userInfo=$userInfo, items=$items, uploadType=$uploadType, isFabulous=$isFabulous, infoCheckNode=$infoCheckNode)"
return "V2XMarkerExploreWay(infoId=$infoId, type=$type, poiType=$poiType, sn=$sn, location=$location, direction=$direction, canLive=$canLive, fileType=$fileType, addr=$addr, generateTime=$generateTime, cityName=$cityName, distance=$distance, userInfo=$userInfo, items=$items, uploadType=$uploadType, isFabulous=$isFabulous, infoCheckNode=$infoCheckNode, coordinateType=$coordinateType)"
}
}

View File

@@ -0,0 +1,57 @@
package com.mogo.eagle.core.function.v2x.internal.data
import androidx.annotation.Keep
@Keep
data class V2XRoadXData(
val poiType: String? = null,
val center: Point? = null,
val centerRoad: CenterRoad? = null,
val congestionLanes: List<Congestion>? = null,
val coordinateType: Int? = -1,
val id: String? = null,
val index: String? = null,
val obstacles: List<Obstacle>? = null,
val polygon: List<Point>? = null,
val type: Int? = 0,
val detectTime: Long? = 0L
)
@Keep
data class CenterRoad(
val bearing: Double? = 0.0,
val laneNo: Int? = null,
val roadId: String? = null,
val roadName: String? = null,
val tileId: Int? = 0
)
@Keep
data class Congestion(
val laneId: Int? = null,
val level: Int? = null
)
@Keep
data class Obstacle(
val boundBox: List<PointX>? = null,
val center: Point? = null,
val id: Int? = null,
val polygon: List<Point>? = null,
val score: Double? = null,
val type: Int? = null
)
@Keep
data class Point(
val lon: Double? = null,
val lat: Double? = null
)
@Keep
data class PointX(
val x: Double? = null,
val y: Double? = null
)

View File

@@ -1,10 +1,6 @@
package com.mogo.eagle.core.function.v2x.internal.event
import com.mogo.eagle.core.function.v2x.internal.data.V2XAdvanceWarning
import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerCardResult
import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerResponse
import com.mogo.eagle.core.function.v2x.internal.data.V2XOptimalRoute
import com.mogo.eagle.core.function.v2x.internal.data.V2XWarningTarget
import com.mogo.eagle.core.function.v2x.internal.data.*
import roadwork.Road.RW_PB
sealed class V2XEvent {
@@ -65,4 +61,15 @@ sealed class V2XEvent {
return "Marker(data=$data)"
}
}
/**
* 长链-道路事件扩展数据结构
*/
class RoadEventX(val type: Int = 70001, val data: V2XRoadXData): V2XEvent() {
override fun toString(): String {
return "RoadEventX(type=$type, data=$data)"
}
}
}

View File

@@ -0,0 +1,27 @@
package com.mogo.eagle.core.function.v2x.internal.socket
import com.mogo.cloud.socket.IMogoCloudSocketOnMessageListener
import com.mogo.eagle.core.function.v2x.internal.V2XManager
import com.mogo.eagle.core.function.v2x.internal.callback.IV2XCallback
import com.mogo.eagle.core.function.v2x.internal.data.V2XRoadXData
import com.mogo.eagle.core.function.v2x.internal.event.V2XEvent
import com.mogo.eagle.core.function.v2x.internal.logger.Logger
internal class V2XMessageListener_70001(val cbs: Iterable<IV2XCallback>?): IMogoCloudSocketOnMessageListener<V2XRoadXData> {
override fun target(msgType: Int): Class<V2XRoadXData> = V2XRoadXData::class.java
override fun onMsgReceived(msgType: Int, data: V2XRoadXData?) {
if (msgType != 70001) {
return
}
if (data == null) {
Logger.i(V2XManager.TAG, "V2XMessageListener_70001message is null!")
return
}
Logger.i(V2XManager.TAG, "V2XMessageListener_70001:$data")
cbs?.forEach {
it.onAck(V2XEvent.RoadEventX(data = data))
}
}
}

View File

@@ -0,0 +1,73 @@
package com.mogo.eagle.core.function.v2x.road
import androidx.annotation.Keep
import com.google.gson.annotations.SerializedName
import com.mogo.eagle.core.data.BaseData
@Keep
data class V2XEventResult (
@SerializedName("result")
var result: Result?
): BaseData()
@Keep
data class Result(
@SerializedName("eventList")
var v2XEventList: List<V2XEvent>?
)
@Keep
data class V2XEvent(
@SerializedName("receiveTime")
var receiveTime: Long,
@SerializedName("detectTime")
var detectTime: Long,
@SerializedName("id")
var id: String?,
@SerializedName("center")
var center: Center?,
@SerializedName("centerRoad")
var centerRoad: CenterRoad?,
@SerializedName("radius")
var radius: Double,
@SerializedName("poiType")
var poiType: String?,
@SerializedName("coordinateType")
var coordinateType:Int? = null
)
@Keep
data class Center(
@SerializedName("lat")
var lat: Double,
@SerializedName("lon")
var lon: Double
)
@Keep
data class CenterRoad(
@SerializedName("bearing")
var bearing: Double,
@SerializedName("laneNo")
var laneNo: Long,
@SerializedName("roadId")
var roadId: String?,
@SerializedName("roadName")
var roadName: String?,
@SerializedName("tileId")
var tileId: Long
)

View File

@@ -0,0 +1,11 @@
package com.mogo.eagle.core.function.v2x.road
import io.reactivex.Observable
import retrofit2.http.GET
import retrofit2.http.Query
interface V2XEventServiceApi {
@GET("/eagleEye-mis/config/queryV2NInformation")
fun queryAllV2XEventsByLineId(@Query("lineId") lineId: String, @Query("sn") sn: String): Observable<V2XEventResult>
}

View File

@@ -54,16 +54,16 @@ public class SpeedLimitDataManager implements IMogoCarLocationChangedListener2 {
@BizConfig(biz = V2I,dependentBizNode = "",bizNode = BIZ_SLW)
private void getSpeedLimit() {
if (!isShowObuLimitSpeedView) {
// if (!isShowObuLimitSpeedView) {
int speedLimit = MogoMapUIController.getInstance().getLimitSpeed(mLocation.getLongitude(), mLocation.getLatitude(), mLocation.getBearing());
UiThreadHandler.post(() -> {
if (speedLimit > 0) {
CallerHmiManager.INSTANCE.showLimitingVelocity(speedLimit);
// CallerHmiManager.INSTANCE.showLimitingVelocity(speedLimit);
CallLimitingVelocityListenerManager.INSTANCE.invokeOnLimitingVelocityChange(speedLimit);
}
});
}
}
// }
}
public void start() {

View File

@@ -0,0 +1,80 @@
package com.mogo.eagle.core.function.v2x.speedlimit
import android.content.Context
import android.os.Handler
import android.util.Log
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
import com.mogo.eagle.core.function.api.obu.IMoGoObuTrafficLightListener
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.api.v2x.LimitingVelocityListener
import com.mogo.eagle.core.function.api.v2x.ObuLimitingSpeedListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.obu.CallerObuTrafficLightListenerManager
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.call.v2x.CallLimitingVelocityListenerManager
import com.mogo.eagle.core.function.call.v2x.CallObuLimitingSpeedListenerManager
import com.mogo.eagle.core.function.v2x.trafficlight.TrafficLightHMIManager
import perception.TrafficLightOuterClass
import perception.TrafficLightOuterClass.TrafficLight
/**
* @author lixiaopeng
* @description 对多个限速进行调度maprsu ...
* @since: 2023/1/12
*/
class SpeedLimitDispatcher : LimitingVelocityListener, ObuLimitingSpeedListener {
companion object {
const val TAG = "SpeedLimitDispatcher"
val INSTANCE: SpeedLimitDispatcher by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
SpeedLimitDispatcher()
}
}
private var mContext: Context? = null
//是否有AI获取红绿灯灯态
private var hasObuStatus: Boolean = false
fun initLimit(context: Context) {
mContext = context
//注册监听MAP的限速
CallLimitingVelocityListenerManager.addListener(TAG, this)
//注册监听OBU的限速
CallObuLimitingSpeedListenerManager.addListener(TAG, this)
}
/**
* 地图限速数据
*/
override fun onLimitingVelocityChange(limitingVelocity: Int) {
// CallerHmiManager.disableLimitingVelocity()
if (!hasObuStatus) {
CallerHmiManager.showLimitingVelocity(limitingVelocity, 1)
}
}
/**
* obu限速
*/
override fun onObuLimitingSpeedChange(limitingSpeed: Int) {
// CallerHmiManager.disableLimitingVelocity()
if (limitingSpeed > 0) {
hasObuStatus = true
CallerHmiManager.showLimitingVelocity(limitingSpeed, 2)
} else {
hasObuStatus = false
CallerHmiManager.disableLimitingVelocity()
}
}
fun destroy() {
//取消注册监听AI云获取红绿灯状态
CallerTrafficLightListenerManager.unRegisterTrafficLightListener(TAG)
//取消注册监听工控机感知红绿灯
CallerAutopilotIdentifyListenerManager.removeListener(TAG)
}
}

View File

@@ -57,6 +57,7 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
* @param trafficLights 感知红绿灯
*/
override fun onAutopilotPerceptionTrafficLight(trafficLights: TrafficLightOuterClass.TrafficLights?) {
Log.d("liyz", "onAutopilotPerceptionTrafficLight hasObuLightStatus = $hasObuLightStatus ---hasAiLightStatus = $hasAiLightStatus")
if (!hasObuLightStatus) {
if (!hasAiLightStatus) {
trafficLights?.let { it ->
@@ -72,6 +73,7 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
}
if (light == null) {
//隐藏红绿灯显示
Log.e("liyz", "onAutopilotPerceptionTrafficLight delete ------>")
TrafficLightHMIManager.INSTANCE.hideTrafficLight()
} else {
when (light.state) {
@@ -138,7 +140,6 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
override fun onObuTrafficLight(light: Int) {
super.onObuTrafficLight(light)
hasObuLightStatus = true
Log.d("liyz", "onObuTrafficLight light = $light")
CallerHmiManager.showWarningTrafficLight(light, 3)
}

View File

@@ -44,7 +44,7 @@ public class CloudPoiManager {
R.drawable.module_common_icon_map_marker_road_block_off2, R.drawable.module_common_icon_map_marker_road_block_off2_white, "封路"));
poiWrapper.put(EventTypeEnumNew.FOURS_ROAD_WORK.getPoiType(), new PoiWrapper(EventTypeEnumNew.FOURS_ROAD_WORK.getPoiType(),
R.drawable.module_common_icon_map_marker_road_work2, R.drawable.module_common_icon_map_marker_road_work2_white, "施工"));
poiWrapper.put(EventTypeEnumNew.AI_ROAD_WORK.getPoiType(), new PoiWrapper(EventTypeEnumNew.AI_ROAD_WORK.getPoiType(),
poiWrapper.put(EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType(), new PoiWrapper(EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType(),
R.drawable.module_common_icon_map_marker_road_work2, R.drawable.module_common_icon_map_marker_road_work2_white, "施工"));
poiWrapper.put(EventTypeEnumNew.FOURS_BLOCK_UP.getPoiType(), new PoiWrapper(EventTypeEnumNew.FOURS_BLOCK_UP.getPoiType(),
R.drawable.module_common_icon_map_marker_road_block_up2, R.drawable.module_common_icon_map_marker_road_block_up2_white, "拥堵"));

View File

@@ -33,12 +33,6 @@ enum class EventTypeEnumNew(
"注意施工占道", "注意施工占道"
),
//施工-AI云下发
AI_ROAD_WORK(
"100061", "道路施工", "前方施工", R.drawable.icon_warning_v2x_road_construction,
"前方施工", "道路施工"
),
//拥堵
FOURS_BLOCK_UP(
"10007", "道路拥堵", "前方拥堵", R.drawable.icon_warning_v2x_congestion,
@@ -324,7 +318,7 @@ enum class EventTypeEnumNew(
//------------道路危险情况预警 obu end ----------->
//------------车内标牌 obu start -------------->
TYPE_ID_SHAPR_TURNS(
TYPE_ID_SHAPR_TURNS( //TODO
2.toString(),
"急转弯",
poiTypeSrcVr = R.drawable.icon_warning_v2x_turn_left_sharp,
@@ -466,6 +460,38 @@ enum class EventTypeEnumNew(
),
//------------车内标牌 obu end -------------->
TYPE_SOCKET_ROAD_CONGESTION(
"10007",
"道路拥堵",
poiTypeSrcVr = R.drawable.v2x_icon_yongdu_vr,
content = "前方%s米交通拥堵",
tts = "前方%s米交通拥堵"
),
TYPE_SOCKET_ROAD_JINGZHI(
"10025",
"前方%s米静止障碍物占道",
poiTypeSrcVr = R.drawable.v2x_icon_jingzhi_zhangai,
content = "前方%s米静止障碍物占道",
tts = "前方%s米静止障碍物占道"
),
TYPE_SOCKET_ROAD_SHIGU(
"10013",
"前方%s米道路事故",
poiTypeSrcVr = R.drawable.v2x_icon_shigu_sanjiaopai,
content = "前方%s米道路事故",
tts = "前方%s米道路事故"
),
TYPE_SOCKET_ROAD_SHIGONG(
"100061",
"前方%s米道路施工",
poiTypeSrcVr = R.drawable.v2x_icon_shigong_zhandao,
content = "前方%s米道路施工",
tts = "前方%s米道路施工"
),
TYPE_ERROR(
0.toString(),
"未知/错误/异常",
@@ -474,9 +500,9 @@ enum class EventTypeEnumNew(
tts = ""
),
TYPE_VIP_IDENTIFICATION_PASS("10022", "", "", R.drawable.icon_warning_v2x_vip_turn_light, "VIP车辆优先通行已为您变为绿灯", "VIP车辆优先通行已为您变为绿灯"),
TYPE_VIP_IDENTIFICATION_EXTEND("10023", "", "", R.drawable.icon_warning_v2x_vip_turn_light, "VIP车辆优先通行已为您延长绿灯", "VIP车辆优先通行已为您延长绿灯"),
TYPE_VIP_ERROR_IDENTIFICATION("10024", "", "", R.drawable.icon_warning_v2x_vip_turn_light, "请求失败,", "请求失败,稍后重试"),
TYPE_VIP_IDENTIFICATION_PASS("20022", "", "", R.drawable.icon_warning_v2x_vip_turn_light, "VIP车辆优先通行已为您变为绿灯", "VIP车辆优先通行已为您变为绿灯"),
TYPE_VIP_IDENTIFICATION_EXTEND("20023", "", "", R.drawable.icon_warning_v2x_vip_turn_light, "VIP车辆优先通行已为您延长绿灯", "VIP车辆优先通行已为您延长绿灯"),
TYPE_VIP_ERROR_IDENTIFICATION("20024", "", "", R.drawable.icon_warning_v2x_vip_turn_light, "请求失败,", "请求失败,稍后重试"),
TYPE_OPTIMAL_ROUTE_RECOMMEND("2000", "", "", R.drawable.icon_warning_v2x_optimal_route, "为您推荐最优路线", "已为您选择最优路线");
@@ -492,7 +518,6 @@ enum class EventTypeEnumNew(
TRAFFIC_CHECK.poiType -> TRAFFIC_CHECK.poiTypeStr
ROAD_CLOSED.poiType -> ROAD_CLOSED.poiTypeStr
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.poiTypeStr
AI_ROAD_WORK.poiType -> AI_ROAD_WORK.poiTypeStr
FOURS_BLOCK_UP.poiType -> FOURS_BLOCK_UP.poiTypeStr
FOURS_PONDING.poiType -> FOURS_PONDING.poiTypeStr
FOURS_FOG.poiType -> FOURS_FOG.poiTypeStr
@@ -514,7 +539,6 @@ enum class EventTypeEnumNew(
TRAFFIC_CHECK.poiType -> TRAFFIC_CHECK.poiTypeStrVr
ROAD_CLOSED.poiType -> ROAD_CLOSED.poiTypeStrVr
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.poiTypeStrVr
AI_ROAD_WORK.poiType -> AI_ROAD_WORK.poiTypeStrVr
FOURS_BLOCK_UP.poiType -> FOURS_BLOCK_UP.poiTypeStrVr
FOURS_PONDING.poiType -> FOURS_PONDING.poiTypeStrVr
FOURS_FOG.poiType -> FOURS_FOG.poiTypeStrVr
@@ -536,7 +560,6 @@ enum class EventTypeEnumNew(
TRAFFIC_CHECK.poiType -> TRAFFIC_CHECK.poiTypeSrcVr
ROAD_CLOSED.poiType -> ROAD_CLOSED.poiTypeSrcVr
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.poiTypeSrcVr
AI_ROAD_WORK.poiType -> AI_ROAD_WORK.poiTypeSrcVr
FOURS_BLOCK_UP.poiType -> FOURS_BLOCK_UP.poiTypeSrcVr
FOURS_PONDING.poiType -> FOURS_PONDING.poiTypeSrcVr
FOURS_FOG.poiType -> FOURS_FOG.poiTypeSrcVr
@@ -558,7 +581,7 @@ enum class EventTypeEnumNew(
fun getPoiTypeBg(poiType: String, isVrMode: Boolean): Int {
return when (poiType) {
FOURS_BLOCK_UP.poiType, FOURS_LIVING.poiType-> if (isVrMode) R.drawable.bg_v2x_event_type_orange_vr else R.drawable.bg_v2x_event_type_orange
TRAFFIC_CHECK.poiType, ROAD_CLOSED.poiType, FOURS_ROAD_WORK.poiType, AI_ROAD_WORK.poiType,
TRAFFIC_CHECK.poiType, ROAD_CLOSED.poiType, FOURS_ROAD_WORK.poiType,
FOURS_PONDING.poiType, FOURS_FOG.poiType, FOURS_ICE.poiType, FOURS_ACCIDENT.poiType,
FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType, FOURS_ACCIDENT_03.poiType,
FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> if (isVrMode) R.drawable.bg_v2x_event_type_red_vr else R.drawable.bg_v2x_event_type_read
@@ -574,7 +597,7 @@ enum class EventTypeEnumNew(
FOURS_BLOCK_UP.poiType, FOURS_LIVING.poiType ->
R.drawable.bg_v2x_event_type_orange
TRAFFIC_CHECK.poiType, ROAD_CLOSED.poiType,
FOURS_ROAD_WORK.poiType, AI_ROAD_WORK.poiType, FOURS_PONDING.poiType,
FOURS_ROAD_WORK.poiType, FOURS_PONDING.poiType,
FOURS_FOG.poiType, FOURS_ICE.poiType,
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType,
FOURS_ACCIDENT_02.poiType, FOURS_ACCIDENT_03.poiType,
@@ -591,65 +614,40 @@ enum class EventTypeEnumNew(
fun isRoadEvent(poiType: String?): Boolean {
return when (poiType) {
TRAFFIC_CHECK.poiType, ROAD_CLOSED.poiType,
FOURS_ROAD_WORK.poiType, AI_ROAD_WORK.poiType, FOURS_BLOCK_UP.poiType,
FOURS_ROAD_WORK.poiType, FOURS_BLOCK_UP.poiType,
FOURS_PONDING.poiType, FOURS_FOG.poiType,
FOURS_ICE.poiType, FOURS_ACCIDENT.poiType,
FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType,
FOURS_ACCIDENT_05.poiType, GHOST_PROBE.poiType, AI_ROAD_WORK.poiType -> true
FOURS_ACCIDENT_05.poiType, GHOST_PROBE.poiType,
TYPE_SOCKET_ROAD_SHIGONG.poiType,
TYPE_SOCKET_ROAD_JINGZHI.poiType,
TYPE_SOCKET_ROAD_SHIGU.poiType,
TYPE_SOCKET_ROAD_CONGESTION.poiType -> true
else -> false
}
}
/**
* 是否需要UGC预警
*/
@JvmStatic
fun isNeedRoadEventUgc(poiType: String?): Boolean {
return when (poiType) {
ROAD_CLOSED.poiType, FOURS_ROAD_WORK.poiType, AI_ROAD_WORK.poiType,
FOURS_BLOCK_UP.poiType, FOURS_ACCIDENT.poiType,
FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType,
FOURS_ACCIDENT_05.poiType, GHOST_PROBE.poiType -> true
else -> false
}
}
@JvmStatic
fun getTts(poiType: String?): String {
return when (poiType) {
TRAFFIC_CHECK.poiType -> TRAFFIC_CHECK.tts
ROAD_CLOSED.poiType -> ROAD_CLOSED.tts
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.tts
AI_ROAD_WORK.poiType -> AI_ROAD_WORK.tts
FOURS_BLOCK_UP.poiType -> FOURS_BLOCK_UP.tts
FOURS_PONDING.poiType -> FOURS_PONDING.tts
FOURS_FOG.poiType -> FOURS_FOG.tts
FOURS_ICE.poiType -> FOURS_ICE.tts
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> FOURS_ACCIDENT.tts
TYPE_SOCKET_ROAD_SHIGONG.poiType -> TYPE_SOCKET_ROAD_SHIGONG.tts
TYPE_SOCKET_ROAD_JINGZHI.poiType -> TYPE_SOCKET_ROAD_JINGZHI.tts
TYPE_SOCKET_ROAD_SHIGU.poiType -> TYPE_SOCKET_ROAD_SHIGU.tts
TYPE_SOCKET_ROAD_CONGESTION.poiType -> TYPE_SOCKET_ROAD_CONGESTION.tts
else -> "道路事件"
}
}
@JvmStatic
fun getTtsWithFeedback(poiType: String?): String {
return when (poiType) {
TRAFFIC_CHECK.poiType -> "交通检查"
ROAD_CLOSED.poiType -> "封路"
FOURS_ROAD_WORK.poiType -> "施工"
AI_ROAD_WORK.poiType -> "施工"
FOURS_BLOCK_UP.poiType -> "道路拥堵"
FOURS_PONDING.poiType -> "道路积水"
FOURS_FOG.poiType -> "出现浓雾"
FOURS_ICE.poiType -> "路面结冰"
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> "交通事故"
else -> "道路事件"
}
}
@JvmStatic
fun getAlarmContent(poiType: String?): String {
@@ -657,7 +655,6 @@ enum class EventTypeEnumNew(
TRAFFIC_CHECK.poiType -> TRAFFIC_CHECK.content
ROAD_CLOSED.poiType -> ROAD_CLOSED.content
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.content
AI_ROAD_WORK.poiType -> AI_ROAD_WORK.content
FOURS_BLOCK_UP.poiType -> FOURS_BLOCK_UP.content
FOURS_PONDING.poiType -> FOURS_PONDING.content
FOURS_FOG.poiType -> FOURS_FOG.content
@@ -666,63 +663,14 @@ enum class EventTypeEnumNew(
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType ->
FOURS_ACCIDENT.content
GHOST_PROBE.poiType -> GHOST_PROBE.content
TYPE_SOCKET_ROAD_SHIGONG.poiType -> TYPE_SOCKET_ROAD_SHIGONG.content
TYPE_SOCKET_ROAD_JINGZHI.poiType -> TYPE_SOCKET_ROAD_JINGZHI.content
TYPE_SOCKET_ROAD_SHIGU.poiType -> TYPE_SOCKET_ROAD_SHIGU.content
TYPE_SOCKET_ROAD_CONGESTION.poiType -> TYPE_SOCKET_ROAD_CONGESTION.content
else -> "道路事件"
}
}
@JvmStatic
fun getTypeSmallRes(type: String): Int {
return when (type) {
TRAFFIC_CHECK.poiType ->
R.drawable.mogo_image_jiaotongjiancha_small
ROAD_CLOSED.poiType -> R.drawable.mogo_image_fenglu_small
FOURS_ROAD_WORK.poiType -> R.drawable.mogo_image_daolushigong_small
AI_ROAD_WORK.poiType -> R.drawable.mogo_image_daolushigong_small
FOURS_BLOCK_UP.poiType -> R.drawable.mogo_image_yongdu_small
FOURS_PONDING.poiType -> R.drawable.mogo_image_jishui_small
FOURS_ICE.poiType -> R.drawable.mogo_image_jiebing_small
FOURS_FOG.poiType -> R.drawable.mogo_image_nongwu_small
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType ->
R.drawable.mogo_image_accident_small
else -> R.drawable.mogo_image_shishilukuang_small
}
}
@JvmStatic
fun getTypeRes(type: String): Int {
return when (type) {
TRAFFIC_CHECK.poiType -> R.drawable.mogo_image_jiaotongjiancha_nor
ROAD_CLOSED.poiType -> R.drawable.mogo_image_fenglu_nor
FOURS_ROAD_WORK.poiType -> R.drawable.mogo_image_daolushigong_nor
AI_ROAD_WORK.poiType -> R.drawable.mogo_image_daolushigong_nor
FOURS_BLOCK_UP.poiType -> R.drawable.mogo_image_yongdu_nor
FOURS_PONDING.poiType -> R.drawable.mogo_image_jishui_nor
FOURS_ICE.poiType -> R.drawable.mogo_image_jiebing_nor
FOURS_FOG.poiType -> R.drawable.mogo_image_nongwu_nor
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType ->
R.drawable.mogo_image_jiaotongshigu_nor
else -> R.drawable.mogo_image_shishlukuang_nor
}
}
@JvmStatic
fun getTypeName(type: String?): String {
return when (type) {
ROAD_CLOSED.poiType -> "封路"
FOURS_ICE.poiType -> "道路结冰"
FOURS_FOG.poiType -> "浓雾"
TRAFFIC_CHECK.poiType -> "交通检查"
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> "交通事故"
FOURS_BLOCK_UP.poiType -> "拥堵"
FOURS_ROAD_WORK.poiType -> "施工"
AI_ROAD_WORK.poiType -> "施工"
FOURS_PONDING.poiType -> "道路积水"
else -> "实时路况"
}
}
@JvmStatic
fun getMarker3DRes(poiType: String?): Int {
@@ -733,31 +681,17 @@ enum class EventTypeEnumNew(
FOURS_FOG.poiType -> R.raw.v2x_nongwu
TRAFFIC_CHECK.poiType -> R.raw.v2x_jiaotongjiancha
FOURS_ROAD_WORK.poiType -> R.raw.v2x_daolushigong
AI_ROAD_WORK.poiType -> R.raw.v2x_daolushigong
FOURS_ICE.poiType -> R.raw.v2x_daolujiebing
FOURS_PONDING.poiType -> R.raw.v2x_daolujishui
GHOST_PROBE.poiType -> R.raw.v2x_guzhangqiuzhu
TYPE_SOCKET_ROAD_SHIGONG.poiType -> R.raw.v2x_shigong_warning
TYPE_SOCKET_ROAD_JINGZHI.poiType -> R.raw.v2x_zhangai
TYPE_SOCKET_ROAD_SHIGU.poiType -> R.raw.v2x_shigu_sanjiaopai
TYPE_SOCKET_ROAD_CONGESTION.poiType -> R.raw.v2x_yongdu
else -> 0
}
}
@JvmStatic
fun getTypeNameTTS(type: String?): String {
return when (type) {
ROAD_CLOSED.poiType -> "封路"
FOURS_ICE.poiType -> "道路结冰"
FOURS_FOG.poiType -> "浓雾"
TRAFFIC_CHECK.poiType -> "交通检查"
FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType,
FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> "交通事故"
FOURS_BLOCK_UP.poiType -> "拥堵"
FOURS_ROAD_WORK.poiType -> "施工"
AI_ROAD_WORK.poiType -> "施工"
FOURS_PONDING.poiType -> "道路积水"
else -> "实时路况"
}
}
@JvmStatic
fun getUpdateIconRes(poiType: String?): Int {
return when (poiType) {
@@ -773,10 +707,10 @@ enum class EventTypeEnumNew(
FOURS_ROAD_WORK.poiType -> {
R.drawable.icon_warning_v2x_road_construction
}
//AI施工
AI_ROAD_WORK.poiType -> {
R.drawable.icon_warning_v2x_road_construction
}
TYPE_SOCKET_ROAD_SHIGONG.poiType -> R.drawable.icon_warning_v2x_road_construction
TYPE_SOCKET_ROAD_JINGZHI.poiType -> R.drawable.v2x_icon_jingzhi_zhangai
TYPE_SOCKET_ROAD_SHIGU.poiType -> R.drawable.v2x_icon_shigu_sanjiaopai
TYPE_SOCKET_ROAD_CONGESTION.poiType -> R.drawable.v2x_icon_yongdu_vr
//拥堵
FOURS_BLOCK_UP.poiType -> {
R.drawable.icon_warning_v2x_congestion
@@ -939,7 +873,10 @@ enum class EventTypeEnumNew(
TYPE_ERROR.poiType -> TYPE_ERROR.poiTypeSrcVr
TYPE_OPTIMAL_ROUTE_RECOMMEND.poiType -> TYPE_OPTIMAL_ROUTE_RECOMMEND.poiTypeSrcVr
GHOST_PROBE.poiType -> GHOST_PROBE.poiTypeSrcVr
AI_ROAD_WORK.poiType -> AI_ROAD_WORK.poiTypeSrcVr
TYPE_SOCKET_ROAD_SHIGONG.poiType -> TYPE_SOCKET_ROAD_SHIGONG.poiTypeSrcVr
TYPE_SOCKET_ROAD_JINGZHI.poiType -> TYPE_SOCKET_ROAD_JINGZHI.poiTypeSrcVr
TYPE_SOCKET_ROAD_SHIGU.poiType -> TYPE_SOCKET_ROAD_SHIGU.poiTypeSrcVr
TYPE_SOCKET_ROAD_CONGESTION.poiType -> TYPE_SOCKET_ROAD_CONGESTION.poiTypeSrcVr
TYPE_USECASE_ID_IVP_RED.poiType -> TYPE_USECASE_ID_IVP_RED.poiTypeSrcVr
TYPE_USECASE_ID_IVP_GREEN.poiType -> TYPE_USECASE_ID_IVP_GREEN.poiTypeSrcVr
@@ -999,7 +936,10 @@ enum class EventTypeEnumNew(
TYPE_VIP_IDENTIFICATION_PASS.poiType -> TYPE_VIP_IDENTIFICATION_PASS.content
TYPE_VIP_IDENTIFICATION_EXTEND.poiType -> TYPE_VIP_IDENTIFICATION_EXTEND.content
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.content
AI_ROAD_WORK.poiType -> AI_ROAD_WORK.content
TYPE_SOCKET_ROAD_SHIGONG.poiType -> TYPE_SOCKET_ROAD_SHIGONG.content
TYPE_SOCKET_ROAD_JINGZHI.poiType -> TYPE_SOCKET_ROAD_JINGZHI.content
TYPE_SOCKET_ROAD_SHIGU.poiType -> TYPE_SOCKET_ROAD_SHIGU.content
TYPE_SOCKET_ROAD_CONGESTION.poiType -> TYPE_SOCKET_ROAD_CONGESTION.content
TYPE_ERROR.poiType -> TYPE_ERROR.content
TYPE_OPTIMAL_ROUTE_RECOMMEND.poiType -> TYPE_OPTIMAL_ROUTE_RECOMMEND.content
GHOST_PROBE.poiType -> GHOST_PROBE.content
@@ -1063,7 +1003,10 @@ enum class EventTypeEnumNew(
TYPE_VIP_IDENTIFICATION_PASS.poiType -> TYPE_VIP_IDENTIFICATION_PASS.tts
TYPE_VIP_IDENTIFICATION_EXTEND.poiType -> TYPE_VIP_IDENTIFICATION_EXTEND.tts
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.tts
AI_ROAD_WORK.poiType -> AI_ROAD_WORK.tts
TYPE_SOCKET_ROAD_SHIGONG.poiType -> TYPE_SOCKET_ROAD_SHIGONG.tts
TYPE_SOCKET_ROAD_JINGZHI.poiType -> TYPE_SOCKET_ROAD_JINGZHI.tts
TYPE_SOCKET_ROAD_SHIGU.poiType -> TYPE_SOCKET_ROAD_SHIGU.tts
TYPE_SOCKET_ROAD_CONGESTION.poiType -> TYPE_SOCKET_ROAD_CONGESTION.tts
TYPE_ERROR.poiType -> TYPE_ERROR.tts
TYPE_OPTIMAL_ROUTE_RECOMMEND.poiType -> TYPE_OPTIMAL_ROUTE_RECOMMEND.tts
GHOST_PROBE.poiType -> GHOST_PROBE.tts
@@ -1110,6 +1053,16 @@ enum class EventTypeEnumNew(
else -> TYPE_ERROR.tts
}
}
}
@JvmStatic
fun isCloudSocketEvent(poiType: String?): Boolean {
return when(poiType) {
TYPE_SOCKET_ROAD_SHIGONG.poiType,
TYPE_SOCKET_ROAD_JINGZHI.poiType,
TYPE_SOCKET_ROAD_SHIGU.poiType,
TYPE_SOCKET_ROAD_CONGESTION.poiType -> true
else -> false
}
}
}
}

View File

@@ -71,16 +71,6 @@ public class V2XRoadEventEntity implements Serializable {
return tts;
}
/**
* 检测到附近#道路施工#,确认该信息是否正确?您可以说“正确”或“错误”帮助其他车友。
*/
public String getTtsWithFeedback() {
tts = "检测到附近";
tts += EventTypeEnumNew.getTtsWithFeedback(getPoiType());
tts += ",确认该信息是否正确?您可以说“正确”或“错误”帮助其他车友。";
return tts;
}
public String getTts() {
return tts;
}

View File

@@ -1,5 +1,9 @@
package com.mogo.eagle.core.data.msgbox
enum class DataSourceType {
DEFAULT, OBU, TELEMATIC, AICLOUD
DEFAULT,
OBU,
TELEMATIC,
AICLOUD,
SUMMARY// V2X事件汇总
}

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

@@ -14,5 +14,5 @@ abstract class IViewLimitingVelocity(context: Context?, attrs: AttributeSet?, de
* 更新限速数据
* @param limitingSpeed 限速值单位km/h
*/
open fun updateLimitingSpeed(limitingSpeed: Int) {}
open fun updateLimitingSpeed(limitingSpeed: Int, limitSource: Int) {}
}

View File

@@ -159,8 +159,9 @@ interface IMoGoWaringProvider : IMoGoHmiViewProxy {
* 展示限速预警
*
* @param limitingSpeed 限速速度
* @param limitSpeedSource 限速来源 1:MAP, 2:RSU
*/
fun showLimitingVelocity(limitingSpeed: Int)
fun showLimitingVelocity(limitingSpeed: Int, limitSpeedSource: Int)
/**
* 关闭限速预警

View File

@@ -7,5 +7,4 @@ interface IMoGoIdentifyListener :IProvider{
fun getIdentifyObj(uuid: String): MessagePad.TrackedObject?
fun clearAiCloudRoma()
}

View File

@@ -0,0 +1,7 @@
package com.mogo.eagle.core.function.api.v2x
import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider
interface IV2XEventProvider: IMoGoFunctionServerProvider {
fun queryWholeRoadEvents()
}

View File

@@ -0,0 +1,8 @@
package com.mogo.eagle.core.function.api.v2x
/**
* 限速信息
*/
interface ObuLimitingSpeedListener {
fun onObuLimitingSpeedChange(limitingSpeed: Int)
}

View File

@@ -196,6 +196,7 @@ object CallerHmiManager : CallerBase() {
* 关闭红绿灯预警
*/
fun disableWarningTrafficLight() {
Log.d("liyz", "disableWarningTrafficLight --------------------> ")
waringProviderApi?.disableWarningTrafficLight()
}
@@ -247,10 +248,12 @@ object CallerHmiManager : CallerBase() {
* 展示限速预警
*
* @param limitingSpeed 限速速度
* @param limitSpeedSource 限速来源 1:MAP, 2:RSU
*/
@BizConfig(V2I, "", BIZ_SLW)
fun showLimitingVelocity(limitingSpeed: Int) {
waringProviderApi?.showLimitingVelocity(limitingSpeed)
fun showLimitingVelocity(limitingSpeed: Int, limitSpeedSource: Int) {
Log.e("liyz", "showLimitingVelocity limitingSpeed = $limitingSpeed ---limitSpeedSource = $limitSpeedSource")
waringProviderApi?.showLimitingVelocity(limitingSpeed, limitSpeedSource)
}
/**

View File

@@ -16,7 +16,4 @@ object CallerMapIdentifyManager : CallerBase() {
return identifyApi.getIdentifyObj(uuid)
}
fun clearAiCloudRoma(){
identifyApi.clearAiCloudRoma()
}
}

View File

@@ -3,8 +3,10 @@ package com.mogo.eagle.core.function.call.map
import android.os.Looper
import com.alibaba.android.arouter.launcher.ARouter
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.data.map.MogoLatLng
import com.mogo.eagle.core.function.api.map.smp.IMogoSmallMapProvider
import com.mogo.eagle.core.function.api.v2x.IV2XEventProvider
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
@@ -22,6 +24,10 @@ object CallerSmpManager : CallerBase() {
get() = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_OVERVIEW)
.navigation() as IMogoSmallMapProvider
private val v2xProvider: IV2XEventProvider
get() = ARouter.getInstance().build(MogoServicePaths.PATH_V2X_MODULE)
.navigation() as IV2XEventProvider
/**
* 绘制路径线
*/
@@ -58,9 +64,11 @@ object CallerSmpManager : CallerBase() {
fun startQueryV2XEvents() {
if (Thread.currentThread() !== Looper.getMainLooper().thread) {
UiThreadHandler.post {
v2xProvider.queryWholeRoadEvents()
mogoOverViewMapProvider.startQueryV2XEvents()
}
} else {
v2xProvider.queryWholeRoadEvents()
mogoOverViewMapProvider.startQueryV2XEvents()
}
}

View File

@@ -242,11 +242,20 @@ object CallerVisualAngleManager {
PriorityQueue<Record>()
}
private var mLevel:Boolean = false
fun updateLongSightLevel(level:Boolean){
mLevel = level
}
fun changeVisualAngle(current: Scene) {
val appIdentityMode = FunctionBuildConfig.appIdentityMode
if (AppIdentityModeUtils.isBus(appIdentityMode) && AppIdentityModeUtils.isPassenger(appIdentityMode)) {
return
}
if(mLevel){
return
}
val triggerTime = SystemClock.elapsedRealtime()
scope.launch {
Log.d("${M_DEVA}${TAG}", "--- 1 ---")

View File

@@ -0,0 +1,74 @@
package com.mogo.eagle.core.function.call.v2x
import androidx.annotation.Nullable
import com.mogo.eagle.core.function.api.v2x.LimitingVelocityListener
import com.mogo.eagle.core.function.api.v2x.ObuLimitingSpeedListener
import com.mogo.eagle.core.utilcode.util.LogUtils
import java.util.concurrent.ConcurrentHashMap
/**
* 限速信息监听
*/
object CallObuLimitingSpeedListenerManager {
private const val TAG = "CallObuLimitingSpeedListenerManager"
private val M_TRAFFIC_LIGHT_LISTENER: ConcurrentHashMap<String, ObuLimitingSpeedListener> =
ConcurrentHashMap()
private var mObuLimitSpeed = 0
/**
* 添加监听
* @param tag 标记,用来注销监听使用
* @param listener 监听回调
*/
fun addListener(
@Nullable tag: String,
@Nullable listener: ObuLimitingSpeedListener
) {
if (M_TRAFFIC_LIGHT_LISTENER.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
return
}
listener.onObuLimitingSpeedChange(mObuLimitSpeed)
M_TRAFFIC_LIGHT_LISTENER[tag] = listener
}
/**
* 删除监听
* @param tag 标记,用来注销监听使用
*/
fun removeListener(@Nullable tag: String) {
if (!M_TRAFFIC_LIGHT_LISTENER.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag not exists")
return
}
M_TRAFFIC_LIGHT_LISTENER.remove(tag)
}
/**
* 删除监听
* @param listener 要删除的监听对象
*/
fun removeListener(@Nullable listener: ObuLimitingSpeedListener) {
if (!M_TRAFFIC_LIGHT_LISTENER.containsValue(listener)) {
LogUtils.eTag(TAG, "listener:$listener not exists")
return
}
M_TRAFFIC_LIGHT_LISTENER.forEach {
if (it.value == listener) {
M_TRAFFIC_LIGHT_LISTENER.remove(it.key)
}
}
}
fun invokeOnObuLimitingSpeedChange(limitingSpeed: Int) {
this.mObuLimitSpeed = limitingSpeed
M_TRAFFIC_LIGHT_LISTENER.forEach {
val tag = it.key
val listener = it.value
listener.onObuLimitingSpeedChange(limitingSpeed)
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

View File

@@ -1129,7 +1129,7 @@ public class AMapViewWrapper implements IMogoMapView,
@Override
public void setLockMode(boolean isLock) {
if (checkAMapView()) {
mMapView.getMapAutoViewHelper().setLockMode(true);
mMapView.getMapAutoViewHelper().setLockMode(isLock);
}
}

View File

@@ -122,14 +122,10 @@ public class AMapWrapper implements IMogoMap {
markerOptionsArrayList.add(markerOptions);
}
});
// markerOptionsArrayList.addAll(cwList);
long time = markerOptionsArrayList.get(0).getTime();
MarkerHelper.INSTANCE.updateBatchMarkerPositon(markerOptionsArrayList, false, FunctionBuildConfig.isBeautyMode ? 8.0f : 0f, 1, time, 0);
// cwList.clear();
}
// private final CopyOnWriteArrayList<MarkerSimpleData> cwList = new CopyOnWriteArrayList<>();
@SuppressLint("NewApi")
@Override
public void updateBatchAiMarkerPosition(HashMap<String, SocketDownData.CloudRoadDataProto> optionsArrayList) {
@@ -143,7 +139,6 @@ public class AMapWrapper implements IMogoMap {
markerOptionsArrayList.add(markerOptions);
}
});
// cwList.addAll(markerOptionsArrayList);
long time = markerOptionsArrayList.get(0).getTime();
//todo 最后一个参数,是否管理锚点的删除
MarkerHelper.INSTANCE.updateBatchMarkerPositon(markerOptionsArrayList, false, FunctionBuildConfig.isBeautyMode ? 8.0f : 0f, 1, time, 0);

View File

@@ -156,7 +156,7 @@ public class ObjectUtils {
markerOptions.setLat(aiData.getWgslat());
markerOptions.setLon(aiData.getWgslon());
markerOptions.setTime(Double.valueOf(aiData.getSatelliteTime()).longValue());
markerOptions.setColor("#00000000");
markerOptions.setColor("#00ffd8FF");
} catch (Exception e) {
e.printStackTrace();
}