From e0007ad81b275e32ba129bdfdfb6d29395a5f018 Mon Sep 17 00:00:00 2001 From: donghongyu Date: Thu, 16 Feb 2023 16:13:01 +0800 Subject: [PATCH 1/9] =?UTF-8?q?[dev=5Farch=5Fopt=5F3.0]=20[Change]=20[=201?= =?UTF-8?q?=E3=80=81=E5=A2=9E=E5=8A=A0=E8=8E=B7=E5=8F=96=E5=BA=8F=E5=88=97?= =?UTF-8?q?=E5=8C=96=E5=90=8E=E7=9A=84=E5=89=AF=E5=B1=8F=E5=B9=95=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=96=B9=E6=B3=95=20]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: donghongyu --- .../core/utilcode/util/MultiDisplayUtils.kt | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/util/MultiDisplayUtils.kt b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/util/MultiDisplayUtils.kt index c24acc4a62..67c6f0aa99 100644 --- a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/util/MultiDisplayUtils.kt +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/util/MultiDisplayUtils.kt @@ -15,6 +15,57 @@ import androidx.appcompat.app.AppCompatActivity object MultiDisplayUtils { private val TAG: String = "MultiDisplayUtils" + /** + * 定昌电子,6屏幕异显 对应的lcd匹配数组, 当前数组只对应于6屏异显, + * 如果是其他屏幕个数, 需要自己重新对应下相关的索引 + * display 里面查看port对应的值 + */ + private var lcd_sub_port_six_lcd_mode = arrayOf( + // main lcd // HDMI-1 + //-------------------begin 定昌电子 RK3588 ------------------- + "port=240", // HDMI-2 + "port=3", // HDMI-3 + "port=243", // HDMI-4 + "port=2", // HDMI-5 + "port=1", // HDMI-6 + //-------------------end 定昌电子 RK3588 ------------------- + ) + + /** + * 获取其他的屏幕 + */ + fun getOtherDisplay(): Array { + val mDisplayManager = + Utils.getApp().getSystemService(Context.DISPLAY_SERVICE) as DisplayManager + // 获取除了内置屏幕(主屏幕)的其它屏幕 + val displays = mDisplayManager.getDisplays(DisplayManager.DISPLAY_CATEGORY_PRESENTATION) + // 初始化新的集合进行接收排序后的屏幕信息 + val displaysList = arrayOfNulls(displays.size) + + // 判断副屏个数 + if (displays.isNotEmpty()) { + // 循环出来副屏幕进行重新排序 + for (i in displays.indices) { + // 这里如果需要固定某个屏幕, 使用 if( display.toString().indexOf("port=1")!=-1) ) 而不是使用 display[i] + val strDisplayString: String = displays[i].toString() + for (j in lcd_sub_port_six_lcd_mode.indices) { // 这里增加port的匹配, 如果不需要对应的匹配 可看下面的other LCD + if (strDisplayString.indexOf(lcd_sub_port_six_lcd_mode[j]) != -1) { // 查找我们实际屏幕的匹配port + displaysList[j] = displays[i] + } + } + } + + // 没有匹配到的显示 + for (i in displays.indices) { + if (displaysList[i] == null) { + displaysList[i] = displays[i] + } + } + } + return displaysList + } + + // 获取 是否支持扩展屏幕打开应用 fun isSupportMultiDisplay(context: Context): Boolean { // 先检查一下是不是支持在第二屏上显示activity这个特性, From 63204a14adec8e9fb6b8302acc4cc3536e8e2dac Mon Sep 17 00:00:00 2001 From: zhongchao Date: Thu, 16 Feb 2023 18:37:42 +0800 Subject: [PATCH 2/9] [2.13.0-arch-opt]fix bug --- .../sweeper/view/SweeperTrafficDataView.java | 3 - .../hmi/ui/vehicle/SteeringBrakeView.kt | 2 - .../hmi/ui/vehicle/TurnLightViewStatus.kt | 55 +++++++++---------- .../hmi/ui/widget/LimitingVelocityView.kt | 2 + .../res/layout/view_limiting_speed_vr.xml | 3 +- .../eagle/core/function/view/MapBizView.kt | 52 +++++++++++++----- .../CallerChassisLamplightListenerManager.kt | 15 ++--- 7 files changed, 76 insertions(+), 56 deletions(-) diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficDataView.java b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficDataView.java index b8e5c3c370..32db9adef0 100644 --- a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficDataView.java +++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficDataView.java @@ -94,13 +94,10 @@ public class SweeperTrafficDataView extends ConstraintLayout if (lightSwitch != null) { CallerLogger.INSTANCE.d(TAG, "车辆转向灯:" + lightSwitch.toString()); if (lightSwitch.getNumber()==1){ - CallerVisualAngleManager.INSTANCE.showTurning(true); sweeperTurnSignal.showLeftSignal(); }else if(lightSwitch.getNumber()==2){ - CallerVisualAngleManager.INSTANCE.showTurning(true); sweeperTurnSignal.showRightSignal(); }else{ - CallerVisualAngleManager.INSTANCE.showTurning(false); sweeperTurnSignal.showDirection(); } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/SteeringBrakeView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/SteeringBrakeView.kt index 604ae04474..f89fe8f773 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/SteeringBrakeView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/SteeringBrakeView.kt @@ -81,11 +81,9 @@ class SteeringBrakeView(context: Context, attrs: AttributeSet?) : ConstraintLayo ThreadUtils.runOnUiThread { if (lightSwitch.number == 1 || lightSwitch.number == 2) { isShowTurnLight = true - CallerVisualAngleManager.showTurning(true) brakeView.visibility = View.VISIBLE brakeView.setBrakeLight(0) } else { - CallerVisualAngleManager.showTurning(false) brakeView.visibility = View.GONE isShowTurnLight = false } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/TurnLightViewStatus.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/TurnLightViewStatus.kt index 803b0a815e..fd1931ee7f 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/TurnLightViewStatus.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/TurnLightViewStatus.kt @@ -12,16 +12,10 @@ import android.widget.ImageView import androidx.constraintlayout.widget.ConstraintLayout import chassis.Chassis 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 com.mogo.eagle.core.utilcode.util.ThreadUtils -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 -import kotlinx.coroutines.launch /** * @description @@ -40,6 +34,9 @@ open class TurnLightViewStatus @JvmOverloads constructor( } private val visible: Boolean + private var isLeftLight: Boolean = false + private var isRightLight: Boolean = false + private var isDisappear: Boolean = false init { val typedArray = context.obtainStyledAttributes(attrs, R.styleable.TurnLightView) @@ -73,7 +70,6 @@ open class TurnLightViewStatus @JvmOverloads constructor( super.onAutopilotLightSwitchData(lightSwitch) lightSwitch?.let { ThreadUtils.runOnUiThread { - turnLightView.visibility = View.VISIBLE setTurnLight(it) } } @@ -86,27 +82,37 @@ open class TurnLightViewStatus @JvmOverloads constructor( if (!isAttachedToWindow) { return } - GlobalScope.launch(Dispatchers.Main) { - //根据左右进行显示和隐藏,实际要判断每个来的时间和频度 - when (directionLight) { - Chassis.LightSwitch.LIGHT_LEFT -> { //左转向 - CallerVisualAngleManager.showTurning(true) + //根据左右进行显示和隐藏,实际要判断每个来的时间和频度 + when (directionLight.number) { + Chassis.LightSwitch.LIGHT_LEFT_VALUE -> { //左转向 + if (!isLeftLight) { + isLeftLight = true + isRightLight = false + isDisappear = false showNormalAnimation() left_select_image.visibility = View.VISIBLE right_select_image.visibility = View.GONE right_select_image.clearAnimation() setAnimation(left_select_image) } - Chassis.LightSwitch.LIGHT_RIGHT -> { //右转向 - CallerVisualAngleManager.showTurning(true) + } + Chassis.LightSwitch.LIGHT_RIGHT_VALUE -> { //右转向 + if (!isRightLight) { + isRightLight = true + isLeftLight = false + isDisappear = false showNormalAnimation() left_select_image.visibility = View.GONE right_select_image.visibility = View.VISIBLE left_select_image.clearAnimation() setAnimation(right_select_image) } - else -> { //消失 - CallerVisualAngleManager.showTurning(false) + } + Chassis.LightSwitch.LIGHT_NONE_VALUE -> { //消失 + if (!isDisappear) { + isDisappear = true + isLeftLight = false + isRightLight = false animationDisappear() } } @@ -170,10 +176,9 @@ open class TurnLightViewStatus @JvmOverloads constructor( } override fun onAnimationEnd(p0: Animation?) { - if (visible) { + if (!visible) { turn_light_layout.visibility = View.GONE } - stopAnimate() } }) } @@ -182,19 +187,13 @@ open class TurnLightViewStatus @JvmOverloads constructor( private fun setAnimation(imageView: ImageView) { val animationSet = AnimatorSet() val valueAnimator = ObjectAnimator.ofFloat(imageView, "alpha", 0f, 1.0f) - val valueAnimatorDisappare = ObjectAnimator.ofFloat(imageView, "alpha", 1.0f, 0f) + val valueAnimatorDisappear = ObjectAnimator.ofFloat(imageView, "alpha", 1.0f, 0f) valueAnimator.duration = 1000 - valueAnimatorDisappare.duration = 800 + valueAnimatorDisappear.duration = 800 valueAnimator.repeatCount = -1 - valueAnimatorDisappare.repeatCount = -1 - animationSet.playTogether(valueAnimatorDisappare, valueAnimator) + valueAnimatorDisappear.repeatCount = -1 + animationSet.playTogether(valueAnimatorDisappear, valueAnimator) animationSet.start() } - private fun stopAnimate() { - turn_light_layout.clearAnimation() - left_nor_image.clearAnimation() - right_nor_image.clearAnimation() - } - } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/LimitingVelocityView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/LimitingVelocityView.kt index ec4155e06c..32406eba70 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/LimitingVelocityView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/LimitingVelocityView.kt @@ -40,9 +40,11 @@ class LimitingVelocityView constructor( 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 = "" } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_limiting_speed_vr.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_limiting_speed_vr.xml index fb6060c188..0bca4b164a 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_limiting_speed_vr.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_limiting_speed_vr.xml @@ -30,7 +30,6 @@ android:textSize="@dimen/dp_30" android:textStyle="bold" app:layout_constraintLeft_toLeftOf="parent" - app:layout_constraintTop_toBottomOf="@+id/tvLimitingVelocity" - android:visibility="gone" /> + app:layout_constraintTop_toBottomOf="@+id/tvLimitingVelocity" /> \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/MapBizView.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/MapBizView.kt index 405cb1b4f5..01defbe2ab 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/MapBizView.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/MapBizView.kt @@ -3,6 +3,7 @@ package com.mogo.eagle.core.function.view import android.content.Context import android.os.Bundle import android.util.AttributeSet +import android.util.Log import androidx.lifecycle.LifecycleObserver import chassis.Chassis import com.mogo.eagle.core.data.map.MogoLocation @@ -11,15 +12,17 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Liste 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.map.* +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.setting.CallerSkinModeListenerManager import com.mogo.map.MogoMapView -class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context, attrs), IMoGoSkinModeChangeListener, - IMoGoChassisLocationWGS84Listener, IMoGoChassisLamplightListener , LifecycleObserver { - - companion object{ +class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context, attrs), + IMoGoSkinModeChangeListener, + IMoGoChassisLocationWGS84Listener, IMoGoChassisLamplightListener, LifecycleObserver { + + companion object { private const val TAG = "MapBizView" } @@ -34,7 +37,7 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context, } - private fun initMapView(){ + private fun initMapView() { map?.uiSettings?.let { //设置所有手势是否可用 it.setAllGesturesEnabled(true) @@ -84,26 +87,47 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context, setExtraGPSData(gnssInfo) } + @Volatile + private var isVisualAngleChanged = false + override fun onAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch?) { super.onAutopilotLightSwitchData(lightSwitch) lightSwitch?.let { when (it.number) { - 1 -> { //左转灯 + Chassis.LightSwitch.LIGHT_LEFT_VALUE -> { //左转灯 CallerVisualAngleManager.showTurning(true) - CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(4, 500) + showTurn(1) } - 2 -> { //右转灯 - CallerVisualAngleManager.showTurning(true) - CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(2, 500) - } - else -> { + Chassis.LightSwitch.LIGHT_RIGHT_VALUE -> { //右转灯 CallerVisualAngleManager.showTurning(false) - CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(3, 500) + showTurn(2) + + } + Chassis.LightSwitch.LIGHT_NONE_VALUE -> { + CallerVisualAngleManager.showTurning(false) + hideTurn() } } } } + private fun showTurn(lightNum: Int) { + if (!isVisualAngleChanged) { + isVisualAngleChanged = true + when (lightNum) { + 1 -> CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(4, 500) + 2 -> CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(2, 500) + } + } + } + + private fun hideTurn() { + if (isVisualAngleChanged) { + isVisualAngleChanged = false + CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(3, 500) + } + } + override fun onDestroy() { // 先取消注册数据,再onDestroy CallerSkinModeListenerManager.removeListener(TAG) diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisLamplightListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisLamplightListenerManager.kt index e5157806b7..08493422d9 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisLamplightListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisLamplightListenerManager.kt @@ -1,5 +1,6 @@ package com.mogo.eagle.core.function.call.autopilot +import android.util.Log import chassis.Chassis import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener import com.mogo.eagle.core.function.call.base.CallerBase @@ -17,24 +18,24 @@ object CallerChassisLamplightListenerManager : CallerBase= 10) { isOnTurnLight = false return turn_light - } else { - turnLightTimes++ - null } + turnLightTimes++ + return null } else { - null + return null } } else { turnLightTimes = 0 From 88ffcfdc71925fe5517b834fca24757f0b4ad24b Mon Sep 17 00:00:00 2001 From: donghongyu Date: Thu, 16 Feb 2023 18:45:04 +0800 Subject: [PATCH 3/9] =?UTF-8?q?[dev=5Farch=5Fopt=5F3.0]=20[Change]=20[=201?= =?UTF-8?q?=E3=80=81=E4=BC=98=E5=8C=96=E5=9C=A8=E5=89=AF=E5=B1=8F=E5=B9=95?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E8=B0=83=E7=94=A8=E4=B8=AA=20]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: donghongyu --- app/productFlavors/fMultiDisplayOchBus.gradle | 2 +- .../fMultiDisplayOchTaxi.gradle | 2 +- .../core/utilcode/util/MultiDisplayUtils.kt | 19 +++++++------------ 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/app/productFlavors/fMultiDisplayOchBus.gradle b/app/productFlavors/fMultiDisplayOchBus.gradle index 2e6173c679..49cf57f8f8 100644 --- a/app/productFlavors/fMultiDisplayOchBus.gradle +++ b/app/productFlavors/fMultiDisplayOchBus.gradle @@ -20,7 +20,7 @@ project.android.productFlavors { //高德地图鉴权信息 manifestPlaceholders = [ AMAP_API_VALUE : rootProject.ext.android.fLauncherAmapApiValue, - CHANNEL_VALUE : "fPadLenovoOchBus", + CHANNEL_VALUE : "fMultiDisplayOchBus", ACTIVITY_ROOT : true, SCREEN_ORIENTATION: "landscape" ] diff --git a/app/productFlavors/fMultiDisplayOchTaxi.gradle b/app/productFlavors/fMultiDisplayOchTaxi.gradle index fba1ab5e63..a04d284d67 100644 --- a/app/productFlavors/fMultiDisplayOchTaxi.gradle +++ b/app/productFlavors/fMultiDisplayOchTaxi.gradle @@ -23,7 +23,7 @@ project.android.productFlavors { // 高德地图鉴权信息 AMAP_API_VALUE : rootProject.ext.android.fLauncherAmapApiValue, // BUGLY_APP_CHANNEL - CHANNEL_VALUE : "fPadLenovoOchTaxi", + CHANNEL_VALUE : "fMultiDisplayOchTaxi", // 在启动的时候把Task给清空 ACTIVITY_ROOT : true, // Activity的朝向 diff --git a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/util/MultiDisplayUtils.kt b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/util/MultiDisplayUtils.kt index 67c6f0aa99..e14d16cc03 100644 --- a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/util/MultiDisplayUtils.kt +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/util/MultiDisplayUtils.kt @@ -7,7 +7,6 @@ import android.content.pm.PackageManager import android.hardware.display.DisplayManager import android.util.Log import android.view.Display -import androidx.appcompat.app.AppCompatActivity /** * 多屏幕操作工具类 @@ -51,6 +50,7 @@ object MultiDisplayUtils { for (j in lcd_sub_port_six_lcd_mode.indices) { // 这里增加port的匹配, 如果不需要对应的匹配 可看下面的other LCD if (strDisplayString.indexOf(lcd_sub_port_six_lcd_mode[j]) != -1) { // 查找我们实际屏幕的匹配port displaysList[j] = displays[i] + break } } } @@ -66,7 +66,9 @@ object MultiDisplayUtils { } - // 获取 是否支持扩展屏幕打开应用 + /** + * 获取 是否支持扩展屏幕打开应用 + */ fun isSupportMultiDisplay(context: Context): Boolean { // 先检查一下是不是支持在第二屏上显示activity这个特性, // 在ActivityOptions.java setLaunchDisplayId 上面有相关的说明 @@ -74,13 +76,6 @@ object MultiDisplayUtils { return packageManager.hasSystemFeature(PackageManager.FEATURE_ACTIVITIES_ON_SECONDARY_DISPLAYS) } - // 获取 当前接入的屏幕集合(含主屏幕) - fun getMultiDisplay(context: Context): Array { - // 多次创建副屏 则副屏的id都是增加的,所以不一定是1,这里还是获取一下 - val displayManager = - context.getSystemService(AppCompatActivity.DISPLAY_SERVICE) as DisplayManager - return displayManager.displays - } /** * 在指定ID的屏幕打开Activity,当前应用的,当前进程 @@ -90,8 +85,8 @@ object MultiDisplayUtils { fun startActWithSecond(context: Context, activity: Class<*>) { val launchDisplayId: Int if (isSupportMultiDisplay(context)) { - if (getMultiDisplay(context).size > 1) { - launchDisplayId = getMultiDisplay(context)[1].displayId + if (getOtherDisplay().size > 1 && getOtherDisplay()[0] != null) { + launchDisplayId = getOtherDisplay()[0]!!.displayId // 要加上Intent.FLAG_ACTIVITY_NEW_TASK val options = ActivityOptions.makeBasic() @@ -113,7 +108,7 @@ object MultiDisplayUtils { * @param launchDisplayId 指定屏幕ID * @param activity 要在副屏幕启动的页面 */ - fun startActWithProcess(context: Context, launchDisplayId: Int, activity: Class<*>) { + fun startActWithOther(context: Context, launchDisplayId: Int, activity: Class<*>) { // 要加上Intent.FLAG_ACTIVITY_NEW_TASK val options = ActivityOptions.makeBasic() options.launchDisplayId = launchDisplayId From dae8147f7745b69a351fc98c0b7a13a8dfeee3c0 Mon Sep 17 00:00:00 2001 From: renwj Date: Thu, 16 Feb 2023 19:09:57 +0800 Subject: [PATCH 4/9] =?UTF-8?q?[dev=5Farch=5Fopt=5F3.0]=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eagle/core/function/call/map/CallerVisualAngleManager.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerVisualAngleManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerVisualAngleManager.kt index 8a8d2dc4d8..75c5a5f04e 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerVisualAngleManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerVisualAngleManager.kt @@ -28,7 +28,7 @@ object CallerVisualAngleManager { fun showTurning(open: Boolean) { if (open) { if (!isVisualAngleChanged) { - isVisualAngleChanged + isVisualAngleChanged = true changeAngle(Turning(true)) } } else { From 2b6f280ae0622bd41b90cf1b631945279e8580d7 Mon Sep 17 00:00:00 2001 From: zhongchao Date: Thu, 16 Feb 2023 19:46:01 +0800 Subject: [PATCH 5/9] [2.13.2-arch-opt] fix bug of limit --- .../src/main/res/layout/bus_base_fragment.xml | 2 +- .../main/res/layout/och_noop_fragment_hmi.xml | 2 +- .../main/res/layout/taxi_base_fragment.xml | 2 +- .../hmi/ui/widget/LimitingVelocityView.kt | 21 +++++++++++-------- .../res/layout/view_limiting_speed_vr.xml | 3 +-- .../eagle/core/data/enums/DataSourceType.kt | 17 ++++++++++++++- 6 files changed, 32 insertions(+), 15 deletions(-) diff --git a/OCH/mogo-och-bus/src/main/res/layout/bus_base_fragment.xml b/OCH/mogo-och-bus/src/main/res/layout/bus_base_fragment.xml index 975b76ad84..582b0f7d84 100644 --- a/OCH/mogo-och-bus/src/main/res/layout/bus_base_fragment.xml +++ b/OCH/mogo-och-bus/src/main/res/layout/bus_base_fragment.xml @@ -94,7 +94,7 @@ 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 = "" + } } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_limiting_speed_vr.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_limiting_speed_vr.xml index 0bca4b164a..c7d079cfb7 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_limiting_speed_vr.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_limiting_speed_vr.xml @@ -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" diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/DataSourceType.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/DataSourceType.kt index 7cc8ddb8fa..bddc074309 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/DataSourceType.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/DataSourceType.kt @@ -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" + } + } + } } \ No newline at end of file From 23c7346fa2b270195b69d59b15180738cd7a9c37 Mon Sep 17 00:00:00 2001 From: zhongchao Date: Thu, 16 Feb 2023 19:52:45 +0800 Subject: [PATCH 6/9] [2.13.2-arch-opt] cherry pick 2.13.2-sop --- .../binding/BindingCarManager.kt | 2 ++ .../binding/BindingCarNetWorkManager.kt | 31 +++++++++++++------ 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarManager.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarManager.kt index 5facb2cac5..2e08b89f0a 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarManager.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarManager.kt @@ -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) diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarNetWorkManager.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarNetWorkManager.kt index 3a44ccd5e9..dca175382b 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarNetWorkManager.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarNetWorkManager.kt @@ -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" + } + } + } \ No newline at end of file From 0e000cf2d10d9e83ccdf92142c1e632de6cace13 Mon Sep 17 00:00:00 2001 From: zhongchao Date: Thu, 16 Feb 2023 21:02:10 +0800 Subject: [PATCH 7/9] [2.13.0-arch-opt]turn light bug fix and add toggle debug view trigger --- .../src/main/res/layout/bus_p_base_fragment.xml | 8 ++++++++ .../src/main/res/layout/bus_base_fragment.xml | 8 ++++++++ .../java/com/mogo/och/noop/OchNoopFragment.kt | 5 +---- .../main/res/layout/och_noop_fragment_hmi.xml | 16 ++++++++-------- .../src/main/res/layout/taxi_p_base_fragment.xml | 8 ++++++++ .../src/main/res/layout/taxi_base_fragment.xml | 8 ++++++++ .../hmi/ui/setting/ToggleDebugViewTrigger.kt | 16 ++++++++++++++++ .../hmi/ui/vehicle/TurnLightViewStatus.kt | 6 ++++-- 8 files changed, 61 insertions(+), 14 deletions(-) create mode 100644 core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/ToggleDebugViewTrigger.kt diff --git a/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_base_fragment.xml b/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_base_fragment.xml index 3e12a1ebb2..96b90db2b4 100644 --- a/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_base_fragment.xml +++ b/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_base_fragment.xml @@ -12,6 +12,14 @@ app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent"/> + + + + (), } override fun initViews() { - viewShowDebugView.setOnLongClickListener { - ToggleDebugView.toggleDebugView.toggle(requireContext()) - true - } + } diff --git a/OCH/mogo-och-noop/src/main/res/layout/och_noop_fragment_hmi.xml b/OCH/mogo-och-noop/src/main/res/layout/och_noop_fragment_hmi.xml index b5c29c1225..8cb712a588 100644 --- a/OCH/mogo-och-noop/src/main/res/layout/och_noop_fragment_hmi.xml +++ b/OCH/mogo-och-noop/src/main/res/layout/och_noop_fragment_hmi.xml @@ -6,19 +6,19 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - - + + + + + + Date: Thu, 16 Feb 2023 21:11:33 +0800 Subject: [PATCH 8/9] [2.13.0-arch-opt] fix bug of mapview angle --- .../main/java/com/mogo/eagle/core/function/view/MapBizView.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/MapBizView.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/MapBizView.kt index 01defbe2ab..ada377f31c 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/MapBizView.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/MapBizView.kt @@ -99,7 +99,7 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context, showTurn(1) } Chassis.LightSwitch.LIGHT_RIGHT_VALUE -> { //右转灯 - CallerVisualAngleManager.showTurning(false) + CallerVisualAngleManager.showTurning(true) showTurn(2) } From b4158cef3a57da35d279055ce119572a2278dcd2 Mon Sep 17 00:00:00 2001 From: donghongyu Date: Fri, 17 Feb 2023 10:12:18 +0800 Subject: [PATCH 9/9] =?UTF-8?q?[dev=5Farch=5Fopt=5F3.0]=20[Change]=20[=201?= =?UTF-8?q?=E3=80=81=E4=BF=AE=E6=94=B9=E4=BD=BF=E7=94=A8=E5=8D=95=E6=AC=A1?= =?UTF-8?q?=E5=AE=9A=E4=BD=8D=E7=9A=84=E8=B0=83=E7=94=A8=EF=BC=8C=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=20=20CallerChassisLocationWGS84ListenerManager.INSTAN?= =?UTF-8?q?CE.getChassisLocationWGS84().getLatitude()=20CallerChassisLocat?= =?UTF-8?q?ionWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getL?= =?UTF-8?q?ongitude()=20]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: donghongyu --- .../och/sweeper/model/SweeperOrderModel.java | 6 +-- .../ui/notice/traffic/NoticeTrafficDialog.kt | 7 ++-- .../hmi/ui/widget/AutoPilotStatusView.kt | 8 ++-- .../routeoverlay/RouteOverlayDrawer.java | 14 ++++--- .../scene/warning/V2XWarningMarker.java | 6 +-- .../function/v2x/events/utils/MapUtils.kt | 6 +-- ...llerChassisLocationWGS84ListenerManager.kt | 39 +++++++++---------- 7 files changed, 45 insertions(+), 41 deletions(-) diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/model/SweeperOrderModel.java b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/model/SweeperOrderModel.java index 38a5dd65e2..fc5b4c548e 100644 --- a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/model/SweeperOrderModel.java +++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/model/SweeperOrderModel.java @@ -23,8 +23,8 @@ import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener; import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager; -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager; +import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.mogo.logger.Logger; @@ -307,8 +307,8 @@ public class SweeperOrderModel { if (distance > SweeperConst.ARRIVE_AT_END_STATION_DISTANCE) { distance = CoordinateUtils.calculateLineDistance(startLon, startLat, - CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon(), - CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat()); + CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLongitude(), + CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLatitude()); } if (distance <= SweeperConst.ARRIVE_AT_END_STATION_DISTANCE) { diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/traffic/NoticeTrafficDialog.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/traffic/NoticeTrafficDialog.kt index 8f2add30d3..0b1490ef68 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/traffic/NoticeTrafficDialog.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/traffic/NoticeTrafficDialog.kt @@ -20,8 +20,7 @@ import com.mogo.eagle.core.data.notice.NoticeTrafficStyleInfo.NoticeTrafficAccou import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData import com.mogo.eagle.core.data.notice.NoticeValue import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.startAutoPilot -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.autopilot.CallerChassisLocationWGS84ListenerManager import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager.bizProvider import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog @@ -201,8 +200,8 @@ class NoticeTrafficDialog : BaseFloatDialog, LifecycleObserver { mTrafficStyleInfo!!.lat, mTrafficStyleInfo!!.lon ) parameters.startLatLon = AutoPilotLonLat( - getCurWgs84Lat(), - getCurWgs84Lon() + CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().latitude, + CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().longitude ) parameters.endLatLon = AutoPilotLonLat(gcj02[0], gcj02[1]) startAutoPilot(parameters) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/AutoPilotStatusView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/AutoPilotStatusView.kt index dd22839a09..8ec86f7842 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/AutoPilotStatusView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/AutoPilotStatusView.kt @@ -10,8 +10,7 @@ import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager 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.autopilot.CallerChassisLocationWGS84ListenerManager import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger @@ -80,7 +79,10 @@ class AutoPilotStatusView constructor( currentAutopilot.endName = "HYJC" currentAutopilot.isSpeakVoice = false currentAutopilot.startLatLon = - AutopilotControlParameters.AutoPilotLonLat(getCurWgs84Lat(), getCurWgs84Lon()) + AutopilotControlParameters.AutoPilotLonLat( + CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().latitude, + CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().longitude + ) currentAutopilot.endLatLon = AutopilotControlParameters.AutoPilotLonLat(26.819716071924688, 112.57715442110867) currentAutopilot.vehicleType = 10 diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/RouteOverlayDrawer.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/RouteOverlayDrawer.java index 9cf9145540..a218d36f2e 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/RouteOverlayDrawer.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/RouteOverlayDrawer.java @@ -5,16 +5,20 @@ import android.graphics.Color; import android.os.Handler; import android.os.HandlerThread; import android.util.Log; + import androidx.core.util.Pools; + import com.mogo.eagle.core.data.map.MogoLatLng; -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; +import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager; import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils; import com.mogo.map.MogoOverlayManager; import com.mogo.map.overlay.IMogoOverlayManager; import com.mogo.map.overlay.IMogoPolyline; import com.mogo.map.overlay.MogoPolylineOptions; + import java.util.LinkedList; import java.util.List; + import mogo.telematics.pad.MessagePad; public class RouteOverlayDrawer { @@ -128,8 +132,8 @@ public class RouteOverlayDrawer { pps.add(acquire); RouteStrategy.INSTANCE.check(route.getVelocity(), route.getAcceleration(), routeList.size()); } - double lon = CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon(); - double lat = CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat(); + double lon = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLongitude(); + double lat = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLatitude(); if (points.size() > 0) { MogoLatLng top = null; while (points.size() != 0) { @@ -140,8 +144,8 @@ public class RouteOverlayDrawer { if (first == top) { break; } - lon = CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon(); - lat = CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat(); + lon = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLongitude(); + lat = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLatitude(); long angle = isPointOnCarFront(lon, lat, bearing, first.lon, first.lat); if (angle >= 90) { RouteStrategy.INSTANCE.remove(first.acc); diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XWarningMarker.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XWarningMarker.java index 51af0affe0..b81750d42c 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XWarningMarker.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XWarningMarker.java @@ -11,7 +11,7 @@ import com.mogo.commons.utils.Trigonometric; import com.mogo.eagle.core.data.map.MogoLatLng; import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.data.v2x.DrawLineInfo; -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; +import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager; import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager; import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi; import com.mogo.eagle.core.function.v2x.events.manager.IMoGoPersonWarnPolylineManager; @@ -44,8 +44,8 @@ public class V2XWarningMarker implements IV2XMarker { private final List fillPoints = new ArrayList();//停止线经纬度合集 private boolean isFirstLocation = false; private MogoLatLng carLocation = new MogoLatLng( - CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat(), - CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon() + CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLatitude(), + CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLongitude() ); /* diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/MapUtils.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/MapUtils.kt index 09ec0fb754..c49b645366 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/MapUtils.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/MapUtils.kt @@ -3,7 +3,7 @@ package com.mogo.eagle.core.function.v2x.events.utils import android.content.Context import android.graphics.Rect import com.mogo.eagle.core.data.map.MogoLatLng -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager +import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager import com.mogo.eagle.core.utilcode.util.WindowUtils @@ -24,8 +24,8 @@ class MapUtils { mBoundRect.right = WindowUtils.dip2px(context, 100f) // 当前车辆位置 val carLocation = MogoLatLng( - CallerAutoPilotStatusListenerManager.getCurWgs84Lat(), - CallerAutoPilotStatusListenerManager.getCurWgs84Lon() + CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().latitude, + CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().longitude ) // 调整自适应的地图镜头 CallerMapUIServiceManager.getMapUIController() diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisLocationWGS84ListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisLocationWGS84ListenerManager.kt index 38a45f7fd9..a0212d23ee 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisLocationWGS84ListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisLocationWGS84ListenerManager.kt @@ -14,9 +14,9 @@ import com.mogo.eagle.core.utilcode.util.TimeUtils object CallerChassisLocationWGS84ListenerManager : CallerBase() { @Volatile - private var mGnssInfo: MogoLocation? = null + private var mGnssInfo: MogoLocation = MogoLocation() - fun getChassisLocationWGS84(): MogoLocation? { + fun getChassisLocationWGS84(): MogoLocation { return mGnssInfo } @@ -40,27 +40,26 @@ object CallerChassisLocationWGS84ListenerManager : CallerBase 0) { - val hzTime = (1.0 / hz.toDouble()) * 1000 - // 获取最后一次回调的时间 - val hzLastSendTime = M_LISTENERS_HZ_LAST_SEND_TIME[tag] - if (hzLastSendTime != null && hzLastSendTime > 0) { - // 计算是否进入下一次回调周期 - val nowTime = TimeUtils.getNowMills() - if (nowTime - hzLastSendTime > hzTime) { - syncLocationCallback(tag, it, mGnssInfo!!, sourceType) - } - } else { - syncLocationCallback(tag, it, mGnssInfo!!, sourceType) + + M_LISTENERS.forEach { + val tag = it.key + // 获取数据监听需要的HZ + val hz = M_LISTENERS_HZ[tag] + if (hz != null && hz > 0) { + val hzTime = (1.0 / hz.toDouble()) * 1000 + // 获取最后一次回调的时间 + val hzLastSendTime = M_LISTENERS_HZ_LAST_SEND_TIME[tag] + if (hzLastSendTime != null && hzLastSendTime > 0) { + // 计算是否进入下一次回调周期 + val nowTime = TimeUtils.getNowMills() + if (nowTime - hzLastSendTime > hzTime) { + syncLocationCallback(tag, it, mGnssInfo, sourceType) } } else { - syncLocationCallback(tag, it, mGnssInfo!!, sourceType) + syncLocationCallback(tag, it, mGnssInfo, sourceType) } + } else { + syncLocationCallback(tag, it, mGnssInfo, sourceType) } } }