From 49f407059464152a4544ff5eeb0dae6d7f3c5ce0 Mon Sep 17 00:00:00 2001 From: xuxinchao Date: Thu, 4 Jul 2024 11:57:22 +0800 Subject: [PATCH 1/4] =?UTF-8?q?[6.5.0]=E8=87=AA=E5=8A=A8=E6=8E=A2=E6=9F=A5?= =?UTF-8?q?UI=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exploration/AutomaticExplorationView.kt | 43 +++++++++++++------ .../main/res/layout/item_auto_exploration.xml | 8 ++-- .../res/layout/item_auto_exploration_p.xml | 14 +++--- .../res/layout/view_automatic_exploration.xml | 12 +++--- .../layout/view_automatic_exploration_p.xml | 6 +-- 5 files changed, 51 insertions(+), 32 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/exploration/AutomaticExplorationView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/exploration/AutomaticExplorationView.kt index bba7a7f340..5bfebc913f 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/exploration/AutomaticExplorationView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/exploration/AutomaticExplorationView.kt @@ -11,9 +11,11 @@ import android.widget.ImageView import androidx.constraintlayout.widget.ConstraintLayout import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import com.mogo.commons.voice.AIAssist import com.mogo.eagle.core.data.autopilot.AutopilotSummaryInfo import com.mogo.eagle.core.data.notice.AutoExplorationEntity import com.mogo.eagle.core.function.hmi.R +import com.mogo.eagle.core.utilcode.util.ThreadUtils /** @@ -31,9 +33,11 @@ class AutomaticExplorationView @JvmOverloads constructor( private var ivScan: ImageView ?= null //扫描视图 private var rvExplorationList: RecyclerView ?= null private var automaticExplorationAdapter: AutomaticExplorationAdapter ?= null + private var rotationAnim: ObjectAnimator ?= null companion object { private const val TAG = "AutomaticExplorationView" + private const val EXPLORATION_SHOW_TIME = 10000L //自动探查弹窗展示时间 } init { @@ -53,21 +57,35 @@ class AutomaticExplorationView @JvmOverloads constructor( initData() } + fun showAutoExploration(){ + //倒计时 + + //语音播放 + AIAssist.getInstance(context).speakTTSVoice("道路畅通一切正常蘑菇行车助手将持续守候您的出行") + + //隐藏自动探查视图 + ThreadUtils.runOnUiThread { + this@AutomaticExplorationView.visibility = View.GONE + } + + } + private fun initEvent(){ ivClose = findViewById(R.id.ivClose) ivScan = findViewById(R.id.ivScan) //隐藏自动探索视图 ivClose?.setOnClickListener { + rotationAnim?.cancel() this.visibility = View.GONE } //启动扫描 ivScan?.let { - val rotationAnim = ObjectAnimator.ofFloat(it, "rotation", 0f, 360f) - rotationAnim.repeatCount = ValueAnimator.INFINITE - rotationAnim.repeatMode = ValueAnimator.RESTART - rotationAnim.duration = 2000 - rotationAnim.interpolator = LinearInterpolator() - rotationAnim.start() + rotationAnim = ObjectAnimator.ofFloat(it, "rotation", 0f, 360f) + rotationAnim?.repeatCount = ValueAnimator.INFINITE + rotationAnim?.repeatMode = ValueAnimator.RESTART + rotationAnim?.duration = 2000 + rotationAnim?.interpolator = LinearInterpolator() + rotationAnim?.start() } rvExplorationList = findViewById(R.id.rvExplorationList) val linearLayoutManager = LinearLayoutManager(context) @@ -79,13 +97,13 @@ class AutomaticExplorationView @JvmOverloads constructor( private fun initData() { val dataList = ArrayList() - dataList.add(AutoExplorationEntity("当前道路事件分析",5000L)) - dataList.add(AutoExplorationEntity("前方车辆",6000L)) - dataList.add(AutoExplorationEntity("两侧车辆",7000L)) + dataList.add(AutoExplorationEntity("当前道路事件分析",2000L)) + dataList.add(AutoExplorationEntity("前方车辆",2000L)) + dataList.add(AutoExplorationEntity("两侧车辆",3000L)) dataList.add(AutoExplorationEntity("后方车辆",3000L)) - dataList.add(AutoExplorationEntity("前方路口车辆流速分析",5000L)) - dataList.add(AutoExplorationEntity("前方路口行人/非机动车分析",6000L)) - dataList.add(AutoExplorationEntity("路侧视频分析",8000L)) + dataList.add(AutoExplorationEntity("前方路口车辆流速分析",4000L)) + dataList.add(AutoExplorationEntity("前方路口行人/非机动车分析",4000L)) + dataList.add(AutoExplorationEntity("路侧视频分析",5000L)) automaticExplorationAdapter?.setData(dataList) //每出现一次自动探查,增加相应的服务次数 @@ -103,7 +121,6 @@ class AutomaticExplorationView @JvmOverloads constructor( override fun onDetachedFromWindow() { super.onDetachedFromWindow() - } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_auto_exploration.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_auto_exploration.xml index 391a77d460..0b719337af 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_auto_exploration.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_auto_exploration.xml @@ -9,8 +9,8 @@ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_auto_exploration_p.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_auto_exploration_p.xml index 1220778189..f375ec5539 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_auto_exploration_p.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_auto_exploration_p.xml @@ -1,15 +1,17 @@ + android:layout_marginTop="@dimen/dp_12" + android:layout_marginBottom="@dimen/dp_12" + tools:ignore="UseCompoundDrawables"> diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_automatic_exploration.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_automatic_exploration.xml index 0cccd76263..223c663fc4 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_automatic_exploration.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_automatic_exploration.xml @@ -31,13 +31,13 @@ android:id="@+id/tvExplorationTitle" android:layout_width="wrap_content" android:layout_height="wrap_content" - app:layout_constraintTop_toTopOf="@id/ivScan" - app:layout_constraintBottom_toBottomOf="@id/ivScan" - app:layout_constraintStart_toEndOf="@id/ivScan" - android:textSize="@dimen/sp_32" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintLeft_toLeftOf="parent" + android:layout_marginTop="@dimen/dp_31" + android:layout_marginLeft="@dimen/dp_146" + android:textSize="@dimen/sp_30" android:textColor="@color/white" android:text="@string/exploration_title" - android:layout_marginStart="@dimen/dp_30" /> \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_automatic_exploration_p.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_automatic_exploration_p.xml index 8ea703c520..bf85992a84 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_automatic_exploration_p.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_automatic_exploration_p.xml @@ -1,7 +1,7 @@ @@ -36,7 +36,7 @@ android:textSize="@dimen/sp_32" android:textColor="@color/color_131415" android:text="@string/exploration_title" - android:layout_marginStart="@dimen/dp_30" + android:layout_marginStart="@dimen/dp_23" /> \ No newline at end of file From 93316b743a8d340bddb497f6ed76c8bfb50a10bb Mon Sep 17 00:00:00 2001 From: yangyakun Date: Thu, 4 Jul 2024 12:00:33 +0800 Subject: [PATCH 2/4] =?UTF-8?q?[6.5.0]=20[fea]=20[=E5=8F=B8=E6=9C=BA?= =?UTF-8?q?=E5=B1=8F=E8=A7=86=E8=A7=92=E5=88=87=E6=8D=A2=E3=80=81Itinerary?= =?UTF-8?q?SummaryDialog=E8=A1=8C=E7=A8=8B=E5=B1=95=E7=A4=BA]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wigets/map/switchvisual/SeekBarView.kt | 27 +++--- .../wigets/map/switchvisual/VisualView.kt | 82 ------------------- .../map/switchvisual/VisualViewModel.kt | 27 ------ .../taxi/passenger/ui/arrived/ArrivedView.kt | 5 ++ 4 files changed, 20 insertions(+), 121 deletions(-) delete mode 100644 OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/map/switchvisual/VisualView.kt diff --git a/OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/map/switchvisual/SeekBarView.kt b/OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/map/switchvisual/SeekBarView.kt index c27788d5d5..eb947263f0 100644 --- a/OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/map/switchvisual/SeekBarView.kt +++ b/OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/map/switchvisual/SeekBarView.kt @@ -18,6 +18,7 @@ import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.findViewTreeViewModelStoreOwner import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.util.UiThreadHandler import com.mogo.och.common.module.R import kotlinx.android.synthetic.main.taxi_p_seekbar_visualangle.view.iv_visualangle_bg @@ -40,6 +41,8 @@ class SeekBarView : ConstraintLayout, VisualViewModel.IVisualCallback { ) } + private val TAG = "SeekBarView" + constructor(context: Context) : super(context) constructor(context: Context, attributeSet: AttributeSet) : super(context, attributeSet) @@ -103,9 +106,9 @@ class SeekBarView : ConstraintLayout, VisualViewModel.IVisualCallback { } MotionEvent.ACTION_UP -> { if(draggableButton.translationY<0){ - translationByValue(VisualViewModel.Visualangle.Middle) - }else if (draggableButton.translationY>(height-draggableButton.height)){ translationByValue(VisualViewModel.Visualangle.Long) + }else if (draggableButton.translationY>(height-draggableButton.height)){ + translationByValue(VisualViewModel.Visualangle.Middle) }else{ val marginTop = draggableButton.translationY val split = (height - draggableButton.height) / 2 @@ -119,9 +122,9 @@ class SeekBarView : ConstraintLayout, VisualViewModel.IVisualCallback { // } if(marginTop>0&&marginTopsplit&&marginTop<(height - draggableButton.height)){ translationByValue(VisualViewModel.Visualangle.Long) + }else if(marginTop>split&&marginTop<(height - draggableButton.height)){ + translationByValue(VisualViewModel.Visualangle.Middle) } } @@ -132,6 +135,7 @@ class SeekBarView : ConstraintLayout, VisualViewModel.IVisualCallback { } private var value: VisualViewModel.Visualangle by Delegates.observable(VisualViewModel.Visualangle.None) { _, oldValue, newValue -> + CallerLogger.d(TAG,"oldValue:${oldValue}____newValue:${newValue}") if (oldValue != newValue) { viewModel?.changeVisualView(newValue) if(newValue==VisualViewModel.Visualangle.UnChange){ @@ -148,25 +152,24 @@ class SeekBarView : ConstraintLayout, VisualViewModel.IVisualCallback { value = visualangle when (visualangle) { VisualViewModel.Visualangle.Middle -> { - ObjectAnimator.ofFloat(draggableButton, "translationY", draggableButton.translationY, 0f).apply { + ObjectAnimator.ofFloat( + draggableButton, "translationY", draggableButton.translationY, + (height - draggableButton.height).toFloat() + ).apply { duration = 100 }.start() } VisualViewModel.Visualangle.Long -> { ObjectAnimator.ofFloat( - draggableButton, - "translationY", - draggableButton.translationY, - (height - draggableButton.height).toFloat() + draggableButton, "translationY", draggableButton.translationY, + 0f ).apply { duration = 100 }.start() } VisualViewModel.Visualangle.UnChange -> { ObjectAnimator.ofFloat( - draggableButton, - "translationY", - draggableButton.translationY, + draggableButton, "translationY", draggableButton.translationY, (height - draggableButton.height) / 2f ).apply { duration = 100 diff --git a/OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/map/switchvisual/VisualView.kt b/OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/map/switchvisual/VisualView.kt deleted file mode 100644 index 5b66ef0c7e..0000000000 --- a/OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/map/switchvisual/VisualView.kt +++ /dev/null @@ -1,82 +0,0 @@ -package com.mogo.och.common.module.wigets.map.switchvisual -import android.content.Context -import android.util.AttributeSet -import android.view.View -import androidx.appcompat.widget.AppCompatImageView -import androidx.lifecycle.ViewModelProvider -import androidx.lifecycle.findViewTreeViewModelStoreOwner -import com.mogo.eagle.core.utilcode.kotlin.onClick -import com.mogo.eagle.core.utilcode.util.UiThreadHandler -import com.mogo.och.common.module.R -/** - * - */ -class VisualView : AppCompatImageView, VisualViewModel.IVisualCallback { - - private val TAG = "VisualView" - - constructor(context: Context) : super(context) - - constructor(context: Context, attributeSet: AttributeSet) : super(context, attributeSet) - - constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int) : super( - context, - attributeSet, - defStyleAttr - ) - - private fun initView() { - setImageResource(R.drawable.common_visual_medium) - } - - override fun onAttachedToWindow() { - super.onAttachedToWindow() - - val viewModel = findViewTreeViewModelStoreOwner()?.let { - ViewModelProvider(it).get(VisualViewModel::class.java) - } - - viewModel?.setDistanceCallback(this) - - onClick { - viewModel?.changeVisualView() - } - } - - - init { - try { - initView() - } catch (e: Exception) { - e.printStackTrace() - } - } - - override fun setViewShow(boolean: Boolean) { - UiThreadHandler.post({ - if (boolean) { - visibility = View.VISIBLE - } else { - visibility = View.GONE - } - }, UiThreadHandler.MODE.QUEUE) - } - - override fun setMiddleAngle() { - UiThreadHandler.post({ - setImageResource(R.drawable.common_visual_medium) - }, UiThreadHandler.MODE.QUEUE) - } - - override fun setLongAngle() { - UiThreadHandler.post({ - setImageResource(R.drawable.common_visual_long) - }, UiThreadHandler.MODE.QUEUE) - } - - override fun setUnableChange() { - - } - - -} \ No newline at end of file diff --git a/OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/map/switchvisual/VisualViewModel.kt b/OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/map/switchvisual/VisualViewModel.kt index 6b1f8631e4..ab8165ed34 100644 --- a/OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/map/switchvisual/VisualViewModel.kt +++ b/OCH/common/common/src/main/java/com/mogo/och/common/module/wigets/map/switchvisual/VisualViewModel.kt @@ -72,33 +72,6 @@ class VisualViewModel : ViewModel(), } } - fun changeVisualView() { - CallerVisualAngleManager.getCurrentScene().let { - val default = Default(0) - - when (it.angle) { - VisualAngleMode.MODE_MEDIUM_SIGHT -> { - if(default.angle==VisualAngleMode.MODE_MEDIUM_SIGHT){ - CallerVisualAngleManager.changeScene(LongSight(0)) - } - } - - VisualAngleMode.MODE_LONG_SIGHT -> { - CallerVisualAngleManager.changeScene(Default(0)) - } - VisualAngleMode.MAP_STYLE_VR_SKY_BOX -> { - if(default.angle==VisualAngleMode.MAP_STYLE_VR_SKY_BOX){ - CallerVisualAngleManager.changeScene(LongSight(0)) - } - } - - else -> { - - } - } - } - } - fun changeVisualView(angle: Visualangle) { when (angle) { diff --git a/OCH/taxi/pcommon/src/main/java/com/mogo/och/taxi/passenger/ui/arrived/ArrivedView.kt b/OCH/taxi/pcommon/src/main/java/com/mogo/och/taxi/passenger/ui/arrived/ArrivedView.kt index 28eccc0732..341310e459 100644 --- a/OCH/taxi/pcommon/src/main/java/com/mogo/och/taxi/passenger/ui/arrived/ArrivedView.kt +++ b/OCH/taxi/pcommon/src/main/java/com/mogo/och/taxi/passenger/ui/arrived/ArrivedView.kt @@ -9,6 +9,7 @@ import android.util.AttributeSet import android.view.LayoutInflater import android.view.View import androidx.lifecycle.ViewModelProvider +import com.mogo.eagle.core.function.hmi.ui.widget.ItinerarySummaryDialog import com.mogo.eagle.core.utilcode.kotlin.onClick import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant @@ -48,6 +49,8 @@ class ArrivedView : WindowRelativeLayout, ArrivedViewModel.ArrivedViewCallback { private lateinit var viewModel: ArrivedViewModel + val dialog = ItinerarySummaryDialog(context,false,R.style.summary_dialog_p) + private fun initView() { d(SceneConstant.M_TAXI_P + TAG, "initView") @@ -71,6 +74,7 @@ class ArrivedView : WindowRelativeLayout, ArrivedViewModel.ArrivedViewCallback { aniSpeedSettingRow() viewModel.setEndInfo() ZhiViewmanager.showListeningAni(ZhiViewmanager.loveAni) + dialog.show() } else { v_video_right_rear_view.resetView() taxiPxiaozhiLove?.stop() @@ -78,6 +82,7 @@ class ArrivedView : WindowRelativeLayout, ArrivedViewModel.ArrivedViewCallback { taxiPxiaozhiLove = null RxUtils.disposeSubscribe(subscribe) ZhiViewmanager.showListeningAni(ZhiViewmanager.normalAni) + dialog.dismiss() } arrivedVisilityChangeListenr?.isShow(isVisible) } From 84ed4aae6d309a98ba75dc55d2b7b19020ab3f41 Mon Sep 17 00:00:00 2001 From: renwj Date: Thu, 4 Jul 2024 10:02:08 +0800 Subject: [PATCH 3/4] =?UTF-8?q?[6.5.0][Marker]=20Marker=E6=B8=85=E9=99=A4?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E6=B7=BB=E5=8A=A0=E8=B5=B0=E8=BF=87=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E7=82=B9=E4=B9=8B=E5=90=8E=E8=B7=9F=E7=A6=BB=E5=92=8C?= =?UTF-8?q?=E6=97=B6=E9=95=BF=E7=9A=84=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mogo/functions/test/GreenWaveTest.kt | 77 +++++++++++++++++ .../biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt | 6 +- .../biz/v2x/v2n/remove/MarkerRemoveManager.kt | 84 +++++++++++-------- .../v2n/scenario/scene/airoad/AiRoadMarker.kt | 36 ++++++-- .../scene/road/V2XRoadEventMarker.java | 5 +- .../core/function/hmi/ui/MoGoHmiProvider.kt | 37 ++++---- .../java/com/mogo/map/overlay/core/Level.kt | 4 - 7 files changed, 182 insertions(+), 67 deletions(-) create mode 100644 app/src/androidTest/java/com/mogo/functions/test/GreenWaveTest.kt diff --git a/app/src/androidTest/java/com/mogo/functions/test/GreenWaveTest.kt b/app/src/androidTest/java/com/mogo/functions/test/GreenWaveTest.kt new file mode 100644 index 0000000000..eb507f54c1 --- /dev/null +++ b/app/src/androidTest/java/com/mogo/functions/test/GreenWaveTest.kt @@ -0,0 +1,77 @@ +package com.mogo.functions.test + +import android.text.TextUtils +import android.util.Log +import androidx.test.core.app.ActivityScenario +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.filters.LargeTest +import androidx.test.platform.app.InstrumentationRegistry +import com.mogo.eagle.core.data.config.FunctionBuildConfig +import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager +import com.mogo.eagle.core.function.call.autopilot.CallerV2nNioEventListenerManager +import com.mogo.eagle.core.function.main.MainLauncherActivity +import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils +import com.mogo.map.MapDataWrapper +import kotlinx.coroutines.delay +import kotlinx.coroutines.runBlocking +import mogo.telematics.pad.MessagePad.V2nCrossSpeed +import org.junit.Before +import org.junit.Test +import org.junit.runner.RunWith +import java.util.concurrent.TimeUnit + + +@RunWith(AndroidJUnit4::class) +@LargeTest +class GreenWaveTest { + + companion object { + private const val TAG = "RoadInfoTest" + } + + lateinit var launch: ActivityScenario + + @Before + fun before() { + launch = ActivityScenario.launch(MainLauncherActivity::class.java) + } + + + @Test + fun testGreenWave(): Unit = runBlocking { + val arguments = InstrumentationRegistry.getArguments() + val millis = arguments.getString("delay", "0").toLong() + if (millis > 0) { + delay(millis) + } + var location = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() + val distance = arguments.getString("distance", "0").toDouble() + var newPoint = DrivingDirectionUtils.calculateNewPoint(location.longitude, location.latitude, location.heading, distance) + var crossInfo = MapDataWrapper.getCrossRoad(newPoint.first, newPoint.second, location.heading) + while (crossInfo == null || TextUtils.isEmpty(crossInfo.cross_id) || TextUtils.isEmpty(crossInfo.cross_id_end)) { + Log.d(TAG, "获取到的路口数据无效, 5秒后重试") + delay(TimeUnit.SECONDS.toMillis(5)) + Log.d(TAG, "5秒时间到,开始计算新的路口数据") + location = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() + newPoint = DrivingDirectionUtils.calculateNewPoint(location.longitude, location.latitude, location.heading, distance) + crossInfo = MapDataWrapper.getCrossRoad(newPoint.first, newPoint.second, location.heading) + } + Log.d(TAG, "获取到路口数据...") + FunctionBuildConfig.isNewV2NData = true + FunctionBuildConfig.v2nMainSwitch = true + CallerV2nNioEventListenerManager.invokeV2nNioGreenWavePassageEvent( + V2nCrossSpeed.getDefaultInstance().toBuilder() + .setSpeedLeftMin(0) + .setSpeedLeftMax(0) + .setSpeedRightMin(0) + .setSpeedRightMax(0) + .setSpeedStraightMin(30) + .setSpeedStraightMax(54) + .setMaxSpeed(0) + .setMaxStatus(0) + .setLng(newPoint.first) + .setLat(newPoint.second) + .build()) + delay(TimeUnit.MINUTES.toMillis(10)) + } +} diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt index 2109243055..1aef69d8b8 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt @@ -462,7 +462,8 @@ internal object V2NIdentifyDrawer: IEventDismissListener { } private fun computeCrossCountBetween(start: kotlin.Triple, end: kotlin.Pair): Int { - val points = V2NUtils.generateIntermediatePoints(kotlin.Pair(start.first, start.second), end, 10.0 * 1e-7) + val points = V2NUtils.generateIntermediatePoints(kotlin.Pair(start.first, start.second), end, 50.0 * 1e-7) + V2XBizTrace.onAck(points, "computeCrossCountBetween", true) var crossId = MapDataWrapper.getCrossRoad(start.first, start.second, start.third)?.cross_id_end val angle = start.third var count = 1 @@ -494,7 +495,8 @@ internal object V2NIdentifyDrawer: IEventDismissListener { } private fun isDrawRoadLine(poiType: String): Boolean { - return EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.poiType == poiType +// return EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.poiType == poiType + return false } private fun getPoiType(type: Int): EventTypeEnumNew = diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/remove/MarkerRemoveManager.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/remove/MarkerRemoveManager.kt index e1dca1a41e..264baec395 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/remove/MarkerRemoveManager.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/remove/MarkerRemoveManager.kt @@ -18,7 +18,7 @@ import java.util.concurrent.atomic.AtomicBoolean import java.util.concurrent.atomic.AtomicReference -data class MarkerWrapper(val id: String, val lon: Double, val lat: Double, val coordinateType: Int, var markers: ArrayList? = null, var lines: ArrayList? = null, var onRemoved:((id: String) -> Unit)? = null) { +data class MarkerWrapper(val id: String, val lon: Double, val lat: Double, val coordinateType: Int, var markers: ArrayList? = null, var lines: ArrayList? = null, var elapsedDistance: Int = 500, var elapsedDuration: Long = -1, var onRemoved:((id: String) -> Unit)? = null) { fun addLine(line: Polyline) { var ll = this.lines @@ -41,12 +41,8 @@ data class MarkerWrapper(val id: String, val lon: Double, val lat: Double, val c override fun equals(other: Any?): Boolean { if (this === other) return true if (javaClass != other?.javaClass) return false - other as MarkerWrapper - - if (id != other.id) return false - - return true + return id == other.id } override fun hashCode(): Int { @@ -108,35 +104,10 @@ object MarkerRemoveManager { elapsed += delta } Log.d(TAG, "--- checkTask --- 5 ---:delta:$delta, elapsed:${elapsed}, id: ${marker.id}") - if (elapsed >= 500) { - var removeMarkerError = false - marker.markers?.forEach { - try { - Log.e(TAG, "--- checkTask --- remove marker: $it, id: ${marker.id}") - CallerMapUIServiceManager.getOverlayManager()?.removePoint(it.id) - } catch (t: Throwable) { - t.printStackTrace() - removeMarkerError = true - Log.e(TAG, "--- checkTask --- remove marker error:${t.message}, id: ${marker.id}") - } - } - var removeLineError = false - marker.lines?.forEach { - try { - CallerMapUIServiceManager.getOverlayManager()?.removeLine(it) - Log.e(TAG, "--- checkTask --- remove line : $it, id:${marker.id}") - } catch (t: Throwable) { - t.printStackTrace() - removeLineError = true - Log.e(TAG, "--- checkTask --- remove line error:${t.message}, id: ${marker.id}") - } - } - if (!removeLineError && !removeMarkerError) { + if (elapsed >= marker.elapsedDistance) { + val result = removeMarker(marker) + if (result) { toRemove.remove() - synchronized(elapsedDistances) { - elapsedDistances.remove(marker) - marker.onRemoved?.invoke(marker.id) - } } } else { elapsedDistances[marker] = elapsed @@ -162,6 +133,18 @@ object MarkerRemoveManager { iterator.remove() synchronized(toRemoveMakers) { toRemoveMakers.offer(marker) + val elapsedDuration = marker.elapsedDuration + if (elapsedDuration > 0) { + handler.postDelayed(Runnable { + try { + while (removeMarker(marker)) { + toRemoveMakers.remove(marker) + } + } catch (t: Throwable) { + t.printStackTrace() + } + }, elapsedDuration) + } } } } @@ -178,6 +161,39 @@ object MarkerRemoveManager { } } + private fun removeMarker(marker: MarkerWrapper): Boolean { + var removeMarkerError = false + marker.markers?.forEach { + try { + Log.e(TAG, "--- checkTask --- remove marker: $it, id: ${marker.id}") + CallerMapUIServiceManager.getOverlayManager()?.removePoint(it.id) + } catch (t: Throwable) { + t.printStackTrace() + removeMarkerError = true + Log.e(TAG, "--- checkTask --- remove marker error:${t.message}, id: ${marker.id}") + } + } + var removeLineError = false + marker.lines?.forEach { + try { + CallerMapUIServiceManager.getOverlayManager()?.removeLine(it) + Log.e(TAG, "--- checkTask --- remove line : $it, id:${marker.id}") + } catch (t: Throwable) { + t.printStackTrace() + removeLineError = true + Log.e(TAG, "--- checkTask --- remove line error:${t.message}, id: ${marker.id}") + } + } + if (!removeLineError && !removeMarkerError) { + synchronized(elapsedDistances) { + elapsedDistances.remove(marker) + marker.onRemoved?.invoke(marker.id) + } + return true + } + return false + } + private val handler by lazy { val thread = HandlerThread("check_marker_expired") thread.start() diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/airoad/AiRoadMarker.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/airoad/AiRoadMarker.kt index 209ac77d44..46eca765cc 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/airoad/AiRoadMarker.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/airoad/AiRoadMarker.kt @@ -7,6 +7,7 @@ import android.os.HandlerThread import android.os.Looper import android.view.animation.DecelerateInterpolator import androidx.core.util.Pair +import com.mogo.eagle.core.data.enums.EventTypeEnumNew import com.mogo.eagle.core.data.map.MogoLatLng import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager @@ -25,6 +26,7 @@ import com.mogo.map.overlay.line.Polyline import com.zhidaoauto.map.data.road.CenterLine import java.util.* import java.util.concurrent.ConcurrentHashMap +import java.util.concurrent.TimeUnit import java.util.concurrent.atomic.AtomicInteger import java.util.concurrent.atomic.AtomicReference @@ -86,12 +88,20 @@ class AiRoadMarker { v2nDrawHandler.post { val location = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() this.marker.set(marker) - val wrapper = MarkerWrapper(marker.id, marker.poi_lon, marker.poi_lat, 1, null, null) + var elapsedDistance = 500 + if (marker.poiType == EventTypeEnumNew.TYPE_SOCKET_ROAD_GREE_WAVE.poiType) { + elapsedDistance = 10 + } + var elapsedDuration = -1L + if (marker.poiType == EventTypeEnumNew.TYPE_SOCKET_ROAD_GREE_WAVE.poiType) { + elapsedDuration = TimeUnit.SECONDS.toMillis(3) + } + val wrapper = MarkerWrapper(marker.id, marker.poi_lon, marker.poi_lat, 1, elapsedDistance = elapsedDistance, elapsedDuration = elapsedDuration) if (drawMarker) { marker.entity?.apply { roadMarker.drawMarkers(this, wrapper) } } if (drawRoadLine) { -/* //施工中心点前方的自车行驶方向上300米距离 + //施工中心点前方的自车行驶方向上300米距离 var l1: CenterLine? = null var l2: CenterLine? = null mogoMapData.get()?.getCenterLineRangeInfo( @@ -118,13 +128,23 @@ class AiRoadMarker { } countDown.incrementAndGet() realMark(marker, wrapper, l1, l2, location.heading) - })*/ - } else { - wrapper.onRemoved = { id -> - aiMakers.remove(id) - } - MarkerRemoveManager.addMarker(wrapper) + }) } + + if (marker.poiType == EventTypeEnumNew.TYPE_SOCKET_ROAD_GREE_WAVE.poiType) { + val builder = Polyline.Options.Builder(V2XConst.V2X_MARKER_OWNER, ROAD_CENTER_LINE) + builder.colors(listOf(Color.parseColor("#996DFED0"), Color.parseColor("#CC6DFED0"), Color.parseColor("#C76DFED0"), Color.parseColor("#006DFED0"))) + .setWidth(5f) + .setUseGps(true) + .points(listOf(MogoLatLng(location.latitude, location.longitude), MogoLatLng(marker.poi_lat, marker.poi_lon))) + .setIsGradient(true) + .isShowArrow(true) + CallerMapUIServiceManager.getOverlayManager()?.showOrUpdateLine(builder.build())?.also { wrapper.addLine(it) } + } + wrapper.onRemoved = { id -> + aiMakers.remove(id) + } + MarkerRemoveManager.addMarker(wrapper) } } diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/road/V2XRoadEventMarker.java b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/road/V2XRoadEventMarker.java index cc7636b7c1..5f85dad000 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/road/V2XRoadEventMarker.java +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/road/V2XRoadEventMarker.java @@ -69,7 +69,7 @@ public class V2XRoadEventMarker implements IV2XMarker { ArrayList markers = new ArrayList<>(); markers.add(point); String id = entity.getLocation().getLon() + "_" + entity.getLocation().getLat(); - MarkerRemoveManager.INSTANCE.addMarker(new MarkerWrapper(id, entity.getLocation().getLon(), entity.getLocation().getLat(), 0, markers, null, null)); + MarkerRemoveManager.INSTANCE.addMarker(new MarkerWrapper(id, entity.getLocation().getLon(), entity.getLocation().getLat(), 0, markers, null, 500, -1L, null)); } else { CallerLogger.d(M_V2X + "RWJ", "V2XRoadEventMarker:" + entity.getPoiType() + "--- return empty marker"); } @@ -89,6 +89,7 @@ public class V2XRoadEventMarker implements IV2XMarker { } private boolean isDrawRoadLine(String poiType) { - return EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType().equals(poiType); +// return EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType().equals(poiType); + return false; } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiProvider.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiProvider.kt index 6a9985c591..523f54857f 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiProvider.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiProvider.kt @@ -47,6 +47,7 @@ import com.mogo.eagle.core.function.hmi.ui.utils.HmiActionLog import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView import com.mogo.eagle.core.function.hmi.xiaozhi.XiaoZhiStateManager import com.mogo.eagle.core.utilcode.floating.MoGoPopWindow +import com.mogo.eagle.core.utilcode.kotlin.lifeCycleScope import com.mogo.eagle.core.utilcode.kotlin.safeCancel import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger @@ -410,23 +411,25 @@ class MoGoHmiProvider : IMoGoHmiProvider { override fun showGreenWave(min: Int, max: Int, cross: Int) { val activity = AppStateManager.currentActivity() ?: return - greenWave.get()?.hide() - val content = GreenWaveView(activity) - MoGoPopWindow.Builder() - .contentView(content) - .width(WindowManager.LayoutParams.WRAP_CONTENT) - .height(WindowManager.LayoutParams.WRAP_CONTENT) - .attachToActivity(activity) - .gravityInActivity(Gravity.END) - .onDismissed { - greenWave.set(null) - } - .onShowed { - content.bind(min, max, cross) - } - .build().also { - greenWave.set(it) - }.show() + activity.lifeCycleScope.launch { + greenWave.get()?.hide() + val content = GreenWaveView(activity) + MoGoPopWindow.Builder() + .contentView(content) + .width(WindowManager.LayoutParams.WRAP_CONTENT) + .height(WindowManager.LayoutParams.WRAP_CONTENT) + .attachToActivity(activity) + .gravityInActivity(Gravity.CENTER) + .onDismissed { + greenWave.set(null) + } + .onShowed { + content.bind(min, max, cross) + } + .build().also { + greenWave.set(it) + }.show() + } } override fun dismissGreenWave() { diff --git a/libraries/mogo-map-api/src/main/java/com/mogo/map/overlay/core/Level.kt b/libraries/mogo-map-api/src/main/java/com/mogo/map/overlay/core/Level.kt index be57ac4b27..4b4704903f 100644 --- a/libraries/mogo-map-api/src/main/java/com/mogo/map/overlay/core/Level.kt +++ b/libraries/mogo-map-api/src/main/java/com/mogo/map/overlay/core/Level.kt @@ -25,8 +25,4 @@ enum class Level(val zIndex: Int) { */ MAP_POLYGON(76000), - /** - * 围栏区域底色 - */ - MAP_POLYGON_SOLID(75500) } \ No newline at end of file From 4af41328388e8fe1f8469dba76be122e95cb5052 Mon Sep 17 00:00:00 2001 From: renwj Date: Thu, 4 Jul 2024 12:15:34 +0800 Subject: [PATCH 4/4] =?UTF-8?q?[6.5.0][=E8=A7=86=E8=A7=92=E5=88=87?= =?UTF-8?q?=E6=8D=A2]=20=E6=B7=BB=E5=8A=A0=E7=9B=91=E5=90=AC=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E7=9B=B4=E6=8E=A5=E5=9B=9E=E8=B0=83=E4=B8=80=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/function/angle/MoGoVisualAngleChangeProvider.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/angle/MoGoVisualAngleChangeProvider.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/angle/MoGoVisualAngleChangeProvider.kt index 279bb7b85a..5ed0a11e9f 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/angle/MoGoVisualAngleChangeProvider.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/angle/MoGoVisualAngleChangeProvider.kt @@ -178,7 +178,10 @@ class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider { } override fun addListener(tag: String, listener: OnMoGoVisualAngleSceneChangeListener) { - listeners.getOrPut(tag) { ArrayList() }.takeIf { !it.contains(listener) }?.add(listener) + listeners.getOrPut(tag) { ArrayList() }.takeIf { !it.contains(listener) }?.also { + it.add(listener) + listener.onSceneChanged(getCurrentScene()) + } } override fun removeListener(tag: String) {