Merge remote-tracking branch 'origin/dev_robobus-m1-p-app-module_1.0.0_230112_1.0.0' into dev_robobus-m1-p-app-module_1.0.0_230112_1.0.0
This commit is contained in:
@@ -4,18 +4,8 @@ import android.content.Context
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.commons.module.status.StatusDescriptor
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2021/1/15
|
||||
*
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
@Route(path = OCHConstants.PATH)
|
||||
class MoGoOCHNoopProvider : IMogoOCH {
|
||||
|
||||
@@ -31,23 +21,8 @@ class MoGoOCHNoopProvider : IMogoOCH {
|
||||
private var activity: FragmentActivity? = null
|
||||
|
||||
override fun init(context: Context) {
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(
|
||||
TAG, StatusDescriptor.VR_MODE, statusChangedListener
|
||||
)
|
||||
}
|
||||
|
||||
private val statusChangedListener =
|
||||
IMogoStatusChangedListener { descriptor: StatusDescriptor, isTrue: Boolean ->
|
||||
if (descriptor == StatusDescriptor.VR_MODE) {
|
||||
// 进入vr模式默认显示网约车小巴fragment
|
||||
if (isTrue) {
|
||||
showFragment()
|
||||
} else {
|
||||
hideFragment()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun showFragment() {
|
||||
activity?.let {
|
||||
if (fragment == null) {
|
||||
@@ -72,17 +47,10 @@ class MoGoOCHNoopProvider : IMogoOCH {
|
||||
}
|
||||
}
|
||||
|
||||
private fun hideFragment() {
|
||||
if (fragment != null) {
|
||||
d(TAG, "准备hide fragment")
|
||||
activity?.supportFragmentManager?.beginTransaction()?.hide(fragment!!)
|
||||
?.commitAllowingStateLoss()
|
||||
}
|
||||
}
|
||||
|
||||
override fun createCoverage(activity: FragmentActivity?, containerId: Int?): Fragment? {
|
||||
this.containerId = containerId!!
|
||||
this.activity = activity
|
||||
showFragment()
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.mogo.och.noop
|
||||
|
||||
import android.view.View
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView
|
||||
import kotlinx.android.synthetic.main.och_noop_fragment_hmi.*
|
||||
@@ -29,21 +28,6 @@ class OchNoopFragment : MvpFragment<OchNoopContract.View?, OchNoopPresenter?>(),
|
||||
ToggleDebugView.toggleDebugView.toggle(requireContext())
|
||||
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)
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -14,6 +14,19 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<com.mogo.eagle.core.function.view.MapBizView
|
||||
android:id="@+id/mapBizView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<!--刹车、转向-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.SteeringBrakeView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--V2X预警红色边框-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.V2XWarningView
|
||||
android:layout_width="match_parent"
|
||||
@@ -38,13 +51,6 @@
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.SteeringWheelView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--Vip车辆标志-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
|
||||
android:layout_width="@dimen/module_vip_width"
|
||||
@@ -73,7 +79,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_constraintTop_toBottomOf="@+id/viewSpeedChart" />
|
||||
|
||||
<!--超视距-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.CameraView
|
||||
@@ -101,16 +107,16 @@
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"
|
||||
tools:visibility="visible"/>
|
||||
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"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -142,11 +148,11 @@
|
||||
android:layout_height="@dimen/module_hmi_check_size"
|
||||
android:layout_marginStart="25dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:contentDescription="工具箱"
|
||||
android:elevation="@dimen/dp_10"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/viewPerspectiveSwitch"
|
||||
app:layout_goneMarginStart="50dp"
|
||||
android:contentDescription="工具箱"/>
|
||||
app:layout_goneMarginStart="50dp" />
|
||||
|
||||
<!--问题反馈-->
|
||||
<ImageView
|
||||
@@ -155,10 +161,10 @@
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginStart="50dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:contentDescription="BadCase"
|
||||
android:src="@drawable/bad_case_selector"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/ivToolsView"
|
||||
android:contentDescription="BadCase"/>
|
||||
app:layout_constraintStart_toEndOf="@id/ivToolsView" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivAiCollectTools"
|
||||
@@ -166,10 +172,10 @@
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginStart="50dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:contentDescription="数据采集"
|
||||
android:src="@drawable/ai_collect_selector"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/ivBadCaseTools"
|
||||
android:contentDescription="数据采集" />
|
||||
app:layout_constraintStart_toEndOf="@id/ivBadCaseTools" />
|
||||
|
||||
<View
|
||||
android:id="@+id/viewUpgradeTips"
|
||||
@@ -217,7 +223,7 @@
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/cbMsgBoxDriver"
|
||||
tools:visibility="gone"/>
|
||||
tools:visibility="gone" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView
|
||||
android:id="@+id/viewDriverMsgBoxBubble"
|
||||
|
||||
@@ -38,6 +38,8 @@ project.android.productFlavors {
|
||||
buildConfigField 'String', 'ADAS_CONNECT_IP', "\"192.168.8.102\""
|
||||
// 构建的是否是演示(美化)模式
|
||||
buildConfigField 'boolean', 'IS_DEMO_MODE', 'false'
|
||||
// 构建的是否要动态更换模型
|
||||
buildConfigField 'boolean', 'IS_CAR_MODEL_CHANGE', 'true'
|
||||
|
||||
// 构建 是否支持多屏异显异交互
|
||||
buildConfigField 'boolean', 'IS_MULTI_DISPLAY', 'true'
|
||||
|
||||
@@ -40,6 +40,8 @@ project.android.productFlavors {
|
||||
buildConfigField 'String', 'ADAS_CONNECT_IP', "\"192.168.1.102\""
|
||||
// 构建的是否是演示(美化)模式
|
||||
buildConfigField 'boolean', 'IS_DEMO_MODE', 'false'
|
||||
// 构建的是否要动态更换模型
|
||||
buildConfigField 'boolean', 'IS_CAR_MODEL_CHANGE', 'true'
|
||||
|
||||
// 构建 是否支持多屏异显异交互
|
||||
buildConfigField 'boolean', 'IS_MULTI_DISPLAY', 'true'
|
||||
|
||||
@@ -41,6 +41,8 @@ project.android.productFlavors {
|
||||
buildConfigField 'String', 'ADAS_CONNECT_IP', "\"192.168.8.102\""
|
||||
// 构建的是否是演示(美化)模式
|
||||
buildConfigField 'boolean', 'IS_DEMO_MODE', 'false'
|
||||
// 构建的是否要动态更换模型
|
||||
buildConfigField 'boolean', 'IS_CAR_MODEL_CHANGE', 'true'
|
||||
|
||||
// 构建 是否支持多屏异显异交互
|
||||
buildConfigField 'boolean', 'IS_MULTI_DISPLAY', 'false'
|
||||
|
||||
@@ -41,6 +41,8 @@ project.android.productFlavors {
|
||||
buildConfigField 'String', 'ADAS_CONNECT_IP', "\"192.168.8.103\""
|
||||
// 构建的是否是演示(美化)模式
|
||||
buildConfigField 'boolean', 'IS_DEMO_MODE', 'false'
|
||||
// 构建的是否要动态更换模型
|
||||
buildConfigField 'boolean', 'IS_CAR_MODEL_CHANGE', 'true'
|
||||
|
||||
// 构建 是否支持多屏异显异交互
|
||||
buildConfigField 'boolean', 'IS_MULTI_DISPLAY', 'false'
|
||||
|
||||
@@ -41,6 +41,8 @@ project.android.productFlavors {
|
||||
buildConfigField 'String', 'ADAS_CONNECT_IP', "\"192.168.8.102\""
|
||||
// 构建的是否是演示(美化)模式
|
||||
buildConfigField 'boolean', 'IS_DEMO_MODE', 'false'
|
||||
// 构建的是否要动态更换模型
|
||||
buildConfigField 'boolean', 'IS_CAR_MODEL_CHANGE', 'true'
|
||||
|
||||
// 构建 是否支持多屏异显异交互
|
||||
buildConfigField 'boolean', 'IS_MULTI_DISPLAY', 'false'
|
||||
|
||||
@@ -42,6 +42,8 @@ project.android.productFlavors {
|
||||
buildConfigField 'String', 'ADAS_CONNECT_IP', "\"192.168.1.102\""
|
||||
// 构建的是否是演示(美化)模式
|
||||
buildConfigField 'boolean', 'IS_DEMO_MODE', 'false'
|
||||
// 构建的是否要动态更换模型
|
||||
buildConfigField 'boolean', 'IS_CAR_MODEL_CHANGE', 'true'
|
||||
|
||||
// 构建 是否支持多屏异显异交互
|
||||
buildConfigField 'boolean', 'IS_MULTI_DISPLAY', 'false'
|
||||
|
||||
@@ -41,6 +41,8 @@ project.android.productFlavors {
|
||||
buildConfigField 'String', 'ADAS_CONNECT_IP', "\"192.168.1.103\""
|
||||
// 构建的是否是演示(美化)模式
|
||||
buildConfigField 'boolean', 'IS_DEMO_MODE', 'false'
|
||||
// 构建的是否要动态更换模型
|
||||
buildConfigField 'boolean', 'IS_CAR_MODEL_CHANGE', 'true'
|
||||
|
||||
// 构建 是否支持多屏异显异交互
|
||||
buildConfigField 'boolean', 'IS_MULTI_DISPLAY', 'true'
|
||||
|
||||
@@ -38,6 +38,8 @@ project.android.productFlavors {
|
||||
buildConfigField 'String', 'ADAS_CONNECT_IP', "\"192.168.1.104\""
|
||||
// 构建的是否是演示(美化)模式
|
||||
buildConfigField 'boolean', 'IS_DEMO_MODE', 'false'
|
||||
// 构建的是否要动态更换模型
|
||||
buildConfigField 'boolean', 'IS_CAR_MODEL_CHANGE', 'true'
|
||||
|
||||
// 构建 是否支持多屏异显异交互
|
||||
buildConfigField 'boolean', 'IS_MULTI_DISPLAY', 'false'
|
||||
|
||||
@@ -79,6 +79,7 @@ object ConfigStartUp {
|
||||
DebugConfig.setMapOptVersion(BuildConfig.MAP_SDK_OPT_VERSION)
|
||||
DebugConfig.setNeedUploadCoordinatesInTime(BuildConfig.IS_NEED_UPLOAD_COORDINATES_IN_TIME)
|
||||
DebugConfig.setMultiDisplay(BuildConfig.IS_MULTI_DISPLAY)
|
||||
DebugConfig.setCarModelChange(BuildConfig.IS_CAR_MODEL_CHANGE)
|
||||
}
|
||||
|
||||
private fun initOtherConfig(context: Context) {
|
||||
|
||||
@@ -58,7 +58,6 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.amapnavi3dmap
|
||||
implementation project(':libraries:mogo-obu')
|
||||
implementation project(':libraries:mogo-adas')
|
||||
implementation project(':libraries:mogo-adas-data')
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogo_core_utils
|
||||
|
||||
@@ -354,8 +354,6 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
|
||||
when (status) {
|
||||
MogoObuConstants.STATUS.ADD -> { // 添加
|
||||
//显示警告红边
|
||||
// CallerHmiManager.showWarning(direction)
|
||||
//不显示弹框,语音提示,数据在消息盒子里面展示,此处不在处理弹框
|
||||
if (alertContent.isEmpty() || ttsContent.isEmpty()) {
|
||||
return
|
||||
@@ -583,7 +581,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
var ttsContent: String = ""
|
||||
var changeVisualAngle = false
|
||||
when (appId) {
|
||||
//交叉路口碰撞预警
|
||||
//前向碰撞预警
|
||||
MogoObuConstants.V2X_WARNING_TYPE.FCW.toString() -> {
|
||||
alertContent =
|
||||
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
|
||||
@@ -736,6 +734,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
}, direction
|
||||
)
|
||||
}
|
||||
// ObuManager.getInstance().obuRvToTrackedObject(info)
|
||||
//更新周边车辆进行预警颜色变换,车辆实时移动和变色 ,UUID不需要匹配了
|
||||
TrafficDataConvertUtilsNew.cvxV2vThreatIndInfo2TrafficData(info)?.let {
|
||||
CallerMapUIServiceManager.getMarkerService()
|
||||
|
||||
@@ -115,7 +115,7 @@ class BindingCarManager : IMoGoAutopilotCarConfigListener {
|
||||
SharedPrefsMgr.getInstance(mContext!!)
|
||||
.putLong("typeDriver", System.currentTimeMillis() / (1000 * 60))
|
||||
BindingCarNetWorkManager.instance
|
||||
.getBindingcarInfo(mContext, macAddress, widevineIDWithMd5, screenType)
|
||||
.getBindingCarInfo(mContext!!, macAddress, widevineIDWithMd5, screenType)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -131,7 +131,7 @@ class BindingCarManager : IMoGoAutopilotCarConfigListener {
|
||||
SharedPrefsMgr.getInstance(mContext!!)
|
||||
.putLong("typePassenger", System.currentTimeMillis() / (1000 * 60))
|
||||
BindingCarNetWorkManager.instance
|
||||
.getBindingcarInfo(mContext, macAddress, widevineIDWithMd5, screenType)
|
||||
.getBindingCarInfo(mContext!!, macAddress, widevineIDWithMd5, screenType)
|
||||
}
|
||||
}
|
||||
}//乘客屏//司机屏
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.zhjt.mogo_core_function_devatools.binding
|
||||
import android.content.Context
|
||||
import com.mogo.commons.constants.HostConst
|
||||
import com.mogo.commons.constants.SharedPrefsConstants
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.eagle.core.data.bindingcar.BindingCarInfo
|
||||
import com.mogo.eagle.core.data.bindingcar.BindingCarRequest
|
||||
import com.mogo.eagle.core.data.bindingcar.ModifyBindingcarInfo
|
||||
@@ -40,16 +41,17 @@ class BindingCarNetWorkManager private constructor() {
|
||||
}
|
||||
}
|
||||
|
||||
private val mBindingCarApiService: BindingCarApiService = MoGoRetrofitFactory.getInstance(HostConst.getHost())
|
||||
.create(BindingCarApiService::class.java)
|
||||
private val mBindingCarApiService: BindingCarApiService =
|
||||
MoGoRetrofitFactory.getInstance(HostConst.getHost())
|
||||
.create(BindingCarApiService::class.java)
|
||||
|
||||
/**
|
||||
* 获取绑定的车辆信息
|
||||
*
|
||||
* @param macAddress mac地址
|
||||
*/
|
||||
fun getBindingcarInfo(
|
||||
context: Context?,
|
||||
fun getBindingCarInfo(
|
||||
context: Context,
|
||||
macAddress: String?,
|
||||
widevineIDWithMd5: String?,
|
||||
screenType: Int
|
||||
@@ -72,10 +74,10 @@ class BindingCarNetWorkManager private constructor() {
|
||||
override fun onSubscribe(d: Disposable) {}
|
||||
override fun onNext(info: BindingCarInfo) {
|
||||
if (info != null && info.getData() != null) {
|
||||
d(
|
||||
SceneConstant.M_BINDING + TAG,
|
||||
"getBindingcarInfo onNext info.getData() =" + info.getData().toString()
|
||||
)
|
||||
d(SceneConstant.M_BINDING + TAG, "getBindingcarInfo data =" + info.getData().toString())
|
||||
if (!SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.MAC_ADDRESS).equals(macAddress) && DebugConfig.isCarModelChange()) {
|
||||
updateCarVrIconRes(info.getData().brandId);
|
||||
}
|
||||
//根据车辆类型切换不同的车辆模型,只针对红旗做处理
|
||||
updateCarVrIconRes(info.getData().brandId)
|
||||
when (info.getData().compare) {
|
||||
@@ -83,10 +85,8 @@ class BindingCarNetWorkManager private constructor() {
|
||||
"3" -> showModifyBindingCarDialog()
|
||||
"null" -> TipToast.shortTip("当前工控机没有入库")
|
||||
}
|
||||
SharedPrefsMgr.getInstance(context!!).putString(
|
||||
SharedPrefsConstants.CAR_INFO,
|
||||
GsonUtils.toJson(info.getData())
|
||||
)
|
||||
SharedPrefsMgr.getInstance(context).putString(SharedPrefsConstants.CAR_INFO, GsonUtils.toJson(info.getData()))
|
||||
SharedPrefsMgr.getInstance(context).putString(SharedPrefsConstants.MAC_ADDRESS, macAddress)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,10 +35,6 @@ class SteeringBrakeView(context: Context, attrs: AttributeSet?) : ConstraintLayo
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_steering_brake, this, true)
|
||||
val typedArray = context.obtainStyledAttributes(attrs, R.styleable.SteeringBrakeView)
|
||||
val dayLight = typedArray.getBoolean(R.styleable.SteeringBrakeView_day_light_mode, false)
|
||||
turnLightView.dayLightMode(dayLight)
|
||||
typedArray.recycle()
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
@@ -47,7 +43,6 @@ class SteeringBrakeView(context: Context, attrs: AttributeSet?) : ConstraintLayo
|
||||
CallerChassisLocationWGS84ListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
|
||||
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
|
||||
if (gnssInfo != null) {
|
||||
//设置刹车信息,小于默认认为是刹车
|
||||
@@ -86,8 +81,6 @@ class SteeringBrakeView(context: Context, attrs: AttributeSet?) : ConstraintLayo
|
||||
brakeView.visibility = View.GONE
|
||||
isShowTurnLight = false
|
||||
}
|
||||
turnLightView.visibility = View.VISIBLE
|
||||
turnLightView.setTurnLight(lightSwitch)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,9 +11,12 @@ import android.view.animation.Animation
|
||||
import android.widget.ImageView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import chassis.Chassis
|
||||
import com.mogo.eagle.core.function.api.map.angle.*
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener
|
||||
import com.mogo.eagle.core.function.api.map.angle.Turning
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import kotlinx.android.synthetic.main.view_steering_brake.view.*
|
||||
import kotlinx.android.synthetic.main.view_turn_light_status.view.*
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
@@ -25,33 +28,62 @@ import kotlinx.coroutines.launch
|
||||
* @author lixiaopeng
|
||||
* @since 2022/1/10
|
||||
*/
|
||||
class TurnLightViewStatus @JvmOverloads constructor(
|
||||
open class TurnLightViewStatus @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr) {
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoChassisLamplightListener {
|
||||
|
||||
private var init: Boolean = false
|
||||
companion object {
|
||||
private const val TAG = "TurnLightViewStatus"
|
||||
}
|
||||
|
||||
fun dayLightMode(dayLight: Boolean) {
|
||||
private val visible: Boolean
|
||||
|
||||
init {
|
||||
val typedArray = context.obtainStyledAttributes(attrs, R.styleable.TurnLightView)
|
||||
val dayLight = typedArray.getBoolean(R.styleable.TurnLightView_day_light_mode, false)
|
||||
if (dayLight) {
|
||||
LayoutInflater.from(context)
|
||||
.inflate(R.layout.view_turn_light_status_daytime, this, true)
|
||||
} else {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_turn_light_status, this, true)
|
||||
}
|
||||
invalidate()
|
||||
init = true
|
||||
visible = typedArray.getBoolean(R.styleable.TurnLightView_visible, false)
|
||||
if (visible) {
|
||||
turn_light_layout.visibility = View.VISIBLE
|
||||
} else {
|
||||
turn_light_layout.visibility = View.GONE
|
||||
}
|
||||
typedArray.recycle()
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerChassisLamplightListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerChassisLamplightListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
override fun onAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch?) {
|
||||
super.onAutopilotLightSwitchData(lightSwitch)
|
||||
lightSwitch?.let {
|
||||
turnLightView.visibility = View.VISIBLE
|
||||
setTurnLight(it)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 转向灯动画
|
||||
*/
|
||||
fun setTurnLight(directionLight: Chassis.LightSwitch) {
|
||||
private fun setTurnLight(directionLight: Chassis.LightSwitch) {
|
||||
if (!isAttachedToWindow) {
|
||||
return
|
||||
}
|
||||
GlobalScope.launch(Dispatchers.Main) {
|
||||
if (!init) {
|
||||
return@launch
|
||||
}
|
||||
//根据左右进行显示和隐藏,实际要判断每个来的时间和频度
|
||||
when (directionLight) {
|
||||
Chassis.LightSwitch.LIGHT_LEFT -> { //左转向
|
||||
@@ -135,7 +167,9 @@ class TurnLightViewStatus @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
override fun onAnimationEnd(p0: Animation?) {
|
||||
turn_light_layout.visibility = View.GONE
|
||||
if (visible) {
|
||||
turn_light_layout.visibility = View.GONE
|
||||
}
|
||||
stopAnimate()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -5,23 +5,22 @@ import android.graphics.Color
|
||||
import android.util.AttributeSet
|
||||
import android.view.Gravity
|
||||
import android.widget.FrameLayout
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
* @date 2021/8/25 8:25 下午
|
||||
*/
|
||||
class SpeedPanelView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : FrameLayout(context, attrs, defStyleAttr), IMoGoChassisLocationGCJ02Listener {
|
||||
) : FrameLayout(context, attrs, defStyleAttr), IMoGoChassisLocationGCJ02Listener,
|
||||
ILimitingVelocityListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "SpeedPanelView"
|
||||
@@ -30,11 +29,6 @@ class SpeedPanelView @JvmOverloads constructor(
|
||||
var mContext: Context
|
||||
var mSpeedChartView: SpeedChartView
|
||||
var mLatLng: MogoLocation? = null
|
||||
var mSpeedLimit = 60
|
||||
|
||||
private val timer by lazy {
|
||||
Timer()
|
||||
}
|
||||
|
||||
init {
|
||||
setBackgroundResource(R.drawable.yi_biao_pan_bg_nor)
|
||||
@@ -50,49 +44,34 @@ class SpeedPanelView @JvmOverloads constructor(
|
||||
addView(mSpeedChartView)
|
||||
}
|
||||
|
||||
private var timerTask: TimerTask? = null
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
// 注册位置回调
|
||||
CallerLimitingVelocityListenerManager.addListener(TAG, this)
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, this)
|
||||
// 开启定时查询速度
|
||||
timerTask?.cancel()
|
||||
val task = object : TimerTask() {
|
||||
override fun run() {
|
||||
mLatLng?.let {
|
||||
mSpeedLimit = CallerMapUIServiceManager.getMapUIController()!!.getLimitSpeed(it.longitude, it.latitude,
|
||||
it.heading.toFloat()
|
||||
)
|
||||
UiThreadHandler.post {
|
||||
val speed = (it.gnssSpeed * 3.6f).toInt()
|
||||
mSpeedChartView.setArcColor(Color.parseColor(if (speed > mSpeedLimit) "#DB3137" else "#3E77F6"))
|
||||
mSpeedChartView.setValues(speed)
|
||||
setBackgroundResource(if (speed > mSpeedLimit) R.drawable.yi_biao_pan_bg_speeding else R.drawable.yi_biao_pan_bg_nor)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.timerTask = task
|
||||
timer.schedule(task, Date(), 200)
|
||||
}
|
||||
|
||||
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
|
||||
gnssInfo?.let {
|
||||
mLatLng = gnssInfo
|
||||
override fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) {
|
||||
mogoLocation?.let {
|
||||
mLatLng = mogoLocation
|
||||
}
|
||||
}
|
||||
|
||||
override fun onLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) {
|
||||
super.onLimitingVelocityChange(limitingVelocity, sourceType)
|
||||
mLatLng?.let {
|
||||
UiThreadHandler.post {
|
||||
val speed = (it.gnssSpeed * 3.6f).toInt()
|
||||
mSpeedChartView.setArcColor(Color.parseColor(if (speed > limitingVelocity) "#DB3137" else "#3E77F6"))
|
||||
mSpeedChartView.setValues(speed)
|
||||
setBackgroundResource(if (speed > limitingVelocity) R.drawable.yi_biao_pan_bg_speeding else R.drawable.yi_biao_pan_bg_nor)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
// 解除注册
|
||||
CallerLimitingVelocityListenerManager.removeListener(TAG)
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
|
||||
try {
|
||||
timerTask?.cancel()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -69,9 +69,9 @@
|
||||
<item name="android:borderlessButtonStyle">@android:color/transparent</item>
|
||||
</style>
|
||||
|
||||
<declare-styleable name="SteeringBrakeView">
|
||||
<declare-styleable name="TurnLightView">
|
||||
<attr name="day_light_mode" format="boolean"/>
|
||||
<attr name="brakeView" format="boolean"/>
|
||||
<attr name="visible" format="boolean"/>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="PncActionsView">
|
||||
|
||||
@@ -67,6 +67,11 @@ object TrackerSourceColorHelper {
|
||||
color = "#9900ffFF"
|
||||
}
|
||||
|
||||
//僵尸车
|
||||
if(data.addAttribute == AdditionalAttribute.ATTR_ZOMBIE){
|
||||
color = "#D1E5FDFF"
|
||||
}
|
||||
|
||||
// pnc预警
|
||||
WarningHelper.getPncColor(data.uuid.toString()) {
|
||||
if (it.isNotBlank()) {
|
||||
|
||||
@@ -190,4 +190,15 @@ public class DebugConfig {
|
||||
public static boolean isMultiDisplay() {
|
||||
return isMultiDisplay;
|
||||
}
|
||||
|
||||
// 兼容是否支持多屏幕方案
|
||||
private static boolean isCarModelChange = true;
|
||||
|
||||
public static void setCarModelChange(boolean status) {
|
||||
isCarModelChange = status;
|
||||
}
|
||||
|
||||
public static boolean isCarModelChange() {
|
||||
return isCarModelChange;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user