Merge remote-tracking branch 'origin/dev_robotaxi-d_240912_6.7.0' into dev_robotaxi-d_240912_6.7.0
This commit is contained in:
@@ -1300,7 +1300,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
receivedAck.messageType == MessageType.TYPE_SEND_PLANNING_CMD ||//给Planning指令
|
||||
receivedAck.messageType == MessageType.TYPE_SEND_SET_PARAM_REQ_V2 //设置参数命令V2
|
||||
) {
|
||||
receiveReceivedAck(receivedAck)
|
||||
receiveReceivedAck(receivedAck.toString())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1310,7 +1310,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
nodeAliasCode = AdasChain.CHAIN_CODE_ADAS_START_AUTOPILOT,
|
||||
paramIndexes = [0]
|
||||
)
|
||||
private fun receiveReceivedAck(receivedAck: ReceivedAck) {
|
||||
private fun receiveReceivedAck(receivedAck: String) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,6 +9,9 @@ import com.mogo.commons.debug.DebugConfig.getNetMode
|
||||
import com.mogo.commons.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ADAS_CONNECT_STATUS
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_SOURCE_ADAS
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_TYPE_SOCKET_AUTOPILOT
|
||||
import com.mogo.eagle.core.data.msgbox.AutopilotMsg
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
@@ -29,6 +32,7 @@ import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.zhidao.support.adas.high.AdasManager
|
||||
import com.zhidao.support.adas.high.OnAdasConnectStatusListener
|
||||
import com.zhidao.support.adas.high.bean.VersionCompatibility
|
||||
import com.zhidao.support.adas.high.chain.AdasChain
|
||||
import com.zhidao.support.adas.high.common.Constants.ENVIRONMENT.DEMO
|
||||
import com.zhidao.support.adas.high.common.Constants.ENVIRONMENT.DEVELOP
|
||||
import com.zhidao.support.adas.high.common.Constants.ENVIRONMENT.PRODUCTION
|
||||
@@ -36,6 +40,7 @@ import com.zhidao.support.adas.high.common.Constants.ENVIRONMENT.TEST
|
||||
import com.zhidao.support.adas.high.common.Constants.TERMINAL_ROLE.DRIVER
|
||||
import com.zhidao.support.adas.high.common.Constants.TERMINAL_ROLE.PASSENGER
|
||||
import com.zhjt.mogo.adas.data.AdasConstants
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
|
||||
@@ -237,7 +242,7 @@ class MoGoAdasMsgConnectStatusListenerImpl :
|
||||
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().connectStatusReason = reason
|
||||
CallerAutoPilotStatusListenerManager.invokeAutoPilotStatus()
|
||||
CallerAutoPilotStatusListenerManager.invokeAutoPilotIPCStatusChanged(status, reason)
|
||||
saveIntoMsgBox(status, reason)
|
||||
saveIntoMsgBox(status, connectStatusDescribe)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -289,9 +294,15 @@ class MoGoAdasMsgConnectStatusListenerImpl :
|
||||
CallerAutopilotCarConfigListenerManager.invokeAutopilotCertFileResult(certificationResult)
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_TYPE_SOCKET_AUTOPILOT,
|
||||
linkCode = CHAIN_SOURCE_ADAS,
|
||||
nodeAliasCode = CHAIN_CODE_ADAS_CONNECT_STATUS,
|
||||
paramIndexes = [0,1]
|
||||
)
|
||||
private fun saveIntoMsgBox(
|
||||
status: AdasConstants.IpcConnectionStatus,
|
||||
reason: String?
|
||||
reason: String
|
||||
) {
|
||||
var title = ""
|
||||
var content = ""
|
||||
|
||||
@@ -20,7 +20,7 @@ import com.zhjt.mogo_core_function_devatools.status.entity.Status
|
||||
/**
|
||||
* FSM状态展示 Dialog
|
||||
*/
|
||||
class FSMStatusDetailDialog(context: Context) : BaseFloatDialog(context),
|
||||
class FSMStatusDetailDialog(context: Context) : BaseFloatDialog(context, TAG),
|
||||
StatusManager.IStatusListener {
|
||||
companion object {
|
||||
private const val TAG = "FSMStatusDetailDialog"
|
||||
|
||||
@@ -12,6 +12,9 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener;
|
||||
import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.commons.module.status.StatusDescriptor;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.PermissionUtils;
|
||||
@@ -21,14 +24,22 @@ import com.mogo.eagle.core.utilcode.util.PermissionUtils;
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class BaseFloatDialog extends Dialog {
|
||||
public class BaseFloatDialog extends Dialog implements IMogoStatusChangedListener {
|
||||
|
||||
private static final String TAG = "BaseFloatDialog";
|
||||
|
||||
private static String REGISTER_TAG = "";
|
||||
|
||||
public BaseFloatDialog(@NonNull Context context) {
|
||||
this(context, R.style.BaseFloatDialogStyle);
|
||||
}
|
||||
|
||||
public BaseFloatDialog(@NonNull Context context, String tag) {
|
||||
this(context, R.style.BaseFloatDialogStyle);
|
||||
REGISTER_TAG = TAG + "_" + tag;
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(REGISTER_TAG, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, this);
|
||||
}
|
||||
|
||||
public BaseFloatDialog(@NonNull Context context, int themeResId) {
|
||||
super(context, themeResId);
|
||||
if (DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_BYD) {
|
||||
@@ -61,6 +72,7 @@ public class BaseFloatDialog extends Dialog {
|
||||
@Override
|
||||
public void dismiss() {
|
||||
CallerLogger.d( TAG, "onDismiss====");
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(REGISTER_TAG, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, this);
|
||||
super.dismiss();
|
||||
}
|
||||
private void setWindowSize(){
|
||||
@@ -76,4 +88,11 @@ public class BaseFloatDialog extends Dialog {
|
||||
}
|
||||
getWindow().setAttributes(attributes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
|
||||
if(descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND && isTrue){
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,9 +15,10 @@ import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
* @since: 2022/1/13
|
||||
*/
|
||||
class AdUpgradeDialog(context: Context, images: List<String>, padSn: String, releaseId: String) :
|
||||
BaseFloatDialog(context), LifecycleObserver {
|
||||
BaseFloatDialog(context,TAG), LifecycleObserver {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "AdUpgradeDialog"
|
||||
private var adUpgradeDialog: AdUpgradeDialog? = null
|
||||
|
||||
fun show(context: Context?, images: List<String>, padSn: String, releaseId: String) {
|
||||
|
||||
@@ -11,7 +11,7 @@ import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
* @description 重启自动驾驶docker确认对话框
|
||||
* @since: 2022/2/17
|
||||
*/
|
||||
class DockerRebootDialog(context: Context): BaseFloatDialog(context), LifecycleObserver {
|
||||
class DockerRebootDialog(context: Context): BaseFloatDialog(context, "DockerReboot"), LifecycleObserver {
|
||||
|
||||
private var rebootConfirm : TextView? = null
|
||||
private var rebootCancel : TextView? = null
|
||||
|
||||
@@ -16,7 +16,7 @@ import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
* @brief 修改车辆对话框
|
||||
* @author lixiaopeng
|
||||
*/
|
||||
class ModifyBindingCarDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver {
|
||||
class ModifyBindingCarDialog(context: Context) : BaseFloatDialog(context, TAG), LifecycleObserver {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "ModifyBindingCarDialog"
|
||||
|
||||
@@ -22,7 +22,7 @@ import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
/**
|
||||
* 离线地图缓存
|
||||
*/
|
||||
class OfflineMapDialog(context: Context) : BaseFloatDialog(context) {
|
||||
class OfflineMapDialog(context: Context) : BaseFloatDialog(context, TAG) {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "OfflineMapDialog"
|
||||
|
||||
@@ -17,7 +17,7 @@ import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
* @brief 绑定车辆对话框
|
||||
* @author lixiaopeng
|
||||
*/
|
||||
class ToBindingCarDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver {
|
||||
class ToBindingCarDialog(context: Context) : BaseFloatDialog(context, TAG), LifecycleObserver {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "ToBindingCarDialog"
|
||||
|
||||
@@ -19,7 +19,7 @@ import java.lang.ref.WeakReference
|
||||
* @brief APP升级提示弹框
|
||||
* @author lixiaopeng
|
||||
*/
|
||||
class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver {
|
||||
class UpgradeAppDialog(context: Context) : BaseFloatDialog(context,TAG), LifecycleObserver {
|
||||
|
||||
companion object{
|
||||
private const val TAG = "UpgradeAppDialog"
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
android:textSize="@dimen/dp_45"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_upgrade_tips"
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
android:layout_width="@dimen/dp_654"
|
||||
android:layout_height="@dimen/dp_790"
|
||||
android:layout_marginTop="@dimen/dp_39"
|
||||
android:layout_marginEnd="@dimen/dp_4"
|
||||
android:layout_marginEnd="@dimen/dp_19"
|
||||
android:visibility="gone"
|
||||
android:focusable="false"
|
||||
android:focusableInTouchMode="false"
|
||||
|
||||
@@ -237,6 +237,8 @@ class OverMapView @JvmOverloads constructor(
|
||||
if (mMapView != null) {
|
||||
mMapView!!.onDestroy()
|
||||
}
|
||||
mAMap?.clear()
|
||||
mAMap = null
|
||||
}
|
||||
// =================必须通知高德地图生命周期的变化=================
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.MapAssetStyleUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP
|
||||
import com.mogo.eagle.core.utilcode.util.CoordinateUtils
|
||||
import com.mogo.eagle.core.utilcode.util.LocationUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
@@ -202,7 +203,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
* 在轨迹点附近的路口设备
|
||||
*/
|
||||
@Volatile
|
||||
private var deviceInPathList: List<DeviceInfoBean>?? = null
|
||||
private var deviceInPathList: List<DeviceInfoBean>? = null
|
||||
|
||||
@Volatile
|
||||
private var roadTrackList: List<List<List<Double>?>?>? = null
|
||||
@@ -269,31 +270,33 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
initView(context)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
Log.d(TAG, "TravelRealityView初始化异常")
|
||||
CallerLogger.d("$M_MAP$TAG", "TravelRealityView初始化异常")
|
||||
}
|
||||
}
|
||||
|
||||
// =================必须通知高德地图生命周期的变化=================
|
||||
fun onCreateView(savedInstanceState: Bundle?) {
|
||||
mMapView?.onCreate(savedInstanceState)
|
||||
Log.d(TAG, "高德地图onCreateView")
|
||||
CallerLogger.d("$M_MAP$TAG", "高德地图onCreateView")
|
||||
}
|
||||
|
||||
fun onResume() {
|
||||
mMapView?.onResume()
|
||||
isMapDestroyed = false
|
||||
Log.d(TAG, "高德地图onResume")
|
||||
CallerLogger.d("$M_MAP$TAG", "高德地图onResume")
|
||||
}
|
||||
|
||||
fun onPause() {
|
||||
mMapView?.onPause()
|
||||
Log.d(TAG, "高德地图onPause")
|
||||
CallerLogger.d("$M_MAP$TAG", "高德地图onPause")
|
||||
}
|
||||
|
||||
fun onDestroy() {
|
||||
mMapView?.onDestroy()
|
||||
mAMap?.clear()
|
||||
mAMap = null
|
||||
isMapDestroyed = true
|
||||
Log.d(TAG, "高德地图页面已销毁!")
|
||||
CallerLogger.d("$M_MAP$TAG", "高德地图页面已销毁!")
|
||||
}
|
||||
// =================必须通知高德地图生命周期的变化=================
|
||||
|
||||
@@ -350,7 +353,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
* 清除所有Marker和Polyline
|
||||
*/
|
||||
fun clearAllMarkersAndPolyline() {
|
||||
Log.d(TAG, "clearAllMarkersAndPolyline")
|
||||
CallerLogger.d("$M_MAP$TAG", "clearAllMarkersAndPolyline")
|
||||
nonFrequentHandler?.removeCallbacksAndMessages(null)
|
||||
travelNetWorkModel.cancelAllRequest()
|
||||
reqData = null
|
||||
@@ -469,7 +472,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
private fun initTravelRealityMapView(isInit: Boolean = false) {
|
||||
Log.d(TAG, "initAMapView")
|
||||
CallerLogger.d("$M_MAP$TAG", "initAMapView")
|
||||
mAMap = mMapView?.map
|
||||
val mapStyleOptions = CustomMapStyleOptions()
|
||||
if (!mapStylePath.isNullOrEmpty() && !mapStyleExtraPath.isNullOrEmpty()) {
|
||||
@@ -511,7 +514,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
}
|
||||
if (isInit) {
|
||||
mAMap?.setOnMapLoadedListener {
|
||||
Log.d(TAG, "地图加载完成!")
|
||||
CallerLogger.d("$M_MAP$TAG", "地图加载完成!")
|
||||
isMapLoaded = true
|
||||
mAMap?.setCustomMapStyle(mapStyleOptions)
|
||||
// 实时路况图层关闭,必须添加在loaded结束之后,其他位置不生效
|
||||
@@ -569,13 +572,13 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
override fun onVisibilityChanged(changedView: View, visibility: Int) {
|
||||
super.onVisibilityChanged(changedView, visibility)
|
||||
if (visibility == VISIBLE) {
|
||||
Log.d(TAG, "onVisibilityChanged:VISIBLE!")
|
||||
CallerLogger.d("$M_MAP$TAG", "onVisibilityChanged:VISIBLE!")
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
Log.d(TAG, "onAttachedToWindow")
|
||||
CallerLogger.d("$M_MAP$TAG", "onAttachedToWindow")
|
||||
initHandlers()
|
||||
advanceRequest()
|
||||
CallerPlanningRottingListenerManager.addListener("${TAG}${this.hashCode()}", this)
|
||||
@@ -586,7 +589,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
Log.d(TAG, "onDetachedFromWindow")
|
||||
CallerLogger.d("$M_MAP$TAG", "onDetachedFromWindow")
|
||||
deviceList = null
|
||||
retryCount = 0
|
||||
// 注册定位监听
|
||||
@@ -606,10 +609,10 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
|
||||
private fun advanceRequest() {
|
||||
isRoadTrackReq = true
|
||||
Log.d(TAG, "请求获取智慧道路轨迹!")
|
||||
CallerLogger.d("$M_MAP$TAG", "请求获取智慧道路轨迹!")
|
||||
// 获取智慧道路轨迹
|
||||
travelNetWorkModel.getCityRoadTrack(onSuccess = {
|
||||
Log.d(TAG, "Road track result is:$it")
|
||||
CallerLogger.d("$M_MAP$TAG", "Road track result is:$it")
|
||||
roadTrackList = it
|
||||
isRoadTrackReq = false
|
||||
// 司机屏默认显示小地图的渲染,乘客屏默认显示行程总览地图的渲染
|
||||
@@ -618,7 +621,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
}
|
||||
}, onError = {
|
||||
isRoadTrackReq = false
|
||||
Log.d(TAG, "Road track error is:$it")
|
||||
CallerLogger.d("$M_MAP$TAG", "Road track error is:$it")
|
||||
})
|
||||
}
|
||||
|
||||
@@ -670,7 +673,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
globalData[0].lat,
|
||||
globalData[0].lon
|
||||
)
|
||||
Log.w(TAG, "起终点距离为:$distance")
|
||||
CallerLogger.w("$M_MAP$TAG", "起终点距离为:$distance")
|
||||
// if (distance < 2000) {
|
||||
// roadRange = maxRoadRange
|
||||
// roadWidth = minRoadWidth
|
||||
@@ -706,7 +709,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
private fun handleRoadEvent(eventList: List<EventBean>, globalList: ArrayList<Point>) {
|
||||
if (globalList.isNullOrEmpty()) return
|
||||
if (globalList.isEmpty()) return
|
||||
testTime = System.currentTimeMillis()
|
||||
if (eventList.isEmpty()) {
|
||||
listener?.onDraw(emptyList(), true)
|
||||
@@ -717,8 +720,8 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
} else {
|
||||
val eventDrawMap = HashMap<String, EventDrawBean>()
|
||||
val eventOptionsList = ArrayList<MarkerOptions>()
|
||||
var distance = 0.0
|
||||
var key = ""
|
||||
var distance: Double
|
||||
var key: String
|
||||
val roadEvents = ArrayList<EventBean>()
|
||||
val eventPointMap = HashMap<String, Int>()
|
||||
globalList.forEachIndexed { index, globalPoint ->
|
||||
@@ -734,8 +737,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
)
|
||||
key = "${eventBean.lon},${eventBean.lat}"
|
||||
if (distance >= 10 || eventPointMap.contains(key)) {
|
||||
Log.d(
|
||||
TAG,
|
||||
CallerLogger.d("$M_MAP$TAG",
|
||||
"道路事件:点(${key})到线段${index}-${index + 1}的距离为:${distance}米"
|
||||
)
|
||||
return@forEach
|
||||
@@ -750,7 +752,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
listener?.onDraw(eventDrawMap.values.toList(), true)
|
||||
Log.d(TAG, "过滤掉的事件个数为:${eventList.size - eventOptionsList.size}")
|
||||
CallerLogger.d("$M_MAP$TAG", "过滤掉的事件个数为:${eventList.size - eventOptionsList.size}")
|
||||
// 事件不足3个则用路口设备补齐
|
||||
completeQuantity(roadEvents)
|
||||
// 绘制道路事件
|
||||
@@ -761,7 +763,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
private fun completeQuantity(roadEvents: ArrayList<EventBean>) {
|
||||
val ipPointEntityMap = HashMap<String, MutableList<VideoMarkerEntity>>()
|
||||
// 全部展示事件,事件数不足则用路口设备补齐
|
||||
Log.d(TAG, "已绘制的道路事件个数为:${roadEvents.size}")
|
||||
CallerLogger.d("$M_MAP$TAG", "已绘制的道路事件个数为:${roadEvents.size}")
|
||||
if (roadEvents.size >= 3) {
|
||||
roadEvents[0].let {
|
||||
it.ip?.also { ip ->
|
||||
@@ -894,7 +896,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
else -> {
|
||||
Log.d(TAG, "请求到未知事件!")
|
||||
CallerLogger.d("$M_MAP$TAG", "请求到未知事件!")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -908,11 +910,11 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
ipPointEntityMap: HashMap<String, MutableList<VideoMarkerEntity>>,
|
||||
eventSize: Int
|
||||
) {
|
||||
Log.d(TAG, "retryGetCrossDevice")
|
||||
CallerLogger.d("$M_MAP$TAG", "retryGetCrossDevice")
|
||||
val crossDeviceListTmp = deviceInPathList
|
||||
while (crossDeviceListTmp.isNullOrEmpty()) {
|
||||
if (retryCount >= 5) {
|
||||
Log.d(TAG, "尝试多次后仍无法获取到路口设备数据!")
|
||||
CallerLogger.d("$M_MAP$TAG", "尝试多次后仍无法获取到路口设备数据!")
|
||||
break
|
||||
}
|
||||
Thread.sleep(250)
|
||||
@@ -920,12 +922,12 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
}
|
||||
var maxSize = 3 - eventSize
|
||||
if (maxSize <= 0) {
|
||||
Log.d(TAG, "全息路口个数计算有误则返回!")
|
||||
CallerLogger.d("$M_MAP$TAG", "全息路口个数计算有误则返回!")
|
||||
return
|
||||
}
|
||||
Log.d(TAG, "待查询缩略图的事件个数为:${eventSize}")
|
||||
CallerLogger.d("$M_MAP$TAG", "待查询缩略图的事件个数为:${eventSize}")
|
||||
if (!crossDeviceListTmp.isNullOrEmpty()) {
|
||||
Log.d(TAG, "缓存的全息路口个数为:${crossDeviceListTmp.size}")
|
||||
CallerLogger.d("$M_MAP$TAG", "缓存的全息路口个数为:${crossDeviceListTmp.size}")
|
||||
// 轨迹线附近的路口设备取几个进行卡片展示
|
||||
crossDeviceListTmp.forEach { deviceInfoBean ->
|
||||
if (maxSize > 0) {
|
||||
@@ -1005,12 +1007,12 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
ipPointEntityMap: HashMap<String, MutableList<VideoMarkerEntity>>
|
||||
) {
|
||||
val ipList = ipPointEntityMap.keys.toMutableList()
|
||||
Log.d(TAG, "请求获取缩略图,个数为:${ipList.size}!")
|
||||
CallerLogger.d("$M_MAP$TAG", "请求获取缩略图,个数为:${ipList.size}!")
|
||||
if (ipList.isEmpty()) {
|
||||
return
|
||||
}
|
||||
travelNetWorkModel.batchRequestCrossLive(ipList, onSuccess = {
|
||||
Log.d(TAG, "Cross live result is:$it")
|
||||
CallerLogger.d("$M_MAP$TAG", "Cross live result is:$it")
|
||||
val liveOptionsList = ArrayList<MarkerOptions>()
|
||||
var markerOption: MarkerOptions
|
||||
var pair: Pair<Float, Float>
|
||||
@@ -1043,18 +1045,18 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
ipPointEntityMap[ip]!!
|
||||
)
|
||||
} else {
|
||||
Log.d(TAG, "缓存中未查到对应ip!!")
|
||||
CallerLogger.d("$M_MAP$TAG", "缓存中未查到对应ip!!")
|
||||
return@let
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Log.d(TAG, "绘制卡片的个数为:${liveOptionsList.size}")
|
||||
CallerLogger.d("$M_MAP$TAG", "绘制卡片的个数为:${liveOptionsList.size}")
|
||||
// 绘制事件卡片
|
||||
drawMarkers(DRAW_LIVE_DETAIL, liveOptionsList)
|
||||
adjustCameraWithVertex(vertexList)
|
||||
}, onError = {
|
||||
Log.d(TAG, "Cross live error is:$it")
|
||||
CallerLogger.d("$M_MAP$TAG", "Cross live error is:$it")
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1082,8 +1084,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
)
|
||||
key = "${deviceBean.lon},${deviceBean.lat}"
|
||||
if (distance >= 10 || devicePointMap.contains(key)) {
|
||||
Log.d(
|
||||
TAG,
|
||||
CallerLogger.d("$M_MAP$TAG",
|
||||
"路口设备:点(${key})到线段${index}-${index + 1}的距离为:${distance}米"
|
||||
)
|
||||
return@loop
|
||||
@@ -1128,7 +1129,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
)
|
||||
}
|
||||
deviceInPathList = deviceInPaths
|
||||
Log.d(TAG, "待绘制的全息路口的个数为:${crossOptionsList.size}")
|
||||
CallerLogger.d("$M_MAP$TAG", "待绘制的全息路口的个数为:${crossOptionsList.size}")
|
||||
// 绘制路口设备
|
||||
drawMarkers(DRAW_CROSS_DEVICE, crossOptionsList)
|
||||
}
|
||||
@@ -1164,7 +1165,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
val globalOptionList = ArrayList<PolylineOptions>()
|
||||
val globalIndexSet = HashSet<Int>()
|
||||
if (globalList.isNullOrEmpty()) {// 无轨迹时以道路中心线为中轴画给定宽度的纹理
|
||||
Log.d(TAG, "无轨迹点,绘制全局智慧道路!")
|
||||
CallerLogger.d("$M_MAP$TAG", "无轨迹点,绘制全局智慧道路!")
|
||||
val boundsBuilder = LatLngBounds.Builder()
|
||||
var latLngTmp: LatLng
|
||||
roadTrajectoryList.forEach { trajectoryList ->
|
||||
@@ -1198,7 +1199,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
)
|
||||
moveMapCamera(cameraUpdate)
|
||||
} else {
|
||||
Log.d(TAG, "有轨迹点,绘制局部智慧道路!")
|
||||
CallerLogger.d("$M_MAP$TAG", "有轨迹点,绘制局部智慧道路!")
|
||||
roadTrajectoryList.forEach { trajectoryList ->
|
||||
var distanceTmp: Double
|
||||
// var lastIndex = -1
|
||||
@@ -1234,7 +1235,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
)
|
||||
// 如果距离小于50m则认为在智慧道路内
|
||||
if (distanceTmp < 50) {
|
||||
Log.d(TAG, "智慧道路内点索引为:$i")
|
||||
CallerLogger.d("$M_MAP$TAG", "智慧道路内点索引为:$i")
|
||||
globalIndexSet.add(i)
|
||||
}
|
||||
}
|
||||
@@ -1246,7 +1247,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
var polylineOptionTmp: PolylineOptions? = null
|
||||
globalList.forEachIndexed { index, point ->
|
||||
if (!globalIndexSet.contains(index)) return@forEachIndexed
|
||||
Log.w(TAG, "智慧道路内点索引为:$index")
|
||||
CallerLogger.w("$M_MAP$TAG", "智慧道路内点索引为:$index")
|
||||
if (lastIndex < 0 || index - lastIndex > 1) {
|
||||
globalOptionList.add(PolylineOptions().also {
|
||||
optionTmp = it
|
||||
@@ -1414,7 +1415,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
} else {
|
||||
lastTime = System.currentTimeMillis()
|
||||
}
|
||||
Log.d(TAG, "下发全局轨迹!")
|
||||
CallerLogger.d("$M_MAP$TAG", "下发全局轨迹!")
|
||||
globalPathResp?.let { globalPath ->
|
||||
if (isSmallMap) {
|
||||
if (globalPath.wayPointsList.size > 0) {
|
||||
@@ -1428,13 +1429,13 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
pointList.add(Point(loc.longitude, loc.latitude))
|
||||
pointCloneList.add(Point(loc.longitude, loc.latitude))
|
||||
}
|
||||
Log.d(TAG, "轨迹点个数为:${pointList.size}")
|
||||
CallerLogger.d("$M_MAP$TAG", "轨迹点个数为:${pointList.size}")
|
||||
reqData = pointCloneList
|
||||
handleGlobalPath(pointList)
|
||||
|
||||
requestData(pointList)
|
||||
if (!isRoadTrackReq) {
|
||||
Log.d(TAG, "处理智慧道路轨迹!")
|
||||
CallerLogger.d("$M_MAP$TAG", "处理智慧道路轨迹!")
|
||||
handleRoadTrajectories(roadTrackList, pointList)
|
||||
}
|
||||
}
|
||||
@@ -1620,21 +1621,21 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
|
||||
private fun requestData(pointList: ArrayList<Point>) {
|
||||
if (!isCrossDeviceReq) {
|
||||
Log.d(TAG, "请求获取路口设备!")
|
||||
CallerLogger.d("$M_MAP$TAG", "请求获取路口设备!")
|
||||
isCrossDeviceReq = true
|
||||
// 获取路口设备
|
||||
travelNetWorkModel.getCrossDevice(onSuccess = {
|
||||
Log.d(TAG, "Cross device result is:$it")
|
||||
CallerLogger.d("$M_MAP$TAG", "Cross device result is:$it")
|
||||
isCrossDeviceReq = false
|
||||
deviceList = it
|
||||
handleCrossDevices(it, pointList)
|
||||
}, onError = {
|
||||
isCrossDeviceReq = false
|
||||
Log.d(TAG, "Cross device error is:$it")
|
||||
CallerLogger.d("$M_MAP$TAG", "Cross device error is:$it")
|
||||
})
|
||||
}
|
||||
if (!isRoadEventReq) {
|
||||
Log.d(TAG, "请求获取道路事件!")
|
||||
CallerLogger.d("$M_MAP$TAG", "请求获取道路事件!")
|
||||
// 获取道路事件
|
||||
var cityCode = CallerMapUIServiceManager.getCityCode() ?: "0734"
|
||||
if (cityCode.isEmpty()) {
|
||||
@@ -1646,13 +1647,13 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
onSuccess = {
|
||||
isRoadEventReq = false
|
||||
retryCount = 0
|
||||
Log.d(TAG, "Events result is:$it")
|
||||
CallerLogger.d("$M_MAP$TAG", "Events result is:$it")
|
||||
handleRoadEvent(it, pointList)
|
||||
},
|
||||
onError = {
|
||||
isRoadEventReq = false
|
||||
retryCount = 0
|
||||
Log.d(TAG, "Events error is:$it")
|
||||
CallerLogger.d("$M_MAP$TAG", "Events error is:$it")
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1666,7 +1667,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
if (mAMap != null && mAMap!!.projection != null) {
|
||||
var latLng: LatLng?
|
||||
// 经纬度转屏幕坐标
|
||||
var point = mAMap!!.projection!!.toScreenLocation(position)
|
||||
val point = mAMap!!.projection!!.toScreenLocation(position)
|
||||
point?.let {
|
||||
travelNetWorkModel.calculateVertex(context, orientation, it).forEach { screenP ->
|
||||
// 每个顶点屏幕坐标转高德坐标
|
||||
@@ -1817,7 +1818,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
Log.e(TAG, "概览页面渲染异常为:${e.message}")
|
||||
CallerLogger.e("$M_MAP$TAG", "概览页面渲染异常为:${e.message}")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1859,7 +1860,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
private fun realDrawGlobalPath(polylineOptions: PolylineOptions) {
|
||||
Log.d(TAG, "realDrawGlobalPath")
|
||||
CallerLogger.d("$M_MAP$TAG", "realDrawGlobalPath")
|
||||
if (globalPolyline == null) {
|
||||
globalPolyline = mAMap?.addPolyline(polylineOptions)
|
||||
} else {
|
||||
@@ -1868,7 +1869,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
private fun realDrawEventMarkers(eventOptionList: ArrayList<MarkerOptions>) {
|
||||
Log.d(TAG, "realDrawEventMarkers")
|
||||
CallerLogger.d("$M_MAP$TAG", "realDrawEventMarkers")
|
||||
eventMarkerList.forEach {
|
||||
it.destroy()
|
||||
}
|
||||
@@ -1881,11 +1882,11 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
it.isClickable = false
|
||||
}
|
||||
}
|
||||
Log.d(TAG, "计算到绘制事件耗时为:${System.currentTimeMillis() - testTime}")
|
||||
CallerLogger.d("$M_MAP$TAG", "计算到绘制事件耗时为:${System.currentTimeMillis() - testTime}")
|
||||
}
|
||||
|
||||
private fun realClearEventMarkers() {
|
||||
Log.d(TAG, "realClearEventMarkers")
|
||||
CallerLogger.d("$M_MAP$TAG", "realClearEventMarkers")
|
||||
eventMarkerList.forEach {
|
||||
it.destroy()
|
||||
}
|
||||
@@ -1893,7 +1894,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
private fun realDrawCrossDeviceMarkers(eventMarkerList: ArrayList<MarkerOptions>) {
|
||||
Log.d(TAG, "realDrawCrossDeviceMarkers")
|
||||
CallerLogger.d("$M_MAP$TAG", "realDrawCrossDeviceMarkers")
|
||||
deviceMarkerList.forEach {
|
||||
it.destroy()
|
||||
}
|
||||
@@ -1907,7 +1908,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
private fun realClearCrossDeviceMarkers() {
|
||||
Log.d(TAG, "realClearCrossDeviceMarkers")
|
||||
CallerLogger.d("$M_MAP$TAG", "realClearCrossDeviceMarkers")
|
||||
deviceMarkerList.forEach {
|
||||
it.destroy()
|
||||
}
|
||||
@@ -1918,7 +1919,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
* 绘制在智慧道路范围内的轨迹
|
||||
*/
|
||||
private fun realDrawGlobalTrajectory(polylineOptionsList: ArrayList<PolylineOptions>) {
|
||||
Log.d(TAG, "realDrawGlobalTrajectory")
|
||||
CallerLogger.d("$M_MAP$TAG", "realDrawGlobalTrajectory")
|
||||
if (globalPolylineList.isNotEmpty() && globalPolylineList.size != polylineOptionsList.size) {
|
||||
globalPolylineList.forEach {
|
||||
it.remove()
|
||||
@@ -1948,7 +1949,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
* 绘制智慧道路范围(和全局轨迹匹配过的)
|
||||
*/
|
||||
private fun realDrawRoadTrajectory(polylineOptionsList: ArrayList<PolylineOptions>) {
|
||||
Log.d(TAG, "realDrawRoadTrajectory")
|
||||
CallerLogger.d("$M_MAP$TAG", "realDrawRoadTrajectory")
|
||||
if (trajectoryPolylineList.isNotEmpty() && trajectoryPolylineList.size != polylineOptionsList.size) {
|
||||
trajectoryPolylineList.forEach {
|
||||
it.remove()
|
||||
@@ -1975,7 +1976,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
private fun realDrawLiveMarkers(liveOptionList: ArrayList<MarkerOptions>) {
|
||||
Log.d(TAG, "realDrawLiveMarkers")
|
||||
CallerLogger.d("$M_MAP$TAG", "realDrawLiveMarkers")
|
||||
liveMarkerList.forEach {
|
||||
it.destroy()
|
||||
}
|
||||
@@ -1990,7 +1991,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
private fun realClearLiveMarkers() {
|
||||
Log.d(TAG, "realClearLiveMarkers")
|
||||
CallerLogger.d("$M_MAP$TAG", "realClearLiveMarkers")
|
||||
liveMarkerList.forEach {
|
||||
it.destroy()
|
||||
}
|
||||
@@ -1998,7 +1999,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
private fun realUpdateVideoMarker(options: List<MarkerOptions>) {
|
||||
Log.d(TAG, "realUpdateVideoMarker")
|
||||
CallerLogger.d("$M_MAP$TAG", "realUpdateVideoMarker")
|
||||
liveMarkerList.forEach { liveMarker ->
|
||||
options.forEach {
|
||||
if (it.position == liveMarker.position) {
|
||||
@@ -2010,7 +2011,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
private fun realDrawEndMarker(options: List<MarkerOptions>) {
|
||||
Log.d(TAG, "realDrawEndMarker")
|
||||
CallerLogger.d("$M_MAP$TAG", "realDrawEndMarker")
|
||||
mStartMarker?.destroy()
|
||||
mStartMarker = null
|
||||
mEndMarker?.destroy()
|
||||
@@ -2035,7 +2036,7 @@ class TravelRealityView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
private fun realClearAllMarkersAndPolyline() {
|
||||
Log.d(TAG, "realClearAllMarkersAndPolyline")
|
||||
CallerLogger.d("$M_MAP$TAG", "realClearAllMarkersAndPolyline")
|
||||
// 清除终点
|
||||
mStartMarker?.destroy()
|
||||
mStartMarker = null
|
||||
|
||||
Reference in New Issue
Block a user