Merge branch 'dev_robotaxi-d-app-module_2110_220915_2.11.0' into dev_robotaxi-d-app-module_2120_yyk_2.12.0
This commit is contained in:
@@ -153,27 +153,6 @@ class MoGoAutopilotProvider :
|
||||
}
|
||||
}, MoGoAiCloudClientConfig.getInstance().sn)
|
||||
} else {
|
||||
msgHandler.setListener(object : EventListener {
|
||||
override fun connectDevice(isSupportMulti: Boolean) {
|
||||
if (!isInit) {
|
||||
isInit = true
|
||||
UiThreadHandler.post {
|
||||
if (isSupportMulti) {
|
||||
// 直连工控机
|
||||
directConnect()
|
||||
} else {
|
||||
val options = AdasOptions
|
||||
.Builder()
|
||||
.setClient(true)
|
||||
.build()
|
||||
AdasManager.getInstance()
|
||||
.create(options, MoGoAdasMsgConnectStatusListenerImpl())
|
||||
listenDeviceData()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
NSDNettyManager.getInstance()
|
||||
.searchAndConnectServer(context, MoGoAiCloudClientConfig.getInstance().sn,
|
||||
AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode),
|
||||
@@ -196,6 +175,36 @@ class MoGoAutopilotProvider :
|
||||
}
|
||||
})
|
||||
}
|
||||
msgHandler.setListener(object : EventListener {
|
||||
override fun connectDevice(isSupportMulti: Boolean) {
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
if (!isInit) {
|
||||
isInit = true
|
||||
// 转发工控机数据给乘客屏
|
||||
listenDeviceData()
|
||||
}
|
||||
} else {
|
||||
if (!isInit) {
|
||||
isInit = true
|
||||
UiThreadHandler.post {
|
||||
if (isSupportMulti) {
|
||||
// 直连工控机
|
||||
directConnect()
|
||||
} else {
|
||||
val options = AdasOptions
|
||||
.Builder()
|
||||
.setClient(true)
|
||||
.build()
|
||||
AdasManager.getInstance()
|
||||
.create(options, MoGoAdasMsgConnectStatusListenerImpl())
|
||||
// 接收司机屏发过来的感知、定位等数据
|
||||
listenDeviceData()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
CallerAutopilotCarConfigListenerManager.addListener(TAG, this)
|
||||
CallerLogger.i("$M_ADAS_IMPL$TAG", "initServer……")
|
||||
// 同步数据给工控机的服务
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.mogo.eagle.core.function.autopilot.adapter
|
||||
|
||||
import android.location.Location
|
||||
import android.util.Log
|
||||
import chassis.VehicleStateOuterClass
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
@@ -37,6 +35,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.invokeAutopilotGuardian
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.invokeAutopilotSNRequest
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.invokeAutopilotStatusRespByQuery
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotActionsListenerManager.invokeAutopilotAbility
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager.invokeAutopilotCarConfigData
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarStatusListenerManager.invokeAutopilotCarStateData
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
|
||||
@@ -51,7 +50,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.map.navi.MogoCarLocationChangedListenerRegister
|
||||
import com.zhidao.support.adas.high.AdasManager
|
||||
import com.zhidao.support.adas.high.OnAdasListener
|
||||
import com.zhidao.support.adas.high.bean.AutopilotAbility
|
||||
@@ -444,5 +442,6 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
* 使用方法查看:app_ipc_monitoring/uiMainActivity/onAutopilotAbility
|
||||
*/
|
||||
override fun onAutopilotAbility(ability: AutopilotAbility?) {
|
||||
invokeAutopilotAbility(ability)
|
||||
}
|
||||
}
|
||||
@@ -118,7 +118,10 @@ class TeleMsgHandler : IMsgHandler {
|
||||
"1" -> true
|
||||
else -> false
|
||||
}
|
||||
Logger.d("Route", "TeleMsgHandler -> handleMsgFromServer ==> isDemoMode:" + FunctionBuildConfig.isDemoMode + ",isIgnore:" + FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData)
|
||||
Logger.d(
|
||||
"Route",
|
||||
"TeleMsgHandler -> handleMsgFromServer ==> isDemoMode:" + FunctionBuildConfig.isDemoMode + ",isIgnore:" + FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData
|
||||
)
|
||||
timestamp = currTime
|
||||
invokeNettyConnResult("乘客屏收到的美化模式isIgnore为:${FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData}")
|
||||
} else {
|
||||
@@ -139,6 +142,7 @@ class TeleMsgHandler : IMsgHandler {
|
||||
MogoProtocolMsg.REQ_MAC_ADDRESS -> {
|
||||
val carConfig = AdasManager.getInstance().carConfig
|
||||
if (carConfig != null) {
|
||||
listener?.connectDevice(!carConfig.dockVersion.contains("2.3.0"))
|
||||
val configArray = carConfig.toByteArray()
|
||||
|
||||
NSDNettyManager.getInstance().sendMsgToSpecifiedClient(
|
||||
|
||||
@@ -1304,7 +1304,13 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
/**
|
||||
* 升级app弹框
|
||||
*/
|
||||
override fun showUpgradeDialog(name: String, url: String, title: String, content: String, installType: String) {
|
||||
override fun showUpgradeDialog(
|
||||
name: String,
|
||||
url: String,
|
||||
title: String,
|
||||
content: String,
|
||||
installType: String
|
||||
) {
|
||||
if (upgradeAppDialog == null) {
|
||||
upgradeAppDialog = UpgradeAppDialog(requireContext())
|
||||
}
|
||||
@@ -1379,6 +1385,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
* 工控机监控节点上报
|
||||
*/
|
||||
override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {
|
||||
Log.d("EmArrow-1013", "onAutopilotGuardian : $guardianInfo , takeOver : $takeOver")
|
||||
ThreadUtils.runOnUiThread {
|
||||
guardianInfo?.let {
|
||||
if (reportList.size > 49) {
|
||||
@@ -1404,8 +1411,11 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
EXIT_AUTOPILOT_FOR_LOCATION,
|
||||
EXIT_AUTOPILOT_FOR_CHASSIS,
|
||||
EXIT_AUTOPILOT_FOR_DISTANCE -> {
|
||||
if (FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData
|
||||
&& getAutoPilotStatusInfo().state != STATUS_AUTOPILOT_RUNNING) {
|
||||
Log.d(
|
||||
"EmArrow-1013",
|
||||
"it code : ${it.code} , state : ${getAutoPilotStatusInfo().state}"
|
||||
)
|
||||
if (getAutoPilotStatusInfo().state != STATUS_AUTOPILOT_RUNNING) {
|
||||
showWarningV2X(
|
||||
EventTypeEnum.TAKE_OVER_EVENT.poiType,
|
||||
EventTypeEnum.TAKE_OVER_EVENT.content,
|
||||
@@ -1413,11 +1423,13 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
EventTypeEnum.TAKE_OVER_EVENT.poiType,
|
||||
object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {
|
||||
Log.d("EmArrow-1013", "onShow")
|
||||
takeOver = true
|
||||
clTakeOverView.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
override fun onDismiss() {
|
||||
Log.d("EmArrow-1013", "onDismiss")
|
||||
takeOver = false
|
||||
clTakeOverView.visibility = View.GONE
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ import com.mogo.eagle.core.data.obu.ObuStatusInfo
|
||||
import com.mogo.eagle.core.data.report.ReportEntity
|
||||
import com.mogo.eagle.core.data.upgrade.UpgradeVersionEntity
|
||||
import com.mogo.eagle.core.function.api.autopilot.*
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener.Companion
|
||||
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsFuncConfigListener
|
||||
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
|
||||
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener
|
||||
@@ -578,8 +579,6 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
FunctionBuildConfig.isDemoMode = isChecked
|
||||
tbIsDrawAutopilotTrajectoryData.isEnabled = !isChecked
|
||||
Logger.d("Route", "DebugSettingView -> initView ==> isDemoMode:" + FunctionBuildConfig.isDemoMode + ",isIgnore: $isChecked" )
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = isChecked
|
||||
if (!FunctionBuildConfig.isDemoMode) {
|
||||
tbIsDrawAutopilotTrajectoryData.isChecked = false
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import android.content.res.TypedArray
|
||||
import android.graphics.*
|
||||
import android.util.AttributeSet
|
||||
import android.util.DisplayMetrics
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.view.animation.LinearInterpolator
|
||||
import android.view.animation.OvershootInterpolator
|
||||
@@ -81,7 +80,6 @@ class CircularProgressView @JvmOverloads constructor(
|
||||
mRectF = RectF(mRectL.toFloat(), mRectT.toFloat(), (mRectL + mRectLength).toFloat(),
|
||||
(mRectT + mRectLength).toFloat())
|
||||
|
||||
Log.d(TAG, "onMeasure:" + mRectF.toString() + "," + "width:" + measuredWidth.toString() + "," + "PaddingLeft:" + getPaddingLeft().toString())
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,7 +105,6 @@ class CircularProgressView @JvmOverloads constructor(
|
||||
|
||||
override fun onDraw(canvas: Canvas?) {
|
||||
super.onDraw(canvas)
|
||||
Log.d(TAG, "onDraw")
|
||||
canvas?.let {
|
||||
mRectF?.let { it1 -> it.drawArc(it1, 0.0f, 360.0f, false, mBackPaint) }
|
||||
mRectF?.let { it1 ->
|
||||
@@ -154,7 +151,6 @@ class CircularProgressView @JvmOverloads constructor(
|
||||
val animator = ValueAnimator.ofInt(mProgress, progress)
|
||||
animator.addUpdateListener {
|
||||
mProgress = it.animatedValue as Int
|
||||
Log.d(TAG, "setProgress" + mProgress.toString())
|
||||
invalidate()
|
||||
}
|
||||
animator.interpolator = LinearInterpolator()
|
||||
|
||||
@@ -6,10 +6,9 @@ import android.view.*
|
||||
import android.widget.*
|
||||
import com.mogo.commons.*
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.R.drawable
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.*
|
||||
import com.mogo.map.*
|
||||
import com.mogo.map.uicontroller.*
|
||||
import com.mogo.map.uicontroller.VisualAngleMode.MODE_MEDIUM_SIGHT
|
||||
import com.mogo.module.common.constants.*
|
||||
import kotlinx.android.synthetic.main.view_perspective_switch.view.*
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.mogo.eagle.core.function.hmi.ui.widget;
|
||||
import android.content.Context;
|
||||
import android.graphics.BlurMaskFilter;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.animation.RotateAnimation;
|
||||
@@ -54,12 +53,10 @@ public class SteeringWheelView extends ConstraintLayout {
|
||||
|
||||
public SteeringWheelView(@NonNull Context context) {
|
||||
super(context);
|
||||
Log.d(TAG, "1");
|
||||
}
|
||||
|
||||
public SteeringWheelView(@NonNull Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
Log.d(TAG, "2");
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel_bus, this);
|
||||
} else {
|
||||
@@ -94,12 +91,10 @@ public class SteeringWheelView extends ConstraintLayout {
|
||||
|
||||
public SteeringWheelView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
Log.d(TAG, "3");
|
||||
}
|
||||
|
||||
public SteeringWheelView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
Log.d(TAG, "4");
|
||||
}
|
||||
|
||||
private final IMoGoAutopilotStatusListener mGoAutopilotStatusListener = new IMoGoAutopilotStatusListener() {
|
||||
@@ -127,7 +122,6 @@ public class SteeringWheelView extends ConstraintLayout {
|
||||
int state = autopilotStatusInfo.getState();
|
||||
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "state = %s", state);
|
||||
if (autopilotIV != null) {
|
||||
Log.d(TAG, "autopilotIV != null");
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
// TODO
|
||||
@@ -151,7 +145,7 @@ public class SteeringWheelView extends ConstraintLayout {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log.d(TAG, "autopilotIV=null");
|
||||
CallerLogger.INSTANCE.d(TAG, "autopilotIV=null");
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -192,7 +186,6 @@ public class SteeringWheelView extends ConstraintLayout {
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotLightSwitchData(@org.jetbrains.annotations.Nullable Chassis.LightSwitch lightSwitch) {
|
||||
Log.d(TAG, "车辆转向灯:" + lightSwitch.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -201,7 +194,6 @@ public class SteeringWheelView extends ConstraintLayout {
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotBrakeLightData(boolean brakeLight) {
|
||||
Log.d(TAG, "刹车灯:" + String.valueOf(brakeLight));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -219,7 +211,6 @@ public class SteeringWheelView extends ConstraintLayout {
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotSteeringData(float steering) {
|
||||
Log.d(TAG, "steering原始值====" + String.valueOf(steering));
|
||||
if (Math.abs(steering) < 1) {
|
||||
steering = 0;
|
||||
}
|
||||
@@ -227,7 +218,6 @@ public class SteeringWheelView extends ConstraintLayout {
|
||||
ThreadUtils.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Log.d(TAG, "steering忽略小数点后====" + String.valueOf((int) steeringValue));
|
||||
if (steeringTVL != null && steeringValue > 0) {
|
||||
steeringTVR.setVisibility(View.INVISIBLE);
|
||||
steeringTVL.setVisibility(View.VISIBLE);
|
||||
@@ -237,7 +227,7 @@ public class SteeringWheelView extends ConstraintLayout {
|
||||
steeringTVR.setVisibility(View.VISIBLE);
|
||||
steeringTVR.setText(String.valueOf((int) -steeringValue) + "°");
|
||||
} else {
|
||||
Log.d(TAG, "onAutopilotSteeringData error");
|
||||
CallerLogger.INSTANCE.d(TAG, "onAutopilotSteeringData error");
|
||||
}
|
||||
animationWithSteeringData(-steeringValue);
|
||||
if (steeringCircularV != null) {
|
||||
@@ -260,7 +250,7 @@ public class SteeringWheelView extends ConstraintLayout {
|
||||
ThreadUtils.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Log.d(TAG, "乘客屏档位" + gear.toString());
|
||||
CallerLogger.INSTANCE.d(TAG, "乘客屏档位" + gear.toString());
|
||||
if (tapPositionView != null) {
|
||||
tapPositionView.updateWithGear(gear);
|
||||
}
|
||||
@@ -288,7 +278,6 @@ public class SteeringWheelView extends ConstraintLayout {
|
||||
* @param steering
|
||||
*/
|
||||
private void animationWithSteeringData(float steering) {
|
||||
Log.d(TAG, "方向盘转动" + String.valueOf(steering));
|
||||
rotateAnimation = new RotateAnimation(fromDegrees, steering,
|
||||
RotateAnimation.RELATIVE_TO_SELF, 0.5f,
|
||||
RotateAnimation.RELATIVE_TO_SELF, 0.5f);
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.RelativeLayout
|
||||
@@ -53,7 +52,6 @@ class V2XWarningView @JvmOverloads constructor(
|
||||
* @param closeTime 倒计时
|
||||
*/
|
||||
fun showWarning(direction: WarningDirectionEnum, closeTime: Long) {
|
||||
Log.d(TAG, "预警红边:预警方向->$direction 预警倒计时->$closeTime")
|
||||
UiThreadHandler.post {
|
||||
// 如果传入的不是关闭显示,则设置倒计时,定时关闭红框警示
|
||||
if (direction != ALERT_WARNING_NON) {
|
||||
|
||||
@@ -26,8 +26,8 @@ import com.kwai.koom.base.MonitorManager;
|
||||
import com.kwai.koom.nativeoom.leakmonitor.LeakMonitor;
|
||||
import com.kwai.koom.nativeoom.leakmonitor.LeakMonitorConfig;
|
||||
import com.kwai.koom.nativeoom.leakmonitor.LeakRecord;
|
||||
import com.mogo.cloud.commons.BuildConfig;
|
||||
import com.mogo.commons.context.ContextHolderUtil;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.mvp.BaseFragment;
|
||||
import com.mogo.commons.mvp.MvpActivity;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
@@ -217,7 +217,7 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
*/
|
||||
public void startUpInStage2() {
|
||||
StartupConfig config = null;
|
||||
if (BuildConfig.DEBUG) {
|
||||
if (DebugConfig.isDebug()) {
|
||||
config = new StartupConfig.Builder()
|
||||
.setLoggerLevel(LoggerLevel.DEBUG)
|
||||
.setOpenStatistics(true)
|
||||
@@ -283,8 +283,10 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
|
||||
// 启动一些基本的服务:定位等
|
||||
startBaseService();
|
||||
// 启动Native内存泄漏监测
|
||||
startLeakMonitor();
|
||||
if (DebugConfig.isDebug()) {
|
||||
// 启动Native内存泄漏监测
|
||||
startLeakMonitor();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -305,12 +307,10 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
.setMonitorThreshold(16)
|
||||
.setNativeHeapAllocatedThreshold(0)
|
||||
.setSelectedSoList(new String[]{"libhdmap", "libmap",
|
||||
"libAMapSDK_NAVI_v8_0_1", "librouting", "libZegoExpressEngine",
|
||||
"libUtils", "libcommon", "libcntts", "libduiutils",
|
||||
"libdatamgr", "libdatascript", "libguidance", "libndsprovider",
|
||||
"libndssqlite", "libpbjni", "libsearch"
|
||||
"libAMapSDK_NAVI_v8_0_1", "libZegoExpressEngine",
|
||||
"libcntts"
|
||||
})
|
||||
.setEnableLocalSymbolic(BuildConfig.DEBUG)
|
||||
.setEnableLocalSymbolic(DebugConfig.isDebug())
|
||||
.setLeakListener(leaks -> {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
if (!leaks.isEmpty()) {
|
||||
|
||||
@@ -4,20 +4,16 @@ import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Process;
|
||||
import android.util.Log;
|
||||
|
||||
import com.bytedance.boost_multidex.BoostMultiDex;
|
||||
import com.elegant.utils.UiThreadHandler;
|
||||
import com.kwai.koom.base.DefaultInitTask;
|
||||
import com.mogo.cloud.socket.SocketBuildConfig;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.constants.MoGoConfig;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.eagle.core.function.api.chat.biz.ChatConsts;
|
||||
import com.mogo.eagle.core.function.autopilot.adapter.MoGoHandAdasMsgManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
|
||||
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager;
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.notice.PushUIConstants;
|
||||
@@ -31,7 +27,6 @@ import com.mogo.map.MapApiPath;
|
||||
import com.mogo.module.common.MogoModule;
|
||||
import com.mogo.module.common.MogoModulePaths;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.zhidao.support.adas.high.AdasManager;
|
||||
import com.zhidao.support.obu.ami.AmiClientManager;
|
||||
import com.zhjt.mogo_core_function_devatools.monitor.db.CpuInfo;
|
||||
import com.zhjt.mogo_core_function_devatools.monitor.db.MemInfo;
|
||||
@@ -62,8 +57,9 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
initLogConfig();
|
||||
initTipToast();
|
||||
initModules();
|
||||
|
||||
initKoom();
|
||||
if (DebugConfig.isDebug()) {
|
||||
initKoom();
|
||||
}
|
||||
//查询是否有版本的更新
|
||||
queryAppUpgrade();
|
||||
checkMonitorDb();
|
||||
|
||||
@@ -35,6 +35,7 @@ import com.amap.api.maps.model.PolylineOptions;
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
|
||||
@@ -54,6 +55,8 @@ import java.util.List;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
/**
|
||||
* 小地图的方向View
|
||||
*
|
||||
|
||||
@@ -1,93 +1,77 @@
|
||||
package com.mogo.eagle.core.function.v2x.events
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.content.*
|
||||
import android.os.*
|
||||
import android.provider.Settings.System
|
||||
import android.util.*
|
||||
import androidx.core.util.Pair
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
||||
import androidx.localbroadcastmanager.content.*
|
||||
import com.mogo.cloud.commons.utils.*
|
||||
import com.mogo.cloud.passport.IMoGoTokenCallback
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.commons.network.ParamsUtil
|
||||
import com.mogo.cloud.passport.*
|
||||
import com.mogo.commons.network.*
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_V2N
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_CLOUD_SHOW
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CLOUD_V2N
|
||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
|
||||
import com.mogo.eagle.core.data.enums.*
|
||||
import com.mogo.eagle.core.data.map.*
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
|
||||
import com.mogo.eagle.core.data.traffic.*
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.*
|
||||
import com.mogo.eagle.core.function.api.map.listener.*
|
||||
import com.mogo.eagle.core.function.call.hmi.*
|
||||
import com.mogo.eagle.core.function.call.map.*
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Default
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.TooClose
|
||||
import com.mogo.eagle.core.function.v2x.events.alarm.V2XAlarmServer
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi
|
||||
import com.mogo.eagle.core.function.v2x.events.alarm.*
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.*
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi.context
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst.BROADCAST_SCENE_EXTRA_KEY
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst.BROADCAST_SCENE_HANDLER_ACTION
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst.MODULE_NAME
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst.V2X_ACC_OFF_TIME_STR
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst.V2X_STRATEGY_PUSH
|
||||
import com.mogo.eagle.core.function.v2x.events.entity.net.V2XSeekHelpRes
|
||||
import com.mogo.eagle.core.function.v2x.events.entity.net.V2XStrategyPushRes
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.V2XStatusManager
|
||||
import com.mogo.eagle.core.function.v2x.events.network.V2XRefreshCallback
|
||||
import com.mogo.eagle.core.function.v2x.events.observer.V2XOptimalRouteObserver
|
||||
import com.mogo.eagle.core.function.v2x.events.receiver.SceneBroadcastReceiver
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.impl.V2XScenarioManager
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.*
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst.*
|
||||
import com.mogo.eagle.core.function.v2x.events.entity.net.*
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.*
|
||||
import com.mogo.eagle.core.function.v2x.events.network.*
|
||||
import com.mogo.eagle.core.function.v2x.events.observer.*
|
||||
import com.mogo.eagle.core.function.v2x.events.receiver.*
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.impl.*
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.*
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.AiRoadMarker.Marker
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.scene.road.*
|
||||
import com.mogo.eagle.core.function.v2x.events.utils.*
|
||||
import com.mogo.eagle.core.function.v2x.events.voice.V2XVoiceManager
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.function.v2x.events.utils.MapUtils
|
||||
import com.mogo.eagle.core.function.v2x.events.voice.*
|
||||
import com.mogo.eagle.core.network.utils.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.*
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.Utils
|
||||
import com.mogo.map.listener.IMogoMapListener
|
||||
import com.mogo.map.marker.IMogoMarker
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener
|
||||
import com.mogo.module.common.ModuleNames
|
||||
import com.mogo.module.common.drawer.TrafficMarkerDrawer
|
||||
import com.mogo.map.listener.*
|
||||
import com.mogo.map.marker.*
|
||||
import com.mogo.module.common.*
|
||||
import com.mogo.module.common.drawer.*
|
||||
import com.mogo.module.common.entity.*
|
||||
import com.mogo.module.common.entity.V2XMessageEntity.V2XTypeEnum
|
||||
import com.mogo.module.common.enums.EventTypeEnum
|
||||
import com.mogo.module.common.enums.EventTypeHelper
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener
|
||||
import com.mogo.service.statusmanager.StatusDescriptor
|
||||
import com.mogo.module.common.enums.*
|
||||
import com.mogo.service.statusmanager.*
|
||||
import com.mogo.service.statusmanager.StatusDescriptor.ACC_STATUS
|
||||
import com.mogo.service.statusmanager.StatusDescriptor.SEEK_HELPING
|
||||
import com.mogo.v2x.V2XManager
|
||||
import com.mogo.v2x.callback.IV2XCallback
|
||||
import com.mogo.v2x.config.V2XConfig
|
||||
import com.mogo.v2x.*
|
||||
import com.mogo.v2x.callback.*
|
||||
import com.mogo.v2x.config.*
|
||||
import com.mogo.v2x.data.*
|
||||
import com.mogo.v2x.event.V2XEvent
|
||||
import com.shuyu.gsyvideoplayer.GSYVideoManager
|
||||
import com.shuyu.gsyvideoplayer.cache.CacheFactory
|
||||
import com.shuyu.gsyvideoplayer.cache.ProxyCacheManager
|
||||
import com.shuyu.gsyvideoplayer.model.VideoOptionModel
|
||||
import com.shuyu.gsyvideoplayer.player.IjkPlayerManager
|
||||
import com.shuyu.gsyvideoplayer.player.PlayerFactory
|
||||
import com.shuyu.gsyvideoplayer.utils.GSYVideoType
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import com.zhjt.service.chain.TracingConstants
|
||||
import com.mogo.v2x.event.*
|
||||
import com.shuyu.gsyvideoplayer.*
|
||||
import com.shuyu.gsyvideoplayer.cache.*
|
||||
import com.shuyu.gsyvideoplayer.model.*
|
||||
import com.shuyu.gsyvideoplayer.player.*
|
||||
import com.shuyu.gsyvideoplayer.utils.*
|
||||
import com.zhjt.service.chain.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.android.asCoroutineDispatcher
|
||||
import kotlinx.coroutines.android.*
|
||||
import roadwork.Road.RW_PB
|
||||
import tv.danmaku.ijk.media.player.IjkMediaPlayer
|
||||
import java.util.concurrent.TimeUnit
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
import tv.danmaku.ijk.media.player.*
|
||||
import java.util.concurrent.*
|
||||
import java.util.concurrent.atomic.*
|
||||
|
||||
|
||||
object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallback,
|
||||
@@ -345,6 +329,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
|
||||
|
||||
private fun refreshCarState(location: MogoLocation) {
|
||||
V2XStatusManager.getInstance().location = location
|
||||
// V2XAiRoadEventMarker.onLocationChanged(location)
|
||||
// 只有车速大于 5 的时候进行计算
|
||||
if (location.speed < 5) return
|
||||
val v2xPolyline = BridgeApi.v2xPolyline()?.mogoPolyline
|
||||
@@ -476,6 +461,15 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
|
||||
|
||||
private val RW_PB.toRoadMarker: V2XMarkerCardResult
|
||||
get() = V2XMarkerCardResult().also { l1 ->
|
||||
this.roadwork?.polygonList?.takeIf { it.isNotEmpty() }?.also { old ->
|
||||
l1.extras = HashMap<String, List<Pair<Double, Double>>>().also { extra ->
|
||||
extra["polygon"] = old.map { d ->
|
||||
Pair(d.lon, d.lat)
|
||||
}
|
||||
|
||||
extra["gps_location"] = listOf(Pair(this.roadwork?.center?.point?.lon ?: 0.0, this.roadwork?.center?.point?.lat ?: 0.0))
|
||||
}
|
||||
}
|
||||
l1.exploreWay = ArrayList<V2XMarkerExploreWay>().also { l2 ->
|
||||
l2.add(V2XMarkerExploreWay().also { l3 ->
|
||||
l3.poiType = this.roadwork?.poiType?.toString()
|
||||
@@ -484,23 +478,22 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
|
||||
val p = CoordinateUtils.transformWgsToGcj(this.roadwork?.center?.point?.lat ?: 0.0, this.roadwork?.center?.point?.lon ?: 0.0)
|
||||
l4.lon = p[0]
|
||||
l4.lat = p[1]
|
||||
AiRoadMarker.enqueue(Marker(this.roadwork?.center?.point?.lat ?: 0.0, this.roadwork?.center?.point?.lon ?: 0.0, this.roadwork?.center?.road?.bearing?.toDouble() ?: 0.0, this.roadwork?.polygonList?.takeIf { it.isNotEmpty() }?.map { d ->
|
||||
android.util.Pair(d.lon, d.lat)
|
||||
}))
|
||||
l4.angle = this.roadwork?.center?.road?.bearing?.toDouble() ?: 0.0
|
||||
}
|
||||
})
|
||||
}
|
||||
this.roadwork?.polygonList?.takeIf { it.isNotEmpty() }?.also { old ->
|
||||
l1.extras = HashMap<String, List<Pair<Double, Double>>>().also { extra ->
|
||||
extra["polygon"] = old.map { d ->
|
||||
val p = CoordinateUtils.transformWgsToGcj(d.lat, d.lon)
|
||||
Pair(p[0], p[1])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// private fun buildRoadEntity(e: V2XMarkerExploreWay, extra: Map<String, Any>? = null): V2XRoadEventEntity { // 记录道路事件
|
||||
// val v2XRoadEventEntity = V2XRoadEventEntity()
|
||||
// v2XRoadEventEntity.location = e.location.toMarkerLocation() // 探路目前只有上报拥堵
|
||||
// v2XRoadEventEntity.poiType = EventTypeEnum.AI_ROAD_WORK.poiType
|
||||
// v2XRoadEventEntity.noveltyInfo = e.toMarkExploreWay(extra)
|
||||
// v2XRoadEventEntity.expireTime = 20000
|
||||
// return v2XRoadEventEntity
|
||||
// }
|
||||
|
||||
private fun handleWarningTargetEvent(data: V2XWarningTarget) {
|
||||
val v2xMessageEntity = V2XMessageEntity<V2XWarningTarget>()
|
||||
v2xMessageEntity.type = V2XTypeEnum.ALERT_THE_FRONT_WEAKNESS
|
||||
|
||||
@@ -79,4 +79,8 @@ public interface IMoGoV2XMarkerManager extends IProvider {
|
||||
void clearALLPOI();
|
||||
|
||||
|
||||
/**
|
||||
* 强制清除道路事件POI
|
||||
*/
|
||||
void forceClearAlarmPOI();
|
||||
}
|
||||
|
||||
@@ -148,8 +148,9 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
|
||||
V2XRoadEventEntity v2XRoadEventEntity = new V2XRoadEventEntity();
|
||||
v2XRoadEventEntity.setLocation(EntityUtilsKt.toMarkerLocation(markerLocation));
|
||||
// 探路目前只有上报拥堵
|
||||
v2XRoadEventEntity.setPoiType(markerExploreWay.getPoiType());
|
||||
String poi = markerExploreWay.getPoiType();
|
||||
|
||||
v2XRoadEventEntity.setPoiType(poi);
|
||||
v2XRoadEventEntity.setNoveltyInfo(EntityUtilsKt.toMarkExploreWay(markerExploreWay,markerCardResult.getExtras()));
|
||||
v2XRoadEventEntity.setExpireTime(20000);
|
||||
mV2XRoadEventEntityArrayList.add(v2XRoadEventEntity);
|
||||
@@ -319,6 +320,13 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forceClearAlarmPOI() {
|
||||
if (mAlarmInfoMarker != null) {
|
||||
mAlarmInfoMarker.remove();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ package com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad
|
||||
import android.animation.*
|
||||
import android.content.*
|
||||
import android.graphics.*
|
||||
import android.util.*
|
||||
import android.view.animation.*
|
||||
import androidx.core.util.Pair
|
||||
import androidx.lifecycle.*
|
||||
import androidx.lifecycle.Lifecycle.Event
|
||||
import androidx.lifecycle.Lifecycle.Event.ON_CREATE
|
||||
@@ -14,10 +14,12 @@ import com.mogo.eagle.core.data.map.MapRoadInfo.StopLine
|
||||
import com.mogo.eagle.core.function.api.map.listener.*
|
||||
import com.mogo.eagle.core.function.call.map.*
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager.OnRoadListener
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.scene.road.*
|
||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.*
|
||||
import com.mogo.map.*
|
||||
import com.mogo.map.overlay.*
|
||||
import com.mogo.module.common.entity.*
|
||||
import com.mogo.module.common.utils.*
|
||||
import io.netty.util.internal.*
|
||||
import java.util.*
|
||||
@@ -45,7 +47,7 @@ object AiRoadMarker {
|
||||
private val line by lazy { AtomicReference<IMogoPolyline>() }
|
||||
|
||||
private val START_COLOR = Color.parseColor("#002ABAD9")
|
||||
private val END_COLOR = Color.parseColor("#FFFF7A30")
|
||||
private val END_COLOR = Color.parseColor("#66FF7A30")
|
||||
|
||||
private val markers = ConcurrentSet<Marker>()
|
||||
|
||||
@@ -91,7 +93,7 @@ object AiRoadMarker {
|
||||
Logger.d(TAG, "--- consumer --- 3 ---: isTrigger => $isTrigger")
|
||||
if (isTrigger) {
|
||||
marker.set(top)
|
||||
marker(top)
|
||||
marker(top, true)
|
||||
} else {
|
||||
synchronized(markers) {
|
||||
markers.remove(top)
|
||||
@@ -138,7 +140,6 @@ object AiRoadMarker {
|
||||
|
||||
private val onLocationListener = object : IMoGoMapLocationListener {
|
||||
|
||||
|
||||
override fun onLocationChanged(location: MogoLocation?, from: Int, isGps: Boolean) {
|
||||
if (location == null || !isGps) {
|
||||
return
|
||||
@@ -170,7 +171,6 @@ object AiRoadMarker {
|
||||
removeLine()
|
||||
}
|
||||
|
||||
|
||||
fun enqueue(marker: Marker) {
|
||||
Logger.d(TAG, "--- enqueue --- 1 ---")
|
||||
if (markers.contains(marker)) {
|
||||
@@ -187,7 +187,7 @@ object AiRoadMarker {
|
||||
}
|
||||
}
|
||||
|
||||
private fun marker(marker: Marker) {
|
||||
fun marker(marker: Marker, drawMarker: Boolean) {
|
||||
val location = carLocation.get() ?: return
|
||||
//施工中心点前方的自车行驶方向上300米距离
|
||||
val l1 = MogoMap.getInstance().mogoMap.getCenterLineRangeInfo(marker.poi_lon, marker.poi_lat, location.third.toFloat(), 300f)
|
||||
@@ -239,6 +239,9 @@ object AiRoadMarker {
|
||||
return
|
||||
}
|
||||
removeLine()
|
||||
if (drawMarker) {
|
||||
marker.entity?.apply { V2XAiRoadEventMarker.drawMarkers(this) }
|
||||
}
|
||||
val evaluator = ArgbEvaluator()
|
||||
val interceptor = DecelerateInterpolator(1.5f)
|
||||
val total = points.size
|
||||
@@ -273,9 +276,38 @@ object AiRoadMarker {
|
||||
}
|
||||
}
|
||||
|
||||
private fun unMarker(marker: Marker) {
|
||||
fun unMarker(marker: Marker) {
|
||||
Logger.d(TAG, "--- unMarker ---")
|
||||
markers -= marker
|
||||
removeLine()
|
||||
V2XAiRoadEventMarker.removeMarkers(null)
|
||||
}
|
||||
|
||||
fun clear() {
|
||||
hideLine()
|
||||
// V2XAiRoadEventMarker.removeMarkers(null)
|
||||
}
|
||||
|
||||
fun restore() {
|
||||
showLine()
|
||||
val marker = marker.get()
|
||||
if (marker != null) {
|
||||
marker(marker, false)
|
||||
}
|
||||
}
|
||||
|
||||
private fun hideLine() {
|
||||
val old = line.get()
|
||||
if (old != null && !old.isDestroyed) {
|
||||
old.isVisible = false
|
||||
}
|
||||
}
|
||||
|
||||
private fun showLine() {
|
||||
val old = line.get()
|
||||
if (old != null && !old.isDestroyed) {
|
||||
old.isVisible = true
|
||||
}
|
||||
}
|
||||
|
||||
private fun isOutOfRange(markerLon: Double, markerLat: Double, carLon: Double, carLat: Double, carAngle: Double): Boolean {
|
||||
@@ -291,8 +323,9 @@ object AiRoadMarker {
|
||||
val poi_lat: Double,
|
||||
val poi_lon: Double,
|
||||
val poi_angle: Double,
|
||||
val polygon: List<Pair<Double, Double>>?,
|
||||
var farthestPoint: Pair<Double, Double>? = null
|
||||
val polygon: List<androidx.core.util.Pair<Double, Double>>?,
|
||||
var farthestPoint: androidx.core.util.Pair<Double, Double>? = null,
|
||||
var entity: V2XRoadEventEntity? = null
|
||||
) {
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
|
||||
@@ -0,0 +1,143 @@
|
||||
package com.mogo.eagle.core.function.v2x.events.scenario.scene.road
|
||||
|
||||
import android.util.*
|
||||
import com.mogo.cloud.commons.utils.*
|
||||
import com.mogo.eagle.core.data.map.*
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi.context
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi.v2xMarker
|
||||
import com.mogo.map.*
|
||||
import com.mogo.map.R.raw
|
||||
import com.mogo.map.marker.*
|
||||
import com.mogo.map.overlay.*
|
||||
import com.mogo.module.common.entity.*
|
||||
import com.mogo.module.common.utils.*
|
||||
import java.util.*
|
||||
import java.util.concurrent.atomic.*
|
||||
import kotlin.Pair
|
||||
|
||||
object V2XAiRoadEventMarker {
|
||||
|
||||
private val current = AtomicReference<Pair<IMogoPolyline?, List<IMogoMarker>?>>()
|
||||
|
||||
private val v2xLocation = AtomicReference<MogoLocation>()
|
||||
|
||||
private val carLocation = AtomicReference<MogoLocation>()
|
||||
|
||||
private val timer = Timer()
|
||||
|
||||
private val timerTask by lazy { AtomicReference<TimerTask>() }
|
||||
|
||||
private val distance = AtomicInteger(0)
|
||||
|
||||
fun drawMarkers(entity: V2XRoadEventEntity): Pair<IMogoPolyline?, List<IMogoMarker>?>? {
|
||||
removeMarkers(current.get())
|
||||
timerTask.get()?.cancel()
|
||||
val extra = entity.noveltyInfo.extras.get("polygon");
|
||||
if (extra is List<*>) {
|
||||
val l = extra
|
||||
if (l.size > 0) {
|
||||
val polygons: MutableList<androidx.core.util.Pair<Double, Double>> = ArrayList()
|
||||
for (i in l.indices) {
|
||||
val o = l[i]!! as? androidx.core.util.Pair<*, *> ?: continue
|
||||
val p = o
|
||||
val first = p.first
|
||||
val second = p.second
|
||||
if (first == null || second == null) {
|
||||
continue
|
||||
}
|
||||
if (first !is Double || second !is Double) {
|
||||
continue
|
||||
}
|
||||
val xx = CoordinateUtils.transformWgsToGcj(second, first)
|
||||
polygons.add(androidx.core.util.Pair.create(xx[0], xx[1]))
|
||||
}
|
||||
if (polygons.size > 0) {
|
||||
val markers = ArrayList<IMogoMarker>(polygons.size)
|
||||
for (i in polygons.indices) {
|
||||
val p = polygons[i]
|
||||
val options = MogoMarkerOptions().data(entity).latitude(p.second).longitude(p.first)
|
||||
options.anchor(0.5f, 0.5f)
|
||||
options.icon3DRes(raw.sanjiaozhui)
|
||||
try {
|
||||
val marker = MogoMarkerManager.getInstance(context()).addMarker("road_pyramid_" + entity.getPoiType(), options)
|
||||
markers += marker
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
}
|
||||
if (markers.size > 0) {
|
||||
v2xMarker()?.drawableAlarmPOI(context(), entity, null)
|
||||
val l2 = entity.noveltyInfo?.location ?: return null
|
||||
v2xLocation.set(MogoLocation().also { it.longitude = l2.lon; it.latitude = l2.lat; it.bearing = l2.angle.toFloat() })
|
||||
current.set(Pair(null, markers))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return current.get()
|
||||
}
|
||||
|
||||
fun removeMarkers(pair: Pair<IMogoPolyline?, List<IMogoMarker>?>?) {
|
||||
if (pair != null) {
|
||||
realRemove(pair)
|
||||
} else {
|
||||
val prev = current.get()
|
||||
if (prev != null) {
|
||||
realRemove(prev)
|
||||
val v2xMarker = v2xMarker()
|
||||
v2xMarker?.also {
|
||||
it.forceClearAlarmPOI()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun realRemove(pair: Pair<IMogoPolyline?, List<IMogoMarker>?>) {
|
||||
val line = pair.first
|
||||
if (line != null && line.isVisible) {
|
||||
line.remove()
|
||||
}
|
||||
val markers = pair.second
|
||||
if (markers != null && markers.isNotEmpty()) {
|
||||
for (m in markers) {
|
||||
m.remove()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun onLocationChanged(location: MogoLocation) {
|
||||
val markerLocation = v2xLocation.get()
|
||||
carLocation.set(location)
|
||||
if (markerLocation != null) {
|
||||
if (isOutOfRange(markerLocation.longitude, markerLocation.latitude, location.longitude, location.latitude, location.bearing.toDouble())) {
|
||||
v2xLocation.set(null)
|
||||
this.distance.set(0)
|
||||
timer.schedule(object : TimerTask() {
|
||||
override fun run() {
|
||||
val carLocation = this@V2XAiRoadEventMarker.carLocation.get()
|
||||
Log.d("XXXXX", "timer do action ---: marker_lon: ${markerLocation.longitude}, marker_lat: ${markerLocation.latitude}, car_lon:${carLocation.longitude}, car_lat: ${carLocation.latitude}")
|
||||
checkDistanceIsValid(markerLocation.longitude, markerLocation.latitude, carLocation)
|
||||
}
|
||||
}.also { this.timerTask.set(it) }, 1000, 1000)
|
||||
}
|
||||
}
|
||||
}
|
||||
private fun checkDistanceIsValid(x1: Double, y1: Double, location: MogoLocation) {
|
||||
val distance = DrivingDirectionUtils.distance(x1, y1, location.longitude, location.latitude)
|
||||
Log.d("XXXXX", "distance: $distance")
|
||||
if (this.distance.addAndGet(distance.toInt()) >= 100) {
|
||||
Log.d("XXXXX", "remove marker")
|
||||
removeMarkers(null)
|
||||
this.timerTask.get()?.cancel()
|
||||
}
|
||||
}
|
||||
|
||||
private fun isOutOfRange(markerLon: Double, markerLat: Double, carLon: Double, carLat: Double, carAngle: Double): Boolean {
|
||||
return !isFrontOfCar(markerLon, markerLat, carLon, carLat, carAngle)
|
||||
}
|
||||
|
||||
private fun isFrontOfCar(markerLon: Double, markerLat: Double, carLon: Double, carLat: Double, carAngle: Double): Boolean {
|
||||
val degree = DrivingDirectionUtils.getDegreeOfCar2Poi2(carLon, carLat, markerLon, markerLat, carAngle)
|
||||
return degree < 90
|
||||
}
|
||||
}
|
||||
@@ -1,26 +1,21 @@
|
||||
package com.mogo.eagle.core.function.v2x.events.scenario.scene.road;
|
||||
|
||||
import android.graphics.Color;
|
||||
|
||||
import androidx.core.util.Pair;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.function.v2x.R;
|
||||
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XMarkerManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XPolylineManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XStatusManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.AiRoadMarker;
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker;
|
||||
import com.mogo.map.MogoMarkerManager;
|
||||
import com.mogo.map.MogoOverlayManager;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.overlay.IMogoOverlayManager;
|
||||
import com.mogo.map.overlay.IMogoPolyline;
|
||||
import com.mogo.map.overlay.MogoPolylineOptions;
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.MarkerLocation;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.common.enums.EventTypeEnum;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 道路V2X事件的Marker
|
||||
@@ -28,11 +23,7 @@ import java.util.List;
|
||||
public class V2XRoadEventMarker implements IV2XMarker<V2XRoadEventEntity> {
|
||||
|
||||
|
||||
private final List<IMogoMarker> pyramids = new ArrayList<>();
|
||||
|
||||
private IMogoPolyline polyline;
|
||||
|
||||
private IMogoOverlayManager overlayManager;
|
||||
private AiRoadMarker.Marker mMarker;
|
||||
|
||||
@Override
|
||||
public void drawPOI(V2XRoadEventEntity entity) {
|
||||
@@ -42,57 +33,59 @@ public class V2XRoadEventMarker implements IV2XMarker<V2XRoadEventEntity> {
|
||||
if (marker != null) {
|
||||
marker.clearAlarmPOI();
|
||||
if (entity != null) {
|
||||
marker.drawableAlarmPOI(BridgeApi.INSTANCE.context(), entity, null);
|
||||
MarkerExploreWay noveltyInfo = entity.getNoveltyInfo();
|
||||
if (noveltyInfo != null && noveltyInfo.extras != null && noveltyInfo.extras.containsKey("polygon")) {
|
||||
Object extra = noveltyInfo.extras.get("polygon");
|
||||
if (pyramids.size() > 0) {
|
||||
for (IMogoMarker m : pyramids) {
|
||||
m.remove();
|
||||
}
|
||||
pyramids.clear();
|
||||
if (!Objects.equals(entity.getPoiType(), EventTypeEnum.AI_ROAD_WORK.getPoiType())) {
|
||||
AiRoadMarker.Marker prev = mMarker;
|
||||
if (prev != null) {
|
||||
AiRoadMarker.INSTANCE.unMarker(prev);
|
||||
mMarker = null;
|
||||
}
|
||||
if (polyline != null && polyline.isVisible()) {
|
||||
polyline.remove();
|
||||
marker.drawableAlarmPOI(BridgeApi.INSTANCE.context(), entity, null);
|
||||
} else {
|
||||
AiRoadMarker.Marker prev = mMarker;
|
||||
if (prev != null) {
|
||||
AiRoadMarker.INSTANCE.unMarker(prev);
|
||||
mMarker = null;
|
||||
}
|
||||
if (extra instanceof List) {
|
||||
List l = (List) extra;
|
||||
if (l.size() > 0) {
|
||||
List<Pair<Double, Double>> polygons = new ArrayList<>();
|
||||
for (int i = 0; i < l.size(); i++) {
|
||||
Object o = l.get(i);
|
||||
if (!(o instanceof Pair)) {
|
||||
continue;
|
||||
}
|
||||
Pair p = (Pair) o;
|
||||
Object first = p.first;
|
||||
Object second = p.second;
|
||||
if (first == null || second == null) {
|
||||
continue;
|
||||
}
|
||||
if (!(first instanceof Double) || !(second instanceof Double)) {
|
||||
continue;
|
||||
}
|
||||
polygons.add(Pair.create((Double) first, (Double) second));
|
||||
}
|
||||
|
||||
if (polygons.size() > 0) {
|
||||
for (int i = 0; i < polygons.size(); i++) {
|
||||
Pair<Double, Double> p = polygons.get(i);
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.data(entity)
|
||||
.latitude(p.second)
|
||||
.longitude(p.first);
|
||||
options.anchor(0.5f, 0.5f);
|
||||
options.icon3DRes(R.raw.sanjiaozhui);
|
||||
try {
|
||||
pyramids.add(MogoMarkerManager.getInstance(BridgeApi.INSTANCE.context()).addMarker("road_pyramid_" + entity.getPoiType(), options));
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
MarkerExploreWay noveltyInfo = entity.getNoveltyInfo();
|
||||
if (noveltyInfo != null && noveltyInfo.extras != null) {
|
||||
List<Pair<Double, Double>> polygons = new ArrayList<>();
|
||||
Pair<Double, Double> gpsLocation = null;
|
||||
if (noveltyInfo.extras.containsKey("polygon")) {
|
||||
Object extra = noveltyInfo.extras.get("polygon");
|
||||
if (extra instanceof List) {
|
||||
List l = (List) extra;
|
||||
if (l.size() > 0) {
|
||||
for (int i = 0; i < l.size(); i++) {
|
||||
Object o = l.get(i);
|
||||
if (!(o instanceof Pair)) {
|
||||
continue;
|
||||
}
|
||||
Pair p = (Pair) o;
|
||||
Object first = p.first;
|
||||
Object second = p.second;
|
||||
if (first == null || second == null) {
|
||||
continue;
|
||||
}
|
||||
if (!(first instanceof Double) || !(second instanceof Double)) {
|
||||
continue;
|
||||
}
|
||||
polygons.add(Pair.create((Double) first, (Double) second));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (noveltyInfo.extras.containsKey("gps_location")) {
|
||||
gpsLocation = (Pair<Double, Double>) ((List)(noveltyInfo.extras.get("gps_location"))).get(0);
|
||||
}
|
||||
|
||||
if (!polygons.isEmpty() && gpsLocation != null) {
|
||||
MarkerLocation location = noveltyInfo.getLocation();
|
||||
AiRoadMarker.Marker m = new AiRoadMarker.Marker(gpsLocation.second, gpsLocation.first, location.getAngle(), polygons, null, entity);
|
||||
mMarker = m;
|
||||
AiRoadMarker.INSTANCE.marker(m, true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -109,19 +102,6 @@ public class V2XRoadEventMarker implements IV2XMarker<V2XRoadEventEntity> {
|
||||
if (polyLineManager != null) {
|
||||
polyLineManager.clearLine();
|
||||
}
|
||||
|
||||
IMoGoV2XStatusManager v2xStatus = BridgeApi.INSTANCE.v2xStatus();
|
||||
if (v2xStatus != null && v2xStatus.isRoadEventPOIShow()) {
|
||||
if (polyline != null) {
|
||||
polyline.remove();
|
||||
}
|
||||
if (pyramids.size() > 0) {
|
||||
for (IMogoMarker marker : pyramids) {
|
||||
marker.remove();
|
||||
}
|
||||
pyramids.clear();
|
||||
}
|
||||
}
|
||||
IMoGoV2XMarkerManager v2xMarker = BridgeApi.INSTANCE.v2xMarker();
|
||||
if (v2xMarker != null) {
|
||||
// 移除事件POI
|
||||
|
||||
@@ -120,7 +120,8 @@ class TrafficLightNetWorkModel {
|
||||
}
|
||||
loader {
|
||||
apiCall {
|
||||
getNetWorkApi().changeLight(map)
|
||||
MoGoRetrofitFactory.getInstanceNoCallAdapter("http://dzt-qa-city.zhidaozhixing.com")
|
||||
.create(TrafficLightApiService::class.java).changeLight(map)
|
||||
}
|
||||
}
|
||||
onSuccess {
|
||||
|
||||
Reference in New Issue
Block a user