fix bug of vip loc
This commit is contained in:
@@ -6,7 +6,6 @@ import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.os.Message
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng
|
||||
import com.mogo.eagle.core.data.trafficlight.*
|
||||
import com.mogo.eagle.core.data.v2x.VipMessage
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
@@ -16,7 +15,6 @@ import com.mogo.eagle.core.function.call.trafficlight.CallTrafficLightListenerMa
|
||||
import com.mogo.eagle.core.function.call.vip.CallVipSetListenerManager
|
||||
import com.mogo.eagle.core.function.v2x.trafficlight.core.MogoTrafficLightManager
|
||||
import com.mogo.eagle.core.function.v2x.vip.network.VipNetWorkModel
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import com.mogo.module.common.enums.EventTypeEnum
|
||||
import com.mogo.service.cloud.socket.IMogoOnMessageListener
|
||||
@@ -25,7 +23,7 @@ import com.mogo.utils.logger.Logger
|
||||
import kotlin.math.abs
|
||||
|
||||
class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListener,
|
||||
IMogoCarLocationChangedListener2, Handler.Callback {
|
||||
Handler.Callback {
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -55,8 +53,6 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
|
||||
fun initServer(context: Context) {
|
||||
mContext = context
|
||||
MogoApisHandler.getInstance()
|
||||
.apis.registerCenterApi.registerCarLocationChangedListener(TAG, this)
|
||||
MogoApisHandler.getInstance()
|
||||
.apis.getSocketManagerApi(context)
|
||||
.registerOnMessageListener(401025, this)
|
||||
@@ -109,7 +105,10 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
return
|
||||
}
|
||||
if (trafficLightResult.currentRoadTrafficLight() == null) {
|
||||
Logger.d(TAG, "vip 获取到灯态,但没找到对应车道数据 result : $trafficLightResult , then resetConditions")
|
||||
Logger.d(
|
||||
TAG,
|
||||
"vip 获取到灯态,但没找到对应车道数据 result : $trafficLightResult , then resetConditions"
|
||||
)
|
||||
resetConditions()
|
||||
return
|
||||
}
|
||||
@@ -132,7 +131,7 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
lastResult?.let {
|
||||
//如果上次结果和本次灯态结果变化比较大,则已变灯,控制HMI展示弹窗
|
||||
if (abs(currentResult!!.remain - it.remain) > 5) {
|
||||
Logger.d(TAG,"调用showWarningV2X to show")
|
||||
Logger.d(TAG, "调用showWarningV2X to show")
|
||||
CallerHmiManager.showWarningV2X(EventTypeEnum.TYPE_VIP_IDENTIFICATION.poiType.toInt(),
|
||||
EventTypeEnum.TYPE_VIP_IDENTIFICATION.content,
|
||||
EventTypeEnum.TYPE_VIP_IDENTIFICATION.tts,
|
||||
@@ -233,12 +232,15 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
|
||||
private fun turnLight(controlTime: Int) {
|
||||
result?.let {
|
||||
val bearing =
|
||||
MogoApisHandler.getInstance().apis.mapServiceApi.getSingletonLocationClient(mContext).lastKnowLocation.bearing.toDouble()
|
||||
Logger.d(TAG, "turnLight -- bearing : $bearing")
|
||||
MogoTrafficLightManager.INSTANCE.turnLightToGreen(
|
||||
it.lightId,
|
||||
it.crossId,
|
||||
mLocation!!.bearing.toDouble(), controlTime, {
|
||||
it.lightId, it.crossId, bearing, controlTime,
|
||||
{
|
||||
Logger.d(TAG, "变灯请求成功")
|
||||
}, { errorMsg ->
|
||||
},
|
||||
{ errorMsg ->
|
||||
Logger.e(TAG, "变灯请求失败 msg : $errorMsg")
|
||||
})
|
||||
}
|
||||
@@ -250,13 +252,4 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
mContext = null
|
||||
}
|
||||
|
||||
override fun onCarLocationChanged(latLng: MogoLatLng?) {
|
||||
}
|
||||
|
||||
override fun onCarLocationChanged2(latLng: Location?) {
|
||||
latLng?.let {
|
||||
mLocation = it
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user