Merge branch 'dev_arch_opt_3.0' into dev_robosweeper-d_app-module_221230_1.1.0
# Conflicts: # OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperLimitingVelocityView.kt # OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficDataView.java # OCH/mogo-och-sweeper/src/main/res/layout/sweeper_base_fragment.xml
This commit is contained in:
@@ -53,20 +53,10 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.amapnavi3dmap
|
||||
implementation project(":OCH:mogo-och-common-module")
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogoutils
|
||||
implementation rootProject.ext.dependencies.mogocommons
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_call
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_v2x
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_hmi
|
||||
}else {
|
||||
implementation project(':foudations:mogo-aicloud-services-sdk')
|
||||
implementation project(":foudations:mogo-commons")
|
||||
implementation project(':core:mogo-core-data')
|
||||
implementation project(":core:mogo-core-utils")
|
||||
implementation project(':core:mogo-core-function-call')
|
||||
implementation project(':core:function-impl:mogo-core-function-v2x')
|
||||
implementation project(':core:function-impl:mogo-core-function-hmi')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,15 +26,14 @@
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<!--Vip车辆标志-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
|
||||
android:layout_width="@dimen/module_vip_width"
|
||||
android:layout_height="@dimen/module_vip_height"
|
||||
android:visibility="gone"
|
||||
app:marginStart="@dimen/dp_640"
|
||||
app:marginTop="@dimen/dp_80"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
<!--pnc行为决策-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.pnc.PncActionsView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_110"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<com.mogo.och.common.module.wigets.OCHBorderShadowLayout
|
||||
android:id="@+id/arrive_station_shadow"
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
package com.mogo.och.bus.passenger;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
||||
//package com.mogo.och.bus.passenger;
|
||||
//
|
||||
//import org.junit.Test;
|
||||
//
|
||||
//import static org.junit.Assert.*;
|
||||
//
|
||||
///**
|
||||
// * Example local unit test, which will execute on the development machine (host).
|
||||
// *
|
||||
// * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
// */
|
||||
//public class ExampleUnitTest {
|
||||
// @Test
|
||||
// public void addition_isCorrect() {
|
||||
// assertEquals(4, 2 + 2);
|
||||
// }
|
||||
//}
|
||||
@@ -56,19 +56,6 @@ dependencies {
|
||||
implementation project(":OCH:mogo-och-common-module")
|
||||
|
||||
implementation rootProject.ext.dependencies.androidxrecyclerview
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogoutils
|
||||
implementation rootProject.ext.dependencies.mogocommons
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_call
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_hmi
|
||||
}else {
|
||||
implementation project(":core:mogo-core-utils")
|
||||
implementation project(":foudations:mogo-commons")
|
||||
implementation project(':core:mogo-core-data')
|
||||
implementation project(':core:mogo-core-function-call')
|
||||
implementation project(':core:function-impl:mogo-core-function-hmi')
|
||||
}
|
||||
}
|
||||
|
||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||
@@ -29,8 +29,26 @@
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:marginStart="@dimen/dp_640"
|
||||
app:marginTop="@dimen/dp_80" />
|
||||
android:layout_marginStart="@dimen/dp_640"
|
||||
android:layout_marginTop="@dimen/dp_80"/>
|
||||
|
||||
<!--pnc行为决策-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.pnc.PncActionsView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_110"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<!--APP、MAP版本-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.VersionNameView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="45dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<!--超视距-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.CameraView
|
||||
@@ -38,11 +56,27 @@
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginTop="45dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
app:layout_constraintRight_toLeftOf="@id/viewTrafficLightVr"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="SpeakableTextPresentCheck"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<!--限速牌子-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.LimitingVelocityView
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:gravity="center"
|
||||
android:text="60"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="60dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<!--红绿灯-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.SingleTrafficLightView
|
||||
android:id="@+id/viewTrafficLightVr"
|
||||
@@ -50,9 +84,30 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/hmi_traffic_light_layout_margin_top"
|
||||
android:layout_marginEnd="@dimen/hmi_traffic_light_layout_margin_right"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--接管提示-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.takeover.TakeOverView
|
||||
android:layout_width="@dimen/hmi_take_over_request_width"
|
||||
android:layout_height="@dimen/hmi_take_over_request_height"
|
||||
android:layout_marginTop="@dimen/hmi_take_over_request_m_top"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--隐藏态下的 美化模式按钮-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.switch.DemoModeHiddenSwitch
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_marginStart="40dp"
|
||||
android:layout_marginBottom="200dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:ignore="SpeakableTextPresentCheck" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/module_mogo_och_autopilot_status"
|
||||
android:layout_width="@dimen/module_mogo_och_autopilot_status_bg_width"
|
||||
@@ -271,6 +326,7 @@
|
||||
android:textSize="@dimen/dp_60"
|
||||
app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable"
|
||||
app:layout_constraintTop_toBottomOf="@id/btnAutopilotRunning" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAutopilotRoute"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -279,7 +335,8 @@
|
||||
android:text="上传全路径"
|
||||
android:textSize="@dimen/dp_60"
|
||||
app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable"
|
||||
app:layout_constraintTop_toBottomOf="@id/btnAutopilotArrive" />
|
||||
app:layout_constraintTop_toBottomOf="@id/btnAutopilotArrive"
|
||||
tools:ignore="TextContrastCheck" />
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/groupTestPanel"
|
||||
|
||||
@@ -58,19 +58,19 @@ dependencies {
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogoutils
|
||||
implementation rootProject.ext.dependencies.mogocommons
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_call
|
||||
api rootProject.ext.dependencies.mogoutils
|
||||
api rootProject.ext.dependencies.mogocommons
|
||||
api rootProject.ext.dependencies.mogo_core_data
|
||||
api rootProject.ext.dependencies.mogo_core_function_call
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_v2x
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_hmi
|
||||
api rootProject.ext.dependencies.mogo_core_function_hmi
|
||||
}else {
|
||||
implementation project(":core:mogo-core-utils")
|
||||
implementation project(":foudations:mogo-commons")
|
||||
implementation project(':core:mogo-core-data')
|
||||
implementation project(':core:mogo-core-function-call')
|
||||
api project(":core:mogo-core-utils")
|
||||
api project(":foudations:mogo-commons")
|
||||
api project(':core:mogo-core-data')
|
||||
api project(':core:mogo-core-function-call')
|
||||
implementation project(':core:function-impl:mogo-core-function-v2x')
|
||||
implementation project(':core:function-impl:mogo-core-function-hmi')
|
||||
api project(':core:function-impl:mogo-core-function-hmi')
|
||||
}
|
||||
|
||||
implementation project(':libraries:mogo-adas')
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'com.alibaba.arouter'
|
||||
plugins {
|
||||
id 'com.android.library'
|
||||
id 'kotlin-android'
|
||||
id 'kotlin-android-extensions'
|
||||
id 'kotlin-kapt'
|
||||
id 'com.alibaba.arouter'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
@@ -13,10 +18,11 @@ android {
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles "consumer-rules.pro"
|
||||
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
arguments = [AROUTER_MODULE_NAME: project.getName()]
|
||||
//ARouter apt 参数
|
||||
kapt {
|
||||
useBuildCache = false
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.getName())
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,6 +49,7 @@ dependencies {
|
||||
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
annotationProcessor rootProject.ext.dependencies.aroutercompiler
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogoutils
|
||||
|
||||
@@ -12,5 +12,5 @@ class OCHConstants {
|
||||
/**
|
||||
* arouter 路由地址
|
||||
*/
|
||||
public static final String PATH = "/och/noop/api";
|
||||
public static final String PATH = "/noop/api";
|
||||
}
|
||||
|
||||
@@ -2,14 +2,8 @@ package com.mogo.och.noop
|
||||
|
||||
import android.view.View
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
|
||||
import com.mogo.och.bus.R
|
||||
import kotlinx.android.synthetic.main.fragment_hmi.*
|
||||
import kotlinx.android.synthetic.main.och_noop_fragment_hmi.*
|
||||
|
||||
class OchNoopFragment : MvpFragment<OchNoopContract.View?, OchNoopPresenter?>(),
|
||||
OchNoopContract.View {
|
||||
@@ -31,46 +25,24 @@ class OchNoopFragment : MvpFragment<OchNoopContract.View?, OchNoopPresenter?>(),
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
|
||||
//设置StatusBar初始状态
|
||||
CallerHmiViewControlListenerManager.updateStatusBarRightView(
|
||||
StatusBarView.TAG,
|
||||
FunctionBuildConfig.isDemoMode,
|
||||
"demoMode",
|
||||
DemoModeView(requireContext())
|
||||
)
|
||||
|
||||
viewShowDebugView.setOnLongClickListener {
|
||||
ToggleDebugView.toggleDebugView.toggle(requireContext())
|
||||
true
|
||||
}
|
||||
|
||||
cbMsgBoxDriver.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (isChecked) {
|
||||
viewDriverMsgBoxList.visibility = View.VISIBLE
|
||||
viewDriverMsgBoxList.notifyData()
|
||||
viewDriverMsgBoxBubble.visibility = View.GONE
|
||||
viewDriverMsgBoxBubble.isShowData(false)
|
||||
CallerHmiManager.updateDriverMsgBoxTipView(false)
|
||||
} else {
|
||||
viewDriverMsgBoxList.visibility = View.GONE
|
||||
viewDriverMsgBoxBubble.visibility = View.VISIBLE
|
||||
viewDriverMsgBoxBubble.isShowData(true)
|
||||
}
|
||||
}
|
||||
|
||||
cbMsgBoxPassenger.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (isChecked) {
|
||||
viewPassengerMsgBoxList.visibility = View.VISIBLE
|
||||
viewPassengerMsgBoxBubble.visibility = View.GONE
|
||||
viewPassengerMsgBoxBubble.isShowData(false)
|
||||
CallerHmiManager.updatePassengerMsgBoxTipView(false)
|
||||
} else {
|
||||
viewPassengerMsgBoxList.visibility = View.GONE
|
||||
viewPassengerMsgBoxBubble.visibility = View.VISIBLE
|
||||
viewPassengerMsgBoxBubble.isShowData(true)
|
||||
}
|
||||
}
|
||||
// cbMsgBoxDriver.setOnCheckedChangeListener { _, isChecked ->
|
||||
// if (isChecked) {
|
||||
// viewDriverMsgBoxList.visibility = View.VISIBLE
|
||||
// viewDriverMsgBoxList.notifyData()
|
||||
// viewDriverMsgBoxBubble.visibility = View.GONE
|
||||
// viewDriverMsgBoxBubble.isShowData(false)
|
||||
// MsgBoxTipView.visibility = View.GONE
|
||||
// } else {
|
||||
// viewDriverMsgBoxList.visibility = View.GONE
|
||||
// viewDriverMsgBoxBubble.visibility = View.VISIBLE
|
||||
// viewDriverMsgBoxBubble.isShowData(true)
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -43,13 +43,14 @@
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
|
||||
android:layout_width="@dimen/module_vip_width"
|
||||
android:layout_height="@dimen/module_vip_height"
|
||||
android:layout_marginStart="@dimen/dp_640"
|
||||
android:layout_marginTop="@dimen/dp_80"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--接管提示-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.takeover.TakeOverView
|
||||
android:id="@+id/clTakeOverView"
|
||||
android:layout_width="@dimen/hmi_take_over_request_width"
|
||||
android:layout_height="@dimen/hmi_take_over_request_height"
|
||||
android:layout_marginTop="@dimen/hmi_take_over_request_m_top"
|
||||
@@ -66,8 +67,7 @@
|
||||
android:layout_marginTop="@dimen/module_mogo_autopilot_status_margin_top"
|
||||
android:elevation="@dimen/dp_10"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/viewSpeedChart"
|
||||
app:layout_constraintTop_toBottomOf="@+id/viewSpeedChart"
|
||||
app:layout_goneMarginStart="@dimen/module_mogo_autopilot_status_margin_left" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/viewSpeedChart"/>
|
||||
|
||||
<!--超视距-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.CameraView
|
||||
@@ -80,11 +80,29 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<!--限速牌子-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.LimitingVelocityView
|
||||
android:id="@+id/viewLimitingVelocity"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:gravity="center"
|
||||
android:text="60"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="60dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<!--红绿灯-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.SingleTrafficLightView
|
||||
android:id="@+id/viewTrafficLightVr"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="@dimen/hmi_traffic_light_layout_margin_top"
|
||||
android:layout_marginEnd="@dimen/hmi_traffic_light_layout_margin_right"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
@@ -121,7 +139,8 @@
|
||||
android:elevation="@dimen/dp_10"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/viewPerspectiveSwitch"
|
||||
app:layout_goneMarginStart="50dp" />
|
||||
app:layout_goneMarginStart="50dp"
|
||||
android:contentDescription="工具箱"/>
|
||||
|
||||
<!--问题反馈-->
|
||||
<ImageView
|
||||
@@ -132,7 +151,8 @@
|
||||
android:layout_marginBottom="40dp"
|
||||
android:src="@drawable/bad_case_selector"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/ivToolsView" />
|
||||
app:layout_constraintStart_toEndOf="@id/ivToolsView"
|
||||
android:contentDescription="BadCase"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivAiCollectTools"
|
||||
@@ -142,7 +162,8 @@
|
||||
android:layout_marginBottom="40dp"
|
||||
android:src="@drawable/ai_collect_selector"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/ivBadCaseTools" />
|
||||
app:layout_constraintStart_toEndOf="@id/ivBadCaseTools"
|
||||
android:contentDescription="数据采集" />
|
||||
|
||||
<View
|
||||
android:id="@+id/viewUpgradeTips"
|
||||
@@ -156,26 +177,6 @@
|
||||
app:layout_constraintCircleRadius="60dp"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
<!--限速牌子-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.LimitingVelocityView
|
||||
android:id="@+id/viewLimitingVelocity"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:background="@drawable/bg_waring_limiting_velocity"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:gravity="center"
|
||||
android:text="60"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="60dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"
|
||||
app:layout_goneMarginEnd="40dp"
|
||||
app:layout_goneMarginTop="40dp"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<!--消息盒子司机端选择入口-->
|
||||
<CheckBox
|
||||
android:id="@+id/cbMsgBoxDriver"
|
||||
@@ -202,32 +203,6 @@
|
||||
app:layout_constraintCircleRadius="32dp"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
<!--消息盒子乘客端选择入口-->
|
||||
<CheckBox
|
||||
android:id="@+id/cbMsgBoxPassenger"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_marginStart="320dp"
|
||||
android:layout_marginBottom="50dp"
|
||||
android:background="@drawable/selector_msg_box_p"
|
||||
android:button="@null"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
|
||||
<!--乘客端消息提示-->
|
||||
<View
|
||||
android:id="@+id/MsgBoxPTipView"
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
android:background="@drawable/version_upgrade_tips_background"
|
||||
android:translationZ="30dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintCircle="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintCircleAngle="40"
|
||||
app:layout_constraintCircleRadius="50dp"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView
|
||||
android:id="@+id/viewDriverMsgBoxList"
|
||||
android:layout_width="864px"
|
||||
@@ -235,36 +210,17 @@
|
||||
android:layout_marginEnd="40dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/cbMsgBoxDriver" />
|
||||
app:layout_constraintTop_toBottomOf="@id/cbMsgBoxDriver"
|
||||
tools:visibility="gone"/>
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView
|
||||
android:id="@+id/viewDriverMsgBoxBubble"
|
||||
android:layout_width="864px"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/cbMsgBoxDriver" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxBubbleView
|
||||
android:id="@+id/viewPassengerMsgBoxBubble"
|
||||
android:layout_width="650px"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintLeft_toLeftOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintRight_toRightOf="@id/cbMsgBoxPassenger" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxListView
|
||||
android:id="@+id/viewPassengerMsgBoxList"
|
||||
android:layout_width="650px"
|
||||
android:layout_height="750px"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintLeft_toLeftOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintRight_toRightOf="@id/cbMsgBoxPassenger" />
|
||||
app:layout_constraintTop_toBottomOf="@id/cbMsgBoxDriver"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<!--左右转向灯-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.turnlight.TurnLightViewStatus
|
||||
@@ -303,16 +259,6 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/statusBarContainer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="30dp"
|
||||
app:layout_constraintEnd_toStartOf="@+id/viewLimitingVelocity"
|
||||
app:layout_constraintTop_toTopOf="@+id/viewLimitingVelocity"
|
||||
app:layout_goneMarginEnd="40dp"
|
||||
app:layout_goneMarginTop="30dp" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -55,19 +55,6 @@ dependencies {
|
||||
implementation project(":OCH:mogo-och-common-module")
|
||||
|
||||
implementation rootProject.ext.dependencies.androidxrecyclerview
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogoutils
|
||||
implementation rootProject.ext.dependencies.mogocommons
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_call
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_hmi
|
||||
}else {
|
||||
implementation project(":core:mogo-core-utils")
|
||||
implementation project(":foudations:mogo-commons")
|
||||
implementation project(':core:mogo-core-data')
|
||||
implementation project(':core:mogo-core-function-call')
|
||||
implementation project(':core:function-impl:mogo-core-function-hmi')
|
||||
}
|
||||
}
|
||||
|
||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||
@@ -2,28 +2,55 @@ package com.mogo.och.sweeper.view
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewLimitingVelocity
|
||||
import android.widget.TextView
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.LinearLayout
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.LimitingVelocityView_TAG
|
||||
import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerViewLimitingVelocityListenerManager
|
||||
import com.mogo.och.sweeper.R
|
||||
import kotlinx.android.synthetic.main.sweeper_limiting_speed.view.*
|
||||
|
||||
/**
|
||||
* 限速
|
||||
*/
|
||||
class SweeperLimitingVelocityView(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : IViewLimitingVelocity(context, attrs, defStyleAttr) {
|
||||
private var limitingVelocity: TextView? = null
|
||||
class SweeperLimitingVelocityView(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
) : LinearLayout(context, attrs), ILimitingVelocityListener, IViewControlListener {
|
||||
|
||||
constructor(context: Context?, attrs: AttributeSet?) : this(context, attrs, 0) {
|
||||
initView(context!!)
|
||||
companion object {
|
||||
private const val TAG = "SweeperLimitingVelocityView"
|
||||
}
|
||||
|
||||
override fun updateLimitingSpeed(limitingSpeed: Int, limitSource: Int) {
|
||||
super.updateLimitingSpeed(limitingSpeed,limitSource)
|
||||
limitingVelocity!!.text = limitingSpeed.toString()
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.sweeper_limiting_speed, this, true)
|
||||
}
|
||||
|
||||
private fun initView(context: Context) {
|
||||
LayoutInflater.from(context).inflate(R.layout.sweeper_limiting_speed, this)
|
||||
limitingVelocity = findViewById(R.id.tvLimitingVelocity)
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerViewLimitingVelocityListenerManager.addListener(TAG, this)
|
||||
CallerHmiViewControlListenerManager.addListener(LimitingVelocityView_TAG, this)
|
||||
}
|
||||
|
||||
override fun onLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) {
|
||||
if (limitingVelocity > 0) {
|
||||
this.visibility = View.VISIBLE
|
||||
tvLimitingVelocity.text = "$limitingVelocity"
|
||||
} else {
|
||||
this.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
override fun visible(v: Int) {
|
||||
super.visible(v)
|
||||
this.visibility = v
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerViewLimitingVelocityListenerManager.removeListener(TAG)
|
||||
CallerHmiViewControlListenerManager.removeListener(LimitingVelocityView_TAG)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -200,4 +200,52 @@
|
||||
,btnAutopilotRunning"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<!--Vip车辆标志-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
|
||||
android:layout_width="@dimen/module_vip_width"
|
||||
android:layout_height="@dimen/module_vip_height"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_640"
|
||||
android:layout_marginTop="@dimen/dp_80"/>
|
||||
|
||||
<!--接管提示-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.takeover.TakeOverView
|
||||
android:layout_width="@dimen/hmi_take_over_request_width"
|
||||
android:layout_height="@dimen/hmi_take_over_request_height"
|
||||
android:layout_marginTop="@dimen/hmi_take_over_request_m_top"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--pnc行为决策-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.pnc.PncActionsView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_110"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<!--超视距-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.CameraView
|
||||
android:id="@+id/ivCameraIcon"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginTop="45dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
app:layout_constraintRight_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<!--APP、MAP版本-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.VersionNameView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="45dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -56,19 +56,9 @@ dependencies {
|
||||
|
||||
implementation project(":OCH:mogo-och-common-module")
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogoutils
|
||||
implementation rootProject.ext.dependencies.mogocommons
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_call
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_v2x
|
||||
implementation rootProject.ext.dependencies.mogo_core_res
|
||||
}else {
|
||||
implementation project(":core:mogo-core-utils")
|
||||
implementation project(":foudations:mogo-commons")
|
||||
implementation project(':core:mogo-core-data')
|
||||
implementation project(':core:mogo-core-function-call')
|
||||
implementation project(':core:function-impl:mogo-core-function-v2x')
|
||||
implementation project(':core:mogo-core-res')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,16 +24,19 @@ import com.mogo.commons.module.status.StatusDescriptor;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener;
|
||||
import com.mogo.eagle.core.function.api.v2x.LimitingVelocityListener;
|
||||
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxEventListener;
|
||||
import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener;
|
||||
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.CallerChassisLocationGCJ20ListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
|
||||
import com.mogo.eagle.core.function.call.v2x.CallLimitingVelocityListenerManager;
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager;
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
@@ -65,6 +68,7 @@ import com.mogo.och.taxi.passenger.callback.ITaxiPassengerVeloctityCallback;
|
||||
import com.mogo.och.taxi.passenger.constant.TaxiPassengerConst;
|
||||
import com.mogo.och.taxi.passenger.constant.TaxiPassengerOrderStatusEnum;
|
||||
import com.mogo.och.taxi.passenger.network.TaxiPassengerServiceManager;
|
||||
import com.mogo.och.taxi.passenger.ui.leftmenu.OverlayLeftViewUtils;
|
||||
import com.mogo.och.taxi.passenger.utils.TaxiPassengerAnalyticsManager;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -242,12 +246,14 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
CallerPlanningRottingListenerManager.INSTANCE.addListener(TAG,moGoAutopilotPlanningListener);
|
||||
|
||||
//增加限速监听
|
||||
CallLimitingVelocityListenerManager.INSTANCE.addListener(TAG,limitingVelocityListener);
|
||||
CallerLimitingVelocityListenerManager.INSTANCE.addListener(TAG,limitingVelocityListener);
|
||||
|
||||
AbnormalFactorsLoopManager.INSTANCE.startLoopAbnormalFactors(mContext);
|
||||
|
||||
//开启自驾后 异常信息返回
|
||||
OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(mAdasStartFailureListener);
|
||||
|
||||
CallerMsgBoxEventListenerManager.INSTANCE.addListener(TAG,iMsgBoxEventListener);
|
||||
}
|
||||
|
||||
private void releaseListeners() {
|
||||
@@ -261,11 +267,13 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.removeListener(mGoAutopilotStatusListener);
|
||||
CallerPlanningRottingListenerManager.INSTANCE.removeListener(moGoAutopilotPlanningListener);
|
||||
CallLimitingVelocityListenerManager.INSTANCE.removeListener(limitingVelocityListener);
|
||||
CallerLimitingVelocityListenerManager.INSTANCE.removeListener(limitingVelocityListener);
|
||||
|
||||
AbnormalFactorsLoopManager.INSTANCE.stopLoopAbnormalFactors();
|
||||
|
||||
OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(null);
|
||||
|
||||
CallerMsgBoxEventListenerManager.INSTANCE.removeListener(iMsgBoxEventListener);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -598,6 +606,17 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
}
|
||||
};
|
||||
|
||||
private final IMsgBoxEventListener iMsgBoxEventListener = new IMsgBoxEventListener() {
|
||||
@Override
|
||||
public void onSummaryClickEvent() {
|
||||
if (mCurrentOCHOrder == null){
|
||||
ToastUtils.showLong("行程已结束");
|
||||
}else {
|
||||
OverlayLeftViewUtils.INSTANCE.transmissionIndexGet(OverlayLeftViewUtils.OVERVIEW);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public void startToRouteAndWipe(List<MessagePad.Location> models) {
|
||||
List<MogoLocation> locationsModels = CoordinateCalculateRouteUtil
|
||||
.coordinateConverterWgsToGcjLocations(mContext,models);
|
||||
@@ -671,10 +690,10 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
/**
|
||||
* 限速监听
|
||||
*/
|
||||
private final LimitingVelocityListener limitingVelocityListener = new LimitingVelocityListener(){
|
||||
private final ILimitingVelocityListener limitingVelocityListener = new ILimitingVelocityListener(){
|
||||
|
||||
@Override
|
||||
public void onLimitingVelocityChange(int limitingVelocity) {
|
||||
public void onLimitingVelocityChange(int limitingVelocity, DataSourceType dataSourceType) {
|
||||
if (mVeloctityCallback != null){
|
||||
mVeloctityCallback.onLimitingVelocityChange(limitingVelocity);
|
||||
}
|
||||
|
||||
@@ -28,15 +28,14 @@
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--Vip车辆标志-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
|
||||
android:layout_width="@dimen/module_vip_width"
|
||||
android:layout_height="@dimen/module_vip_height"
|
||||
android:visibility="gone"
|
||||
app:marginStart="@dimen/dp_540"
|
||||
app:marginTop="@dimen/dp_40"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
<!--pnc行为决策-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.pnc.PncActionsView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_110"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/module_och_taxi_swich_map_iv"
|
||||
|
||||
@@ -55,19 +55,9 @@ dependencies {
|
||||
implementation project(":OCH:mogo-och-common-module")
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogoutils
|
||||
implementation rootProject.ext.dependencies.mogocommons
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_call
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_v2x
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_hmi
|
||||
}else {
|
||||
implementation project(":core:mogo-core-utils")
|
||||
implementation project(":foudations:mogo-commons")
|
||||
implementation project(':core:mogo-core-data')
|
||||
implementation project(':core:mogo-core-function-call')
|
||||
implementation project(':core:function-impl:mogo-core-function-v2x')
|
||||
implementation project(':core:function-impl:mogo-core-function-hmi')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
package com.mogo.och.taxi;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.commons.utils.LocationUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ColorUtils;
|
||||
import com.mogo.map.overlay.IMogoOverlayManager;
|
||||
import com.mogo.map.overlay.IMogoPolyline;
|
||||
import com.mogo.map.overlay.MogoPolylineOptions;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TaxiOverlayManager {
|
||||
|
||||
|
||||
private IMogoPolyline mMoGoPolyline;
|
||||
// 连接线参数
|
||||
private MogoPolylineOptions mPolylineOptions;
|
||||
// 线路径集合
|
||||
private List<MogoLatLng> mPolylinePointList;
|
||||
// 渐变色
|
||||
private List<Integer> mPolylineColors;
|
||||
private Context mContext;
|
||||
IMogoOverlayManager mogoOverlayManager;
|
||||
public TaxiOverlayManager(Context context) {
|
||||
mPolylineOptions = new MogoPolylineOptions();
|
||||
// 绘制路径集合
|
||||
mPolylinePointList = new ArrayList<>();
|
||||
// 引导线颜色
|
||||
mPolylineColors = new ArrayList<>();
|
||||
mContext = context;
|
||||
mogoOverlayManager = CallerMapUIServiceManager.INSTANCE.getOverlayManager(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制最优路线
|
||||
*
|
||||
* @param polylinePoint 要绘制的经纬度度集合
|
||||
*/
|
||||
public IMogoPolyline draw(MogoLocation carLocal, List<MogoLatLng> polylinePoint) {
|
||||
if (mMoGoPolyline != null) {
|
||||
mMoGoPolyline.remove();
|
||||
mPolylinePointList.clear();
|
||||
mPolylineColors.clear();
|
||||
}
|
||||
if (polylinePoint != null) {
|
||||
|
||||
// 将当前车辆位置放进去
|
||||
mPolylinePointList.add(new MogoLatLng(carLocal.getLatitude(), carLocal.getLongitude()));
|
||||
// 过滤后台推送的推荐路线集合
|
||||
for (MogoLatLng polyline : polylinePoint) {
|
||||
//需要剔除已经行驶过的经纬度,这里需要比对推荐路线集合中的点是否在当前车辆行驶方向前面如果不在则抛弃
|
||||
if (LocationUtils.isPointOnCarFront(carLocal, polyline)) {
|
||||
mPolylinePointList.add(polyline);
|
||||
}
|
||||
}
|
||||
mPolylineColors.addAll(ColorUtils.getGradientAlpha("#002965ED", "#FF2965ED", "#002965ED", mPolylinePointList.size()));
|
||||
// 替换路径集合
|
||||
mPolylineOptions.points(mPolylinePointList);
|
||||
// 线条粗细,渐变,渐变色值
|
||||
mPolylineOptions.width(25).useGradient(true).colorValues(mPolylineColors);
|
||||
// 绘制线
|
||||
mMoGoPolyline = mogoOverlayManager.addPolyline(mPolylineOptions);
|
||||
}
|
||||
return mMoGoPolyline;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -85,11 +85,29 @@
|
||||
android:layout_width="@dimen/module_vip_width"
|
||||
android:layout_height="@dimen/module_vip_height"
|
||||
android:visibility="gone"
|
||||
app:marginStart="@dimen/dp_640"
|
||||
app:marginTop="@dimen/dp_80"
|
||||
android:layout_marginStart="@dimen/dp_640"
|
||||
android:layout_marginTop="@dimen/dp_80"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<!--pnc行为决策-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.pnc.PncActionsView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_110"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<!--APP、MAP版本-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.VersionNameView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="45dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<!--超视距-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.CameraView
|
||||
android:id="@+id/ivCameraIcon"
|
||||
@@ -101,6 +119,22 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<!--限速牌子-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.LimitingVelocityView
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:gravity="center"
|
||||
android:text="60"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="60dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<!--红绿灯-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.SingleTrafficLightView
|
||||
android:id="@+id/viewTrafficLightVr"
|
||||
@@ -108,9 +142,29 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/hmi_traffic_light_layout_margin_top"
|
||||
android:layout_marginEnd="@dimen/hmi_traffic_light_layout_margin_right"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--接管提示-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.takeover.TakeOverView
|
||||
android:layout_width="@dimen/hmi_take_over_request_width"
|
||||
android:layout_height="@dimen/hmi_take_over_request_height"
|
||||
android:layout_marginTop="@dimen/hmi_take_over_request_m_top"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--隐藏态下的 美化模式按钮-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.switch.DemoModeHiddenSwitch
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_marginStart="40dp"
|
||||
android:layout_marginBottom="200dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/module_mogo_och_station_panel_container"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -210,6 +210,9 @@ android {
|
||||
buildConfigField 'String', 'MAP_SDK_VERSION', "\"${MAP_SDK_VERSION}\""
|
||||
buildConfigField 'String', 'MAP_SDK_OPT_VERSION', "\"${MAP_SDK_OPERATION_VERSION}\""
|
||||
}
|
||||
noop {
|
||||
dimension "business"
|
||||
}
|
||||
busbase {
|
||||
dimension "business"
|
||||
}
|
||||
@@ -253,6 +256,12 @@ android {
|
||||
variantFilter { variant ->
|
||||
def names = variant.flavors*.name
|
||||
//要检查特定的构建类型,请使用variant.buildType.name ==“ <buildType>”
|
||||
// region 过滤noop 的flavors 不带och业务的
|
||||
if (names.contains("noop")&&!names.contains("fPadLenovo")) {
|
||||
//Gradle会忽略满足上述条件的所有变体
|
||||
setIgnore(true)
|
||||
}
|
||||
// endregion
|
||||
// region 过滤sweper 的flavors
|
||||
if (names.contains("sweeper")&&!names.contains("fPadLenovoOchSweeper")) {
|
||||
//Gradle会忽略满足上述条件的所有变体
|
||||
@@ -328,7 +337,7 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.android_start_up
|
||||
implementation rootProject.ext.dependencies.lancetx_runtime
|
||||
implementation rootProject.ext.dependencies.mogocustommap
|
||||
|
||||
implementation project(':core:function-impl:mogo-core-function-startup')
|
||||
// // 暂不使用Shizuku-API
|
||||
// implementation rootProject.ext.dependencies.shizuku_provider
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
|
||||
@@ -24,7 +24,7 @@ project.android.productFlavors {
|
||||
buildConfigField 'int', 'GPS_PROVIDER', "1"
|
||||
|
||||
// 构建的应用身份类型,具体查看 README.md APP_IDENTITY_MODE规则
|
||||
buildConfigField 'String', 'APP_IDENTITY_MODE', "\"Taxi_Driver_Base\""
|
||||
buildConfigField 'String', 'APP_IDENTITY_MODE', "\"FPad_Noop_Base\""
|
||||
// 连接的工控机IP地址
|
||||
buildConfigField 'String', 'ADAS_CONNECT_IP', "\"192.168.1.104\""
|
||||
// 构建的是否是演示(美化)模式
|
||||
|
||||
@@ -1,28 +1,12 @@
|
||||
package com.mogo.launcher;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.function.call.startup.CallerStartUpManager;
|
||||
import com.mogo.eagle.core.function.main.MainMoGoApplication;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.LogLevel;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.eagle.core.utilcode.util.ProcessUtils;
|
||||
import com.mogo.launcher.crash.CrashSystem;
|
||||
import com.mogo.launcher.stageone.APMStartup;
|
||||
import com.mogo.launcher.stageone.ARouterStartUp;
|
||||
import com.mogo.launcher.stageone.ConfigStartUp;
|
||||
import com.mogo.launcher.stageone.HttpDnsStartUp;
|
||||
import com.mogo.launcher.stageone.ThreadOptStartup;
|
||||
import com.rousetime.android_startup.StartupListener;
|
||||
import com.rousetime.android_startup.StartupManager;
|
||||
import com.rousetime.android_startup.model.LoggerLevel;
|
||||
import com.rousetime.android_startup.model.StartupConfig;
|
||||
import com.zhidaoauto.map.sdk.open.HDTypes;
|
||||
import com.zhidaoauto.map.sdk.open.MapAutoApi;
|
||||
import com.zhidaoauto.map.sdk.open.MapParams;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import com.mogo.launcher.startup.ARouterStartUp;
|
||||
import com.mogo.launcher.startup.ConfigStartUp;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -34,43 +18,12 @@ public class MogoApplication extends MainMoGoApplication {
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
startUpInStage1();
|
||||
ARouterStartUp.init(this);
|
||||
ConfigStartUp.init(this);
|
||||
CallerStartUpManager.initStageOne();
|
||||
super.onCreate();
|
||||
}
|
||||
|
||||
private final StartupListener startupListener = (l, costTimesModels) -> EventBus.getDefault().postSticky(costTimesModels);
|
||||
|
||||
/**
|
||||
* 第一阶段初始化
|
||||
*/
|
||||
public void startUpInStage1() {
|
||||
StartupConfig config = null;
|
||||
if (DebugConfig.isDebug()) {
|
||||
config = new StartupConfig.Builder()
|
||||
.setLoggerLevel(LoggerLevel.DEBUG)
|
||||
.setOpenStatistics(true)
|
||||
.setListener(startupListener)
|
||||
.build();
|
||||
} else {
|
||||
config = new StartupConfig.Builder()
|
||||
.setLoggerLevel(LoggerLevel.NONE)
|
||||
.setOpenStatistics(false)
|
||||
.setAwaitTimeout(10000L)
|
||||
.setListener(startupListener)
|
||||
.build();
|
||||
}
|
||||
new StartupManager.Builder()
|
||||
.addStartup(new HttpDnsStartUp())
|
||||
.addStartup(new APMStartup())
|
||||
.addStartup(new ConfigStartUp())
|
||||
.addStartup(new ARouterStartUp())
|
||||
.addStartup(new ThreadOptStartup())
|
||||
.setConfig(config)
|
||||
.build(this)
|
||||
.start()
|
||||
.await();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initCrashConfig() {
|
||||
CrashSystem crashSystem = CrashSystem.getInstance(this);
|
||||
|
||||
@@ -1,25 +1,22 @@
|
||||
package com.mogo.launcher.stageone
|
||||
package com.mogo.launcher.startup
|
||||
|
||||
import android.app.Application
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.eagle.core.utilcode.util.AppUtils
|
||||
import com.mogo.eagle.core.utilcode.util.CleanUtils
|
||||
import com.rousetime.android_startup.AndroidStartup
|
||||
import java.lang.Exception
|
||||
|
||||
class ARouterStartUp : AndroidStartup<String>() {
|
||||
override fun callCreateOnMainThread() = true
|
||||
|
||||
override fun create(context: Context): String {
|
||||
object ARouterStartUp {
|
||||
@JvmStatic
|
||||
fun init(app: Application) {
|
||||
try {
|
||||
if (DebugConfig.isDebug()) {
|
||||
ARouter.openDebug()
|
||||
ARouter.openLog()
|
||||
}
|
||||
// 初始化 arouter
|
||||
ARouter.init(context as Application?)
|
||||
ARouter.init(app)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
// 由于ARouter会在SP_AROUTER_CACHE.xml缓存路由表,如果出现了被删除的情况会报错,这里清除下就好了
|
||||
@@ -27,12 +24,5 @@ class ARouterStartUp : AndroidStartup<String>() {
|
||||
// 重启应用
|
||||
AppUtils.relaunchApp()
|
||||
}
|
||||
return this.javaClass.simpleName
|
||||
}
|
||||
|
||||
override fun waitOnMainThread() = false
|
||||
|
||||
override fun dependenciesByName(): List<String>? {
|
||||
return listOf("com.mogo.launcher.stageone.ThreadOptStartup")
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,9 @@
|
||||
package com.mogo.launcher.stageone
|
||||
package com.mogo.launcher.startup
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo.appBuildTime
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo.workingBranchHash
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo.workingBranchName
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
@@ -16,30 +14,25 @@ import com.mogo.eagle.core.utilcode.util.ProcessUtils
|
||||
import com.mogo.launcher.BuildConfig
|
||||
import com.mogo.launcher.R
|
||||
import com.mogo.test.crashreport.CrashReportConstants
|
||||
import com.rousetime.android_startup.AndroidStartup
|
||||
import com.zhidaoauto.map.sdk.open.HDTypes
|
||||
import com.zhidaoauto.map.sdk.open.MapAutoApi
|
||||
import com.zhidaoauto.map.sdk.open.MapParams
|
||||
import com.zhjt.mogo_core_function_devatools.env.EnvChangeManager
|
||||
|
||||
class ConfigStartUp : AndroidStartup<Boolean>() {
|
||||
object ConfigStartUp {
|
||||
|
||||
override fun callCreateOnMainThread() = true
|
||||
|
||||
override fun waitOnMainThread() = false
|
||||
|
||||
override fun create(context: Context): Boolean {
|
||||
initDebugConfig(context)
|
||||
@JvmStatic
|
||||
fun init(context: Context) {
|
||||
initDebugConfig()
|
||||
initBuildConfig()
|
||||
initOtherConfig(context)
|
||||
return true
|
||||
}
|
||||
|
||||
private fun initBuildConfig() {
|
||||
// 初始化构建APP的时候的分支及提交HASH,用于辅助定位问题
|
||||
workingBranchName = BuildConfig.WORKING_BRANCH_NAME
|
||||
workingBranchHash = BuildConfig.WORKING_BRANCH_HASH
|
||||
appBuildTime = BuildConfig.APP_BUILD_TIME
|
||||
AppConfigInfo.workingBranchName = BuildConfig.WORKING_BRANCH_NAME
|
||||
AppConfigInfo.workingBranchHash = BuildConfig.WORKING_BRANCH_HASH
|
||||
AppConfigInfo.appBuildTime = BuildConfig.APP_BUILD_TIME
|
||||
// 使用与渠道配置一样的gps提供者提供的数据,app/productFlavors/fPadLenovo.gradle GPS_PROVIDER 0-Android系统,1-工控机,2-OBU
|
||||
FunctionBuildConfig.gpsProvider = BuildConfig.GPS_PROVIDER
|
||||
// FunctionBuildConfig.gpsProvider = 2
|
||||
@@ -70,7 +63,7 @@ class ConfigStartUp : AndroidStartup<Boolean>() {
|
||||
FunctionBuildConfig.adasConnectIP = BuildConfig.ADAS_CONNECT_IP
|
||||
}
|
||||
|
||||
private fun initDebugConfig(context: Context) {
|
||||
private fun initDebugConfig() {
|
||||
var mode = BuildConfig.NET_ENV
|
||||
val envConfig = EnvChangeManager.getEnvConfig()
|
||||
if (envConfig != null) {
|
||||
@@ -86,7 +79,6 @@ class ConfigStartUp : AndroidStartup<Boolean>() {
|
||||
DebugConfig.setMapOptVersion(BuildConfig.MAP_SDK_OPT_VERSION)
|
||||
DebugConfig.setNeedUploadCoordinatesInTime(BuildConfig.IS_NEED_UPLOAD_COORDINATES_IN_TIME)
|
||||
DebugConfig.setMultiDisplay(BuildConfig.IS_MULTI_DISPLAY)
|
||||
|
||||
}
|
||||
|
||||
private fun initOtherConfig(context: Context) {
|
||||
@@ -117,23 +109,24 @@ class ConfigStartUp : AndroidStartup<Boolean>() {
|
||||
|
||||
val mapParams = MapParams.init()
|
||||
mapParams.setDebugMode(false) //todo 1-使用本地地图数据,0-使用在线地图数据
|
||||
//.setDataFileSource(1)
|
||||
.setCoordinateType(MapParams.COORDINATETYPE_GCJ02)
|
||||
.setPerspectiveMode(MapParams.MAP_PERSPECTIVE_UP_CAR)
|
||||
.setHDVisibileArray(intArrayOf(HDTypes.DIVIDER.type,
|
||||
HDTypes.ROAD_AREA.type,
|
||||
HDTypes.STOP_LINE.type,
|
||||
HDTypes.ARROW.type,
|
||||
HDTypes.STATION_BRIDGE.type,
|
||||
HDTypes.ZEBRA_LINE.type,
|
||||
HDTypes.GREEN_BELT.type,
|
||||
HDTypes.DIVERSION.type,
|
||||
HDTypes.SAFE_ISLAND.type,
|
||||
HDTypes.ALPHANUMERIC.type,
|
||||
HDTypes.GUARDBAR.type,
|
||||
HDTypes.TRAFFIC_DEVICE.type,
|
||||
HDTypes.CABLE.type,
|
||||
HDTypes.SIGNAL_LINE.type))
|
||||
//.setDataFileSource(1)
|
||||
.setCoordinateType(MapParams.COORDINATETYPE_GCJ02)
|
||||
.setPerspectiveMode(MapParams.MAP_PERSPECTIVE_UP_CAR)
|
||||
.setHDVisibileArray(intArrayOf(
|
||||
HDTypes.DIVIDER.type,
|
||||
HDTypes.ROAD_AREA.type,
|
||||
HDTypes.STOP_LINE.type,
|
||||
HDTypes.ARROW.type,
|
||||
HDTypes.STATION_BRIDGE.type,
|
||||
HDTypes.ZEBRA_LINE.type,
|
||||
HDTypes.GREEN_BELT.type,
|
||||
HDTypes.DIVERSION.type,
|
||||
HDTypes.SAFE_ISLAND.type,
|
||||
HDTypes.ALPHANUMERIC.type,
|
||||
HDTypes.GUARDBAR.type,
|
||||
HDTypes.TRAFFIC_DEVICE.type,
|
||||
HDTypes.CABLE.type,
|
||||
HDTypes.SIGNAL_LINE.type))
|
||||
// .setZoom( 20 )
|
||||
// .setPointToCenter( 0.734375f, 0.5f )
|
||||
//todo 2D模式下需要注意ADAS部分遮挡
|
||||
@@ -153,8 +146,4 @@ class ConfigStartUp : AndroidStartup<Boolean>() {
|
||||
MapAutoApi.init(context, mapParams)
|
||||
|
||||
}
|
||||
|
||||
override fun dependenciesByName(): List<String> {
|
||||
return listOf("com.mogo.launcher.stageone.ThreadOptStartup")
|
||||
}
|
||||
}
|
||||
@@ -91,9 +91,7 @@ ext {
|
||||
|
||||
// obu sdk
|
||||
obusdk : "com.zhidao.enterprise.smartv2x:smartv2x:1.0.0.3",
|
||||
mogoobuold : 'com.zhidao.support.obu:mogoobu:1.0.0.33',
|
||||
mogoobu : 'com.mogo.support.obu:mogo-obu:1.0.6',
|
||||
mogoami : 'com.zhidao.support.obu.ami:mogoami:1.0.0.24',
|
||||
mogoobu : 'com.mogo.support.obu:mogo-obu:1.1.0_beta0',
|
||||
|
||||
// google
|
||||
googlezxing : "com.google.zxing:core:3.3.3",
|
||||
@@ -226,6 +224,8 @@ ext {
|
||||
|
||||
//========================= autosize ======================
|
||||
androidautoSize : 'com.github.JessYanCoding:AndroidAutoSize:v1.2.1',
|
||||
|
||||
thread_opt : "com.mogo.thread.opt:lib:${THREAD_OPT_VERSION}"
|
||||
]
|
||||
android = [
|
||||
launcherApplicationId : "com.mogo.launcher",
|
||||
|
||||
@@ -10,7 +10,6 @@ import com.mogo.eagle.function.biz.dispatch.DispatchAutoPilotManager.Companion.d
|
||||
import com.mogo.eagle.function.biz.monitoring.CronTaskManager.Companion.cronTaskManager
|
||||
import com.mogo.eagle.function.biz.notice.NoticeSocketManager.Companion.noticeSocketManager
|
||||
import com.mogo.eagle.function.biz.notice.network.NoticeNetWorkManager
|
||||
import com.mogo.eagle.function.biz.v2x.speedlimit.SpeedLimitDataManager
|
||||
import com.mogo.eagle.function.biz.v2x.speedlimit.SpeedLimitDispatcher
|
||||
import com.mogo.eagle.function.biz.v2x.trafficlight.core.MogoTrafficLightManager
|
||||
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightDispatcher
|
||||
@@ -28,10 +27,9 @@ class FuncBizProvider : IMoGoFuncBizProvider {
|
||||
cronTaskManager.startCronTask()
|
||||
|
||||
MogoTrafficLightManager.INSTANCE.initServer(context)
|
||||
TrafficLightDispatcher.INSTANCE.initServer(context) //todo 红绿灯中心模块放入dataCenter
|
||||
VipCarManager.INSTANCE.initServer(context)
|
||||
SpeedLimitDataManager.getInstance().start()
|
||||
SpeedLimitDispatcher.INSTANCE.initLimit(context)
|
||||
TrafficLightDispatcher.INSTANCE.initServer(context) //todo 宏宇 放入dataCenter
|
||||
SpeedLimitDispatcher.INSTANCE.initLimit(context) //todo 宏宇,放入dataCenter
|
||||
// RedLightWarningManager.INSTANCE.listenTrafficLight()
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import android.util.Log
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_IVP
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_IVP_GREEN
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2I
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnum
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
@@ -209,17 +209,17 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
MsgBoxBean(
|
||||
MsgBoxType.V2X,
|
||||
V2XMsg(
|
||||
EventTypeEnum.TYPE_USECASE_ID_IVP.poiType,
|
||||
EventTypeEnum.TYPE_USECASE_ID_IVP.content,
|
||||
EventTypeEnum.TYPE_USECASE_ID_IVP.tts
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.content,
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.tts
|
||||
)
|
||||
)
|
||||
)
|
||||
CallerHmiManager.warningV2X(
|
||||
EventTypeEnum.TYPE_USECASE_ID_IVP.poiType,
|
||||
EventTypeEnum.TYPE_USECASE_ID_IVP.content,
|
||||
EventTypeEnum.TYPE_USECASE_ID_IVP.tts,
|
||||
EventTypeEnum.TYPE_USECASE_ID_IVP.poiType,
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.content,
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.tts,
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
|
||||
null,
|
||||
true,
|
||||
5000L
|
||||
@@ -235,11 +235,11 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
CallerLogger.d("$M_V2X$TAG", "=====绿灯通行预警=====")
|
||||
ThreadUtils.runOnUiThread {
|
||||
val content = String.format(
|
||||
EventTypeEnum.getWarningContent(EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType),
|
||||
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
|
||||
speed
|
||||
)
|
||||
val tts = String.format(
|
||||
EventTypeEnum.getWarningTts(EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType),
|
||||
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
|
||||
speed
|
||||
)
|
||||
if (content.isNullOrEmpty() || tts.isNullOrEmpty()) {
|
||||
@@ -249,17 +249,17 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
MsgBoxBean(
|
||||
MsgBoxType.V2X,
|
||||
V2XMsg(
|
||||
EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
content,
|
||||
tts
|
||||
)
|
||||
)
|
||||
)
|
||||
CallerHmiManager.warningV2X(
|
||||
EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
content,
|
||||
tts,
|
||||
EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
null,
|
||||
true,
|
||||
5000L
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
package com.mogo.eagle.function.biz.v2x.speedlimit
|
||||
|
||||
import android.content.Context
|
||||
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.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.data.deva.bizconfig.FuncBizConfig
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerViewLimitingVelocityListenerManager
|
||||
import com.zhjt.service_biz.BizConfig
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description 对多个限速进行调度(map,rsu ...)
|
||||
* @since: 2023/1/12
|
||||
*/
|
||||
class SpeedLimitDispatcher : LimitingVelocityListener, ObuLimitingSpeedListener {
|
||||
class SpeedLimitDispatcher : ILimitingVelocityListener {
|
||||
companion object {
|
||||
const val TAG = "SpeedLimitDispatcher"
|
||||
val INSTANCE: SpeedLimitDispatcher by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
@@ -24,47 +23,42 @@ class SpeedLimitDispatcher : LimitingVelocityListener, ObuLimitingSpeedListener
|
||||
|
||||
private var mContext: Context? = null
|
||||
|
||||
//是否有AI获取红绿灯灯态
|
||||
//obu限速状态
|
||||
private var hasObuStatus: Boolean = false
|
||||
|
||||
|
||||
fun initLimit(context: Context) {
|
||||
mContext = context
|
||||
//注册监听MAP的限速
|
||||
CallLimitingVelocityListenerManager.addListener(TAG, this)
|
||||
//注册监听OBU的限速
|
||||
CallObuLimitingSpeedListenerManager.addListener(TAG, this)
|
||||
CallerLimitingVelocityListenerManager.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()
|
||||
// @BizConfig(FuncBizConfig.V2I, "", FuncBizConfig.BIZ_SLW) //todo arrow 重新考虑放的位置
|
||||
override fun onLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) {
|
||||
when (sourceType) { // obu 优先级高于 map,体现链路能力
|
||||
DataSourceType.OBU -> {
|
||||
hasObuStatus = limitingVelocity > 0
|
||||
CallerViewLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(
|
||||
limitingVelocity,
|
||||
sourceType
|
||||
)
|
||||
return
|
||||
}
|
||||
DataSourceType.MAP -> {
|
||||
if (!hasObuStatus) {
|
||||
CallerViewLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(
|
||||
limitingVelocity,
|
||||
sourceType
|
||||
)
|
||||
}
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
fun destroy() {
|
||||
//取消注册监听AI云获取红绿灯状态
|
||||
CallerTrafficLightListenerManager.removeListener(TAG)
|
||||
//取消注册监听工控机感知红绿灯
|
||||
CallerAutopilotIdentifyListenerManager.removeListener(TAG)
|
||||
CallerLimitingVelocityListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,7 +10,7 @@ import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_VIP
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2N
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnum
|
||||
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.V2XMsg
|
||||
@@ -209,17 +209,17 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
val light = this.result?.currentRoadTrafficLight()
|
||||
if (light != null && light.isGreen()) {
|
||||
showWarning(
|
||||
EventTypeEnum.TYPE_VIP_IDENTIFICATION_EXTEND.poiType,
|
||||
EventTypeEnum.TYPE_VIP_IDENTIFICATION_EXTEND.content,
|
||||
EventTypeEnum.TYPE_VIP_IDENTIFICATION_EXTEND.tts,
|
||||
EventTypeEnum.TYPE_VIP_IDENTIFICATION_EXTEND.poiType
|
||||
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.poiType,
|
||||
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.content,
|
||||
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.tts,
|
||||
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.poiType
|
||||
)
|
||||
} else {
|
||||
showWarning(
|
||||
EventTypeEnum.TYPE_VIP_IDENTIFICATION_PASS.poiType,
|
||||
EventTypeEnum.TYPE_VIP_IDENTIFICATION_PASS.content,
|
||||
EventTypeEnum.TYPE_VIP_IDENTIFICATION_PASS.tts,
|
||||
EventTypeEnum.TYPE_VIP_IDENTIFICATION_PASS.poiType
|
||||
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.poiType,
|
||||
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.content,
|
||||
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.tts,
|
||||
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.poiType
|
||||
)
|
||||
}
|
||||
return@turnLightToGreen
|
||||
@@ -228,10 +228,10 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
// 请求变灯失败,根据灯态来提示。 此处灯态未获取到
|
||||
if (this.result == null || this.result?.currentRoadTrafficLight() == null) {
|
||||
showWarning(
|
||||
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.poiType,
|
||||
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.content + ", 稍后重试",
|
||||
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.tts,
|
||||
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.poiType
|
||||
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.poiType,
|
||||
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.content + ", 稍后重试",
|
||||
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.tts,
|
||||
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.poiType
|
||||
)
|
||||
return@turnLightToGreen
|
||||
}
|
||||
@@ -249,10 +249,10 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
"${temp}秒后重试"
|
||||
}
|
||||
showWarning(
|
||||
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.poiType,
|
||||
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.content + time,
|
||||
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.tts,
|
||||
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.poiType
|
||||
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.poiType,
|
||||
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.content + time,
|
||||
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.tts,
|
||||
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.poiType
|
||||
)
|
||||
} else {
|
||||
CallerLogger.d(
|
||||
|
||||
@@ -54,16 +54,17 @@ dependencies {
|
||||
kapt rootProject.ext.dependencies.androidxroomcompiler
|
||||
implementation rootProject.ext.dependencies.androidxroomktx
|
||||
|
||||
implementation rootProject.ext.dependencies.mogoami
|
||||
implementation rootProject.ext.dependencies.mogoaicloudtelematic
|
||||
|
||||
implementation rootProject.ext.dependencies.mogoobu
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
implementation rootProject.ext.dependencies.mogo_core_utils
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_call
|
||||
|
||||
implementation project(':libraries:mogo-adas')
|
||||
|
||||
implementation rootProject.ext.dependencies.mogocommons
|
||||
} else {
|
||||
implementation project(':core:mogo-core-data')
|
||||
implementation project(':core:mogo-core-utils')
|
||||
@@ -71,8 +72,6 @@ dependencies {
|
||||
|
||||
implementation project(':libraries:mogo-adas')
|
||||
implementation project(':foudations:mogo-commons')
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mogo.eagle.core.function.datacenter">
|
||||
|
||||
<application>
|
||||
<receiver android:name=".obu.receiver.ObuTestTriggerReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.obu.test_trigger" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
<receiver android:name=".obu.receiver.ObuTestTriggerRecognizedReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.obu.test_trigger_recognized" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".obu.receiver.ObuRsuTestTriggerReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.obu.test_light_recognized" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".obu.receiver.ObuTestNewObuReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.obu.test_newobu" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".obu.receiver.ObuTestNewObuRsiReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.obu.test_newobu_rsi" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.mogo.eagle.core.function
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.function.api.datacenter.IDataCenterProvider
|
||||
|
||||
@Route(path = MogoServicePaths.PATH_DATA_CENTER_MODULE)
|
||||
class DataCenterProvider: IDataCenterProvider {
|
||||
|
||||
override val functionName: String
|
||||
get() = "DataCenterProvider"
|
||||
|
||||
override fun init(context: Context?) {
|
||||
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -62,9 +62,9 @@ import java.util.concurrent.TimeUnit
|
||||
|
||||
|
||||
/**
|
||||
* 域控制器
|
||||
* @author xiaoyuzhou
|
||||
* @date 2021/9/22 8:43 下午
|
||||
* 域控制器
|
||||
*/
|
||||
@Route(path = MogoServicePaths.PATH_AUTO_PILOT)
|
||||
class MoGoAutopilotProvider :
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.obu.mogo
|
||||
package com.mogo.eagle.core.function.datacenter.obu
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
@@ -11,6 +11,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.util.CommonUtils
|
||||
import com.mogo.support.obu.MogoObuManager
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
@@ -54,9 +55,6 @@ class MoGoObuProvider : IMoGoObuProvider {
|
||||
ipAddress,
|
||||
CommonUtils.getIpAddressString()
|
||||
)
|
||||
|
||||
//old obu
|
||||
MogoPrivateObuManager.INSTANCE.init(context, ipAddress)
|
||||
} else if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) { //taxi 司机端和乘客端
|
||||
val ipAddress =
|
||||
SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, taxiObuIp)
|
||||
@@ -66,9 +64,6 @@ class MoGoObuProvider : IMoGoObuProvider {
|
||||
ipAddress,
|
||||
CommonUtils.getIpAddressString()
|
||||
)
|
||||
|
||||
//old obu
|
||||
MogoPrivateObuManager.INSTANCE.init(context, ipAddress)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -95,18 +90,16 @@ class MoGoObuProvider : IMoGoObuProvider {
|
||||
CommonUtils.getIpAddressString()
|
||||
)
|
||||
|
||||
//连接old obu
|
||||
MogoPrivateObuManager.INSTANCE.connectObu(it, ipAddress)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun disConnect() {
|
||||
MogoPrivateObuManager.INSTANCE.disConnectObu()
|
||||
MogoPrivateObuNewManager.INSTANCE.disconnect()
|
||||
}
|
||||
|
||||
override fun isConnected(): Boolean {
|
||||
return MogoPrivateObuManager.INSTANCE.isConnected()
|
||||
return MogoObuManager.getInstance().connectStatus == 1
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.obu.mogo;
|
||||
package com.mogo.eagle.core.function.datacenter.obu;
|
||||
|
||||
/**
|
||||
* author : lxiiaopeng
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.mogo.eagle.core.function.obu.mogo
|
||||
package com.mogo.eagle.core.function.datacenter.obu
|
||||
|
||||
import android.content.Context
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
|
||||
import com.mogo.eagle.core.data.msgbox.DataSourceType
|
||||
import com.mogo.eagle.core.data.enums.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
|
||||
@@ -14,11 +14,13 @@ 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.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.call.obucombine.CallerObuDcCombineListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
|
||||
import com.mogo.support.obu.constants.MogoObuConstants
|
||||
import mogo.v2x.ObuWarningEvent
|
||||
import mogo.v2x.ObuWarningEvent.*
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
|
||||
/**
|
||||
@@ -441,14 +443,15 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
|
||||
"MogoObuDcCombineManager onMogoObuMapMath = ${data.status} --speedMaxLimit = ${Math.round((data.speedMaxLimit*0.02*3.6))} --- data.speedMaxLimit = ${data.speedMaxLimit}")
|
||||
when (data.status) {
|
||||
MogoObuConstants.STATUS.ADD -> { // 添加 TODO
|
||||
CallerHmiManager.showLimitingVelocity(Math.round((data.speedMaxLimit*0.02*3.6)).toInt(), 2)
|
||||
CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(
|
||||
(data.speedMaxLimit * 0.02 * 3.6).roundToInt().toInt(),DataSourceType.OBU)
|
||||
}
|
||||
|
||||
MogoObuConstants.STATUS.UPDATE -> { // 更新
|
||||
}
|
||||
|
||||
MogoObuConstants.STATUS.DELETE -> { // 删除
|
||||
CallerHmiManager.disableLimitingVelocity()
|
||||
CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(-1 ,DataSourceType.OBU)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
package com.mogo.eagle.core.function.obu.mogo
|
||||
package com.mogo.eagle.core.function.datacenter.obu
|
||||
|
||||
import android.content.Context
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.data.enums.*
|
||||
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
|
||||
@@ -18,8 +17,8 @@ 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.function.call.v2x.CallerLimitingVelocityListenerManager
|
||||
import com.mogo.eagle.core.function.datacenter.obu.utils.TrafficDataConvertUtilsNew
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
@@ -34,6 +33,7 @@ import com.mogo.support.obu.model.advance.SpatLight
|
||||
import com.mogo.support.obu.option.MogoObuCom
|
||||
import com.mogo.support.obu.option.MogoObuOptions
|
||||
import org.json.JSONObject
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -88,6 +88,11 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
return mogoObuListener
|
||||
}
|
||||
|
||||
fun disconnect() {
|
||||
MogoObuManager.getInstance().disconnect()
|
||||
}
|
||||
|
||||
|
||||
private val mogoObuListener: OnMogoObuListener = object : OnMogoObuListener() {
|
||||
/**
|
||||
* 连接状态的改变
|
||||
@@ -105,13 +110,6 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
mObuStatusInfo.obuStatus = true
|
||||
CallerObuListenerManager.invokeListener(mObuStatusInfo)
|
||||
mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU", true) }
|
||||
|
||||
//断开老obu
|
||||
try {
|
||||
com.zhidao.support.obu.MogoObuManager.getInstance().disConnect()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -512,7 +510,9 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
|
||||
//物体数据绘制
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "onMogoObuRsmWarning ---- data.status = ${data.status} ---data.participant.ptcId = ${data.participant.ptcId} ---data.participant.ptcType = ${data.participant.ptcType} ---data.warningMsg = ${data.warningMsg} -----data = ${data.toString()}")
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"onMogoObuRsmWarning ---- data.status = ${data.status} ---data.participant.ptcId = ${data.participant.ptcId} ---data.participant.ptcType = ${data.participant.ptcType} ---data.warningMsg = ${data.warningMsg} -----data = ${data.toString()}"
|
||||
)
|
||||
when (data.status) {
|
||||
MogoObuConstants.STATUS.ADD -> { // 添加
|
||||
// 更新数据,模型变色的时候是不是update,如果不是更新,可能导致模型不变色,(add的时候,是否有level高的) TODO
|
||||
@@ -552,7 +552,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
//删除弱势交通元素
|
||||
CallerMapUIServiceManager.getMarkerService()
|
||||
?.removeCvxRvInfoIndInfo(data.participant.ptcId.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//预警status
|
||||
@@ -629,347 +629,421 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
*/
|
||||
override fun onMogoObuMapMath(data: MogoObuMapMathData?) {
|
||||
super.onMogoObuMapMath(data)
|
||||
// if (isShowObuLimitSpeedView) {
|
||||
if (data != null) {
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"onMogoObuMapMath = ${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(), 2)
|
||||
CallObuLimitingSpeedListenerManager.invokeOnObuLimitingSpeedChange(Math.round((data.speedMaxLimit * 3.6)).toInt())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MogoObuConstants.STATUS.UPDATE -> { // 更新
|
||||
}
|
||||
|
||||
MogoObuConstants.STATUS.DELETE -> { // 删除
|
||||
UiThreadHandler.post {
|
||||
// CallerHmiManager.disableLimitingVelocity()
|
||||
CallObuLimitingSpeedListenerManager.invokeOnObuLimitingSpeedChange(-1)
|
||||
if (data != null) {
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"onMogoObuMapMath = ${data.status} --speedMaxLimit = ${(data.speedMaxLimit * 3.6).roundToInt()}"
|
||||
)
|
||||
when (data.status) {
|
||||
MogoObuConstants.STATUS.ADD -> { // 添加
|
||||
UiThreadHandler.post {
|
||||
if (data.speedMaxLimit > 0) {
|
||||
CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(
|
||||
(data.speedMaxLimit * 3.6).roundToInt(), DataSourceType.OBU
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MogoObuConstants.STATUS.UPDATE -> { // 更新
|
||||
}
|
||||
|
||||
MogoObuConstants.STATUS.DELETE -> { // 删除
|
||||
UiThreadHandler.post {
|
||||
CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(-1,DataSourceType.OBU)
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取消息的方位 车辆相关
|
||||
*/
|
||||
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确定是否展示
|
||||
*
|
||||
* @param appId 使用WarningTypeEnum获取icon、提示内容、tts内容 TODO 添加事件频繁播报拦截
|
||||
*
|
||||
* @see com.mogo.module.common.enums.EventTypeEnum
|
||||
*/
|
||||
private fun handleSdkObu(
|
||||
appId: String,
|
||||
direction: WarningDirectionEnum,
|
||||
status: Int,
|
||||
level: Int,
|
||||
info: MogoObuRvWarningData
|
||||
) {
|
||||
// 这里排除需要特殊定制的语音及文案外,其余的都可以使用 EventTypeEnumNew 提供的
|
||||
var alertContent: String = ""
|
||||
var ttsContent: String = ""
|
||||
var changeVisualAngle = false
|
||||
when (appId) {
|
||||
//交叉路口碰撞预警
|
||||
MogoObuConstants.V2X_WARNING_TYPE.FCW.toString() -> {
|
||||
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
|
||||
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
|
||||
}
|
||||
/**
|
||||
* 构造对应展示数据和场景 根据obu的场景,add change delete确定是否展示
|
||||
*
|
||||
* @param appId 使用WarningTypeEnum获取icon、提示内容、tts内容 TODO 添加事件频繁播报拦截
|
||||
*
|
||||
* @see com.mogo.module.common.enums.EventTypeEnum
|
||||
*/
|
||||
private fun handleSdkObu(
|
||||
appId: String,
|
||||
direction: WarningDirectionEnum,
|
||||
status: Int,
|
||||
level: Int,
|
||||
info: MogoObuRvWarningData
|
||||
) {
|
||||
// 这里排除需要特殊定制的语音及文案外,其余的都可以使用 EventTypeEnumNew 提供的
|
||||
var alertContent: String = ""
|
||||
var ttsContent: String = ""
|
||||
var changeVisualAngle = false
|
||||
when (appId) {
|
||||
//交叉路口碰撞预警
|
||||
MogoObuConstants.V2X_WARNING_TYPE.FCW.toString() -> {
|
||||
alertContent =
|
||||
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
|
||||
ttsContent =
|
||||
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
|
||||
}
|
||||
|
||||
//交叉路口碰撞预警
|
||||
MogoObuConstants.V2X_WARNING_TYPE.ICW.toString() -> {
|
||||
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType)
|
||||
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType)
|
||||
}
|
||||
//交叉路口碰撞预警
|
||||
MogoObuConstants.V2X_WARNING_TYPE.ICW.toString() -> {
|
||||
alertContent =
|
||||
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType)
|
||||
ttsContent =
|
||||
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType)
|
||||
}
|
||||
|
||||
//左转辅助预警
|
||||
MogoObuConstants.V2X_WARNING_TYPE.LTA.toString() -> {
|
||||
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_LTA.poiType)
|
||||
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_LTA.poiType)
|
||||
}
|
||||
//左转辅助预警
|
||||
MogoObuConstants.V2X_WARNING_TYPE.LTA.toString() -> {
|
||||
alertContent =
|
||||
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_LTA.poiType)
|
||||
ttsContent =
|
||||
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_LTA.poiType)
|
||||
}
|
||||
|
||||
//盲区预警
|
||||
MogoObuConstants.V2X_WARNING_TYPE.BSW.toString() -> {
|
||||
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType)
|
||||
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType)
|
||||
if (
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_LEFT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT
|
||||
) { //左后
|
||||
changeVisualAngle = true
|
||||
ttsContent = String.format(ttsContent, "左")
|
||||
alertContent = String.format(alertContent, "左")
|
||||
} else if (
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_RIGHT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT
|
||||
) { //右后
|
||||
changeVisualAngle = true
|
||||
ttsContent = String.format(ttsContent, "右")
|
||||
alertContent = String.format(alertContent, "右")
|
||||
}
|
||||
//盲区预警
|
||||
MogoObuConstants.V2X_WARNING_TYPE.BSW.toString() -> {
|
||||
ttsContent =
|
||||
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType)
|
||||
alertContent =
|
||||
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType)
|
||||
if (
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_LEFT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT
|
||||
) { //左后
|
||||
changeVisualAngle = true
|
||||
ttsContent = String.format(ttsContent, "左")
|
||||
alertContent = String.format(alertContent, "左")
|
||||
} else if (
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_RIGHT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT
|
||||
) { //右后
|
||||
changeVisualAngle = true
|
||||
ttsContent = String.format(ttsContent, "右")
|
||||
alertContent = String.format(alertContent, "右")
|
||||
}
|
||||
}
|
||||
|
||||
// 变道预警,注意左后车辆/注意右后车辆
|
||||
MogoObuConstants.V2X_WARNING_TYPE.LCW.toString() -> {
|
||||
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType)
|
||||
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType)
|
||||
if (
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_LEFT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT
|
||||
) {
|
||||
ttsContent = String.format(ttsContent, "左")
|
||||
alertContent = String.format(alertContent, "左")
|
||||
} else if (
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_RIGHT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT
|
||||
) {
|
||||
ttsContent = String.format(ttsContent, "右")
|
||||
alertContent = String.format(alertContent, "右")
|
||||
}
|
||||
// 变道预警,注意左后车辆/注意右后车辆
|
||||
MogoObuConstants.V2X_WARNING_TYPE.LCW.toString() -> {
|
||||
alertContent =
|
||||
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType)
|
||||
ttsContent =
|
||||
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType)
|
||||
if (
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_LEFT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT
|
||||
) {
|
||||
ttsContent = String.format(ttsContent, "左")
|
||||
alertContent = String.format(alertContent, "左")
|
||||
} else if (
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_RIGHT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT
|
||||
) {
|
||||
ttsContent = String.format(ttsContent, "右")
|
||||
alertContent = String.format(alertContent, "右")
|
||||
}
|
||||
}
|
||||
|
||||
//逆向超车预警
|
||||
MogoObuConstants.V2X_WARNING_TYPE.DNPW.toString() -> {
|
||||
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_DNPW.poiType)
|
||||
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_DNPW.poiType)
|
||||
}
|
||||
//逆向超车预警
|
||||
MogoObuConstants.V2X_WARNING_TYPE.DNPW.toString() -> {
|
||||
alertContent =
|
||||
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_DNPW.poiType)
|
||||
ttsContent =
|
||||
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_DNPW.poiType)
|
||||
}
|
||||
|
||||
//紧急制动预警
|
||||
MogoObuConstants.V2X_WARNING_TYPE.EBW.toString() -> {
|
||||
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_EBW.poiType)
|
||||
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_EBW.poiType)
|
||||
}
|
||||
//紧急制动预警
|
||||
MogoObuConstants.V2X_WARNING_TYPE.EBW.toString() -> {
|
||||
alertContent =
|
||||
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_EBW.poiType)
|
||||
ttsContent =
|
||||
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_EBW.poiType)
|
||||
}
|
||||
|
||||
//异常车辆提醒
|
||||
MogoObuConstants.V2X_WARNING_TYPE.AVW.toString() -> {
|
||||
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_AVW.poiType)
|
||||
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_AVW.poiType)
|
||||
alertContent = String.format(alertContent, direction.desc)
|
||||
ttsContent = String.format(ttsContent, direction.desc)
|
||||
}
|
||||
//异常车辆提醒
|
||||
MogoObuConstants.V2X_WARNING_TYPE.AVW.toString() -> {
|
||||
alertContent =
|
||||
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_AVW.poiType)
|
||||
ttsContent =
|
||||
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_AVW.poiType)
|
||||
alertContent = String.format(alertContent, direction.desc)
|
||||
ttsContent = String.format(ttsContent, direction.desc)
|
||||
}
|
||||
|
||||
//车辆失控预警
|
||||
MogoObuConstants.V2X_WARNING_TYPE.CLW.toString() -> {
|
||||
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType)
|
||||
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType)
|
||||
alertContent = String.format(alertContent, direction.desc)
|
||||
ttsContent = String.format(ttsContent, direction.desc)
|
||||
}
|
||||
//车辆失控预警
|
||||
MogoObuConstants.V2X_WARNING_TYPE.EVW.toString() -> {
|
||||
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType)
|
||||
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType)
|
||||
}
|
||||
//车辆失控预警
|
||||
MogoObuConstants.V2X_WARNING_TYPE.CLW.toString() -> {
|
||||
alertContent =
|
||||
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType)
|
||||
ttsContent =
|
||||
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType)
|
||||
alertContent = String.format(alertContent, direction.desc)
|
||||
ttsContent = String.format(ttsContent, direction.desc)
|
||||
}
|
||||
//车辆失控预警
|
||||
MogoObuConstants.V2X_WARNING_TYPE.EVW.toString() -> {
|
||||
alertContent =
|
||||
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType)
|
||||
ttsContent =
|
||||
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType)
|
||||
}
|
||||
|
||||
// 这里处理固定的提示信息,包括了<紧急车辆提醒>
|
||||
else -> { //TODO
|
||||
// 这里处理固定的提示信息,包括了<紧急车辆提醒>
|
||||
else -> { //TODO
|
||||
// ttsContent = EventTypeEnumNew.getWarningTts(appId.toString())
|
||||
// alertContent = EventTypeEnumNew.getWarningContent(appId.toString())
|
||||
}
|
||||
}
|
||||
|
||||
when (status) {
|
||||
// 添加,更新 add的时候,可能级别是2,
|
||||
MogoObuConstants.STATUS.ADD,
|
||||
MogoObuConstants.STATUS.UPDATE -> {
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"new handleSdkObu appId2 = $appId --- level = $level ---ttsContent = $ttsContent --- alertContent = $alertContent --- direction = $direction"
|
||||
)
|
||||
if (level == 2 || level == 3) {
|
||||
//不显示弹框,其它保留
|
||||
CallerMsgBoxManager.saveMsgBox(
|
||||
MsgBoxBean(
|
||||
MsgBoxType.V2X,
|
||||
V2XMsg(
|
||||
appId,
|
||||
alertContent,
|
||||
ttsContent
|
||||
)
|
||||
).apply {
|
||||
sourceType = DataSourceType.OBU
|
||||
}
|
||||
)
|
||||
CallerHmiManager.warningV2X(
|
||||
appId,
|
||||
alertContent,
|
||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
(appId + direction.direction),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的
|
||||
object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {
|
||||
super.onShow()
|
||||
if (changeVisualAngle) {
|
||||
CallerVisualAngleManager.changeVisualAngle(TooClose)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDismiss() {
|
||||
// 关闭警告红边
|
||||
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
||||
if (changeVisualAngle) {
|
||||
CallerVisualAngleManager.changeVisualAngle(Default())
|
||||
}
|
||||
}
|
||||
},
|
||||
true,
|
||||
5000L
|
||||
)
|
||||
//显示警告红边
|
||||
CallerHmiManager.showWarning(direction)
|
||||
}
|
||||
//更新周边车辆进行预警颜色变换,车辆实时移动和变色 ,UUID不需要匹配了
|
||||
TrafficDataConvertUtilsNew.cvxV2vThreatIndInfo2TrafficData(info)?.let {
|
||||
CallerMapUIServiceManager.getMarkerService()
|
||||
?.updateITrafficThreatLevelInfo(it)
|
||||
}
|
||||
}
|
||||
// 删除
|
||||
MogoObuConstants.STATUS.DELETE -> {
|
||||
// 关闭警告红边
|
||||
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
||||
// 移除顶部弹窗
|
||||
// CallerHmiManager.disableWarningV2X((appId + direction.direction))
|
||||
//更新周边车辆进行预警颜色变换,车辆实时移动和变色
|
||||
TrafficDataConvertUtilsNew.cvxV2vThreatIndInfo2TrafficData(info)?.let {
|
||||
it.threatLevel = 0x01
|
||||
CallerMapUIServiceManager.getMarkerService()
|
||||
?.updateITrafficThreatLevelInfo(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理红绿灯
|
||||
*/
|
||||
private fun handlerTrafficLight(appId: Int, status: Int, lights: List<SpatLight>) {
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"handlerTrafficLight --- status = $status ---lights.size = ${lights.size} ---lights = $lights ---appId = $appId"
|
||||
)
|
||||
when (status) {
|
||||
// 添加
|
||||
MogoObuConstants.STATUS.ADD,
|
||||
MogoObuConstants.STATUS.UPDATE
|
||||
-> {
|
||||
if (lights != null && lights.isNotEmpty()) {
|
||||
changeTrafficLightStatus(appId, lights)
|
||||
}
|
||||
when (status) {
|
||||
// 添加,更新 add的时候,可能级别是2,
|
||||
MogoObuConstants.STATUS.ADD,
|
||||
MogoObuConstants.STATUS.UPDATE -> {
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"new handleSdkObu appId2 = $appId --- level = $level ---ttsContent = $ttsContent --- alertContent = $alertContent --- direction = $direction"
|
||||
)
|
||||
if (level == 2 || level == 3) {
|
||||
//不显示弹框,其它保留
|
||||
CallerMsgBoxManager.saveMsgBox(
|
||||
MsgBoxBean(
|
||||
MsgBoxType.V2X,
|
||||
V2XMsg(
|
||||
appId,
|
||||
alertContent,
|
||||
ttsContent
|
||||
)
|
||||
).apply {
|
||||
sourceType = DataSourceType.OBU
|
||||
}
|
||||
)
|
||||
CallerHmiManager.warningV2X(
|
||||
appId,
|
||||
alertContent,
|
||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
(appId + direction.direction),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的
|
||||
object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {
|
||||
super.onShow()
|
||||
if (changeVisualAngle) {
|
||||
CallerVisualAngleManager.changeVisualAngle(TooClose)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDismiss() {
|
||||
// 关闭警告红边
|
||||
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
||||
if (changeVisualAngle) {
|
||||
CallerVisualAngleManager.changeVisualAngle(Default())
|
||||
}
|
||||
}
|
||||
},
|
||||
true,
|
||||
5000L
|
||||
)
|
||||
//显示警告红边
|
||||
CallerHmiManager.showWarning(direction)
|
||||
}
|
||||
// 删除
|
||||
MogoObuConstants.STATUS.DELETE -> {
|
||||
// 移除顶部弹窗
|
||||
CallerHmiManager.disableWarningTrafficLight()
|
||||
CallerHmiManager.disableWarningV2X(appId.toString())
|
||||
isShowGreenWave = false
|
||||
isShowRunRedLight = false
|
||||
isYellowLight = false
|
||||
//更新周边车辆进行预警颜色变换,车辆实时移动和变色 ,UUID不需要匹配了
|
||||
TrafficDataConvertUtilsNew.cvxV2vThreatIndInfo2TrafficData(info)?.let {
|
||||
CallerMapUIServiceManager.getMarkerService()
|
||||
?.updateITrafficThreatLevelInfo(it)
|
||||
}
|
||||
}
|
||||
// 删除
|
||||
MogoObuConstants.STATUS.DELETE -> {
|
||||
// 关闭警告红边
|
||||
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
||||
// 移除顶部弹窗
|
||||
// CallerHmiManager.disableWarningV2X((appId + direction.direction))
|
||||
//更新周边车辆进行预警颜色变换,车辆实时移动和变色
|
||||
TrafficDataConvertUtilsNew.cvxV2vThreatIndInfo2TrafficData(info)?.let {
|
||||
it.threatLevel = 0x01
|
||||
CallerMapUIServiceManager.getMarkerService()
|
||||
?.updateITrafficThreatLevelInfo(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理红绿灯
|
||||
*/
|
||||
private fun handlerTrafficLight(appId: Int, status: Int, lights: List<SpatLight>) {
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"handlerTrafficLight --- status = $status ---lights.size = ${lights.size} ---lights = $lights ---appId = $appId"
|
||||
)
|
||||
when (status) {
|
||||
// 添加
|
||||
MogoObuConstants.STATUS.ADD,
|
||||
MogoObuConstants.STATUS.UPDATE
|
||||
-> {
|
||||
if (lights != null && lights.isNotEmpty()) {
|
||||
changeTrafficLightStatus(appId, lights)
|
||||
}
|
||||
}
|
||||
// 删除
|
||||
MogoObuConstants.STATUS.DELETE -> {
|
||||
// 移除顶部弹窗
|
||||
CallerHmiManager.disableWarningTrafficLight()
|
||||
CallerHmiManager.disableWarningV2X(appId.toString())
|
||||
isShowGreenWave = false
|
||||
isShowRunRedLight = false
|
||||
isYellowLight = false
|
||||
// lightCountDownRed = 1
|
||||
// lightCountDownGreen = 1
|
||||
// lightCountDownYellow = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var isRedLight = false
|
||||
private var isGreenLight = false
|
||||
private var isYellowLight = false
|
||||
private var isShowGreenWave = false
|
||||
private var isShowRunRedLight = false
|
||||
private var isRedLight = false
|
||||
private var isGreenLight = false
|
||||
private var isYellowLight = false
|
||||
private var isShowGreenWave = false
|
||||
private var isShowRunRedLight = false
|
||||
|
||||
// private var lightCountDownRed : Int = 1
|
||||
// private var lightCountDownGreen : Int = 1
|
||||
// private var lightCountDownYellow : Int = 1
|
||||
|
||||
|
||||
/**
|
||||
* 修改红绿灯
|
||||
*/
|
||||
@Synchronized
|
||||
private fun changeTrafficLightStatus(
|
||||
appId: Int,
|
||||
lights: List<SpatLight>
|
||||
) {
|
||||
var ttsContent = ""
|
||||
var alertContent = ""
|
||||
//这里需要根据真实数据确定 index 取值方式
|
||||
val currentLight = lights[0]
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"changeTrafficLightStatus currentLight = $currentLight ----currentLight.light = ${currentLight.light} ---currentLight.phase = ${currentLight.phaseId} ---appId = $appId --countDown = ${currentLight.countDown.toInt()}"
|
||||
)
|
||||
// 闯红灯预警,绿波通行和闯红灯是互斥的
|
||||
when (appId) {
|
||||
0 -> {//不可用 V2I_RLVW_VIOLATION_TYPE_UNAVAILABLE 无效
|
||||
/**
|
||||
* 修改红绿灯
|
||||
*/
|
||||
@Synchronized
|
||||
private fun changeTrafficLightStatus(
|
||||
appId: Int,
|
||||
lights: List<SpatLight>
|
||||
) {
|
||||
var ttsContent = ""
|
||||
var alertContent = ""
|
||||
//这里需要根据真实数据确定 index 取值方式
|
||||
val currentLight = lights[0]
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"changeTrafficLightStatus currentLight = $currentLight ----currentLight.light = ${currentLight.light} ---currentLight.phase = ${currentLight.phaseId} ---appId = $appId --countDown = ${currentLight.countDown.toInt()}"
|
||||
)
|
||||
// 闯红灯预警,绿波通行和闯红灯是互斥的
|
||||
when (appId) {
|
||||
0 -> {//不可用 V2I_RLVW_VIOLATION_TYPE_UNAVAILABLE 无效
|
||||
|
||||
}
|
||||
1 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT 一个红灯周期只显示一次
|
||||
if (!isShowRunRedLight) {
|
||||
isShowRunRedLight = true
|
||||
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,
|
||||
V2XMsg(
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
|
||||
alertContent,
|
||||
ttsContent
|
||||
)
|
||||
).apply {
|
||||
sourceType = DataSourceType.OBU
|
||||
}
|
||||
)
|
||||
|
||||
CallerHmiManager.warningV2X(
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
|
||||
alertContent,
|
||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
|
||||
null,
|
||||
true,
|
||||
5000L
|
||||
)
|
||||
}
|
||||
1 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT 一个红灯周期只显示一次
|
||||
if (!isShowRunRedLight) {
|
||||
isShowRunRedLight = true
|
||||
CallerHmiManager.disableWarningV2X(1667.toString())
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"changeTrafficLightStatus 闯红灯 --------> "
|
||||
}
|
||||
|
||||
2 -> { //绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION 一个绿灯周期只显示一次 100m的时候
|
||||
if (!isShowGreenWave) {
|
||||
isShowGreenWave = true
|
||||
CallerHmiManager.disableWarningV2X(1666.toString())
|
||||
|
||||
var minSpeedTemp = Math.round(currentLight.suggestMinSpeed * 3.6)
|
||||
var maxSpeedTemp = Math.round(currentLight.suggestMaxSpeed * 3.6)
|
||||
if (minSpeedTemp == maxSpeedTemp) {
|
||||
minSpeedTemp -= 5
|
||||
}
|
||||
|
||||
val adviceSpeed = "$minSpeedTemp - $maxSpeedTemp"
|
||||
val adviceSpeedTts = "$minSpeedTemp 到 $maxSpeedTemp"
|
||||
|
||||
// val adviceSpeed =
|
||||
// "${Math.round(currentLight.suggestMinSpeed*3.6)} - ${Math.round(currentLight.suggestMaxSpeed*3.6)}"
|
||||
// val adviceSpeedTts =
|
||||
// "${Math.round(currentLight.suggestMinSpeed*3.6)} 到 ${Math.round(currentLight.suggestMaxSpeed*3.6)}"
|
||||
|
||||
ttsContent =
|
||||
String.format(
|
||||
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
|
||||
adviceSpeedTts
|
||||
)
|
||||
ttsContent =
|
||||
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType)
|
||||
alertContent =
|
||||
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType)
|
||||
alertContent =
|
||||
String.format(
|
||||
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
|
||||
adviceSpeed
|
||||
)
|
||||
|
||||
val maxSpeed = currentLight.suggestMaxSpeed
|
||||
if (maxSpeed > 0) {
|
||||
CallerMsgBoxManager.saveMsgBox(
|
||||
MsgBoxBean(
|
||||
MsgBoxType.V2X,
|
||||
V2XMsg(
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
alertContent,
|
||||
ttsContent
|
||||
)
|
||||
@@ -979,118 +1053,61 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
)
|
||||
|
||||
CallerHmiManager.warningV2X(
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
alertContent,
|
||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
|
||||
appId.toString(),
|
||||
null,
|
||||
true,
|
||||
5000L
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
2 -> { //绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION 一个绿灯周期只显示一次 100m的时候
|
||||
if (!isShowGreenWave) {
|
||||
isShowGreenWave = true
|
||||
CallerHmiManager.disableWarningV2X(1666.toString())
|
||||
|
||||
var minSpeedTemp = Math.round(currentLight.suggestMinSpeed*3.6)
|
||||
var maxSpeedTemp = Math.round(currentLight.suggestMaxSpeed*3.6)
|
||||
if (minSpeedTemp == maxSpeedTemp) {
|
||||
minSpeedTemp -= 5
|
||||
}
|
||||
|
||||
val adviceSpeed = "$minSpeedTemp - $maxSpeedTemp"
|
||||
val adviceSpeedTts = "$minSpeedTemp 到 $maxSpeedTemp"
|
||||
|
||||
// val adviceSpeed =
|
||||
// "${Math.round(currentLight.suggestMinSpeed*3.6)} - ${Math.round(currentLight.suggestMaxSpeed*3.6)}"
|
||||
// val adviceSpeedTts =
|
||||
// "${Math.round(currentLight.suggestMinSpeed*3.6)} 到 ${Math.round(currentLight.suggestMaxSpeed*3.6)}"
|
||||
|
||||
ttsContent =
|
||||
String.format(
|
||||
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
|
||||
adviceSpeedTts
|
||||
)
|
||||
alertContent =
|
||||
String.format(
|
||||
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
|
||||
adviceSpeed
|
||||
)
|
||||
|
||||
val maxSpeed = currentLight.suggestMaxSpeed
|
||||
if (maxSpeed > 0) {
|
||||
CallerMsgBoxManager.saveMsgBox(
|
||||
MsgBoxBean(
|
||||
MsgBoxType.V2X,
|
||||
V2XMsg(
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
alertContent,
|
||||
ttsContent
|
||||
)
|
||||
).apply {
|
||||
sourceType = DataSourceType.OBU
|
||||
}
|
||||
)
|
||||
|
||||
CallerHmiManager.warningV2X(
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
alertContent,
|
||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
appId.toString(),
|
||||
null,
|
||||
true,
|
||||
5000L
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
when (currentLight.light) {
|
||||
// 灯光不可用
|
||||
0 -> {
|
||||
CallerObuTrafficLightListenerManager.invokeObuTrafficLight(0)
|
||||
}
|
||||
// 红灯
|
||||
2, 3 -> {
|
||||
if (!isRedLight) {
|
||||
CallerHmiManager.disableWarningV2X(appId.toString())
|
||||
isRedLight = true
|
||||
}
|
||||
isGreenLight = false
|
||||
isYellowLight = false
|
||||
CallerObuTrafficLightListenerManager.invokeObuTrafficLight(1)
|
||||
val red = currentLight.countDown.toInt()
|
||||
CallerHmiManager.changeCountdownRed(red)
|
||||
}
|
||||
|
||||
// 绿灯
|
||||
4, 5, 6 -> {
|
||||
if (!isGreenLight) {
|
||||
CallerHmiManager.disableWarningV2X(appId.toString())
|
||||
isGreenLight = true
|
||||
}
|
||||
isRedLight = false
|
||||
isYellowLight = false
|
||||
CallerObuTrafficLightListenerManager.invokeObuTrafficLight(3)
|
||||
val green = currentLight.countDown.toInt()
|
||||
CallerHmiManager.changeCountdownGreen(green)
|
||||
}
|
||||
|
||||
// 黄灯
|
||||
7, 8 -> {
|
||||
if (!isYellowLight) {
|
||||
isYellowLight = true
|
||||
}
|
||||
isRedLight = false
|
||||
isGreenLight = false
|
||||
CallerHmiManager.disableWarningV2X(appId.toString())
|
||||
CallerObuTrafficLightListenerManager.invokeObuTrafficLight(2)
|
||||
val yellow = currentLight.countDown.toInt()
|
||||
CallerHmiManager.changeCountdownYellow(yellow)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
when (currentLight.light) {
|
||||
// 灯光不可用
|
||||
0 -> {
|
||||
CallerObuTrafficLightListenerManager.invokeObuTrafficLight(0)
|
||||
}
|
||||
// 红灯
|
||||
2, 3 -> {
|
||||
if (!isRedLight) {
|
||||
CallerHmiManager.disableWarningV2X(appId.toString())
|
||||
isRedLight = true
|
||||
}
|
||||
isGreenLight = false
|
||||
isYellowLight = false
|
||||
CallerObuTrafficLightListenerManager.invokeObuTrafficLight(1)
|
||||
val red = currentLight.countDown.toInt()
|
||||
CallerHmiManager.changeCountdownRed(red)
|
||||
}
|
||||
|
||||
// 绿灯
|
||||
4, 5, 6 -> {
|
||||
if (!isGreenLight) {
|
||||
CallerHmiManager.disableWarningV2X(appId.toString())
|
||||
isGreenLight = true
|
||||
}
|
||||
isRedLight = false
|
||||
isYellowLight = false
|
||||
CallerObuTrafficLightListenerManager.invokeObuTrafficLight(3)
|
||||
val green = currentLight.countDown.toInt()
|
||||
CallerHmiManager.changeCountdownGreen(green)
|
||||
}
|
||||
|
||||
// 黄灯
|
||||
7, 8 -> {
|
||||
if (!isYellowLight) {
|
||||
isYellowLight = true
|
||||
}
|
||||
isRedLight = false
|
||||
isGreenLight = false
|
||||
CallerHmiManager.disableWarningV2X(appId.toString())
|
||||
CallerObuTrafficLightListenerManager.invokeObuTrafficLight(2)
|
||||
val yellow = currentLight.countDown.toInt()
|
||||
CallerHmiManager.changeCountdownYellow(yellow)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.mogo.eagle.core.function.obu.mogo.receiver
|
||||
package com.mogo.eagle.core.function.datacenter.obu.receiver
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
//import com.mogo.eagle.core.function.obu.mogo.MogoObuConst
|
||||
//import com.mogo.eagle.core.function.obu.mogo.MogoPrivateObuManager
|
||||
//import com.mogo.eagle.core.function.datacenter.obu.MogoPrivateObuManager
|
||||
//import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
//import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
|
||||
//import com.zhidao.support.obu.constants.ObuConstants
|
||||
@@ -1,10 +1,9 @@
|
||||
package com.mogo.eagle.core.function.obu.mogo.receiver
|
||||
package com.mogo.eagle.core.function.datacenter.obu.receiver
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.function.obu.mogo.MogoPrivateObuNewManager
|
||||
import com.mogo.eagle.core.function.datacenter.obu.MogoPrivateObuNewManager
|
||||
import com.mogo.support.obu.model.MogoObuRvWarningData
|
||||
import com.mogo.support.obu.model.advance.V2xWarning
|
||||
import com.mogo.support.obu.model.advance.VehBasics
|
||||
@@ -1,16 +1,11 @@
|
||||
package com.mogo.eagle.core.function.obu.mogo.receiver
|
||||
package com.mogo.eagle.core.function.datacenter.obu.receiver
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.function.obu.mogo.MogoPrivateObuNewManager
|
||||
import com.mogo.eagle.core.function.datacenter.obu.MogoPrivateObuNewManager
|
||||
import com.mogo.support.obu.model.MogoObuRsiWarningData
|
||||
import com.mogo.support.obu.model.MogoObuRvWarningData
|
||||
import com.mogo.support.obu.model.advance.RsiWarning
|
||||
import com.mogo.support.obu.model.advance.V2xWarning
|
||||
import com.mogo.support.obu.model.advance.VehBasics
|
||||
import com.mogo.support.obu.model.advance.WarningData
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.mogo.eagle.core.function.obu.mogo.receiver
|
||||
package com.mogo.eagle.core.function.datacenter.obu.receiver
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
//import com.mogo.eagle.core.function.obu.mogo.MogoObuConst
|
||||
//import com.mogo.eagle.core.function.obu.mogo.MogoPrivateObuManager
|
||||
//import com.mogo.eagle.core.function.datacenter.obu.MogoPrivateObuManager
|
||||
//import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
//import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
|
||||
//import com.zhidao.support.obu.constants.ObuConstants
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.mogo.eagle.core.function.obu.mogo.receiver
|
||||
package com.mogo.eagle.core.function.datacenter.obu.receiver
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
//import com.mogo.eagle.core.function.obu.mogo.MogoObuConst
|
||||
//import com.mogo.eagle.core.function.obu.mogo.MogoPrivateObuManager
|
||||
//import com.mogo.eagle.core.function.datacenter.obu.MogoPrivateObuManager
|
||||
//import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
//import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
|
||||
//import com.zhidao.support.obu.model.CvxHvInfoIndInfo
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.mogo.eagle.core.function.obu.mogo.utils
|
||||
package com.mogo.eagle.core.function.datacenter.obu.utils
|
||||
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
@@ -5,6 +5,7 @@ import android.content.Context
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.eagle.core.data.EnvConfig
|
||||
import com.mogo.eagle.core.data.bindingcar.ModifyBindingcarInfo
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainLogParam
|
||||
@@ -13,6 +14,7 @@ import com.mogo.eagle.core.data.deva.scene.SceneTAG
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.function.api.devatools.IDevaToolsProvider
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.BadCaseManager
|
||||
import com.zhjt.mogo_core_function_devatools.env.EnvChangeManager
|
||||
import com.zhjt.mogo_core_function_devatools.binding.BindingCarManager.Companion.bindingCarManager
|
||||
import com.zhjt.mogo_core_function_devatools.funcconfig.FuncConfigCenter.Companion.bizConfigCenter
|
||||
import com.zhjt.mogo_core_function_devatools.funcconfig.FuncConfigImpl
|
||||
@@ -142,6 +144,10 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
traceManager.syncConfig()
|
||||
}
|
||||
|
||||
override fun getEnvConfig(): EnvConfig? {
|
||||
return EnvChangeManager.getEnvConfig()
|
||||
}
|
||||
|
||||
override fun modifyCarInfo(callBack: (ModifyBindingcarInfo) -> Unit) {
|
||||
bindingCarManager.modifyCarInfo(callBack)
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.Context.MODE_PRIVATE
|
||||
import android.os.Process
|
||||
import com.mogo.commons.constants.*
|
||||
import com.mogo.commons.debug.*
|
||||
import com.mogo.eagle.core.data.EnvConfig
|
||||
import com.mogo.eagle.core.function.call.map.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.*
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
@@ -47,6 +48,11 @@ object EnvChangeManager {
|
||||
}
|
||||
}
|
||||
|
||||
fun getConfigNetMode(): Int {
|
||||
val cache = getConfig()
|
||||
return cache?.second ?: -1
|
||||
}
|
||||
|
||||
fun getNetMode(): String {
|
||||
val cache = getConfig()
|
||||
return if (cache == null) {
|
||||
@@ -88,6 +94,4 @@ object EnvChangeManager {
|
||||
if (it.first == "010") 116.397446 else 112.582654,
|
||||
if (it.first == "010") 39.909004 else 26.816478)
|
||||
}
|
||||
|
||||
data class EnvConfig(val cityCode: String, val netMode: Int, val lat: Double, val lon: Double)
|
||||
}
|
||||
@@ -69,11 +69,10 @@ dependencies {
|
||||
// debugImplementation rootProject.ext.dependencies.debugleakcanary
|
||||
// releaseImplementation rootProject.ext.dependencies.releaseleakcanary
|
||||
|
||||
implementation rootProject.ext.dependencies.mogoobu
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
|
||||
implementation rootProject.ext.dependencies.mogoami
|
||||
|
||||
implementation rootProject.ext.dependencies.android_start_up
|
||||
implementation rootProject.ext.dependencies.cicle_indicator
|
||||
implementation rootProject.ext.dependencies.koomnative
|
||||
@@ -88,7 +87,6 @@ dependencies {
|
||||
api rootProject.ext.dependencies.mogo_core_data
|
||||
api rootProject.ext.dependencies.mogo_core_utils
|
||||
api rootProject.ext.dependencies.mogo_core_network
|
||||
api rootProject.ext.dependencies.mogo_core_function_obu_mogo
|
||||
api rootProject.ext.dependencies.mogo_core_function_map
|
||||
api rootProject.ext.dependencies.mogo_core_function_v2x
|
||||
api rootProject.ext.dependencies.mogo_core_function_devatools
|
||||
@@ -104,14 +102,12 @@ dependencies {
|
||||
api project(':core:mogo-core-res')
|
||||
api project(':core:mogo-core-data')
|
||||
api project(':core:mogo-core-utils')
|
||||
api project(':core:function-impl:mogo-core-function-obu-mogo')
|
||||
api project(':core:function-impl:mogo-core-function-map')
|
||||
api project(':core:function-impl:mogo-core-function-v2x')
|
||||
api project(':core:function-impl:mogo-core-function-devatools')
|
||||
api project(':core:function-impl:mogo-core-function-chat')
|
||||
api project(':core:function-impl:mogo-core-function-datacenter')
|
||||
api project(':core:function-impl:mogo-core-function-biz')
|
||||
|
||||
api project(':core:mogo-core-function-call')
|
||||
api project(':libraries:mogo-adas')
|
||||
api project(':libraries:map-usbcamera')
|
||||
|
||||
@@ -3,7 +3,11 @@ package com.mogo.eagle.core.function.hmi.receiver
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import android.view.View
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.LimitingVelocityView_TAG
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerViewLimitingVelocityListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.WaringConst
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
@@ -57,13 +61,13 @@ class V2XLimitingVelocityBroadcastReceiver : BroadcastReceiver() {
|
||||
* @param limitingVelocitySpeed 限速速度
|
||||
*/
|
||||
private fun dispatchShowWaring(limitingVelocitySpeed: Int) {
|
||||
CallerHmiManager.showLimitingVelocity(limitingVelocitySpeed, 1)
|
||||
CallerViewLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(limitingVelocitySpeed,DataSourceType.MAP)
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭限速标志
|
||||
*/
|
||||
private fun dispatchCloseWaring() {
|
||||
CallerHmiManager.disableLimitingVelocity()
|
||||
CallerHmiViewControlListenerManager.invokeVisible(LimitingVelocityView_TAG, View.GONE)
|
||||
}
|
||||
}
|
||||
@@ -4,15 +4,17 @@ import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.hmi.WaringConst
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnum
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.V2XMsg
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerViewLimitingVelocityListenerManager
|
||||
|
||||
/**
|
||||
* V2X 预警广播接收。用于跨应用,跨进程,内部也可以通过这种方式弹出预警提示框
|
||||
@@ -75,8 +77,8 @@ class V2XWarningBroadcastReceiver : BroadcastReceiver() {
|
||||
ttsContent: String?,
|
||||
tag: String?
|
||||
) {
|
||||
if (EventTypeEnum.TYPE_USECASE_ID_IVP.poiType == v2xType.toString()) {
|
||||
CallerHmiManager.showLimitingVelocity(1, 1)
|
||||
if (EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType == v2xType.toString()) {
|
||||
CallerViewLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(1,DataSourceType.MAP)
|
||||
}
|
||||
if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) {
|
||||
Log.d("MsgBox-V2XWarningBR", "alertContent或ttsContent为空!")
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.text.TextUtils
|
||||
import android.util.*
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.animation.AlphaAnimation
|
||||
@@ -24,38 +23,23 @@ import com.mogo.eagle.core.data.constants.MoGoFragmentPaths
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_RTS
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2I
|
||||
import com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnum
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
|
||||
import com.mogo.eagle.core.data.map.Infrastructure
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.RecordBagMsg
|
||||
import com.mogo.eagle.core.data.notice.NoticeNormalData
|
||||
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
|
||||
import com.mogo.eagle.core.data.report.ReportEntity
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
|
||||
import com.mogo.eagle.core.function.api.hmi.IMoGoHmiViewProxy
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.AutoPilotStatusView_TAG
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.CameraView_TAG
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.PerspectiveSwitchView_TAG
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.SpeedPanelView_TAG
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.ToolsView_TAG
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.TrafficLightView_TAG
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewLimitingVelocity
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoHmiProvider
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
|
||||
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager
|
||||
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.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Turning
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.notification.WarningFloat
|
||||
import com.mogo.eagle.core.function.hmi.ui.bindingcar.ModifyBindingCarDialog
|
||||
@@ -67,10 +51,10 @@ import com.mogo.eagle.core.function.hmi.ui.notice.NoticeCheckDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.notice.traffic.NoticeTrafficDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.CameraLiveView.Companion.cameraLiveView
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.IPCReportWindow
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView.Companion.toggleDebugView
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.ToolsView.Companion.toolsView
|
||||
import com.mogo.eagle.core.function.hmi.ui.tools.AdUpgradeDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.*
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
|
||||
import com.mogo.eagle.core.function.main.DisplayEffectsHelper
|
||||
import com.mogo.eagle.core.utilcode.kotlin.safeCancel
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
@@ -78,17 +62,12 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
import com.mogo.eagle.core.utilcode.reminder.api.IReminder
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils.millis2String
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
||||
import com.zhjt.service_biz.BizConfig
|
||||
import kotlinx.android.synthetic.main.fragment_hmi.*
|
||||
import kotlinx.coroutines.*
|
||||
import record_cache.RecordPanelOuterClass
|
||||
import java.util.concurrent.atomic.AtomicReference
|
||||
|
||||
/**
|
||||
@@ -100,7 +79,7 @@ import java.util.concurrent.atomic.AtomicReference
|
||||
class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
IMoGoHmiProvider,
|
||||
IMoGoHmiViewProxy,
|
||||
MoGoHmiContract.View{
|
||||
MoGoHmiContract.View {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "MoGoHmiFragment"
|
||||
@@ -110,9 +89,6 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
// todo 需要统一数据源 红绿灯 View代理
|
||||
private var mViewTrafficLight: IViewTrafficLight? = null
|
||||
|
||||
// todo 需要统一数据源 限速 View代理
|
||||
private var mViewLimitingVelocity: IViewLimitingVelocity? = null
|
||||
|
||||
private val lastSpeakJob by lazy { AtomicReference<Job>() }
|
||||
private var lastShowV2XJob: Job? = null
|
||||
|
||||
@@ -120,73 +96,16 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
|
||||
override fun initViews() {
|
||||
|
||||
//设置StatusBar初始状态
|
||||
CallerHmiViewControlListenerManager.updateStatusBarRightView(StatusBarView.TAG,FunctionBuildConfig.isDemoMode, "demoMode", DemoModeView(requireContext()))
|
||||
|
||||
//todo 新超,封装至消息盒子
|
||||
cbMsgBoxDriver.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (isChecked) {
|
||||
viewDriverMsgBoxList.visibility = View.VISIBLE
|
||||
viewDriverMsgBoxList.notifyData()
|
||||
viewDriverMsgBoxBubble.visibility = View.GONE
|
||||
viewDriverMsgBoxBubble.isShowData(false)
|
||||
CallerHmiManager.updateDriverMsgBoxTipView(false)
|
||||
} else {
|
||||
viewDriverMsgBoxList.visibility = View.GONE
|
||||
viewDriverMsgBoxBubble.visibility = View.VISIBLE
|
||||
viewDriverMsgBoxBubble.isShowData(true)
|
||||
}
|
||||
}
|
||||
|
||||
//todo 新超,封装至消息盒子
|
||||
cbMsgBoxPassenger.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (isChecked) {
|
||||
viewPassengerMsgBoxList.visibility = View.VISIBLE
|
||||
viewPassengerMsgBoxBubble.visibility = View.GONE
|
||||
viewPassengerMsgBoxBubble.isShowData(false)
|
||||
CallerHmiManager.updatePassengerMsgBoxTipView(false)
|
||||
} else {
|
||||
viewPassengerMsgBoxList.visibility = View.GONE
|
||||
viewPassengerMsgBoxBubble.visibility = View.VISIBLE
|
||||
viewPassengerMsgBoxBubble.isShowData(true)
|
||||
}
|
||||
}
|
||||
|
||||
//todo 加载端自己控制 --- 新超 本期我们设置到bus,taxi,sweep Fragment
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
cbMsgBoxDriver.visibility = View.VISIBLE
|
||||
viewDriverMsgBoxBubble.visibility = View.VISIBLE
|
||||
}
|
||||
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) &&
|
||||
AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)
|
||||
) {
|
||||
cbMsgBoxPassenger.visibility = View.VISIBLE
|
||||
viewPassengerMsgBoxBubble.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
// todo 新超
|
||||
override fun updateDriverMsgBoxTipView(show: Boolean) {
|
||||
if (show) {
|
||||
MsgBoxTipView.visibility = View.VISIBLE
|
||||
} else {
|
||||
MsgBoxTipView.visibility = View.GONE
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// todo 新超
|
||||
override fun updatePassengerMsgBoxTipView(show: Boolean) {
|
||||
if (show) {
|
||||
MsgBoxPTipView.visibility = View.VISIBLE
|
||||
} else {
|
||||
MsgBoxPTipView.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
//todo 确认使用方 taxi bus 乘客/司机
|
||||
setProxyLimitingSpeedView(viewLimitingVelocity)
|
||||
}
|
||||
|
||||
/** todo ----------------------------------------------**/
|
||||
@@ -197,13 +116,6 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
mViewTrafficLight = view
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 限速 代理View
|
||||
*/
|
||||
override fun setProxyLimitingSpeedView(view: IViewLimitingVelocity) {
|
||||
mViewLimitingVelocity = view
|
||||
}
|
||||
|
||||
/**
|
||||
* ok
|
||||
* 工控机重启返回结果
|
||||
@@ -249,23 +161,38 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
}
|
||||
|
||||
override fun setStatusBarDarkOrLight(light: Boolean) {
|
||||
CallerHmiViewControlListenerManager.setStatusBarDarkOrLight(StatusBarView.TAG,light)
|
||||
CallerHmiViewControlListenerManager.setStatusBarDarkOrLight(StatusBarView.TAG, light)
|
||||
}
|
||||
|
||||
override fun updateStatusBarRightView(insert: Boolean, tag: String, viewGroup: ViewGroup) {
|
||||
CallerHmiViewControlListenerManager.updateStatusBarRightView(StatusBarView.TAG,insert, tag, viewGroup)
|
||||
CallerHmiViewControlListenerManager.updateStatusBarRightView(
|
||||
StatusBarView.TAG,
|
||||
insert,
|
||||
tag,
|
||||
viewGroup
|
||||
)
|
||||
}
|
||||
|
||||
override fun updateStatusBarLeftView(insert: Boolean, tag: String, viewGroup: ViewGroup) {
|
||||
CallerHmiViewControlListenerManager.updateStatusBarLeftView(StatusBarView.TAG,insert, tag, viewGroup)
|
||||
CallerHmiViewControlListenerManager.updateStatusBarLeftView(
|
||||
StatusBarView.TAG,
|
||||
insert,
|
||||
tag,
|
||||
viewGroup
|
||||
)
|
||||
}
|
||||
|
||||
override fun updateStatusBarDownloadView(insert: Boolean, tag: String, progress: Int) {
|
||||
CallerHmiViewControlListenerManager.updateStatusBarDownloadView(StatusBarView.TAG,insert, tag, progress)
|
||||
CallerHmiViewControlListenerManager.updateStatusBarDownloadView(
|
||||
StatusBarView.TAG,
|
||||
insert,
|
||||
tag,
|
||||
progress
|
||||
)
|
||||
}
|
||||
|
||||
override fun updateMfStatus(tag: String, status: Boolean) {
|
||||
CallerHmiViewControlListenerManager.updateMfStatus(StatusBarView.TAG,tag, status)
|
||||
CallerHmiViewControlListenerManager.updateMfStatus(StatusBarView.TAG, tag, status)
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
@@ -284,30 +211,6 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
DisplayEffectsHelper.getInstance().display()
|
||||
}
|
||||
|
||||
override fun setTrafficLightVrVisibility(visibility: Int) {
|
||||
CallerHmiViewControlListenerManager.invokeVisible(TrafficLightView_TAG,visibility)
|
||||
}
|
||||
|
||||
override fun setToolsViewVisibility(visibility: Int) {
|
||||
CallerHmiViewControlListenerManager.invokeVisible(ToolsView_TAG,visibility)
|
||||
}
|
||||
|
||||
override fun setSpeedChartViewVisibility(visibility: Int) {
|
||||
CallerHmiViewControlListenerManager.invokeVisible(SpeedPanelView_TAG,visibility)
|
||||
}
|
||||
|
||||
override fun setAutopilotStatusViewVisibility(visibility: Int) {
|
||||
CallerHmiViewControlListenerManager.invokeVisible(AutoPilotStatusView_TAG,visibility)
|
||||
}
|
||||
|
||||
override fun setPerspectiveSwitchViewVisibility(visibility: Int) {
|
||||
CallerHmiViewControlListenerManager.invokeVisible(PerspectiveSwitchView_TAG,visibility)
|
||||
}
|
||||
|
||||
override fun setCameraViewVisibility(visibility: Int) {
|
||||
CallerHmiViewControlListenerManager.invokeVisible(CameraView_TAG, visibility)
|
||||
}
|
||||
|
||||
/** todo----------------------------------------------- **/
|
||||
/**
|
||||
* 不展示顶部弹窗,其它保留
|
||||
@@ -326,7 +229,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
playTts && !AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
|
||||
activity?.let {
|
||||
val warningContent = alertContent
|
||||
?: EventTypeEnum.getWarningContent(v2xType)
|
||||
?: EventTypeEnumNew.getWarningContent(v2xType)
|
||||
|
||||
//占道施工预警
|
||||
if (v2xType == "10006" || v2xType == "100061") {
|
||||
@@ -364,7 +267,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
if (ttsContent != null && !TextUtils.isEmpty(ttsContent) && playTTS) {
|
||||
val last = lastSpeakJob.get()
|
||||
Log.d("CODE", "---- 0 ------: last: $last")
|
||||
if (last != null && !last.isCompleted) {
|
||||
if (last != null && !last.isCompleted) {
|
||||
Log.d("CODE", "---- 1 ------")
|
||||
return
|
||||
}
|
||||
@@ -465,40 +368,6 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
mViewTrafficLight?.changeCountdownTrafficLightNum(readNum, yellowNum, greenNum)
|
||||
}
|
||||
|
||||
/**
|
||||
* 控制展示限速标志及内容
|
||||
*/
|
||||
override fun showLimitingVelocity(limitingSpeed: Int, limitSpeedSource: Int) {
|
||||
// 控制 限速UI 展示
|
||||
if (HmiBuildConfig.isShowLimitingVelocityView) {
|
||||
if (limitingSpeed > 0) {
|
||||
mViewLimitingVelocity?.visibility = View.VISIBLE
|
||||
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, limitSpeedSource)
|
||||
tvLimitingSource?.visibility = View.INVISIBLE
|
||||
}
|
||||
} else {
|
||||
disableLimitingVelocity()
|
||||
tvLimitingSource?.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 控制关闭限速标志及内容
|
||||
*/
|
||||
override fun disableLimitingVelocity() {
|
||||
mViewLimitingVelocity?.visibility = View.GONE
|
||||
mViewLimitingVelocity?.updateLimitingSpeed(0, 1)
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示指定方位上的红框预警
|
||||
* @param direction
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.msgbox
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 消息盒子司机端视图切换按钮
|
||||
* @since: 2023/1/31
|
||||
*/
|
||||
class DriverMsgBoxButtonView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
):ConstraintLayout(context, attrs, defStyleAttr) {
|
||||
|
||||
companion object {
|
||||
const val TAG = "DriverMsgBoxButtonView"
|
||||
}
|
||||
|
||||
init{
|
||||
LayoutInflater.from(context).inflate(R.layout.view_driver_msg_box_button, this, true)
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView(){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -171,13 +171,21 @@ class DriverMsgBoxListView @JvmOverloads constructor(
|
||||
when (category) {
|
||||
MsgCategory.NOTICE -> {
|
||||
noticeList?.add(0,msgBoxList)
|
||||
if(MsgBoxConfig.getUserRecord() == 0){
|
||||
noticeList?.let { driverMsgBoxListAdapter?.setData(it) }
|
||||
}
|
||||
}
|
||||
MsgCategory.SYS_INFO -> {
|
||||
ipcReportList?.add(0,msgBoxList)
|
||||
if(MsgBoxConfig.getUserRecord() == 1){
|
||||
ipcReportList?.let { driverMsgBoxListAdapter?.setData(it) }
|
||||
}
|
||||
}
|
||||
MsgCategory.RECORD_BAG -> {
|
||||
badCaseList?.add(0,msgBoxList)
|
||||
badCaseList?.let { driverMsgBoxListAdapter?.setData(it) }
|
||||
if(MsgBoxConfig.getUserRecord() == 2){
|
||||
badCaseList?.let { driverMsgBoxListAdapter?.setData(it) }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.msgbox
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 消息盒子乘客端视图切换按钮
|
||||
* @since: 2023/1/31
|
||||
*/
|
||||
class PassengerMsgBoxButtonView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
): ConstraintLayout(context, attrs, defStyleAttr) {
|
||||
|
||||
companion object {
|
||||
const val TAG = "PassengerMsgBoxButtonView"
|
||||
}
|
||||
|
||||
init{
|
||||
LayoutInflater.from(context).inflate(R.layout.view_passenger_msg_box_button, this, true)
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView(){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnum
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
import com.mogo.eagle.core.data.msgbox.*
|
||||
import com.mogo.eagle.core.data.report.ReportEntity
|
||||
@@ -34,6 +34,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
|
||||
@@ -47,89 +48,105 @@ 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_bubble_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){
|
||||
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)))
|
||||
}else{
|
||||
holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable(
|
||||
EventTypeEnum.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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -156,14 +173,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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,6 +215,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
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnum
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
import com.mogo.eagle.core.data.msgbox.*
|
||||
import com.mogo.eagle.core.data.report.ReportEntity
|
||||
@@ -28,198 +28,263 @@ import com.mogo.eagle.core.utilcode.util.TimeUtils.getHourMinFormat
|
||||
* @description 司机端消息盒子列表视图RecyclerView适配器
|
||||
* @since: 2022/11/25
|
||||
*/
|
||||
class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Adapter<RecyclerView.ViewHolder>(){
|
||||
class DriverMsgBoxListAdapter(private val activity: Activity) :
|
||||
RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
||||
|
||||
private var data: List<MsgBoxBean> ?= null
|
||||
private var data: List<MsgBoxBean>? = null
|
||||
|
||||
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"
|
||||
val RESULT_AUTOPILOT_SYSTEM_UNSTARTED = "RESULT_AUTOPILOT_SYSTEM_UNSTARTED"
|
||||
val RESULT_REMOTEPILOT_DISABLE = "RESULT_REMOTEPILOT_DISABLE"
|
||||
|
||||
fun setData(data: List<MsgBoxBean>){
|
||||
fun setData(data: List<MsgBoxBean>) {
|
||||
this.data = data
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
}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
|
||||
}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
|
||||
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 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 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.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.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.ivOperationImageOpen.visibility = View.GONE
|
||||
holder.tvOperationTitleOpen.visibility = View.GONE
|
||||
holder.tvOperationContentOpen.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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}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) }
|
||||
}
|
||||
}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) }
|
||||
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.GONE
|
||||
holder.tvOperationTitleOpen.visibility = View.GONE
|
||||
holder.tvOperationContentOpen.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}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){
|
||||
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
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
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)))
|
||||
}else{
|
||||
holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable(
|
||||
EventTypeEnum.getUpdateIconRes(v2XMsg.type)))
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -229,26 +294,30 @@ 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
|
||||
}
|
||||
}
|
||||
|
||||
//录包实体
|
||||
class BadCaseHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var tvBagRecordTime: TextView= itemView.findViewById(R.id.tvBagRecordTime)
|
||||
class BadCaseHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
var tvBagRecordTime: TextView = itemView.findViewById(R.id.tvBagRecordTime)
|
||||
var tvBagReceiveTime: TextView = itemView.findViewById(R.id.tvBagReceiveTime)
|
||||
var tvRecordCheck: TextView = itemView.findViewById(R.id.tvRecordCheck)
|
||||
}
|
||||
|
||||
//车辆系统信息
|
||||
class MsgBoxIpcReportHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
class MsgBoxIpcReportHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
var ivReportImageNormal: ImageView = itemView.findViewById(R.id.ivReportImageNormal)
|
||||
var tvReportLevelNormal: TextView = itemView.findViewById(R.id.tvReportLevelNormal)
|
||||
var tvReportTimeNormal: TextView = itemView.findViewById(R.id.tvReportTimeNormal)
|
||||
@@ -264,10 +333,11 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
|
||||
}
|
||||
|
||||
//运营平台
|
||||
class MsgBoxOperation(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
class MsgBoxOperation(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
var ivOperationImageNormal: ImageView = itemView.findViewById(R.id.ivOperationImageNormal)
|
||||
var tvOperationTitleNormal: TextView = itemView.findViewById(R.id.tvOperationTitleNormal)
|
||||
var tvOperationContentNormal: TextView = itemView.findViewById(R.id.tvOperationContentNormal)
|
||||
var tvOperationContentNormal: TextView =
|
||||
itemView.findViewById(R.id.tvOperationContentNormal)
|
||||
var tvOperationStatusSelect: TextView = itemView.findViewById(R.id.tvOperationStatusSelect)
|
||||
var tvOperationTime: TextView = itemView.findViewById(R.id.tvOperationTime)
|
||||
var ivOperationImageOpen: ImageView = itemView.findViewById(R.id.ivOperationImageOpen)
|
||||
@@ -276,7 +346,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
|
||||
}
|
||||
|
||||
//Notice
|
||||
class MsgBoxNotice(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
class MsgBoxNotice(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
var ivNoticeImage: ImageView = itemView.findViewById(R.id.ivNoticeImage)
|
||||
var tvNoticeTitle: TextView = itemView.findViewById(R.id.tvNoticeTitle)
|
||||
var tvNoticeTime: TextView = itemView.findViewById(R.id.tvNoticeTime)
|
||||
@@ -285,11 +355,17 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
|
||||
}
|
||||
|
||||
//V2X,OBU
|
||||
class MsgBoxV2X(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
class MsgBoxV2X(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
var ivV2XImage: ImageView = itemView.findViewById(R.id.ivV2XImage)
|
||||
var tvV2XTime: TextView = itemView.findViewById(R.id.tvV2XTime)
|
||||
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)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -8,15 +8,12 @@ import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnum
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.NoticeFrCloudMsg
|
||||
import com.mogo.eagle.core.data.msgbox.V2XMsg
|
||||
import com.mogo.eagle.core.data.msgbox.*
|
||||
import com.mogo.eagle.core.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.CallerMsgBoxEventListenerManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform
|
||||
@@ -34,6 +31,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
|
||||
|
||||
@@ -46,65 +44,83 @@ 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){
|
||||
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)))
|
||||
}else{
|
||||
holder.ivPassengerV2XImage.setImageDrawable(activity.resources.getDrawable(
|
||||
EventTypeEnum.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()
|
||||
CallerMsgBoxEventListenerManager.invokeListener()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val msgBoxBean: MsgBoxBean = data!![position]
|
||||
countDownTimer =object: CountDownTimer(CallerMsgBoxManager.getDismissTime(),1000){
|
||||
override fun onTick(p0: Long) {
|
||||
@@ -125,10 +141,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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,4 +166,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)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,14 +7,11 @@ import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnum
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.NoticeFrCloudMsg
|
||||
import com.mogo.eagle.core.data.msgbox.V2XMsg
|
||||
import com.mogo.eagle.core.data.notice.NoticeNormalData
|
||||
import com.mogo.eagle.core.data.msgbox.*
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform
|
||||
@@ -32,6 +29,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
|
||||
@@ -39,61 +37,78 @@ 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){
|
||||
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)))
|
||||
}else{
|
||||
holder.ivPassengerV2XImage.setImageDrawable(activity.resources.getDrawable(
|
||||
EventTypeEnum.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()
|
||||
CallerMsgBoxEventListenerManager.invokeListener()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -102,10 +117,12 @@ class PassengerMsgBoxListAdapter(private val activity: Activity): RecyclerView.A
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,4 +142,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)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,6 +16,7 @@ import androidx.appcompat.widget.PopupMenu
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.*
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import chassis.Chassis
|
||||
import chassis.ChassisStatesOuterClass
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient
|
||||
@@ -63,6 +64,7 @@ import com.mogo.eagle.core.function.hmi.ui.logcatch.ILogViewListener
|
||||
import com.mogo.eagle.core.function.hmi.ui.logcatch.LogInfoView
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
|
||||
import com.mogo.eagle.core.utilcode.kotlin.currentPadding
|
||||
import com.mogo.eagle.core.utilcode.kotlin.lifecycleOwner
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.LogLevel
|
||||
@@ -74,9 +76,12 @@ import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.mogo.map.uicontroller.VisualAngleMode
|
||||
import com.mogo.map.uicontroller.VisualAngleMode.*
|
||||
import com.zhidao.easysocket.utils.L
|
||||
import com.mogo.support.obu.MogoObuManager
|
||||
import com.mogo.support.obu.constants.MogoObuLogLevel
|
||||
import com.mogo.support.obu.option.MogoObuLog
|
||||
import com.zhjt.mogo_core_function_devatools.env.*
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.*
|
||||
import kotlinx.coroutines.launch
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo_msg.MogoReportMsg
|
||||
import planning.RoboSweeperTaskIndexOuterClass
|
||||
@@ -88,9 +93,7 @@ import kotlin.collections.component3
|
||||
import kotlin.collections.component4
|
||||
import kotlin.collections.set
|
||||
import kotlin.math.abs
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import kotlinx.coroutines.launch
|
||||
import com.mogo.eagle.core.utilcode.kotlin.lifecycleOwner
|
||||
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
@@ -1035,49 +1038,6 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
* 设置Hmi点击监听
|
||||
*/
|
||||
private fun setHmiCheckedChangeListener() {
|
||||
/**
|
||||
* 显示、隐藏迈速表
|
||||
*/
|
||||
tbSpeedView.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (!isChecked) {
|
||||
CallerHmiManager.setSpeedChartViewVisibility(View.VISIBLE)
|
||||
} else {
|
||||
CallerHmiManager.setSpeedChartViewVisibility(View.GONE)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示、隐藏“自动驾驶控制按钮”
|
||||
*/
|
||||
tbAutopilotStatusView.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (!isChecked) {
|
||||
CallerHmiManager.setAutopilotStatusViewVisibility(View.VISIBLE)
|
||||
} else {
|
||||
CallerHmiManager.setAutopilotStatusViewVisibility(View.GONE)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示、隐藏视角切换按钮
|
||||
*/
|
||||
tbPerspectiveSwitchView.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (!isChecked) {
|
||||
CallerHmiManager.setPerspectiveSwitchViewVisibility(View.VISIBLE)
|
||||
} else {
|
||||
CallerHmiManager.setPerspectiveSwitchViewVisibility(View.GONE)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示、隐藏工具箱
|
||||
*/
|
||||
tbCheckStatusView.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (!isChecked) {
|
||||
CallerHmiManager.setToolsViewVisibility(View.VISIBLE)
|
||||
} else {
|
||||
CallerHmiManager.setToolsViewVisibility(View.GONE)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 隐藏、显示小地图
|
||||
@@ -1275,7 +1235,14 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
* 设置是否输出OBU日志 true-打印日志,false-不打印日志
|
||||
*/
|
||||
tbObuLog.setOnCheckedChangeListener { _, isChecked ->
|
||||
L.setEnableLog(isChecked)
|
||||
MogoObuManager.getInstance().setEnableLog(isChecked)
|
||||
|
||||
val builder: com.mogo.support.obu.option.MogoObuLog.Builder =
|
||||
MogoObuLog.newBuilder().setEnableStdio(isChecked)
|
||||
if (isChecked) {
|
||||
builder.setStdioLevel(MogoObuLogLevel.DBG)
|
||||
}
|
||||
MogoObuManager.getInstance().logConfig(builder.build())
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig
|
||||
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsFuncConfigListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsFuncConfigListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
@@ -19,6 +20,7 @@ import com.mogo.eagle.core.utilcode.kotlin.currentPadding
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.RouteStrategy
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.*
|
||||
@@ -150,7 +152,7 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
HmiBuildConfig.isShowLimitingVelocityView = true
|
||||
} else {
|
||||
HmiBuildConfig.isShowLimitingVelocityView = false
|
||||
CallerHmiManager.disableLimitingVelocity()
|
||||
CallerHmiViewControlListenerManager.invokeVisible(IViewControlListener.LimitingVelocityView_TAG,View.GONE)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,23 +10,21 @@ import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
|
||||
class DemoModeHiddenSwitch(context: Context?, attrs: AttributeSet?) : View(context, attrs) {
|
||||
class DemoModeHiddenSwitch(context: Context, attrs: AttributeSet?) : View(context, attrs) {
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
init {
|
||||
isClickable = true
|
||||
setOnClickListener {
|
||||
//只在司机端设置美化模式开关功能
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
//单次查询,是否有行程信息(订单进行中时点击不生效),autopilotControlParameters为null代表不处于自动驾驶状态下
|
||||
if (CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().autopilotControlParameters == null) {
|
||||
FunctionBuildConfig.isDemoMode = !FunctionBuildConfig.isDemoMode
|
||||
context?.let {
|
||||
CallerHmiManager.updateStatusBarLeftView(
|
||||
FunctionBuildConfig.isDemoMode,
|
||||
"demoMode",
|
||||
DemoModeView(it)
|
||||
)
|
||||
}
|
||||
CallerHmiManager.updateStatusBarLeftView(
|
||||
FunctionBuildConfig.isDemoMode,
|
||||
"demoMode",
|
||||
DemoModeView(context)
|
||||
)
|
||||
CallerAutoPilotManager.setDemoMode(FunctionBuildConfig.isDemoMode)
|
||||
if (!FunctionBuildConfig.isDemoMode) {
|
||||
//关闭美化模式时,通知工控机
|
||||
|
||||
@@ -6,7 +6,7 @@ import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnum
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
@@ -56,10 +56,10 @@ class TakeOverView @JvmOverloads constructor(
|
||||
MogoReport.Code.Error.EMAP.EXIT_AUTOPILOT_FOR_CHASSIS,
|
||||
MogoReport.Code.Error.EMAP.EXIT_AUTOPILOT_FOR_DISTANCE -> {
|
||||
CallerHmiManager.warningV2X(
|
||||
EventTypeEnum.TAKE_OVER_EVENT.poiType,
|
||||
EventTypeEnum.TAKE_OVER_EVENT.content,
|
||||
EventTypeEnum.TAKE_OVER_EVENT.tts,
|
||||
EventTypeEnum.TAKE_OVER_EVENT.poiType,
|
||||
EventTypeEnumNew.TAKE_OVER_EVENT.poiType,
|
||||
EventTypeEnumNew.TAKE_OVER_EVENT.content,
|
||||
EventTypeEnumNew.TAKE_OVER_EVENT.tts,
|
||||
EventTypeEnumNew.TAKE_OVER_EVENT.poiType,
|
||||
object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {
|
||||
takeOver = true
|
||||
|
||||
@@ -2,34 +2,20 @@ package com.mogo.eagle.core.function.hmi.ui.tools
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.ToolsView_TAG
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.ToolsView.Companion.toolsView
|
||||
|
||||
class ToolsImageView(context: Context, attrs: AttributeSet?) :
|
||||
androidx.appcompat.widget.AppCompatImageView(context, attrs), IViewControlListener {
|
||||
androidx.appcompat.widget.AppCompatImageView(context, attrs) {
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
scaleType = ScaleType.CENTER
|
||||
setBackgroundResource(R.drawable.module_ext_check)
|
||||
setImageResource(R.drawable.icon_tools_nor)
|
||||
scaleType = ScaleType.CENTER
|
||||
setOnClickListener{
|
||||
toolsView.showToolsFloat(context)
|
||||
}
|
||||
|
||||
CallerHmiViewControlListenerManager.addListener(ToolsView_TAG, this)
|
||||
}
|
||||
|
||||
override fun visible(v: Int) {
|
||||
super.visible(v)
|
||||
visibility = v
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerHmiViewControlListenerManager.removeListener(ToolsView_TAG)
|
||||
}
|
||||
}
|
||||
@@ -8,14 +8,11 @@ import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.AutoPilotStatusView_TAG
|
||||
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.CallerAutoPilotStatusListenerManager.getCurWgs84Lat
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lon
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
@@ -33,7 +30,7 @@ class AutoPilotStatusView constructor(
|
||||
attrs: AttributeSet
|
||||
) : ConstraintLayout(context, attrs),
|
||||
View.OnClickListener,
|
||||
IMoGoAutopilotStatusListener, IViewControlListener {
|
||||
IMoGoAutopilotStatusListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "AutopilotStatusView"
|
||||
@@ -41,33 +38,21 @@ class AutoPilotStatusView constructor(
|
||||
|
||||
private var mAutopilotStatus: Int = 0
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
init{
|
||||
initView(context)
|
||||
}
|
||||
|
||||
private fun initView(context: Context) {
|
||||
setBackgroundResource(R.drawable.module_hmi_autopilot_status_bg)
|
||||
LayoutInflater.from(context).inflate(R.layout.view_autopilot_status, this, true)
|
||||
|
||||
val lp = LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)
|
||||
layoutParams = lp
|
||||
|
||||
// 设置点击监听
|
||||
setOnClickListener(this)
|
||||
// 自动驾驶状态监听
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
CallerHmiViewControlListenerManager.addListener(AutoPilotStatusView_TAG, this)
|
||||
|
||||
CallerLogger.d("$M_HMI$TAG", "autopilotStatus: $mAutopilotStatus")
|
||||
setAutoPilotStatus(mAutopilotStatus)
|
||||
}
|
||||
|
||||
override fun visible(v: Int) {
|
||||
super.visible(v)
|
||||
visibility = v
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
when (mAutopilotStatus) {
|
||||
0 -> {// 不可自动驾驶,adas与工控机没有链接,或工控机异常
|
||||
@@ -139,7 +124,6 @@ class AutoPilotStatusView constructor(
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
CallerHmiViewControlListenerManager.removeListener(AutoPilotStatusView_TAG)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,15 +2,12 @@ package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.CameraView_TAG
|
||||
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.CameraLiveView.Companion.cameraLiveView
|
||||
|
||||
class CameraView(context: Context, attrs: AttributeSet?) :
|
||||
androidx.appcompat.widget.AppCompatImageView(context, attrs), IViewControlListener {
|
||||
androidx.appcompat.widget.AppCompatImageView(context, attrs) {
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
@@ -28,16 +25,6 @@ class CameraView(context: Context, attrs: AttributeSet?) :
|
||||
}
|
||||
}
|
||||
|
||||
CallerHmiViewControlListenerManager.addListener(CameraView_TAG, this)
|
||||
}
|
||||
|
||||
override fun visible(v: Int) {
|
||||
super.visible(v)
|
||||
visibility = v
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerHmiViewControlListenerManager.removeListener(CameraView_TAG)
|
||||
}
|
||||
}
|
||||
@@ -3,25 +3,59 @@ package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewLimitingVelocity
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.LimitingVelocityView_TAG
|
||||
import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerViewLimitingVelocityListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import kotlinx.android.synthetic.main.view_limiting_speed_vr.view.*
|
||||
|
||||
/**
|
||||
* 限速控件
|
||||
*/
|
||||
class LimitingVelocityView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : IViewLimitingVelocity(context, attrs, defStyleAttr) {
|
||||
class LimitingVelocityView constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
) : ConstraintLayout(context, attrs), ILimitingVelocityListener, IViewControlListener {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "LimitingVelocityView"
|
||||
}
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_limiting_speed_vr, this, true)
|
||||
}
|
||||
|
||||
override fun updateLimitingSpeed(limitingSpeed: Int, limitSource: Int) {
|
||||
super.updateLimitingSpeed(limitingSpeed, limitSource)
|
||||
tvLimitingVelocity.text = "$limitingSpeed"
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerViewLimitingVelocityListenerManager.addListener(TAG, this)
|
||||
CallerHmiViewControlListenerManager.addListener(LimitingVelocityView_TAG, this)
|
||||
}
|
||||
|
||||
override fun onLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) {
|
||||
if (limitingVelocity > 0) {
|
||||
this.visibility = View.VISIBLE
|
||||
tvLimitingVelocity.text = "$limitingVelocity"
|
||||
tvLimitingSource.text = sourceType.name
|
||||
} else {
|
||||
this.visibility = View.GONE
|
||||
tvLimitingSource.text = ""
|
||||
}
|
||||
}
|
||||
|
||||
override fun visible(v: Int) {
|
||||
super.visible(v)
|
||||
this.visibility = v
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerViewLimitingVelocityListenerManager.removeListener(TAG)
|
||||
CallerHmiViewControlListenerManager.removeListener(LimitingVelocityView_TAG)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,9 +5,6 @@ import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.FrameLayout
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.PerspectiveSwitchView_TAG
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getMapUIController
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.map.uicontroller.VisualAngleMode
|
||||
@@ -22,20 +19,13 @@ class PerspectiveSwitchView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : FrameLayout(context, attrs, defStyleAttr), View.OnClickListener, IViewControlListener{
|
||||
) : FrameLayout(context, attrs, defStyleAttr), View.OnClickListener{
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
LayoutInflater.from(context).inflate(R.layout.view_perspective_switch, this, true)
|
||||
setBackgroundResource(R.drawable.module_switch_map_bg)
|
||||
setOnClickListener(this)
|
||||
|
||||
CallerHmiViewControlListenerManager.addListener(PerspectiveSwitchView_TAG,this)
|
||||
}
|
||||
|
||||
override fun visible(v: Int) {
|
||||
super.visible(v)
|
||||
visibility = v
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
@@ -53,9 +43,4 @@ class PerspectiveSwitchView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerHmiViewControlListenerManager.removeListener(PerspectiveSwitchView_TAG)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,11 +6,7 @@ import android.util.AttributeSet
|
||||
import android.view.Gravity
|
||||
import android.widget.FrameLayout
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.SpeedPanelView_TAG
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
@@ -25,7 +21,7 @@ class SpeedPanelView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : FrameLayout(context, attrs, defStyleAttr), IMoGoChassisLocationGCJ02Listener,IViewControlListener {
|
||||
) : FrameLayout(context, attrs, defStyleAttr), IMoGoChassisLocationGCJ02Listener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "SpeedPanelView"
|
||||
@@ -58,8 +54,6 @@ class SpeedPanelView @JvmOverloads constructor(
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
// 注册view控制显示隐藏监听
|
||||
CallerHmiViewControlListenerManager.addListener(SpeedPanelView_TAG,this)
|
||||
// 注册位置回调
|
||||
CallerChassisLocationGCJ20ListenerManager.addListener(TAG, this)
|
||||
// 开启定时查询速度
|
||||
@@ -89,15 +83,9 @@ class SpeedPanelView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
override fun visible(v: Int) {
|
||||
super.visible(v)
|
||||
visibility = v
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
// 解除注册
|
||||
CallerHmiViewControlListenerManager.removeListener(SpeedPanelView_TAG)
|
||||
CallerChassisLocationGCJ20ListenerManager.removeListener(TAG)
|
||||
try {
|
||||
timerTask?.cancel()
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import android.widget.LinearLayout
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.mofang.MfConstants
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
|
||||
@@ -51,6 +52,7 @@ class StatusBarView @JvmOverloads constructor(
|
||||
//将状态窗口中的状态移到状态栏上
|
||||
CallerDevaToolsManager.showStatusBar(context, status_container)
|
||||
|
||||
updateStatusBarRightView(FunctionBuildConfig.isDemoMode, "demoMode", DemoModeView(this.context))
|
||||
}
|
||||
|
||||
override fun onSkinModeChange(skinMode: Int) {
|
||||
|
||||
@@ -52,7 +52,7 @@ class VersionNameView @JvmOverloads constructor(
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun showCurrentPadVersion() {
|
||||
tvAppVersionName?.let {
|
||||
it.text = "APP:${AppUtils.getAppVersionName()}"
|
||||
// it.text = "APP:${AppUtils.getAppVersionName()}"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,32 +27,14 @@ class VipIdentificationView : ConstraintLayout, IMoGoVipSetListener {
|
||||
attributeSet,
|
||||
defStyleAttr
|
||||
) {
|
||||
init(attributeSet, defStyleAttr)
|
||||
}
|
||||
|
||||
private var marginStart: Float = 0.0f
|
||||
private var marginTop: Float = 0.0f
|
||||
|
||||
private fun init(attrs: AttributeSet, defStyleAttr: Int) {
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_vip_identification, this, true)
|
||||
val a = context.obtainStyledAttributes(
|
||||
attrs,
|
||||
R.styleable.VipIdentificationView,
|
||||
defStyleAttr,
|
||||
0
|
||||
)
|
||||
marginStart = a.getDimension(R.styleable.VipIdentificationView_marginStart, 0.0f)
|
||||
marginTop = a.getDimension(R.styleable.VipIdentificationView_marginTop, 0.0f)
|
||||
a.recycle()
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
val lp = this.layoutParams as LayoutParams
|
||||
lp.marginStart = marginStart.toInt()
|
||||
lp.topMargin = marginTop.toInt()
|
||||
this.layoutParams = lp
|
||||
invalidate()
|
||||
CallVipSetListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
|
||||
@@ -41,10 +41,10 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.call.startup.CallerStartUpManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView;
|
||||
import com.mogo.eagle.core.function.main.modules.MogoModulesManager;
|
||||
import com.mogo.eagle.core.function.main.stagetwo.AutopilotStartup;
|
||||
import com.mogo.eagle.core.function.main.windowview.FloatingViewHandler;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppLaunchTimeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
@@ -163,7 +163,7 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
ContextHolderUtil.holdContext(this);
|
||||
// 监听工控机连接信息
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, this);
|
||||
startUpInStage2();
|
||||
CallerStartUpManager.initStageTwo();
|
||||
// 加载模块
|
||||
mPresenter.postLoadModuleMsg();
|
||||
// 监听网络状态
|
||||
@@ -218,26 +218,6 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
mConnectInfoRV.setAdapter(mConnAdapter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 第二阶段初始化,第一阶段初始化可查看:{@link com.mogo.launcher.stageone}
|
||||
*/
|
||||
public void startUpInStage2() {
|
||||
StartupConfig config = null;
|
||||
if (DebugConfig.isDebug()) {
|
||||
config = new StartupConfig.Builder()
|
||||
.setLoggerLevel(LoggerLevel.DEBUG)
|
||||
.setOpenStatistics(true)
|
||||
.build();
|
||||
}
|
||||
new StartupManager.Builder()
|
||||
.addStartup(new AutopilotStartup())
|
||||
// .addStartup(new APMStartup())
|
||||
.setConfig(config)
|
||||
.build(this)
|
||||
.start()
|
||||
.await();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadModules() {
|
||||
final long start = System.currentTimeMillis();
|
||||
|
||||
@@ -149,10 +149,14 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
ochProvider = (IMoGoFunctionProvider) ARouter.getInstance()
|
||||
.build("/driver/api")
|
||||
.navigation(getContext());
|
||||
} else {
|
||||
} else if(AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)){
|
||||
ochProvider = (IMoGoFunctionProvider) ARouter.getInstance()
|
||||
.build("/passenger/api")
|
||||
.navigation(getContext());
|
||||
} else {
|
||||
ochProvider = (IMoGoFunctionProvider) ARouter.getInstance()
|
||||
.build("/noop/api")
|
||||
.navigation(getContext());
|
||||
}
|
||||
}
|
||||
// 处理一个机器多个屏幕方案
|
||||
|
||||
@@ -34,7 +34,6 @@ 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.ProcessUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.SPUtils;
|
||||
import com.zhidao.support.obu.ami.AmiClientManager;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
@@ -203,7 +202,7 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
*/
|
||||
private void connectAmiIp() {
|
||||
String ipAddress = SharedPrefsMgr.getInstance(AbsMogoApplication.getApp().getBaseContext()).getString(MoGoConfig.OBU_IP, "192.168.1.199");
|
||||
AmiClientManager.getInstance().setObuIp(ipAddress);
|
||||
// AmiClientManager.getInstance().setObuIp(ipAddress);
|
||||
}
|
||||
|
||||
private void initModules() {
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
package com.mogo.eagle.core.function.main.stagetwo;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.rousetime.android_startup.AndroidStartup;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AutopilotStartup extends AndroidStartup<Boolean> {
|
||||
@Nullable
|
||||
@Override
|
||||
public Boolean create(@NonNull Context context) {
|
||||
ARouter.getInstance().build(MogoServicePaths.PATH_AUTO_PILOT).navigation();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean callCreateOnMainThread() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean waitOnMainThread() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// @Nullable
|
||||
// @Override
|
||||
// public List<String> dependenciesByName() {
|
||||
// List<String> deps = new ArrayList<>();
|
||||
// deps.add("com.mogo.eagle.core.function.main.stagetwo.APMStartup");
|
||||
// return deps;
|
||||
// }
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package com.mogo.eagle.core.function.main.stagetwo;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.rousetime.android_startup.AndroidStartup;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MapStartup extends AndroidStartup<Boolean> {
|
||||
@Nullable
|
||||
@Override
|
||||
public Boolean create(@NonNull Context context) {
|
||||
// TODO:暂不支持分步加载
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean callCreateOnMainThread() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean waitOnMainThread() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// @Nullable
|
||||
// @Override
|
||||
// public List<String> dependenciesByName() {
|
||||
// List<String> deps = new ArrayList<>();
|
||||
// deps.add("com.mogo.eagle.core.function.main.stagetwo.APMStartup");
|
||||
// return deps;
|
||||
// }
|
||||
}
|
||||
@@ -20,82 +20,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingTop="72dp">
|
||||
<!--Vip车辆标志-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
|
||||
android:layout_width="@dimen/module_vip_width"
|
||||
android:layout_height="@dimen/module_vip_height"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--接管提示-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.takeover.TakeOverView
|
||||
android:id="@+id/clTakeOverView"
|
||||
android:layout_width="@dimen/hmi_take_over_request_width"
|
||||
android:layout_height="@dimen/hmi_take_over_request_height"
|
||||
android:layout_marginTop="@dimen/hmi_take_over_request_m_top"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--地图视角切换-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.PerspectiveSwitchView
|
||||
android:id="@+id/viewPerspectiveSwitch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="50dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:elevation="@dimen/dp_10"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<!--隐藏态下的 美化模式按钮-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.switch.DemoModeHiddenSwitch
|
||||
android:id="@+id/viewDemoModeSwitch"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_marginStart="40dp"
|
||||
android:layout_marginBottom="200dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<!--限速牌子-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.LimitingVelocityView
|
||||
android:id="@+id/viewLimitingVelocity"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:background="@drawable/bg_waring_limiting_velocity"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:gravity="center"
|
||||
android:text="60"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="60dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_goneMarginEnd="40dp"
|
||||
app:layout_goneMarginTop="40dp"
|
||||
tools:visibility="gone" />
|
||||
<!-- todo 需要放入使用方 -->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"-->
|
||||
|
||||
<!--限速来源-->
|
||||
<TextView
|
||||
android:id="@+id/tvLimitingSource"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="35dp"
|
||||
android:gravity="center"
|
||||
android:text=""
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="@dimen/dp_30"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/viewLimitingVelocity" />
|
||||
|
||||
<!--消息盒子司机端选择入口-->
|
||||
<CheckBox
|
||||
@@ -107,9 +31,10 @@
|
||||
android:background="@drawable/selector_msg_box"
|
||||
android:button="@null"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toLeftOf="@id/viewLimitingVelocity"
|
||||
app:layout_constraintRight_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
<!-- todo 需要放入使用方 , view先gone掉方便重组 -->
|
||||
<!-- app:layout_constraintRight_toLeftOf="@id/viewLimitingVelocity"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon" />-->
|
||||
|
||||
<!--司机端消息提示-->
|
||||
@@ -209,33 +134,6 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--pnc行为决策-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.pnc.PncActionsView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_110"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<!--APP、MAP版本-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.VersionNameView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="45dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/statusBarContainer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="30dp"
|
||||
app:layout_constraintEnd_toStartOf="@+id/viewLimitingVelocity"
|
||||
app:layout_constraintTop_toTopOf="@+id/viewLimitingVelocity"
|
||||
app:layout_goneMarginEnd="40dp"
|
||||
app:layout_goneMarginTop="30dp" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,64 @@
|
||||
<?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="804dp"
|
||||
android:layout_height="160dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="#53000000"
|
||||
app:roundLayoutRadius="24dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="30dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:layout_marginTop="7dp"
|
||||
android:layout_marginBottom="7dp"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivSummaryImage"
|
||||
android:layout_width="140dp"
|
||||
android:layout_height="130dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginStart="15dp"
|
||||
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="32dp"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivSummaryImage"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/tvSummaryContent"
|
||||
android:layout_marginStart="15dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSummaryContent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvSummaryTitle"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvSummaryTitle"
|
||||
app:layout_constraintRight_toRightOf="@id/tvSummaryTime"
|
||||
android:gravity="start"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="28dp"
|
||||
/>
|
||||
|
||||
<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="25dp"
|
||||
android:textColor="#80FFFFFF"
|
||||
android:textSize="24dp"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
@@ -0,0 +1,62 @@
|
||||
<?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="804dp"
|
||||
android:layout_height="160dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="#53000000"
|
||||
app:roundLayoutRadius="24dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="7dp"
|
||||
android:layout_marginBottom="7dp"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivSummaryImage"
|
||||
android:layout_width="140dp"
|
||||
android:layout_height="130dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginStart="15dp"
|
||||
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="32dp"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivSummaryImage"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/tvSummaryContent"
|
||||
android:layout_marginStart="15dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSummaryContent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvSummaryTitle"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvSummaryTitle"
|
||||
app:layout_constraintRight_toRightOf="@id/tvSummaryTime"
|
||||
android:gravity="start"
|
||||
android:textColor="#B3FFFFFF"
|
||||
android:textSize="28dp"
|
||||
/>
|
||||
|
||||
<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="25dp"
|
||||
android:textColor="#80FFFFFF"
|
||||
android:textSize="24dp"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -1274,54 +1274,6 @@
|
||||
app:layout_constraintLeft_toRightOf="@+id/tbChangeCurrentCarIcon"
|
||||
app:layout_constraintTop_toTopOf="@id/tbChangeCurrentCarIcon" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbSpeedView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_margin="2dp"
|
||||
android:gravity="center"
|
||||
android:padding="@dimen/dp_20"
|
||||
android:textOff="隐藏「脉速表」"
|
||||
android:textOn="显示「脉速表」"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbAutopilotStatusView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_margin="2dp"
|
||||
android:gravity="center"
|
||||
android:padding="@dimen/dp_20"
|
||||
android:textOff="隐藏「自动驾驶控制按钮」"
|
||||
android:textOn="显示「自动驾驶控制按钮」"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbPerspectiveSwitchView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_margin="2dp"
|
||||
android:gravity="center"
|
||||
android:padding="@dimen/dp_20"
|
||||
android:textOff="隐藏「视角切换按钮」"
|
||||
android:textOn="显示「视角切换按钮」"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbCheckStatusView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_margin="2dp"
|
||||
android:gravity="center"
|
||||
android:padding="@dimen/dp_20"
|
||||
android:textOff="隐藏「工具箱」"
|
||||
android:textOn="显示「工具箱」"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbControlView"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<!--消息盒子司机端选择入口-->
|
||||
<CheckBox
|
||||
android:id="@+id/cbMsgBoxDriver"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
android:background="@drawable/selector_msg_box"
|
||||
android:button="@null"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
/>
|
||||
|
||||
<!--司机端消息提示-->
|
||||
<View
|
||||
android:id="@+id/MsgBoxTipView"
|
||||
android:layout_width="8dp"
|
||||
android:layout_height="8dp"
|
||||
android:background="@drawable/version_upgrade_tips_background"
|
||||
android:translationZ="30dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintCircle="@id/cbMsgBoxDriver"
|
||||
app:layout_constraintCircleAngle="40"
|
||||
app:layout_constraintCircleRadius="32dp"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,22 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLimitingVelocity"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:background="@drawable/bg_waring_limiting_velocity"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:gravity="center"
|
||||
android:text="60"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/dp_60"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"
|
||||
/>
|
||||
android:textSize="@dimen/dp_60"/>
|
||||
|
||||
</LinearLayout>
|
||||
<!--限速来源-->
|
||||
<TextView
|
||||
android:id="@+id/tvLimitingSource"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:gravity="center"
|
||||
android:text=""
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="@dimen/dp_30"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvLimitingVelocity"
|
||||
android:visibility="gone" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<!--消息盒子乘客端选择入口-->
|
||||
<CheckBox
|
||||
android:id="@+id/cbMsgBoxPassenger"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:background="@drawable/selector_msg_box_p"
|
||||
android:button="@null"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
|
||||
<!--乘客端消息提示-->
|
||||
<View
|
||||
android:id="@+id/MsgBoxPTipView"
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
android:background="@drawable/version_upgrade_tips_background"
|
||||
android:translationZ="30dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintCircle="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintCircleAngle="40"
|
||||
app:layout_constraintCircleRadius="50dp"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -69,9 +69,4 @@
|
||||
<item name="android:borderlessButtonStyle">@android:color/transparent</item>
|
||||
</style>
|
||||
|
||||
<declare-styleable name="VipIdentificationView">
|
||||
<attr name="marginStart" format="dimension" />
|
||||
<attr name="marginTop" format="dimension" />
|
||||
</declare-styleable>
|
||||
|
||||
</resources>
|
||||
@@ -1,19 +1,15 @@
|
||||
package com.mogo.eagle.function.biz.v2x.speedlimit;
|
||||
|
||||
import static com.mogo.eagle.core.data.config.HmiBuildConfig.isShowObuLimitSpeedView;
|
||||
import static com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.BIZ_SLW;
|
||||
import static com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.V2I;
|
||||
package com.mogo.eagle.core.function.business;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
|
||||
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.v2x.CallLimitingVelocityListenerManager;
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.zhjt.service_biz.BizConfig;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
@@ -27,8 +23,8 @@ import mogo.telematics.pad.MessagePad;
|
||||
public class SpeedLimitDataManager implements IMoGoChassisLocationGCJ02Listener {
|
||||
|
||||
private final static String TAG = "SpeedLimitDataManager";
|
||||
private static SpeedLimitDataManager instance;
|
||||
private MessagePad.GnssInfo mLocation;
|
||||
private static volatile SpeedLimitDataManager instance;
|
||||
private MessagePad.GnssInfo mLocation;
|
||||
|
||||
private SpeedLimitDataManager() {
|
||||
}
|
||||
@@ -53,24 +49,19 @@ public class SpeedLimitDataManager implements IMoGoChassisLocationGCJ02Listener
|
||||
@Override
|
||||
public void run() {
|
||||
if (mLocation != null) {
|
||||
if(CallerMapUIServiceManager.INSTANCE.getMapUIController()!=null){
|
||||
if (CallerMapUIServiceManager.INSTANCE.getMapUIController() != null) {
|
||||
getSpeedLimit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@BizConfig(biz = V2I, dependentBizNode = "", bizNode = BIZ_SLW)
|
||||
private void getSpeedLimit() {
|
||||
// if (!isShowObuLimitSpeedView) {
|
||||
int speedLimit = CallerMapUIServiceManager.INSTANCE.getMapUIController().getLimitSpeed(mLocation.getLongitude(), mLocation.getLatitude(), (float) mLocation.getHeading());
|
||||
UiThreadHandler.post(() -> {
|
||||
if (speedLimit > 0) {
|
||||
// CallerHmiManager.INSTANCE.showLimitingVelocity(speedLimit, 1);
|
||||
CallLimitingVelocityListenerManager.INSTANCE.invokeOnLimitingVelocityChange(speedLimit);
|
||||
|
||||
}
|
||||
});
|
||||
// }
|
||||
int speedLimit = Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).getLimitSpeed(mLocation.getLongitude(), mLocation.getLatitude(), (float) mLocation.getHeading());
|
||||
UiThreadHandler.post(() -> {
|
||||
if (speedLimit > 0) {
|
||||
CallerLimitingVelocityListenerManager.INSTANCE.invokeOnLimitingVelocityChange(speedLimit, DataSourceType.MAP);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,23 +10,24 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.*
|
||||
import com.mogo.eagle.core.function.api.map.collect.IMoGoMapDataCollectProvider
|
||||
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.*
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
|
||||
import com.zhidaoauto.map.operational.open.GatherApi
|
||||
import com.zhidaoauto.map.operational.open.GatherParams
|
||||
import com.zhidaoauto.map.operational.open.abs.OnTaskListener
|
||||
import mogo.telematics.pad.MessagePad.GnssInfo
|
||||
import record_cache.RecordPanelOuterClass
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import java.util.concurrent.CopyOnWriteArrayList
|
||||
import java.util.concurrent.atomic.AtomicReference
|
||||
|
||||
@Route(path = MogoServicePaths.PATH_MAP_DATA_COLLECT_PROVIDER)
|
||||
class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener, IMoGoMapLocationListener, IMoGoTokenCallback,
|
||||
class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener, IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback,
|
||||
IMoGoAutopilotRecordListener {
|
||||
|
||||
companion object {
|
||||
@@ -52,7 +53,7 @@ class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener,
|
||||
|
||||
override fun init(context: Context?) {
|
||||
|
||||
CallerMapLocationListenerManager.addListener(TAG, this, false)
|
||||
CallerChassisLocationGCJ20ListenerManager.addListener(TAG, this)
|
||||
CallerAutopilotRecordListenerManager.addListener(TAG, this)
|
||||
|
||||
executor.set(context?.let {
|
||||
@@ -74,7 +75,7 @@ class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener,
|
||||
|
||||
override fun onDestroy() {
|
||||
CallerLogger.d("$M_MAP$TAG", "--------- onDestroy --------")
|
||||
CallerMapLocationListenerManager.removeListener(TAG, false)
|
||||
CallerChassisLocationGCJ20ListenerManager.removeListener(TAG)
|
||||
CallerAutopilotRecordListenerManager.removeListener(TAG)
|
||||
executor.get()?.setOnTaskListener(null)
|
||||
listeners.clear()
|
||||
@@ -170,18 +171,17 @@ class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener,
|
||||
}
|
||||
}
|
||||
|
||||
override fun onLocationChanged(location: MogoLocation?, from: Int, isGps: Boolean) {
|
||||
location ?: return
|
||||
override fun onChassisLocationGCJ02(gnssInfo: GnssInfo?) {
|
||||
val location = CallerMapLocationListenerManager.getCurrentLocation() ?: return
|
||||
executor.get()?.updateLocation(
|
||||
location.longitude,
|
||||
location.latitude,
|
||||
location.longitude,
|
||||
location.latitude,
|
||||
location.altitude,
|
||||
location.bearing,
|
||||
location.speed,
|
||||
isGps)
|
||||
false)
|
||||
}
|
||||
|
||||
|
||||
private fun isInValidStatus(): Boolean {
|
||||
if (map.isEmpty()) {
|
||||
return true
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.text.TextUtils;
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.entity.MarkerExploreWay;
|
||||
import com.mogo.eagle.core.data.map.entity.MarkerNoveltyInfo;
|
||||
@@ -19,7 +20,6 @@ import com.mogo.map.MogoMarkerManager;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnum;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -81,7 +81,7 @@ public class MarkerDrawer {
|
||||
Object bindObj = markerShowEntity.getBindObj();
|
||||
if (bindObj instanceof MarkerExploreWay && ((MarkerExploreWay) bindObj).getPoiType() != null) {
|
||||
String poiType = ((MarkerExploreWay) bindObj).getPoiType();
|
||||
options.icon3DRes(EventTypeEnum.getMarker3DRes(poiType));
|
||||
options.icon3DRes(EventTypeEnumNew.getMarker3DRes(poiType));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener
|
||||
import com.mogo.eagle.core.function.api.map.hd.IMoGoMapFragmentProvider
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
|
||||
import com.mogo.eagle.core.function.business.MapPointCloudSubscriber
|
||||
import com.mogo.eagle.core.function.business.SpeedLimitDataManager
|
||||
import com.mogo.eagle.core.function.business.identify.MapIdentifySubscriber
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.MogoRouteOverlayManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
@@ -199,6 +200,8 @@ class MapFragment : MvpFragment<MapView?, MapPresenter?>(),
|
||||
MapIdentifySubscriber.instance
|
||||
MogoRouteOverlayManager.getInstance().init()
|
||||
MapPointCloudSubscriber.instance
|
||||
SpeedLimitDataManager.getInstance().start()
|
||||
|
||||
// TODO GD地图业务需要与高精地图业务拆开 --- 扶风
|
||||
queryInfStructure()
|
||||
}
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mogo.eagle.core.function.obu.mogo">
|
||||
|
||||
|
||||
<application>
|
||||
<receiver android:name="com.mogo.eagle.core.function.obu.mogo.receiver.ObuTestTriggerReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.obu.test_trigger" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
<receiver android:name="com.mogo.eagle.core.function.obu.mogo.receiver.ObuTestTriggerRecognizedReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.obu.test_trigger_recognized" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name="com.mogo.eagle.core.function.obu.mogo.receiver.ObuRsuTestTriggerReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.obu.test_light_recognized" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name="com.mogo.eagle.core.function.obu.mogo.receiver.ObuTestNewObuReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.obu.test_newobu" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name="com.mogo.eagle.core.function.obu.mogo.receiver.ObuTestNewObuRsiReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.obu.test_newobu_rsi" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,133 +0,0 @@
|
||||
package com.mogo.eagle.core.function.obu.mogo.utils
|
||||
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
|
||||
import com.zhidao.support.obu.constants.ObuConstants
|
||||
import com.zhidao.support.obu.model.CvxPtcThreatIndInfo
|
||||
import com.zhidao.support.obu.model.CvxRtiThreatIndInfo
|
||||
import com.zhidao.support.obu.model.CvxRvInfoIndInfo
|
||||
import com.zhidao.support.obu.model.CvxV2vThreatIndInfo
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
* @date 2021/8/18 2:30 下午
|
||||
*/
|
||||
object TrafficDataConvertUtils {
|
||||
val TAG = "TrafficDataConvertUtils"
|
||||
|
||||
/**
|
||||
* OBU 远车 转换交通元素数据
|
||||
*/
|
||||
fun cvxRvInfoIndInfo2TrafficData(info: CvxRvInfoIndInfo): TrafficData? {
|
||||
if (info.basic_info == null || info.basic_info.position == null) {
|
||||
CallerLogger.e("$M_OBU$TAG", "cvxRvInfoIndInfo2TrafficData 数据转换异常,请检查参数是否齐全")
|
||||
return null
|
||||
}
|
||||
val trafficData = TrafficData()
|
||||
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_TA_CHE
|
||||
trafficData.uuid = info.vehicle_id
|
||||
trafficData.lat = info.basic_info.position.latitude
|
||||
trafficData.lon = info.basic_info.position.longitude
|
||||
trafficData.heading = info.basic_info.heading
|
||||
trafficData.speed = info.basic_info.speed
|
||||
|
||||
return trafficData
|
||||
}
|
||||
|
||||
/**
|
||||
* OBU RSU道路事件预警信息 转换交通元素数据
|
||||
*/
|
||||
fun cvxRtiThreatIndInfo2TrafficData(info: CvxRtiThreatIndInfo): TrafficData? {
|
||||
// 这里只处理道路施工
|
||||
if(info.ext_info.rti_type != 0x7){
|
||||
return null
|
||||
}
|
||||
if (info.rti_id == null || info.ext_info == null
|
||||
|| info.zones_info == null || info.zones_info.first() == null
|
||||
|| info.zones_info.first().path_points.first() == null
|
||||
|| info.threat_info == null
|
||||
) {
|
||||
CallerLogger.e("$M_OBU$TAG", "数据转换异常,请检查参数是否齐全")
|
||||
return null
|
||||
}
|
||||
val trafficData = TrafficData()
|
||||
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_DAO_LU_SHI_GONG
|
||||
trafficData.uuid = info.rti_id
|
||||
|
||||
trafficData.lat = info.zones_info.first().path_points.first().latitude
|
||||
trafficData.lon = info.zones_info.first().path_points.first().longitude
|
||||
|
||||
trafficData.threatLevel = info.threat_info.threat_level
|
||||
|
||||
return trafficData
|
||||
}
|
||||
|
||||
/**
|
||||
* OBU 预警事件 转换交通元素数据
|
||||
*/
|
||||
fun cvxV2vThreatIndInfo2TrafficData(info: CvxV2vThreatIndInfo): TrafficData? {
|
||||
if (info.basic_info == null || info.basic_info.position == null || info.threat_info == null) {
|
||||
CallerLogger.e("$M_OBU$TAG", "数据转换异常,请检查参数是否齐全")
|
||||
return null
|
||||
}
|
||||
val trafficData = TrafficData()
|
||||
trafficData.uuid = info.vehicle_id
|
||||
trafficData.lat = info.basic_info.position.latitude
|
||||
trafficData.lon = info.basic_info.position.longitude
|
||||
trafficData.heading = info.basic_info.heading
|
||||
trafficData.speed = info.basic_info.speed
|
||||
// 判断车辆V2X预警级别,调整车辆颜色
|
||||
trafficData.threatLevel = info.threat_info.threat_level
|
||||
|
||||
if (info.threat_info.app_id == ObuConstants.USE_CASE_ID.EVW) {
|
||||
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_SPECIAL_VEHICLE
|
||||
} else {
|
||||
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_TA_CHE
|
||||
}
|
||||
|
||||
return trafficData
|
||||
}
|
||||
|
||||
/**
|
||||
* OBU 弱势交通参与者信息 转换交通元素数据 TODO
|
||||
*/
|
||||
fun cvxPtcThreatIndInfo2TrafficData(info: CvxPtcThreatIndInfo): TrafficData? {
|
||||
if (info.ptc_pos == null || info.threat_info == null) {
|
||||
CallerLogger.e("$M_OBU$TAG", "数据转换异常,请检查参数是否齐全")
|
||||
return null
|
||||
}
|
||||
val trafficData = TrafficData()
|
||||
|
||||
trafficData.uuid = info.ptc_id
|
||||
trafficData.lat = info.ptc_pos.latitude
|
||||
trafficData.lon = info.ptc_pos.longitude
|
||||
// trafficData.heading = info.ptc_pos.heading
|
||||
// trafficData.speed = info.ptc_pos.speed
|
||||
|
||||
when (info.ptc_type) {
|
||||
// 未知
|
||||
0x0 -> {
|
||||
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI
|
||||
}
|
||||
// 非机动车
|
||||
0x1 -> {
|
||||
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_MOTO
|
||||
}
|
||||
// 行人
|
||||
0x2 -> {
|
||||
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_PEOPLE
|
||||
}
|
||||
}
|
||||
|
||||
// 判断车辆V2X预警级别,调整车辆颜色
|
||||
if (info.threat_info != null) {
|
||||
trafficData.threatLevel = info.threat_info.threat_level
|
||||
}
|
||||
|
||||
return trafficData
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -5,7 +5,6 @@ plugins {
|
||||
id 'kotlin-kapt'
|
||||
id 'com.alibaba.arouter'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
defaultConfig {
|
||||
@@ -13,10 +12,8 @@ android {
|
||||
targetSdkVersion rootProject.ext.android.targetSdkVersion
|
||||
versionCode Integer.valueOf(VERSION_CODE)
|
||||
versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION")
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles 'consumer-rules.pro'
|
||||
|
||||
//ARouter apt 参数
|
||||
kapt {
|
||||
useBuildCache = false
|
||||
@@ -32,36 +29,43 @@ android {
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '1.8'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation rootProject.ext.dependencies.androidxccorektx
|
||||
implementation rootProject.ext.dependencies.androidxappcompat
|
||||
implementation rootProject.ext.dependencies.androidxconstraintlayout
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
implementation rootProject.ext.dependencies.rxandroid
|
||||
|
||||
implementation project(path: ':foudations:mogo-commons')
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
|
||||
implementation rootProject.ext.dependencies.android_start_up
|
||||
implementation rootProject.ext.dependencies.mogocustommap
|
||||
implementation rootProject.ext.dependencies.thread_opt
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogo_core_res
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
implementation rootProject.ext.dependencies.mogo_core_utils
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_api
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_call
|
||||
implementation rootProject.ext.dependencies.crashreport
|
||||
implementation rootProject.ext.dependencies.mogomap
|
||||
implementation rootProject.ext.dependencies.mogomapapi
|
||||
} else {
|
||||
implementation project(':core:mogo-core-res')
|
||||
implementation project(':core:mogo-core-data')
|
||||
implementation project(':core:mogo-core-utils')
|
||||
implementation project(':core:mogo-core-function-api')
|
||||
implementation project(':core:mogo-core-function-call')
|
||||
implementation project(":test:crashreport")
|
||||
implementation project(':libraries:mogo-map')
|
||||
implementation project(":libraries:mogo-map-api")
|
||||
}
|
||||
|
||||
implementation rootProject.ext.dependencies.mogoobuold
|
||||
implementation rootProject.ext.dependencies.mogoobu
|
||||
|
||||
}
|
||||
|
||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Automatically generated file. DO NOT MODIFY
|
||||
*/
|
||||
package com.mogo.eagle.core.function.startup;
|
||||
|
||||
public final class BuildConfig {
|
||||
public static final boolean DEBUG = Boolean.parseBoolean("true");
|
||||
public static final String LIBRARY_PACKAGE_NAME = "com.mogo.eagle.core.function.startup";
|
||||
/**
|
||||
* @deprecated APPLICATION_ID is misleading in libraries. For the library package name use LIBRARY_PACKAGE_NAME
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String APPLICATION_ID = "com.mogo.eagle.core.function.startup";
|
||||
public static final String BUILD_TYPE = "debug";
|
||||
public static final String FLAVOR = "";
|
||||
public static final int VERSION_CODE = 1;
|
||||
public static final String VERSION_NAME = "";
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user