[6.5.0] fix bug of roam
This commit is contained in:
@@ -37,8 +37,8 @@ class MapBizProvider :IMoGoFunctionServerProvider, IMogoRoma {
|
||||
CallerVisualAngleManager.init()
|
||||
}
|
||||
|
||||
override fun trigger(romaStatus: Boolean) {
|
||||
romaManager.trigger(romaStatus)
|
||||
override fun trigger(roamStatus: Boolean) {
|
||||
romaManager.trigger(roamStatus)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
|
||||
@@ -32,21 +32,15 @@ class AiCloudIdentifyDataManager {
|
||||
})
|
||||
}
|
||||
|
||||
fun trigger(romaStatus: Boolean, startDis: Int, endDis: Int) {
|
||||
requestRangeOfIdentify(romaStatus, startDis, endDis)
|
||||
fun trigger(romaStatus: Boolean, startDis: Int, endDis: Int, lat: Double, lon: Double) {
|
||||
requestRangeOfIdentify(romaStatus, startDis, endDis, lat, lon)
|
||||
}
|
||||
|
||||
fun requestRangeOfIdentify(
|
||||
romaStatus: Boolean,
|
||||
startDis: Int,
|
||||
endDis: Int
|
||||
romaStatus: Boolean, startDis: Int, endDis: Int, lat: Double, lon: Double
|
||||
) {
|
||||
val loc = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().gnssInfo
|
||||
aiCloudIdentifyNetWorkModel.requestIdentifyRange(
|
||||
romaStatus,
|
||||
startDis, endDis,
|
||||
loc.longitude,
|
||||
loc.latitude,
|
||||
romaStatus, startDis, endDis, lon, lat,
|
||||
{
|
||||
CallerMapAiCloudDataManager.invokeResponse(romaStatus)
|
||||
},
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.eagle.core.function.business.ai
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.os.Message
|
||||
import android.util.Log
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
@@ -51,7 +52,7 @@ class RomaManager() : IMoGoPlanningRottingListener,
|
||||
IMoGoAutopilotStatusListener, IMoGoRomaListener, IMoGoAiCloudIdentifyDataListener {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "AiCloudIdentifyData"
|
||||
private const val TAG = "RomaManager"
|
||||
|
||||
private const val H_ERROR_CLOUD = 1
|
||||
private const val H_ERROR_MAP = 2
|
||||
@@ -116,13 +117,17 @@ class RomaManager() : IMoGoPlanningRottingListener,
|
||||
true
|
||||
}
|
||||
|
||||
fun trigger(romaStatus: Boolean) {
|
||||
if (CallerMapIdentifyManager.roma.first != TAG && CallerMapIdentifyManager.roma.second) {
|
||||
fun trigger(roamStatus: Boolean) {
|
||||
if (CallerMapIdentifyManager.roam.first.isNotEmpty()
|
||||
&& CallerMapIdentifyManager.roam.first!= TAG
|
||||
&& CallerMapIdentifyManager.roam.second) {
|
||||
ToastUtils.showLong("正在展示路口漫游,请稍后重试")
|
||||
Log.e("emArrow", "正在展示路口漫游,请稍后重试")
|
||||
CallerMapRomaListener.invokeMapRoma(false)
|
||||
return
|
||||
}
|
||||
// 乘客司机屏屏各自单独控制漫游
|
||||
if (romaStatus) {
|
||||
if (roamStatus) {
|
||||
// 开启roma,当前非漫游,开启
|
||||
MapRomaTrace.log(
|
||||
"",
|
||||
@@ -140,7 +145,7 @@ class RomaManager() : IMoGoPlanningRottingListener,
|
||||
}
|
||||
|
||||
private fun openRoma() {
|
||||
CallerMapIdentifyManager.roma = Pair(TAG, true)
|
||||
CallerMapIdentifyManager.roam = Pair(TAG, true)
|
||||
CallerMapUIServiceManager.getMapUIController()?.visualAngleLock(true)
|
||||
CallerMapUIServiceManager.getMapUIController()?.setScrollGesturesEnable(false)
|
||||
updateLongSightLevel(true)
|
||||
@@ -149,7 +154,7 @@ class RomaManager() : IMoGoPlanningRottingListener,
|
||||
|
||||
@Synchronized
|
||||
private fun closeRoma(manual: Boolean = true) {
|
||||
CallerMapIdentifyManager.roma = Pair("", false)
|
||||
CallerMapIdentifyManager.roam = Pair("", false)
|
||||
CallerMapUIServiceManager.getMapUIController()?.visualAngleLock(false)
|
||||
CallerMapUIServiceManager.getMapUIController()?.setScrollGesturesEnable(true)
|
||||
updateLongSightLevel(false)
|
||||
@@ -192,7 +197,7 @@ class RomaManager() : IMoGoPlanningRottingListener,
|
||||
"cityCode" to CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().cityCode
|
||||
), !dataReceive
|
||||
)
|
||||
aiCloudIdentifyDataManager.trigger(dataReceive, START_METRE, END_METRE)
|
||||
aiCloudIdentifyDataManager.trigger(dataReceive, START_METRE, END_METRE,loc.latitude,loc.longitude)
|
||||
}
|
||||
|
||||
override fun response(requestStatus: Boolean, errorMsg: String?) {
|
||||
|
||||
@@ -8,13 +8,12 @@ import android.util.Log
|
||||
import androidx.lifecycle.LifecycleObserver
|
||||
import com.mogo.eagle.core.function.api.map.road.IMoGoMapRoadListener
|
||||
import com.mogo.eagle.core.function.api.map.roma.IMoGoAiCloudIdentifyDataListener
|
||||
import com.mogo.eagle.core.function.business.ai.AiCloudIdentifyDataManager
|
||||
import com.mogo.eagle.core.function.business.ai.AiCloudIdentifyDataManager.Companion.aiCloudIdentifyDataManager
|
||||
import com.mogo.eagle.core.function.business.ai.RomaManager
|
||||
import com.mogo.eagle.core.function.business.identify.MapIdentifySubscriber
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapAiCloudDataManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager
|
||||
import com.mogo.eagle.core.utilcode.util.CoordinateUtils
|
||||
import com.mogo.eagle.core.widget.media.video.TextureVideoViewOutlineProvider
|
||||
import com.mogo.map.MogoMap.Companion.MAP_ROAM
|
||||
import com.mogo.map.MogoMapView
|
||||
@@ -24,23 +23,19 @@ import mogo.yycp.api.proto.SocketDownData
|
||||
|
||||
|
||||
class MapRoamView(context: Context?, attrs: AttributeSet?) : MogoMapView(context, attrs),
|
||||
LifecycleObserver, IMoGoMapRoadListener , IMoGoAiCloudIdentifyDataListener {
|
||||
LifecycleObserver, IMoGoMapRoadListener, IMoGoAiCloudIdentifyDataListener {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "MapRoamView"
|
||||
}
|
||||
|
||||
override fun onCreate(bundle: Bundle?) {
|
||||
super.onCreate(bundle)
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
initMapView()
|
||||
}
|
||||
|
||||
private fun initMapView() {
|
||||
map?.uiController?.showMyLocation(false)
|
||||
getUI()?.showMyLocation(false)
|
||||
map?.uiSettings?.let {
|
||||
it.setAllGesturesEnabled(false)
|
||||
//设置指南针是否可见。
|
||||
@@ -58,18 +53,6 @@ class MapRoamView(context: Context?, attrs: AttributeSet?) : MogoMapView(context
|
||||
return MAP_ROAM
|
||||
}
|
||||
|
||||
override fun onSaveInstanceState(outState: Bundle) {
|
||||
super.onSaveInstanceState(outState)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
}
|
||||
|
||||
private fun getUI(): IMogoMapUIController? {
|
||||
return map?.uiController
|
||||
}
|
||||
@@ -83,25 +66,28 @@ class MapRoamView(context: Context?, attrs: AttributeSet?) : MogoMapView(context
|
||||
|
||||
fun openRoam() {
|
||||
this.onResume()
|
||||
CallerMapAiCloudDataManager.addListener(TAG, this)
|
||||
getUI()?.setVisible(true)
|
||||
CallerMapAiCloudDataManager.addListener(RoadCrossRoamView.TAG, this)
|
||||
// 更新地图视角 - 高视角
|
||||
getUI()?.changeMapVisualAngle(VisualAngleMode.MAP_STYLE_VR_ANGLE_TOP, null)
|
||||
// 更新路口位置
|
||||
val latLng = CallerMapRoadListenerManager.getStopLineLatLng()
|
||||
Log.i("emArrow","$TAG 开始漫游 latLng:${latLng.toString()}")
|
||||
latLng?.let {
|
||||
val loc = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
||||
val curLat = loc.latitude
|
||||
val curLng = loc.longitude
|
||||
loc.latitude = latLng.first
|
||||
loc.longitude = latLng.second
|
||||
setExtraGPSData(loc)
|
||||
val dis = CoordinateUtils.calculateLineDistance(curLat, curLng, latLng.first, latLng.second)
|
||||
Log.i("emArrow", "$TAG 开始漫游 latLng:$latLng , curLat:$curLat , curLng:$curLng , dis:$dis")
|
||||
// 开始漫游
|
||||
aiCloudIdentifyDataManager.trigger(true, 1, 300, latLng.first, latLng.second)
|
||||
}
|
||||
// 开始漫游
|
||||
aiCloudIdentifyDataManager.trigger(true, 1, 300)
|
||||
}
|
||||
|
||||
|
||||
override fun response(requestStatus: Boolean, errorMsg: String?) {
|
||||
|
||||
Log.e("emArrow","road map response:$requestStatus , errorMsg:${errorMsg?:""}")
|
||||
}
|
||||
|
||||
override fun onAiIdentifyData(obj: SocketDownData.SocketDownDataProto?) {
|
||||
@@ -116,17 +102,16 @@ class MapRoamView(context: Context?, attrs: AttributeSet?) : MogoMapView(context
|
||||
}
|
||||
}
|
||||
|
||||
fun closeRoam(){
|
||||
this.onPause()
|
||||
fun closeRoam() {
|
||||
// 结束漫游
|
||||
aiCloudIdentifyDataManager.trigger(false, 1, 300)
|
||||
CallerMapAiCloudDataManager.removeListener(TAG)
|
||||
val latLng = CallerMapRoadListenerManager.getStopLineLatLng()
|
||||
latLng?.let {
|
||||
aiCloudIdentifyDataManager.trigger(false, 1, 300, it.first, it.second)
|
||||
}
|
||||
CallerMapAiCloudDataManager.removeListener(RoadCrossRoamView.TAG)
|
||||
MapIdentifySubscriber.instance.clearAiCloudRoma(MAP_ROAM)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
// 先取消注册数据,再onDestroy
|
||||
super.onDestroy()
|
||||
this.onPause()
|
||||
getUI()?.setVisible(false)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.mogo.eagle.core.function.view
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
@@ -48,7 +47,6 @@ class RoadCrossRoamListAdapter(private val mContext: Context, private val lightM
|
||||
|
||||
val r0 = Random.nextInt(0,3)
|
||||
val r1 = Random.nextInt(1,9)
|
||||
Log.i("emArrow","random:${r0 * 1000L + r1 * 100L}")
|
||||
// 模拟加载完成
|
||||
holder.itemView.postDelayed({
|
||||
holder.progressBar.visibility = View.GONE
|
||||
|
||||
@@ -36,7 +36,7 @@ class RoadCrossRoamView @JvmOverloads constructor(
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoMapRoadListener{
|
||||
|
||||
companion object {
|
||||
private const val TAG = "RoadCrossRoamView"
|
||||
const val TAG = "RoadCrossRoamView"
|
||||
}
|
||||
|
||||
private var showState by Delegates.observable(false) { _, oldV, newV ->
|
||||
@@ -91,19 +91,23 @@ class RoadCrossRoamView @JvmOverloads constructor(
|
||||
|
||||
override fun onStopLineInfo(info: StopLine) {
|
||||
super.onStopLineInfo(info)
|
||||
if(info.distance == 0.0){
|
||||
Log.i("emArrow", "showState return , distance is zero")
|
||||
return
|
||||
}
|
||||
showState = info.distance < 200 && info.distance > 100
|
||||
Log.i("emArrow", "showState $showState , distance:${info.distance}")
|
||||
// Log.i("emArrow", "showState $showState , distance:${info.distance}")
|
||||
}
|
||||
|
||||
private fun attachView() {
|
||||
// 处于漫游模式下不做处理
|
||||
if (CallerMapIdentifyManager.roma.second) {
|
||||
if (CallerMapIdentifyManager.roma.first != TAG) {
|
||||
if (CallerMapIdentifyManager.roam.second) {
|
||||
if (CallerMapIdentifyManager.roam.first != TAG) {
|
||||
ToastUtils.showLong("正在漫游中,不展示路口漫游")
|
||||
}
|
||||
return
|
||||
}
|
||||
CallerMapIdentifyManager.roma = Pair(TAG, true)
|
||||
CallerMapIdentifyManager.roam = Pair(TAG, true)
|
||||
this.visibility = View.VISIBLE
|
||||
ivZhiRoadRoamView.visibility = View.VISIBLE
|
||||
mapRoamView.visibility = View.VISIBLE
|
||||
@@ -145,7 +149,7 @@ class RoadCrossRoamView @JvmOverloads constructor(
|
||||
}
|
||||
mapRoamView.closeRoam()
|
||||
mapRoamView.visibility = View.GONE
|
||||
CallerMapIdentifyManager.roma = Pair("", false)
|
||||
CallerMapIdentifyManager.roam = Pair("", false)
|
||||
lvRoadCrossRoamTip.adapter = null
|
||||
animator?.cancel()
|
||||
if (lightMode) {
|
||||
|
||||
Reference in New Issue
Block a user