[8.1.0][opt]解决合并后的冲突
This commit is contained in:
@@ -1,33 +1,56 @@
|
||||
package com.mogo.och.bridge.bridge
|
||||
|
||||
import com.mogo.commons.env.ProjectUtils
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningActionsListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningTrajectoryListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager.getWgs84Lat
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager.getWgs84Lon
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningActionsListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningTrajectoryListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OCHCOMMON
|
||||
import com.mogo.map.MogoMap
|
||||
import com.mogo.map.MogoMap.Companion.mapInstance
|
||||
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils
|
||||
import com.mogo.map.overlay.core.Level
|
||||
import com.mogo.map.overlay.point.Point
|
||||
import com.mogo.och.bridge.BridgeServiceManager
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
import com.mogo.och.common.module.manager.loop.LoopInfo
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import com.mogo.och.bridge.R
|
||||
import prediction2025.Prediction2025
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
object OchBridgeManager: IMoGoPlanningTrajectoryListener, IMoGoAutopilotIdentifyListener {
|
||||
object OchBridgeManager: IMoGoPlanningTrajectoryListener, IMoGoAutopilotIdentifyListener,
|
||||
IMoGoAutopilotPlanningActionsListener {
|
||||
private val TAG = "${M_OCHCOMMON}OchPlanningListenerManager"
|
||||
|
||||
|
||||
private var trajectoryTime = 0L
|
||||
private var predictionTime = 0L
|
||||
|
||||
private val map by lazy {
|
||||
mapInstance.getMogoMap(MogoMap.DEFAULT)
|
||||
}
|
||||
|
||||
@Volatile
|
||||
private var lastTime: Long = 0L
|
||||
|
||||
@Volatile
|
||||
private var isHide = false
|
||||
|
||||
fun load(){
|
||||
CallerPlanningTrajectoryListenerManager.addListener(TAG,this)
|
||||
CallerAutopilotIdentifyListenerManager.addListener(TAG,this)
|
||||
BizLoopManager.setLoopFunction(TAG, LoopInfo(2, ::checkTimeout, immediately = false, scheduler = Schedulers.io()))
|
||||
CallerPlanningActionsListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
fun release(){
|
||||
fun release() {
|
||||
CallerPlanningTrajectoryListenerManager.removeListener(TAG)
|
||||
CallerAutopilotIdentifyListenerManager.removeListener(TAG)
|
||||
}
|
||||
@@ -84,5 +107,54 @@ object OchBridgeManager: IMoGoPlanningTrajectoryListener, IMoGoAutopilotIdentify
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun pncActions(planningActionMsg: MessagePad.PlanningActionMsg) {
|
||||
if (System.currentTimeMillis() - lastTime >= 1000) {
|
||||
lastTime = System.currentTimeMillis()
|
||||
// Saas乘客屏且是自驾中
|
||||
if (ProjectUtils.isSaas() && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
|
||||
) {
|
||||
if (CallerAutoPilotStatusListenerManager.getState() != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
CallerMapUIServiceManager.getOverlayManager()?.hidePoint("RenderParkingModel")
|
||||
isHide = true
|
||||
} else {
|
||||
val lonLatArr = map?.switchData(
|
||||
planningActionMsg.updatedTerminal.x,
|
||||
planningActionMsg.updatedTerminal.y,
|
||||
false
|
||||
)
|
||||
lonLatArr?.let {
|
||||
if (it.size < 2) {
|
||||
CallerMapUIServiceManager.getOverlayManager()?.hidePoint("RenderParkingModel")
|
||||
isHide = true
|
||||
return@let
|
||||
}
|
||||
// 只处理100m以内的
|
||||
if (DrivingDirectionUtils.distance(it[0], it[1], getWgs84Lon(), getWgs84Lat()) >= 100) {
|
||||
CallerMapUIServiceManager.getOverlayManager()?.hidePoint("RenderParkingModel")
|
||||
isHide = true
|
||||
return@let
|
||||
}
|
||||
// owner、level、id作为key去从缓存中取
|
||||
val builder =
|
||||
Point.Options.Builder("TYPE_MARKER_PNC", Level.DEFAULT)
|
||||
.setId("RenderParkingModel")
|
||||
.anchor(0.5f, 0.5f)
|
||||
.set3DMode(true)
|
||||
.isUseGps(true)
|
||||
.controlAngle(true)
|
||||
.rotate(map!!.convertAngle(planningActionMsg.parkingLotHeading, it[0], it[1]).toFloat())
|
||||
.icon3DRes(R.raw.parking_model)
|
||||
.longitude(it[0])
|
||||
.latitude(it[1])
|
||||
CallerMapUIServiceManager.getOverlayManager()
|
||||
?.showOrUpdatePoint(builder.build())
|
||||
if (isHide) {
|
||||
CallerMapUIServiceManager.getOverlayManager()?.showPoint("RenderParkingModel")
|
||||
isHide = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
OCH/common/bridge/src/main/res/raw/parking_model.nt3d
Normal file
BIN
OCH/common/bridge/src/main/res/raw/parking_model.nt3d
Normal file
Binary file not shown.
@@ -19,6 +19,7 @@ import com.mogo.eagle.core.function.view.CoordinateAnimationView.Companion
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.eagle.core.widget.media.video.TextureVideoViewOutlineProvider
|
||||
import com.mogo.map.MogoMap
|
||||
import com.mogo.map.MogoMap.Companion.mapInstance
|
||||
import com.mogo.map.MogoMapView
|
||||
import com.mogo.map.overlay.line.Polyline
|
||||
import com.mogo.map.overlay.point.Point
|
||||
@@ -36,6 +37,9 @@ open class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(con
|
||||
private const val TAG = "MapBizView"
|
||||
}
|
||||
|
||||
@Volatile
|
||||
private var lastTime: Long = 0L
|
||||
|
||||
override fun onCreate(bundle: Bundle?) {
|
||||
super.onCreate(bundle)
|
||||
map?.uiController?.showMyLocation(true)
|
||||
@@ -110,6 +114,11 @@ open class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(con
|
||||
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
|
||||
// 跟新地图控件
|
||||
setExtraGPSData(gnssInfo)
|
||||
if (System.currentTimeMillis() - lastTime >= 5000) {
|
||||
// 预测给的UTM坐标数据没有带上度带信息,根据定位计算度带
|
||||
mapInstance.getMogoMap()?.switchData(gnssInfo.longitude, gnssInfo.latitude, true)
|
||||
lastTime = System.currentTimeMillis()
|
||||
}
|
||||
accLimit = gnssInfo.acceleration < accThreshold
|
||||
}
|
||||
|
||||
|
||||
@@ -72,6 +72,8 @@ interface IMogoMap {
|
||||
|
||||
fun switchData(x: Double, y: Double, isWgs84: Boolean): DoubleArray?
|
||||
|
||||
fun convertAngle(angle: Double, lon: Double, lat: Double): Double
|
||||
|
||||
/**
|
||||
* 和高精地图SDK配置的默认坐标系MapParams.setCoordinateType()有关,方法暂不支持传入当前的坐标系
|
||||
*/
|
||||
|
||||
@@ -247,6 +247,10 @@ class AMapWrapper(map: MapAutoViewHelper?, mapView: MapAutoView, controller: IMo
|
||||
return mAMap?.switchData(x, y, isWgs84)
|
||||
}
|
||||
|
||||
override fun convertAngle(angle: Double, lon: Double, lat: Double): Double {
|
||||
return MapTools.convertAngle(angle, lon, lat)
|
||||
}
|
||||
|
||||
override fun toScreenLocations(data: List<LonLatPoint>): List<android.graphics.Point> {
|
||||
return MapTools.toScreenLocations(data, mMapView.getMapController())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user