[6.2.0] fix bug of break map icon

This commit is contained in:
zhongchao
2023-11-13 19:36:33 +08:00
parent a686e1fa02
commit 04875a220a
5 changed files with 40 additions and 8 deletions

View File

@@ -1040,7 +1040,7 @@ internal class DebugSettingView @JvmOverloads constructor(
private fun setEagleEyeConfigListener() {
//初始化刹车加速度阈值信息
val brakeThreshold = SharedPrefsMgr.getInstance(context)
.getFloat(MoGoConfig.BRAKE_ACCELERATION_THRESHOLD, -2.5F)
.getFloat(MoGoConfig.BRAKE_ACCELERATION_THRESHOLD, FunctionBuildConfig.accThreshold)
etInputBrakeThreshold.setText(brakeThreshold.toString())
etInputBrakeThreshold.text?.let { etInputBrakeThreshold.setSelection(brakeThreshold.toString().length) }
//设置刹车加速度阈值信息
@@ -1054,6 +1054,7 @@ internal class DebugSettingView @JvmOverloads constructor(
if (thresholdStrFloat < 0) {
SharedPrefsMgr.getInstance(context)
.putFloat(MoGoConfig.BRAKE_ACCELERATION_THRESHOLD, thresholdStrFloat)
FunctionBuildConfig.accThreshold = thresholdStrFloat
ToastUtils.showShort("刹车阈值设置成功")
} else {
ToastUtils.showShort("刹车阈值加速度值应小于0")

View File

@@ -187,8 +187,15 @@ class AiCloudIdentifyDataManager : IMoGoPlanningRottingListener,
}
override fun mapRomaInRange(range: Boolean) {
MapRomaTrace.log("", CHAIN_CODE_ROMA_RANGE, TAG, mutableMapOf("range" to range))
if(FunctionBuildConfig.romaModeStyle == 1){
val gnss = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().gnssInfo
MapRomaTrace.log(
"", CHAIN_CODE_ROMA_RANGE, TAG, mutableMapOf(
"range" to range,
"lon" to gnss.longitude,
"lat" to gnss.latitude
), true
)
if (FunctionBuildConfig.romaModeStyle == 1) {
return
}
invokeRomaViewStatus(range)
@@ -361,6 +368,7 @@ class AiCloudIdentifyDataManager : IMoGoPlanningRottingListener,
FunctionBuildConfig.romaModeStyle = 0
} else {
FunctionBuildConfig.romaModeStyle = 1
invokeRomaViewStatus(true)
}
}

View File

@@ -5,6 +5,7 @@ import android.os.Bundle
import android.util.AttributeSet
import androidx.lifecycle.LifecycleObserver
import chassis.Chassis
import com.mogo.eagle.core.data.config.FunctionBuildConfig.accThreshold
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
@@ -12,12 +13,15 @@ import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP
import com.mogo.map.MogoMapView
import com.mogo.map.overlay.line.Polyline
import com.mogo.map.overlay.point.Point
import com.mogo.map.overlay.proxy.line.IMapPolylineOverlay
import com.mogo.map.overlay.proxy.point.IMapPointOverlay
import com.mogo.map.uicontroller.IMogoMapUIController
import kotlin.properties.Delegates
class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context, attrs),
@@ -95,9 +99,23 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
}
}
/**
* 设置车辆灯光状态 true 刹车, false 正常
*/
private var accLimit : Boolean by Delegates.observable(false){ _, oldV, newV ->
if(oldV != newV){
if(newV){
turn(4)
}else{
turn(0)
}
}
}
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
// 跟新地图控件
setExtraGPSData(gnssInfo)
accLimit = gnssInfo.acceleration < accThreshold
}
private var currentLevel:Int = 0
@@ -121,11 +139,7 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
private fun turn(lightNum: Int) {
if (currentLevel != lightNum) {
when (lightNum) {
0 -> getUI()?.setCarLightsType(0, 500)
1 -> getUI()?.setCarLightsType(1, 500)
2 -> getUI()?.setCarLightsType(2, 500)
}
getUI()?.setCarLightsType(lightNum, 500)
currentLevel = lightNum
}
}

View File

@@ -127,6 +127,14 @@ object FunctionBuildConfig {
@JvmField
var adasConnectIP = "192.168.1.102"
/**
* acc 加速度值阈值
* 默认 -2.5
*/
@Volatile
@JvmField
var accThreshold = -2.5f
/**
* 自车位置使用哪种外部数据源
* 0 = Android系统/GD

View File

@@ -13,6 +13,7 @@ object CallerMapRomaListener : CallerBase<IMoGoRomaListener>() {
override fun doSomeAfterAddListener(tag: String, listener: IMoGoRomaListener) {
listener.romaStatus(roma)
listener.mapRomaInRange(romaRange)
}
fun invokeMapRomaRange(romaRange: Boolean) {