Merge branch 'dev_robo_240612_6.5.0_tmp' of gitlab.zhidaoauto.com:SCA/L4HA/AndroidApp/MoGoEagleEye into dev_robo_240612_6.5.0_tmp
This commit is contained in:
@@ -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&&marginTop<split){
|
||||
translationByValue(VisualViewModel.Visualangle.Middle)
|
||||
}else if(marginTop>split&&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
|
||||
|
||||
@@ -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() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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<MainLauncherActivity>
|
||||
|
||||
@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))
|
||||
}
|
||||
}
|
||||
@@ -458,7 +458,8 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
}
|
||||
|
||||
private fun computeCrossCountBetween(start: kotlin.Triple<Double, Double, Double>, end: kotlin.Pair<Double, Double>): 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
|
||||
@@ -490,7 +491,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 =
|
||||
|
||||
@@ -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<Point>? = null, var lines: ArrayList<Polyline>? = 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<Point>? = null, var lines: ArrayList<Polyline>? = 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()
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ public class V2XRoadEventMarker implements IV2XMarker<V2XRoadEventEntity> {
|
||||
ArrayList<Point> 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<V2XRoadEventEntity> {
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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<AutoExplorationEntity>()
|
||||
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()
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivExplorationLoading"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="@dimen/dp_27"
|
||||
android:layout_height="@dimen/dp_27"
|
||||
android:src="@drawable/icon_exploration_loading"
|
||||
android:contentDescription="@string/exploration_loading"
|
||||
android:layout_gravity="center_vertical"
|
||||
@@ -20,9 +20,9 @@
|
||||
android:id="@+id/tvExplorationContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp_18"
|
||||
android:textSize="@dimen/sp_20"
|
||||
android:textColor="@color/white"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:layout_marginLeft="@dimen/dp_13"
|
||||
android:layout_gravity="center_vertical"
|
||||
/>
|
||||
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginBottom="@dimen/dp_10">
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_marginBottom="@dimen/dp_12"
|
||||
tools:ignore="UseCompoundDrawables">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivExplorationLoading"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="@dimen/dp_27"
|
||||
android:layout_height="@dimen/dp_27"
|
||||
android:src="@drawable/icon_exploration_loading_p"
|
||||
android:contentDescription="@string/exploration_loading"
|
||||
android:layout_gravity="center_vertical"
|
||||
@@ -19,9 +21,9 @@
|
||||
android:id="@+id/tvExplorationContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp_18"
|
||||
android:textSize="@dimen/sp_20"
|
||||
android:textColor="@color/auto_exploration_content_p"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:layout_marginStart="@dimen/dp_13"
|
||||
android:layout_gravity="center_vertical"
|
||||
/>
|
||||
|
||||
|
||||
@@ -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"
|
||||
/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
@@ -46,7 +46,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvExplorationTitle"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvExplorationTitle"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_marginTop="@dimen/dp_17"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="@dimen/dp_580"
|
||||
android:layout_height="@dimen/dp_500"
|
||||
android:layout_height="@dimen/dp_520"
|
||||
android:background="@drawable/bg_automatic_exploration"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
@@ -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"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
@@ -55,7 +55,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvExplorationTitle"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvExplorationTitle"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -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) {
|
||||
|
||||
@@ -25,8 +25,4 @@ enum class Level(val zIndex: Int) {
|
||||
*/
|
||||
MAP_POLYGON(76000),
|
||||
|
||||
/**
|
||||
* 围栏区域底色
|
||||
*/
|
||||
MAP_POLYGON_SOLID(75500)
|
||||
}
|
||||
Reference in New Issue
Block a user