Merge branch 'dev_arch_opt_3.0' into 'dev_robobus-m1-p-app-module_1.0.0_230112_1.0.0'
Dev arch opt 3.0 See merge request zhjt/AndroidApp/MoGoEagleEye!537
This commit is contained in:
@@ -94,7 +94,7 @@
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.LimitingVelocityView
|
||||
android:id="@+id/viewLimitingVelocity"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:elevation="@dimen/dp_10"
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.LimitingVelocityView
|
||||
android:id="@+id/viewLimitingVelocity"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:elevation="@dimen/dp_10"
|
||||
|
||||
@@ -150,7 +150,7 @@
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.LimitingVelocityView
|
||||
android:id="@+id/viewLimitingVelocity"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:elevation="@dimen/dp_10"
|
||||
|
||||
@@ -43,6 +43,8 @@ class BindingCarManager : IMoGoAutopilotCarConfigListener {
|
||||
|
||||
fun init(context: Context) {
|
||||
mContext = context
|
||||
SharedPrefsMgr.getInstance(mContext!!).putLong("typeDriver", 0)
|
||||
SharedPrefsMgr.getInstance(mContext!!).putLong("typePassenger", 0)
|
||||
CallerAutopilotCarConfigListenerManager.addListener(TAG, this)
|
||||
ipcUpgradeManager.init(context)
|
||||
UiThreadHandler.postDelayed({ queryAppUpgrade() }, 10_000)
|
||||
|
||||
@@ -74,17 +74,20 @@ 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 data =" + info.getData().toString())
|
||||
if (!SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.MAC_ADDRESS).equals(macAddress) && DebugConfig.isCarModelChange()) {
|
||||
updateCarVrIconRes(info.getData().brandId);
|
||||
}
|
||||
d(
|
||||
SceneConstant.M_BINDING + TAG,
|
||||
"getBindingCarInfo data =" + info.getData().toString()
|
||||
)
|
||||
updateCarVrIconRes(info.getData().brandId);
|
||||
when (info.getData().compare) {
|
||||
"0" -> showBindingCarDialog()
|
||||
"3" -> showModifyBindingCarDialog()
|
||||
"null" -> TipToast.shortTip("当前工控机没有入库")
|
||||
}
|
||||
SharedPrefsMgr.getInstance(context).putString(SharedPrefsConstants.CAR_INFO, GsonUtils.toJson(info.getData()))
|
||||
SharedPrefsMgr.getInstance(context).putString(SharedPrefsConstants.MAC_ADDRESS, macAddress)
|
||||
SharedPrefsMgr.getInstance(context).putString(
|
||||
SharedPrefsConstants.CAR_INFO,
|
||||
GsonUtils.toJson(info.getData())
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,10 +136,7 @@ class BindingCarNetWorkManager private constructor() {
|
||||
SceneConstant.M_BINDING + TAG,
|
||||
"modifyBindingCar onNext code = " + info.code + "---msg = " + info.msg + "--info.toString() = " + info.toString()
|
||||
)
|
||||
if (!SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.MAC_ADDRESS).equals(macAddress) && DebugConfig.isCarModelChange()) {
|
||||
updateCarVrIconRes(info.data.brandId);
|
||||
}
|
||||
SharedPrefsMgr.getInstance(context).putString(SharedPrefsConstants.MAC_ADDRESS, macAddress)
|
||||
updateCarVrIconRes(info.data.brandId)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,6 +155,9 @@ class BindingCarNetWorkManager private constructor() {
|
||||
if (brandId == null || brandId.isEmpty()) {
|
||||
return
|
||||
}
|
||||
if (getDefaultId() == brandId) {
|
||||
return
|
||||
}
|
||||
d(SceneConstant.M_BINDING + TAG, "updateCarVrIconRes : $brandId")
|
||||
when (brandId) {
|
||||
"1" -> {
|
||||
@@ -176,4 +179,12 @@ class BindingCarNetWorkManager private constructor() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun getDefaultId(): String {
|
||||
return when (HdMapBuildConfig.currentCarVrIconRes) {
|
||||
R.raw.chuzuche -> "1"
|
||||
R.raw.xiaobache -> "3"
|
||||
else -> "1"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -12,6 +13,7 @@ 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.CallerLimitingVelocityListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import kotlinx.android.synthetic.main.view_limiting_speed_vr.view.*
|
||||
|
||||
/**
|
||||
@@ -37,15 +39,16 @@ class LimitingVelocityView constructor(
|
||||
}
|
||||
|
||||
override fun onLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) {
|
||||
if (limitingVelocity > 0) {
|
||||
this.visibility = View.VISIBLE
|
||||
tvLimitingVelocity.text = "$limitingVelocity"
|
||||
tvLimitingSource.visibility = View.VISIBLE
|
||||
tvLimitingSource.text = sourceType.name
|
||||
} else {
|
||||
this.visibility = View.GONE
|
||||
tvLimitingSource.visibility = View.GONE
|
||||
tvLimitingSource.text = ""
|
||||
ThreadUtils.runOnUiThread {
|
||||
if (limitingVelocity > 0) {
|
||||
visibility = View.VISIBLE
|
||||
tvLimitingVelocity.text = "$limitingVelocity"
|
||||
Log.d("emArrow","limit : ${ DataSourceType.getName(sourceType)}")
|
||||
tvLimitingSource.text = DataSourceType.getName(sourceType)
|
||||
} else {
|
||||
visibility = View.GONE
|
||||
tvLimitingSource.text = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,9 +23,8 @@
|
||||
android:id="@+id/tvLimitingSource"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:gravity="center"
|
||||
android:text=""
|
||||
android:text="123"
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="@dimen/dp_30"
|
||||
android:textStyle="bold"
|
||||
|
||||
@@ -1,11 +1,26 @@
|
||||
package com.mogo.eagle.core.data.enums
|
||||
|
||||
|
||||
|
||||
enum class DataSourceType(name: String) {
|
||||
DEFAULT("defalut"),
|
||||
OBU("OBU"),
|
||||
MAP("MAP"),
|
||||
TELEMATIC("TELEMATIC"),
|
||||
AICLOUD("AI云"),
|
||||
SUMMARY("汇总")// V2X事件汇总
|
||||
SUMMARY("汇总");// V2X事件汇总
|
||||
|
||||
|
||||
companion object{
|
||||
fun getName(type :DataSourceType):String{
|
||||
return when(type){
|
||||
OBU -> "OBU"
|
||||
MAP -> "MAP"
|
||||
TELEMATIC -> "TELEMATIC"
|
||||
AICLOUD -> "AI云"
|
||||
SUMMARY -> "汇总"
|
||||
else -> "defalut"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ object CallerVisualAngleManager {
|
||||
fun showTurning(open: Boolean) {
|
||||
if (open) {
|
||||
if (!isVisualAngleChanged) {
|
||||
isVisualAngleChanged
|
||||
isVisualAngleChanged = true
|
||||
changeAngle(Turning(true))
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user