diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java index ad9e8b5b50..5471b06c29 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java @@ -27,6 +27,7 @@ import com.mogo.commons.mvp.IView; import com.mogo.commons.mvp.MvpFragment; import com.mogo.commons.mvp.Presenter; import com.mogo.commons.voice.AIAssist; +import com.mogo.eagle.core.data.config.FunctionBuildConfig; import com.mogo.eagle.core.data.config.HmiBuildConfig; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; @@ -34,8 +35,9 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager; import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager; import com.mogo.eagle.core.function.call.hmi.CallerHmiManager; +import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager; +import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager; import com.mogo.eagle.core.function.hmi.ui.widget.TrafficDataView; -import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.AiRoadMarker; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.util.ToastUtils; import com.mogo.eagle.core.utilcode.util.UiThreadHandler; @@ -56,6 +58,8 @@ import com.mogo.och.common.module.utils.SoundPoolHelper; import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.ThreadMode; +import java.util.Objects; + import mogo.telematics.pad.MessagePad; import record_cache.RecordPanelOuterClass; @@ -137,20 +141,22 @@ public abstract class BaseBusTabFragment @Override public void onClickImpl(View v) { //切换地图的远近视图 - if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isLongSight()) { - // 2.11.0去掉 -// MogoMarkerManager.getInstance(AbsMogoApplication.getApp()).visibleAllMarkers(); + if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isLongSight() + || MogoMapUIController.getInstance().getCurrentMapVisualAngle().isRoma()) { + CallerVisualAngleManager.INSTANCE.updateLongSightLevel(false); + Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(true); MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null); mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium); } else if (MogoMapUIController.getInstance().getCurrentMapVisualAngle().isMediumSight()) { - // 2.11.0去掉 -// MogoMarkerManager.getInstance(AbsMogoApplication.getApp()) -// .inVisibleWithoutMarkers(DataTypes.TYPE_MARKER_ADAS, BusConst.TYPE_MARKER_BUS_ORDER); - MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null); + CallerVisualAngleManager.INSTANCE.updateLongSightLevel(true); + if (FunctionBuildConfig.isRomaMode) { + MogoMapUIController.getInstance().setRomaMode(1); + } else { + Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false); + MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null); + } mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long); } else { - // 2.11.0去掉 -// MogoMarkerManager.getInstance(AbsMogoApplication.getApp()).visibleAllMarkers(); MogoMapUIController.getInstance().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null); mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium); } diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/model/BusOrderModel.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/model/BusOrderModel.java index 148aa350ca..5116a5d4d2 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/model/BusOrderModel.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/model/BusOrderModel.java @@ -32,6 +32,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager; import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager; +import com.mogo.eagle.core.function.call.map.CallerSmpManager; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.util.NetworkUtils; import com.mogo.eagle.core.utilcode.util.ToastUtils; @@ -520,6 +521,8 @@ public class BusOrderModel { stationList, arrivingOrArrivedStationIndex, false); } updateAutopilotControlParameters(); + + CallerSmpManager.startQueryV2XEvents(); //选择路线后开启 } } diff --git a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerModel.java b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerModel.java index 32bdacd61d..aa06fd8dae 100644 --- a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerModel.java +++ b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerModel.java @@ -4,6 +4,7 @@ import android.content.Context; import android.content.Intent; import android.net.ConnectivityManager; import android.os.Looper; +import android.util.Log; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -26,11 +27,13 @@ import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener; 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.api.msgbox.IMsgBoxEventListener; import com.mogo.eagle.core.function.api.v2x.LimitingVelocityListener; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager; import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager; +import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager; import com.mogo.eagle.core.function.call.v2x.CallLimitingVelocityListenerManager; import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; @@ -63,6 +66,7 @@ import com.mogo.och.taxi.passenger.callback.ITaxiPassengerVeloctityCallback; import com.mogo.och.taxi.passenger.constant.TaxiPassengerConst; import com.mogo.och.taxi.passenger.constant.TaxiPassengerOrderStatusEnum; import com.mogo.och.taxi.passenger.network.TaxiPassengerServiceManager; +import com.mogo.och.taxi.passenger.ui.leftmenu.OverlayLeftViewUtils; import com.mogo.och.taxi.passenger.utils.TaxiPassengerAnalyticsManager; import org.jetbrains.annotations.NotNull; @@ -248,6 +252,8 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback //开启自驾后 异常信息返回 OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(mAdasStartFailureListener); + + CallerMsgBoxEventListenerManager.INSTANCE.addListener(TAG,iMsgBoxEventListener); } private void releaseListeners() { @@ -266,6 +272,8 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback AbnormalFactorsLoopManager.INSTANCE.stopLoopAbnormalFactors(); OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(null); + + CallerMsgBoxEventListenerManager.INSTANCE.removeListener(iMsgBoxEventListener); } /** @@ -602,6 +610,17 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback } }; + private final IMsgBoxEventListener iMsgBoxEventListener = new IMsgBoxEventListener() { + @Override + public void onSummaryClickEvent() { + if (mCurrentOCHOrder == null){ + ToastUtils.showLong("行程已结束"); + }else { + OverlayLeftViewUtils.INSTANCE.transmissionIndexGet(OverlayLeftViewUtils.OVERVIEW); + } + } + }; + public void startToRouteAndWipe(List models) { List locationsModels = CoordinateCalculateRouteUtil .coordinateConverterWgsToGcjLocations(mContext,models); diff --git a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/presenter/BaseTaxiPassengerPresenter.java b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/presenter/BaseTaxiPassengerPresenter.java index 8876dbf5fe..5eebed8920 100644 --- a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/presenter/BaseTaxiPassengerPresenter.java +++ b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/presenter/BaseTaxiPassengerPresenter.java @@ -198,7 +198,6 @@ public class BaseTaxiPassengerPresenter extends Presenter(new TaxiPassengerArrivedView(getContext())); mArrivedEndView.get().setITaxiPassengerScoreCallback((taxiPassengerScoreUpdateOrderReqBean) -> getPresenter().arrivedAndScore(taxiPassengerScoreUpdateOrderReqBean)); } @@ -173,9 +180,10 @@ public class TaxiPassengerBaseFragment extends MvpFragment { if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING != status) { @@ -199,7 +208,7 @@ public class TaxiPassengerBaseFragment extends MvpFragment(new TaxiPassengerStartAutopilotView(getContext())); } mStartAutopilotView.get().setOnClickStartAutopilotBtnCallback(this); - OverlayViewUtils.showOverlayView(getActivity(),mStartAutopilotView.get()); + OverlayViewUtils.showOverlayView(getActivity(), mStartAutopilotView.get()); updateStartAutopilotBtnStatus(isClickable); - }else { - if (mStartAutopilotView == null || mStartAutopilotView.get() == null){ + } else { + if (mStartAutopilotView == null || mStartAutopilotView.get() == null) { return; } mStartAutopilotView.get().setOnClickStartAutopilotBtnCallback(null); @@ -331,15 +343,15 @@ public class TaxiPassengerBaseFragment extends MvpFragment + android:value="2560"/> + android:value="1600"/> () { } override fun dependenciesByName(): List { - return listOf("com.mogo.launcher.stageone.ARouterStartUp") + return listOf("com.mogo.launcher.stageone.ARouterStartUp", "com.mogo.launcher.stageone.ThreadOptStartup") } } \ No newline at end of file diff --git a/app/src/main/java/com/mogo/launcher/stageone/ARouterStartUp.kt b/app/src/main/java/com/mogo/launcher/stageone/ARouterStartUp.kt index 1cab03977a..15c913da9b 100644 --- a/app/src/main/java/com/mogo/launcher/stageone/ARouterStartUp.kt +++ b/app/src/main/java/com/mogo/launcher/stageone/ARouterStartUp.kt @@ -31,4 +31,8 @@ class ARouterStartUp : AndroidStartup() { } override fun waitOnMainThread() = false + + override fun dependenciesByName(): List? { + return listOf("com.mogo.launcher.stageone.ThreadOptStartup") + } } \ No newline at end of file diff --git a/app/src/main/java/com/mogo/launcher/stageone/ConfigStartUp.kt b/app/src/main/java/com/mogo/launcher/stageone/ConfigStartUp.kt index 71babd15d0..4c151ffa25 100644 --- a/app/src/main/java/com/mogo/launcher/stageone/ConfigStartUp.kt +++ b/app/src/main/java/com/mogo/launcher/stageone/ConfigStartUp.kt @@ -105,4 +105,8 @@ class ConfigStartUp : AndroidStartup() { } } + + override fun dependenciesByName(): List { + return listOf("com.mogo.launcher.stageone.ThreadOptStartup") + } } \ No newline at end of file diff --git a/app/src/main/java/com/mogo/launcher/stageone/HttpDnsStartUp.kt b/app/src/main/java/com/mogo/launcher/stageone/HttpDnsStartUp.kt index 794e9ef28b..dd5ef2f13b 100644 --- a/app/src/main/java/com/mogo/launcher/stageone/HttpDnsStartUp.kt +++ b/app/src/main/java/com/mogo/launcher/stageone/HttpDnsStartUp.kt @@ -70,7 +70,8 @@ class HttpDnsStartUp : AndroidStartup() { override fun dependenciesByName(): List { return listOf( "com.mogo.launcher.stageone.APMStartup", - "com.mogo.launcher.stageone.ConfigStartUp" + "com.mogo.launcher.stageone.ConfigStartUp", + "com.mogo.launcher.stageone.ThreadOptStartup" ) } @@ -367,5 +368,4 @@ class HttpDnsStartUp : AndroidStartup() { MogoAiCloudSocketManager.getInstance(context) .init(context, DebugConfig.getSocketAppId(), lat, lon) } - } \ No newline at end of file diff --git a/app/src/main/java/com/mogo/launcher/stageone/ThreadOptStartup.kt b/app/src/main/java/com/mogo/launcher/stageone/ThreadOptStartup.kt new file mode 100644 index 0000000000..d0043384b8 --- /dev/null +++ b/app/src/main/java/com/mogo/launcher/stageone/ThreadOptStartup.kt @@ -0,0 +1,33 @@ +package com.mogo.launcher.stageone + +import android.content.* +import com.mogo.thread.ext.core.* +import com.mogo.thread.ext.core.config.* +import com.rousetime.android_startup.* +import java.io.* +import java.text.SimpleDateFormat +import java.util.* +import java.util.concurrent.TimeUnit.SECONDS + +class ThreadOptStartup: AndroidStartup() { + + override fun create(context: Context): Boolean { + ThreadManager + .init(ThreadConfig.Builder() + .maxKeepAliveTime(5, SECONDS) + /*.dump(DumpConfig.Builder() + .dumpLogFilePath(File(context.getExternalFilesDir(null), "thread_dump_log_${ SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.ROOT).format(Date()) }.txt").absolutePath) + .dumpPeriod(5, SECONDS) + .threadRunThreshold(10, SECONDS) + .build())*/) + return true + } + + override fun callCreateOnMainThread(): Boolean { + return true + } + + override fun waitOnMainThread(): Boolean { + return true + } +} \ No newline at end of file diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/DataDistribution.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/DataDistribution.java index 9421872e3f..fb8fafd35b 100644 --- a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/DataDistribution.java +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/DataDistribution.java @@ -11,6 +11,7 @@ import com.zhidao.adas.client.bean.ErrorData; import com.zhidao.adas.client.bean.GlobalPathResp; import com.zhidao.adas.client.bean.GnssInfo; import com.zhidao.adas.client.bean.MogoReportMessage; +import com.zhidao.adas.client.bean.ObuWarningData; import com.zhidao.adas.client.bean.OriginalPointCloudData; import com.zhidao.adas.client.bean.PerceptionTrafficLight; import com.zhidao.adas.client.bean.PlanningDecisionState; @@ -117,6 +118,7 @@ public class DataDistribution { public final List listOriginalPointCloud = new ArrayList<>(); public final List listPlanningObjects = new ArrayList<>(); public final List listPlanningDecisionState = new ArrayList<>(); + public final List listObuWarningData = new ArrayList<>(); public String cutDown(String str) { if (isCutDown && str.length() > 650) { @@ -168,6 +170,14 @@ public class DataDistribution { if (listener != null && Constants.TITLE.RECEIVE_PLANNING_DECISION_STATE.equals(listener.first)) { listener.second.onRefresh(); } + } else if (data instanceof ObuWarningData) { + listObuWarningData.add(0, time + str); + if (listObuWarningData.size() > LIST_SIZE) { + listObuWarningData.remove(listObuWarningData.size() - 1); + } + if (listener != null && Constants.TITLE.RECEIVE_OBU_WARNING_DATA.equals(listener.first)) { + listener.second.onRefresh(); + } } else if (data instanceof GnssInfo) { listGnssInfo.add(0, time + str); if (listGnssInfo.size() > LIST_SIZE) { diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/ObuWarningData.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/ObuWarningData.java new file mode 100644 index 0000000000..7ea1bca9af --- /dev/null +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/ObuWarningData.java @@ -0,0 +1,24 @@ +package com.zhidao.adas.client.bean; + +import com.google.protobuf.TextFormat; + +import java.text.SimpleDateFormat; + +import mogo.telematics.pad.MessagePad; +import mogo.v2x.ObuWarningEvent; + +public class ObuWarningData extends BaseInfo { + public final ObuWarningEvent.ObuWarningData bean; + + public ObuWarningData(MessagePad.Header header, ObuWarningEvent.ObuWarningData bean, SimpleDateFormat sdf) { + super("接收", bean.getSerializedSize(), header, sdf); + this.bean = bean; + } + + + @Override + public String toString() { + return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean); + } + +} diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/InfoFragment.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/InfoFragment.java index 7cf79e26e6..f1cdaed48e 100644 --- a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/InfoFragment.java +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/InfoFragment.java @@ -117,6 +117,8 @@ public class InfoFragment extends BaseFragment { adapter.setData(DataDistribution.getInstance().listArrivalNotification); } else if (Constants.TITLE.RECEIVE_STATUS_QUERY_RESP.equals(title)) { adapter.setData(DataDistribution.getInstance().listStatusInfo); + } else if (Constants.TITLE.RECEIVE_OBU_WARNING_DATA.equals(title)) { + adapter.setData(DataDistribution.getInstance().listObuWarningData); } else if (Constants.TITLE.RECEIVE_RECORD_DATA_CONFIG_RESP.equals(title)) { adapter.setData(DataDistribution.getInstance().listRecordDataConfig); } else if (Constants.TITLE.RECEIVE_GLOBAL_PATH_RESP.equals(title)) { diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/MainActivity.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/MainActivity.java index 185f094cd6..538eea185c 100644 --- a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/MainActivity.java +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/MainActivity.java @@ -64,6 +64,7 @@ import com.zhidao.adas.client.bean.GlobalPathResp; import com.zhidao.adas.client.bean.GnssInfo; import com.zhidao.adas.client.bean.IPCConnectState; import com.zhidao.adas.client.bean.MogoReportMessage; +import com.zhidao.adas.client.bean.ObuWarningData; import com.zhidao.adas.client.bean.OriginalPointCloudData; import com.zhidao.adas.client.bean.PerceptionTrafficLight; import com.zhidao.adas.client.bean.PlanningDecisionState; @@ -116,6 +117,7 @@ import chassis.Chassis; import chassis.VehicleStateOuterClass; import io.netty.channel.Channel; import mogo.telematics.pad.MessagePad; +import mogo.v2x.ObuWarningEvent; import mogo_msg.MogoReportMsg; import perception.TrafficLightOuterClass; import prediction.Prediction; @@ -642,6 +644,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas titleFragmentData.add(Constants.TITLE.RECEIVE_GLOBAL_PATH_RESP); titleFragmentData.add(Constants.TITLE.RECEIVE_ARRIVAL_NOTIFICATION); titleFragmentData.add(Constants.TITLE.RECEIVE_STATUS_QUERY_RESP); + titleFragmentData.add(Constants.TITLE.RECEIVE_OBU_WARNING_DATA); titleFragmentData.add(Constants.TITLE.RECEIVE_WARN); titleFragmentData.add(Constants.TITLE.RECEIVE_ERROR); @@ -1016,6 +1019,11 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas DataDistribution.getInstance().addData(base); } + @Override + public void onObuWarningData(MessagePad.Header header, ObuWarningEvent.ObuWarningData obuWarningData) { + ObuWarningData base = new ObuWarningData(header, obuWarningData, sdf); + DataDistribution.getInstance().addData(base); + } private void initAdas() { CupidLogUtils.e(TAG, "--->初始化"); diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/utils/Constants.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/utils/Constants.java index 77a8b48dff..6214902d6d 100644 --- a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/utils/Constants.java +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/utils/Constants.java @@ -168,6 +168,7 @@ public class Constants { String RECEIVE_WARN = MessageType.TYPE_RECEIVE_WARN.desc; String RECEIVE_ARRIVAL_NOTIFICATION = MessageType.TYPE_RECEIVE_ARRIVAL_NOTIFICATION.desc; String RECEIVE_STATUS_QUERY_RESP = MessageType.TYPE_RECEIVE_STATUS_QUERY_RESP.desc; + String RECEIVE_OBU_WARNING_DATA = MessageType.TYPE_RECEIVE_OBU_WARNING_DATA.desc; String RECEIVE_ERROR = "错误数据"; diff --git a/app_mogo_magic_ring/src/main/java/com/zhidao/adas/magic/ui/MainActivity.java b/app_mogo_magic_ring/src/main/java/com/zhidao/adas/magic/ui/MainActivity.java index c995bae83d..a4e603b05e 100644 --- a/app_mogo_magic_ring/src/main/java/com/zhidao/adas/magic/ui/MainActivity.java +++ b/app_mogo_magic_ring/src/main/java/com/zhidao/adas/magic/ui/MainActivity.java @@ -66,6 +66,7 @@ import java.util.TimerTask; import chassis.VehicleStateOuterClass; import mogo.telematics.pad.MessagePad; +import mogo.v2x.ObuWarningEvent; import mogo_msg.MogoReportMsg; import perception.TrafficLightOuterClass; import prediction.Prediction; @@ -538,6 +539,10 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas } + @Override + public void onObuWarningData(MessagePad.Header header, ObuWarningEvent.ObuWarningData obuWarningData) { + + } private void initAdas() { CupidLogUtils.e(TAG, "--->初始化"); diff --git a/build.gradle b/build.gradle index 81379d1baa..0eb109a8a4 100644 --- a/build.gradle +++ b/build.gradle @@ -34,7 +34,7 @@ buildscript { classpath "com.mogo.cloud:hook:${HOOK_LOG_VERSION}" classpath "com.mogo.cloud:bizconfig:${BIZCONFIG_VERSION}" classpath 'com.volcengine:apm_insight_plugin:1.4.1' -// classpath "com.mogo.thread.opt:plg:${THREAD_OPT_VERSION}" + classpath "com.mogo.thread.opt:plg:${THREAD_OPT_VERSION}" classpath 'com.mogo.cloud:systrace:1.0.1' classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.18' classpath 'com.mogo.sticky:service:1.0.8' diff --git a/config.gradle b/config.gradle index f18228dd1c..248a9c1ae9 100644 --- a/config.gradle +++ b/config.gradle @@ -1,6 +1,7 @@ ext { time = "" - kotlin_version = "1.4.31" +// kotlin_version = "1.4.31" + kotlin_version = "1.5.0" dependencies = [ // androidx androidxappcompat : "androidx.appcompat:appcompat:1.3.1", @@ -201,8 +202,6 @@ ext { mogo_core_utils : "com.mogo.eagle.core:utils:${MOGO_CORE_UTILS_VERSION}", mogo_core_network : "com.mogo.eagle.core:network:${MOGO_CORE_NETWORK_VERSION}", - //========================= V2X SDK ========================= - mogo_v2x : "com.mogo.v2x:v2x:${MOGO_V2X_SDK_VERSION}", life_cycle_scope : "androidx.lifecycle:lifecycle-runtime-ktx:2.2.0", view_model_scope : "androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0", diff --git a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasListenerImpl.kt b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasListenerImpl.kt index e2be4c4680..8cffd15828 100644 --- a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasListenerImpl.kt +++ b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasListenerImpl.kt @@ -52,6 +52,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotStatisticsList import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerStartAutopilotFailedListenerManager.invokeStartAutopilotFailed import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager +import com.mogo.eagle.core.function.call.obucombine.CallerObuDcCombineListenerManager import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.zhidao.support.adas.high.AdasManager import com.zhidao.support.adas.high.OnAdasListener @@ -62,6 +63,7 @@ import com.zhjt.service.chain.ChainLog import com.zhjt.service.chain.TracingConstants.Endpoint.Companion.PAD import mogo.telematics.pad.MessagePad import mogo.telematics.pad.MessagePad.TrackedObject +import mogo.v2x.ObuWarningEvent import mogo_msg.MogoReportMsg import perception.TrafficLightOuterClass import prediction.Prediction @@ -99,14 +101,14 @@ class MoGoAdasListenerImpl : OnAdasListener { } //感知物体 - @ChainLog( - linkChainLog = CHAIN_LINK_LOG_WEB_SOCKET_DATA_TRACKED, - linkCode = CHAIN_LINK_ADAS, - endpoint = PAD, - nodeAliasCode = CHAIN_ALIAS_CODE_ADAS_MESSAGE_RECT_DATA, - paramIndexes = [0, 1], - clientPkFileName = "sn" - ) +// @ChainLog( +// linkChainLog = CHAIN_LINK_LOG_WEB_SOCKET_DATA_TRACKED, +// linkCode = CHAIN_LINK_ADAS, +// endpoint = PAD, +// nodeAliasCode = CHAIN_ALIAS_CODE_ADAS_MESSAGE_RECT_DATA, +// paramIndexes = [0, 1], +// clientPkFileName = "sn" +// ) override fun onTrackedObjects( header: MessagePad.Header, trackedObjects: MessagePad.TrackedObjects @@ -441,7 +443,15 @@ class MoGoAdasListenerImpl : OnAdasListener { } } - + /** + * OBU预警事件 + * + * @param header 头 + * @param obuWarningData 数据 + */ + override fun onObuWarningData(header: MessagePad.Header?, obuWarningData: ObuWarningEvent.ObuWarningData?) { + CallerObuDcCombineListenerManager.invokeObuDcData(obuWarningData) + } /** * 是否可以启动自动驾驶 diff --git a/core/function-impl/mogo-core-function-chat/src/main/res/layout/module_car_chatting_launcher_calling_hawk_eye_view.xml b/core/function-impl/mogo-core-function-chat/src/main/res/layout/module_car_chatting_launcher_calling_hawk_eye_view.xml index 13272210f3..311f50e690 100644 --- a/core/function-impl/mogo-core-function-chat/src/main/res/layout/module_car_chatting_launcher_calling_hawk_eye_view.xml +++ b/core/function-impl/mogo-core-function-chat/src/main/res/layout/module_car_chatting_launcher_calling_hawk_eye_view.xml @@ -13,7 +13,6 @@ android:id="@+id/module_carchatting_call_head" android:layout_width="@dimen/module_call_chat_calling_iv_hawk_eye_width_height" android:layout_height="@dimen/module_call_chat_calling_iv_hawk_eye_width_height" - android:scaleType="centerInside" android:src="@mipmap/module_carchatting_hawk_eye_default_head_img" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -25,7 +24,6 @@ android:layout_width="@dimen/module_call_chat_hawk_eye_circle_btn_size" android:layout_height="@dimen/module_call_chat_hawk_eye_circle_btn_size" android:layout_marginEnd="@dimen/module_call_chat_calling_iv_hawk_eye_margin_left_right" - android:scaleType="centerInside" android:src="@mipmap/module_carchatting_launcher_calling_hangup" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" diff --git a/core/function-impl/mogo-core-function-chat/src/main/res/layout/module_car_chatting_launcher_incoming_hawk_eye_view.xml b/core/function-impl/mogo-core-function-chat/src/main/res/layout/module_car_chatting_launcher_incoming_hawk_eye_view.xml index cdf0244555..c509164c94 100644 --- a/core/function-impl/mogo-core-function-chat/src/main/res/layout/module_car_chatting_launcher_incoming_hawk_eye_view.xml +++ b/core/function-impl/mogo-core-function-chat/src/main/res/layout/module_car_chatting_launcher_incoming_hawk_eye_view.xml @@ -12,7 +12,6 @@ android:id="@+id/module_carchatting_call_head" android:layout_width="@dimen/module_call_chat_incoming_aisdk_tag_width" android:layout_height="match_parent" - android:scaleType="centerInside" android:src="@drawable/module_carchatting_aicloud_incoming" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -26,7 +25,6 @@ android:layout_marginEnd="@dimen/module_call_chat_calling_iv_hawk_eye_margin_left_right" android:layout_marginRight="@dimen/module_call_chat_state_incoming_hawk_eye_call_margin_right" android:clickable="true" - android:scaleType="centerInside" android:src="@mipmap/module_callchatting_launcher_incoming_answer" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@+id/module_carchatting_incoming_hangUp" @@ -39,7 +37,6 @@ android:layout_height="@dimen/module_call_chat_hawk_eye_incoming_circle_btn_size" android:layout_marginEnd="@dimen/module_call_chat_calling_iv_hawk_eye_margin_left_right" android:clickable="true" - android:scaleType="centerInside" android:src="@mipmap/module_callchatting_launcher_incoming_hangup" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/scene/SceneManager.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/scene/SceneManager.kt index 329b2ff2ab..7ac30b517d 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/scene/SceneManager.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/scene/SceneManager.kt @@ -56,8 +56,8 @@ class SceneManager { sceneModuleTAG.map[DEVA] = SceneModule(false, M_DEVA) sceneModuleTAG.map[HMI] = SceneModule(false, M_HMI) sceneModuleTAG.map[OBU] = SceneModule(false, M_OBU) - sceneModuleTAG.map[V2X] = SceneModule(false, M_V2X) - sceneModuleTAG.map[MAP] = SceneModule(false, M_MAP) + sceneModuleTAG.map[V2X] = SceneModule(true, M_V2X) + sceneModuleTAG.map[MAP] = SceneModule(true, M_MAP) sceneModuleTAG.map[ROUTE] = SceneModule(true, M_OLD_ROUTE) sceneModuleTAG.map[NET] = SceneModule(true, M_NETWORK) sceneModuleTAG.map[BUS] = SceneModule(true, M_BUS) diff --git a/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/DispatchAutoPilotManager.java b/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/DispatchAutoPilotManager.java index bd8b98e7ac..72a42c653c 100644 --- a/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/DispatchAutoPilotManager.java +++ b/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/DispatchAutoPilotManager.java @@ -33,6 +33,7 @@ import org.jetbrains.annotations.NotNull; import java.util.ArrayList; import java.util.List; +import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_DISPATCH; import static com.zhjt.dispatch.model.DispatchServiceModel.DISPATCH_RESULT_AFFIRM; import static com.zhjt.dispatch.model.DispatchServiceModel.DISPATCH_RESULT_MANUAL_CANCEL; @@ -161,20 +162,27 @@ public class DispatchAutoPilotManager implements IMogoOnMessageListener wayLatLon = new ArrayList<>(); - if (receiverBean != null && receiverBean.getStopsList() != null) { - for (MogoLatLng mogoLatLng : receiverBean.getStopsList()) { - wayLatLon.add(new AutopilotControlParameters.AutoPilotLonLat(mogoLatLng.lat, mogoLatLng.lon)); +// AutopilotControlParameters currentAutopilot = new AutopilotControlParameters(); +// currentAutopilot.isSpeakVoice = false; +// List wayLatLon = new ArrayList<>(); +// if (receiverBean != null && receiverBean.getStopsList() != null) { +// for (MogoLatLng mogoLatLng : receiverBean.getStopsList()) { +// wayLatLon.add(new AutopilotControlParameters.AutoPilotLonLat(mogoLatLng.lat, mogoLatLng.lon)); +// } +// } +// currentAutopilot.wayLatLons = wayLatLon; +// currentAutopilot.startLatLon = new AutopilotControlParameters.AutoPilotLonLat(receiverBean.getStartLat(), receiverBean.getStartLon()); +// currentAutopilot.endLatLon = new AutopilotControlParameters.AutoPilotLonLat(receiverBean.getEndLat(), receiverBean.getEndLon()); +// currentAutopilot.vehicleType = 10; +// CallerLogger.INSTANCE.d(M_DISPATCH + TAG, "开启自动驾驶====" + currentAutopilot); +// CallerAutoPilotManager.INSTANCE.startAutoPilot(currentAutopilot); + AutopilotStatusInfo autopilotStatusInfo = CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo(); + if (autopilotStatusInfo !=null){ + AutopilotControlParameters autopilotControlParameters = autopilotStatusInfo.getAutopilotControlParameters(); + if (autopilotControlParameters != null){ + CallerAutoPilotManager.INSTANCE.startAutoPilot(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getAutopilotControlParameters()); } } - currentAutopilot.wayLatLons = wayLatLon; - currentAutopilot.startLatLon = new AutopilotControlParameters.AutoPilotLonLat(receiverBean.getStartLat(), receiverBean.getStartLon()); - currentAutopilot.endLatLon = new AutopilotControlParameters.AutoPilotLonLat(receiverBean.getEndLat(), receiverBean.getEndLon()); - currentAutopilot.vehicleType = 10; - CallerLogger.INSTANCE.d(M_DISPATCH + TAG, "开启自动驾驶====" + currentAutopilot); - CallerAutoPilotManager.INSTANCE.startAutoPilot(currentAutopilot); } @Override diff --git a/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/DispatchBaseDialog.java b/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/DispatchBaseDialog.java index d414f4c6ae..4464f806da 100644 --- a/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/DispatchBaseDialog.java +++ b/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/DispatchBaseDialog.java @@ -3,16 +3,20 @@ package com.zhjt.dispatch; import android.app.Dialog; import android.content.Context; import android.os.Build; +import android.view.Gravity; +import android.view.ViewGroup; import android.view.WindowManager; +import android.widget.FrameLayout; import androidx.annotation.NonNull; import com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean; +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; public abstract class DispatchBaseDialog extends Dialog { public DispatchBaseDialog(@NonNull Context context) { - super(context,R.style.Base_AlertDialog_AppCompat); + super(context,R.style.BaseFloatDialogStyle); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { getWindow().setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY); } else { @@ -27,4 +31,22 @@ public abstract class DispatchBaseDialog extends Dialog { public abstract void showDialog(DispatchAdasAutoPilotLocReceiverBean dispatchContent); + @Override + public void show() { + super.show(); + setWindowSize(); + } + private void setWindowSize(){ + WindowManager.LayoutParams attributes = getWindow().getAttributes(); + attributes.width = ViewGroup.LayoutParams.MATCH_PARENT; + attributes.height = ViewGroup.LayoutParams.MATCH_PARENT; + FrameLayout content = (FrameLayout)findViewById(android.R.id.content); + if(content!=null){ + ViewGroup rootView = (ViewGroup) content.getChildAt(0); + FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) rootView.getLayoutParams(); + layoutParams.gravity = Gravity.CENTER; + rootView.setLayoutParams(layoutParams); + } + getWindow().setAttributes(attributes); + } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XLimitingVelocityBroadcastReceiver.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XLimitingVelocityBroadcastReceiver.kt index e8d3961a3e..fad928ffe7 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XLimitingVelocityBroadcastReceiver.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XLimitingVelocityBroadcastReceiver.kt @@ -56,8 +56,8 @@ class V2XLimitingVelocityBroadcastReceiver : BroadcastReceiver() { * * @param limitingVelocitySpeed 限速速度 */ - private fun dispatchShowWaring(limitingVelocitySpeed: Int) { - CallerHmiManager.showLimitingVelocity(limitingVelocitySpeed) + private fun dispatchShowWaring(limitingVelocitySpeed: Int) { // TODO +// CallerHmiManager.showLimitingVelocity(limitingVelocitySpeed, 3) } /** diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XTrafficLightBroadcastReceiver.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XTrafficLightBroadcastReceiver.kt index b6599e45b2..5445788608 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XTrafficLightBroadcastReceiver.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XTrafficLightBroadcastReceiver.kt @@ -3,6 +3,7 @@ package com.mogo.eagle.core.function.hmi.receiver import android.content.BroadcastReceiver import android.content.Context import android.content.Intent +import android.util.Log import com.mogo.eagle.core.function.call.hmi.CallerHmiManager import com.mogo.eagle.core.function.hmi.WaringConst diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XWarningBroadcastReceiver.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XWarningBroadcastReceiver.kt index 6207e5eb1b..aa0216cc31 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XWarningBroadcastReceiver.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XWarningBroadcastReceiver.kt @@ -8,7 +8,7 @@ import com.mogo.eagle.core.function.call.hmi.CallerHmiManager import com.mogo.eagle.core.function.hmi.WaringConst import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI -import com.mogo.eagle.core.data.enums.EventTypeEnum +import com.mogo.eagle.core.data.enums.EventTypeEnumNew import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.data.msgbox.V2XMsg @@ -75,8 +75,8 @@ class V2XWarningBroadcastReceiver : BroadcastReceiver() { ttsContent: String?, tag: String? ) { - if (EventTypeEnum.TYPE_USECASE_ID_IVP.poiType == v2xType.toString()) { - CallerHmiManager.showLimitingVelocity(1) + if (EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType == v2xType.toString()) { //TODO +// CallerHmiManager.showLimitingVelocity(1, 4) } if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) { Log.d("MsgBox-V2XWarningBR", "alertContent或ttsContent为空!") diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt index ccf6614c2a..b30ccde589 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt @@ -33,7 +33,7 @@ import com.mogo.eagle.core.data.config.HmiBuildConfig import com.mogo.eagle.core.data.constants.MoGoFragmentPaths import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_RTS import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2I -import com.mogo.eagle.core.data.enums.EventTypeEnum +import com.mogo.eagle.core.data.enums.EventTypeEnumNew import com.mogo.eagle.core.data.enums.SidePattern import com.mogo.eagle.core.data.enums.SidePattern.* import com.mogo.eagle.core.data.enums.WarningDirectionEnum @@ -111,6 +111,7 @@ import me.jessyan.autosize.utils.AutoSizeUtils import mogo_msg.MogoReportMsg import record_cache.RecordPanelOuterClass import java.util.* +import java.util.concurrent.atomic.AtomicReference /** @@ -171,7 +172,7 @@ class MoGoHmiFragment : MvpFragment(), private var adUpgradeDialog: AdUpgradeDialog? = null - private var lastSpeakJob: Job? = null + private val lastSpeakJob by lazy { AtomicReference() } private var lastShowV2XJob: Job? = null @@ -470,17 +471,17 @@ class MoGoHmiFragment : MvpFragment(), override fun updateDriverMsgBoxTipView(show: Boolean) { if(show){ - MsgBoxTipView.visibility = View.VISIBLE + MsgBoxTipView?.visibility = View.VISIBLE }else{ - MsgBoxTipView.visibility = View.GONE + MsgBoxTipView?.visibility = View.GONE } } override fun updatePassengerMsgBoxTipView(show: Boolean) { if(show){ - MsgBoxPTipView.visibility = View.VISIBLE + MsgBoxPTipView?.visibility = View.VISIBLE }else{ - MsgBoxPTipView.visibility = View.GONE + MsgBoxPTipView?.visibility = View.GONE } } @@ -821,7 +822,7 @@ class MoGoHmiFragment : MvpFragment(), playTts && !AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) activity?.let { val warningContent = alertContent - ?: EventTypeEnum.getWarningContent(v2xType) + ?: EventTypeEnumNew.getWarningContent(v2xType) //占道施工预警 if (v2xType.equals("10006") || v2xType.equals("100061")) { @@ -842,7 +843,7 @@ class MoGoHmiFragment : MvpFragment(), return } val content = mViewNotificationProvider?.getNotificationView() ?: return - content.setWarningIcon(EventTypeEnum.getWarningIcon(v2xType)) + content.setWarningIcon(EventTypeEnumNew.getWarningIcon(v2xType)) content.setWarningContent(warningContent) CallerLogger.d( "$M_HMI$TAG", @@ -901,7 +902,7 @@ class MoGoHmiFragment : MvpFragment(), override fun onShow(reminder: IReminder) { listener?.onShow() lastShowV2XJob?.safeCancel() - lastSpeakJob?.safeCancel() + lastSpeakJob.get()?.safeCancel() showingV2XTip = reminder lifecycleScope.launch { delay(expireTime) @@ -914,7 +915,7 @@ class MoGoHmiFragment : MvpFragment(), lifecycleScope.launch { speak(it, ttsContent) }.also { itx -> - lastSpeakJob = itx + lastSpeakJob.set(itx) } } } @@ -941,53 +942,60 @@ class MoGoHmiFragment : MvpFragment(), playTts: Boolean, expireTime: Long ) { - val playTTS = - playTts && !AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) - activity?.let { - val warningContent = alertContent - ?: EventTypeEnum.getWarningContent(v2xType) + ThreadUtils.runOnUiThread { + val playTTS = + playTts && !AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) + activity?.let { + val warningContent = alertContent + ?: EventTypeEnumNew.getWarningContent(v2xType) - //占道施工预警 - if (v2xType.equals("10006") || v2xType.equals("100061")) { - val currentTime = System.currentTimeMillis() / 1000 - val oldTime = - context?.let { it -> SharedPrefsMgr.getInstance(it).getLong("roadwork", 0) } - if (currentTime - oldTime!! > 60) { //超过一分钟,才会继续播报重复提醒 - context?.let { it -> - SharedPrefsMgr.getInstance(it) - .putLong("roadwork", System.currentTimeMillis() / 1000) +// Log.d("liyz", "warningV2X v2xType = $v2xType ---alertContent = $alertContent ---ttsContent = $ttsContent") + //占道施工预警 + if (v2xType == "10006" || v2xType == "100061") { + val currentTime = System.currentTimeMillis() / 1000 + val oldTime = + context?.let { it -> SharedPrefsMgr.getInstance(it).getLong("roadwork", 0) } + if (currentTime - oldTime!! > 60) { //超过一分钟,才会继续播报重复提醒 + context?.let { it -> + SharedPrefsMgr.getInstance(it) + .putLong("roadwork", System.currentTimeMillis() / 1000) + } + CallerAutoPilotManager.sendTripInfo(5, "", "", "", false) } - CallerAutoPilotManager.sendTripInfo(5, "", "", "", false) } - } - - if (warningContent.isEmpty()) { - CallerLogger.e("$M_HMI$TAG", "Show warningContent is null or empty!") - return - } - listener?.onShow() - CallerLogger.d( - "$M_HMI$TAG", - "--- show v2x dialog 1 ---: info -> v2x-type: $v2xType : expireTime: $expireTime" - ) - - lastShowV2XJob?.safeCancel() - lastSpeakJob?.safeCancel() - - lifecycleScope.launch { - delay(expireTime) - }.also { itx -> - lastShowV2XJob = itx - }.invokeOnCompletion { _ -> - listener?.onDismiss() - showWarning(WarningDirectionEnum.ALERT_WARNING_NON) - } - - if (ttsContent != null && !TextUtils.isEmpty(ttsContent) && playTTS) { + if (warningContent.isEmpty()) { + CallerLogger.e("$M_HMI$TAG", "Show warningContent is null or empty!") + return@runOnUiThread + } + listener?.onShow() + CallerLogger.d( + "$M_HMI$TAG", + "--- show v2x dialog 1 ---: info -> v2x-type: $v2xType : expireTime: $expireTime" + ) + lastShowV2XJob?.safeCancel() lifecycleScope.launch { - speak(it, ttsContent) + delay(expireTime) }.also { itx -> - lastSpeakJob = itx + lastShowV2XJob = itx + }.invokeOnCompletion { _ -> + listener?.onDismiss() + showWarning(WarningDirectionEnum.ALERT_WARNING_NON) + } + + if (ttsContent != null && !TextUtils.isEmpty(ttsContent) && playTTS) { + val last = lastSpeakJob.get() + Log.d("CODE", "---- 0 ------: last: $last") + if (last != null && !last.isCompleted) { + Log.d("CODE", "---- 1 ------") + return@runOnUiThread + } + lifecycleScope.launch(Dispatchers.Default) { + Log.d("CODE", "---- 2 ------") + speak(it, ttsContent) + Log.d("CODE", "---- 3 ------") + }.also { itx -> + lastSpeakJob.set(itx) + } } } } @@ -1082,18 +1090,26 @@ class MoGoHmiFragment : MvpFragment(), /** * 控制展示限速标志及内容 */ - override fun showLimitingVelocity(limitingSpeed: Int) { + override fun showLimitingVelocity(limitingSpeed: Int, limitSpeedSource: Int) { // 控制 限速UI 展示 if (HmiBuildConfig.isShowLimitingVelocityView) { if (limitingSpeed > 0) { mViewLimitingVelocity?.visibility = View.VISIBLE - mViewLimitingVelocity?.updateLimitingSpeed(limitingSpeed) + mViewLimitingVelocity?.updateLimitingSpeed(limitingSpeed, limitSpeedSource) + tvLimitingSource?.visibility = View.VISIBLE + if (limitSpeedSource == 1) { + tvLimitingSource.text = "MAP" + } else if (limitSpeedSource == 2) { + tvLimitingSource.text = "RSU" + } } else { mViewLimitingVelocity?.visibility = View.INVISIBLE - mViewLimitingVelocity?.updateLimitingSpeed(0) + mViewLimitingVelocity?.updateLimitingSpeed(0, limitSpeedSource) + tvLimitingSource?.visibility = View.INVISIBLE } } else { disableLimitingVelocity() + tvLimitingSource?.visibility = View.GONE } } @@ -1102,7 +1118,7 @@ class MoGoHmiFragment : MvpFragment(), */ override fun disableLimitingVelocity() { mViewLimitingVelocity?.visibility = View.GONE - mViewLimitingVelocity?.updateLimitingSpeed(0) + mViewLimitingVelocity?.updateLimitingSpeed(0, 1) } /** @@ -1461,14 +1477,14 @@ class MoGoHmiFragment : MvpFragment(), override fun showToBindingcarDialog() { if (toBindingCarDialog == null) { - toBindingCarDialog = ToBindingCarDialog(requireContext()) + toBindingCarDialog = ToBindingCarDialog(ContextHolderUtil.getContext()) } toBindingCarDialog!!.showToBindingcarDialog() } override fun showModifyBindingcarDialog() { if (modifyBindingCarDialog == null) { - modifyBindingCarDialog = ModifyBindingCarDialog(requireContext()) + modifyBindingCarDialog = ModifyBindingCarDialog(ContextHolderUtil.getContext()) } modifyBindingCarDialog!!.showModifyBindingcarDialog() } @@ -1593,10 +1609,10 @@ class MoGoHmiFragment : MvpFragment(), EXIT_AUTOPILOT_FOR_CHASSIS, EXIT_AUTOPILOT_FOR_DISTANCE -> { warningV2X( - EventTypeEnum.TAKE_OVER_EVENT.poiType, - EventTypeEnum.TAKE_OVER_EVENT.content, - EventTypeEnum.TAKE_OVER_EVENT.tts, - EventTypeEnum.TAKE_OVER_EVENT.poiType, + EventTypeEnumNew.TAKE_OVER_EVENT.poiType, + EventTypeEnumNew.TAKE_OVER_EVENT.content, + EventTypeEnumNew.TAKE_OVER_EVENT.tts, + EventTypeEnumNew.TAKE_OVER_EVENT.poiType, object : IMoGoWarningStatusListener { override fun onShow() { takeOver = true diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxListView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxListView.kt index 2dbaf16312..547b6c8719 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxListView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxListView.kt @@ -171,13 +171,21 @@ class DriverMsgBoxListView @JvmOverloads constructor( when (category) { MsgCategory.NOTICE -> { noticeList?.add(0,msgBoxList) + if(MsgBoxConfig.getUserRecord() == 0){ + noticeList?.let { driverMsgBoxListAdapter?.setData(it) } + } } MsgCategory.SYS_INFO -> { ipcReportList?.add(0,msgBoxList) + if(MsgBoxConfig.getUserRecord() == 1){ + ipcReportList?.let { driverMsgBoxListAdapter?.setData(it) } + } } MsgCategory.RECORD_BAG -> { badCaseList?.add(0,msgBoxList) - badCaseList?.let { driverMsgBoxListAdapter?.setData(it) } + if(MsgBoxConfig.getUserRecord() == 2){ + badCaseList?.let { driverMsgBoxListAdapter?.setData(it) } + } } } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt index ab7bab281e..1f656db107 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt @@ -8,7 +8,6 @@ import android.view.ViewGroup import android.widget.ImageView import android.widget.TextView import androidx.recyclerview.widget.RecyclerView -import com.mogo.eagle.core.data.enums.EventTypeEnum import com.mogo.eagle.core.data.enums.EventTypeEnumNew import com.mogo.eagle.core.data.msgbox.* import com.mogo.eagle.core.data.report.ReportEntity @@ -34,6 +33,7 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A private val notice: Int = 2 private val v2x: Int = 3 private val report: Int = 4 + private val summary: Int = 5 var countDownTimer: CountDownTimer?=null private var changeViewListener: ChangeViewListener?=null @@ -47,89 +47,105 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { - if(viewType == operation){ - val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_operation,parent,false) - return BubbleOperationHolder(view) - }else if(viewType == report){ - val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_report,parent,false) - return BubbleReportHolder(view) - }else if(viewType == notice){ - val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_notice,parent,false) - return BubbleNoticeHolder(view) - }else{ - val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_v2x,parent,false) - return BubbleV2XHolder(view) + when (viewType) { + operation -> { + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_operation,parent,false) + return BubbleOperationHolder(view) + } + report -> { + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_report,parent,false) + return BubbleReportHolder(view) + } + notice -> { + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_notice,parent,false) + return BubbleNoticeHolder(view) + } + summary -> { + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_summary,parent,false) + return BubbleSummaryHolder(view) + } + else -> { + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_v2x,parent,false) + return BubbleV2XHolder(view) + } } } override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) { - if(holder is BubbleOperationHolder){ - data?.let { - val operationMsg = it[position].bean as OperationMsg - holder.tvBubbleOperationTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) - holder.tvBubbleOperationContent.text = operationMsg.content - } - }else if(holder is BubbleReportHolder){ - data?.let { - val reportEntity = it[position].bean as ReportEntity - holder.tvBubbleReportTime.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}" - holder.tvBubbleReceiveTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) - var resultStr = "类型:" - for (result in reportEntity.resultList){ - resultStr = "${resultStr}${CallerAutoPilotManager.getReportResultDesc(result)}" + when (holder) { + is BubbleOperationHolder -> { + data?.let { + val operationMsg = it[position].bean as OperationMsg + holder.tvBubbleOperationTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvBubbleOperationContent.text = operationMsg.content } - holder.tvBubbleReportType.text = resultStr } - }else if(holder is BubbleNoticeHolder){ - data?.let { - val msgBoxBean = it[position].bean - val noticeFrCloudMsg = msgBoxBean as NoticeFrCloudMsg - if(noticeFrCloudMsg.type == 0){ - val noticeNormalData = noticeFrCloudMsg.noticeNormalData - holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) - holder.tvNoticeContent.text = noticeNormalData?.content - GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform( - GlideRoundedCornersTransform( - 20f, - GlideRoundedCornersTransform.CornerType.ALL - ) - ).into(holder.ivNoticeImage) - holder.tvNoticeCheck.setOnClickListener { - //云公告 - if (noticeNormalData != null) { - CallerHmiManager.showNoticeNormalData(noticeNormalData) - } + is BubbleReportHolder -> { + data?.let { + val reportEntity = it[position].bean as ReportEntity + holder.tvBubbleReportTime.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}" + holder.tvBubbleReceiveTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + var resultStr = "类型:" + for (result in reportEntity.resultList){ + resultStr = "${resultStr}${CallerAutoPilotManager.getReportResultDesc(result)}" } - }else if(noticeFrCloudMsg.type == 1){ - val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData - holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) - holder.tvNoticeContent.text = noticeTrafficStylePushData?.content - GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).optionalTransform( - GlideRoundedCornersTransform( - 20f, - GlideRoundedCornersTransform.CornerType.ALL - ) - ).into(holder.ivNoticeImage) - holder.tvNoticeCheck.setOnClickListener { - //云公告 - if (noticeTrafficStylePushData != null) { - CallerHmiManager.showTrafficBanner(noticeTrafficStylePushData) + holder.tvBubbleReportType.text = resultStr + } + } + is BubbleNoticeHolder -> { + data?.let { + val msgBoxBean = it[position].bean + val noticeFrCloudMsg = msgBoxBean as NoticeFrCloudMsg + if(noticeFrCloudMsg.type == 0){ + val noticeNormalData = noticeFrCloudMsg.noticeNormalData + holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvNoticeContent.text = noticeNormalData?.content + GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform( + GlideRoundedCornersTransform( + 20f, + GlideRoundedCornersTransform.CornerType.ALL + ) + ).into(holder.ivNoticeImage) + holder.tvNoticeCheck.setOnClickListener { + //云公告 + if (noticeNormalData != null) { + CallerHmiManager.showNoticeNormalData(noticeNormalData) + } + } + }else if(noticeFrCloudMsg.type == 1){ + val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData + holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvNoticeContent.text = noticeTrafficStylePushData?.content + GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).optionalTransform( + GlideRoundedCornersTransform( + 20f, + GlideRoundedCornersTransform.CornerType.ALL + ) + ).into(holder.ivNoticeImage) + holder.tvNoticeCheck.setOnClickListener { + //云公告 + if (noticeTrafficStylePushData != null) { + CallerHmiManager.showTrafficBanner(noticeTrafficStylePushData) + } } } } } - }else if(holder is BubbleV2XHolder){ - data?.let { - val msgBoxBean = it[position] - val v2XMsg = msgBoxBean.bean as V2XMsg - holder.tvV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) - holder.tvV2XContent.text = v2XMsg.content - if(msgBoxBean.type == MsgBoxType.OBU){ + is BubbleV2XHolder -> { + data?.let { + val msgBoxBean = it[position] + val v2XMsg = msgBoxBean.bean as V2XMsg + holder.tvV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvV2XContent.text = v2XMsg.content holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable( EventTypeEnumNew.getUpdateIconRes(v2XMsg.type))) - }else{ - holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable( - EventTypeEnum.getUpdateIconRes(v2XMsg.type))) + } + } + is BubbleSummaryHolder -> { + data?.let { + val summaryMsg = it[position].bean as V2XMsg + holder.tvSummaryTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvSummaryContent.text = summaryMsg.content } } } @@ -156,14 +172,16 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A override fun getItemCount() = data?.size ?: 0 override fun getItemViewType(position: Int): Int { - if(data!![position].type == MsgBoxType.OPERATION){ - return operation + return if(data!![position].type == MsgBoxType.OPERATION){ + operation }else if(data!![position].type == MsgBoxType.REPORT){ - return report + report }else if(data!![position].type == MsgBoxType.NOTICE){ - return notice - }else{ - return v2x + notice + }else if(data!![position].type == MsgBoxType.V2X && data!![position].sourceType == DataSourceType.SUMMARY){ + summary + } else{ + v2x } } @@ -196,6 +214,12 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A var tvV2XContent: TextView = itemView.findViewById(R.id.tvV2XContent) } + //汇总消息 + class BubbleSummaryHolder(itemView: View): RecyclerView.ViewHolder(itemView){ + var tvSummaryContent: TextView = itemView.findViewById(R.id.tvSummaryContent) + var tvSummaryTime: TextView = itemView.findViewById(R.id.tvSummaryTime) + } + fun setChangeListener(listener: ChangeViewListener){ changeViewListener = listener } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt index 65a914808d..1cbb3186d0 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt @@ -9,7 +9,6 @@ import android.widget.ImageView import android.widget.TextView import androidx.core.view.isVisible import androidx.recyclerview.widget.RecyclerView -import com.mogo.eagle.core.data.enums.EventTypeEnum import com.mogo.eagle.core.data.enums.EventTypeEnumNew import com.mogo.eagle.core.data.msgbox.* import com.mogo.eagle.core.data.report.ReportEntity @@ -28,198 +27,263 @@ import com.mogo.eagle.core.utilcode.util.TimeUtils.getHourMinFormat * @description 司机端消息盒子列表视图RecyclerView适配器 * @since: 2022/11/25 */ -class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Adapter(){ +class DriverMsgBoxListAdapter(private val activity: Activity) : + RecyclerView.Adapter() { - private var data: List ?= null + private var data: List? = null private val operation: Int = 1 private val notice: Int = 2 private val v2x: Int = 3 - private val obu: Int = 4 private val report: Int = 5 private val record: Int = 6 - private val traffic: Int = 7 + private val summary: Int = 8 //Error val RESULT_AUTOPILOT_DISABLE = "RESULT_AUTOPILOT_DISABLE" val RESULT_AUTOPILOT_SYSTEM_UNSTARTED = "RESULT_AUTOPILOT_SYSTEM_UNSTARTED" val RESULT_REMOTEPILOT_DISABLE = "RESULT_REMOTEPILOT_DISABLE" - fun setData(data: List){ + fun setData(data: List) { this.data = data notifyDataSetChanged() } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { - if(viewType == record){ - val view = LayoutInflater.from(parent.context).inflate(R.layout.item_bad_case,parent,false) - return BadCaseHolder(view) - }else if(viewType == report){ - val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_box_ipc_report,parent,false) - return MsgBoxIpcReportHolder(view) - }else if(viewType == operation){ - val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_box_operation,parent,false) - return MsgBoxOperation(view) - }else if(viewType == notice){ - val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_box_notice,parent,false) - return MsgBoxNotice(view) - }else{ - val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_box_v2x,parent,false) - return MsgBoxV2X(view) + when (viewType) { + record -> { + val view = LayoutInflater.from(parent.context) + .inflate(R.layout.item_bad_case, parent, false) + return BadCaseHolder(view) + } + report -> { + val view = LayoutInflater.from(parent.context) + .inflate(R.layout.item_msg_box_ipc_report, parent, false) + return MsgBoxIpcReportHolder(view) + } + operation -> { + val view = LayoutInflater.from(parent.context) + .inflate(R.layout.item_msg_box_operation, parent, false) + return MsgBoxOperation(view) + } + notice -> { + val view = LayoutInflater.from(parent.context) + .inflate(R.layout.item_msg_box_notice, parent, false) + return MsgBoxNotice(view) + } + summary -> { + val view = LayoutInflater.from(parent.context) + .inflate(R.layout.item_msg_box_summary, parent, false) + return MsgBoxSummary(view) + } + else -> { + val view = LayoutInflater.from(parent.context) + .inflate(R.layout.item_msg_box_v2x, parent, false) + return MsgBoxV2X(view) + } } } @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) { - if(holder is BadCaseHolder){ - data?.let { - holder.tvBagReceiveTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) - holder.tvBagRecordTime.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}" - val msgBoxBean = it[position] - holder.tvRecordCheck.setOnClickListener { - //打开被动录包弹窗 - CallerDevaToolsManager.onReceiveBadCaseRecord(msgBoxBean,activity,false) - } - } - }else if(holder is MsgBoxIpcReportHolder){ - data?.let { it -> - holder.tvReportTimeNormal.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}" - holder.tvReportTimeOpen.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}" - val reportEntity = (it[position].bean as ReportEntity) - if(reportEntity.resultList.contains(RESULT_AUTOPILOT_DISABLE) - || reportEntity.resultList.contains(RESULT_AUTOPILOT_SYSTEM_UNSTARTED) - || reportEntity.resultList.contains(RESULT_REMOTEPILOT_DISABLE)){ - //Error - holder.ivReportImageNormal.setImageDrawable(getDrawable(R.drawable.icon_report_error_normal)) - holder.ivReportImageOpen.setImageDrawable(getDrawable(R.drawable.icon_report_error_open)) - holder.tvReportLevelNormal.text = "Error" - holder.tvReportLevelOpen.text = "Error" - }else{ - //Warning - holder.ivReportImageNormal.setImageDrawable(getDrawable(R.drawable.icon_report_warning_normal)) - holder.ivReportImageOpen.setImageDrawable(getDrawable(R.drawable.icon_report_warning_open)) - holder.tvReportLevelNormal.text = "Warning" - holder.tvReportLevelOpen.text = "Warning" - } - holder.tvReportTimeNormal.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}" - holder.tvReportTimeOpen.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}" - holder.tvReportTime.text =TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) - var resultStr = "类型:" - for (result in reportEntity.resultList){ - resultStr = "${resultStr}${CallerAutoPilotManager.getReportResultDesc(result)}" - } - holder.tvReportTypeNormal.text = resultStr - holder.tvReportTypeOpen.text = resultStr - holder.tvReportReasonOpen.text = "原因:${reportEntity.msg}" - var actionStr = "" - for (action in reportEntity.actionsList){ - actionStr = "${actionStr}${CallerAutoPilotManager.getReportActionDesc(action)}" - } - holder.tvReportActionOpen.text = "建议操作:$actionStr" - holder.tvStatusSelect.setOnClickListener { - if(holder.tvReportLevelNormal.isVisible){ - holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds(getDrawable(R.drawable.icon_msg_close),null,null,null) - holder.ivReportImageNormal.visibility = View.GONE - holder.tvReportLevelNormal.visibility = View.GONE - holder.tvReportTimeNormal.visibility = View.GONE - holder.tvReportTypeNormal.visibility = View.GONE - - holder.ivReportImageOpen.visibility = View.VISIBLE - holder.tvReportLevelOpen.visibility = View.VISIBLE - holder.tvReportTimeOpen.visibility = View.VISIBLE - holder.tvReportTypeOpen.visibility = View.VISIBLE - holder.tvReportReasonOpen.visibility = View.VISIBLE - holder.tvReportActionOpen.visibility = View.VISIBLE - }else{ - holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds(getDrawable(R.drawable.icon_msg_open),null,null,null) - holder.ivReportImageNormal.visibility = View.VISIBLE - holder.tvReportLevelNormal.visibility = View.VISIBLE - holder.tvReportTimeNormal.visibility = View.VISIBLE - holder.tvReportTypeNormal.visibility = View.VISIBLE - - holder.ivReportImageOpen.visibility = View.GONE - holder.tvReportLevelOpen.visibility = View.GONE - holder.tvReportTimeOpen.visibility = View.GONE - holder.tvReportTypeOpen.visibility = View.GONE - holder.tvReportReasonOpen.visibility = View.GONE - holder.tvReportActionOpen.visibility = View.GONE + when (holder) { + is BadCaseHolder -> { + data?.let { + holder.tvBagReceiveTime.text = + TimeUtils.millis2String(it[position].timestamp, getHourMinFormat()) + holder.tvBagRecordTime.text = + "时间:${TimeUtils.millis2String(it[position].timestamp)}" + val msgBoxBean = it[position] + holder.tvRecordCheck.setOnClickListener { + //打开被动录包弹窗 + CallerDevaToolsManager.onReceiveBadCaseRecord(msgBoxBean, activity, false) } } } - }else if(holder is MsgBoxOperation){ - data?.let { - val operationMsg = it[position].bean as OperationMsg - holder.tvOperationContentNormal.text = operationMsg.content - holder.tvOperationContentOpen.text = operationMsg.content - holder.tvOperationTime.text = TimeUtils.millis2String(operationMsg.timestamp,getHourMinFormat()) - holder.tvOperationStatusSelect.setOnClickListener { - if(holder.ivOperationImageNormal.isVisible){ - holder.tvOperationStatusSelect.setCompoundDrawablesWithIntrinsicBounds(getDrawable(R.drawable.icon_msg_close),null,null,null) - holder.ivOperationImageNormal.visibility = View.GONE - holder.tvOperationTitleNormal.visibility = View.GONE - holder.tvOperationContentNormal.visibility = View.GONE + is MsgBoxIpcReportHolder -> { + data?.let { it -> + holder.tvReportTimeNormal.text = + "时间:${TimeUtils.millis2String(it[position].timestamp)}" + holder.tvReportTimeOpen.text = + "时间:${TimeUtils.millis2String(it[position].timestamp)}" + val reportEntity = (it[position].bean as ReportEntity) + if (reportEntity.resultList.contains(RESULT_AUTOPILOT_DISABLE) + || reportEntity.resultList.contains(RESULT_AUTOPILOT_SYSTEM_UNSTARTED) + || reportEntity.resultList.contains(RESULT_REMOTEPILOT_DISABLE) + ) { + //Error + holder.ivReportImageNormal.setImageDrawable(getDrawable(R.drawable.icon_report_error_normal)) + holder.ivReportImageOpen.setImageDrawable(getDrawable(R.drawable.icon_report_error_open)) + holder.tvReportLevelNormal.text = "Error" + holder.tvReportLevelOpen.text = "Error" + } else { + //Warning + holder.ivReportImageNormal.setImageDrawable(getDrawable(R.drawable.icon_report_warning_normal)) + holder.ivReportImageOpen.setImageDrawable(getDrawable(R.drawable.icon_report_warning_open)) + holder.tvReportLevelNormal.text = "Warning" + holder.tvReportLevelOpen.text = "Warning" + } + holder.tvReportTimeNormal.text = + "时间:${TimeUtils.millis2String(it[position].timestamp)}" + holder.tvReportTimeOpen.text = + "时间:${TimeUtils.millis2String(it[position].timestamp)}" + holder.tvReportTime.text = + TimeUtils.millis2String(it[position].timestamp, getHourMinFormat()) + var resultStr = "类型:" + for (result in reportEntity.resultList) { + resultStr = + "${resultStr}${CallerAutoPilotManager.getReportResultDesc(result)}" + } + holder.tvReportTypeNormal.text = resultStr + holder.tvReportTypeOpen.text = resultStr + holder.tvReportReasonOpen.text = "原因:${reportEntity.msg}" + var actionStr = "" + for (action in reportEntity.actionsList) { + actionStr = + "${actionStr}${CallerAutoPilotManager.getReportActionDesc(action)}" + } + holder.tvReportActionOpen.text = "建议操作:$actionStr" + holder.tvStatusSelect.setOnClickListener { + if (holder.tvReportLevelNormal.isVisible) { + holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds( + getDrawable(R.drawable.icon_msg_close), + null, + null, + null + ) + holder.ivReportImageNormal.visibility = View.GONE + holder.tvReportLevelNormal.visibility = View.GONE + holder.tvReportTimeNormal.visibility = View.GONE + holder.tvReportTypeNormal.visibility = View.GONE - holder.ivOperationImageOpen.visibility = View.VISIBLE - holder.tvOperationTitleOpen.visibility = View.VISIBLE - holder.tvOperationContentOpen.visibility = View.VISIBLE - }else{ - holder.tvOperationStatusSelect.setCompoundDrawablesWithIntrinsicBounds(getDrawable(R.drawable.icon_msg_open),null,null,null) - holder.ivOperationImageNormal.visibility = View.VISIBLE - holder.tvOperationTitleNormal.visibility = View.VISIBLE - holder.tvOperationContentNormal.visibility = View.VISIBLE + holder.ivReportImageOpen.visibility = View.VISIBLE + holder.tvReportLevelOpen.visibility = View.VISIBLE + holder.tvReportTimeOpen.visibility = View.VISIBLE + holder.tvReportTypeOpen.visibility = View.VISIBLE + holder.tvReportReasonOpen.visibility = View.VISIBLE + holder.tvReportActionOpen.visibility = View.VISIBLE + } else { + holder.tvStatusSelect.setCompoundDrawablesWithIntrinsicBounds( + getDrawable(R.drawable.icon_msg_open), + null, + null, + null + ) + holder.ivReportImageNormal.visibility = View.VISIBLE + holder.tvReportLevelNormal.visibility = View.VISIBLE + holder.tvReportTimeNormal.visibility = View.VISIBLE + holder.tvReportTypeNormal.visibility = View.VISIBLE - holder.ivOperationImageOpen.visibility = View.GONE - holder.tvOperationTitleOpen.visibility = View.GONE - holder.tvOperationContentOpen.visibility = View.GONE + holder.ivReportImageOpen.visibility = View.GONE + holder.tvReportLevelOpen.visibility = View.GONE + holder.tvReportTimeOpen.visibility = View.GONE + holder.tvReportTypeOpen.visibility = View.GONE + holder.tvReportReasonOpen.visibility = View.GONE + holder.tvReportActionOpen.visibility = View.GONE + } } } } - }else if(holder is MsgBoxNotice){ - data?.let { - val noticeFrCloudMsg = it[position].bean as NoticeFrCloudMsg - if(noticeFrCloudMsg.type == 0){ - val noticeNormalData = noticeFrCloudMsg.noticeNormalData - holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) - holder.tvNoticeContent.text = noticeNormalData?.content - GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform( - GlideRoundedCornersTransform( - 20f, - GlideRoundedCornersTransform.CornerType.ALL - ) - ).into(holder.ivNoticeImage) - holder.tvNoticeCheck.setOnClickListener { - //云公告 - noticeNormalData?.let { it1 -> CallerHmiManager.showNoticeNormalData(it1) } - } - }else if(noticeFrCloudMsg.type == 1){ - val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData - holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) - holder.tvNoticeContent.text = noticeTrafficStylePushData?.content - GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).optionalTransform( - GlideRoundedCornersTransform( - 20f, - GlideRoundedCornersTransform.CornerType.ALL - ) - ).into(holder.ivNoticeImage) - holder.tvNoticeCheck.setOnClickListener { - //云公告 - noticeTrafficStylePushData?.let { it1 -> CallerHmiManager.showTrafficBanner(it1) } + is MsgBoxOperation -> { + data?.let { + val operationMsg = it[position].bean as OperationMsg + holder.tvOperationContentNormal.text = operationMsg.content + holder.tvOperationContentOpen.text = operationMsg.content + holder.tvOperationTime.text = + TimeUtils.millis2String(operationMsg.timestamp, getHourMinFormat()) + holder.tvOperationStatusSelect.setOnClickListener { + if (holder.ivOperationImageNormal.isVisible) { + holder.tvOperationStatusSelect.setCompoundDrawablesWithIntrinsicBounds( + getDrawable(R.drawable.icon_msg_close), + null, + null, + null + ) + holder.ivOperationImageNormal.visibility = View.GONE + holder.tvOperationTitleNormal.visibility = View.GONE + holder.tvOperationContentNormal.visibility = View.GONE + + holder.ivOperationImageOpen.visibility = View.VISIBLE + holder.tvOperationTitleOpen.visibility = View.VISIBLE + holder.tvOperationContentOpen.visibility = View.VISIBLE + } else { + holder.tvOperationStatusSelect.setCompoundDrawablesWithIntrinsicBounds( + getDrawable(R.drawable.icon_msg_open), + null, + null, + null + ) + holder.ivOperationImageNormal.visibility = View.VISIBLE + holder.tvOperationTitleNormal.visibility = View.VISIBLE + holder.tvOperationContentNormal.visibility = View.VISIBLE + + holder.ivOperationImageOpen.visibility = View.GONE + holder.tvOperationTitleOpen.visibility = View.GONE + holder.tvOperationContentOpen.visibility = View.GONE + } } } - } - }else if(holder is MsgBoxV2X){ - data?.let { - val msgBoxBean = it[position] - val v2XMsg = msgBoxBean.bean as V2XMsg - holder.tvV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) - holder.tvV2XContent.text = v2XMsg.content - if(msgBoxBean.type == MsgBoxType.OBU){ + is MsgBoxNotice -> { + data?.let { + val noticeFrCloudMsg = it[position].bean as NoticeFrCloudMsg + if (noticeFrCloudMsg.type == 0) { + val noticeNormalData = noticeFrCloudMsg.noticeNormalData + holder.tvNoticeTime.text = + TimeUtils.millis2String(it[position].timestamp, getHourMinFormat()) + holder.tvNoticeContent.text = noticeNormalData?.content + GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform( + GlideRoundedCornersTransform( + 20f, + GlideRoundedCornersTransform.CornerType.ALL + ) + ).into(holder.ivNoticeImage) + holder.tvNoticeCheck.setOnClickListener { + //云公告 + noticeNormalData?.let { it1 -> CallerHmiManager.showNoticeNormalData(it1) } + } + } else if (noticeFrCloudMsg.type == 1) { + val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData + holder.tvNoticeTime.text = + TimeUtils.millis2String(it[position].timestamp, getHourMinFormat()) + holder.tvNoticeContent.text = noticeTrafficStylePushData?.content + GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl) + .optionalTransform( + GlideRoundedCornersTransform( + 20f, + GlideRoundedCornersTransform.CornerType.ALL + ) + ).into(holder.ivNoticeImage) + holder.tvNoticeCheck.setOnClickListener { + //云公告 + noticeTrafficStylePushData?.let { it1 -> + CallerHmiManager.showTrafficBanner( + it1 + ) + } + } + } + + } + } + is MsgBoxV2X -> { + data?.let { + val msgBoxBean = it[position] + val v2XMsg = msgBoxBean.bean as V2XMsg + holder.tvV2XTime.text = + TimeUtils.millis2String(it[position].timestamp, getHourMinFormat()) + holder.tvV2XContent.text = v2XMsg.content holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable( - EventTypeEnumNew.getUpdateIconRes(v2XMsg.type))) - }else{ - holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable( - EventTypeEnum.getUpdateIconRes(v2XMsg.type))) + EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)) + ) + } + } + is MsgBoxSummary -> { + data?.let { + val summaryMsg = it[position].bean as V2XMsg + holder.tvSummaryTime.text = + TimeUtils.millis2String(it[position].timestamp, getHourMinFormat()) + holder.tvSummaryContent.text = summaryMsg.content } } } @@ -229,26 +293,30 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada override fun getItemViewType(position: Int): Int { - return when(data!![position].type){ - MsgBoxType.OPERATION -> operation - MsgBoxType.NOTICE -> notice - MsgBoxType.V2X -> v2x - MsgBoxType.OBU -> obu - MsgBoxType.REPORT -> report - MsgBoxType.RECORD -> record - MsgBoxType.TRAFFIC -> traffic - } + return if (data!![position].type == MsgBoxType.OPERATION) { + operation + } else if (data!![position].type == MsgBoxType.NOTICE) { + notice + } else if (data!![position].type == MsgBoxType.V2X && data!![position].sourceType == DataSourceType.SUMMARY) { + summary + } else if (data!![position].type == MsgBoxType.REPORT) { + report + } else if (data!![position].type == MsgBoxType.RECORD) { + record + } else { + v2x + } } //录包实体 - class BadCaseHolder(itemView: View): RecyclerView.ViewHolder(itemView){ - var tvBagRecordTime: TextView= itemView.findViewById(R.id.tvBagRecordTime) + class BadCaseHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { + var tvBagRecordTime: TextView = itemView.findViewById(R.id.tvBagRecordTime) var tvBagReceiveTime: TextView = itemView.findViewById(R.id.tvBagReceiveTime) var tvRecordCheck: TextView = itemView.findViewById(R.id.tvRecordCheck) } //车辆系统信息 - class MsgBoxIpcReportHolder(itemView: View): RecyclerView.ViewHolder(itemView){ + class MsgBoxIpcReportHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { var ivReportImageNormal: ImageView = itemView.findViewById(R.id.ivReportImageNormal) var tvReportLevelNormal: TextView = itemView.findViewById(R.id.tvReportLevelNormal) var tvReportTimeNormal: TextView = itemView.findViewById(R.id.tvReportTimeNormal) @@ -264,10 +332,11 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada } //运营平台 - class MsgBoxOperation(itemView: View): RecyclerView.ViewHolder(itemView){ + class MsgBoxOperation(itemView: View) : RecyclerView.ViewHolder(itemView) { var ivOperationImageNormal: ImageView = itemView.findViewById(R.id.ivOperationImageNormal) var tvOperationTitleNormal: TextView = itemView.findViewById(R.id.tvOperationTitleNormal) - var tvOperationContentNormal: TextView = itemView.findViewById(R.id.tvOperationContentNormal) + var tvOperationContentNormal: TextView = + itemView.findViewById(R.id.tvOperationContentNormal) var tvOperationStatusSelect: TextView = itemView.findViewById(R.id.tvOperationStatusSelect) var tvOperationTime: TextView = itemView.findViewById(R.id.tvOperationTime) var ivOperationImageOpen: ImageView = itemView.findViewById(R.id.ivOperationImageOpen) @@ -276,7 +345,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada } //Notice - class MsgBoxNotice(itemView: View): RecyclerView.ViewHolder(itemView){ + class MsgBoxNotice(itemView: View) : RecyclerView.ViewHolder(itemView) { var ivNoticeImage: ImageView = itemView.findViewById(R.id.ivNoticeImage) var tvNoticeTitle: TextView = itemView.findViewById(R.id.tvNoticeTitle) var tvNoticeTime: TextView = itemView.findViewById(R.id.tvNoticeTime) @@ -285,11 +354,17 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada } //V2X,OBU - class MsgBoxV2X(itemView: View): RecyclerView.ViewHolder(itemView){ + class MsgBoxV2X(itemView: View) : RecyclerView.ViewHolder(itemView) { var ivV2XImage: ImageView = itemView.findViewById(R.id.ivV2XImage) var tvV2XTime: TextView = itemView.findViewById(R.id.tvV2XTime) var tvV2XContent: TextView = itemView.findViewById(R.id.tvV2XContent) } + //汇总消息 + class MsgBoxSummary(itemView: View) : RecyclerView.ViewHolder(itemView) { + var tvSummaryContent: TextView = itemView.findViewById(R.id.tvSummaryContent) + var tvSummaryTime: TextView = itemView.findViewById(R.id.tvSummaryTime) + } + } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/PassengerMsgBoxBubbleAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/PassengerMsgBoxBubbleAdapter.kt index 6b0c6750a6..db78cd9935 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/PassengerMsgBoxBubbleAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/PassengerMsgBoxBubbleAdapter.kt @@ -8,15 +8,11 @@ import android.view.ViewGroup import android.widget.ImageView import android.widget.TextView import androidx.recyclerview.widget.RecyclerView -import com.mogo.eagle.core.data.enums.EventTypeEnum import com.mogo.eagle.core.data.enums.EventTypeEnumNew -import com.mogo.eagle.core.data.msgbox.MsgBoxBean -import com.mogo.eagle.core.data.msgbox.MsgBoxType -import com.mogo.eagle.core.data.msgbox.NoticeFrCloudMsg -import com.mogo.eagle.core.data.msgbox.V2XMsg +import com.mogo.eagle.core.data.msgbox.* import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp -import com.mogo.eagle.core.data.notice.NoticeNormalData import com.mogo.eagle.core.function.call.hmi.CallerHmiManager +import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform @@ -34,6 +30,7 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView private val notice: Int = 1 private val v2x: Int = 2 + private val summary: Int = 3 var countDownTimer: CountDownTimer?=null @@ -46,65 +43,83 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { - if(viewType == notice){ - val view = LayoutInflater.from(parent.context).inflate(R.layout.item_passenger_msg_box_notice,parent,false) - return BubbleNoticeHolder(view) - }else{ - val view = LayoutInflater.from(parent.context).inflate(R.layout.item_passenger_msg_box_v2x,parent,false) - return BubbleV2XHolder(view) + return when (viewType) { + notice -> { + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_passenger_msg_box_notice,parent,false) + BubbleNoticeHolder(view) + } + summary -> { + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_passenger_msg_box_summary,parent,false) + BubbleSummaryHolder(view) + } + else -> { + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_passenger_msg_box_v2x,parent,false) + BubbleV2XHolder(view) + } } } override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) { - if(holder is BubbleNoticeHolder){ - data?.let { - val noticeFrCloudMsg = it[position].bean as NoticeFrCloudMsg - if(noticeFrCloudMsg.type == 0){ - val noticeNormalData = noticeFrCloudMsg.noticeNormalData - holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) - holder.tvPassengerNoticeContent.text = noticeNormalData?.content - GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform( - GlideRoundedCornersTransform( - 20f, - GlideRoundedCornersTransform.CornerType.ALL - ) - ).into(holder.ivPassengerNoticeImage) - holder.tvPassengerNoticeCheck.setOnClickListener { - //云公告 - noticeNormalData?.let { it1 -> CallerHmiManager.showNoticeNormalData(it1) } + when (holder) { + is BubbleNoticeHolder -> { + data?.let { + val noticeFrCloudMsg = it[position].bean as NoticeFrCloudMsg + if(noticeFrCloudMsg.type == 0){ + val noticeNormalData = noticeFrCloudMsg.noticeNormalData + holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvPassengerNoticeContent.text = noticeNormalData?.content + GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform( + GlideRoundedCornersTransform( + 20f, + GlideRoundedCornersTransform.CornerType.ALL + ) + ).into(holder.ivPassengerNoticeImage) + holder.tvPassengerNoticeCheck.setOnClickListener { + //云公告 + noticeNormalData?.let { it1 -> CallerHmiManager.showNoticeNormalData(it1) } + } + }else if(noticeFrCloudMsg.type == 1){ + val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData + holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvPassengerNoticeContent.text = noticeTrafficStylePushData?.content + GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).optionalTransform( + GlideRoundedCornersTransform( + 20f, + GlideRoundedCornersTransform.CornerType.ALL + ) + ).into(holder.ivPassengerNoticeImage) + holder.tvPassengerNoticeCheck.setOnClickListener { + //云公告 + noticeTrafficStylePushData?.let { it1 -> CallerHmiManager.showTrafficBanner(it1) } + } } - }else if(noticeFrCloudMsg.type == 1){ - val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData - holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) - holder.tvPassengerNoticeContent.text = noticeTrafficStylePushData?.content - GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).optionalTransform( - GlideRoundedCornersTransform( - 20f, - GlideRoundedCornersTransform.CornerType.ALL - ) - ).into(holder.ivPassengerNoticeImage) - holder.tvPassengerNoticeCheck.setOnClickListener { - //云公告 - noticeTrafficStylePushData?.let { it1 -> CallerHmiManager.showTrafficBanner(it1) } - } - } + } } - }else if(holder is BubbleV2XHolder){ - data?.let { - val msgBoxBean = it[position] - val v2XMsg = msgBoxBean.bean as V2XMsg - holder.tvPassengerV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) - holder.tvPassengerV2XContent.text = v2XMsg.content - if(msgBoxBean.type == MsgBoxType.OBU){ + is BubbleV2XHolder -> { + data?.let { + val msgBoxBean = it[position] + val v2XMsg = msgBoxBean.bean as V2XMsg + holder.tvPassengerV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvPassengerV2XContent.text = v2XMsg.content holder.ivPassengerV2XImage.setImageDrawable(activity.resources.getDrawable( EventTypeEnumNew.getUpdateIconRes(v2XMsg.type))) - }else{ - holder.ivPassengerV2XImage.setImageDrawable(activity.resources.getDrawable( - EventTypeEnum.getUpdateIconRes(v2XMsg.type))) + } + } + is BubbleSummaryHolder -> { + data?.let { + val summaryMsg= it[position].bean as V2XMsg + holder.tvPassengerSummaryTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvPassengerSummaryContent.text = summaryMsg.content + holder.tvPassengerSummaryCheck.setOnClickListener { + //跳转全览模式 +// CallerHmiManager.showSmallFragment() + CallerMsgBoxEventListenerManager.invokeListener() + } } } } + val msgBoxBean: MsgBoxBean = data!![position] countDownTimer =object: CountDownTimer(CallerMsgBoxManager.getDismissTime(),1000){ override fun onTick(p0: Long) { @@ -125,10 +140,12 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView override fun getItemCount() = data?.size ?: 0 override fun getItemViewType(position: Int): Int { - if(data!![position].type == MsgBoxType.NOTICE){ - return notice - }else{ - return v2x + return if(data!![position].type == MsgBoxType.NOTICE){ + notice + }else if(data!![position].type == MsgBoxType.V2X && data!![position].sourceType == DataSourceType.SUMMARY){ + summary + } else{ + v2x } } @@ -148,4 +165,11 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView var tvPassengerV2XContent: TextView = itemView.findViewById(R.id.tvPassengerV2XContent) } + //汇总消息 + class BubbleSummaryHolder(itemView: View): RecyclerView.ViewHolder(itemView){ + var tvPassengerSummaryContent: TextView = itemView.findViewById(R.id.tvPassengerSummaryContent) + var tvPassengerSummaryCheck: TextView = itemView.findViewById(R.id.tvPassengerSummaryCheck) + var tvPassengerSummaryTime: TextView = itemView.findViewById(R.id.tvPassengerSummaryTime) + } + } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/PassengerMsgBoxListAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/PassengerMsgBoxListAdapter.kt index 50c635e49c..8bb23e0ed6 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/PassengerMsgBoxListAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/PassengerMsgBoxListAdapter.kt @@ -7,14 +7,10 @@ import android.view.ViewGroup import android.widget.ImageView import android.widget.TextView import androidx.recyclerview.widget.RecyclerView -import com.mogo.eagle.core.data.enums.EventTypeEnum import com.mogo.eagle.core.data.enums.EventTypeEnumNew -import com.mogo.eagle.core.data.msgbox.MsgBoxBean -import com.mogo.eagle.core.data.msgbox.MsgBoxType -import com.mogo.eagle.core.data.msgbox.NoticeFrCloudMsg -import com.mogo.eagle.core.data.msgbox.V2XMsg -import com.mogo.eagle.core.data.notice.NoticeNormalData +import com.mogo.eagle.core.data.msgbox.* import com.mogo.eagle.core.function.call.hmi.CallerHmiManager +import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform @@ -32,6 +28,7 @@ class PassengerMsgBoxListAdapter(private val activity: Activity): RecyclerView.A private val notice: Int = 1 private val v2x: Int = 2 + private val summary: Int = 3 fun setData(data: List){ this.data = data @@ -39,61 +36,78 @@ class PassengerMsgBoxListAdapter(private val activity: Activity): RecyclerView.A } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { - return if(viewType == notice){ - val view = LayoutInflater.from(parent.context).inflate(R.layout.item_passenger_msg_list_notice,parent,false) - ListNoticeHolder(view) - }else{ - val view = LayoutInflater.from(parent.context).inflate(R.layout.item_passenger_msg_list_v2x,parent,false) - ListV2XHolder(view) + return when (viewType) { + notice -> { + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_passenger_msg_list_notice,parent,false) + ListNoticeHolder(view) + } + summary -> { + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_passenger_msg_list_summary,parent,false) + ListSummaryHolder(view) + } + else -> { + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_passenger_msg_list_v2x,parent,false) + ListV2XHolder(view) + } } } override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) { - if(holder is ListNoticeHolder){ - data?.let { - val noticeFrCloudMsg = it[position].bean as NoticeFrCloudMsg - if(noticeFrCloudMsg.type == 0){ - val noticeNormalData = noticeFrCloudMsg.noticeNormalData - holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) - holder.tvPassengerNoticeContent.text = noticeNormalData?.content - GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform( - GlideRoundedCornersTransform( - 20f, - GlideRoundedCornersTransform.CornerType.ALL - ) - ).into(holder.ivPassengerNoticeImage) - holder.tvPassengerNoticeCheck.setOnClickListener { - //云公告 - noticeNormalData?.let { it1 -> CallerHmiManager.showNoticeNormalData(it1) } - } - }else if(noticeFrCloudMsg.type == 1){ - val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData - holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) - holder.tvPassengerNoticeContent.text = noticeTrafficStylePushData?.content - GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).optionalTransform( - GlideRoundedCornersTransform( - 20f, - GlideRoundedCornersTransform.CornerType.ALL - ) - ).into(holder.ivPassengerNoticeImage) - holder.tvPassengerNoticeCheck.setOnClickListener { - //云公告 - noticeTrafficStylePushData?.let { it1 -> CallerHmiManager.showTrafficBanner(it1) } + when (holder) { + is ListNoticeHolder -> { + data?.let { + val noticeFrCloudMsg = it[position].bean as NoticeFrCloudMsg + if(noticeFrCloudMsg.type == 0){ + val noticeNormalData = noticeFrCloudMsg.noticeNormalData + holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvPassengerNoticeContent.text = noticeNormalData?.content + GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform( + GlideRoundedCornersTransform( + 20f, + GlideRoundedCornersTransform.CornerType.ALL + ) + ).into(holder.ivPassengerNoticeImage) + holder.tvPassengerNoticeCheck.setOnClickListener { + //云公告 + noticeNormalData?.let { it1 -> CallerHmiManager.showNoticeNormalData(it1) } + } + }else if(noticeFrCloudMsg.type == 1){ + val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData + holder.tvPassengerNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvPassengerNoticeContent.text = noticeTrafficStylePushData?.content + GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).optionalTransform( + GlideRoundedCornersTransform( + 20f, + GlideRoundedCornersTransform.CornerType.ALL + ) + ).into(holder.ivPassengerNoticeImage) + holder.tvPassengerNoticeCheck.setOnClickListener { + //云公告 + noticeTrafficStylePushData?.let { it1 -> CallerHmiManager.showTrafficBanner(it1) } + } } } } - }else if(holder is ListV2XHolder){ - data?.let { - val msgBoxBean = it[position] - val v2XMsg = msgBoxBean.bean as V2XMsg - holder.tvPassengerV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) - holder.tvPassengerV2XContent.text = v2XMsg.content - if(msgBoxBean.type == MsgBoxType.OBU){ + is ListV2XHolder -> { + data?.let { + val msgBoxBean = it[position] + val v2XMsg = msgBoxBean.bean as V2XMsg + holder.tvPassengerV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvPassengerV2XContent.text = v2XMsg.content holder.ivPassengerV2XImage.setImageDrawable(activity.resources.getDrawable( EventTypeEnumNew.getUpdateIconRes(v2XMsg.type))) - }else{ - holder.ivPassengerV2XImage.setImageDrawable(activity.resources.getDrawable( - EventTypeEnum.getUpdateIconRes(v2XMsg.type))) + } + } + is ListSummaryHolder -> { + data?.let { + val summaryMsg= it[position].bean as V2XMsg + holder.tvPassengerSummaryTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvPassengerSummaryContent.text = summaryMsg.content + holder.tvPassengerSummaryCheck.setOnClickListener { + //跳转全览模式 +// CallerHmiManager.showSmallFragment() + CallerMsgBoxEventListenerManager.invokeListener() + } } } } @@ -102,10 +116,12 @@ class PassengerMsgBoxListAdapter(private val activity: Activity): RecyclerView.A override fun getItemCount() = data?.size ?: 0 override fun getItemViewType(position: Int): Int { - if(data!![position].type == MsgBoxType.NOTICE){ - return notice - }else{ - return v2x + return if(data!![position].type == MsgBoxType.NOTICE){ + notice + }else if(data!![position].type == MsgBoxType.V2X && data!![position].sourceType == DataSourceType.SUMMARY){ + summary + } else{ + v2x } } @@ -125,4 +141,11 @@ class PassengerMsgBoxListAdapter(private val activity: Activity): RecyclerView.A var tvPassengerV2XContent: TextView = itemView.findViewById(R.id.tvPassengerV2XContent) } + //汇总消息 + class ListSummaryHolder(itemView: View): RecyclerView.ViewHolder(itemView){ + var tvPassengerSummaryContent: TextView = itemView.findViewById(R.id.tvPassengerSummaryContent) + var tvPassengerSummaryCheck: TextView = itemView.findViewById(R.id.tvPassengerSummaryCheck) + var tvPassengerSummaryTime: TextView = itemView.findViewById(R.id.tvPassengerSummaryTime) + } + } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/pnc/PncActionsView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/pnc/PncActionsView.kt index 539658cf16..1c178824d5 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/pnc/PncActionsView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/pnc/PncActionsView.kt @@ -72,7 +72,7 @@ class PncActionsView @JvmOverloads constructor( @BizConfig(FOUNDATION, "", BIZ_PNC_ACTIONS) override fun pncActions(planningActionMsg: MessagePad.PlanningActionMsg) { - mAutoPilotStatusInfo?.let { + mAutoPilotStatusInfo?.let { it -> if (it.state == STATUS_AUTOPILOT_RUNNING) { UiThreadHandler.post { var actions: String? = null diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt index c98bbfc1e0..8fe270ab24 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt @@ -16,6 +16,7 @@ import androidx.appcompat.widget.PopupMenu import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.content.ContextCompat import androidx.core.view.* +import androidx.lifecycle.lifecycleScope import androidx.recyclerview.widget.LinearLayoutManager import chassis.Chassis import chassis.VehicleStateOuterClass @@ -78,11 +79,13 @@ import com.mogo.map.uicontroller.VisualAngleMode import com.mogo.map.uicontroller.VisualAngleMode.* import com.mogo.eagle.core.function.business.routeoverlay.* import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager +import com.mogo.eagle.core.utilcode.kotlin.lifecycleOwner import com.zhidao.easysocket.utils.L import com.zhidao.support.adas.high.other.permission.BackgrounderPermission import com.zhjt.mogo_core_function_devatools.env.* import kotlinx.android.synthetic.main.view_debug_setting.view.* import kotlinx.android.synthetic.main.view_debug_setting.view.tbRouteDynamicEffect +import kotlinx.coroutines.launch import mogo.telematics.pad.MessagePad import mogo_msg.MogoReportMsg import java.text.SimpleDateFormat @@ -207,7 +210,7 @@ class DebugSettingView @JvmOverloads constructor( logInfoView!!.onEnterForeground() } // 开启定时查询速度 - Timer().schedule(timerTaskRefresh, Date(), 100) + Timer().schedule(timerTaskRefresh, Date(), 300) if (AppConfigInfo.isConnectAutopilot && (AppConfigInfo.plateNumber.isNullOrEmpty() || AppConfigInfo.iPCMacAddress.isNullOrEmpty())) { //查询工控机基础配置信息 CallerAutoPilotManager.getCarConfig() @@ -623,6 +626,33 @@ class DebugSettingView @JvmOverloads constructor( } } + tbV2NFromCar.isChecked = FunctionBuildConfig.isV2NFromCar + //v2n车端预警 + tbV2NFromCar.setOnCheckedChangeListener { _, isChecked -> + FunctionBuildConfig.isV2NFromCar = isChecked + if (!FunctionBuildConfig.isV2NFromCar) { + tbV2NFromCar.isChecked = false + } + } + + tbDrawAiCloudFusion.isChecked = FunctionBuildConfig.isDrawAiCloudFusion + //云端感知绘制 + tbDrawAiCloudFusion.setOnCheckedChangeListener { _, isChecked -> + FunctionBuildConfig.isDrawAiCloudFusion = isChecked + if (!FunctionBuildConfig.isDrawAiCloudFusion) { + tbDrawAiCloudFusion.isChecked = false + } + } + + tbDrawRomaMode.isChecked = FunctionBuildConfig.isRomaMode + //云端感知绘制 + tbDrawRomaMode.setOnCheckedChangeListener { _, isChecked -> + FunctionBuildConfig.isRomaMode = isChecked + if (!FunctionBuildConfig.isRomaMode) { + tbDrawRomaMode.isChecked = false + } + } + //重启工控机所有节点 btnIpcReboot.onClick { CallerAutoPilotManager.sendIpcReboot() @@ -1119,8 +1149,9 @@ class DebugSettingView @JvmOverloads constructor( /** * obu弱势交通控制 */ + tbObuWeaknessTraffic.isChecked = HmiBuildConfig.isShowObuWeaknessTrafficView tbObuWeaknessTraffic.setOnCheckedChangeListener { _, isChecked -> - if (!isChecked) { //默认开启 + if (isChecked) { //默认开启 CallerHmiManager.setObuWeaknessTraffic(true) } else { CallerHmiManager.setObuWeaknessTraffic(false) @@ -1130,6 +1161,7 @@ class DebugSettingView @JvmOverloads constructor( /** * 云端弱势交通控制 */ + tbCloudWeaknessTraffic.isChecked = HmiBuildConfig.isShowCloudWeaknessTrafficView tbCloudWeaknessTraffic.setOnCheckedChangeListener { _, isChecked -> if (isChecked) { //默认关闭 CallerHmiManager.setCloudWeaknessTraffic(true) @@ -1797,10 +1829,10 @@ class DebugSettingView @JvmOverloads constructor( }" ) - - tvAutopilotInfo.text = GsonUtils.toJson(mAutoPilotStatusInfo) - tvIpcInfo.text = GsonUtils.toJson(mAutoPilotStatusInfo) - tvIpcInfoKey.text = GsonUtils.toJson(mAutoPilotStatusInfo) + val autopilotJson = GsonUtils.toJson(mAutoPilotStatusInfo) + tvAutopilotInfo.text = autopilotJson + tvIpcInfo.text = autopilotJson + tvIpcInfoKey.text = autopilotJson tvCarInfo.text = "GPS时间:${(mGnssInfo?.satelliteTime?.times(1000))?.toLong()}\n" + @@ -1845,18 +1877,20 @@ class DebugSettingView @JvmOverloads constructor( * OBU状态回调 */ override fun onObuStatusResponse(obuStatusInfo: ObuStatusInfo) { - tvObuInfo.text = GsonUtils.toJson(obuStatusInfo) + lifecycleOwner.lifecycleScope.launch { + tvObuInfo.text = GsonUtils.toJson(obuStatusInfo) - AppConfigInfo.obuSdkVersion = obuStatusInfo.obuSdkVersion - AppConfigInfo.isConnectObu = obuStatusInfo.obuStatus + AppConfigInfo.obuSdkVersion = obuStatusInfo.obuSdkVersion + AppConfigInfo.isConnectObu = obuStatusInfo.obuStatus - if (obuStatusInfo.obuStatus) { - obuConnectStatus = true - } - //OBU断开连接,提示异常 - if (obuConnectStatus && !obuStatusInfo.obuStatus) { - obuConnectStatus = false - toastMsg("OBU连接状态异常") + if (obuStatusInfo.obuStatus) { + obuConnectStatus = true + } + //OBU断开连接,提示异常 + if (obuConnectStatus && !obuStatusInfo.obuStatus) { + obuConnectStatus = false + toastMsg("OBU连接状态异常") + } } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt index ca74993d5a..6865374f1c 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt @@ -78,6 +78,7 @@ class SOPSettingView @JvmOverloads constructor( /** * obu弱势交通控制 */ + tbObuWeaknessTrafficSop.isChecked = HmiBuildConfig.isShowObuWeaknessTrafficView tbObuWeaknessTrafficSop.setOnCheckedChangeListener { _, isChecked -> if (!isChecked) { //默认开启 CallerHmiManager.setObuWeaknessTraffic(true) @@ -89,6 +90,7 @@ class SOPSettingView @JvmOverloads constructor( /** * 云端弱势交通控制 */ + tbCloudWeaknessTrafficSop.isChecked = HmiBuildConfig.isShowCloudWeaknessTrafficView tbCloudWeaknessTrafficSop.setOnCheckedChangeListener { _, isChecked -> if (isChecked) { //默认关闭 CallerHmiManager.setCloudWeaknessTraffic(true) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/LimitingVelocityView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/LimitingVelocityView.kt index b1c509d6f2..c766f7a029 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/LimitingVelocityView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/LimitingVelocityView.kt @@ -20,8 +20,8 @@ class LimitingVelocityView @JvmOverloads constructor( LayoutInflater.from(context).inflate(R.layout.view_limiting_speed_vr, this, true) } - override fun updateLimitingSpeed(limitingSpeed: Int) { - super.updateLimitingSpeed(limitingSpeed) + override fun updateLimitingSpeed(limitingSpeed: Int, limitSource: Int) { + super.updateLimitingSpeed(limitingSpeed, limitSource) tvLimitingVelocity.text = "$limitingSpeed" } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/PerspectiveSwitchView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/PerspectiveSwitchView.kt index df4e2a1d15..4554b912e5 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/PerspectiveSwitchView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/PerspectiveSwitchView.kt @@ -5,6 +5,7 @@ import android.util.AttributeSet import android.view.LayoutInflater import android.view.View import android.widget.FrameLayout +import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager import com.mogo.eagle.core.function.hmi.R import com.mogo.map.MogoMapUIController import com.mogo.map.uicontroller.VisualAngleMode @@ -34,12 +35,14 @@ class PerspectiveSwitchView @JvmOverloads constructor( // .visibleAllMarkers() MogoMapUIController.getInstance() .changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null) + CallerMapUIServiceManager.getMapUIController()?.setLockMode(true) textSwitch.setText(R.string.module_map_model_normal) } else if (MogoMapUIController.getInstance().currentMapVisualAngle.isMediumSight) { // MogoMarkerManager.getInstance(AbsMogoApplication.getApp()) // .inVisibleWithoutMarkers(DataTypes.TYPE_MARKER_ADAS) MogoMapUIController.getInstance() .changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null) + CallerMapUIServiceManager.getMapUIController()?.setLockMode(false) textSwitch.setText(R.string.module_map_model_faster) } else { // MogoMarkerManager.getInstance(AbsMogoApplication.getApp()) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SingleTrafficLightView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SingleTrafficLightView.kt index 12842094df..c2c483aeb3 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SingleTrafficLightView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SingleTrafficLightView.kt @@ -174,7 +174,7 @@ class SingleTrafficLightView @JvmOverloads constructor( * 更新红绿灯icon * * @param lightId 0-都是默认,1-红,2-黄,3-绿 - * @param lightSource 1:云端下发;2:自车感知 + * @param lightSource 1:云端下发;2:自车感知; 3:OBU */ private fun updateTrafficLightIcon(lightId: Int,lightSource: Int) { UiThreadHandler.post { @@ -200,6 +200,9 @@ class SingleTrafficLightView @JvmOverloads constructor( 2 -> { mLightSourceTV!!.text = "自车感知" } + 3 -> { + mLightSourceTV!!.text = "OBU" + } else -> { mLightSourceTV!!.visibility = GONE } @@ -208,9 +211,9 @@ class SingleTrafficLightView @JvmOverloads constructor( } private fun resetView(){ - // 小巴车的司机端需要展示红绿灯信号来源 - if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode) - && AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)){ + // 小巴车的司机端需要展示红绿灯信号来源 ,由于需要知道来源,这里不在限制 +// if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode) +// && AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)){ val lp = this.layoutParams as MarginLayoutParams lp.width = context.resources.getDimension(R.dimen.hmi_traffic_light_bus_layout_width).toInt() this.layoutParams = lp @@ -219,15 +222,15 @@ class SingleTrafficLightView @JvmOverloads constructor( mLightSourceTV!!.visibility = View.VISIBLE mLightSourceTV!!.setPadding(0,0,0,0) mLightIconBG!!.layoutParams.width = context.resources.getDimension(R.dimen.hmi_traffic_light_bus_bg_width).toInt() - }else{ - val lp = this.layoutParams as MarginLayoutParams - lp.width = context.resources.getDimension(R.dimen.hmi_traffic_light_layout_width).toInt() - this.layoutParams = lp - mLightTimeTV!!.visibility = View.VISIBLE - mLightSourceDivider!!.visibility = View.GONE - mLightSourceTV!!.visibility = View.GONE - mLightIconBG!!.layoutParams.width = context.resources.getDimension(R.dimen.hmi_traffic_light_bg_width).toInt() - } +// }else{ +// val lp = this.layoutParams as MarginLayoutParams +// lp.width = context.resources.getDimension(R.dimen.hmi_traffic_light_layout_width).toInt() +// this.layoutParams = lp +// mLightTimeTV!!.visibility = View.VISIBLE +// mLightSourceDivider!!.visibility = View.GONE +// mLightSourceTV!!.visibility = View.GONE +// mLightIconBG!!.layoutParams.width = context.resources.getDimension(R.dimen.hmi_traffic_light_bg_width).toInt() +// } } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SpeedChartView.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SpeedChartView.java index f6d69a53ee..47a53c4ce8 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SpeedChartView.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SpeedChartView.java @@ -178,7 +178,7 @@ public class SpeedChartView extends View { setAnimation(lastAngle, currentAngle, 1000); lastAngle = currentAngle; //重新绘制 - postInvalidate(); + invalidate(); } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SpeedPanelView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SpeedPanelView.kt index f0f2cbce26..6a4e148a1a 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SpeedPanelView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SpeedPanelView.kt @@ -89,7 +89,7 @@ class SpeedPanelView @JvmOverloads constructor( } } this.timerTask = task - timer.schedule(task, Date(), 100) + timer.schedule(task, Date(), 200) } override fun onDetachedFromWindow() { diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SystemVersionView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SystemVersionView.kt index c30efddd3a..8044145aff 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SystemVersionView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SystemVersionView.kt @@ -18,6 +18,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener import com.mogo.eagle.core.function.call.bindingcar.CallerBindingCarListenerManager import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsUpgradeListenerManager +import com.mogo.eagle.core.function.call.hmi.CallerHmiManager import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showUpgradeDialog import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java index 0338363c76..012b4f7f38 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java @@ -120,7 +120,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis protected void onStop() { super.onStop(); IntentManager.getInstance().unregisterIntentListener(Intent.ACTION_CLOSE_SYSTEM_DIALOGS, this); - //ActivityLifecycleManager.getInstance().setAppActive(false); +// ActivityLifecycleManager.getInstance().setAppActive(false); } @Override @@ -221,17 +221,18 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent A down pressADownTime = " + pressADownTime + "---" + (pressADownTime - startPressTime) + "----isCombinationKey = " + isCombinationKey + "--pressBDownTime = " + pressBDownTime); if ((pressADownTime - startPressTime) > 360 && (pressADownTime - startPressTime) < 1300 && pressBDownTime > 0) { if (isShowToast) { - ToastUtils.showShort("方块 A 按AB组合 -2 "); + ToastUtils.showShort("方块 A 按AB组合 +1 "); } - sendAcc(true, -2); + sendAcc(true, +1); isCombinationKey = 3; } if (isCombinationKey != 3 && isCombinationKey != 1) { if ((pressADownTime - startPressTime) > 1320) { if (isShowToast) { - ToastUtils.showShort("方块 长按A 无 操作 "); + ToastUtils.showShort("方块 长按A -2 "); } + sendAcc(true, -2); isCombinationKey = 2; } } @@ -261,17 +262,16 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent B down pressBDownTime = " + pressBDownTime + "--差-" + (pressBDownTime - startPressTime) + "---isCombinationKey = " + isCombinationKey + "--pressADownTime = " + pressADownTime); if ((pressBDownTime - startPressTime) > 360 && (pressBDownTime - startPressTime) < 1300 && pressADownTime > 0) { if (isShowToast) { - ToastUtils.showShort("方块 B 按AB组合 "); + ToastUtils.showShort("方块 B 按AB组合 +1 "); } - sendAcc(true, -2); + sendAcc(true, +1); isCombinationKey = 3; } if (isCombinationKey != 3 && isCombinationKey != 1) { if ((pressBDownTime - startPressTime) > 1320) { if (isShowToast) { - ToastUtils.showShort("方块 长按B +1 "); + ToastUtils.showShort("方块 长按B 无操作 "); } - sendAcc(true, +1); isCombinationKey = 2; } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java index ab789ac15b..d05a210dca 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java @@ -17,7 +17,6 @@ import com.mogo.commons.AbsMogoApplication; import com.mogo.commons.debug.DebugConfig; import com.mogo.commons.module.MogoModule; import com.mogo.commons.module.MogoModulePaths; -import com.mogo.commons.voice.AIAssist; import com.mogo.eagle.core.data.config.FunctionBuildConfig; import com.mogo.eagle.core.data.constants.MoGoConfig; import com.mogo.eagle.core.data.constants.MogoServicePaths; diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml index a9a6f19e19..21d86a2dc9 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml @@ -182,6 +182,21 @@ app:layout_goneMarginTop="40dp" tools:visibility="gone" /> + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_ipc_report.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_ipc_report.xml index 2e26a4ebc0..5911e16c42 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_ipc_report.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_ipc_report.xml @@ -1,27 +1,27 @@ @@ -56,11 +56,11 @@ app:layout_constraintLeft_toLeftOf="@id/tvReportTimeNormal" app:layout_constraintRight_toRightOf="@id/tvStatusSelect" app:layout_constraintBottom_toBottomOf="parent" - android:layout_marginTop="5px" - android:layout_marginBottom="25px" + android:layout_marginTop="5dp" + android:layout_marginBottom="25dp" android:textColor="#B3FFFFFF" android:gravity="start" - android:textSize="28px" + android:textSize="28dp" android:maxLines="1" android:ellipsize="end" android:lineSpacingMultiplier="1.2" @@ -72,18 +72,18 @@ android:layout_height="wrap_content" android:text="折叠" android:textColor="#FFFFFFFF" - android:textSize="24px" + android:textSize="24dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintRight_toRightOf="parent" - android:layout_marginTop="25px" - android:layout_marginEnd="25px" + android:layout_marginTop="25dp" + android:layout_marginEnd="25dp" android:background="@drawable/bg_msg_status_select" android:drawableStart="@drawable/icon_msg_open" - android:drawablePadding="10px" - android:paddingStart="15px" - android:paddingEnd="15px" - android:paddingTop="5px" - android:paddingBottom="5px" + android:drawablePadding="10dp" + android:paddingStart="15dp" + android:paddingEnd="15dp" + android:paddingTop="5dp" + android:paddingBottom="5dp" /> @@ -118,8 +118,8 @@ app:layout_constraintBottom_toBottomOf="@id/ivReportImageOpen" app:layout_constraintLeft_toRightOf="@id/ivReportImageOpen" android:textColor="#FFFFFFFF" - android:textSize="32px" - android:layout_marginStart="10px" + android:textSize="32dp" + android:layout_marginStart="10dp" android:visibility="gone" /> @@ -129,9 +129,9 @@ android:layout_height="wrap_content" app:layout_constraintTop_toBottomOf="@id/ivReportImageOpen" app:layout_constraintLeft_toLeftOf="@id/ivReportImageOpen" - android:layout_marginTop="10px" + android:layout_marginTop="10dp" android:textColor="#B3FFFFFF" - android:textSize="28px" + android:textSize="28dp" android:lineSpacingMultiplier="1.2" android:visibility="gone" /> @@ -143,7 +143,7 @@ app:layout_constraintTop_toBottomOf="@id/tvReportTimeOpen" app:layout_constraintLeft_toLeftOf="@id/tvReportTimeOpen" android:textColor="#B3FFFFFF" - android:textSize="28px" + android:textSize="28dp" android:lineSpacingMultiplier="1.2" android:visibility="gone" /> @@ -157,7 +157,7 @@ app:layout_constraintRight_toRightOf="@id/tvStatusSelect" android:gravity="start" android:textColor="#B3FFFFFF" - android:textSize="28px" + android:textSize="28dp" android:lineSpacingMultiplier="1.2" android:visibility="gone" /> @@ -170,9 +170,9 @@ app:layout_constraintLeft_toLeftOf="@id/tvReportReasonOpen" app:layout_constraintRight_toRightOf="@id/tvStatusSelect" app:layout_constraintBottom_toBottomOf="parent" - android:layout_marginBottom="15px" + android:layout_marginBottom="15dp" android:textColor="#B3FFFFFF" - android:textSize="28px" + android:textSize="28dp" android:lineSpacingMultiplier="1.2" android:visibility="gone" /> diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_notice.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_notice.xml index 38b8988e07..9506d06130 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_notice.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_notice.xml @@ -1,25 +1,25 @@ @@ -29,10 +29,10 @@ android:layout_height="wrap_content" android:text="官方公告" android:textColor="#FFFFFFFF" - android:textSize="32px" + android:textSize="32dp" app:layout_constraintTop_toTopOf="@id/ivNoticeImage" app:layout_constraintLeft_toRightOf="@id/ivNoticeImage" - android:layout_marginStart="15px" + android:layout_marginStart="15dp" /> \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_operation.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_operation.xml index 8537e5d213..375a39975f 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_operation.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_operation.xml @@ -1,27 +1,27 @@ @@ -34,8 +34,8 @@ app:layout_constraintLeft_toRightOf="@id/ivOperationImageNormal" android:text="运营平台" android:textColor="#FFFFFFFF" - android:textSize="32px" - android:layout_marginStart="23px" + android:textSize="32dp" + android:layout_marginStart="23dp" /> @@ -61,18 +61,18 @@ android:layout_height="wrap_content" android:text="折叠" android:textColor="#FFFFFFFF" - android:textSize="24px" + android:textSize="24dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintRight_toRightOf="parent" - android:layout_marginTop="25px" - android:layout_marginEnd="25px" + android:layout_marginTop="25dp" + android:layout_marginEnd="25dp" android:background="@drawable/bg_msg_status_select" android:drawableStart="@drawable/icon_msg_open" - android:drawablePadding="10px" - android:paddingStart="15px" - android:paddingEnd="15px" - android:paddingTop="5px" - android:paddingBottom="5px" + android:drawablePadding="10dp" + android:paddingStart="15dp" + android:paddingEnd="15dp" + android:paddingTop="5dp" + android:paddingBottom="5dp" /> @@ -108,8 +108,8 @@ app:layout_constraintLeft_toRightOf="@id/ivOperationImageOpen" android:text="运营平台" android:textColor="#FFFFFFFF" - android:textSize="32px" - android:layout_marginStart="10px" + android:textSize="32dp" + android:layout_marginStart="10dp" android:visibility="gone" /> @@ -122,11 +122,11 @@ app:layout_constraintLeft_toLeftOf="@id/ivOperationImageOpen" app:layout_constraintRight_toRightOf="@id/tvOperationStatusSelect" android:gravity="start" - android:layout_marginTop="10px" - android:layout_marginBottom="15px" + android:layout_marginTop="10dp" + android:layout_marginBottom="15dp" android:lineSpacingMultiplier="1.2" android:textColor="#B3FFFFFF" - android:textSize="28px" + android:textSize="28dp" android:visibility="gone" /> diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_summary.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_summary.xml new file mode 100644 index 0000000000..9f2439221a --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_summary.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_v2x.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_v2x.xml index 808e8e2396..ef36f539a0 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_v2x.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_v2x.xml @@ -1,24 +1,24 @@ + android:layout_marginStart="30dp" + android:layout_marginEnd="30dp" + android:layout_marginTop="7dp" + android:layout_marginBottom="7dp"> + android:layout_margin="25dp"/> diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_notice.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_notice.xml index d88358219c..2496ec595f 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_notice.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_notice.xml @@ -1,24 +1,23 @@ @@ -28,10 +27,10 @@ android:layout_height="wrap_content" android:text="官方公告" android:textColor="#FFFFFFFF" - android:textSize="32px" + android:textSize="32dp" app:layout_constraintTop_toTopOf="@id/ivNoticeImage" app:layout_constraintLeft_toRightOf="@id/ivNoticeImage" - android:layout_marginStart="15px" + android:layout_marginStart="15dp" /> \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_operation.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_operation.xml index e7e45d6527..af25aec755 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_operation.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_operation.xml @@ -1,22 +1,22 @@ + android:layout_marginTop="7dp" + android:layout_marginBottom="7dp"> @@ -27,9 +27,9 @@ app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toTopOf="@id/tvBubbleOperationContent" app:layout_constraintLeft_toRightOf="@id/ivBubbleOperationImage" - android:layout_marginStart="25px" + android:layout_marginStart="25dp" android:textColor="#FFFFFFFF" - android:textSize="32px" + android:textSize="32dp" android:text="运营平台" /> @@ -40,9 +40,9 @@ app:layout_constraintTop_toTopOf="@id/tvBubbleOperationTitle" app:layout_constraintBottom_toBottomOf="@id/tvBubbleOperationTitle" app:layout_constraintRight_toRightOf="parent" - android:layout_marginEnd="25px" + android:layout_marginEnd="25dp" android:textColor="#80FFFFFF" - android:textSize="24px" + android:textSize="24dp" /> diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_report.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_report.xml index ed451de81e..ac287b1ca2 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_report.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_report.xml @@ -1,23 +1,23 @@ @@ -27,10 +27,10 @@ android:layout_height="wrap_content" app:layout_constraintTop_toTopOf="parent" app:layout_constraintLeft_toRightOf="@id/ivBubbleReportImage" - android:layout_marginTop="15px" - android:layout_marginStart="25px" + android:layout_marginTop="15dp" + android:layout_marginStart="25dp" android:textColor="#FFFFFFFF" - android:textSize="32px" + android:textSize="32dp" android:text="Error" /> @@ -40,9 +40,9 @@ android:layout_height="wrap_content" app:layout_constraintTop_toBottomOf="@id/tvBubbleReportTitle" app:layout_constraintLeft_toLeftOf="@id/tvBubbleReportTitle" - android:layout_marginTop="5px" + android:layout_marginTop="5dp" android:textColor="#B3FFFFFF" - android:textSize="28px" + android:textSize="28dp" /> \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_summary.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_summary.xml new file mode 100644 index 0000000000..25f2eedcd9 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_summary.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_v2x.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_v2x.xml index a3ba2a9c73..8c1cb8475d 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_v2x.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_v2x.xml @@ -1,22 +1,22 @@ + android:layout_marginTop="7dp" + android:layout_marginBottom="7dp"> + android:layout_margin="25dp"/> diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_passenger_msg_box_notice.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_passenger_msg_box_notice.xml index 8a26d7a513..30d71f2364 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_passenger_msg_box_notice.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_passenger_msg_box_notice.xml @@ -1,18 +1,18 @@ @@ -47,7 +47,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:textColor="#FFFFFFFF" - android:textSize="28px" + android:textSize="28dp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="@id/tvPassengerNoticeTitle" app:layout_constraintTop_toBottomOf="@id/tvPassengerNoticeTitle" @@ -59,11 +59,11 @@ \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_passenger_msg_box_summary.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_passenger_msg_box_summary.xml new file mode 100644 index 0000000000..3c58b979c0 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_passenger_msg_box_summary.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_passenger_msg_box_v2x.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_passenger_msg_box_v2x.xml index fd7c05db5a..d7096b95b6 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_passenger_msg_box_v2x.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_passenger_msg_box_v2x.xml @@ -1,21 +1,21 @@ + app:roundLayoutRadius="24dp" + android:layout_marginTop="16dp" + android:layout_marginBottom="16dp"> \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_passenger_msg_list_notice.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_passenger_msg_list_notice.xml index b56115e291..d65de843e3 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_passenger_msg_list_notice.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_passenger_msg_list_notice.xml @@ -1,13 +1,13 @@ \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_passenger_msg_list_summary.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_passenger_msg_list_summary.xml new file mode 100644 index 0000000000..964715f577 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_passenger_msg_list_summary.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_passenger_msg_list_v2x.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_passenger_msg_list_v2x.xml index 0e8088cae4..a323fe7515 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_passenger_msg_list_v2x.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_passenger_msg_list_v2x.xml @@ -1,13 +1,13 @@ \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_driver_msg_box_bubble.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_driver_msg_box_bubble.xml index ed5d0dab45..db4163466c 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_driver_msg_box_bubble.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_driver_msg_box_bubble.xml @@ -1,6 +1,6 @@ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_passenger_msg_box_bubble.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_passenger_msg_box_bubble.xml index ac09584e77..542619f7ea 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_passenger_msg_box_bubble.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_passenger_msg_box_bubble.xml @@ -1,7 +1,7 @@ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_passenger_msg_box_list.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_passenger_msg_box_list.xml index 74431ca542..053b089c8c 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_passenger_msg_box_list.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_passenger_msg_box_list.xml @@ -1,12 +1,12 @@ + android:layout_marginBottom="16dp"> \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml index 7a32567b16..bef611254c 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml @@ -242,6 +242,42 @@ android:textOn="关闭感知优化模式" android:textSize="@dimen/dp_24" /> + + + + + + + android:layout_height="match_parent" + android:orientation="vertical"> - + app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon" /> \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-map/src/main/AndroidManifest.xml b/core/function-impl/mogo-core-function-map/src/main/AndroidManifest.xml index fb2b0d007d..c1429480b7 100644 --- a/core/function-impl/mogo-core-function-map/src/main/AndroidManifest.xml +++ b/core/function-impl/mogo-core-function-map/src/main/AndroidManifest.xml @@ -2,4 +2,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/ai/AiCloudIdentifyDataManager.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/ai/AiCloudIdentifyDataManager.kt new file mode 100644 index 0000000000..267cb2b60e --- /dev/null +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/ai/AiCloudIdentifyDataManager.kt @@ -0,0 +1,106 @@ +package com.mogo.eagle.core.function.business.ai + +import android.content.Context +import com.mogo.aicloud.services.socket.IMogoOnMessageListener +import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager +import com.mogo.eagle.core.data.config.FunctionBuildConfig +import com.mogo.eagle.core.data.deva.chain.ChainConstant +import com.mogo.eagle.core.function.business.ai.net.AiCloudIdentifyNetWorkModel +import com.mogo.eagle.core.function.business.identify.MapIdentifySubscriber +import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager +import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP +import com.mogo.map.listener.IMogoMapListener +import com.mogo.map.uicontroller.VisualAngleMode +import com.mogo.module.common.MogoApisHandler +import com.zhjt.service.chain.ChainLog +import com.zhjt.service.chain.TracingConstants +import mogo.yycp.api.proto.SocketDownData + +class AiCloudIdentifyDataManager : IMogoMapListener { + + companion object { + private const val TAG = "AiCloudIdentifyData" + + var START_METRE = 200 + var END_METRE = 2000 + + @JvmStatic + val aiCloudIdentifyDataManager by lazy(LazyThreadSafetyMode.SYNCHRONIZED) { + AiCloudIdentifyDataManager() + } + } + + private val aiCloudIdentifyNetWorkModel = AiCloudIdentifyNetWorkModel() + private var showAiCloud = false + + fun init(mContext: Context) { + MogoApisHandler.getInstance().apis.registerCenterApi.registerMogoMapListener(TAG, this) + MogoAiCloudSocketManager.getInstance(mContext) + .registerOnMessageListener( + 0x040003, //低频数据 + object : IMogoOnMessageListener { + override fun target(): Class { + return SocketDownData.SocketDownDataProto::class.java + } + + @ChainLog( + linkChainLog = ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_DATA_TRACKED, + linkCode = ChainConstant.CHAIN_LINK_ADAS, + endpoint = TracingConstants.Endpoint.PAD, + nodeAliasCode = ChainConstant.CHAIN_ALIAS_CODE_ADAS_MESSAGE_RECT_DATA, + paramIndexes = [0], + clientPkFileName = "sn" + ) + override fun onMsgReceived(obj: SocketDownData.SocketDownDataProto?) { + if(!FunctionBuildConfig.isDrawAiCloudFusion){ + MapIdentifySubscriber.instance.clearAiCloudRoma() + return + } + obj?.let { + obj.data?.let { + if (showAiCloud) { + if (it.allListList == null || it.allListList.size == 0) { + MapIdentifySubscriber.instance.clearAiCloudRoma() + return + } + MapIdentifySubscriber.instance.renderAiCloudResult(it.allListList) + } + } + } + } + }) + requestRangeOfIdentify() + } + + fun requestRangeOfIdentify() { + aiCloudIdentifyNetWorkModel.requestIdentifyRange({ + CallerLogger.d( + M_MAP + TAG, + "requestIdentifyRange ok startRange:$START_METRE, endRange:$END_METRE" + ) + }, { + CallerLogger.d( + M_MAP + TAG, + "requestIdentifyRange error : $it , startRange:$START_METRE, endRange:$END_METRE" + ) + }) + } + + override fun onMapVisualAngleChanged(visualAngleMode: VisualAngleMode) { + super.onMapVisualAngleChanged(visualAngleMode) + when { + visualAngleMode.isRoma -> { + showAiCloud = true + FunctionBuildConfig.isDrawIdentifyData = false + } + else -> { + showAiCloud = false + FunctionBuildConfig.isDrawIdentifyData = true + MapIdentifySubscriber.instance.clearAiCloudRoma() + } + } + } + +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/ai/AiCloudRangeBroadcastReceiver.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/ai/AiCloudRangeBroadcastReceiver.kt new file mode 100644 index 0000000000..a45ec2a068 --- /dev/null +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/ai/AiCloudRangeBroadcastReceiver.kt @@ -0,0 +1,30 @@ +package com.mogo.eagle.core.function.business.ai + +import android.content.BroadcastReceiver +import android.content.Context +import android.content.Intent +import com.mogo.eagle.core.function.business.ai.AiCloudIdentifyDataManager.Companion.END_METRE +import com.mogo.eagle.core.function.business.ai.AiCloudIdentifyDataManager.Companion.START_METRE +import com.mogo.eagle.core.function.business.ai.AiCloudIdentifyDataManager.Companion.aiCloudIdentifyDataManager +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP + +class AiCloudRangeBroadcastReceiver : BroadcastReceiver() { + + companion object { + private const val TAG = "AiCloudRangeBroadcastReceiver" + private const val START_RANGE = "startRange" + private const val END_RANGE = "endRange" + + // adb shell am broadcast -a com.map.aiCloud.notification --ei startRange 140 --ei endRange 2000 + } + + override fun onReceive(context: Context, intent: Intent) { + val startRange = intent.getIntExtra(START_RANGE, START_METRE) + val endRange = intent.getIntExtra(END_RANGE, END_METRE) + START_METRE = startRange + END_METRE = endRange + CallerLogger.d("$M_MAP$TAG", "startRange:$startRange, endRange:$endRange") + aiCloudIdentifyDataManager.requestRangeOfIdentify() + } +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/ai/net/AiCloudIdentifyNetWorkModel.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/ai/net/AiCloudIdentifyNetWorkModel.kt new file mode 100644 index 0000000000..8ad4ad3521 --- /dev/null +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/ai/net/AiCloudIdentifyNetWorkModel.kt @@ -0,0 +1,63 @@ +package com.mogo.eagle.core.function.business.ai.net + +import com.mogo.cloud.passport.MoGoAiCloudClientConfig +import com.mogo.commons.debug.DebugConfig +import com.mogo.eagle.core.data.BaseResponse +import com.mogo.eagle.core.function.business.ai.AiCloudIdentifyDataManager.Companion.END_METRE +import com.mogo.eagle.core.function.business.ai.AiCloudIdentifyDataManager.Companion.START_METRE +import com.mogo.eagle.core.network.MoGoRetrofitFactory +import com.mogo.eagle.core.network.apiCall +import com.mogo.eagle.core.network.request +import com.zhjt.service_biz.FuncConfig + +class AiCloudIdentifyNetWorkModel { + + companion object { + val aiCloudIdentifyNetWorkModel by lazy(LazyThreadSafetyMode.SYNCHRONIZED) { + AiCloudIdentifyNetWorkModel() + } + } + + private fun getHost(): String { + var host = "http://dzt-city.zhidaozhixing.com" + when (DebugConfig.getNetMode()) { + DebugConfig.NET_MODE_DEV, + DebugConfig.NET_MODE_QA -> host = "http://dzt-qa-city.zhidaozhixing.com" + } + return host + } + + private fun getNetWorkApi(baseUrl: String = getHost()): IAiCloudIdentifyApiService { + return MoGoRetrofitFactory.getInstanceNoCallAdapter(baseUrl) + .create(IAiCloudIdentifyApiService::class.java) + } + + fun requestIdentifyRange( + onSuccess: (() -> Unit), + onError: ((String) -> Unit) + ) { + request> { + val map = mutableMapOf() + start { + map["sn"] = MoGoAiCloudClientConfig.getInstance().sn + map["status"] = true + map["startMetre"] = START_METRE + map["endMetre"] = END_METRE + map["type"] = 1 + } + loader { + apiCall { + getNetWorkApi().identifyRange(map) + } + } + onSuccess { + onSuccess.invoke() + } + onError { + it.message?.let { errorMsg -> + onError.invoke(errorMsg) + } + } + } + } +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/ai/net/IAiCloudIdentifyApiService.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/ai/net/IAiCloudIdentifyApiService.kt new file mode 100644 index 0000000000..3ddaac5e43 --- /dev/null +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/ai/net/IAiCloudIdentifyApiService.kt @@ -0,0 +1,13 @@ +package com.mogo.eagle.core.function.business.ai.net + +import com.mogo.eagle.core.data.BaseResponse +import retrofit2.http.Body +import retrofit2.http.Headers +import retrofit2.http.POST + +interface IAiCloudIdentifyApiService { + + @Headers("Content-type:application/json;charset=UTF-8") + @POST("yycp-c-v2x-service/dataFusion/remoteDrivingSet") + suspend fun identifyRange(@Body map: MutableMap): BaseResponse +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/Identify.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/Identify.kt index e3ba3c913b..f721331dc4 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/Identify.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/Identify.kt @@ -3,16 +3,35 @@ package com.mogo.eagle.core.function.business.identify import com.mogo.eagle.core.data.traffic.TrafficData import mogo.telematics.pad.MessagePad import mogo.telematics.pad.MessagePad.TrackedObject +import mogo.yycp.api.proto.SocketDownData interface Identify { - fun renderAdasRecognizedResult(resultList: List?) + fun renderAdasRecognizedResult(resultList: List?){ - fun renderPlanningWarningObj(planningObjects: List?) + } + + fun renderAiCloudResult(resultList: List){ + + } + + fun renderPlanningWarningObj(planningObjects: List?){ + + } fun renderOBUWarningObj(exist: Boolean, obuTrafficData: TrafficData) { } - fun clearOldMarker() + fun clearOldMarker(){ + + } + + fun clearAiMarker(){ + + } + + fun getIdentifyObj(uuid: String):TrackedObject?{ + return null + } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyAiCloudDataDrawer.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyAiCloudDataDrawer.kt new file mode 100644 index 0000000000..9ebdd1c9d1 --- /dev/null +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyAiCloudDataDrawer.kt @@ -0,0 +1,102 @@ +package com.mogo.eagle.core.function.business.identify + +import android.annotation.SuppressLint +import androidx.collection.ArraySet +import com.mogo.commons.AbsMogoApplication +import com.mogo.commons.module.status.MogoStatusManager +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.w +import com.mogo.map.MogoMarkerManager +import java.util.concurrent.ConcurrentHashMap +import mogo.yycp.api.proto.SocketDownData + +class IdentifyAiCloudDataDrawer : Identify { + + companion object { + private const val TAG = "IdentifyDataDrawer" + } + + /** + * 上一帧数据的缓存 + */ + private val mMarkersCaches = ConcurrentHashMap() + + /** + * 记录每次实际绘制的交通元素UUID + */ + @SuppressLint("NewApi") + private val trafficDataUuidList = ArraySet() + + /** + * 过滤后的数据集合 + */ + @SuppressLint("NewApi") + private val mFilterTrafficData = HashMap() + + @SuppressLint("NewApi") + override fun renderAiCloudResult(resultList: List) { + if (resultList.isEmpty()) { + clearOldMarker() + w(TAG, "感知数据为空无需渲染……") + return + } + if (!MogoStatusManager.getInstance().isVrMode) { + clearOldMarker() + w(TAG, "渲染 adas 识别的数据 当前不是VR模式") + return + } + + //清除缓存 + for (data in resultList) { + if (trafficDataUuidList.size > 0 && trafficDataUuidList.contains("" + data.uuid)) { + trafficDataUuidList.remove("" + data.uuid) + } + } + + //清除缓存,删除marker + val it: MutableIterator<*> = trafficDataUuidList.iterator() + while (it.hasNext()) { + val key = it.next() as String + it.remove() + mMarkersCaches.remove(key) + MogoMarkerManager.getInstance(AbsMogoApplication.getApp()) + .removeMarker(key.hashCode().toString()) + } + + val filterList = filterTrafficData(resultList) + if (filterList.size > 0) { + // 绘制新数据 + MogoMarkerManager.getInstance(AbsMogoApplication.getApp()) + .updateBatchAiMarkerPosition(filterList) + } + } + + /** + * 数据过滤器 + * + * @return 过滤后的数据集合 + */ + @SuppressLint("NewApi") + private fun filterTrafficData(trafficData: List): HashMap { + mFilterTrafficData.clear() + trafficDataUuidList.clear() + for (data in trafficData) { + val uuid = "" + data.uuid + mMarkersCaches[uuid] = data + trafficDataUuidList.add(uuid) + mFilterTrafficData[uuid] = data + } + return mFilterTrafficData + } + + @SuppressLint("NewApi") + override fun clearAiMarker() { + trafficDataUuidList.clear() + mMarkersCaches.forEach { (uuid, _) -> + mMarkersCaches.remove(uuid) + MogoMarkerManager.getInstance(AbsMogoApplication.getApp()) + .removeMarker(uuid.hashCode().toString()) + } + mFilterTrafficData.clear() + } + +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyBeautifyDataDrawer.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyBeautifyDataDrawer.kt index aa8a35caf9..977e319371 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyBeautifyDataDrawer.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyBeautifyDataDrawer.kt @@ -61,5 +61,9 @@ class IdentifyBeautifyDataDrawer : Identify { TrackManager.getInstance().clearAll() } + override fun getIdentifyObj(uuid: String): TrackedObject? { + return TrackManager.getInstance().getIdentifyObj(uuid) + } + } diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyFactory.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyFactory.kt index 78e56df4f0..eff0c9b9b0 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyFactory.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyFactory.kt @@ -9,6 +9,7 @@ import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler import mogo.telematics.pad.MessagePad import mogo.telematics.pad.MessagePad.TrackedObject +import mogo.yycp.api.proto.SocketDownData object IdentifyFactory : Identify, IMoGoObuStatusListener { @@ -22,7 +23,12 @@ object IdentifyFactory : Identify, IMoGoObuStatusListener { internal val beautifyDataDrawer = IdentifyBeautifyDataDrawer() } + object AiIdentify { + internal val aiCloudDataDrawer = IdentifyAiCloudDataDrawer() + } + private var identify: Identify? = null + private var aiCloudIdentify: Identify? = null init { identify = if (FunctionBuildConfig.isBeautyMode) { @@ -30,14 +36,17 @@ object IdentifyFactory : Identify, IMoGoObuStatusListener { } else { DriverIdentify.originDataDrawer } + aiCloudIdentify = AiIdentify.aiCloudDataDrawer CallerObuListenerManager.addListener(TAG, this) } private const val MSG_DATA_TRACK = 0 - private const val MSG_DATA_WARNING = 1 - private const val MSG_DATA_OBU_WARNING_UPDATE = 2 - private const val MSG_DATA_OBU_WARNING_REMOVE = 3 - private const val MSG_DATA_CLEAR = 4 + private const val MSG_DATA_AI_TRACK = 1 + private const val MSG_DATA_WARNING = 2 + private const val MSG_DATA_OBU_WARNING_UPDATE = 3 + private const val MSG_DATA_OBU_WARNING_REMOVE = 4 + private const val MSG_DATA_CLEAR = 5 + private const val MSG_DATA_AI_CLEAR = 6 // 维护一个线程定时轮询数据进行地图绘制 private val mDrawerHandler: Handler = @@ -63,6 +72,11 @@ object IdentifyFactory : Identify, IMoGoObuStatusListener { identify!!.renderAdasRecognizedResult(msg.obj as List?) } } + MSG_DATA_AI_TRACK -> { + if (msg.obj is List<*>) { + aiCloudIdentify!!.renderAiCloudResult(msg.obj as List) + } + } MSG_DATA_WARNING -> { if (msg.obj is List<*>) { identify!!.renderPlanningWarningObj(msg.obj as List?) @@ -81,6 +95,9 @@ object IdentifyFactory : Identify, IMoGoObuStatusListener { MSG_DATA_CLEAR -> { identify!!.clearOldMarker() } + MSG_DATA_AI_CLEAR -> { + aiCloudIdentify!!.clearAiMarker() + } } } } @@ -92,6 +109,13 @@ object IdentifyFactory : Identify, IMoGoObuStatusListener { mDrawerHandler.sendMessage(message) } + override fun renderAiCloudResult(resultList: List) { + val message = Message.obtain() + message.what = MSG_DATA_AI_TRACK + message.obj = resultList + mDrawerHandler.sendMessage(message) + } + override fun renderPlanningWarningObj(planningObjects: List?) { val message = Message.obtain() message.what = MSG_DATA_WARNING @@ -105,6 +129,16 @@ object IdentifyFactory : Identify, IMoGoObuStatusListener { mDrawerHandler.sendMessage(message) } + override fun clearAiMarker() { + val message = Message.obtain() + message.what = MSG_DATA_AI_CLEAR + mDrawerHandler.sendMessage(message) + } + + override fun getIdentifyObj(uuid: String): TrackedObject? { + return identify?.getIdentifyObj(uuid) + } + override fun updateTrackerWarningInfo(trafficData: TrafficData) { super.updateTrackerWarningInfo(trafficData) val message = Message.obtain() diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyOriginDataDrawer.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyOriginDataDrawer.kt index 72052c3a59..1aa1fe92aa 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyOriginDataDrawer.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyOriginDataDrawer.kt @@ -136,4 +136,8 @@ class IdentifyOriginDataDrawer : Identify { WarningHelper.clear() } + override fun getIdentifyObj(uuid: String): TrackedObject? { + return mMarkersCaches[uuid] + } + } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/MapIdentifySubscriber.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/MapIdentifySubscriber.kt index d9a344ec2e..4ca9d9e1cf 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/MapIdentifySubscriber.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/MapIdentifySubscriber.kt @@ -1,12 +1,18 @@ package com.mogo.eagle.core.function.business.identify +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route import com.mogo.eagle.core.data.config.FunctionBuildConfig +import com.mogo.eagle.core.data.constants.MogoServicePaths.PATH_IDENTIFY import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener import com.mogo.eagle.core.function.api.base.IMoGoSubscriber +import com.mogo.eagle.core.function.api.map.marker.IMoGoIdentifyListener +import com.mogo.eagle.core.function.business.identify.IdentifyFactory.AiIdentify.aiCloudDataDrawer import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager import com.mogo.eagle.core.utilcode.util.ThreadUtils import mogo.telematics.pad.MessagePad import mogo.telematics.pad.MessagePad.TrackedObject +import mogo.yycp.api.proto.SocketDownData /** * 订阅感知数据的订阅者 @@ -14,7 +20,8 @@ import mogo.telematics.pad.MessagePad.TrackedObject * * @author donghongyu */ -class MapIdentifySubscriber private constructor() : IMoGoSubscriber, +@Route(path = PATH_IDENTIFY) +class MapIdentifySubscriber private constructor() : IMoGoIdentifyListener, IMoGoSubscriber, IMoGoAutopilotIdentifyListener { private val TAG = "MapIdentifySubscriber" @@ -36,7 +43,6 @@ class MapIdentifySubscriber private constructor() : IMoGoSubscriber, override fun onDestroy() { CallerAutopilotIdentifyListenerManager.removeListener(TAG) - } override fun onAutopilotIdentifyDataUpdate(trafficData: List?) { @@ -53,6 +59,26 @@ class MapIdentifySubscriber private constructor() : IMoGoSubscriber, } } + fun renderAiCloudResult(cloudData: List) { + try { + if (FunctionBuildConfig.isDrawAiCloudFusion) { + ThreadUtils.getSinglePool().execute { +// aiCloudDataDrawer.renderAiCloudResult(cloudData) + IdentifyFactory.renderAiCloudResult(cloudData) + } + } else { + clearAiCloudRoma() + } + } catch (e: Exception) { + e.printStackTrace() + } + } + + fun clearAiCloudRoma() { +// aiCloudDataDrawer.clearAiMarker() + IdentifyFactory.clearAiMarker() + } + override fun onAutopilotIdentifyPlanningObj(planningObjects: List?) { try { if (FunctionBuildConfig.isDrawIdentifyData && FunctionBuildConfig.debugTrackerProvider == 0) { @@ -67,7 +93,12 @@ class MapIdentifySubscriber private constructor() : IMoGoSubscriber, } } - override fun onAutopilotWarnMessage(warn: MessagePad.Warn?) { + override fun getIdentifyObj(uuid: String): TrackedObject? { + return IdentifyFactory.getIdentifyObj(uuid) + } + + override fun init(context: Context?) { } + } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackManager.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackManager.java index 907f04ce8d..b06fe8bdfd 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackManager.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackManager.java @@ -163,4 +163,13 @@ public class TrackManager { mMarkersCaches.forEach((uuid, trackObj) -> removeKey(uuid)); } + public MessagePad.TrackedObject getIdentifyObj(String uuid) { + TrackObj trackObj = mMarkersCaches.get(uuid); + if (trackObj != null && trackObj.getCache() != null) { + return trackObj.getCache(); + } else { + return null; + } + } + } diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackObj.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackObj.java index 4efa56ce58..b715d16ebf 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackObj.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackObj.java @@ -23,9 +23,8 @@ public class TrackObj { private S2CellId s2CellId; //s2 id权重 private S2LatLng s2LatLng; //s2 经纬度 private double recentlyTime; //用于缓存帧数判断,暂定缓存1秒数据,中间如果有物体未出现,1秒后删除 - private double roadAngle; //道路航向 - private int[] typeArray = new int[3]; - private int typeWeight; //类型权重 +// private int[] typeArray = new int[3]; +// private int typeWeight; //类型权重 private double lat; private double lon; private double speedAverage; @@ -37,11 +36,6 @@ public class TrackObj { lon = data.getLongitude(); s2LatLng = S2LatLng.fromDegrees(data.getLatitude(), data.getLongitude()); s2CellId = S2CellId.fromLatLng(s2LatLng).parent(22); //需要验证22前后 - CenterLine centerLine = CallerHDMapManager.INSTANCE.getCenterLineInfo(lon, lat, -1); - if (centerLine != null && centerLine.getAngle() != 0) { - roadAngle = centerLine.getAngle(); - } - } private MessagePad.TrackedObject cacheData; @@ -68,20 +62,20 @@ public class TrackObj { objQueueList.sort(Comparator.comparing(ObjQueue::getSpeed)); speedAverage = objQueueList.get(1).getSpeed(); //计算类型 - typeArray[0] = objQueueList.get(0).getType(); - typeArray[1] = objQueueList.get(1).getType(); - typeArray[2] = objQueueList.get(2).getType(); +// typeArray[0] = objQueueList.get(0).getType(); +// typeArray[1] = objQueueList.get(1).getType(); +// typeArray[2] = objQueueList.get(2).getType(); } else { double cal = 0; List objQueueList = circleQueue.getPreFrame(); for (int i = 0; i < objQueueList.size() - 1; i++) { cal += objQueueList.get(i).getSpeed(); - typeArray[i] = objQueueList.get(i).getType(); +// typeArray[i] = objQueueList.get(i).getType(); } speedAverage = cal / objQueueList.size(); } - typeArray = Arrays.stream(typeArray).sorted().toArray(); - typeWeight = typeArray[typeArray.length / 2] == 0 ? cacheData.getType() : typeArray[typeArray.length / 2]; +// typeArray = Arrays.stream(typeArray).sorted().toArray(); +// typeWeight = typeArray[typeArray.length / 2] == 0 ? cacheData.getType() : typeArray[typeArray.length / 2]; // 重新给静止物体赋值速度 if (relativeStatic()) { @@ -107,18 +101,18 @@ public class TrackObj { private void calHeading() { //更正数据,速度小于LIMIT_SPEED使用上一帧数据 - if (relativeStatic()) { - if (roadAngle != 0.0) { - CenterLine centerLine = CallerHDMapManager.INSTANCE.getCenterLineInfo(lon, lat, -1); - if (centerLine != null && centerLine.getAngle() != 0) { - cacheData = cacheData.toBuilder().setHeading(centerLine.getAngle()).build(); - } else { - cacheData = cacheData.toBuilder().setHeading(circleQueue.getLastFrame().getHeading()).build(); - } - } else { - cacheData = cacheData.toBuilder().setHeading(circleQueue.getLastFrame().getHeading()).build(); - } - } +// if (relativeStatic()) { +// if (roadAngle != 0.0) { +// CenterLine centerLine = CallerHDMapManager.INSTANCE.getCenterLineInfo(lon, lat, -1); +// if (centerLine != null && centerLine.getAngle() != 0) { +// cacheData = cacheData.toBuilder().setHeading(centerLine.getAngle()).build(); +// } else { +// cacheData = cacheData.toBuilder().setHeading(circleQueue.getLastFrame().getHeading()).build(); +// } +// } else { +// cacheData = cacheData.toBuilder().setHeading(circleQueue.getLastFrame().getHeading()).build(); +// } +// } } public double getRecentlyTime() { @@ -167,11 +161,11 @@ public class TrackObj { } } - public boolean isFourWheelType() { - return typeWeight != TrafficTypeEnum.TYPE_TRAFFIC_ID_PEOPLE.getType() - && typeWeight != TrafficTypeEnum.TYPE_TRAFFIC_ID_BICYCLE.getType() - && typeWeight != TrafficTypeEnum.TYPE_TRAFFIC_ID_MOTO.getType(); - } +// public boolean isFourWheelType() { +// return typeWeight != TrafficTypeEnum.TYPE_TRAFFIC_ID_PEOPLE.getType() +// && typeWeight != TrafficTypeEnum.TYPE_TRAFFIC_ID_BICYCLE.getType() +// && typeWeight != TrafficTypeEnum.TYPE_TRAFFIC_ID_MOTO.getType(); +// } private double[] getCenterPoint(List objQueueList) { int total = objQueueList.size(); diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackerSourceColorHelper.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackerSourceColorHelper.kt index 68abd5926b..bc96ab3770 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackerSourceColorHelper.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackerSourceColorHelper.kt @@ -9,9 +9,8 @@ object TrackerSourceColorHelper { @SuppressLint("NewApi") fun filterData(data: TrackedObject): Boolean { - if (!FunctionBuildConfig.isDrawUnknownIdentifyData && data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI.type - || data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_501.type || data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_502.type - ) { + if (!FunctionBuildConfig.isDrawUnknownIdentifyData && (data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI.type + || data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_501.type || data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_502.type)) { return true } var trackIPCFilter = true diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/drawer/MarkerDrawer.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/drawer/MarkerDrawer.java index 63bba6385f..7195182391 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/drawer/MarkerDrawer.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/drawer/MarkerDrawer.java @@ -5,6 +5,7 @@ import android.text.TextUtils; import com.mogo.cloud.commons.utils.CoordinateUtils; import com.mogo.commons.AbsMogoApplication; import com.mogo.commons.module.status.MogoStatusManager; +import com.mogo.eagle.core.data.enums.EventTypeEnumNew; import com.mogo.eagle.core.data.map.MogoLatLng; import com.mogo.eagle.core.data.map.entity.MarkerExploreWay; import com.mogo.eagle.core.data.map.entity.MarkerNoveltyInfo; @@ -19,7 +20,6 @@ import com.mogo.map.MogoMarkerManager; import com.mogo.map.marker.IMogoMarker; import com.mogo.map.marker.IMogoMarkerClickListener; import com.mogo.map.marker.MogoMarkerOptions; -import com.mogo.eagle.core.data.enums.EventTypeEnum; /** * @author congtaowang @@ -81,7 +81,7 @@ public class MarkerDrawer { Object bindObj = markerShowEntity.getBindObj(); if (bindObj instanceof MarkerExploreWay && ((MarkerExploreWay) bindObj).getPoiType() != null) { String poiType = ((MarkerExploreWay) bindObj).getPoiType(); - options.icon3DRes(EventTypeEnum.getMarker3DRes(poiType)); + options.icon3DRes(EventTypeEnumNew.getMarker3DRes(poiType)); } } diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/drawer/TrafficMarkerDrawer.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/drawer/TrafficMarkerDrawer.kt index 3527a4a31f..785e7f24df 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/drawer/TrafficMarkerDrawer.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/impl/marker/drawer/TrafficMarkerDrawer.kt @@ -101,7 +101,7 @@ object TrafficMarkerDrawer { fun updateITrafficThreatLevelInfo(trafficData: TrafficData) { CallerLogger.d(TAG, "trafficData.type = " + trafficData.type + "---trafficData.threatLevel = " + trafficData.threatLevel + "----FunctionBuildConfig.debugTrackerProvider = " + FunctionBuildConfig.debugTrackerProvider) - if (FunctionBuildConfig.debugTrackerProvider != 1) { + if (FunctionBuildConfig.debugTrackerProvider != 1) { return } if (trafficData != null && !TextUtils.isEmpty(trafficData.uuid)) { @@ -128,6 +128,10 @@ object TrafficMarkerDrawer { fun removeCvxRvInfoIndInfo(key: String) { if (mTrafficMap.containsKey(key)) { mTrafficMap.remove(key) + mMarkersCaches.get(key)?.let { + it.remove() + } + } } diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.java index 4add2174dc..3420ce4ae9 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.java @@ -9,12 +9,14 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.alibaba.android.arouter.facade.annotation.Route; +import com.mogo.commons.AbsMogoApplication; import com.mogo.commons.mvp.MvpFragment; import com.mogo.eagle.core.data.constants.MoGoFragmentPaths; import com.mogo.eagle.core.data.map.CenterLine; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener; import com.mogo.eagle.core.function.api.map.hd.IMoGoMapFragmentProvider; import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener; +import com.mogo.eagle.core.function.business.ai.AiCloudIdentifyDataManager; import com.mogo.eagle.core.function.business.identify.MapIdentifySubscriber; import com.mogo.eagle.core.function.business.MapPointCloudSubscriber; import com.mogo.eagle.core.function.business.routeoverlay.MogoRouteOverlayManager; @@ -191,6 +193,7 @@ public class MapFragment extends MvpFragment MapIdentifySubscriber.Companion.getInstance(); MogoRouteOverlayManager.getInstance().init(); MapPointCloudSubscriber.Companion.getInstance(); + AiCloudIdentifyDataManager.Companion.getAiCloudIdentifyDataManager().init(AbsMogoApplication.getApp()); } private void queryInfStructure() { diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/remote/V2XEventResult.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/remote/V2XEventResult.kt index e57241ae53..e9138cb04e 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/remote/V2XEventResult.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/remote/V2XEventResult.kt @@ -38,8 +38,11 @@ data class V2XEvent( @SerializedName("radius") var radius: Double, - @SerializedName("type") - var type: Int + @SerializedName("poiType") + var poiType: String?, + + @SerializedName("coordinateType") + var coordinateType:Int? = null ) @Keep diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/vm/OverViewModel.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/vm/OverViewModel.kt index eb67733969..9250e8fd6e 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/vm/OverViewModel.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/vm/OverViewModel.kt @@ -8,6 +8,8 @@ import com.mogo.eagle.core.function.overview.OverviewDao import com.mogo.eagle.core.function.overview.remote.OverViewServiceApi import com.mogo.eagle.core.function.overview.remote.V2XEvent import com.mogo.eagle.core.network.MoGoRetrofitFactory +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant import io.reactivex.Observable import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.disposables.Disposable @@ -22,6 +24,10 @@ class OverViewModel( private val _V2XEvents = MutableLiveData>() private var disposable: Disposable? = null + companion object { + const val TAG = "OverViewModel" + } + val infStructures get() = _infStructures @@ -90,8 +96,10 @@ class OverViewModel( .queryAllV2XEventsByLineId(lineId.toString(), sn) .map { if (it.code == 200 || it.code == 0) { + CallerLogger.d(SceneConstant.M_MAP + TAG, "请求成功,size为:${it.result?.v2XEventList?.size}") return@map it.result?.v2XEventList } else { + CallerLogger.d(SceneConstant.M_MAP + TAG, "请求失败,code为:${it.code}") return@map ArrayList() } } @@ -121,7 +129,12 @@ class OverViewModel( if (parameter != null) { if (parameter.autoPilotLine != null) { lineId = parameter.autoPilotLine!!.lineId + CallerLogger.d(SceneConstant.M_MAP + TAG, "lineId为:$lineId") + } else { + CallerLogger.d(SceneConstant.M_MAP + TAG, "parameter.autoPilotLine为null") } + } else { + CallerLogger.d(SceneConstant.M_MAP + TAG, "parameter为null") } return lineId } diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java index e6d7bb9401..31e96cdde7 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java @@ -268,10 +268,16 @@ public class AMapCustomView if (center != null) { center.getLon(); MarkerOptions markerOption = new MarkerOptions(); - LatLng latLng = MarkerDrawerManager.INSTANCE.coordinateConverterWgsToGcj(mContext, center.getLat(), center.getLon()); + LatLng latLng; + if (event.getCoordinateType() == null || event.getCoordinateType() == 0) { + latLng = new LatLng(center.getLat(), center.getLon()); + } else { + // wgs84坐标系需转成高德坐标系 + latLng = MarkerDrawerManager.INSTANCE.coordinateConverterWgsToGcj(mContext, center.getLat(), center.getLon()); + } markerOption.position(latLng); markerOption.anchor(0.13f, 1f); - markerOption.icon(BitmapDescriptorFactory.fromBitmap(getV2XBitmap())); + markerOption.icon(BitmapDescriptorFactory.fromBitmap(getV2XBitmap(event.getPoiType()))); markerOptionsList.add(markerOption); } } @@ -284,8 +290,8 @@ public class AMapCustomView currMarkerList = mAMap.addMarkers(markerOptionsList, false); } - private Bitmap getV2XBitmap() { - V2XMarkerView marker = new V2XMarkerView(getContext()); + private Bitmap getV2XBitmap(String poiType) { + V2XMarkerView marker = new V2XMarkerView(getContext(), null, 0, poiType); marker.measure(View.MeasureSpec.makeMeasureSpec(AutoSizeUtils.dp2px(mContext, 229), View.MeasureSpec.EXACTLY), View.MeasureSpec.makeMeasureSpec(AutoSizeUtils.dp2px(mContext, 96), View.MeasureSpec.EXACTLY)); marker.layout(0, 0, marker.getMeasuredWidth(), marker.getMeasuredHeight()); diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapFragment.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapFragment.java index 129bf728c3..c8b5804dd4 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapFragment.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapFragment.java @@ -141,12 +141,12 @@ public class SmallMapFragment extends BaseFragment @Override public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autoPilotStatusInfo) { int tempStatus = autoPilotStatusInfo.getPilotmode(); - CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotStatusResponse:"+tempStatus+" autoPilotStatus:"+autoPilotStatus); +// CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotStatusResponse:"+tempStatus+" autoPilotStatus:"+autoPilotStatus); if (tempStatus != 1) { - CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotStatusResponse:"+tempStatus+" clearPolyline"); +// CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotStatusResponse:"+tempStatus+" clearPolyline"); clearPolyline(); }else if (tempStatus == 1 && autoPilotStatus == 0){ - CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotStatusResponse:getGlobalPath"); +// CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotStatusResponse:getGlobalPath"); CallerAutoPilotManager.INSTANCE.getGlobalPath(); } autoPilotStatus = tempStatus; diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/V2XMarkerView.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/V2XMarkerView.kt index a776a29073..687ec34f1b 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/V2XMarkerView.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/V2XMarkerView.kt @@ -3,14 +3,16 @@ package com.mogo.eagle.core.function.smp import android.content.Context import android.util.AttributeSet import android.view.LayoutInflater +import android.widget.ImageView +import android.widget.TextView import androidx.constraintlayout.widget.ConstraintLayout import com.mogo.eagle.core.function.map.R -import kotlinx.android.synthetic.main.view_maker_with_count.view.* class V2XMarkerView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, - defStyleAttr: Int = 0 + defStyleAttr: Int = 0, + private val poiType: String? = "" ) : ConstraintLayout ( context, attrs, @@ -19,5 +21,33 @@ class V2XMarkerView @JvmOverloads constructor( init { LayoutInflater.from(context).inflate(R.layout.layout_v2x_maker, this, true) + initView() + } + + private fun initView() { + val iconView = findViewById(R.id.ivIcon) + val contentView = findViewById(R.id.tvContent) + when (poiType) { + "10006" -> { + iconView.setBackgroundResource(R.drawable.icon_small_v2x_road_construction) + contentView.text = "道路施工" + } + "10007" -> { + iconView.setBackgroundResource(R.drawable.icon_v2x_road_congestion) + contentView.text = "道路拥堵" + } + "10032" -> { + iconView.setBackgroundResource(R.drawable.icon_v2x_road_accidents) + contentView.text = "道路事故" + } + "10025" -> { + iconView.setBackgroundResource(R.drawable.icon_v2x_obstacle) + contentView.text = "障碍车辆" + } +// "10031" -> { +// iconView.setBackgroundResource(R.drawable.icon_small_v2x_road_construction) +// contentView.text = "弱势预警" +// } + } } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-map/src/main/res/layout/layout_v2x_maker.xml b/core/function-impl/mogo-core-function-map/src/main/res/layout/layout_v2x_maker.xml index 8a5ee087ea..d105f5057d 100644 --- a/core/function-impl/mogo-core-function-map/src/main/res/layout/layout_v2x_maker.xml +++ b/core/function-impl/mogo-core-function-map/src/main/res/layout/layout_v2x_maker.xml @@ -19,7 +19,7 @@ /> { + MsgBoxType.V2X -> { + // 汇总消息不存数据库 + if (msg.sourceType != DataSourceType.SUMMARY) { + synchronized(this) { + notifyList.add(msg) + } + } + CallerMsgBoxListenerManager.invokeListener(MsgCategory.NOTICE, msg) + } + MsgBoxType.OBU, MsgBoxType.NOTICE, MsgBoxType.OPERATION -> { synchronized(this) { notifyList.add(msg) } diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/AndroidManifest.xml b/core/function-impl/mogo-core-function-obu-mogo/src/main/AndroidManifest.xml index dc0250ec9b..1f72d0c85c 100644 --- a/core/function-impl/mogo-core-function-obu-mogo/src/main/AndroidManifest.xml +++ b/core/function-impl/mogo-core-function-obu-mogo/src/main/AndroidManifest.xml @@ -33,6 +33,13 @@ + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MoGoObuProvider.kt b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MoGoObuProvider.kt index 9d8693a859..a4de8e25d8 100644 --- a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MoGoObuProvider.kt +++ b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MoGoObuProvider.kt @@ -32,7 +32,9 @@ class MoGoObuProvider : IMoGoObuProvider { } override fun init(context: Context) { - CallerLogger.d("$M_OBU$TAG", "初始化蘑菇自研OBU…… localIp = " + CommonUtils.getLocalIPAddress() + "--") + //obu融合数据 +// MogoObuDcCombineManager.INSTANCE.init(context) + CallerLogger.d("$M_OBU$TAG", "初始化蘑菇自研OBU…… localIp = " + CommonUtils.getLocalIPAddress()) //bus乘客版本obu功能去掉 if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger( FunctionBuildConfig.appIdentityMode @@ -55,8 +57,6 @@ class MoGoObuProvider : IMoGoObuProvider { //old obu MogoPrivateObuManager.INSTANCE.init(context, ipAddress) - CallerLogger.d("$M_OBU$TAG", "bus 司机 ipAddress = $ipAddress ---localIp = ${CommonUtils.getIpAddressString()}") - } else if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) { //taxi 司机端和乘客端 val ipAddress = SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, taxiObuIp) @@ -69,7 +69,6 @@ class MoGoObuProvider : IMoGoObuProvider { //old obu MogoPrivateObuManager.INSTANCE.init(context, ipAddress) - CallerLogger.d("$M_OBU$TAG", "taxi 司机端和乘客端 ipAddress = $ipAddress ---localIp = ${CommonUtils.getIpAddressString()}") } } } diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoObuDcCombineManager.kt b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoObuDcCombineManager.kt new file mode 100644 index 0000000000..11b19e241b --- /dev/null +++ b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoObuDcCombineManager.kt @@ -0,0 +1,665 @@ +package com.mogo.eagle.core.function.obu.mogo + +import android.content.Context +import android.util.Log +import com.mogo.eagle.core.data.config.HmiBuildConfig +import com.mogo.eagle.core.data.enums.EventTypeEnumNew +import com.mogo.eagle.core.data.enums.WarningDirectionEnum +import com.mogo.eagle.core.data.msgbox.DataSourceType +import com.mogo.eagle.core.data.msgbox.MsgBoxBean +import com.mogo.eagle.core.data.msgbox.MsgBoxType +import com.mogo.eagle.core.data.msgbox.V2XMsg +import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener +import com.mogo.eagle.core.function.api.obucombine.IMoGoObuDcCombineListener +import com.mogo.eagle.core.function.call.hmi.CallerHmiManager +import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager +import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager +import com.mogo.eagle.core.function.call.obucombine.CallerObuDcCombineListenerManager +import com.mogo.eagle.core.function.obu.mogo.utils.TrafficDataConvertDcCombineUtils +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU +import com.mogo.support.obu.constants.MogoObuConstants +import mogo.v2x.ObuWarningEvent +import mogo.v2x.ObuWarningEvent.* + + +/** + * + * @author lixiaopeng + * @since 2021/11/30 + * @description 工控机融合数据 + */ +class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener { + companion object { + val INSTANCE: MogoObuDcCombineManager by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) { + MogoObuDcCombineManager() + } + } + + private var mContext: Context? = null + private val TAG = "MogoObuDcCombineManager" + + + fun init(context: Context) { + mContext = context + CallerObuDcCombineListenerManager.addListener(TAG, this) + } + + fun destoryListener() { + CallerObuDcCombineListenerManager.removeListener(TAG) + } + + /** + * 通过工控机中转的obu数据,包括rsi,rsm,spat + * + */ + override fun onMoGoObuDcCombineData(obuWarningData: ObuWarningEvent.ObuWarningData?) { + CallerLogger.d( + "${M_OBU}${TAG}", + "MogoObuDcCombineManager onMoGoObuDcCombineData obuWarningData = ${obuWarningData.toString()} ---obuWarningData.msgDataType = ${obuWarningData?.msgDataType}" + ) + + obuWarningData?.let { + when (obuWarningData.msgDataType) { + 1 -> { //rsiEvent + onMogoObuDcRsiWarning(obuWarningData.rsiEvent) + } + + 2 -> { //RsmEvent + onMogoObuDcRsmWarning(obuWarningData.rsmEvent) + } + + 3 -> { //SpatEvent + onMogoObuDcSpatWarning(obuWarningData.spatEvent) + } + + 4 -> { //map + onMogoObuMapMath(obuWarningData.mapMatchData) + } + } + } + + } + + /** + * RSI预警信息 CvxRtiThreatIndInfo(交通标志预警(前方限速、前方学校等等),交通事件预警(前方拥堵、前方积水等等)) + */ + fun onMogoObuDcRsiWarning(rsiWarningData: RsiWarningData?) { + CallerLogger.d( + "${M_OBU}${TAG}", + "MogoObuDcCombineManager onMogoObuRsiWarning ------> ${rsiWarningData.toString()}" + ) + if (rsiWarningData != null && rsiWarningData.warningMsgList != null && rsiWarningData.warningMsgList.size > 0) { + var alertContent = "" + var ttsContent = "" //TODO 列表还是只有一项吗? + var appId = rsiWarningData.warningMsgList[0].sceneType.toString() + val status = rsiWarningData.status + val level = rsiWarningData.warningMsgList[0].warningLevel + val direction = getMessageDirection(rsiWarningData.warningMsgList[0].targetPosition) + CallerLogger.d("${M_OBU}${TAG}", + "MogoObuDcCombineManager onMogoObuDcRsiWarning appId = $appId --status = $status --level = $level -- eventSerialNum = ${rsiWarningData.warningMsgList[0].eventSerialNum} ---signSerialNum = ${rsiWarningData.warningMsgList[0].signSerialNum} --- direction = $direction -- targetPosition = ${rsiWarningData.warningMsgList[0].targetPosition}" + ) + + when (appId) { + // 道路危险情况预警 + MogoObuConstants.RSI_SCENE_TYPE.HLW.toString() -> { + when (rsiWarningData.warningMsgList[0].eventSerialNum) { + MogoObuConstants.RTE.RTI_TYPE_BREAKDOWN -> {//车辆故障 + appId = EventTypeEnumNew.TYPE_USECASE_ID_BREAKDOWN_WARNING.poiType + } + MogoObuConstants.RTE.RTI_TYPE_ROAD_WATER -> { //道路积水 + appId = EventTypeEnumNew.FOURS_PONDING.poiType + } + MogoObuConstants.RTE.RTI_TYPE_PARKING_VIOLATION -> { //异常停车 + appId = EventTypeEnumNew.TYPE_USECASE_ID_ROAD_PARKING.poiType + } +// MogoObuConstants.RTE.RTI_TYPE_CONSTRUCTION_RTE -> { //施工占道,和标牌重复 +// appId = EventTypeEnumNew.FOURS_ROAD_WORK.poiType +// } + MogoObuConstants.RTE.RTI_TYPE_SPEEDING -> { //超速行驶 + appId = EventTypeEnumNew.TYPE_USECASE_ID_SLW.poiType + } + MogoObuConstants.RTE.RTI_TYPE_RETRIGRADE -> { //车辆逆行 + appId = + EventTypeEnumNew.TYPE_USECASE_ID_ROAD_VEHICLE_RETROGRADE.poiType + } + } + alertContent = EventTypeEnumNew.getWarningContent(appId) + ttsContent = EventTypeEnumNew.getWarningTts(appId) + alertContent = String.format( //事件才有影响范围 + alertContent, + Math.round(rsiWarningData.warningMsgList[0].distance / 100.0).toString(), + Math.round(rsiWarningData.warningMsgList[0].eventRadius / 10.0).toString() + ) + ttsContent = String.format( + ttsContent, + Math.round(rsiWarningData.warningMsgList[0].distance / 100.0).toString(), + Math.round(rsiWarningData.warningMsgList[0].eventRadius / 10.0).toString() + ) + } + + //车内标牌 + MogoObuConstants.RSI_SCENE_TYPE.IVS.toString() -> { + when (rsiWarningData.warningMsgList[0].signSerialNum) { +// MogoObuConstants.RTS.RTI_TYPE_INTERSECTION -> { //十字路口 +// appId = V2iEventTypeEnum.TYPE_ID_NTERSECTION.poiType +// } + MogoObuConstants.RTS.RTI_TYPE_SHAPR_TURNS -> { //急转弯 + appId = EventTypeEnumNew.TYPE_ID_SHAPR_TURNS.poiType + } + MogoObuConstants.RTS.RTI_TYPE_BRIDGE -> { //桥梁 + appId = EventTypeEnumNew.TYPE_ID_BRIDGE.poiType + } + MogoObuConstants.RTS.RTI_TYPE_PEDESTRIAN -> { //行人 + appId = EventTypeEnumNew.TYPE_ID_PEDESTRIAN.poiType + } + MogoObuConstants.RTS.RTI_TYPE_SLIPPERY_ROAD -> { //路滑 + appId = EventTypeEnumNew.TYPE_ID_SLIPPERY_ROAD.poiType + } + MogoObuConstants.RTS.RTI_TYPE_TUNNEL -> { //隧道 + appId = EventTypeEnumNew.TYPE_ID_TUNNEL.poiType + } + MogoObuConstants.RTS.RTI_TYPE_FERRY -> { //渡轮 + appId = EventTypeEnumNew.TYPE_ID_FERRY.poiType + } + MogoObuConstants.RTS.RTI_TYPE_UNEVEN_ROAD -> { //路面不平 + appId = EventTypeEnumNew.TYPE_ID_UNEVEN_ROAD.poiType + } + MogoObuConstants.RTS.RTI_TYPE_NON_MOTOR_VEHICLE -> { //非机动车 + appId = EventTypeEnumNew.TYPE_ID_NON_MOTOR_VEHICLE.poiType + } + MogoObuConstants.RTS.RTI_TYPE_OBSTACLE -> { //障碍 + appId = EventTypeEnumNew.TYPE_ID_OBSTACLE.poiType + } + MogoObuConstants.RTS.RTI_TYPE_CONSTRUCTION -> { //施工 + appId = EventTypeEnumNew.TYPE_FOURS_ROAD_WORK.poiType + } + MogoObuConstants.RTS.RTI_TYPE_VEHICLE_QUEUE -> { //车队 + appId = EventTypeEnumNew.TYPE_VEHICLE_QUEUE.poiType + } + MogoObuConstants.RTS.RTI_TYPE_NO_PASSING -> { //不通 + appId = EventTypeEnumNew.TYPE_NO_PASSING.poiType + } + MogoObuConstants.RTS.RTI_TYPE_NO_TURNING_AROUND -> { //禁止掉头 + appId = EventTypeEnumNew.TYPE_NO_TURNING_AROUND.poiType + } + MogoObuConstants.RTS.RTI_TYPE_NO_STOPPING -> { //禁止停车 + appId = EventTypeEnumNew.TYPE_USECASE_ID_ROAD_NO_PARKING.poiType + } + MogoObuConstants.RTS.RTI_TYPE_NO_TOOTING -> { //禁止鸣笛 + appId = EventTypeEnumNew.TYPE_USECASE_ID_ROAD_NO_TOOTING.poiType + } + MogoObuConstants.RTS.RTI_TYPE_SPEED_LIMIT -> { //限速 + appId = EventTypeEnumNew.TYPE_USECASE_ID_ROAD_SPEED_LIMIT.poiType + } +// MogoObuConstants.RTS.RTI_TYPE_GO_STRAIGHT_TURN_RIGHT -> { //直行或右转 +// appId = +// EventTypeEnumNew.TYPE_USECASE_ID_GO_STRAIGHT_TURN_RIGHT.poiType +// } + MogoObuConstants.RTS.RTI_TYPE_BUS_WARNING -> { //公交提醒 + appId = EventTypeEnumNew.TYPE_USECASE_ID_BUS_WARNING.poiType + } + MogoObuConstants.RTS.RTI_TYPE_NARROW_RIGHT -> { //右侧变窄/车道数减少 + appId = EventTypeEnumNew.TYPE_USECASE_ID_NARROW_RIGHT.poiType + } + MogoObuConstants.RTS.RTI_TYPE_GAS_STATION -> { //加油站 + appId = EventTypeEnumNew.TYPE_USECASE_ID_GAS_STATION.poiType + } + MogoObuConstants.RTS.RTI_TYPE_SCHOOL -> { //学校 + appId = + EventTypeEnumNew.TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL.poiType + } + MogoObuConstants.RTS.RTI_TYPE_ACCIDENT -> { //事故 + appId = EventTypeEnumNew.TYPE_USECASE_ID_ACCIDENT.poiType + } + } + + alertContent = EventTypeEnumNew.getWarningContent(appId) + ttsContent = EventTypeEnumNew.getWarningTts(appId) + alertContent = String.format( //标牌是没有影响范围的 + alertContent, + Math.round(rsiWarningData.warningMsgList[0].distance / 100.0).toString() + ) + ttsContent = String.format( + ttsContent, + Math.round(rsiWarningData.warningMsgList[0].distance / 100.0).toString() + ) + } + + // 拥堵 + MogoObuConstants.RSI_SCENE_TYPE.TJW.toString() -> { + appId = EventTypeEnumNew.TYPE_USECASE_ID_TJW.poiType + alertContent = EventTypeEnumNew.getWarningContent(appId) + ttsContent = EventTypeEnumNew.getWarningTts(appId) + alertContent = String.format( //事件才有影响范围 + alertContent, + Math.round(rsiWarningData.warningMsgList[0].distance / 100.0).toString(), + Math.round(rsiWarningData.warningMsgList[0].eventRadius / 10.0).toString() + ) + ttsContent = String.format( + ttsContent, + Math.round(rsiWarningData.warningMsgList[0].distance / 100.0).toString(), + Math.round(rsiWarningData.warningMsgList[0].eventRadius / 10.0).toString() + ) + } + + //限速预警, ADD处理一次 + MogoObuConstants.RSI_SCENE_TYPE.SLW.toString() -> { + alertContent = EventTypeEnumNew.getWarningContent(appId) + ttsContent = EventTypeEnumNew.getWarningTts(appId) + } + } + + CallerLogger.d( + "${M_OBU}${TAG}", + "MogoObuDcCombineManager ttsContent = $ttsContent --alertContent = $alertContent --appId = $appId ---direction = ${direction.direction} --distance = ${rsiWarningData.warningMsgList[0].distance} ---eventRadius = ${rsiWarningData.warningMsgList[0].eventRadius} --speedMaxLimit = ${rsiWarningData.warningMsgList[0].speedMaxLimit}" + ) + when (status) { + // 添加 + MogoObuConstants.STATUS.ADD -> { + //显示警告红边 + CallerHmiManager.showWarning(direction) + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.V2X, + V2XMsg( + appId, + alertContent, + ttsContent + ) + ).apply { + sourceType = DataSourceType.TELEMATIC + } + ) + CallerHmiManager.warningV2X( + appId, + alertContent, + ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 + (appId + direction.direction),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的 + object : IMoGoWarningStatusListener { + override fun onDismiss() { + // 关闭警告红边 + CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON) + } + }, + true, + 5000L + ) + + // 更新数据,是否需要 +// TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(rsiWarningData)?.let { +// CallerMapUIServiceManager.getMarkerService() +// ?.updateITrafficThreatLevelInfo(it) +// } + } + + MogoObuConstants.STATUS.UPDATE -> { // 更新 + } + + // 删除 + MogoObuConstants.STATUS.DELETE -> { + // 关闭警告红边 +// CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON) + // 移除顶部弹窗 + CallerHmiManager.disableWarningV2X((appId + direction.direction)) + // 更新数据,删除标牌? +// TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(rsiWarningData) +// ?.let { +// // 事件结束,还原车辆颜色 +// it.threatLevel = 0x01 +// CallerMapUIServiceManager.getMarkerService() +// ?.updateITrafficInfo(it) +// } + } + } + } + } + + /** + * RSM预警信息 CvxPtcThreatIndInfo CvxPtcInfoIndInfo(主车与弱势交通参与者之间的预警(如:弱势交通参与者碰撞预警)) + */ + fun onMogoObuDcRsmWarning(rsmWarningData: RsmWarningData?) { + if (HmiBuildConfig.isShowObuWeaknessTrafficView) { + CallerLogger.d( + "${M_OBU}${TAG}", + "MogoObuDcCombineManager onMogoObuRsmWarning ------> ${rsmWarningData.toString()}" + ) + // 交通参与者类型 0x0:未知 UNKNOWN | 1机动车 2:非机动车 NON_MOTOR | 3:行人 PEDESTRIAN 4:obu + if (rsmWarningData != null && rsmWarningData.participantOfOne != null) { + var v2xType = "" + if (rsmWarningData.participantOfOne.ptcType == 1) { //机动车 + v2xType = + EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES.poiType + } else if (rsmWarningData.participantOfOne.ptcType == 2) { //非机动车 + v2xType = + EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_NOT_MOTOR_VEHICLES.poiType + } else if (rsmWarningData.participantOfOne.ptcType == 3) { //行人 + v2xType = + EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_PERSON.poiType + } else { //未知 + v2xType = EventTypeEnumNew.TYPE_ERROR.poiType + } + val ttsContent = EventTypeEnumNew.getWarningTts(v2xType) + val alertContent = + EventTypeEnumNew.getWarningContent(v2xType) + var level = -1 + val direction = + getMessageDirection(rsmWarningData.participantOfOne.targetPosition) //TODO 只有一个 + if (rsmWarningData.warningMsg != null && rsmWarningData.warningMsg.warningDataList != null && rsmWarningData.warningMsg.warningDataList.size > 0) { + level = rsmWarningData.warningMsg.warningDataList[0].warningLevel + CallerLogger.d( + "${M_OBU}${TAG}", + "MogoObuDcCombineManager onMogoObuRsmWarning ---status---> ${rsmWarningData.status} --list status----> ${rsmWarningData.warningMsg.warningDataList.get(0).status} --v2xType--- $v2xType ---alertContent = $alertContent ---ttsContent= $ttsContent" + ) + + when (rsmWarningData.warningMsg.warningDataList.get(0).status) { + MogoObuConstants.STATUS.ADD -> { // 添加 + //显示警告红边 + CallerHmiManager.showWarning(direction) + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.V2X, + V2XMsg( + v2xType, + alertContent, + ttsContent + ) + ).apply { + sourceType = DataSourceType.TELEMATIC + } + ) + CallerHmiManager.warningV2X( + v2xType, + alertContent, + ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 + (v2xType + direction.direction),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的 + object : IMoGoWarningStatusListener { + override fun onDismiss() { + // 关闭警告红边 + CallerHmiManager.showWarning( + WarningDirectionEnum.ALERT_WARNING_NON + ) + } + }, + true, + 5000L + ) + + // 更新数据 TODO + TrafficDataConvertDcCombineUtils.cvxPtcThreatIndInfo2TrafficData(rsmWarningData)?.let { +// TrafficMarkerDrawer.updateITrafficThreatLevelInfo(it) + CallerMapUIServiceManager.getMarkerService() + ?.updateITrafficThreatLevelInfo(it) + } + } + + MogoObuConstants.STATUS.UPDATE -> {// 更新 + } + + // 删除 + MogoObuConstants.STATUS.DELETE -> { + // 关闭警告红边 + CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON) + // 更新数据 TODO 由于obu通过域控需要转换单位,这里临时转换,后面3.0不需要转换 + TrafficDataConvertDcCombineUtils.cvxPtcThreatIndInfo2TrafficData(rsmWarningData)?.let { + // 事件结束,还原交通参与者颜色 + it.threatLevel = 0x01 +// TrafficMarkerDrawer.updateITrafficThreatLevelInfo(it) + CallerMapUIServiceManager.getMarkerService() + ?.updateITrafficThreatLevelInfo(it) + } + //删除弱势交通元素 + CallerMapUIServiceManager.getMarkerService() + ?.removeCvxRvInfoIndInfo(rsmWarningData.participantOfOne.ptcID.toString()) +// TrafficMarkerDrawer.removeCvxRvInfoIndInfo(rsmWarningData.participantOfOne.ptcID.toString()) + } + } + } + } + } + + } + + /** + * 红绿灯预警信息 + */ + fun onMogoObuDcSpatWarning(spatWarningData: SpatWarningData?) { + CallerLogger.d("${M_OBU}${TAG}", "onMogoObuDcSpatWarning warningType = ${spatWarningData!!.warningType} --status = ${spatWarningData?.status} --lightsList = ${spatWarningData.lightsList}") + handlerTrafficLight( + spatWarningData!!.warningType, + spatWarningData?.status, + spatWarningData?.lightsList + ) + } + + /** + * 地图匹配 是OBU算法输出地图匹配结果,主车匹配道路哪条路或者哪条车道 + */ + fun onMogoObuMapMath(data: MapMatchData?) { + CallerLogger.d("${M_OBU}${TAG}", "MogoObuDcCombineManager onMogoObuMapMath HmiBuildConfig.isShowObuLimitSpeedView = " + HmiBuildConfig.isShowObuLimitSpeedView) + if(HmiBuildConfig.isShowObuLimitSpeedView) { + if (data != null) { + CallerLogger.d("${M_OBU}${TAG}", + "MogoObuDcCombineManager onMogoObuMapMath = ${data.status} --speedMaxLimit = ${Math.round((data.speedMaxLimit*0.02*3.6))} --- data.speedMaxLimit = ${data.speedMaxLimit}") + when (data.status) { + MogoObuConstants.STATUS.ADD -> { // 添加 TODO + CallerHmiManager.showLimitingVelocity(Math.round((data.speedMaxLimit*0.02*3.6)).toInt(), 2) + } + + MogoObuConstants.STATUS.UPDATE -> { // 更新 + } + + MogoObuConstants.STATUS.DELETE -> { // 删除 + CallerHmiManager.disableLimitingVelocity() + } + } + } + } + } + + /** + * 获取消息的方位 车辆相关 + */ + private fun getMessageDirection(targetClassification: Int): WarningDirectionEnum { + return when (targetClassification) { + MogoObuConstants.VEH_TARGET_POSITION.AHEAD_IN_LANE, + MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_TOP //正前方 + + MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_BOTTOM //正后方 + + MogoObuConstants.VEH_TARGET_POSITION.INTERSECTION_RIGHT -> WarningDirectionEnum.ALERT_WARNING_RIGHT //正右方 + + MogoObuConstants.VEH_TARGET_POSITION.INTERSECTION_LEFT -> WarningDirectionEnum.ALERT_WARNING_LEFT //正左方 + + MogoObuConstants.VEH_TARGET_POSITION.AHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.AHEAD_FAR_LEFT, + MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_LEFT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAR_LEFT + -> WarningDirectionEnum.ALERT_WARNING_TOP_LEFT //左前方 + + MogoObuConstants.VEH_TARGET_POSITION.AHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.AHEAD_FAR_RIGHT, + MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAT_RIGHT + -> WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT //右前方 + + MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_LEFT, + -> WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT //左后方 + + MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_RIGHT, + -> WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT //右后方 + + MogoObuConstants.VEH_TARGET_POSITION.UNCLASSIFIED -> WarningDirectionEnum.ALERT_WARNING_NON //未知 + else -> WarningDirectionEnum.ALERT_WARNING_ALL + } + } + + /** + * 处理红绿灯 + */ + private fun handlerTrafficLight(appId: Int, status: Int, lights: List) { + CallerLogger.d( + "${M_OBU}${TAG}", + "MogoObuDcCombineManager handlerTrafficLight --- status = $status ---lights.size = ${lights.size} ---lights = $lights ---appId = $appId" + ) + when (status) { + // 添加 + MogoObuConstants.STATUS.ADD, + MogoObuConstants.STATUS.UPDATE + -> { + if (lights != null && lights.isNotEmpty()) { + changeTrafficLightStatus(appId, lights) + } + } + // 删除 + MogoObuConstants.STATUS.DELETE -> { + // 移除顶部弹窗,当收不到信号的时候触发一次 + CallerHmiManager.disableWarningTrafficLight() + CallerHmiManager.disableWarningV2X(appId.toString()) + isShowGreenWave = false + isShowRunRedLight = false + } + } + } + + private var isRedLight = false + private var isGreenLight = false + private var isShowGreenWave = false + private var isShowRunRedLight = false + + /** + * 修改红绿灯 + */ + @Synchronized + private fun changeTrafficLightStatus( + appId: Int, + lights: List + ) { + var ttsContent = "" + var alertContent = "" + //这里需要根据真实数据确定 index 取值方式 + val currentLight = lights[0] + CallerLogger.e( + "${M_OBU}${TAG}", + "MogoObuDcCombineManager currentLight = $currentLight ---currentLight.phaseID = ${currentLight.phaseID} ---appId = $appId ---isShowRunRedLight = $isShowRunRedLight ---isShowGreenWave = $isShowGreenWave" + ) + + // 闯红灯预警和绿波通行底层是互斥的 + when (appId) { + 0 -> {//不可用 V2I_RLVW_VIOLATION_TYPE_UNAVAILABLE 无效 + + } + 1 -> { //闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT 一个红灯周期只显示一次 + if (!isShowRunRedLight) { + isShowRunRedLight = true + CallerHmiManager.disableWarningV2X(1667.toString()) + ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType) + alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType) + CallerLogger.d("${M_OBU}${TAG}","MogoObuDcCombineManager changeTrafficLightStatus 闯红灯 --------> ttsContent = $ttsContent ---alertContent = $alertContent ") + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.V2X, + V2XMsg( + EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, + alertContent, + ttsContent + ) + ).apply { + sourceType = DataSourceType.TELEMATIC + } + ) + + CallerHmiManager.showWarningV2X( + EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, alertContent, ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 + EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, null, true, 5000L) + } + } + + 2 -> { //绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION 一个绿灯周期只显示一次 + if (!isShowGreenWave) { + isShowGreenWave = true + CallerHmiManager.disableWarningV2X(1666.toString()) + CallerLogger.d( + "${M_OBU}${TAG}", + "MogoObuDcCombineManager 绿波通行引导 --------> speed_min = ${currentLight.suggestMinSpeed} --speed_max = ${currentLight.suggestMaxSpeed}") + val adviceSpeed = + "${Math.round(currentLight.suggestMinSpeed*3.6*0.02)} - ${Math.round(currentLight.suggestMaxSpeed*3.6*0.02)}" + val adviceSpeedTts = + "${Math.round(currentLight.suggestMinSpeed*3.6*0.02)} - ${Math.round(currentLight.suggestMaxSpeed*3.6*0.02)}" + + ttsContent = + String.format( + EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType), + adviceSpeedTts + ) + alertContent = + String.format( + EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType), + adviceSpeed + ) + val maxSpeed = currentLight.suggestMaxSpeed*3.6 + if (maxSpeed > 0) { + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.V2X, + V2XMsg( + EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, + alertContent, + ttsContent + ) + ).apply { + sourceType = DataSourceType.TELEMATIC + } + ) + + CallerHmiManager.warningV2X( + EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, + alertContent, + ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 + appId.toString(), + null, + true, + 5000L + ) + } + } + } + } + + when (currentLight.light) { + // 灯光不可用 + 0 -> { + CallerHmiManager.showWarningTrafficLight(0, 2) + } + + // 红灯 + 2, 3 -> { + if (!isRedLight) { + CallerHmiManager.disableWarningV2X(appId.toString()) + isRedLight = true + } + isGreenLight = false + CallerHmiManager.showWarningTrafficLight(1, 2) + val red = currentLight.countDown / 10 + CallerHmiManager.changeCountdownRed(red) + } + + // 绿灯 + 4, 5, 6 -> { + if (!isGreenLight) { + CallerHmiManager.disableWarningV2X(appId.toString()) + isGreenLight = true + } + isRedLight = false + CallerHmiManager.showWarningTrafficLight(3, 2) + val green = currentLight.countDown / 10 + CallerHmiManager.changeCountdownGreen(green) + } + + // 黄灯 + 7, 8 -> { + CallerHmiManager.disableWarningV2X(appId.toString()) + CallerHmiManager.showWarningTrafficLight(2, 2) + val yellow = currentLight.countDown / 10 + CallerHmiManager.changeCountdownYellow(yellow) + } + } + } + +} diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuManager.kt b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuManager.kt index d687259f9d..ea71e56e3f 100644 --- a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuManager.kt +++ b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuManager.kt @@ -233,7 +233,7 @@ class MogoPrivateObuManager private constructor() { // (3) 道路事件预警信息:CVX_RTI_THREAT_IND override fun onCvxRtiThreatIndInfo(info: CvxRtiThreatIndInfo?) { - if (HmiBuildConfig.isShowObuV2iView) { +// if (HmiBuildConfig.isShowObuV2iView) { CallerLogger.d( "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", "onCvxRtiThreatIndInfo ------> $info" @@ -433,8 +433,7 @@ class MogoPrivateObuManager private constructor() { } } } - } - +// } } // (4) V2I预警信息:CVX_IVP_THREAT_IND,红绿灯 @@ -448,20 +447,20 @@ class MogoPrivateObuManager private constructor() { && info.ext_info.lights != null && info.ext_info.lights.isNotEmpty() ) { - if (HmiBuildConfig.isShowObuV2iView) { +// if (HmiBuildConfig.isShowObuV2iView) { handlerTrafficLight( info.threat_info.app_id, info.status, info.ext_info.lights, info.ext_info.index ) - } +// } } } // (2) 弱势交通参与者预警信息:CVX_PTC_THREAT_IND override fun onCvxPtcThreatIndInfo(info: CvxPtcThreatIndInfo?) { - if (HmiBuildConfig.isShowObuV2iView) { +// if (HmiBuildConfig.isShowObuV2iView) { CallerLogger.d( "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", "onCvxPtcInfoIndInfo ------> $info" @@ -559,7 +558,7 @@ class MogoPrivateObuManager private constructor() { } } - } +// } } // (5) 限速预警信息:CVX_SLW_THREAT_IND @@ -592,7 +591,7 @@ class MogoPrivateObuManager private constructor() { // (1) V2V预警信息:CVX_V2V_THREAT_IND override fun onCvxV2vThreatIndInfo(info: CvxV2vThreatIndInfo?) { - if (HmiBuildConfig.isShowObuV2vView) { +// if (HmiBuildConfig.isShowObuV2vView) { CallerLogger.d( "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", "onCvxV2vThreatIndInfo ------> $info" @@ -620,7 +619,7 @@ class MogoPrivateObuManager private constructor() { } } } - } +// } } /** @@ -751,7 +750,7 @@ class MogoPrivateObuManager private constructor() { when (currentLight.phase) { // 灯光不可用 0x0 -> { - CallerHmiManager.showWarningTrafficLight(0, 2) + CallerHmiManager.showWarningTrafficLight(0, 3) } // 红灯 0x1 -> { @@ -760,7 +759,7 @@ class MogoPrivateObuManager private constructor() { isRedLight = true } isGreenLight = false - CallerHmiManager.showWarningTrafficLight(1, 2) + CallerHmiManager.showWarningTrafficLight(1, 3) val red = currentLight.count_down.toInt() CallerHmiManager.changeCountdownRed(red) @@ -775,7 +774,7 @@ class MogoPrivateObuManager private constructor() { isGreenLight = true } isRedLight = false - CallerHmiManager.showWarningTrafficLight(3, 2) + CallerHmiManager.showWarningTrafficLight(3, 3) val green = currentLight.count_down.toInt() CallerHmiManager.changeCountdownGreen(green) //防止数据出现问题的容错 diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuNewManager.kt b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuNewManager.kt index 897a9432fe..e22a0d3f7e 100644 --- a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuNewManager.kt +++ b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuNewManager.kt @@ -4,8 +4,8 @@ import android.content.Context import android.util.Log import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.config.HmiBuildConfig -import com.mogo.eagle.core.data.config.HmiBuildConfig.isShowObuLimitSpeedView import com.mogo.eagle.core.data.enums.* +import com.mogo.eagle.core.data.msgbox.DataSourceType import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.data.msgbox.V2XMsg @@ -18,6 +18,8 @@ import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Defa import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.TooClose import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager +import com.mogo.eagle.core.function.call.obu.CallerObuTrafficLightListenerManager +import com.mogo.eagle.core.function.call.v2x.CallObuLimitingSpeedListenerManager import com.mogo.eagle.core.function.obu.mogo.utils.TrafficDataConvertUtilsNew import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU @@ -93,7 +95,6 @@ class MogoPrivateObuNewManager private constructor() { */ override fun onConnectStatus(connectStatus: Int) { if (connectStatus == 0) { //断开连接 - CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "onConnectFail ------> ") mObuStatusInfo.obuStatus = false mObuStatusInfo.obuHvStatus = false mObuStatusInfo.obuRvStatus = false @@ -102,7 +103,6 @@ class MogoPrivateObuNewManager private constructor() { mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_HV", false) } mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_RV", false) } } else if (connectStatus == 1) { //连接成功 - CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "onConnected ------> ") mObuStatusInfo.obuStatus = true CallerObuListenerManager.invokeListener(mObuStatusInfo) mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU", true) } @@ -170,47 +170,61 @@ class MogoPrivateObuNewManager private constructor() { */ override fun onMogoObuRvWarning(data: MogoObuRvWarningData) { super.onMogoObuRvWarning(data) - if (HmiBuildConfig.isShowObuV2vView) { - mObuStatusInfo.obuRvStatus = true - CallerObuListenerManager.invokeListener(mObuStatusInfo) +// if (HmiBuildConfig.isShowObuV2vView) { //TODO 临时需要关闭v2v开关 + mObuStatusInfo.obuRvStatus = true + CallerObuListenerManager.invokeListener(mObuStatusInfo) + if (!data.warningMsg.warningData.isNullOrEmpty()) { + // 更新数据,远车数据,之前要匹配uuid + TrafficDataConvertUtilsNew.cvxRvInfoIndInfo2TrafficData(data)?.let { + CallerMapUIServiceManager.getMarkerService()?.updateITrafficLocationInfo(it) + } - if (!data.warningMsg.warningData.isNullOrEmpty()) { - // 更新数据,远车数据,之前要匹配uuid - TrafficDataConvertUtilsNew.cvxRvInfoIndInfo2TrafficData(data)?.let { - CallerMapUIServiceManager.getMarkerService()?.updateITrafficLocationInfo(it) - } + CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", data.toString()) + data.let { + //预警信息,预警类型 threat_level 2、3 + data.vehBasicsMsg?.let { + //预警方位 + val direction = getMessageDirection(data.vehBasicsMsg.targetPosition) + //处理预警类型 + var appId = "" + var level = -1 + var status = -1 + data.warningMsg?.let { + if (data.warningMsg.warningData != null && data.warningMsg.warningData.size > 0) { + level = data.warningMsg.warningData[0].warningLevel + appId = data.warningMsg.warningData[0].warningType.toString() + status = data.warningMsg.warningData[0].status - CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", data.toString()) - data.let { - //预警信息,预警类型 threat_level 2、3 - var status = data.status - data.vehBasicsMsg?.let { - //预警方位 - val direction = getMessageDirection(data.vehBasicsMsg.targetPosition) - //处理预警类型 - var appId = "" - var level = -1 - data.warningMsg?.let { - if (data.warningMsg.warningData != null && data.warningMsg.warningData.size > 0) { - level = data.warningMsg.warningData[0].warningLevel - appId = data.warningMsg.warningData[0].warningType.toString() + //30秒内同一个事件只出现一次 + if (rvMap.containsKey(appId)) { + var oldTime = rvMap[appId] + var timeDiff = (System.currentTimeMillis() - oldTime!!) / 1000 + if (timeDiff < 30) { + return + } + rvMap.remove(appId) + rvMap[appId] = System.currentTimeMillis() + } else { + rvMap[appId] = System.currentTimeMillis() + } + + //拼凑数据 + if (appId != null) { + handleSdkObu(appId, direction, status, level, data) } } - - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", - "onMogoObuRvWarning target_classification = ${ - getMessageDirection(data.vehBasicsMsg.targetPosition) - } --- direction = $direction --- appId = $appId ---level = $level -- status = $status" - ) - //拼凑数据 - if (appId != null) { - handleSdkObu(appId, direction, status, level, data) - } } + + CallerLogger.d( + "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", + "onMogoObuRvWarning target_classification = ${ + getMessageDirection(data.vehBasicsMsg.targetPosition) + } --- direction = $direction --- appId = $appId ---level = $level -- status = $status" + ) } } } +// } } /** @@ -218,46 +232,48 @@ class MogoPrivateObuNewManager private constructor() { */ override fun onMogoObuSpatWarning(data: MogoObuSpatWarningData) { super.onMogoObuSpatWarning(data) - if (data?.lights != null && data.lights.isNotEmpty() - ) { - if (HmiBuildConfig.isShowObuV2iView) { - handlerTrafficLight( - data.warningType, - data.status, - data.lights - ) - } + if (data != null) { +// if (HmiBuildConfig.isShowObuV2iView) { + handlerTrafficLight( + data.warningType, + data.status, + data.lights + ) +// } } } + val rvMap = mutableMapOf() + val rsiMap = mutableMapOf() + val rsmMap = mutableMapOf() + val rsmPtcIdMap = mutableMapOf() + /** - * RSI预警信息 CvxRtiThreatIndInfo(交通标志预警(前方限速、前方学校等等),交通事件预警(前方拥堵、前方积水等等)) + * RSI预警信息 onMogoObuRsiWarning(交通标志预警(前方限速、前方学校等等),交通事件预警(前方拥堵、前方积水等等)) */ override fun onMogoObuRsiWarning(data: MogoObuRsiWarningData) { super.onMogoObuRsiWarning(data) - if (HmiBuildConfig.isShowObuV2iView) { +// if (HmiBuildConfig.isShowObuV2iView) { + if (data != null && data.warningMsg != null && data.warningMsg.size > 0) { + var alertContent = "" + var ttsContent = "" + var appId = data.warningMsg[0].sceneType.toString() + val status = data.status + val level = data.warningMsg[0].warningLevel + val direction = getMessageDirection(data.warningMsg[0].targetPosition) CallerLogger.d( "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", - "onMogoObuRsiWarning ------> $data" + "onMogoObuRsiWarning appId = $appId --status = $status --level = $level -- eventSerialNum = ${data.warningMsg[0].eventSerialNum} ---signSerialNum = ${data.warningMsg[0].signSerialNum} --- direction = $direction -- targetPosition = ${data.warningMsg[0].targetPosition}" ) - if (data != null && data.warningMsg != null && data.warningMsg.size > 0) { - var alertContent = "" - var ttsContent = "" - var appId = data.warningMsg[0].sceneType.toString() - val status = data.status - val level = data.warningMsg[0].warningLevel - val direction = getMessageDirection(data.warningMsg[0].targetPosition) - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", - "onCvxRtiThreatIndInfo appId = $appId --status = $status --level = $level -- eventSerialNum = ${data.warningMsg[0].eventSerialNum} ---signSerialNum = ${data.warningMsg[0].signSerialNum} --- direction = $direction -- targetPosition = ${data.warningMsg[0].targetPosition}" - ) + if (appId != "0") { when (appId) { // 道路危险情况预警 MogoObuConstants.RSI_SCENE_TYPE.HLW.toString() -> { when (data.warningMsg[0].eventSerialNum) { MogoObuConstants.RTE.RTI_TYPE_BREAKDOWN -> {//车辆故障 - appId = EventTypeEnumNew.TYPE_USECASE_ID_BREAKDOWN_WARNING.poiType + appId = + EventTypeEnumNew.TYPE_USECASE_ID_BREAKDOWN_WARNING.poiType } MogoObuConstants.RTE.RTI_TYPE_ROAD_WATER -> { //道路积水 appId = EventTypeEnumNew.FOURS_PONDING.poiType @@ -302,9 +318,9 @@ class MogoPrivateObuNewManager private constructor() { MogoObuConstants.RTS.RTI_TYPE_BRIDGE -> { //桥梁 appId = EventTypeEnumNew.TYPE_ID_BRIDGE.poiType } - MogoObuConstants.RTS.RTI_TYPE_PEDESTRIAN -> { //行人 - appId = EventTypeEnumNew.TYPE_ID_PEDESTRIAN.poiType - } +// MogoObuConstants.RTS.RTI_TYPE_PEDESTRIAN -> { //行人 TODO 暂时去掉 +// appId = EventTypeEnumNew.TYPE_ID_PEDESTRIAN.poiType +// } MogoObuConstants.RTS.RTI_TYPE_SLIPPERY_ROAD -> { //路滑 appId = EventTypeEnumNew.TYPE_ID_SLIPPERY_ROAD.poiType } @@ -341,9 +357,11 @@ class MogoPrivateObuNewManager private constructor() { MogoObuConstants.RTS.RTI_TYPE_NO_TOOTING -> { //禁止鸣笛 appId = EventTypeEnumNew.TYPE_USECASE_ID_ROAD_NO_TOOTING.poiType } - MogoObuConstants.RTS.RTI_TYPE_SPEED_LIMIT -> { //限速 - appId = EventTypeEnumNew.TYPE_USECASE_ID_ROAD_SPEED_LIMIT.poiType - } +// MogoObuConstants.RTS.RTI_TYPE_SPEED_LIMIT -> { //限速 +// appId = +// EventTypeEnumNew.TYPE_USECASE_ID_ROAD_SPEED_LIMIT.poiType +// } + // MogoObuConstants.RTS.RTI_TYPE_GO_STRAIGHT_TURN_RIGHT -> { //直行或右转 // appId = // EventTypeEnumNew.TYPE_USECASE_ID_GO_STRAIGHT_TURN_RIGHT.poiType @@ -381,7 +399,6 @@ class MogoPrivateObuNewManager private constructor() { // 拥堵 MogoObuConstants.RSI_SCENE_TYPE.TJW.toString() -> { appId = EventTypeEnumNew.TYPE_USECASE_ID_TJW.poiType - alertContent = EventTypeEnumNew.getWarningContent(appId) ttsContent = EventTypeEnumNew.getWarningTts(appId) alertContent = String.format( //事件才有影响范围 @@ -398,32 +415,51 @@ class MogoPrivateObuNewManager private constructor() { //限速预警, ADD处理一次 MogoObuConstants.RSI_SCENE_TYPE.SLW.toString() -> { + appId = EventTypeEnumNew.TYPE_USECASE_ID_ROAD_SPEED_LIMIT.poiType alertContent = EventTypeEnumNew.getWarningContent(appId) ttsContent = EventTypeEnumNew.getWarningTts(appId) } } + //30秒内同一个事件只出现一次 + if (rsiMap.containsKey(appId)) { + var oldTime = rsiMap[appId] + var timeDiff = (System.currentTimeMillis() - oldTime!!) / 1000 + if (timeDiff < 30) { + return + } + rsiMap.remove(appId) + rsiMap[appId] = System.currentTimeMillis() + } else { + rsiMap[appId] = System.currentTimeMillis() + } + CallerLogger.d( "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", - "new onMogoObuRsiWarning ttsContent = $ttsContent --alertContent = $alertContent --appId = $appId ---direction = ${direction.direction} --distance = ${Math.round(data.warningMsg[0].distance)} ---eventRadius = ${Math.round(data.warningMsg[0].eventRadius)} --speedMaxLimit = ${data.warningMsg[0].speedMaxLimit.toInt()}" + "new onMogoObuRsiWarning appId = $appId ---status = $status --- ttsContent = $ttsContent --alertContent = $alertContent -- eventSerialNum = ${data.warningMsg[0].eventSerialNum} ---signSerialNum = ${data.warningMsg[0].signSerialNum} ---direction = ${direction.direction} --distance = ${ + Math.round(data.warningMsg[0].distance) + } ---eventRadius = ${Math.round(data.warningMsg[0].eventRadius)} --speedMaxLimit = ${data.warningMsg[0].speedMaxLimit.toInt()}" ) + when (status) { MogoObuConstants.STATUS.ADD -> { // 添加 //显示警告红边 // CallerHmiManager.showWarning(direction) //不显示弹框,语音提示,数据在消息盒子里面展示,此处不在处理弹框 if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) { - Log.d("MsgBox-PriObuNewMana1", "alertContent或ttsContent为空!") + return } CallerMsgBoxManager.saveMsgBox( MsgBoxBean( - MsgBoxType.OBU, + MsgBoxType.V2X, V2XMsg( appId, alertContent, ttsContent ) - ) + ).apply { + sourceType = DataSourceType.OBU + } ) CallerHmiManager.warningV2X( appId, @@ -437,7 +473,7 @@ class MogoPrivateObuNewManager private constructor() { } }, true, - 3000L + 5000L ) // 更新数据 @@ -451,10 +487,6 @@ class MogoPrivateObuNewManager private constructor() { } MogoObuConstants.STATUS.DELETE -> { // 删除 - // 关闭警告红边 -// CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON) - // 移除顶部弹窗 -// CallerHmiManager.disableWarningV2X((appId + direction.direction)) // 更新数据 TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(data) ?.let { @@ -467,7 +499,7 @@ class MogoPrivateObuNewManager private constructor() { } } } - +// } } /** @@ -483,106 +515,164 @@ class MogoPrivateObuNewManager private constructor() { data: MogoObuRsmWarningData? ) { super.onMogoObuRsmWarning(data) - if (HmiBuildConfig.isShowObuV2iView) { - if (HmiBuildConfig.isShowObuWeaknessTrafficView) { + CallerLogger.d( + "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", + "onMogoObuRsmWarning ------> ${data.toString()}" + ) +// if (HmiBuildConfig.isShowObuV2iView) { + if (HmiBuildConfig.isShowObuWeaknessTrafficView) { + // 交通参与者类型 0x0:未知 UNKNOWN | 1机动车 2:非机动车 NON_MOTOR | 3:行人 PEDESTRIAN 4:obu + if (data != null && data.participant != null) { + var v2xType = "" +// if (data.participant.ptcType == 1) { //机动车 +// v2xType = +// EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES.poiType +// } else if (data.participant.ptcType == 2) { //非机动车 +// v2xType = +// EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_NOT_MOTOR_VEHICLES.poiType +// } else if (data.participant.ptcType == 3) { //行人 +// v2xType = +// EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_PERSON.poiType +// } else { //未知 +// v2xType = EventTypeEnumNew.TYPE_ERROR.poiType +// } + + if (data.participant.ptcType == 3) { //行人 + v2xType = + EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_PERSON.poiType + } + + val ttsContent = EventTypeEnumNew.getWarningTts(v2xType) + val alertContent = + EventTypeEnumNew.getWarningContent(v2xType) + var level = -1 + val direction = getMessageDirection(data.participant.targetPosition) + + //物体数据绘制 TODO 这里与dc通过工控机有区别 CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", - "onMogoObuRsmWarning ------> ${data.toString()}" - ) - // 交通参与者类型 0x0:未知 UNKNOWN | 1机动车 2:非机动车 NON_MOTOR | 3:行人 PEDESTRIAN 4:obu - if (data != null && data.participant != null) { - var v2xType = "" - if (data.participant.ptcType == 1) { //机动车 - v2xType = - EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES.poiType - } else if (data.participant.ptcType == 2) { //非机动车 - v2xType = - EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_NOT_MOTOR_VEHICLES.poiType - } else if (data.participant.ptcType == 3) { //行人 - v2xType = - EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_PERSON.poiType - } else { //未知 - v2xType = EventTypeEnumNew.TYPE_ERROR.poiType - } - val ttsContent = EventTypeEnumNew.getWarningTts(v2xType) - val alertContent = - EventTypeEnumNew.getWarningContent(v2xType) - var level = -1 - val direction = getMessageDirection(data.participant.targetPosition) - if (data.warningMsg != null && data.warningMsg.warningData != null && data.warningMsg.warningData.size > 0) { - level = data.warningMsg.warningData[0].warningLevel //默认是1个 - CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", - "new onMogoObuRsmWarning ---status---> ${data.status} ---data.warningMsg.warningData[0].status = ${data.warningMsg.warningData[0].status} ---v2xType = $v2xType ---alertContent = $alertContent ---ttsContent = $ttsContent " - ) - - when (data.warningMsg.warningData[0].status) { - MogoObuConstants.STATUS.ADD -> { // 添加 -// if (level == 2 || level == 3) { //不考虑level - //显示警告红边 - CallerHmiManager.showWarning(direction) - if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) { - Log.d("MsgBox-PriObuNewMana2", "alertContent或ttsContent为空!") - } - CallerMsgBoxManager.saveMsgBox( - MsgBoxBean( - MsgBoxType.OBU, - V2XMsg( - v2xType, - alertContent, - ttsContent - ) - ) - ) - CallerHmiManager.warningV2X( - v2xType, - alertContent, - ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 - (v2xType + direction.direction),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的 - object : IMoGoWarningStatusListener { - override fun onDismiss() { - // 关闭警告红边 - CallerHmiManager.showWarning( - WarningDirectionEnum.ALERT_WARNING_NON - ) - } - }, - true, - 5000L - ) + "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "onMogoObuRsmWarning ---- data.status = ${data.status} ---data.participant.ptcId = ${data.participant.ptcId} ---data.participant.ptcType = ${data.participant.ptcType} ---data.warningMsg = ${data.warningMsg} -----data = ${data.toString()}") +// when (data.status) { +// MogoObuConstants.STATUS.ADD -> { // 添加 +// // 更新数据,模型变色的时候是不是update,如果不是更新,可能导致模型不变色,(add的时候,是否有level高的) TODO +// TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data) +// ?.let { +// CallerMapUIServiceManager.getMarkerService() +// ?.updateITrafficThreatLevelInfo(it) +// } // } +// +// MogoObuConstants.STATUS.UPDATE -> { // 更新 +// //处理删除逻辑, +//// if (rsmPtcIdMap.containsKey(data.participant.ptcId.toString())) { +//// var oldTime = rsmPtcIdMap[data.participant.ptcId.toString()] +//// var timeDiff = (System.currentTimeMillis() - oldTime!!) / 1000 +//// if (timeDiff > 3) { //超过3秒,删除对应弱势交通元素 +//// CallerMapUIServiceManager.getMarkerService() +//// ?.removeCvxRvInfoIndInfo(data.participant.ptcId.toString()) +//// } +//// rsmPtcIdMap.remove(data.participant.ptcId.toString()) +//// rsmPtcIdMap[data.participant.ptcId.toString()] = System.currentTimeMillis() +//// } else { +//// rsmPtcIdMap[data.participant.ptcId.toString()] = System.currentTimeMillis() +//// } +// } +// +// MogoObuConstants.STATUS.DELETE -> { // 删除 +// // 更新数据 TODO 删除原来的,改变颜色,删除marker。不影响别的模型添加 +// TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data) +// ?.let { +// // 事件结束,还原交通参与者颜色 +// it.threatLevel = 0x01 +// CallerMapUIServiceManager.getMarkerService() +// ?.updateITrafficThreatLevelInfo(it) +// } +// +// //删除弱势交通元素 +// CallerMapUIServiceManager.getMarkerService() +// ?.removeCvxRvInfoIndInfo(data.participant.ptcId.toString()) +// } +// } - // 更新数据 - TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data)?.let { - CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "add cvxPtcThreatIndInfo2TrafficData ---it---> $it") + //预警status + if (data.warningMsg != null && data.warningMsg.warningData != null && data.warningMsg.warningData.size > 0) { + level = data.warningMsg.warningData[0].warningLevel //默认是1个 + CallerLogger.d( + "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", + "onMogoObuRsmWarning ---status---> ${data.status} ---data.warningMsg.warningData[0].status = ${data.warningMsg.warningData[0].status} ---v2xType = $v2xType ---alertContent = $alertContent ---ttsContent = $ttsContent ---level = $level" + ) + when (data.warningMsg.warningData[0].status) { + MogoObuConstants.STATUS.ADD -> { // 添加 + //更新模型的颜色 + //30秒内同一个事件只出现一次 + if (rsmMap.containsKey(v2xType)) { + var oldTime = rsmMap[v2xType] + var timeDiff = (System.currentTimeMillis() - oldTime!!) / 1000 + if (timeDiff < 30) { + return + } + rsmMap.remove(v2xType) + rsmMap[v2xType] = System.currentTimeMillis() + } else { + rsmMap[v2xType] = System.currentTimeMillis() + } + + TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data) + ?.let { CallerMapUIServiceManager.getMarkerService() ?.updateITrafficThreatLevelInfo(it) } - } - MogoObuConstants.STATUS.UPDATE -> {// 更新 + if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) { + return } + //显示警告红边 + CallerHmiManager.showWarning(direction) + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.V2X, + V2XMsg( + v2xType, + alertContent, + ttsContent + ) + ).apply { + sourceType = DataSourceType.OBU + } + ) - // 删除 - MogoObuConstants.STATUS.DELETE -> { - // 关闭警告红边 - CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON) - // 更新数据 TODO 删除原来的,改变颜色,删除marker。不影响别的模型添加 - TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data) - ?.let { - // 事件结束,还原交通参与者颜色 - it.threatLevel = 0x01 - CallerMapUIServiceManager.getMarkerService() - ?.updateITrafficThreatLevelInfo(it) + CallerHmiManager.warningV2X( + v2xType, + alertContent, + ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 + (v2xType + direction.direction),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的 + object : IMoGoWarningStatusListener { + override fun onDismiss() { + // 关闭警告红边 + CallerHmiManager.showWarning( + WarningDirectionEnum.ALERT_WARNING_NON + ) } + }, + true, + 5000L + ) + } - //删除弱势交通元素 - CallerMapUIServiceManager.getMarkerService()?.removeCvxRvInfoIndInfo(data.participant.ptcId.toString()) - } + MogoObuConstants.STATUS.UPDATE -> {// 更新 + } + + MogoObuConstants.STATUS.DELETE -> { // 删除 + // 关闭警告红边 + CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON) + //删除弱势交通元素 + CallerMapUIServiceManager.getMarkerService() + ?.removeCvxRvInfoIndInfo(data.participant.ptcId.toString()) } } } } } +// } } /** @@ -590,16 +680,19 @@ class MogoPrivateObuNewManager private constructor() { */ override fun onMogoObuMapMath(data: MogoObuMapMathData?) { super.onMogoObuMapMath(data) - if(isShowObuLimitSpeedView) { +// if (isShowObuLimitSpeedView) { if (data != null) { CallerLogger.d( "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", - "onMogoObuMapMathstatus = ${data.status} --speedMaxLimit = ${Math.round((data.speedMaxLimit*3.6))}") + "onMogoObuMapMath = ${data.status} --speedMaxLimit = ${Math.round((data.speedMaxLimit * 3.6))}" + ) when (data.status) { MogoObuConstants.STATUS.ADD -> { // 添加 UiThreadHandler.post { - if(data.speedMaxLimit > 0) { - CallerHmiManager.showLimitingVelocity(Math.round((data.speedMaxLimit*3.6)).toInt()) + if (data.speedMaxLimit > 0) { +// CallerHmiManager.showLimitingVelocity( +// Math.round((data.speedMaxLimit * 3.6)).toInt(), 2) + CallObuLimitingSpeedListenerManager.invokeOnObuLimitingSpeedChange(Math.round((data.speedMaxLimit * 3.6)).toInt()) } } } @@ -609,22 +702,23 @@ class MogoPrivateObuNewManager private constructor() { MogoObuConstants.STATUS.DELETE -> { // 删除 UiThreadHandler.post { - CallerHmiManager.disableLimitingVelocity() +// CallerHmiManager.disableLimitingVelocity() + CallObuLimitingSpeedListenerManager.invokeOnObuLimitingSpeedChange(-1) } } } } - } +// } } } - } +} /** * 获取消息的方位 车辆相关 */ private fun getMessageDirection(targetClassification: Int): WarningDirectionEnum { -// CallerLogger.d("$M_OBU${TAG_MOGO_NEW_OBU}", "预警红边:预警方向->$targetClassification") + // CallerLogger.d("$M_OBU${TAG_MOGO_NEW_OBU}", "预警红边:预警方向->$targetClassification") return when (targetClassification) { MogoObuConstants.VEH_TARGET_POSITION.AHEAD_IN_LANE, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_TOP //正前方 @@ -657,7 +751,7 @@ class MogoPrivateObuNewManager private constructor() { /** * 构造对应展示数据和场景 根据obu的场景,add change delete确定是否展示 * - * @param appId 使用WarningTypeEnum获取icon、提示内容、tts内容 + * @param appId 使用WarningTypeEnum获取icon、提示内容、tts内容 TODO 添加事件频繁播报拦截 * * @see com.mogo.module.common.enums.EventTypeEnum */ @@ -669,56 +763,32 @@ class MogoPrivateObuNewManager private constructor() { info: MogoObuRvWarningData ) { // 这里排除需要特殊定制的语音及文案外,其余的都可以使用 EventTypeEnumNew 提供的 - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", - "handleSdkObu appId = $appId --- handleDirection = $direction ---level = $level ---status = $status" - ) - - var alertContent: String - var ttsContent: String + var alertContent: String = "" + var ttsContent: String = "" var changeVisualAngle = false when (appId) { - // 变道预警,注意左后车辆/注意右后车辆 - EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType -> { - alertContent = EventTypeEnumNew.getWarningContent(appId) - ttsContent = EventTypeEnumNew.getWarningTts(appId) - if ( - direction == WarningDirectionEnum.ALERT_WARNING_LEFT || - direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT || - direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT - ) { - ttsContent = String.format(ttsContent, "左") - alertContent = String.format(alertContent, "左") - } else if ( - direction == WarningDirectionEnum.ALERT_WARNING_RIGHT || - direction == WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT || - direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT - ) { - ttsContent = String.format(ttsContent, "右") - alertContent = String.format(alertContent, "右") - } + //交叉路口碰撞预警 + MogoObuConstants.V2X_WARNING_TYPE.FCW.toString() -> { + alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType) + ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType) } - //车辆失控预警 - EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType -> { - alertContent = EventTypeEnumNew.getWarningContent(appId) - ttsContent = EventTypeEnumNew.getWarningTts(appId) - alertContent = String.format(alertContent, direction.desc) - ttsContent = String.format(ttsContent, direction.desc) + //交叉路口碰撞预警 + MogoObuConstants.V2X_WARNING_TYPE.ICW.toString() -> { + alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType) + ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType) } - //异常车辆提醒 - EventTypeEnumNew.TYPE_USECASE_ID_AVW.poiType -> { - alertContent = EventTypeEnumNew.getWarningContent(appId) - ttsContent = EventTypeEnumNew.getWarningTts(appId) - alertContent = String.format(alertContent, direction.desc) - ttsContent = String.format(ttsContent, direction.desc) + //左转辅助预警 + MogoObuConstants.V2X_WARNING_TYPE.LTA.toString() -> { + alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_LTA.poiType) + ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_LTA.poiType) } //盲区预警 - EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType -> { - ttsContent = EventTypeEnumNew.getWarningTts(appId) - alertContent = EventTypeEnumNew.getWarningContent(appId) + MogoObuConstants.V2X_WARNING_TYPE.BSW.toString() -> { + ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType) + alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType) if ( direction == WarningDirectionEnum.ALERT_WARNING_LEFT || direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT || @@ -737,10 +807,65 @@ class MogoPrivateObuNewManager private constructor() { alertContent = String.format(alertContent, "右") } } + + // 变道预警,注意左后车辆/注意右后车辆 + MogoObuConstants.V2X_WARNING_TYPE.LCW.toString() -> { + alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType) + ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType) + if ( + direction == WarningDirectionEnum.ALERT_WARNING_LEFT || + direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT || + direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT + ) { + ttsContent = String.format(ttsContent, "左") + alertContent = String.format(alertContent, "左") + } else if ( + direction == WarningDirectionEnum.ALERT_WARNING_RIGHT || + direction == WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT || + direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT + ) { + ttsContent = String.format(ttsContent, "右") + alertContent = String.format(alertContent, "右") + } + } + + //逆向超车预警 + MogoObuConstants.V2X_WARNING_TYPE.DNPW.toString() -> { + alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_DNPW.poiType) + ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_DNPW.poiType) + } + + //紧急制动预警 + MogoObuConstants.V2X_WARNING_TYPE.EBW.toString() -> { + alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_EBW.poiType) + ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_EBW.poiType) + } + + //异常车辆提醒 + MogoObuConstants.V2X_WARNING_TYPE.AVW.toString() -> { + alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_AVW.poiType) + ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_AVW.poiType) + alertContent = String.format(alertContent, direction.desc) + ttsContent = String.format(ttsContent, direction.desc) + } + + //车辆失控预警 + MogoObuConstants.V2X_WARNING_TYPE.CLW.toString() -> { + alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType) + ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType) + alertContent = String.format(alertContent, direction.desc) + ttsContent = String.format(ttsContent, direction.desc) + } + //车辆失控预警 + MogoObuConstants.V2X_WARNING_TYPE.EVW.toString() -> { + alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType) + ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType) + } + // 这里处理固定的提示信息,包括了<紧急车辆提醒> - else -> { - ttsContent = EventTypeEnumNew.getWarningTts(appId) - alertContent = EventTypeEnumNew.getWarningContent(appId) + else -> { //TODO +// ttsContent = EventTypeEnumNew.getWarningTts(appId.toString()) +// alertContent = EventTypeEnumNew.getWarningContent(appId.toString()) } } @@ -753,19 +878,18 @@ class MogoPrivateObuNewManager private constructor() { "new handleSdkObu appId2 = $appId --- level = $level ---ttsContent = $ttsContent --- alertContent = $alertContent --- direction = $direction" ) if (level == 2 || level == 3) { - if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) { - Log.d("MsgBox-PriObuNewManager2", "alertContent或ttsContent为空!") - } //不显示弹框,其它保留 CallerMsgBoxManager.saveMsgBox( MsgBoxBean( - MsgBoxType.OBU, + MsgBoxType.V2X, V2XMsg( appId, alertContent, ttsContent ) - ) + ).apply { + sourceType = DataSourceType.OBU + } ) CallerHmiManager.warningV2X( appId, @@ -789,7 +913,7 @@ class MogoPrivateObuNewManager private constructor() { } }, true, - 3000L + 5000L ) //显示警告红边 CallerHmiManager.showWarning(direction) @@ -805,7 +929,7 @@ class MogoPrivateObuNewManager private constructor() { // 关闭警告红边 CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON) // 移除顶部弹窗 - // CallerHmiManager.disableWarningV2X((appId + direction.direction)) + // CallerHmiManager.disableWarningV2X((appId + direction.direction)) //更新周边车辆进行预警颜色变换,车辆实时移动和变色 TrafficDataConvertUtilsNew.cvxV2vThreatIndInfo2TrafficData(info)?.let { it.threatLevel = 0x01 @@ -829,7 +953,9 @@ class MogoPrivateObuNewManager private constructor() { MogoObuConstants.STATUS.ADD, MogoObuConstants.STATUS.UPDATE -> { - changeTrafficLightStatus(appId, lights) + if (lights != null && lights.isNotEmpty()) { + changeTrafficLightStatus(appId, lights) + } } // 删除 MogoObuConstants.STATUS.DELETE -> { @@ -838,15 +964,25 @@ class MogoPrivateObuNewManager private constructor() { CallerHmiManager.disableWarningV2X(appId.toString()) isShowGreenWave = false isShowRunRedLight = false + isYellowLight = false +// lightCountDownRed = 1 +// lightCountDownGreen = 1 +// lightCountDownYellow = 1 } } } private var isRedLight = false private var isGreenLight = false + private var isYellowLight = false private var isShowGreenWave = false private var isShowRunRedLight = false +// private var lightCountDownRed : Int = 1 +// private var lightCountDownGreen : Int = 1 +// private var lightCountDownYellow : Int = 1 + + /** * 修改红绿灯 */ @@ -861,63 +997,93 @@ class MogoPrivateObuNewManager private constructor() { val currentLight = lights[0] CallerLogger.d( "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", - "currentLight = $currentLight ---currentLight.phase = ${currentLight.phaseId} ---appId = $appId" + "changeTrafficLightStatus currentLight = $currentLight ----currentLight.light = ${currentLight.light} ---currentLight.phase = ${currentLight.phaseId} ---appId = $appId --countDown = ${currentLight.countDown.toInt()}" ) // 闯红灯预警,绿波通行和闯红灯是互斥的 when (appId) { - 0x0 -> {//不可用 V2I_RLVW_VIOLATION_TYPE_UNAVAILABLE 无效 + 0 -> {//不可用 V2I_RLVW_VIOLATION_TYPE_UNAVAILABLE 无效 } - 0x1 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT 一个红灯周期只显示一次 + 1 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT 一个红灯周期只显示一次 if (!isShowRunRedLight) { isShowRunRedLight = true - CallerHmiManager.disableWarningV2X(0x2.toString()) - CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}","changeTrafficLightStatus 闯红灯 --------> ") - ttsContent = EventTypeEnumNew.getWarningTts(appId.toString()) - alertContent = EventTypeEnumNew.getWarningContent(appId.toString()) + CallerHmiManager.disableWarningV2X(1667.toString()) + CallerLogger.d( + "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", + "changeTrafficLightStatus 闯红灯 --------> " + ) + ttsContent = + EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType) + alertContent = + EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType) + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.V2X, + V2XMsg( + EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, + alertContent, + ttsContent + ) + ).apply { + sourceType = DataSourceType.OBU + } + ) + CallerHmiManager.warningV2X( - appId.toString(), alertContent, ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 - appId.toString(), null, true, 5000L) + EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, + alertContent, + ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 + EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, + null, + true, + 5000L + ) } } - 0x2 -> { //绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION 一个绿灯周期只显示一次 100m的时候 + 2 -> { //绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION 一个绿灯周期只显示一次 100m的时候 if (!isShowGreenWave) { isShowGreenWave = true - CallerHmiManager.disableWarningV2X(0x1.toString()) - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", - "new changeTrafficLightStatus speed_min = ${currentLight.suggestMinSpeed} --speed_max = ${currentLight.suggestMaxSpeed} --TYPE_USECASE_ID_IVP_GREEN ---alertContent = $alertContent ---ttsContent = $ttsContent" - ) - val adviceSpeed = - "${currentLight.suggestMinSpeed} - ${currentLight.suggestMaxSpeed}" - val adviceSpeedTts = - "${currentLight.suggestMinSpeed}到${currentLight.suggestMaxSpeed}" + CallerHmiManager.disableWarningV2X(1666.toString()) + + var minSpeedTemp = Math.round(currentLight.suggestMinSpeed*3.6) + var maxSpeedTemp = Math.round(currentLight.suggestMaxSpeed*3.6) + if (minSpeedTemp == maxSpeedTemp) { + minSpeedTemp -= 5 + } + + val adviceSpeed = "$minSpeedTemp - $maxSpeedTemp" + val adviceSpeedTts = "$minSpeedTemp 到 $maxSpeedTemp" + +// val adviceSpeed = +// "${Math.round(currentLight.suggestMinSpeed*3.6)} - ${Math.round(currentLight.suggestMaxSpeed*3.6)}" +// val adviceSpeedTts = +// "${Math.round(currentLight.suggestMinSpeed*3.6)} 到 ${Math.round(currentLight.suggestMaxSpeed*3.6)}" + ttsContent = String.format( - EventTypeEnumNew.getWarningTts(appId.toString()), + EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType), adviceSpeedTts ) alertContent = String.format( - EventTypeEnumNew.getWarningContent(appId.toString()), + EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType), adviceSpeed ) val maxSpeed = currentLight.suggestMaxSpeed if (maxSpeed > 0) { - if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) { - Log.d("MsgBox-PriObuNewManager1", "alertContent或ttsContent为空!") - } CallerMsgBoxManager.saveMsgBox( MsgBoxBean( - MsgBoxType.OBU, + MsgBoxType.V2X, V2XMsg( EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, alertContent, ttsContent ) - ) + ).apply { + sourceType = DataSourceType.OBU + } ) CallerHmiManager.warningV2X( @@ -937,39 +1103,91 @@ class MogoPrivateObuNewManager private constructor() { when (currentLight.light) { // 灯光不可用 0 -> { - CallerHmiManager.showWarningTrafficLight(0, 2) + CallerObuTrafficLightListenerManager.invokeObuTrafficLight(0) } // 红灯 2, 3 -> { - if (!isRedLight) { - CallerHmiManager.disableWarningV2X(appId.toString()) - isRedLight = true - } - isGreenLight = false - CallerHmiManager.showWarningTrafficLight(1, 2) +// if (!isGreenLight) { //只有不是是绿灯,才能展示跳转到红灯 + if (!isRedLight) { + CallerHmiManager.disableWarningV2X(appId.toString()) + isRedLight = true + } + isGreenLight = false + isYellowLight = false +// lightCountDownYellow = 1 +// lightCountDownGreen = 1 - val red = currentLight.countDown.toInt() - CallerHmiManager.changeCountdownRed(red) + CallerObuTrafficLightListenerManager.invokeObuTrafficLight(1) + val red = currentLight.countDown.toInt() +// Log.e("lixp", " ----11--- red --------- = $red ----lightCountDownRed = $lightCountDownRed ----isGreenLight = $isGreenLight") +// //记录当前红灯的上一帧的值 10,9,10 +// if (lightCountDownRed == 1) { //最后一个灯态是1 +// lightCountDownRed = red +// } +// +// if (lightCountDownRed < red) { //10 9 +// return +// } +// lightCountDownRed = red +// Log.e("lixp", " ----22--- red --------- = $red ----lightCountDownRed = $lightCountDownRed ----isGreenLight = $isGreenLight") + CallerHmiManager.changeCountdownRed(red) +// } } // 绿灯 4, 5, 6 -> { - if (!isGreenLight) { - CallerHmiManager.disableWarningV2X(appId.toString()) - isGreenLight = true - } - isRedLight = false - CallerHmiManager.showWarningTrafficLight(3, 2) - val green = currentLight.countDown.toInt() - CallerHmiManager.changeCountdownGreen(green) +// if (!isYellowLight) { //只有不是黄灯的时候,才能跳转到绿灯 + if (!isGreenLight) { + CallerHmiManager.disableWarningV2X(appId.toString()) + isGreenLight = true + } + isRedLight = false + isYellowLight = false +// lightCountDownRed = 1 +// lightCountDownYellow = 1 + + CallerObuTrafficLightListenerManager.invokeObuTrafficLight(3) + val green = currentLight.countDown.toInt() +// Log.e("lixp", " ----11--- green --------- = $green ---lightCountDownGreen = $lightCountDownGreen ----isYellowLight = $isYellowLight") +// if (lightCountDownGreen == 1) { +// lightCountDownGreen = green +// } +// +// if (lightCountDownGreen < green) { +// return +// } +// lightCountDownGreen = green +// Log.d("lixp", " ----22--- green --------- = $green ---lightCountDownGreen = $lightCountDownGreen ----isYellowLight = $isYellowLight") + CallerHmiManager.changeCountdownGreen(green) +// } } // 黄灯 7, 8 -> { - CallerHmiManager.disableWarningV2X(appId.toString()) - CallerHmiManager.showWarningTrafficLight(2, 2) - val yellow = currentLight.countDown.toInt() - CallerHmiManager.changeCountdownYellow(yellow) +// if (!isRedLight) { //黄灯只能跳转绿灯 + if (!isYellowLight) { + isYellowLight = true + } + isRedLight = false + isGreenLight = false +// lightCountDownRed = 1 +// lightCountDownGreen = 1 + + CallerHmiManager.disableWarningV2X(appId.toString()) + CallerObuTrafficLightListenerManager.invokeObuTrafficLight(2) + val yellow = currentLight.countDown.toInt() +// Log.e("lixp", " -----11-- yellow --------- = $yellow ---lightCountDownYellow = $lightCountDownYellow ----isYellowLight = $isYellowLight") +// if (lightCountDownYellow == 1) { +// lightCountDownYellow = yellow +// } +// +// if (lightCountDownYellow < yellow) { +// return +// } +// lightCountDownYellow = yellow +// Log.d("lixp", " -----22-- yellow --------- = $yellow ---lightCountDownYellow = $lightCountDownYellow ----isYellowLight = $isYellowLight") + CallerHmiManager.changeCountdownYellow(yellow) + } } - } - } +// } + } diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/receiver/ObuTestNewObuRsiReceiver.kt b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/receiver/ObuTestNewObuRsiReceiver.kt new file mode 100644 index 0000000000..c216a9e7be --- /dev/null +++ b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/receiver/ObuTestNewObuRsiReceiver.kt @@ -0,0 +1,57 @@ +package com.mogo.eagle.core.function.obu.mogo.receiver + +import android.content.BroadcastReceiver +import android.content.Context +import android.content.Intent +import android.util.Log +import com.mogo.eagle.core.function.obu.mogo.MogoPrivateObuNewManager +import com.mogo.support.obu.model.MogoObuRsiWarningData +import com.mogo.support.obu.model.MogoObuRvWarningData +import com.mogo.support.obu.model.advance.RsiWarning +import com.mogo.support.obu.model.advance.V2xWarning +import com.mogo.support.obu.model.advance.VehBasics +import com.mogo.support.obu.model.advance.WarningData + +/** + * @author lixiaopeng + * @date 2023/1/13 10:50 上午 + * + * 自研OBU RSI 模拟场景 + */ +class ObuTestNewObuRsiReceiver : BroadcastReceiver() { + private var mContext: Context? = null + + companion object { + private const val TAG = "ObuTestNewObuReceiver" + } + + override fun onReceive(context: Context, intent: Intent) { + mContext = context + /** + * OBU 场景类型 + */ + val obuSceneType = intent.getIntExtra("sceneType", 0) + val obuStatus = intent.getIntExtra("status", 0) +// val obuDistance = intent.getDoubleExtra("distance", 0.0) + val obuEventSeriaNum = intent.getIntExtra("seriaNum", 0) + val obuSignSerialNum = intent.getIntExtra("signSerialNum", 0) + + val rsiWarning = RsiWarning(1) + rsiWarning.warningLevel = 1 + + rsiWarning.setDistance(1000) + rsiWarning.sceneType = obuSceneType //预警类型 0:无效 1:限速信息 2:道路危险 3:车内标牌 4:前方拥堵 + rsiWarning.eventSerialNum = obuEventSeriaNum //根据预警类型匹配 101 车辆故障 + rsiWarning.signSerialNum = obuSignSerialNum // 2:急转弯,8:桥梁 + + val rsiWarningList = listOf(rsiWarning) //TODO + + val cvxObuRsiInfo = MogoObuRsiWarningData(obuStatus, 1, rsiWarningList) + + MogoPrivateObuNewManager.INSTANCE + .getMogoObuListener() + .onMogoObuRsiWarning(cvxObuRsiInfo) + + } + +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/utils/TrafficDataConvertDcCombineUtils.kt b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/utils/TrafficDataConvertDcCombineUtils.kt new file mode 100644 index 0000000000..f8cdab2ba7 --- /dev/null +++ b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/utils/TrafficDataConvertDcCombineUtils.kt @@ -0,0 +1,95 @@ +package com.mogo.eagle.core.function.obu.mogo.utils + +import android.util.Log +import com.mogo.eagle.core.data.enums.TrafficTypeEnum +import com.mogo.eagle.core.data.traffic.TrafficData +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU +import com.mogo.support.obu.model.MogoObuRsiWarningData +import com.mogo.support.obu.model.MogoObuRsmWarningData +import com.mogo.support.obu.model.MogoObuRvWarningData +import mogo.v2x.ObuWarningEvent + +/** + * @description 自研obu数据通过工控机转发 + * + * @author lixiaopeng + * @since 2022/12/2 + */ +object TrafficDataConvertDcCombineUtils { + val TAG = "TrafficDataConvertDcCombineUtils" + + /** + * OBU RSU道路事件预警信息 转换交通元素数据 标牌 为何要显示level + */ + fun cvxRtiThreatIndInfo2TrafficData(info: MogoObuRsiWarningData): TrafficData? { + if (info.warningMsg == null || info.warningMsg.size < 1 || info.warningMsg[0].position == null) { + CallerLogger.e("$M_OBU$TAG", "数据转换异常,请检查参数是否齐全") + return null + } + val trafficData = TrafficData() + trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_DAO_LU_SHI_GONG + trafficData.uuid = info.warningMsg[0].signSerialNum.toString() + trafficData.lat = info.warningMsg[0].position.latitude + trafficData.lon = info.warningMsg[0].position.longitude + trafficData.threatLevel = info.warningMsg[0].warningLevel + return trafficData + } + + /** + * OBU 弱势交通参与者信息 转换交通元素数据 + */ + fun cvxPtcThreatIndInfo2TrafficData(info: ObuWarningEvent.RsmWarningData): TrafficData? { + if (info.participantOfOne == null) { + CallerLogger.e("$M_OBU$TAG", "数据转换异常,请检查参数是否齐全") + return null + } + val trafficData = TrafficData() + trafficData.uuid = info.participantOfOne.ptcID.toString() + trafficData.lat = info.participantOfOne.latitude / 10000000.0 + trafficData.lon = info.participantOfOne.longitude / 10000000.0 + trafficData.heading = info.participantOfOne.heading / 80.0 + trafficData.speed = info.participantOfOne.speed / 50.0 + + CallerLogger.e( + "${M_OBU}${"MogoObuDcCombineManager"}", + " cvxPtcThreatIndInfo2TrafficData ---uuid---> ${trafficData.uuid} --lat-- ${trafficData.lat} --lon-- ${trafficData.lon} --heading-- ${trafficData.heading} --speed-- ${trafficData.speed} --type --${info.participantOfOne.ptcType}" + ) + + when (info.participantOfOne.ptcType) { + // 未知 + 0 -> { + trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI + } + //机动车 + 1 -> { + trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_MOTO + } + // 非机动车 + 2 -> { + trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_BICYCLE + } + // 行人 + 3 -> { + trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_PEOPLE + } + } + + /** + * 交通参与者类型 + * 0:未知 + * 1:机动车 + * 2:非机动车 + * 3:行人 + * 4:OBU自身 + */ + // 判断车辆V2X预警级别,调整车辆颜色 + if (info.warningMsg != null && info.warningMsg.warningDataList != null) { + trafficData.threatLevel = info.warningMsg.warningDataList[0].warningLevel + } else { + trafficData.threatLevel = 1 + } + return trafficData + } + +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/build.gradle b/core/function-impl/mogo-core-function-v2x/build.gradle index 0549db5dd0..4a75c0e99f 100644 --- a/core/function-impl/mogo-core-function-v2x/build.gradle +++ b/core/function-impl/mogo-core-function-v2x/build.gradle @@ -4,6 +4,7 @@ plugins { id 'kotlin-android-extensions' id 'kotlin-kapt' id 'com.alibaba.arouter' + id 'com.google.protobuf' } android { compileSdkVersion rootProject.ext.android.compileSdkVersion @@ -35,6 +36,19 @@ android { targetCompatibility JavaVersion.VERSION_1_8 } + protobuf { + protoc { + artifact = rootProject.ext.dependencies.protoc + } + generateProtoTasks { + all().each { task -> + task.builtins { + java {} + } + } + } + } + } dependencies { @@ -50,7 +64,8 @@ dependencies { implementation rootProject.ext.dependencies.rxandroid implementation rootProject.ext.dependencies.flexbox kapt rootProject.ext.dependencies.aroutercompiler - implementation rootProject.ext.dependencies.mogo_v2x + implementation rootProject.ext.dependencies.protobuf_java + implementation rootProject.ext.dependencies.protobuf_java_util implementation rootProject.ext.dependencies.mogoaicloudtrafficlive if (Boolean.valueOf(USE_MAVEN_PACKAGE)) { implementation rootProject.ext.dependencies.mogocommons diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/V2XProvider.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/V2XProvider.kt index 5fffe10672..460656b069 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/V2XProvider.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/V2XProvider.kt @@ -4,16 +4,17 @@ import android.content.Context import com.alibaba.android.arouter.facade.annotation.Route import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.constants.MogoServicePaths.PATH_V2X_MODULE -import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider +import com.mogo.eagle.core.function.api.v2x.IV2XEventProvider import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightManager import com.mogo.eagle.core.function.v2x.events.V2XEventManager import com.mogo.eagle.core.function.v2x.speedlimit.SpeedLimitDataManager +import com.mogo.eagle.core.function.v2x.speedlimit.SpeedLimitDispatcher import com.mogo.eagle.core.function.v2x.trafficlight.core.TrafficLightDispatcher import com.mogo.eagle.core.function.v2x.vip.VipCarManager import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils @Route(path = PATH_V2X_MODULE) -class V2XProvider : IMoGoFunctionServerProvider { +class V2XProvider : IV2XEventProvider { override val functionName: String get() = "V2XProvider" @@ -23,6 +24,7 @@ class V2XProvider : IMoGoFunctionServerProvider { VipCarManager.INSTANCE.initServer(context) SpeedLimitDataManager.getInstance().start() TrafficLightDispatcher.INSTANCE.initServer(context) + SpeedLimitDispatcher.INSTANCE.initLimit(context) if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) { //不处理 @@ -33,6 +35,10 @@ class V2XProvider : IMoGoFunctionServerProvider { // RedLightWarningManager.INSTANCE.listenTrafficLight() } + override fun queryWholeRoadEvents() { + V2XEventManager.queryWholeRoadEvents() + } + override fun onDestroy() { VipCarManager.INSTANCE.destroy() TrafficLightDispatcher.INSTANCE.destroy() diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt index 86c0e3b634..12d03d56ac 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt @@ -4,17 +4,17 @@ import android.content.* import android.os.* import android.provider.Settings.System import android.util.* -import androidx.core.util.Pair import androidx.localbroadcastmanager.content.* -import com.mogo.cloud.commons.utils.* import com.mogo.cloud.passport.* +import com.mogo.commons.constants.HostConst import com.mogo.commons.module.ServiceConst.CARD_TYPE_ROAD_CONDITION 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.data.enums.EventTypeEnum +import com.mogo.eagle.core.data.enums.EventTypeEnumNew import com.mogo.eagle.core.data.enums.EventTypeHelper import com.mogo.commons.network.* +import com.mogo.eagle.core.data.config.FunctionBuildConfig 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 import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CLOUD_V2N @@ -24,12 +24,16 @@ import com.mogo.eagle.core.data.map.entity.MarkerExploreWay import com.mogo.eagle.core.data.map.entity.MarkerShowEntity import com.mogo.eagle.core.data.map.entity.V2XMessageEntity import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity +import com.mogo.eagle.core.data.msgbox.DataSourceType import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.data.msgbox.V2XMsg import com.mogo.eagle.core.data.traffic.* +import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener 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.autopilot.CallerAutoPilotStatusListenerManager +import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager 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 @@ -46,11 +50,19 @@ 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.utils.* import com.mogo.eagle.core.function.v2x.events.utils.MapUtils import com.mogo.eagle.core.function.v2x.events.voice.* +import com.mogo.eagle.core.function.v2x.internal.V2XManager +import com.mogo.eagle.core.function.v2x.internal.callback.IV2XCallback +import com.mogo.eagle.core.function.v2x.internal.config.V2XConfig +import com.mogo.eagle.core.function.v2x.internal.data.V2XAdvanceWarning +import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerCardResult +import com.mogo.eagle.core.function.v2x.internal.data.V2XOptimalRoute +import com.mogo.eagle.core.function.v2x.internal.data.V2XWarningTarget +import com.mogo.eagle.core.function.v2x.internal.event.V2XEvent +import com.mogo.eagle.core.function.v2x.road.V2XEventServiceApi +import com.mogo.eagle.core.network.MoGoRetrofitFactory 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 @@ -60,27 +72,25 @@ import com.mogo.eagle.core.utilcode.util.TimeUtils import com.mogo.eagle.core.utilcode.util.Utils import com.mogo.map.listener.* import com.mogo.map.marker.* -import com.mogo.v2x.* -import com.mogo.v2x.callback.* -import com.mogo.v2x.config.* -import com.mogo.v2x.data.* -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 io.reactivex.android.schedulers.AndroidSchedulers +import io.reactivex.disposables.Disposable +import io.reactivex.schedulers.Schedulers import kotlinx.coroutines.* import kotlinx.coroutines.android.* -import roadwork.Road.RW_PB +import mogo.telematics.pad.MessagePad import tv.danmaku.ijk.media.player.* import java.util.concurrent.* import java.util.concurrent.atomic.* object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallback, - IMogoMapListener, IMogoStatusChangedListener { + IMogoMapListener, IMogoStatusChangedListener, IMoGoAutopilotIdentifyListener { private const val TAG = "V2XEventManager" @@ -93,15 +103,16 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb // 记录历史行驶轨迹,用于车行驶方向计算,只保留两个数据 private val historyPath = arrayOfNulls(2) + var v2xEventDisposable: Disposable? = null + fun init(context: Context) { BridgeApi.init(context) if (hasInit.compareAndSet(false, true)) { if (!V2XManager.hasInit()) { - AiRoadMarker.init(context) V2XManager.init(V2XConfig.Builder().also { it.aiCloudConfig(MoGoAiCloudClientConfig.getInstance()) it.context(context) - it.loggable(false) + it.loggable(true) it.distanceForTriggerRefresh(200f) //行驶超过200(包含)米,刷新道路周边信息(短链请求) it.durationForTriggerRefresh( 60, @@ -129,7 +140,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb private fun registerListener() { V2XManager.addCallback(this) CallerMapLocationListenerManager.addListener(TAG, this, false) - BridgeApi.registerCenter()?.let { + BridgeApi.registerCenter()?.let { it-> it.registerMogoMapListener(MODULE_NAME, this) it.registerMogoMarkerClickListener( CARD_TYPE_ROAD_CONDITION, @@ -140,21 +151,25 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb } }) } - MogoStatusManager.getInstance().registerStatusChangedListener(MODULE_NAME, StatusDescriptor.ACC_STATUS, this) - MogoStatusManager.getInstance().registerStatusChangedListener(MODULE_NAME, StatusDescriptor.SEEK_HELPING, this) - + MogoStatusManager.getInstance() + .registerStatusChangedListener(MODULE_NAME, StatusDescriptor.ACC_STATUS, this) + MogoStatusManager.getInstance() + .registerStatusChangedListener(MODULE_NAME, StatusDescriptor.SEEK_HELPING, this) + CallerAutopilotIdentifyListenerManager.addListener(MODULE_NAME, this) } private fun unRegisterListener() { V2XManager.removeCallback(this) CallerMapLocationListenerManager.removeListener(TAG, false) - BridgeApi.registerCenter()?.let { + BridgeApi.registerCenter()?.let { it-> it.unregisterMogoMapListener(MODULE_NAME) it.unregisterMogoMarkerClickListener(CARD_TYPE_ROAD_CONDITION) } - MogoStatusManager.getInstance().unregisterStatusChangedListener(MODULE_NAME, StatusDescriptor.ACC_STATUS, this) - MogoStatusManager.getInstance().unregisterStatusChangedListener(MODULE_NAME, StatusDescriptor.SEEK_HELPING, this) - + MogoStatusManager.getInstance() + .unregisterStatusChangedListener(MODULE_NAME, StatusDescriptor.ACC_STATUS, this) + MogoStatusManager.getInstance() + .unregisterStatusChangedListener(MODULE_NAME, StatusDescriptor.SEEK_HELPING, this) + CallerAutopilotIdentifyListenerManager.removeListener(MODULE_NAME) } private fun initData() { @@ -353,12 +368,18 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb BridgeApi.v2xMarker()?.v2XRoadEventEntityList, V2XStatusManager.getInstance().location ) - if (v2XRoadEventEntity != null) { // CallerLogger.w("$M_V2X$TAG", + if (v2XRoadEventEntity != null) { val distance = v2XRoadEventEntity.distance - val min = if (EventTypeEnum.AI_ROAD_WORK.poiType == v2XRoadEventEntity.poiType) 0 else 5 - Logger.d(TAG, "--- trigger show before ---:data=>[${location.longitude}, ${location.latitude}, ${location.speed}], distance: $distance, minDistance: $min, poiType: ${v2XRoadEventEntity.poiType}") + val min = if (EventTypeEnumNew.isCloudSocketEvent(v2XRoadEventEntity.poiType)) 0 else 5 + CallerLogger.d( + "$M_V2X$TAG", + "--- trigger show before ---:data=>[${location.longitude}, ${location.latitude}, ${location.speed}], distance: $distance, minDistance: $min, poiType: ${v2XRoadEventEntity.poiType}" + ) if (distance >= min) { - Logger.d(TAG, "--- trigger show ---:poiType:" + v2XRoadEventEntity.poiType) + CallerLogger.d( + "$M_V2X$TAG", + "--- trigger show ---:poiType:" + v2XRoadEventEntity.poiType + ) TrackUtils.trackV2xRoadProduceEvent(1) val v2XMessageEntity = V2XMessageEntity() v2XMessageEntity.type = V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING @@ -428,46 +449,58 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb handleWarningTargetEvent(event.data) } is V2XEvent.RoadAI -> { - handleRoadMarkerEvent(event.data.toRoadMarker) + if(FunctionBuildConfig.isV2NFromCar){ + return + } + handleRoadMarkerEvent(event.data.toRoadMarker()) + } + + is V2XEvent.RoadEventX -> { + handleRoadMarkerEvent(event.data.toRoadMarker()) } } } - private val RW_PB.toRoadMarker: V2XMarkerCardResult - get() = V2XMarkerCardResult().also { l1 -> - this.roadwork?.polygonList?.takeIf { it.isNotEmpty() }?.also { old -> - l1.extras = HashMap>>().also { extra -> - extra["polygon"] = old.map { d -> - Pair(d.lon, d.lat) + override fun onAutopilotIdentifyPlanningObj(planningObjects: List?) { + super.onAutopilotIdentifyPlanningObj(planningObjects) + if(!FunctionBuildConfig.isV2NFromCar){ + return + } + planningObjects?.let { + if (it.isNotEmpty()) { + val first = it.stream() + .filter { planningObj: MessagePad.PlanningObject -> planningObj.type >= 1000 } + .findFirst() + if (first.isPresent) { + val poiType = when (first.get().type) { +// 1004 -> { //V2N_RSM,静止事件,包括异常停车、异常静止障碍物 +// } + 1005 -> { //V2N_RSI,施工事件,包括锥桶或者挡板围城的施工场景,是个多边形包围区域 + EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.poiType + } + 1007 -> { //三角牌 + EventTypeEnumNew.FOURS_ACCIDENT_04.poiType + } + else -> { + return + } + } + CallerLogger.d("$M_V2X$TAG", "poiType : $poiType , 触发道路事件") + val trackedObj = + CallerMapIdentifyManager.getIdentifyObj(first.get().uuid.toString()) + trackedObj?.let { t -> + CallerLogger.d("$M_V2X$TAG", "polygon size : ${(t.polygonList.size)}") + TrackUtils.trackV2xRoadProduceEvent(1) + val v2XMessageEntity = V2XMessageEntity() + v2XMessageEntity.type = V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING + v2XMessageEntity.content = t.toRoadMarker(poiType).toV2XRoadEventEntity() + v2XMessageEntity.isShowState = true + V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity) } - - extra["gps_location"] = listOf(Pair(this.roadwork?.center?.point?.lon ?: 0.0, this.roadwork?.center?.point?.lat ?: 0.0)) } } - l1.exploreWay = ArrayList().also { l2 -> - l2.add(V2XMarkerExploreWay().also { l3 -> - l3.poiType = this.roadwork?.poiType?.toString() - l3.generateTime = this.roadwork?.detectTime ?: 0L - l3.location = V2XMarkerLocation().also { l4 -> - 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] - l4.angle = this.roadwork?.center?.road?.bearing?.toDouble() ?: 0.0 - } - }) - } - - AiRoadMarker.receive(Marker(this.roadwork?.center?.point?.lat ?: 0.0, this.roadwork?.center?.point?.lon ?: 0.0, this.roadwork?.center?.road?.bearing?.toDouble() ?: 0.0, null, null, null)) } - -// private fun buildRoadEntity(e: V2XMarkerExploreWay, extra: Map? = 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() @@ -513,7 +546,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb when (message.typeId) { 1001 -> { // 弱势交通碰撞预警 - EventTypeHelper.getVRU{ appId, tts, content -> + EventTypeHelper.getVRU { appId, tts, content -> tempAppId = appId tempTts = tts tempContent = content @@ -530,35 +563,35 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb 1003 -> { // 交叉路口碰撞预警 changeVisualAngle = true - tempAppId = EventTypeEnum.TYPE_USECASE_ID_ICW.poiType.toInt() - tempTts = EventTypeEnum.TYPE_USECASE_ID_ICW.tts - tempContent = EventTypeEnum.TYPE_USECASE_ID_ICW.content + tempAppId = EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType.toInt() + tempTts = EventTypeEnumNew.TYPE_USECASE_ID_ICW.tts + tempContent = EventTypeEnumNew.TYPE_USECASE_ID_ICW.content } 1004 -> { // 交叉路口碰撞预警 changeVisualAngle = true - tempAppId = EventTypeEnum.TYPE_USECASE_ID_BSW.poiType.toInt() + tempAppId = EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType.toInt() tempTts = String.format( - EventTypeEnum.TYPE_USECASE_ID_BSW.tts, + EventTypeEnumNew.TYPE_USECASE_ID_BSW.tts, getWarningDirection() ) - tempContent = EventTypeEnum.TYPE_USECASE_ID_BSW.content + tempContent = EventTypeEnumNew.TYPE_USECASE_ID_BSW.content } 1006 -> { // 逆向超车预警 - tempAppId = EventTypeEnum.TYPE_USECASE_ID_DNPW.poiType.toInt() - tempTts = EventTypeEnum.TYPE_USECASE_ID_DNPW.tts - tempContent = EventTypeEnum.TYPE_USECASE_ID_DNPW.content + tempAppId = EventTypeEnumNew.TYPE_USECASE_ID_DNPW.poiType.toInt() + tempTts = EventTypeEnumNew.TYPE_USECASE_ID_DNPW.tts + tempContent = EventTypeEnumNew.TYPE_USECASE_ID_DNPW.content } 1005 -> { // 闯红灯预警 - tempAppId = EventTypeEnum.TYPE_USECASE_ID_IVP.poiType.toInt() - tempTts = EventTypeEnum.TYPE_USECASE_ID_IVP.tts - tempContent = EventTypeEnum.TYPE_USECASE_ID_IVP.content + tempAppId = EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType.toInt() + tempTts = EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.tts + tempContent = EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.content } 2001 -> { // 最优车道100061 - EventTypeHelper.getOptLine{ appId, tts, content -> + EventTypeHelper.getOptLine { appId, tts, content -> tempAppId = appId tempTts = tts tempContent = content @@ -566,7 +599,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb } 3001 -> { // 前方道路拥堵预警 - EventTypeHelper.getTJW{ appId, tts, content -> + EventTypeHelper.getTJW { appId, tts, content -> tempAppId = appId tempTts = tts tempContent = content @@ -580,9 +613,11 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb CallerMsgBoxManager.saveMsgBox( MsgBoxBean( MsgBoxType.V2X, - V2XMsg(tempAppId.toString(), + V2XMsg( + tempAppId.toString(), tempContent, - tempTts) + tempTts + ) ) ) CallerHmiManager.warningV2X( @@ -645,6 +680,63 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb } } + fun queryWholeRoadEvents() { + if (v2xEventDisposable != null && !v2xEventDisposable!!.isDisposed) { + v2xEventDisposable!!.dispose() + } + val sn = MoGoAiCloudClientConfig.getInstance().sn + val lineId = getLineId() + if (lineId > 0) { + realQueryV2xEvents(lineId.toString(), sn) + } else { + UiThreadHandler.postDelayed({ + realQueryV2xEvents(getLineId().toString(), sn) + }, 500) + } + } + + private fun realQueryV2xEvents(lineId: String, sn: String) { + v2xEventDisposable = MoGoRetrofitFactory.getInstance(HostConst.getHost()) + .create(V2XEventServiceApi::class.java) + .queryAllV2XEventsByLineId(lineId, sn) + .map { + if (it.code == 200 || it.code == 0) { + CallerLogger.d(M_V2X + TAG, "请求成功,size为:${it.result?.v2XEventList?.size}") + return@map it.result?.v2XEventList + } else { + CallerLogger.d(M_V2X + TAG, "请求失败,code为:${it.code}") + return@map ArrayList() + } + } + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe { + val size = it?.size ?: 0 + if (size > 0) { + val msgBoxBean = MsgBoxBean(MsgBoxType.V2X, V2XMsg("", "查询到当前全程共${size}个事件", "")) + msgBoxBean.sourceType = DataSourceType.SUMMARY + CallerMsgBoxManager.saveMsgBox(msgBoxBean) + } + } + } + + private fun getLineId(): Long { + var lineId: Long = -1 + val parameter = CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo() + .autopilotControlParameters + if (parameter != null) { + if (parameter.autoPilotLine != null) { + lineId = parameter.autoPilotLine!!.lineId + CallerLogger.d(M_V2X + TAG, "lineId为:$lineId") + } else { + CallerLogger.d(M_V2X + TAG, "parameter.autoPilotLine为null") + } + } else { + CallerLogger.d(M_V2X + TAG, "parameter为null") + } + return lineId + } + override fun onFail(msg: String) { CallerLogger.e("$M_V2X$TAG", "Error: $msg") } @@ -662,4 +754,5 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb } } } + } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/alarm/V2XAlarmServer.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/alarm/V2XAlarmServer.java index 1d822f9a92..7019f0601f 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/alarm/V2XAlarmServer.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/alarm/V2XAlarmServer.java @@ -1,10 +1,13 @@ package com.mogo.eagle.core.function.v2x.events.alarm; +import android.util.Log; + +import com.facebook.common.logging.LoggingDelegate; +import com.mogo.eagle.core.data.enums.EventTypeEnumNew; import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.data.map.entity.MarkerLocation; import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; import com.mogo.eagle.core.function.v2x.events.utils.DrivingDirectionUtils; -import com.mogo.eagle.core.data.enums.EventTypeEnum; import java.util.Iterator; import java.util.concurrent.CopyOnWriteArrayList; import io.netty.util.internal.ConcurrentSet; @@ -24,7 +27,7 @@ import io.netty.util.internal.ConcurrentSet; public class V2XAlarmServer { // 记录道路播报的事件 - private static ConcurrentSet showedEvents = new ConcurrentSet<>(); + private static final ConcurrentSet showedEvents = new ConcurrentSet<>(); /** * 获取当前车辆前方距离最近的道路事件 */ @@ -32,6 +35,7 @@ public class V2XAlarmServer { CopyOnWriteArrayList v2XRoadEventEntityList, MogoLocation currentLocation) { try { + Log.d("RWJ", "getDriveFrontAlarmEvent --- 1 ---" + currentLocation ); if (!showedEvents.isEmpty()) { Iterator iterator = showedEvents.iterator(); while (iterator.hasNext()) { @@ -48,17 +52,20 @@ public class V2XAlarmServer { } } } + Log.d("RWJ", "getDriveFrontAlarmEvent --- 2 ---" + currentLocation); if (currentLocation != null && v2XRoadEventEntityList != null) { // 因为集合是按照距离排序后的所以这里检索出来第一个就发出警告 for (V2XRoadEventEntity v2XRoadEventEntity : v2XRoadEventEntityList) { // 0、道路事件必须有朝向,角度>=0; + Log.d("RWJ", "entity:" + v2XRoadEventEntity.getLocation()); if (v2XRoadEventEntity.getLocation().getAngle() >= 0) { // 计算车辆距离指定气泡的距离 MarkerLocation eventLocation = v2XRoadEventEntity.getLocation(); // 1、判断是否到达了触发距离,20 ~ 500, double distance = v2XRoadEventEntity.getDistance(); + Log.d("RWJ", "distance:" + distance); if (distance <= 500) { - if (EventTypeEnum.GHOST_PROBE.getPoiType().equals(v2XRoadEventEntity.getPoiType())) { + if (EventTypeEnumNew.GHOST_PROBE.getPoiType().equals(v2XRoadEventEntity.getPoiType())) { if (distance > 25) { continue; } @@ -67,7 +74,8 @@ public class V2XAlarmServer { double carBearing = currentLocation.getBearing(); double eventBearing = eventLocation.getAngle(); double diffAngle = DrivingDirectionUtils.getAngleDiff(carBearing, eventBearing); - if (diffAngle < 20) { + Log.d("RWJ", "car_bearing:" + carBearing + ",eventBearing:" + eventBearing + ",diffAngle:" + diffAngle); + if (diffAngle <= 20) { // 3、计算当前车辆行驶方向与事件位置之间夹角《20度,保证道路事件在车辆前方 double eventAngle = DrivingDirectionUtils.getDegreeOfCar2Poi( currentLocation.getLongitude(), @@ -76,10 +84,13 @@ public class V2XAlarmServer { eventLocation.getLat(), (int) currentLocation.getBearing() ); + + Log.d("RWJ", "eventAngle:" + eventAngle); if (0 <= eventAngle && eventAngle <= 20) { if (showedEvents.contains(v2XRoadEventEntity)) { return null; } + Log.d("RWJ", "showed---"); showedEvents.add(v2XRoadEventEntity); return v2XRoadEventEntity; } @@ -90,6 +101,7 @@ public class V2XAlarmServer { } } catch (Exception e) { e.printStackTrace(); + Log.w("RWJ", "error: " + e.getMessage()); } return null; } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/consts/V2XConst.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/consts/V2XConst.java index 1be40996cc..2d2e0a4d73 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/consts/V2XConst.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/consts/V2XConst.java @@ -59,6 +59,6 @@ public class V2XConst { /** * V2X预警日志tag */ - public static final String LOG_NAME_WARN = "liyz"; + public static final String LOG_NAME_WARN = "MoGoPersonWarnPolyline"; } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/entity/panel/SurroundingConstruction.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/entity/panel/SurroundingConstruction.java index 00af59ade0..eb63f3cc4a 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/entity/panel/SurroundingConstruction.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/entity/panel/SurroundingConstruction.java @@ -1,8 +1,7 @@ package com.mogo.eagle.core.function.v2x.events.entity.panel; +import com.mogo.eagle.core.data.enums.EventTypeEnumNew; import com.mogo.eagle.core.data.map.entity.MarkerExploreWay; -import com.mogo.eagle.core.data.enums.EventTypeEnum; - import java.io.Serializable; import java.util.ArrayList; import java.util.List; @@ -37,9 +36,4 @@ public class SurroundingConstruction implements Serializable { construtList.add(item); } - public String getTypeNameTTS(String type) { - String typeName = "请查看周边的"; - typeName += EventTypeEnum.getTypeNameTTS(type); - return typeName + "信息"; - } } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XMarkerManager.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XMarkerManager.java index 739c8cdf99..f82f7c4014 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XMarkerManager.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XMarkerManager.java @@ -4,8 +4,9 @@ import android.content.Context; import com.alibaba.android.arouter.facade.template.IProvider; import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; +import com.mogo.map.marker.IMogoMarker; import com.mogo.map.marker.IMogoMarkerClickListener; -import com.mogo.v2x.data.V2XMarkerCardResult; +import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerCardResult; import java.util.concurrent.CopyOnWriteArrayList; @@ -37,11 +38,11 @@ public interface IMoGoV2XMarkerManager extends IProvider { /** * 绘制正在预警的道路事件的POI点 - * - * @param context + * @param context * @param roadEventEntity + * @return */ - void drawableAlarmPOI(Context context, V2XRoadEventEntity roadEventEntity, IMogoMarkerClickListener clickListener); + IMogoMarker drawableAlarmPOI(Context context, V2XRoadEventEntity roadEventEntity, IMogoMarkerClickListener clickListener); /** * 清除 道路事件 POI diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XMarkerManager.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XMarkerManager.java index 83ed3ee04d..0e19213da2 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XMarkerManager.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XMarkerManager.java @@ -10,6 +10,7 @@ import com.alibaba.android.arouter.facade.annotation.Route; import com.mogo.cloud.commons.utils.CoordinateUtils; import com.mogo.commons.AbsMogoApplication; import com.mogo.commons.module.status.MogoStatusManager; +import com.mogo.eagle.core.data.enums.EventTypeEnumNew; import com.mogo.eagle.core.data.map.MogoLatLng; import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.data.map.entity.MarkerExploreWay; @@ -32,11 +33,10 @@ import com.mogo.map.marker.IMogoMarker; import com.mogo.map.marker.IMogoMarkerClickListener; import com.mogo.map.marker.IMogoMarkerManager; import com.mogo.map.marker.MogoMarkerOptions; -import com.mogo.eagle.core.data.enums.EventTypeEnum; -import com.mogo.v2x.V2XManager; -import com.mogo.v2x.data.V2XMarkerCardResult; -import com.mogo.v2x.data.V2XMarkerExploreWay; -import com.mogo.v2x.data.V2XMarkerLocation; +import com.mogo.eagle.core.function.v2x.internal.V2XManager; +import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerCardResult; +import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerExploreWay; +import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerLocation; import java.util.List; import java.util.Objects; @@ -56,8 +56,7 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager { // 记录所有的:新鲜事儿的道路事件点、探路事件 private static final CopyOnWriteArraySet mV2XRoadEventEntityArrayList = new CopyOnWriteArraySet<>(); - // 上次的道路事件的预警Marker - private static IMogoMarker mAlarmInfoMarker; + @Override public void drawableLastAllPOI() { @@ -112,7 +111,7 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager { List exploreWayList = markerCardResult.getExploreWay(); if (exploreWayList != null) { for (V2XMarkerExploreWay markerExploreWay : exploreWayList) { - if (EventTypeEnum.isRoadEvent(markerExploreWay.getPoiType())) { + if (EventTypeEnumNew.isRoadEvent(markerExploreWay.getPoiType())) { V2XMarkerLocation markerLocation = markerExploreWay.getLocation(); // 记录道路事件 V2XRoadEventEntity v2XRoadEventEntity = new V2XRoadEventEntity(); @@ -133,7 +132,7 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager { } @Override - public void drawableAlarmPOI(Context context, V2XRoadEventEntity roadEventEntity, IMogoMarkerClickListener clickListener) { + public IMogoMarker drawableAlarmPOI(Context context, V2XRoadEventEntity roadEventEntity, IMogoMarkerClickListener clickListener) { try { IMoGoV2XStatusManager v2xStatus = BridgeApi.INSTANCE.v2xStatus(); if (v2xStatus != null) { @@ -148,7 +147,6 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager { .latitude(roadEventEntity.getLocation().getLat()) .longitude(roadEventEntity.getLocation().getLon()); optionsRipple.anchor(0.5f, 0.5f); - MarkerShowEntity markerShowEntity = new MarkerShowEntity(); MarkerExploreWay markerExploreWay = roadEventEntity.getNoveltyInfo(); markerShowEntity.setBindObj(markerExploreWay); @@ -156,22 +154,21 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager { markerShowEntity.setTextContent(markerExploreWay.getAddr()); markerShowEntity.setMarkerLocation(markerExploreWay.getLocation()); markerShowEntity.setMarkerType(CARD_TYPE_NOVELTY); - optionsRipple.icons(V2XMarkerAdapter.getV2XRoadEventViewGif(context, roadEventEntity)); optionsRipple.period(1); - + IMogoMarker ret = null; if (MogoStatusManager.getInstance().isVrMode()) { - mAlarmInfoMarker = Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerService()).drawMarker(markerShowEntity); + ret = Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMarkerService()).drawMarker(markerShowEntity); } else { optionsRipple.icon(V2XMarkerAdapter.getV2XRoadEventViewPng(context, roadEventEntity)); IMogoMarkerManager marker = MogoMarkerManager.getInstance(context); if (marker != null) { - mAlarmInfoMarker = marker.addMarker(V2X_EVENT_ALARM_POI, optionsRipple); + ret = marker.addMarker(V2X_EVENT_ALARM_POI, optionsRipple); } } // 当前Marker设置为最上面 - if (mAlarmInfoMarker != null) { - mAlarmInfoMarker.setToTop(); + if (ret != null) { + ret.setToTop(); } // 绘制连接线 IMoGoV2XPolylineManager polylineManager = BridgeApi.INSTANCE.v2xPolyline(); @@ -183,28 +180,30 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager { new MogoLatLng(roadEventEntity.getLocation().getLat(), roadEventEntity.getLocation().getLon() ), context); + + return ret; } else { CallerLogger.INSTANCE.e(M_V2X + TAG, "Location 必须进行初始化!!!!!"); } } catch (Exception e) { e.printStackTrace(); } + return null; } @Override public void clearAlarmPOI() { - - boolean isRoadEventPOIShow = false; - IMoGoV2XStatusManager v2xStatus = BridgeApi.INSTANCE.v2xStatus(); - if (v2xStatus != null) { - isRoadEventPOIShow = v2xStatus.isRoadEventPOIShow(); - } - if (isRoadEventPOIShow) { - v2xStatus.setRoadEventPOIShow(TAG, false); - if (mAlarmInfoMarker != null) { - mAlarmInfoMarker.remove(); - } - } +// boolean isRoadEventPOIShow = false; +// IMoGoV2XStatusManager v2xStatus = BridgeApi.INSTANCE.v2xStatus(); +// if (v2xStatus != null) { +// isRoadEventPOIShow = v2xStatus.isRoadEventPOIShow(); +// } +// if (isRoadEventPOIShow) { +// v2xStatus.setRoadEventPOIShow(TAG, false); +// if (mAlarmInfoMarker != null) { +// mAlarmInfoMarker.remove(); +// } +// } } @Override @@ -221,9 +220,9 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager { @Override public void forceClearAlarmPOI() { - if (mAlarmInfoMarker != null) { - mAlarmInfoMarker.remove(); - } +// if (mAlarmInfoMarker != null) { +// mAlarmInfoMarker.remove(); +// } } @Override diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/MarkerManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/MarkerManager.kt new file mode 100644 index 0000000000..01387ee060 --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/MarkerManager.kt @@ -0,0 +1,196 @@ +package com.mogo.eagle.core.function.v2x.events.marker + +import android.os.Handler +import android.os.HandlerThread +import android.util.Log +import com.mogo.cloud.commons.utils.CoordinateUtils +import com.mogo.commons.utils.DrivingDirectionUtils +import com.mogo.eagle.core.data.map.MogoLocation +import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager +import com.mogo.map.marker.IMogoMarker +import com.mogo.map.overlay.IMogoPolyline +import kotlinx.coroutines.Runnable +import java.util.LinkedList +import java.util.concurrent.ConcurrentHashMap +import java.util.concurrent.atomic.AtomicBoolean +import java.util.concurrent.atomic.AtomicReference + + +data class MarkerWrapper(val id: String, val lon: Double, val lat: Double, val coordinateType: Int, var markers: ArrayList? = null, var lines: ArrayList? = null) { + + fun addLine(line: IMogoPolyline) { + var ll = this.lines + if (ll == null) { + ll = ArrayList() + this.lines = ll + } + ll.add(line) + } + + fun addMarker(marker: IMogoMarker) { + var mm = this.markers + if (mm == null) { + mm = ArrayList() + this.markers = mm + } + mm.add(marker) + } + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + + other as MarkerWrapper + + if (id != other.id) return false + + return true + } + + override fun hashCode(): Int { + return id.hashCode() + } +} + +object MarkerManager { + + private const val TAG = "MarkerManager" + + private val showedMarkers by lazy { LinkedList() } + + private val toRemoveMakers by lazy { LinkedList() } + + private val isFirstAdd by lazy { AtomicBoolean(false) } + + private val elapsedDistances by lazy { ConcurrentHashMap() } + + private val lastCarLocation by lazy { AtomicReference() } + + private val lastGpsLocation by lazy { AtomicReference() } + + private val checkTask = object : Runnable { + + override fun run() { + + try { + Log.d(TAG, "--- checkTask --- 1 ---") + if (lastCarLocation.get() == null) { + return + } + Log.d(TAG, "--- checkTask --- 2 ---") + if (lastGpsLocation.get() == null) { + return + } + Log.d(TAG, "--- checkTask --- 3 ---") + val toRemove = toRemoveMakers.iterator() + val carLoc = AtomicReference() + while (toRemove.hasNext()) { + val marker = toRemove.next() + if (carLoc.get() == null) { + carLoc.set(if (marker.coordinateType == 0) { + //高德坐标 + CallerMapLocationListenerManager.getCurrentLocation() + } else { + CallerMapLocationListenerManager.getCurrentGpsLocation() + }) + } + val currentLocation = carLoc.get() + val lastLocation = if (marker.coordinateType == 0) lastCarLocation.get() else lastGpsLocation.get() + + if (marker.coordinateType == 0) { + lastCarLocation.set(currentLocation) + } else { + lastGpsLocation.set(currentLocation) + } + if (currentLocation != null && lastLocation != null) { + val delta = CoordinateUtils.calculateLineDistance(currentLocation.longitude, currentLocation.latitude, lastLocation.longitude, lastLocation.latitude) + Log.d(TAG, "--- checkTask --- 4 ---:delta:$delta") + var elapsed = elapsedDistances[marker] + if (elapsed == null) { + elapsed = delta.toDouble() + } else { + elapsed += delta + } + Log.d(TAG, "--- checkTask --- 5 ---:delta:$delta, elapsed:${elapsed}") + if (elapsed >= 200) { + var removeMarkerError = false + marker.markers?.forEach { + try { + it.setVisible(false) + it.destroy() + } catch (t: Throwable) { + t.printStackTrace() + removeMarkerError = true + Log.e(TAG, "--- checkTask --- remove marker error:${t.message}") + } + } + var removeLineError = false + marker.lines?.forEach { + try { + it.isVisible = false + it.destroy() + } catch (t: Throwable) { + t.printStackTrace() + removeLineError = true + Log.e(TAG, "--- checkTask --- remove line error:${t.message}") + } + } + if (!removeLineError && !removeMarkerError) { + toRemove.remove() + synchronized(elapsedDistances) { + elapsedDistances.remove(marker) + } + } + } else { + elapsedDistances[marker] = elapsed + } + } + } + val iterator = showedMarkers.iterator() + while (iterator.hasNext()) { + val marker = iterator.next() + if (carLoc.get() == null) { + carLoc.set(if (marker.coordinateType == 0) { + //高德坐标 + CallerMapLocationListenerManager.getCurrentLocation() + } else { + CallerMapLocationListenerManager.getCurrentGpsLocation() + }) + } + val location = carLoc.get() + if (location != null) { + val angle = DrivingDirectionUtils.getDegreeOfCar2Poi2(location.longitude, location.latitude, marker.lon, marker.lat, location.bearing.toDouble()) + if (angle >= 90) { + iterator.remove() + synchronized(toRemoveMakers) { + toRemoveMakers.offer(marker) + } + } + } + } + } catch (t: Throwable) { + t.printStackTrace() + } finally { + lastCarLocation.set(CallerMapLocationListenerManager.getCurrentLocation()) + lastGpsLocation.set(CallerMapLocationListenerManager.getCurrentGpsLocation()) + handler.postDelayed(this, 1000) + } + } + } + + private val handler by lazy { + val thread = HandlerThread("check_marker_expired") + thread.start() + Handler(thread.looper) + } + + + fun addMarker(marker: MarkerWrapper) { + synchronized(showedMarkers) { + showedMarkers.offer(marker) + } + if (isFirstAdd.compareAndSet(false,true)) { + handler.postDelayed(checkTask, 1000) + } + } +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerAdapter.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerAdapter.java index 215745c444..ed35d062a8 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerAdapter.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerAdapter.java @@ -3,10 +3,9 @@ package com.mogo.eagle.core.function.v2x.events.marker; import android.content.Context; import android.graphics.Bitmap; +import com.mogo.eagle.core.data.enums.EventTypeEnumNew; import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; import com.mogo.eagle.core.function.v2x.R; -import com.mogo.eagle.core.data.enums.EventTypeEnum; - import java.util.ArrayList; /** @@ -30,10 +29,10 @@ public class V2XMarkerAdapter { */ public static Bitmap getV2XRoadEventViewPng(Context context, V2XRoadEventEntity alarmInfo) { Bitmap bitmap; - if (EventTypeEnum.ALERT_TRAFFIC_LIGHT_SUGGEST.getPoiType().equals(alarmInfo.getPoiType()) - || EventTypeEnum.ALERT_TRAFFIC_LIGHT_WARNING.getPoiType().equals(alarmInfo.getPoiType()) - || EventTypeEnum.FOURS_BLOCK_UP.getPoiType().equals(alarmInfo.getPoiType()) - || EventTypeEnum.ALERT_CAR_TROUBLE_WARNING.getPoiType().equals(alarmInfo.getPoiType())) { + if (EventTypeEnumNew.ALERT_TRAFFIC_LIGHT_SUGGEST.getPoiType().equals(alarmInfo.getPoiType()) + || EventTypeEnumNew.ALERT_TRAFFIC_LIGHT_WARNING.getPoiType().equals(alarmInfo.getPoiType()) + || EventTypeEnumNew.FOURS_BLOCK_UP.getPoiType().equals(alarmInfo.getPoiType()) + || EventTypeEnumNew.ALERT_CAR_TROUBLE_WARNING.getPoiType().equals(alarmInfo.getPoiType())) { bitmap = getV2XRoadEventMarkerView( context, alarmInfo, @@ -52,10 +51,10 @@ public class V2XMarkerAdapter { */ public static ArrayList getV2XRoadEventViewGif(Context context, V2XRoadEventEntity alarmInfo) { ArrayList bitmapArrayList; - if (EventTypeEnum.ALERT_TRAFFIC_LIGHT_SUGGEST.getPoiType().equals(alarmInfo.getPoiType()) - || EventTypeEnum.ALERT_TRAFFIC_LIGHT_WARNING.getPoiType().equals(alarmInfo.getPoiType()) - || EventTypeEnum.FOURS_BLOCK_UP.getPoiType().equals(alarmInfo.getPoiType()) - || EventTypeEnum.ALERT_CAR_TROUBLE_WARNING.getPoiType().equals(alarmInfo.getPoiType())) { + if (EventTypeEnumNew.ALERT_TRAFFIC_LIGHT_SUGGEST.getPoiType().equals(alarmInfo.getPoiType()) + || EventTypeEnumNew.ALERT_TRAFFIC_LIGHT_WARNING.getPoiType().equals(alarmInfo.getPoiType()) + || EventTypeEnumNew.FOURS_BLOCK_UP.getPoiType().equals(alarmInfo.getPoiType()) + || EventTypeEnumNew.ALERT_CAR_TROUBLE_WARNING.getPoiType().equals(alarmInfo.getPoiType())) { bitmapArrayList = getV2XRoadEventOrangeMarkerView(context, alarmInfo); } else { bitmapArrayList = getV2XRoadEventRedMarkerView(context, alarmInfo); diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerRoadEventView.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerRoadEventView.kt index 2fe26980a0..26e860d73d 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerRoadEventView.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerRoadEventView.kt @@ -8,7 +8,7 @@ import androidx.constraintlayout.widget.ConstraintLayout import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity import com.mogo.eagle.core.function.v2x.R import com.mogo.eagle.core.utilcode.util.ViewUtils -import com.mogo.eagle.core.data.enums.EventTypeEnum +import com.mogo.eagle.core.data.enums.EventTypeEnumNew import kotlinx.android.synthetic.main.view_marker_event_car.view.* /** @@ -30,8 +30,8 @@ class V2XMarkerRoadEventView(context: Context, alarmInfo: V2XRoadEventEntity) : } fun initView(context: Context, alarmInfo: V2XRoadEventEntity) { - if (alarmInfo.poiType == EventTypeEnum.ALERT_FRONT_CAR.poiType || - alarmInfo.poiType == EventTypeEnum.ALERT_CAR_TROUBLE_WARNING.poiType + if (alarmInfo.poiType == EventTypeEnumNew.ALERT_FRONT_CAR.poiType || + alarmInfo.poiType == EventTypeEnumNew.ALERT_CAR_TROUBLE_WARNING.poiType ) { LayoutInflater.from(context) .inflate(R.layout.view_marker_event_car, this) @@ -43,11 +43,11 @@ class V2XMarkerRoadEventView(context: Context, alarmInfo: V2XRoadEventEntity) : } /** - * @see EventTypeEnum + * @see EventTypeEnumNew */ private fun updateIcon(alarmInfo: V2XRoadEventEntity) { // 道路施工、积水、路面结冰、浓雾、事故、拥堵 - val iconResId = EventTypeEnum.getUpdateIconRes(alarmInfo.poiType) + val iconResId = EventTypeEnumNew.getUpdateIconRes(alarmInfo.poiType) if (iconResId != 0) { ivCar.setImageResource(iconResId) } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/receiver/TestPanelBroadcastReceiver.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/receiver/TestPanelBroadcastReceiver.java deleted file mode 100644 index acb38623e6..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/receiver/TestPanelBroadcastReceiver.java +++ /dev/null @@ -1,154 +0,0 @@ -package com.mogo.eagle.core.function.v2x.events.receiver; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; - -import androidx.localbroadcastmanager.content.LocalBroadcastManager; - -import com.mogo.commons.module.status.MogoStatusManager; -import com.mogo.eagle.core.data.map.MogoLatLng; -import com.mogo.eagle.core.data.map.entity.MarkerExploreWay; -import com.mogo.eagle.core.data.map.entity.V2XMessageEntity; -import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; -import com.mogo.eagle.core.function.call.chat.CallerChatManager; -import com.mogo.eagle.core.function.call.map.CallerSmpManager; -import com.mogo.eagle.core.function.v2x.events.consts.V2XConst; -import com.mogo.eagle.core.function.v2x.events.entity.net.V2XOptimalRouteDataRes; -import com.mogo.eagle.core.function.v2x.events.entity.net.V2XSpecialCarRes; -import com.mogo.eagle.core.function.v2x.events.utils.TestOnLineCarUtils; -import com.mogo.eagle.core.function.v2x.events.utils.V2XSQLiteUtils; -import com.mogo.eagle.core.utilcode.util.Utils; - -import java.util.List; - -/** - * V2X 测试面板广播接收,目的是可以通过广播调用起来面板 - * - * @author donghongyu - */ -public class TestPanelBroadcastReceiver extends BroadcastReceiver { - private static final String TAG = V2XConst.MODULE_NAME + "_TestPanelBroadcastReceiver"; - - private Context mContext; - - @Override - public void onReceive(Context context, Intent intent) { - try { - this.mContext = context; - int sceneType = intent.getIntExtra(V2XConst.BROADCAST_TEST_PANEL_CONTROL_TYPE_EXTRA_KEY, 0); - - // 分发场景 - dispatchSceneTest(sceneType); - } catch (Exception e) { - e.printStackTrace(); - } - } - - - /** - * 分发处理场景 - * - * @param sceneType 场景类型 - */ - private void dispatchSceneTest(int sceneType) { - if (sceneType == 0) {//打开用户信息 - CallerChatManager.INSTANCE.call(Utils.getApp(), "X20202111230C01"); - } else if (sceneType == 1) {// 触发道路事件 - V2XMessageEntity v2XMessageEntity = - TestOnLineCarUtils.getV2XScenarioRoadEventData(); - - Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION); - intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity); - LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent); - - // 存储本地,出行动态作展示 - saveLocalStory(V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING, - v2XMessageEntity.getContent().getNoveltyInfo()); - } - if (sceneType == 2) {// 触发AI道路施工事件 - V2XMessageEntity v2XMessageEntity = - TestOnLineCarUtils.getV2XScenarioAIRoadEventData(); - Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION); - intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity); - LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent); - - // 存储本地,出行动态作展示 - saveLocalStory(V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING, - v2XMessageEntity.getContent().getNoveltyInfo()); - } else if (sceneType == 9) {//触发他人发起道路求助事件 - V2XMessageEntity> v2XMessageEntity = - TestOnLineCarUtils.getV2XScenarioSeekHelpData(); - - Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION); - intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity); - LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent); - } else if (sceneType == 10) {//触发事件UGC - V2XMessageEntity v2XMessageEntity = - TestOnLineCarUtils.getV2XScenarioRoadEventUGCData(); - - Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION); - intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity); - LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent); - } else if (sceneType == 11) {//触发违章停车事件 - V2XMessageEntity> v2XMessageEntity = - TestOnLineCarUtils.getV2XIllegalParkData(); - - Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION); - intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity); - LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent); - } else if (sceneType == 12) {//车路云场景预警-右侧 - V2XMessageEntity messageEntity = TestOnLineCarUtils.getV2XScenarioPushFrontWarningEventData("right"); - Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION); - intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, messageEntity); - LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent); - } else if (sceneType == 13) {//车路云场景预警-左侧 - V2XMessageEntity messageEntity = TestOnLineCarUtils.getV2XScenarioPushFrontWarningEventData("left"); - Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION); - intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, messageEntity); - LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent); - } else if (sceneType == 14) {//行人预警,行人路线预测 车路云预警-前方行人 - V2XMessageEntity messageEntity = TestOnLineCarUtils.getV2XScenarioPushFrontWarningEventData("pedestrians"); - Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION); - intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, messageEntity); - LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent); - } /*else if (sceneType == 16) {//触发基于目的地预测的线路推荐 - V2XRefreshModel model = BridgeApi.INSTANCE.refreshModel(); - model. - V2XServiceManager.getV2XRefreshModel().queryRoadData("F803EB2046PZD00149"); - } */ else if (sceneType == 17) {//最优路线推荐 - V2XMessageEntity v2XMessageEntity = - TestOnLineCarUtils.getV2XOptimalRoute(); - - Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION); - intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity); - LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent); - } else if (sceneType == 18) {// 自车求助 - V2XMessageEntity v2XMessageEntity = - TestOnLineCarUtils.getV2XScenarioCarForHelpEventData(); - Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION); - intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity); - LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent); - MogoStatusManager.getInstance().setSeekHelping(V2XConst.MODULE_NAME, true); - } else if (sceneType == 20) {// 小地图绘制线 - List coordinates = TestOnLineCarUtils.getTestCoordinates(); - CallerSmpManager.drawablePolyline(coordinates); - } else if (sceneType == 21) {// 小地图清除绘制线 - CallerSmpManager.clearPolyline(); - } - } - - - /** - * 存储本地数据 - * - * @param v2XRoadEventEntity 要存储的场景 - */ - public void saveLocalStory(int scenarioType, MarkerExploreWay v2XRoadEventEntity) { - try { - V2XSQLiteUtils.saveLocalStory(scenarioType, v2XRoadEventEntity, v2XRoadEventEntity.hashCode()); - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/receiver/TestPanelBroadcastReceiver.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/receiver/TestPanelBroadcastReceiver.kt new file mode 100644 index 0000000000..27ffef0b67 --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/receiver/TestPanelBroadcastReceiver.kt @@ -0,0 +1,224 @@ +package com.mogo.eagle.core.function.v2x.events.receiver + +import android.content.BroadcastReceiver +import android.content.Context +import android.content.Intent +import android.util.Log +import androidx.localbroadcastmanager.content.LocalBroadcastManager +import com.mogo.commons.module.status.MogoStatusManager +import com.mogo.eagle.core.data.enums.EventTypeEnumNew +import com.mogo.eagle.core.data.map.entity.MarkerExploreWay +import com.mogo.eagle.core.data.map.entity.V2XMessageEntity +import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity +import com.mogo.eagle.core.function.call.chat.CallerChatManager.call +import com.mogo.eagle.core.function.call.map.CallerSmpManager.clearPolyline +import com.mogo.eagle.core.function.call.map.CallerSmpManager.drawablePolyline +import com.mogo.eagle.core.function.v2x.events.consts.V2XConst +import com.mogo.eagle.core.function.v2x.events.scenario.impl.V2XScenarioManager +import com.mogo.eagle.core.function.v2x.events.utils.* +import com.mogo.eagle.core.utilcode.util.Utils +import mogo.telematics.pad.MessagePad + +/** + * V2X 测试面板广播接收,目的是可以通过广播调用起来面板 + * + * @author donghongyu + */ +class TestPanelBroadcastReceiver : BroadcastReceiver() { + private var mContext: Context? = null + override fun onReceive(context: Context, intent: Intent) { + try { + mContext = context + val sceneType = + intent.getIntExtra(V2XConst.BROADCAST_TEST_PANEL_CONTROL_TYPE_EXTRA_KEY, 0) + + // 分发场景 + dispatchSceneTest(sceneType) + } catch (e: Exception) { + e.printStackTrace() + } + } + + /** + * 分发处理场景 + * + * @param sceneType 场景类型 + */ + private fun dispatchSceneTest(sceneType: Int) { + when (sceneType) { + 0 -> {//打开用户信息 + call(Utils.getApp(), "X20202111230C01") + } + 1 -> { // 触发道路事件 + val v2XMessageEntity = TestOnLineCarUtils.getV2XScenarioRoadEventData() + val intent = Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION) + intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity) + LocalBroadcastManager.getInstance(mContext!!).sendBroadcast(intent) + + // 存储本地,出行动态作展示 + saveLocalStory( + V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING, + v2XMessageEntity.content.noveltyInfo + ) + } + 2 -> { // 触发AI道路施工事件 + val v2XMessageEntity = TestOnLineCarUtils.getV2XScenarioAIRoadEventData() + val intent = Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION) + intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity) + LocalBroadcastManager.getInstance(mContext!!).sendBroadcast(intent) + + // 存储本地,出行动态作展示 + saveLocalStory( + V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING, + v2XMessageEntity.content.noveltyInfo + ) + } + 9 -> { //触发他人发起道路求助事件 + val v2XMessageEntity = TestOnLineCarUtils.getV2XScenarioSeekHelpData() + val intent = Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION) + intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity) + LocalBroadcastManager.getInstance(mContext!!).sendBroadcast(intent) + } + 10 -> { //触发事件UGC + val v2XMessageEntity = TestOnLineCarUtils.getV2XScenarioRoadEventUGCData() + val intent = Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION) + intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity) + LocalBroadcastManager.getInstance(mContext!!).sendBroadcast(intent) + } + 11 -> { //触发违章停车事件 + val v2XMessageEntity = TestOnLineCarUtils.getV2XIllegalParkData() + val intent = Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION) + intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity) + LocalBroadcastManager.getInstance(mContext!!).sendBroadcast(intent) + } + 12 -> { //车路云场景预警-右侧 + val messageEntity = + TestOnLineCarUtils.getV2XScenarioPushFrontWarningEventData("right") + val intent = Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION) + intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, messageEntity) + LocalBroadcastManager.getInstance(mContext!!).sendBroadcast(intent) + } + 13 -> { //车路云场景预警-左侧 + val messageEntity = + TestOnLineCarUtils.getV2XScenarioPushFrontWarningEventData("left") + val intent = Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION) + intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, messageEntity) + LocalBroadcastManager.getInstance(mContext!!).sendBroadcast(intent) + } + 14 -> { //行人预警,行人路线预测 车路云预警-前方行人 + val messageEntity = + TestOnLineCarUtils.getV2XScenarioPushFrontWarningEventData("pedestrians") + val intent = Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION) + intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, messageEntity) + LocalBroadcastManager.getInstance(mContext!!).sendBroadcast(intent) + } /*else if (sceneType == 16) {//触发基于目的地预测的线路推荐 + V2XRefreshModel model = BridgeApi.INSTANCE.refreshModel(); + model. + V2XServiceManager.getV2XRefreshModel().queryRoadData("F803EB2046PZD00149"); + } */ + 17 -> { //最优路线推荐 + val v2XMessageEntity = TestOnLineCarUtils.getV2XOptimalRoute() + val intent = Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION) + intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity) + LocalBroadcastManager.getInstance(mContext!!).sendBroadcast(intent) + } + 18 -> { // 自车求助 + val v2XMessageEntity = TestOnLineCarUtils.getV2XScenarioCarForHelpEventData() + val intent = Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION) + intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity) + LocalBroadcastManager.getInstance(mContext!!).sendBroadcast(intent) + MogoStatusManager.getInstance().setSeekHelping(V2XConst.MODULE_NAME, true) + } + 20 -> { // 小地图绘制线 + val coordinates = TestOnLineCarUtils.getTestCoordinates() + drawablePolyline(coordinates) + } + 21 -> { // 小地图清除绘制线 + clearPolyline() + } + 22 -> { //mock工控发来的预警事件 + mockAngle() + } + 23 -> { //mock工控发来的预警事件 + mockRoad() + } + } + } + + + private fun mockAngle() { + Log.d("emArrow", "触发三角牌") + val trackedObj = MessagePad.TrackedObject.newBuilder().setLatitude(26.819352799999997) + .setLongitude(112.575119).setType(13).setSatelliteTime(1671094475.0523846) + .setSystemTime(1671528008.4332187).setUuid(89295).setHeading(90.0) + .addPolygon(MessagePad.Location.newBuilder().setLatitude(26.819359203460486).setLongitude(112.57513221567056).build()) + .addPolygon(MessagePad.Location.newBuilder().setLatitude(26.819276703460478).setLongitude(112.57517171567059).build()) + .addPolygon(MessagePad.Location.newBuilder().setLatitude(26.819183903460488).setLongitude(112.57521561567059).build()) + .addPolygon(MessagePad.Location.newBuilder().setLatitude(26.81912310346047).setLongitude(112.57524471567059).build()) + .addPolygon(MessagePad.Location.newBuilder().setLatitude(26.81911710346047).setLongitude(112.57524771567061).build()) + .addPolygon(MessagePad.Location.newBuilder().setLatitude(26.819090803460476).setLongitude(112.5752602156706).build()) + .addPolygon(MessagePad.Location.newBuilder().setLatitude(26.81907760346048).setLongitude(112.5752320156706).build()) + .addPolygon(MessagePad.Location.newBuilder().setLatitude(26.819152103460482).setLongitude(112.57519621567059).build()) + .addPolygon(MessagePad.Location.newBuilder().setLatitude(26.819269603460477).setLongitude(112.5751405156706).build()) + .addPolygon(MessagePad.Location.newBuilder().setLatitude(26.819345603460498).setLongitude(112.57510421567056).build()) + .build() + TrackUtils.trackV2xRoadProduceEvent(1) + val v2XMessageEntity = V2XMessageEntity() + v2XMessageEntity.type = V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING + v2XMessageEntity.content = + trackedObj.toRoadMarker(EventTypeEnumNew.FOURS_ACCIDENT_04.poiType).toV2XRoadEventEntity() + v2XMessageEntity.isShowState = true + V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity) + } + + private fun mockRoad() { + Log.d("emArrow", "触发道路事件") + val trackedObj = MessagePad.TrackedObject.newBuilder().setLatitude(26.819352799999997) + .setLongitude(112.575119).setType(502).setSatelliteTime(1671094475.0523846) + .setSystemTime(1671528008.4332187).setUuid(89295).setHeading(90.0) + .addPolygon(MessagePad.Location.newBuilder().setLatitude(26.819444703460505).setLongitude(112.57508961567058).build()) + .addPolygon(MessagePad.Location.newBuilder().setLatitude(26.819444703460505).setLongitude(112.57509051567057).build()) + .addPolygon(MessagePad.Location.newBuilder().setLatitude(26.81944450346051).setLongitude(112.57509111567056).build()) + .addPolygon(MessagePad.Location.newBuilder().setLatitude(26.8194439034605).setLongitude(112.57509181567058).build()) + .addPolygon(MessagePad.Location.newBuilder().setLatitude(26.819443503460505).setLongitude(112.57509201567058).build()) + .addPolygon(MessagePad.Location.newBuilder().setLatitude(26.819443203460512).setLongitude(112.57509211567056).build()) + .addPolygon(MessagePad.Location.newBuilder().setLatitude(26.819442303460505).setLongitude(112.57509201567058).build()) + .addPolygon(MessagePad.Location.newBuilder().setLatitude(26.819441703460495).setLongitude(112.57509161567056).build()) + .addPolygon(MessagePad.Location.newBuilder().setLatitude(26.819441203460503).setLongitude(112.57509081567055).build()) + .addPolygon(MessagePad.Location.newBuilder().setLatitude(26.819433303460496).setLongitude(112.57505681567058).build()) + .addPolygon(MessagePad.Location.newBuilder().setLatitude(26.819433403460494).setLongitude(112.57505581567055).build()) + .addPolygon(MessagePad.Location.newBuilder().setLatitude(26.81943390346051).setLongitude(112.57505501567057).build()) + .addPolygon(MessagePad.Location.newBuilder().setLatitude(26.819434503460496).setLongitude(112.57505461567055).build()) + .addPolygon(MessagePad.Location.newBuilder().setLatitude(26.819435403460503).setLongitude(112.57505451567057).build()) + .addPolygon(MessagePad.Location.newBuilder().setLatitude(26.81943590346049).setLongitude(112.57505471567056).build()) + .addPolygon(MessagePad.Location.newBuilder().setLatitude(26.819436603460503).setLongitude(112.57505531567055).build()) + .addPolygon(MessagePad.Location.newBuilder().setLatitude(26.819436903460495).setLongitude(112.57505601567057).build()) + .addPolygon(MessagePad.Location.newBuilder().setLatitude(26.819444703460505).setLongitude(112.57508961567058).build()) + .build() + TrackUtils.trackV2xRoadProduceEvent(1) + val v2XMessageEntity = V2XMessageEntity() + v2XMessageEntity.type = V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING + v2XMessageEntity.content = + trackedObj.toRoadMarker(EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.poiType).toV2XRoadEventEntity() + v2XMessageEntity.isShowState = true + V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity) + } + + /** + * 存储本地数据 + * + * @param v2XRoadEventEntity 要存储的场景 + */ + private fun saveLocalStory(scenarioType: Int, v2XRoadEventEntity: MarkerExploreWay) { + try { + V2XSQLiteUtils.saveLocalStory( + scenarioType, + v2XRoadEventEntity, + v2XRoadEventEntity.hashCode() + ) + } catch (e: Exception) { + e.printStackTrace() + } + } + +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/impl/AbsV2XScenario.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/impl/AbsV2XScenario.java index cd72feafbd..88baed92e0 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/impl/AbsV2XScenario.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/impl/AbsV2XScenario.java @@ -7,6 +7,8 @@ import com.mogo.eagle.core.data.map.entity.V2XMessageEntity; import com.mogo.eagle.core.function.v2x.events.scenario.IV2XScenario; import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker; +import java.util.concurrent.atomic.AtomicReference; + /** * author : donghongyu * e-mail : 1358506549@qq.com @@ -17,7 +19,7 @@ import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker; public abstract class AbsV2XScenario implements IV2XScenario { protected String TAG = "AbsV2XScenario"; private IV2XMarker mV2XMarker; - private V2XMessageEntity mV2XMessageEntity; + private final AtomicReference mV2XMessageEntity = new AtomicReference<>(); protected AbsV2XScenario() { } @@ -26,14 +28,14 @@ public abstract class AbsV2XScenario implements IV2XScenario { @Override public void close() { - clearPOI(); +// clearPOI(); } /** * 释放资源 */ public void release() { - mV2XMessageEntity = null; + mV2XMessageEntity.set(null); mV2XMarker = null; } @@ -46,19 +48,19 @@ public abstract class AbsV2XScenario implements IV2XScenario { } public void setV2XMessageEntity(@Nullable V2XMessageEntity mV2XMessageEntity) { - this.mV2XMessageEntity = mV2XMessageEntity; + this.mV2XMessageEntity.set(mV2XMessageEntity); } public V2XMessageEntity getV2XMessageEntity() { - return mV2XMessageEntity; + return mV2XMessageEntity.get(); } @Override public boolean isSameScenario(@Nullable V2XMessageEntity v2XMessageEntity) { - if (mV2XMessageEntity == null) { + V2XMessageEntity old = mV2XMessageEntity.get(); + if (old == null) { return false; } - return mV2XMessageEntity.equals(v2XMessageEntity); + return old.equals(v2XMessageEntity); } - } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/impl/V2XScenarioManager.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/impl/V2XScenarioManager.java index a5addc16c7..a8f916dc9f 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/impl/V2XScenarioManager.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/impl/V2XScenarioManager.java @@ -21,6 +21,8 @@ import com.mogo.map.MogoMapUIController; import com.mogo.map.uicontroller.IMogoMapUIController; import com.mogo.map.uicontroller.VisualAngleMode; +import java.util.concurrent.atomic.AtomicReference; + /** * author : donghongyu * e-mail : 1358506549@qq.com diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/airoad/AiRoadMarker.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/airoad/AiRoadMarker.kt index 5adc3dda75..dfbf16bf89 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/airoad/AiRoadMarker.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/airoad/AiRoadMarker.kt @@ -1,97 +1,65 @@ package com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad import android.animation.* -import android.content.* import android.graphics.* import android.os.* import android.view.animation.* import androidx.core.util.Pair -import androidx.lifecycle.* -import androidx.lifecycle.Lifecycle.Event -import androidx.lifecycle.Lifecycle.Event.ON_CREATE -import androidx.lifecycle.Lifecycle.Event.ON_DESTROY +import com.mogo.cloud.commons.utils.CoordinateUtils import com.mogo.commons.utils.DrivingDirectionUtils import com.mogo.eagle.core.data.map.* -import com.mogo.eagle.core.data.map.MapRoadInfo.StopLine import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity -import com.mogo.eagle.core.function.api.map.listener.* -import com.mogo.eagle.core.function.api.v2x.* import com.mogo.eagle.core.function.call.map.* -import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager.OnRoadListener -import com.mogo.eagle.core.function.call.v2x.* -import com.mogo.eagle.core.function.v2x.events.consts.V2XConst.V2X_EVENT_ALARM_POI +import com.mogo.eagle.core.function.v2x.events.marker.MarkerManager +import com.mogo.eagle.core.function.v2x.events.marker.MarkerWrapper 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 io.netty.util.internal.* import java.lang.Runnable import java.util.* -import java.util.concurrent.* +import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.atomic.* import kotlin.collections.ArrayList /** * Ai云道路施工事件,道路颜色标记类 */ -object AiRoadMarker { +class AiRoadMarker { - private const val TAG = "AiRoadMarker" + companion object { + @JvmField + val aiMakers = ConcurrentHashMap() + } - private val queue by lazy { LinkedBlockingQueue() } - - private val pool by lazy { Executors.newFixedThreadPool(2) } + private val TAG = "AiRoadMarker" private val marker by lazy { AtomicReference() } - private val carLocation by lazy { AtomicReference>() } - private val overlayManager by lazy { MogoOverlayManager.getInstance() } - private val line by lazy { AtomicReference() } - private val START_COLOR = Color.parseColor("#002ABAD9") private val END_COLOR = Color.parseColor("#66FF7A30") + private val roadMarker by lazy { V2XAiRoadEventMarker() } + + private val line = AtomicReference() + private val handler by lazy { Handler(Looper.getMainLooper()) } private val checkExpiredTask = Runnable { val poi = this.marker.get() - val car = this.carLocation.get() + val car = CallerMapLocationListenerManager.getCurrentGpsLocation() if (poi != null && car != null) { - val distance = DrivingDirectionUtils.distance(car.first, car.second, poi.poi_lon, poi.poi_lat) * 10000 + val distance = CoordinateUtils.calculateLineDistance(car.longitude, car.latitude, poi.poi_lon, poi.poi_lat) if (distance < 500) { unMarker(poi) } } } - private val onClearAllMarker = object : OnClearAllMarker { - - override fun onClearAllMarkers() { - Logger.d(TAG, "--- onClearAllMarkers ----") - val marker = this@AiRoadMarker.marker.get() - if (marker != null) { - Logger.d(TAG, "--- onClearAllMarkers ----2") - unMarker(marker) - } - } - - override fun onClearAllMarkers(tag: String) { - Logger.d(TAG, "--- onClearAllMarkers ----: tag: $tag") - val marker = this@AiRoadMarker.marker.get() - if (marker != null && tag == V2X_EVENT_ALARM_POI) { - Logger.d(TAG, "--- onClearAllMarkers ----: tag: -- 1: $tag") - unMarker(marker) - } - } - } - - private val markers = ConcurrentSet() - private val options by lazy { MogoPolylineOptions().apply { zIndex(40000f) @@ -101,213 +69,82 @@ object AiRoadMarker { } } - fun init(ctx: Context) { - ctx.lifeCycleOwner.lifecycle.addObserver(object : LifecycleEventObserver { - override fun onStateChanged(source: LifecycleOwner, event: Event) { - if (event == ON_CREATE) { - onCreate() - } - if (event == ON_DESTROY) { - onDestroy() - } - } - }) - - pool.execute { - var interrupted = false - Logger.d(TAG, "--- consumer --- 0 ---") - while (!interrupted) { - try { - Logger.d(TAG, "--- consumer --- 1 ---") - val top = queue.take() ?: continue - Logger.d(TAG, "--- consumer --- 2 ---") - val location = carLocation.get() - if (location == null) { - if (queue.isEmpty()) { - synchronized(markers) { - markers.clear() - } - } - continue - } - val isTrigger = isTriggerEvent(top.poi_lon, top.poi_lat, location.first, location.second, location.third) - Logger.d(TAG, "--- consumer --- 3 ---: isTrigger => $isTrigger") - if (isTrigger) { - marker.set(top) - marker(top, true) - } else { - synchronized(markers) { - markers.remove(top) - } - } - interrupted = Thread.currentThread().isInterrupted - } catch (e: InterruptedException) { - e.printStackTrace() - break - } - } + fun marker(marker: Marker, drawMarker: Boolean, drawRoadLine: Boolean = false) { + val location = CallerMapLocationListenerManager.getCurrentGpsLocation() ?: return + this.marker.set(marker) + val wrapper = MarkerWrapper(marker.id, marker.poi_lon, marker.poi_lat, 1, null, null) + if (drawMarker) { + marker.entity?.apply { roadMarker.drawMarkers(this, wrapper) } } - } - - private fun isTriggerEvent(x1: Double, y1: Double, x2: Double, y2: Double, a2: Double): Boolean { - val angle = DrivingDirectionUtils.getDegreeOfCar2Poi2(x2, y2, x1, y1, a2) - if (angle <= 60 && DrivingDirectionUtils.distance(x1, y1, x2, y2) <= 300) { - return true - } - return false - } - - private val onRoadListener = object : OnRoadListener { - private var roadId = "" - private var hasCrossRoad = false - - override fun onRoadIdInfo(roadId: String) { - Logger.d(TAG, "--- onRoadInfo --- roadId: $roadId") - val oldRoadId = this.roadId - if (oldRoadId != roadId) { - if (hasCrossRoad) { - hasCrossRoad = false - } - } - this.roadId = roadId - } - override fun onStopLineInfo(info: StopLine) { - Logger.d(TAG, "--- onStopLineInfo --- info: $info") - if (!hasCrossRoad) { - hasCrossRoad = true - } - } - } - - private val onLocationListener = object : IMoGoMapLocationListener { - - override fun onLocationChanged(location: MogoLocation?, from: Int, isGps: Boolean) { - if (location == null || !isGps) { + if (drawRoadLine) { + //施工中心点前方的自车行驶方向上300米距离 + val l1 = MogoMap.getInstance().mogoMap.getCenterLineRangeInfo(marker.poi_lon, marker.poi_lat, location.bearing, 300f) + //施工中心点后方的自车行驶方向上300米距离 + Logger.d(TAG, "--- marker --- 3 --- l1: $l1") + val l2 = MogoMap.getInstance().mogoMap.getCenterLineRangeInfo(marker.poi_lon, marker.poi_lat, location.bearing, -300f) + if (l1.points.isEmpty() || l2.points.isEmpty()) { + Logger.d(TAG, "--- marker --- 3 --- return ----") return } - try { - val loc = arrayOf(location.longitude, location.latitude) - carLocation.set(Triple(loc[0], loc[1], location.bearing.toDouble())) - } catch (t: Throwable) { - Logger.e(TAG, "error: ${t.message}") + Logger.d(TAG, "--- marker --- 4 --- l2: $l2") + val points = LinkedList() + if (l2 != null && l2.points.isNotEmpty()) { + points.addAll(l2.points.reversed().map { + MogoLatLng(it.second, it.first) + }) } - } - } - - private fun onCreate() { - CallerMapRoadListenerManager.registerRoadListener(TAG, onRoadListener) - CallMarkersClearManager.addAllMarkersClearListener(TAG, onClearAllMarker) - CallerMapLocationListenerManager.addListener(TAG, onLocationListener, true) - } - - private fun onDestroy() { - CallerMapRoadListenerManager.unRegisterRoadListener(TAG) - CallMarkersClearManager.removeAllMarkersClearListener(TAG) - CallerMapLocationListenerManager.removeListener(TAG, true) - pool.shutdownNow() - removeLine() - } - - fun enqueue(marker: Marker) { - Logger.d(TAG, "--- enqueue --- 1 ---") - if (markers.contains(marker)) { - Logger.d(TAG, "--- enqueue --- cache hit ---") - return - } - Logger.d(TAG, "--- enqueue --- 2 ---") - synchronized(markers) { - markers += marker - } - pool.execute { - Logger.d(TAG, "--- enqueue --- 3 ---${Thread.currentThread().name}::${Thread.currentThread().id}") - queue.put(marker) - } - } - - fun marker(marker: Marker, drawMarker: Boolean) { - handler.removeCallbacks(checkExpiredTask) - val location = carLocation.get() ?: return - if (markers.contains(marker)) { - Logger.d(TAG, "--- enqueue --- cache hit ---") - return - } - synchronized(markers) { - markers += marker - } - this.marker.set(marker) - //施工中心点前方的自车行驶方向上300米距离 - val l1 = MogoMap.getInstance().mogoMap.getCenterLineRangeInfo(marker.poi_lon, marker.poi_lat, location.third.toFloat(), 300f) - //施工中心点后方的自车行驶方向上300米距离 - Logger.d(TAG, "--- marker --- 3 --- l1: $l1") - val l2 = MogoMap.getInstance().mogoMap.getCenterLineRangeInfo(marker.poi_lon, marker.poi_lat, location.third.toFloat(), -300f) - if (l1.points.isEmpty() || l2.points.isEmpty()) { - Logger.d(TAG, "--- marker --- 3 --- return ----") - synchronized(markers) { - markers.remove(marker) - } - return - } - Logger.d(TAG, "--- marker --- 4 --- l2: $l2") - val points = LinkedList() - if (l2 != null && l2.points.isNotEmpty()) { - points.addAll(l2.points.reversed().map { - MogoLatLng(it.second, it.first) - }) - } - val centerX= marker.poi_lon - val centerY = marker.poi_lat - Logger.d(TAG, "--- marker --- 5 --- marker: $marker") - val farthestPoint = marker.polygon?.let { - var find: Pair = Pair(centerX, centerY) - var min = Long.MAX_VALUE - for (p in it) { - val angle = DrivingDirectionUtils.getDegreeOfCar2Poi2(centerX, centerY, p.first, p.second, location.third) - if (angle < min) { - min = angle - find = p + val centerX= marker.poi_lon + val centerY = marker.poi_lat + Logger.d(TAG, "--- marker --- 5 --- marker: $marker") + val farthestPoint = marker.polygon?.let { + var find: Pair = Pair(centerX, centerY) + var min = Long.MAX_VALUE + for (p in it) { + val angle = DrivingDirectionUtils.getDegreeOfCar2Poi2(centerX, centerY, p.first, p.second, location.bearing.toDouble()) + if (angle < min) { + min = angle + find = p + } } - } - MogoLatLng(find.second, find.first) - } ?: MogoLatLng(centerY, centerX) - marker.farthestPoint = Pair(farthestPoint.lon, farthestPoint.lat) - Logger.d(TAG, "--- marker --- 6 --- marker: $marker") - if (l1 != null && l1.points.isNotEmpty()) { - for (l in l1.points) { - if (DrivingDirectionUtils.getDegreeOfCar2Poi2(farthestPoint.lon, farthestPoint.lat, l.first, l.second, location.third + 180) < 90L) { - points.add(l.let { MogoLatLng(it.second, it.first) }) + MogoLatLng(find.second, find.first) + } ?: MogoLatLng(centerY, centerX) + marker.farthestPoint = Pair(farthestPoint.lon, farthestPoint.lat) + Logger.d(TAG, "--- marker --- 6 --- marker: $marker") + if (l1 != null && l1.points.isNotEmpty()) { + for (l in l1.points) { + if (DrivingDirectionUtils.getDegreeOfCar2Poi2(farthestPoint.lon, farthestPoint.lat, l.first, l.second, (location.bearing + 180).toDouble()) < 90L) { + points.add(l.let { MogoLatLng(it.second, it.first) }) + } } } - } - if (points.size <= 1) { - synchronized(markers) { - markers.remove(marker) + if (points.size <= 1) { + return } - return - } - removeLine() - if (drawMarker) { - marker.entity?.apply { V2XAiRoadEventMarker.drawMarkers(this) } - } - val evaluator = ArgbEvaluator() - val interceptor = DecelerateInterpolator(1.5f) - val total = points.size - val colors = ArrayList() - (0..total).forEach { i -> - colors += evaluator.evaluate(interceptor.getInterpolation(i * 1f / total), START_COLOR, END_COLOR) as Int - } - var line = line.get() - options.points(points) - options.colorValues(colors) - Logger.d(TAG, "--- marker --- 7 --- points: ${points.size}") - if (line == null || line.isDestroyed) { - val l = overlayManager.addPolyline(options) - this.line.set(l) - line = l - } else { - line.setOption(options) - } - if (!line.isVisible) { - line.isVisible = true + val evaluator = ArgbEvaluator() + val interceptor = DecelerateInterpolator(1.5f) + val total = points.size + val colors = ArrayList() + (0..total).forEach { i -> + colors += evaluator.evaluate(interceptor.getInterpolation(i * 1f / total), START_COLOR, END_COLOR) as Int + } + var line = line.get() + options.points(points) + options.colorValues(colors) + Logger.d(TAG, "--- marker --- 7 --- points: ${points.size}") + if (line == null || line.isDestroyed) { + val l = overlayManager.addPolyline(options) + this.line.set(l) + line = l + } else { + line.setOption(options) + } + if (!line.isVisible) { + line.isVisible = true + } + if (line != null) { + wrapper.addLine(line) + } + MarkerManager.addMarker(wrapper) } } @@ -322,22 +159,21 @@ object AiRoadMarker { } } - fun unMarker(marker: Marker) { + private fun unMarker(marker: Marker) { Logger.d(TAG, "--- unMarker ---") - markers -= marker this.marker.set(null) removeLine() - V2XAiRoadEventMarker.removeMarkers(null) + roadMarker.removeMarkers() handler.removeCallbacks(checkExpiredTask) } - fun receive(marker: Marker) { + fun receive() { Logger.d(TAG, "receive --- 1 ---") val poi = this.marker.get() - val car = this.carLocation.get() + val car = CallerMapLocationListenerManager.getCurrentGpsLocation() if (poi != null && car != null) { - val distance = DrivingDirectionUtils.distance(car.first, car.second, marker.poi_lon, marker.poi_lat) * 10000 - Logger.d(TAG, "receive --- 2 ---:car:[${car.first}, ${car.second}] -> poi:[${marker.poi_lon}, ${marker.poi_lat}] --> distance:$distance") + val distance = CoordinateUtils.calculateLineDistance(car.longitude, car.latitude, poi.poi_lon, poi.poi_lat) + Logger.d(TAG, "receive --- 2 ---:car:[${car.longitude}, ${car.latitude}] -> poi:[${poi.poi_lon}, ${poi.poi_lat}] --> distance:$distance") if (distance < 500) { checkExpired() } else { @@ -356,10 +192,12 @@ object AiRoadMarker { } data class Marker( + val id: String, + val poiType: String, val poi_lat: Double, val poi_lon: Double, val poi_angle: Double, - val polygon: List>?, + val polygon: List>? = null, var farthestPoint: Pair? = null, var entity: V2XRoadEventEntity? = null ) { @@ -368,15 +206,12 @@ object AiRoadMarker { if (this === other) return true if (javaClass != other?.javaClass) return false other as Marker - if (poi_lat != other.poi_lat) return false - if (poi_lon != other.poi_lon) return false + if (id != other.id) return false return true } override fun hashCode(): Int { - var result = poi_lat.hashCode() - result = 31 * result + poi_lon.hashCode() - return result + return id.hashCode() } } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XAiRoadEventMarker.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XAiRoadEventMarker.kt index 971eec6f0b..563aada462 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XAiRoadEventMarker.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XAiRoadEventMarker.kt @@ -1,123 +1,88 @@ package com.mogo.eagle.core.function.v2x.events.scenario.scene.road import android.graphics.* -import android.util.* -import com.mogo.cloud.commons.utils.* -import com.mogo.commons.utils.DrivingDirectionUtils +import com.mogo.eagle.core.data.enums.EventTypeEnumNew import com.mogo.eagle.core.data.map.* import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity 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.eagle.core.function.v2x.events.marker.MarkerWrapper import com.mogo.map.* -import com.mogo.map.R.raw import com.mogo.map.marker.* import com.mogo.map.overlay.* -import java.util.* import java.util.concurrent.atomic.* import kotlin.Pair import kotlin.collections.ArrayList -object V2XAiRoadEventMarker { +class V2XAiRoadEventMarker { private val current = AtomicReference?>>() private val v2xLocation = AtomicReference() - private val carLocation = AtomicReference() - - private val timer = Timer() - - private val timerTask by lazy { AtomicReference() } - - private val distance = AtomicInteger(0) - private val overlayManager by lazy { MogoOverlayManager.getInstance() } - fun drawMarkers(entity: V2XRoadEventEntity): Pair?>? { - removeMarkers(current.get()) - timerTask.get()?.cancel() - val extra = entity.noveltyInfo.extras.get("polygon"); - if (extra is List<*>) { - val l = extra - if (l.size > 0) { + fun drawMarkers(entity: V2XRoadEventEntity, wrapper: MarkerWrapper) { + val extra = entity.noveltyInfo.extras["polygon"] + v2xMarker()?.drawableAlarmPOI(context(), entity, null)?.also { + wrapper.addMarker(it) + } + if (extra is List<*> && entity.poiType != EventTypeEnumNew.TYPE_SOCKET_ROAD_JINGZHI.poiType) { + if (extra.size > 0) { val polygons: MutableList> = 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 + for (i in extra.indices) { + val o = extra[i]!! as? androidx.core.util.Pair<*, *> ?: continue + val first = o.first + val second = o.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])) + polygons.add(androidx.core.util.Pair.create(second, first)) } if (polygons.size > 0) { - val markers = ArrayList(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() - } + val l2 = entity.noveltyInfo?.location ?: return + v2xLocation.set(MogoLocation().also { + it.longitude = l2.lon; it.latitude = l2.lat; it.bearing = l2.angle.toFloat() + }) + + val options = MogoPolylineOptions() + val colors = ArrayList() + colors.add(Color.argb(204, 237, 172, 21)) + colors.add(Color.argb(0, 255, 255, 255)) + options.colorValues(colors) + val points = ArrayList() + + for (p in polygons) { + points.add(MogoLatLng(p.first, p.second)) } - 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() }) - - val options = MogoPolylineOptions() - val colors = ArrayList() - colors.add(Color.argb(204, 237, 172, 21)) - colors.add(Color.argb(0, 255, 255, 255)) - options.colorValues(colors) - val points = ArrayList() - - for (p in polygons) { - points.add(MogoLatLng(p.second, p.first)) - } - if (points.size > 2) { - points.add(points[0]) - } - options.points(points); - options.useGradient(true) - options.useFacade(true) - options.setGps(false) - options.width(5f) - options.zIndex(75000f) - options.maxIndex(800000f) - val line = overlayManager.addPolyline(options) - current.set(Pair(line, markers)) - if (line != null) { - line.isVisible = true - } + if (points.size > 2) { + points.add(points[0]) + } + options.points(points) + options.useGradient(true) + options.useFacade(true) + options.setGps(true) + options.width(5f) + options.zIndex(75000f) + options.maxIndex(800000f) + val line = overlayManager.addPolyline(options) + current.set(Pair(line, wrapper.markers)) + if (line != null) { + line.isVisible = true + wrapper.addLine(line) } } } } - return current.get() } - fun removeMarkers(pair: Pair?>?) { - if (pair != null) { - realRemove(pair) - } else { - val prev = current.get() - if (prev != null) { - realRemove(prev) - val v2xMarker = v2xMarker() - v2xMarker?.also { - it.forceClearAlarmPOI() - } - } + fun removeMarkers() { + val prev = current.get() + if (prev != null) { + realRemove(prev) } } @@ -133,40 +98,4 @@ object V2XAiRoadEventMarker { } } } - - 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 - } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventMarker.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventMarker.java index 7b0637ba7e..4de55a0c84 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventMarker.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventMarker.java @@ -1,16 +1,20 @@ package com.mogo.eagle.core.function.v2x.events.scenario.scene.road; +import android.util.Log; + import androidx.core.util.Pair; +import com.mogo.eagle.core.data.enums.EventTypeEnumNew; import com.mogo.eagle.core.data.map.entity.MarkerExploreWay; import com.mogo.eagle.core.data.map.entity.MarkerLocation; import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; 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.marker.MarkerWrapper; +import com.mogo.eagle.core.function.v2x.events.marker.MarkerManager; 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.eagle.core.data.enums.EventTypeEnum; +import com.mogo.map.marker.IMogoMarker; import java.util.ArrayList; import java.util.List; @@ -22,30 +26,31 @@ import java.util.Objects; public class V2XRoadEventMarker implements IV2XMarker { - private static AiRoadMarker.Marker mMarker; - @Override public void drawPOI(V2XRoadEventEntity entity) { try { // 清除道路事件 IMoGoV2XMarkerManager marker = BridgeApi.INSTANCE.v2xMarker(); if (marker != null) { - marker.clearAlarmPOI(); if (entity != null) { - if (!Objects.equals(entity.getPoiType(), EventTypeEnum.AI_ROAD_WORK.getPoiType())) { - AiRoadMarker.Marker prev = mMarker; - if (prev != null) { - AiRoadMarker.INSTANCE.unMarker(prev); - mMarker = null; + Log.d("RWJ", "V2XRoadEventMarker:" + entity.getPoiType()); + if (!Objects.equals(entity.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType()) + && !Objects.equals(entity.getPoiType(), EventTypeEnumNew.FOURS_ACCIDENT_04.getPoiType()) + && !Objects.equals(entity.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_JINGZHI.getPoiType()) + && !Objects.equals(entity.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGU.getPoiType())) { + IMogoMarker iMarker = marker.drawableAlarmPOI(BridgeApi.INSTANCE.context(), entity, null); + if (iMarker != null) { + Log.d("RWJ", "V2XRoadEventMarker:" + entity.getPoiType() + "--- add Marker"); + ArrayList markers = new ArrayList<>(); + markers.add(iMarker); + String id = entity.getLocation().getLon() + "_" + entity.getLocation().getLat(); + MarkerManager.INSTANCE.addMarker(new MarkerWrapper(id, entity.getLocation().getLon(), entity.getLocation().getLat(), 0, markers, null)); + } else { + Log.d("RWJ", "V2XRoadEventMarker:" + entity.getPoiType() + "--- return empty marker"); } - marker.drawableAlarmPOI(BridgeApi.INSTANCE.context(), entity, null); } else { - AiRoadMarker.Marker prev = mMarker; - if (prev != null) { - AiRoadMarker.INSTANCE.unMarker(prev); - mMarker = null; - } MarkerExploreWay noveltyInfo = entity.getNoveltyInfo(); + Log.d("RWJ", "V2XRoadEventMarker -> noveltyInfo:" + noveltyInfo); if (noveltyInfo != null && noveltyInfo.extras != null) { List> polygons = new ArrayList<>(); Pair gpsLocation = null; @@ -77,14 +82,13 @@ public class V2XRoadEventMarker implements IV2XMarker { if (noveltyInfo.extras.containsKey("gps_location")) { gpsLocation = (Pair) ((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); + AiRoadMarker.Marker m = new AiRoadMarker.Marker(noveltyInfo.getInfoId(), noveltyInfo.getPoiType(), gpsLocation.second, gpsLocation.first, location.getAngle(), polygons, null, entity); + AiRoadMarker aiMarker = new AiRoadMarker(); + aiMarker.marker(m, true, isDrawRoadLine(m.getPoiType())); + AiRoadMarker.aiMakers.put(noveltyInfo.getInfoId(), aiMarker); } - } } } @@ -94,19 +98,23 @@ public class V2XRoadEventMarker implements IV2XMarker { } } + private boolean isDrawRoadLine(String poiType) { + return EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType().equals(poiType); + } + @Override public void clearPOI() { // 移除线 - IMoGoV2XPolylineManager polyLineManager = BridgeApi.INSTANCE.v2xPolyline(); - if (polyLineManager != null) { - polyLineManager.clearLine(); - } - IMoGoV2XMarkerManager v2xMarker = BridgeApi.INSTANCE.v2xMarker(); - if (v2xMarker != null) { - // 移除事件POI - v2xMarker.clearAlarmPOI(); - // 绘制上次的数据 - v2xMarker.drawableLastAllPOI(); - } +// IMoGoV2XPolylineManager polyLineManager = BridgeApi.INSTANCE.v2xPolyline(); +// if (polyLineManager != null) { +// polyLineManager.clearLine(); +// } +// IMoGoV2XMarkerManager v2xMarker = BridgeApi.INSTANCE.v2xMarker(); +// if (v2xMarker != null) { +// // 移除事件POI +// v2xMarker.clearAlarmPOI(); +// // 绘制上次的数据 +// v2xMarker.drawableLastAllPOI(); +// } } } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventScenario.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventScenario.java index cf448413a1..4eb32d0dc2 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventScenario.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventScenario.java @@ -1,12 +1,15 @@ package com.mogo.eagle.core.function.v2x.events.scenario.scene.road; -import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X; import android.util.Log; +import com.mogo.cloud.commons.utils.CoordinateUtils; import com.mogo.commons.analytics.AnalyticsUtils; +import com.mogo.eagle.core.data.enums.EventTypeEnumNew; import com.mogo.eagle.core.data.enums.WarningDirectionEnum; +import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.data.map.entity.MarkerExploreWay; +import com.mogo.eagle.core.data.map.entity.MarkerLocation; import com.mogo.eagle.core.data.map.entity.V2XMessageEntity; import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; import com.mogo.eagle.core.data.msgbox.MsgBoxBean; @@ -14,6 +17,7 @@ import com.mogo.eagle.core.data.msgbox.MsgBoxType; import com.mogo.eagle.core.data.msgbox.V2XMsg; import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener; 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.CallerVisualAngleManager; import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager; import com.mogo.eagle.core.function.v2x.events.consts.V2XConst; @@ -21,11 +25,9 @@ import com.mogo.eagle.core.function.v2x.events.manager.V2XStatusManager; import com.mogo.eagle.core.function.v2x.events.scenario.impl.AbsV2XScenario; import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker; import com.mogo.eagle.core.network.utils.GsonUtil; -import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; -import com.mogo.eagle.core.data.enums.EventTypeEnum; - import java.util.HashMap; import java.util.Map; +import java.util.Objects; import java.util.concurrent.TimeUnit; /** @@ -45,7 +47,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario imp @Override public void init(V2XMessageEntity v2XMessageEntity) { try { - CallerLogger.INSTANCE.d(M_V2X + TAG, "v2XMessageEntity:" + GsonUtil.jsonFromObject(v2XMessageEntity)); + Log.d(TAG, "v2XMessageEntity:" + GsonUtil.jsonFromObject(v2XMessageEntity)); V2XRoadEventEntity v2XRoadEventEntity = v2XMessageEntity.getContent(); if (v2XRoadEventEntity != null) { if (v2XMessageEntity.isShowState()) { @@ -71,16 +73,23 @@ public class V2XRoadEventScenario extends AbsV2XScenario imp try { if (getV2XMessageEntity() != null && getV2XMessageEntity().getContent() != null) { //只展示不播报 不广播 - boolean onlyShow = getV2XMessageEntity().isOnlyShow(); + V2XMessageEntity entity = getV2XMessageEntity(); + boolean onlyShow = entity.isOnlyShow(); if (!onlyShow) { // 设置TTS - getV2XMessageEntity().getContent().getTts(false); + V2XRoadEventEntity content = entity.getContent(); + if (content != null && !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType()) + && !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_JINGZHI.getPoiType()) + && !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGU.getPoiType()) + && !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_CONGESTION.getPoiType())) { + content.getTts(false); + } } showWindow(); - String poiType = getV2XMessageEntity().getContent().getPoiType(); - String lat = String.valueOf(getV2XMessageEntity().getContent().getLocation().getLat()); - String lon = String.valueOf(getV2XMessageEntity().getContent().getLocation().getLon()); - String infoId = getV2XMessageEntity().getContent().getNoveltyInfo().getInfoId(); + String poiType = entity.getContent().getPoiType(); + String lat = String.valueOf(entity.getContent().getLocation().getLat()); + String lon = String.valueOf(entity.getContent().getLocation().getLon()); + String infoId = entity.getContent().getNoveltyInfo().getInfoId(); String style = "1"; Map properties = new HashMap<>(); properties.put("dbid", infoId); @@ -100,20 +109,39 @@ public class V2XRoadEventScenario extends AbsV2XScenario imp V2XRoadEventEntity content = entity != null ? entity.getContent() : null; if (content != null) { // //显示警告红边 - if (content.getAlarmContent() == null || content.getAlarmContent().isEmpty() - || content.getTts() == null || content.getTts().isEmpty()) { + String alarmText = content.getAlarmContent(); + String ttsText = content.getTts(); + if (alarmText == null || alarmText.isEmpty() + || ttsText == null || ttsText.isEmpty()) { Log.d("MsgBox-V2XRoadScenario", "alertContent或ttsContent为空!"); } + String poiType = content.getPoiType(); + if (EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType().equals(poiType) || + EventTypeEnumNew. TYPE_SOCKET_ROAD_JINGZHI.getPoiType().equals(poiType) || + EventTypeEnumNew.TYPE_SOCKET_ROAD_CONGESTION.getPoiType().equals(poiType) || + EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGU.getPoiType().equals(poiType)) { + MogoLocation carLocation = CallerMapLocationListenerManager.INSTANCE.getCurrentLocation(); + MarkerExploreWay noveltyInfo = content.getNoveltyInfo(); + if (carLocation != null && noveltyInfo != null) { + MarkerLocation eventLocation = noveltyInfo.getLocation(); + if (eventLocation != null) { + double distance = content.getDistance(); + alarmText = String.format(alarmText, Math.round(distance) + ""); + ttsText = String.format(ttsText, Math.round(distance) + ""); + } + } + } + CallerMsgBoxManager.INSTANCE.saveMsgBox( new MsgBoxBean( MsgBoxType.V2X, - new V2XMsg(content.getPoiType(), - content.getAlarmContent(), - content.getTts()) + new V2XMsg(poiType, + alarmText, + ttsText) ) ); - CallerHmiManager.INSTANCE.warningV2X(content.getPoiType(), content.getAlarmContent(), - content.getTts(), TAG, this, !entity.isOnlyShow(), + CallerHmiManager.INSTANCE.warningV2X(poiType, alarmText, + ttsText, TAG, this, !entity.isOnlyShow(), TimeUnit.SECONDS.toMillis(5)); } } @@ -130,10 +158,10 @@ public class V2XRoadEventScenario extends AbsV2XScenario imp @Override public void clearPOI() { - IV2XMarker marker = getV2XMarker(); - if (marker != null) { - marker.clearPOI(); - } +// IV2XMarker marker = getV2XMarker(); +// if (marker != null) { +// marker.clearPOI(); +// } } @Override @@ -144,13 +172,14 @@ public class V2XRoadEventScenario extends AbsV2XScenario imp CallerHmiManager.INSTANCE.showWarning(WarningDirectionEnum.ALERT_WARNING_TOP, TimeUnit.HOURS.toMillis(1)); V2XMessageEntity entity = getV2XMessageEntity(); if (entity != null) { - if (entity.isNeedAddLine()) { - drawPOI(); - } + V2XRoadEventEntity content = entity.getContent(); if (content != null) { + if (entity.isNeedAddLine() && !EventTypeEnumNew.TYPE_SOCKET_ROAD_CONGESTION.getPoiType().equals(content.getPoiType()) ) { + drawPOI(); + } MarkerExploreWay noveltyInfo = content.getNoveltyInfo(); - if (noveltyInfo != null && EventTypeEnum.FOURS_FOG.getPoiType().equals(content.getNoveltyInfo().getPoiType())) { + if (noveltyInfo != null && EventTypeEnumNew.FOURS_FOG.getPoiType().equals(content.getNoveltyInfo().getPoiType())) { CallerHmiManager.INSTANCE.displayEffects(); } } @@ -163,7 +192,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario imp if (content == null) { return true; } - return !EventTypeEnum.GHOST_PROBE.getPoiType().equals(content.getPoiType()); + return !EventTypeEnumNew.GHOST_PROBE.getPoiType().equals(content.getPoiType()); } @Override @@ -172,7 +201,6 @@ public class V2XRoadEventScenario extends AbsV2XScenario imp if (isNeedChangeAngle()) { CallerVisualAngleManager.INSTANCE.changeVisualAngle(new CallerVisualAngleManager.Scene.Default(3, TimeUnit.SECONDS)); } - clearPOI(); release(); } } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/route/V2XOptimalRouteVREventMarker.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/route/V2XOptimalRouteVREventMarker.java index 3ca5bb86e1..03bdcf95c1 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/route/V2XOptimalRouteVREventMarker.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/route/V2XOptimalRouteVREventMarker.java @@ -39,13 +39,13 @@ public class V2XOptimalRouteVREventMarker implements IV2XMarker? = null): MarkerExploreWay = + MarkerExploreWay().also { + it.items = this.items?.map { itx -> itx.toMarkerExploreWayItem() } + it.userInfo = this.userInfo?.toMarkerUserInfo() + it.distance = this.distance + it.cityName = this.cityName + it.setGenerateTime(this.generateTime) + it.infoId = this.infoId + it.setFileType(this.fileType) + it.setDirection(this.direction) + it.location = this.location?.toMarkerLocation() + it.sn = this.sn + it.canLive = this.canLive != "0" + it.poiType = this.poiType + it.type = this.type + it.infoCheckNode = this.infoCheckNode + it.isFabulous = this.isFabulous + it.uploadType = this.uploadType + it.isCanLive = this.canLive != "0" + it.extras = extras + } + +fun Road.RW_PB.toRoadMarker(): V2XMarkerCardResult = + V2XMarkerCardResult().also { l1 -> + this.roadwork?.polygonList?.takeIf { it.isNotEmpty() }?.also { old -> + l1.extras = HashMap>>().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 + ) + ) + } + } + val centerX = this.roadwork?.center?.point?.lon ?: 0.0 + val centerY = this.roadwork?.center?.point?.lat ?: 0.0 + val id = "${centerX}_${centerY}" + l1.exploreWay = ArrayList().also { l2 -> + l2.add(V2XMarkerExploreWay().also { l3 -> + l3.poiType = this.roadwork?.poiType?.toString() + l3.generateTime = this.roadwork?.detectTime ?: 0L + l3.location = V2XMarkerLocation().also { l4 -> + val p = MogoMap.getInstance().mogoMap.switchLonLat( + this.roadwork?.center?.point?.lon ?: 0.0, + this.roadwork?.center?.point?.lat ?: 0.0 + ) + l4.lon = p.lon + l4.lat = p.lat + l4.angle = this.roadwork?.center?.road?.bearing?.toDouble() ?: 0.0 + } + l3.infoId = id + }) + } + AiRoadMarker.aiMakers[id]?.receive() + } + +fun V2XRoadXData.toRoadMarker(): V2XMarkerCardResult = + V2XMarkerCardResult().also { l1 -> + this.polygon?.takeIf { it.isNotEmpty() }?.also { old -> + l1.extras = HashMap>>().also { extra -> + extra["polygon"] = old.map { d -> + Pair(d.lon, d.lat) + } + extra["gps_location"] = listOf(Pair(this.center?.lon ?: 0.0, this.center?.lat ?: 0.0)) + } + } + + l1.exploreWay = ArrayList().also { l2 -> + l2.add(V2XMarkerExploreWay().also { l3 -> + l3.poiType = this.poiType + l3.generateTime = this.detectTime ?: 0L + l3.location = V2XMarkerLocation().also { l4 -> + val p = MogoMap.getInstance().mogoMap.switchLonLat( + this.center?.lon ?: 0.0, + this.center?.lat ?: 0.0 + ) + l4.lon = p.lon + l4.lat = p.lat + l4.angle = this.centerRoad?.bearing ?: 0.0 + } + l3.infoId = this.index + }) + } + + AiRoadMarker.aiMakers[this.index]?.receive() + } + +fun MessagePad.TrackedObject.toRoadMarker(poiType: String): V2XMarkerCardResult = + V2XMarkerCardResult().also { l1 -> + this.polygonList?.takeIf { it.isNotEmpty() }?.also { old -> + l1.extras = HashMap>>().also { extra -> + extra["polygon"] = old.map { d -> Pair(d.longitude, d.latitude) } + extra["gps_location"] = listOf(Pair(this.longitude, this.latitude)) + } + } + val id = "${this.longitude}_${this.latitude}" + l1.exploreWay = ArrayList().also { l2 -> + l2.add(V2XMarkerExploreWay().also { l3 -> + l3.poiType = poiType + l3.generateTime = 0L + l3.location = V2XMarkerLocation().also { l4 -> + val p = + MogoMap.getInstance().mogoMap.switchLonLat(this.longitude, this.latitude) + l4.lon = p.lon + l4.lat = p.lat + l4.angle = this.heading + } + l3.infoId = id + }) + } + AiRoadMarker.aiMakers[id]?.receive() + } + +fun V2XMarkerCardResult.toV2XRoadEventEntity(): V2XRoadEventEntity = + V2XRoadEventEntity().also { l1 -> + val exploreWayList: List? = this.exploreWay + if (!exploreWayList.isNullOrEmpty() && exploreWayList.isNotEmpty()) { + for (markerExploreWay in exploreWayList) { + if (isRoadEvent(markerExploreWay.poiType)) { + val markerLocation = markerExploreWay.location + l1.location = markerLocation.toMarkerLocation() + l1.poiType = markerExploreWay.poiType + l1.noveltyInfo = markerExploreWay.toMarkExploreWay(this.extras) + l1.expireTime = 20000 + } + } + } + } -fun V2XMarkerExploreWay.toMarkExploreWay(extras: Map? = null): MarkerExploreWay = MarkerExploreWay().also { - it.items = this.items?.map { itx -> itx.toMarkerExploreWayItem() } - it.userInfo = this.userInfo?.toMarkerUserInfo() - it.distance = this.distance - it.cityName = this.cityName - it.setGenerateTime(this.generateTime) - it.infoId = this.infoId - it.setFileType(this.fileType) - it.setDirection(this.direction) - it.location = this.location?.toMarkerLocation() - it.sn = this.sn - it.canLive = this.canLive != "0" - it.poiType = this.poiType - it.type = this.type - it.infoCheckNode = this.infoCheckNode - it.isFabulous = this.isFabulous - it.uploadType = this.uploadType - it.isCanLive = this.canLive != "0" - it.extras = extras -} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/V2XManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/V2XManager.kt new file mode 100755 index 0000000000..8622fd1f21 --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/V2XManager.kt @@ -0,0 +1,257 @@ +package com.mogo.eagle.core.function.v2x.internal + +import android.os.Handler +import android.os.Looper +import com.mogo.cloud.passport.MoGoAiCloudClientConfig +import com.mogo.cloud.socket.SocketManager +import com.mogo.eagle.core.function.v2x.internal.callback.IV2XCallback +import com.mogo.eagle.core.function.v2x.internal.config.V2XConfig +import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerResponse +import com.mogo.eagle.core.function.v2x.internal.event.V2XEvent +import com.mogo.eagle.core.function.v2x.internal.http.V2XRefreshModel +import com.mogo.eagle.core.function.v2x.internal.http.callback.IV2XRefreshCallback +import com.mogo.eagle.core.function.v2x.internal.logger.Logger +import com.mogo.eagle.core.function.v2x.internal.socket.* +import com.mogo.eagle.core.function.v2x.internal.socket.V2XMessageListener_401012 +import com.mogo.eagle.core.function.v2x.internal.socket.V2XMessageListener_401018 +import com.mogo.eagle.core.function.v2x.internal.socket.V2XMessageListener_402000 +import com.mogo.eagle.core.function.v2x.internal.socket.V2XMessageListener_404000 +import com.mogo.eagle.core.function.v2x.internal.utils.DistanceUtils +import java.util.concurrent.CopyOnWriteArrayList +import java.util.concurrent.atomic.AtomicBoolean +import java.util.concurrent.atomic.AtomicReference + +object V2XManager { + + internal const val TAG = "V2XManager" + + private val config: AtomicReference by lazy { + AtomicReference(null) + } + + private val cbs by lazy { + CopyOnWriteArrayList() + } + + private val lastLongitude by lazy { + AtomicReference(0.0) + } + + private val lastLatitude by lazy { + AtomicReference(0.0) + } + + private val realLongitude by lazy { AtomicReference(0.0) } + + private val realLatitude by lazy { AtomicReference(0.0) } + + + + /** + * 标识此参数是否启动 + */ + private val started by lazy { + AtomicBoolean(false) + } + + private val refreshCallback = object : IV2XRefreshCallback { + + override fun onSuccess(result: V2XMarkerResponse) { + cbs.forEach { + it.onAck(V2XEvent.Marker(result)) + } + } + + override fun onFail(msg: String?) { + cbs.forEach { + it.onFail(msg ?: "") + } + } + } + + + private val refreshTask = object : Runnable { + override fun run() { + V2XRefreshModel.querySnapshot(longitude = realLongitude.get(), latitude = realLatitude.get(), refreshCallback) + handler.postDelayed(this, config.get().durationForTriggerRefresh) + } + } + + private val handler by lazy { + Handler(Looper.getMainLooper()) + } + + /** + * 根据所配置的参数,初始化V2X相关功能(注: 此方法不要重复调用,非首次调用会抛异常) + * @param config 相关配置类 + */ + fun init(config: V2XConfig) { + Logger.d(TAG, "-- init --") + if (V2XManager.config.get() != null) { + throw IllegalStateException("V2XManager has been initialized, don't initialize repeatably.") + } + V2XManager.config.set(config) + Logger.loggable = config.loggable + } + + /** + * - 开启V2X功能, 此方法调用前,要确保满足以下两个条件: + * 1.初始化方法[init]已调用 + * 2.确保[MoGoAiCloudClientConfig.sn]和[MoGoAiCloudClientConfig.token]两个值存在,如果其中有一个值不存在,不会启动相关功能 + * - 此函数的功能如下: + * 1.建立长链接[SocketManager.init] + * 2.位置上报服务[LocationManager.init]和[LocationManager.start] + * 3.短链[V2XRefreshModel.querySnapshot]定时轮循,轮循时长取[V2XConfig.durationForTriggerRefresh] + */ + fun start() { + Logger.d(TAG, "-- start --") + val config = config.get() ?: throw IllegalStateException("V2XManager has not been initialized, please invoke V2XManager#init(config: X2XConfig) firstly.") + if (started.get()) { + Logger.d(TAG, "-- has been started --") + return + } + if (config.aiCloudConfig.sn?.isBlank() == true) { + Logger.e(TAG, "sn is null or blank, please ensure sn exists and then invoke V2XManager#start() again.") + cbs.forEach { + it.onFail("sn is null or blank, please ensure sn exists and then invoke V2XManager#start() again.") + } + return + } + if (config.aiCloudConfig.token?.isBlank() == true) { + Logger.e(TAG, "token is null or blank, please ensure token exists and then invoke V2Manager#start() again.") + cbs.forEach { + it.onFail("token is null or blank, please ensure token exists and then invoke V2Manager#start() again.") + } + return + } + if (started.compareAndSet(false, true)) { + Logger.d(TAG, "-- start real --") + SocketManager.getInstance().init(config.context,0.0,0.0) + SocketManager.getInstance().registerOnMessageListener(401012, V2XMessageListener_401012(cbs)) + SocketManager.getInstance().registerOnMessageListener(401018, V2XMessageListener_401018(cbs)) + SocketManager.getInstance().registerOnMessageListener(402000, V2XMessageListener_402000(cbs)) + SocketManager.getInstance().registerOnMessageListener(404000, V2XMessageListener_404000(cbs)) + //SocketManager.getInstance().registerOnMessageListener(503000, V2XMessageListener_503000(cbs)) + SocketManager.getInstance().registerOnMessageListener(70001, V2XMessageListener_70001(cbs)) + handler.post(refreshTask) + } + } + + /** + * @param sn 更新后的sn + * @param token 更新后的token + */ + fun updateSnAndToken(sn: String?, token: String?) { + val config = config.get() ?: throw IllegalStateException("V2XManager has not been initialized, please invoke V2XManager#init(config: X2XConfig) firstly.") + sn ?: return + token ?: return + if (started.get()) { + return + } + config.aiCloudConfig.sn = sn + config.aiCloudConfig.token = token + start() + } + + /** + * 停止V2X功能 + * 1. 断开长链接[SocketManager.release] + * 2. 停止位置上报[LocationManager.stop] + * 3. 取消短链定时轮循任务 + */ + fun stop() { + Logger.d(TAG, "-- stop --") + if (config.get() == null) { + throw IllegalStateException("V2XManager has not been initialized, please invoke V2XManager#init(config: X2XConfig) firstly.") + } + if (started.compareAndSet(true, false)) { + Logger.d(TAG, "-- stop real --") + SocketManager.getInstance().release() + handler.removeCallbacks(refreshTask) + lastLatitude.set(0.0) + lastLongitude.set(0.0) + } + } + + /** + * 添加相关信息接口回调 + * @param cb 要添加的回调接口 + */ + fun addCallback(cb: IV2XCallback) { + Logger.d(TAG, "-- addCallback --") + if (cbs.contains(cb)) { + return + } + cbs += cb + } + + /** + * 移除相关信息接口回调 + * @param cb 要移除的回调接口 + */ + fun removeCallback(cb: IV2XCallback) { + Logger.d(TAG, "-- removeCallback --") + if (!cbs.contains(cb)) { + return + } + cbs.remove(cb) + } + + /** + * 当自车位置变量时调用 + * @param longitude 自车所在精度 + * @param latitude 自车所在纬度 + */ + fun onLocationChanged(longitude: Double, latitude: Double) { + if (config.get() == null) { + throw IllegalStateException("V2XManager has not been initialized, please invoke V2XManager#init(config: X2XConfig) firstly.") + } + if (!started.get()) { + return + } + Logger.d(TAG, "--- onLocationChanged --[longitude: $longitude, latitude: $latitude]") + realLongitude.set(longitude) + realLatitude.set(latitude) + val oldLon = lastLongitude.get() + val oldLat = lastLatitude.get() + var update = false + try { + if (oldLon == 0.0 || oldLat == 0.0) { + Logger.d(TAG, "--- onLocationChanged -- first --[longitude: $longitude, latitude: $latitude]") + handler.removeCallbacks(refreshTask) + handler.post(refreshTask) + update = true + return + } + if (DistanceUtils.calculateLineDistance(oldLon, oldLat, longitude, latitude) >= config.get().distanceForTriggerRefresh) { + Logger.d(TAG, "--- onLocationChanged -- trigger --[longitude: $longitude, latitude: $latitude]") + handler.removeCallbacks(refreshTask) + handler.post(refreshTask) + update = true + } + } finally { + if (update) { + lastLatitude.set(latitude) + lastLongitude.set(longitude) + } + } + } + + /** + * 是否已经初始化 + * @return true: 已初始化过 false: 未初始化 + */ + fun hasInit() = getConfig() != null + + /** + * 强制刷新道路事件 + */ + fun forceRefresh() { + if (hasInit()) { + handler.removeCallbacks(refreshTask) + handler.post(refreshTask) + } + } + + internal fun getConfig() = config.get() +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/callback/IV2XCallback.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/callback/IV2XCallback.kt new file mode 100644 index 0000000000..f755c465e4 --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/callback/IV2XCallback.kt @@ -0,0 +1,24 @@ +package com.mogo.eagle.core.function.v2x.internal.callback + +import com.mogo.eagle.core.function.v2x.internal.event.V2XEvent + +interface IV2XCallback { + + + /** + * 获取到V2X事件成功回调 + * @param event + * - 参数说明:目前此参数支持以下类型 + * - [V2XEvent.ForwardsWarning]: 路口碰撞预警、盲区预警等预警事件, 数据实体取自[V2XEvent.ForwardsWarning.data] + * - [V2XEvent.Road]: 道路事件, 数据实体取自[V2XEvent.Road.data] + * - [V2XEvent.Warning]: 预警目标物事件, 数据实体取自[V2XEvent.Warning.data] + * - [V2XEvent.Marker]: 道路标记事件, 数据实体取自[V2XEvent.Marker.data] + */ + fun onAck(event: V2XEvent) + + /** + * V2X事件获取过程中,出现的异常信息,用于问题排查 + * @param msg 异常信息 + */ + fun onFail(msg: String) +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/config/V2XConfig.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/config/V2XConfig.kt new file mode 100755 index 0000000000..1ab70b67ac --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/config/V2XConfig.kt @@ -0,0 +1,174 @@ +package com.mogo.eagle.core.function.v2x.internal.config + +import android.content.Context +import com.mogo.cloud.passport.MoGoAiCloudClientConfig +import com.mogo.eagle.core.function.v2x.internal.executor.Executors +import java.util.concurrent.Executor +import java.util.concurrent.TimeUnit +import kotlin.IllegalStateException + +/** + * V2X相关配置 + */ +class V2XConfig private constructor(builder: Builder) { + + /** + * - 应用上下文 + * - 必选项 + * - 通过[Builder.context]设置 + */ + val context : Context by lazy { + builder.context?.applicationContext ?: throw IllegalStateException("context must not be null.") + } + + /** + * - 云平台配置参数 + * - 必选项 + * - 通过[Builder.aiCloudConfig]设置 + */ + val aiCloudConfig by lazy { + builder.aiCloudConfig ?: throw IllegalStateException("aiCloudConfig must not be null.") + } + + /** + * - 网络请求使用的线程池,IO类型 + * - 可选项 + * - 通过[Builder.executor]设置 + */ + val executor: Executor by lazy { + builder.executor ?: Executors.IO + } + + /** + * - 是否开启日志 + * - 可选项 + * - 通过[Builder.loggable]设置,开发阶段可以打开,应用发布后记得关闭 + */ + val loggable: Boolean by lazy { + builder.loggable + } + + /** + * - 公共参数, 默认为空 + * - 可选项 + * - 通过[Builder.staticParams]设置 + */ + val staticParams by lazy { + builder.staticParams ?: HashMap() + } + + /** + * - 基础Url, 默认值为`http://dzt-launcherSnapshot.zhidaozhixing.com` + * - 可选项 + * - 通过[Builder.baseUrl]设置 + */ + val baseUrl by lazy { + builder.baseUrl ?: "http://dzt-launcherSnapshot.zhidaozhixing.com" + + } + + /** + * - 多长时间请求一次自车周边信息,单位为毫秒,默认值为`6_000`毫秒 + * - 可选项 + * - 通过[Builder.durationForTriggerRefresh]设置 + */ + val durationForTriggerRefresh by lazy { + val duration = builder.durationForTriggerRefresh + if (duration == null || duration <= 0) TimeUnit.SECONDS.toMillis(60) else duration + } + + /** + * - 自车行驶超过此长度,会刷新自车周边信息,单位为`米` + * - 可选项 + * - 通过[Builder.distanceForTriggerRefresh]设置 + */ + val distanceForTriggerRefresh: Float by lazy { + val distance = builder.distanceForTriggerRefresh + if (distance == null || distance <= 0) 200f else distance + } + + internal fun newBuilder() = Builder(this) + + class Builder { + + internal var context: Context? = null + + internal var executor: Executor? = null + + internal var loggable: Boolean = false + + internal var staticParams: Map? = null + + internal var aiCloudConfig: MoGoAiCloudClientConfig? = null + + internal var durationForTriggerRefresh: Long? = null + + internal var baseUrl: String? = null + + internal var distanceForTriggerRefresh: Float? = null + + constructor() + + internal constructor(config: V2XConfig) { + context = config.context + executor = config.executor + loggable = config.loggable + baseUrl = config.baseUrl + staticParams = config.staticParams + aiCloudConfig = config.aiCloudConfig + durationForTriggerRefresh = config.durationForTriggerRefresh + distanceForTriggerRefresh = config.distanceForTriggerRefresh + } + + /** + * 应用上下文,此参数为必选项,不设置会抛异常 + */ + fun context(context: Context) = apply { this.context = context } + + /** + * 是否开启日志 + */ + fun loggable(loggable: Boolean) = apply { this.loggable = loggable } + + /** + * 公共参数列表 + */ + fun staticParams(params: Map) = apply { this.staticParams = params } + + /** + * 网络请求线程池,如未设置,会使用内置的线程池[Executors.IO] + */ + fun executor(executor: Executor): Builder = apply { + if (this.executor != null) { + throw IllegalArgumentException("io executor has been initialized, don't set repeatedly.") + } + this.executor = executor + } + + /** + * 刷新周边信息的时间间隔 + * @param duration 时长 + * @param unit 时间单位 + */ + fun durationForTriggerRefresh(duration: Long, unit: TimeUnit = TimeUnit.SECONDS) = apply { this.durationForTriggerRefresh = unit.toMillis(duration) } + + /** + * @param distance 超过此距离会触发刷新周边道路信息,单位为米 + */ + fun distanceForTriggerRefresh(distance: Float) = apply { this.distanceForTriggerRefresh = distance } + + /** + * 云平台配置信息,此参数为必选项,不设置会抛异常 + * @param config 云平台配置 + */ + fun aiCloudConfig(config: MoGoAiCloudClientConfig) = apply { this.aiCloudConfig = config } + + /** + * 云平台baseUrl + * @param baseUrl 云平台baseUrl + */ + fun baseUrl(baseUrl: String) = apply { this.baseUrl = baseUrl } + + fun build() : V2XConfig = V2XConfig(this) + } +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XAdvanceWarning.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XAdvanceWarning.kt new file mode 100644 index 0000000000..df71ca8175 --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XAdvanceWarning.kt @@ -0,0 +1,120 @@ +package com.mogo.eagle.core.function.v2x.internal.data + +import androidx.annotation.Keep +import java.io.Serializable + +/** + * 路口碰撞预警、盲区预警等数据实体 + */ +@Keep +class V2XAdvanceWarning: Serializable { + + companion object { + private const val serialVersionUID = -446395L + } + + /** + * 物体唯一标识 + */ + var objectId: String? = null + + /** + * 物体类型: + * 1-人 + * 2-自行车 + * 3-小轿车 + * 4-摩托车 + * 5-红绿灯 + * 6-公交车 + * 8-卡车 + * 9-路边摄像头 + */ + var objectType: Int? = -1 + + /** + * 1-add + * 2-update + * 3-delete + */ + var status: Int? = -1 + + /** + * 大类标识 + * 1-预警 + * 2-规划 + * 3-拥堵 + * 4-事故 + */ + var typeId: Int? = -1 + + /** + * 预警下发时间 + */ + var time: Long? = 0 + + /** + * 预警等级 + */ + var level: Int? = -1 + + /** + * 危险等级: + * 0-保留 + * 1-模型原始颜色 + * 2-通知--黄 + * 3-警告--红 + */ + var threatLevel: Int? = -1 + + /** + * 目标预警物所在位置 + */ + var position: V2XLocation? = null + + /** + * 目标预警物朝向 + */ + var heading: Double? = 0.0 + + /** + * 目标预警物速度 + */ + var speed: Double? = 0.0 + + /** + * 目标预警物到自车距离 + */ + var distance: Double? = 0.0 + + /** + * 道路ID + */ + var roadId: String? = null + + /** + * 车道ID + */ + var laneId: String? = null + + /** + * 车道号: + * 中心线编号为0, 中心线右侧编号为负数。 + * eg: 3车道通行Road的车道编号,0,-1,-2,-3 + */ + var laneNum: Int? = Integer.MIN_VALUE + + /** + * 线性经纬度轨迹列表(高德) + */ + var gdLocusList: List? = null + + /** + * 轨迹列表(Wgs84坐标系) + */ + var locusList: List? = null + + override fun toString(): String { + return "V2XAdvanceWarning(objectId=$objectId, objectType=$objectType, status=$status, typeId=$typeId, time=$time, level=$level, threatLevel=$threatLevel, position=$position, heading=$heading, speed=$speed, distance=$distance, roadId=$roadId, laneId=$laneId, laneNum=$laneNum, gdLocusList=$gdLocusList, locusList=$locusList)" + } +} + diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XBaseData.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XBaseData.kt new file mode 100644 index 0000000000..d7df5b04f0 --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XBaseData.kt @@ -0,0 +1,9 @@ +package com.mogo.eagle.core.function.v2x.internal.data + +open class V2XBaseData { + + @JvmField + var code = -1 + @JvmField + var msg: String? = null +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XLocation.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XLocation.kt new file mode 100644 index 0000000000..3ce50a38f0 --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XLocation.kt @@ -0,0 +1,26 @@ +package com.mogo.eagle.core.function.v2x.internal.data + +import androidx.annotation.Keep +import java.io.Serializable + +@Keep +class V2XLocation: Serializable { + + companion object { + private const val serialVersionUID = -93L + } + + /** + * 经度 + */ + var lon: Double = 0.0 + + /** + * 纬度 + */ + var lat: Double = 0.0 + + override fun toString(): String { + return "V2XLocation(lon=$lon, lat=$lat)" + } +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XMarkerCardResult.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XMarkerCardResult.kt new file mode 100644 index 0000000000..48bd6a55e4 --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XMarkerCardResult.kt @@ -0,0 +1,817 @@ +package com.mogo.eagle.core.function.v2x.internal.data + +import androidx.annotation.Keep +import java.io.Serializable + +@Keep +class V2XMarkerCardResult: V2XBaseData(), Serializable { + + companion object { + private const val serialVersionUID = -92L + } + + /** + * 要查询的数据类型 + * CARD_TYPE_USER_DATA:用户相关数据 + * CARD_TYPE_ROAD_CONDITION:路况数据 + * CARD_TYPE_LIVE:正播相关数据 + */ + var dataType: List? = null + + /** + * 车聊聊数据集合 + */ + var carChat: List? = null + + /** + * 分享的音乐数据集合 + */ + var shareMusic: List? = null + + /** + * 新鲜事分享的数据集合 + */ + var noveltyInfo: List? = null + + /** + * 在线车辆数据集合 + */ + var onlineCar: List? = null + + /** + * 探路数据集合 + */ + var exploreWay: List? = null + + /** + * 服务端下发消息时间 + */ + var messageTime: Long = 0 + + /** + * 额外信息 + */ + var extras: Map? = null + + override fun toString(): String { + return "MarkerCardResult(dataType=$dataType, carChat=$carChat, shareMusic=$shareMusic, noveltyInfo=$noveltyInfo, onlineCar=$onlineCar, exploreWay=$exploreWay, messageTime=$messageTime, extras=$extras)" + } +} + +@Keep +class V2XMarkerCarChat: Serializable { + + companion object { + private const val serialVersionUID = -92L + } + + /** + * 卡片类型 + */ + var type: String? = null + + /** + * 地址信息 + */ + var location: V2XMarkerLocation? = null + + /** + * 用户信息 + */ + var userInfo: V2XMarkerUserInfo? = null + + override fun toString(): String { + return "V2XMarkerCarChat(type=$type, location=$location, userInfo=$userInfo)" + } +} + +@Keep +class V2XMarkerShareMusic: Serializable { + + companion object { + private const val serialVersionUID = -93L + } + + /** + * 事件类型 + */ + var type: String? = null + + /** + * 音乐专辑信息 + */ + var bookInfo: String? = null + + /** + * 歌曲ID + */ + var id = 0 + + /** + * 点赞数 + */ + var likeNumber = 0 + + /** + * 位置信息 + */ + var location: V2XMarkerLocation? = null + + /** + * 已弃用 + */ + var mediaId: String? = null + + /** + * 歌曲封面-已弃用 + */ + var mediaImg: String? = null + + /** + * 歌曲名字 + */ + var mediaName: String? = null + + /** + * 歌手名字 + */ + var mediaSinger: String? = null + + /** + * 播放地址 + */ + var mediaUrl: String? = null + + /** + * 分享文案 + */ + var shareContentText: String? = null + + /** + * 分享类型 + */ + var shareType = 0 + + /** + * 用户信息 + */ + var userInfo: V2XMarkerUserInfo? = null + + override fun toString(): String { + return "V2XMarkerShareMusic(bookInfo=$bookInfo, id=$id, likeNumber=$likeNumber, location=$location, mediaId=$mediaId, mediaImg=$mediaImg, mediaName=$mediaName, mediaSinger=$mediaSinger, mediaUrl=$mediaUrl, shareContentText=$shareContentText, shareType=$shareType, type=$type, userInfo=$userInfo)" + } +} + +/** + * 新鲜事儿Marker数据 + */ +@Keep +class V2XMarkerNoveltyInfo: Serializable { + + companion object { + private const val serialVersionUID = -93L + } + + /** + * 事件类型 + */ + var type: String? = null + + /** + * 车机唯一标识 + */ + var sn: String? = null + + /** + * 标记坐标 + */ + var location: V2XMarkerLocation? = null + + /** + * POI类型 + */ + var poiType: String? = null + + /** + * 新鲜事分享内容 + */ + var contentData: ContentData? = null + + @Keep + class ContentData: Serializable { + + companion object { + private const val serialVersionUID = -93L + } + + /** + * 信息ID + */ + var infoId: String? = null + + /** + * 分享内容 + */ + var content: String? = null + + /** + * 分享内容左上角图标 + */ + var iconUrl: String? = null + + /** + * 分享内容图片 + */ + var imgUrl: String? = null + + /** + * 点赞数 + */ + var likeNum: Long = 0 + + /** + * 标题 + */ + var title: String? = null + + /** + * 加油站油价 + */ + var gasPrices: String? = null + + /** + * 是否显示导航 + */ + var isDisplayNavigation = false + + /** + * 是否显示好友主页 + */ + var isDesplayHost = false + + /** + * 是否是新鲜的 + */ + var isFabulous = false + + /** + * 分享类型 + */ + var styleType: String? = null + + /** + * 上报类型: + * 1-用户上报 + * 2-后台上报 + * 3-三方上报 + */ + var uploadType: String? = null + + override fun toString(): String { + return "ContentData(content=$content, iconUrl=$iconUrl, imgUrl=$imgUrl, infoId=$infoId, likeNum=$likeNum, title=$title, gasPrices=$gasPrices, isDisplayNavigation=$isDisplayNavigation, isDesplayHost=$isDesplayHost, isFabulous=$isFabulous, styleType=$styleType, uploadType=$uploadType)" + } + } + + override fun toString(): String { + return "V2XMarkerNoveltyInfo(type=$type, sn=$sn, location=$location, poiType=$poiType, contentData=$contentData)" + } +} + +@Keep +class V2XMarkerOnlineCar: Serializable { + + companion object { + private const val serialVersionUID = -93L + } + + /** + * 事件类型 + */ + var type: String? = null + + /** + * 车辆位置 + */ + var location: V2XMarkerLocation? = null + + /** + * focus:false-未关注,true-关注 + */ + var focus: Boolean? = null + + /** + * 用户数据 + */ + var userInfo: V2XMarkerUserInfo? = null + + /** + * 车辆数据 + */ + var carInfo: V2XMarkerCarInfo? = null + + /** + * 车辆路线 + */ + var pois: List? = null + + /** + * 动态数据 + */ + var dynamicData: V2XMarkerDynamicData? = null + + /** + * 爱好数据集合 + */ + var hobbyData: V2XMarkerHobbyDatum? = null + + /** + * 活动范围数据集合 + */ + var activitiesScope: List? = null + + /** + * 匹配度 + */ + var compatibility = 0 + + override fun toString(): String { + return "V2XMarkerOnlineCar(type=$type, location=$location, focus=$focus, userInfo=$userInfo, carInfo=$carInfo, pois=$pois, dynamicData=$dynamicData, hobbyData=$hobbyData, activitiesScope=$activitiesScope, compatibility=$compatibility)" + } +} + +@Keep +class V2XMarkerExploreWay: Serializable { + + companion object { + private const val serialVersionUID = -93L + } + + /** + * 事件类型 + */ + var type: String? = null + + /** + * 信息ID + */ + var infoId: String? = null + + /** + * POI类型 + */ + var poiType: String? = null + + /** + * 车辆唯一标识 + */ + var sn: String? = null + + /** + * 位置信息 + */ + var location: V2XMarkerLocation? = null + + /** + * 车辆方位 + */ + var direction = 0 + + /** + * 是否可直播(1为可直播,0不可直播) + */ + var canLive: String? = "0" + + /** + * 是图片还是视频(1视频,0图片) + */ + var fileType = 0 + + /** + * 车辆详细地址 + */ + var addr: String? = null + + /** + * 事件下发的时间 + */ + var generateTime: Long = 0L + + /** + * 城市名称 + */ + var cityName: String? = null + + /** + * 距离 + */ + var distance = 0.0 + + /** + * 用户信息 + */ + var userInfo: V2XMarkerUserInfo? = null + + /** + * 视频地址和图片地址 + */ + var items: List? = null + + /** + * 上报类型: + * 1-用户上报 + * 2-后台上报 + * 3-三方上报 + */ + var uploadType: String? = null + + /** + * 是否是新鲜的 + */ + var isFabulous = false + + /** + * 需要用户判断是否拥堵 进行UGC问答 + */ + var infoCheckNode = 0 + + var coordinateType: Int? = null + + override fun toString(): String { + return "V2XMarkerExploreWay(infoId=$infoId, type=$type, poiType=$poiType, sn=$sn, location=$location, direction=$direction, canLive=$canLive, fileType=$fileType, addr=$addr, generateTime=$generateTime, cityName=$cityName, distance=$distance, userInfo=$userInfo, items=$items, uploadType=$uploadType, isFabulous=$isFabulous, infoCheckNode=$infoCheckNode, coordinateType=$coordinateType)" + } +} + +@Keep +class V2XMarkerUserInfo: Serializable { + + companion object { + private const val serialVersionUID = -93L + } + + /** + * 自车车机唯一标识 + */ + var sn: String? = null + + /** + * 用户ID + */ + var userId: Long = 0 + + /** + * 用户昵称 + */ + var userName: String? = null + + /** + * 用户头像 + */ + var userHead: String? = null + + /** + * gender": "男|女|无(也可以0|1|2根据实际库存返回即可) + */ + var gender: String? = null + + /** + * 年龄段,可以为空,与车聊聊一致 + */ + var age: Int? = null + + /** + * 末次活跃周驾驶行为平均得分 + */ + var lastActiveweekAvgscore: String? = null + + /** + * 车辆安全标签 + */ + var safeLabel: String? = null + + /** + * 1-老司机 + * 2-安全驾驶 + * 3-危险驾驶 + */ + var safeLabelType = 0 + + override fun toString(): String { + return "V2XMarkerUserInfo(sn=$sn, userId=$userId, userName=$userName, userHead=$userHead, gender=$gender, age=$age, lastActiveweekAvgscore=$lastActiveweekAvgscore, safeLabel=$safeLabel, safeLabelType=$safeLabelType)" + } +} + +@Keep +class V2XMarkerCarInfo: Serializable { + + companion object { + private const val serialVersionUID = -93L + } + + /** + * 车品牌Logo资源链接 + */ + var carBrandLogoUrl: String? = null + + /** + * 车型名称 + */ + var carTypeName: String? = null + + /** + * 车类型: + * 0-普通车辆 + * 1-警车 + * 2-救护车 + * 3-失控车 + * 4-道路救援车 + */ + var vehicleType: Int = 0 + + /** + * 车辆直播相关信息 + */ + var carLiveInfo: CarLiveInfo? = null + + @Keep + class CarLiveInfo: Serializable { + + companion object { + private const val serialVersionUID = -93L + } + + /** + * rtmp视频直播地址rtmp:// + */ + var videoUrl: String? = null + + /** + * 直播频道【直播心跳接口参数】C_1 + */ + var videoChannel: String? = null + + /** + * 直播源sn + */ + var videoSn: String? = null + + override fun toString(): String { + return "CarLiveInfo(videoUrl=$videoUrl, videoChannel=$videoChannel, videoSn=$videoSn)" + } + } + + override fun toString(): String { + return "V2XMarkerCarInfo(carBrandLogoUrl=$carBrandLogoUrl, carTypeName=$carTypeName, vehicleType=$vehicleType, carLiveInfo=$carLiveInfo)" + } +} + +@Keep +class V2XMarkerCarPois: Serializable { + + companion object { + private const val serialVersionUID = -93L + } + + /** + * 位置信息,返回的值不为空并且长度为2的倍数 + */ + var coordinates: List<*>? = null + + /** + * 车的朝向角度 + */ + var angle = 0.0 + + /** + * 地区code + */ + var adcode: String? = null + + override fun toString(): String { + return "V2XMarkerCarPois(coordinates=$coordinates, angle=$angle, adcode=$adcode)" + } +} + +@Keep +class V2XMarkerDynamicData: Serializable { + + companion object { + private const val serialVersionUID = -93L + } + + /** + * QQ音乐,懒人听书,乐听头条 2 为书籍听书,3 为新闻,1 为qq音乐 + */ + var type = 0 + + /** + * qq音乐id,书的bookId + */ + var mediaId: String? = null + + /** + * qq音乐url 懒人听书为“” + */ + var mediaUrl: String? = null + + /** + * 歌曲名 ,当前播放书名,新闻标题内容 + */ + var mediaName: String? = null + + /** + * 演唱歌手,当前章节,新闻来源 + */ + var mediaSinger: String? = null + + /** + * 歌曲封面,书籍封面,新闻预览图 + */ + var mediaImg: String? = null + + /** + * 音乐类别,类似经典 ,流行只有qq特有 + */ + var mediaType: String? = null + + /** + * 音频总时长 + */ + var maxTime = 0 + + /** + * 懒人听书json串 + */ + var bookInfo: String? = null + + /** + * 当前播放时长,可以不加,播放进度单独独立出来 + */ + var curTime = 0 + + /** + * 是否是本地音频,只有qq音乐 + */ + var isLocalMedia = false + + /** + * 播放模式,顺序,单曲循环,随机 + */ + var mediaPlayMode = 0 + + /** + * 1 播放 2 缓冲 0 暂停/停止 -1 播放错误 + */ + var playState = 0 + + override fun toString(): String { + return "V2XMarkerDynamicData(type=$type, mediaId=$mediaId, mediaUrl=$mediaUrl, mediaName=$mediaName, mediaSinger=$mediaSinger, mediaImg=$mediaImg, mediaType=$mediaType, maxTime=$maxTime, bookInfo=$bookInfo, curTime=$curTime, isLocalMedia=$isLocalMedia, mediaPlayMode=$mediaPlayMode, playState=$playState)" + } +} + +@Keep +class V2XMarkerHobbyDatum: Serializable { + + companion object { + private const val serialVersionUID = -93L + } + + /** + * 最喜欢的两位歌手 + */ + var singerTop2: List? = null + + /** + * 最喜欢的两种音乐类型 + */ + var songTypeTop2: List? = null + + /** + * 最喜欢的资讯类型 + */ + var newsType: List? = null + + /** + * 最喜欢听的两本书 + */ + var listenBookTop2: List? = null + + /** + * 是否喜爱社交 + */ + var ifSociety: List? = null + + @Keep + class MarkerOnlineTag: Serializable { + + companion object { + private const val serialVersionUID = -93L + } + + /** + * 社交内容 + */ + var content: String? = null + + /** + * 是否选中 + */ + var isCheck: Boolean = false + + override fun toString(): String { + return "MarkerOnlineTag(content=$content, isCheck=$isCheck)" + } + } + + override fun toString(): String { + return "V2XMarkerHobbyDatum(singerTop2=$singerTop2, songTypeTop2=$songTypeTop2, newsType=$newsType, listenBookTop2=$listenBookTop2, ifSociety=$ifSociety)" + } +} + +@Keep +class V2XMarkerActivitiesScope: Serializable { + + companion object { + private const val serialVersionUID = -93L + } + + /** + * 活动范围内容 + */ + var content: String? = null + + /** + * 是否选中 + */ + var isCheck: Boolean = false + + override fun toString(): String { + return "V2XMarkerActivitiesScope(content=$content, isCheck=$isCheck)" + } +} + +/** + * 道路情报,V2X预警,地图道路事件POI,违章停车POI等 + */ +@Keep +class MarkerExploreWayItem: Serializable { + + companion object { + private const val serialVersionUID = -93L + } + + /** + * 缩略图 + */ + var thumbnail: String? = null + + /** + * 正式图 + */ + var url: String? = null + + /** + * 描述字段 + */ + var content: String? = null + + /** + * 违章停车人数 + */ + var illegalCount = 0.0 + + override fun toString(): String { + return "MarkerExploreWayItem(thumbnail=$thumbnail, url=$url, content=$content, illegalCount=$illegalCount)" + } +} + +@Keep +class V2XMarkerLocation: Serializable { + + companion object { + private const val serialVersionUID = -93L + } + + /** + * 纬度 + */ + var lat: Double = 0.0 + + /** + * 纬度 + */ + var lon: Double = 0.0 + + /** + * 车头角度,可以没有 + */ + var angle: Double = 0.0 + + /** + * 具体的位置信息 + */ + var address: String? = null + + override fun toString(): String { + return "V2XMarkerLocation(lat=$lat, lon=$lon, angle=$angle, address=$address)" + } +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XMarkerResponse.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XMarkerResponse.kt new file mode 100644 index 0000000000..790bd71b0a --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XMarkerResponse.kt @@ -0,0 +1,28 @@ +package com.mogo.eagle.core.function.v2x.internal.data + +import androidx.annotation.Keep +import com.elegant.network.BaseResp +import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerCardResult +import java.io.Serializable + +@Keep +class V2XMarkerResponse: BaseResp(), Serializable { + + companion object { + private const val serialVersionUID = -93L + } + + /** + * 响应的数据集 + */ + var result: V2XMarkerCardResult? = null + + /** + * TODO 不知道啥含义,可以忽略 + */ + var sign: String? = null + + override fun toString(): String { + return "V2XMarkerResponse(result=$result, sign=$sign)" + } +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XOptimalRoute.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XOptimalRoute.kt new file mode 100644 index 0000000000..dd27d302af --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XOptimalRoute.kt @@ -0,0 +1,56 @@ +package com.mogo.eagle.core.function.v2x.internal.data + +import androidx.annotation.Keep +import com.mogo.eagle.core.function.v2x.internal.data.V2XLocation +import java.io.Serializable + +/** + * 最优路线推荐 + */ +@Keep +class V2XOptimalRoute: Serializable { + + companion object { + private const val serialVersionUID = -93L + } + + /** + * 自车SN + */ + var sn: String? = null + + /** + * 道路ID + */ + var road_id: String? = null + + /** + * 车道ID-2D路段 + */ + var current_lane_id: String? = null + + /** + * 车道号:中心线编号为0, 中心线右侧编号为负数,3车道通行Road的车道编号,0,-1,-2,-3 + */ + var current_lane_num = 0 + + /** + * 最优车道平均速度 + */ + var most_speed = 0.0 + + /** + * 车道号:中心线编号为0, 中心线右侧编号为负数,3车道通行Road的车道编号,0,-1,-2,-3 + */ + var most_lane_num = 0 + + /** + * Wgs84坐标系,线性经纬度轨迹列表 + */ + var locus_list: List? = null + + /** + * 高德坐标系Gcj,线性经纬度轨迹列表 + */ + var gd_locus_list: List? = null +} diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XRoadXEvent.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XRoadXEvent.kt new file mode 100644 index 0000000000..a692c2dfa7 --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XRoadXEvent.kt @@ -0,0 +1,59 @@ +package com.mogo.eagle.core.function.v2x.internal.data + +import androidx.annotation.Keep + + +@Keep +data class V2XRoadXData( + val poiType: String? = null, + val center: Point? = null, + val centerRoad: CenterRoad? = null, + val congestionLanes: List? = null, + val coordinateType: Int? = -1, + val id: String? = null, + val index: String? = null, + val obstacles: List? = null, + val polygon: List? = null, + val type: Int? = 0, + val detectTime: Long? = 0L, + val crossId: String? = null +) + +@Keep +data class CenterRoad( + val bearing: Double? = 0.0, + val laneNo: Int? = null, + val roadId: String? = null, + val roadName: String? = null, + val tileId: Int? = 0, + val heading: String? = null +) + +@Keep +data class Congestion( + val laneId: Int? = null, + val level: Int? = null +) + +@Keep +data class Obstacle( + val boundBox: List? = null, + val center: Point? = null, + val id: Int? = null, + val polygon: List? = null, + val score: Double? = null, + val type: Int? = null +) + + +@Keep +data class Point( + val lon: Double? = null, + val lat: Double? = null +) + +@Keep +data class PointX( + val x: Double? = null, + val y: Double? = null +) \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XWarningTarget.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XWarningTarget.kt new file mode 100644 index 0000000000..8173032600 --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XWarningTarget.kt @@ -0,0 +1,176 @@ +package com.mogo.eagle.core.function.v2x.internal.data + +import androidx.annotation.Keep +import com.mogo.eagle.core.function.v2x.internal.data.V2XLocation +import java.io.Serializable + +/** + * 预警目标物数据模型 + */ +@Keep +class V2XWarningTarget: Serializable { + + companion object { + private const val serialVersionUID = -93L + } + + /** + * 事件类型 + * 行人-1 + * 自行车-2 + * 摩托车-4 + * 骑行车辆-11 + */ + var type = 0 + + /** + * 目标物纬度 + */ + var lat = 0.0 + + /** + * 目标物经度 + */ + var lon = 0.0 + + /** + * 目标物颜色 + */ + var targetColor: String? = null + + /** + * 目标物距自车距离 + */ + var distance = 0.0 + + /** + * 预测碰撞点位置-纬度 + */ + var collisionLat = 0.0 + + /** + * 预测碰撞点位置-经度 + */ + var collisionLon = 0.0 + + /** + * 目标物行驶朝向 + */ + var angle = 0.0 + + /** + * 目标物方位 + * 方位:前 后 左 右 + */ + var direction = 0 + + /** + * 目标物速度 + */ + var speed = 0f + + /** + * 停止线经纬度 + */ + var stopLines: List? = null + + /** + * 自车到停止线距离 + */ + var stopLineDistance = 0.0 + + /** + * 道路唯一标识 + */ + var roadId: String? = null + + /** + * 车道唯一标识 + */ + var laneId: String? = null + + /** + * 识别物体唯一标识 + */ + var uuid: String? = null + + /** + * 红绿灯颜色 + */ + var color: String? = null + + /** + * 车ID 暂不使用 + */ + var carId: String? = null + + /** + * 预警文案 + */ + var warningContent: String? = null + + /** + * 车头朝向 + */ + var heading = 0.0 + + /** + * 系统时间 暂时没用 + */ + var systemTime: Long = 0 + + /** + * 定位卫星时间 暂时没用 + */ + var satelliteTime: Long = 0 + + /** + * 预警蒙层等展示时长 + */ + var showTime: Long = 0 + + /** + * 设计划线宽度与道路同宽 + */ + var roadwidth = 0f + + /** + * 自组字段, tts播报 + */ + var tts: String? = null + + /** + * 自车位置 + */ + var carLocation: V2XLocation? = null + + override fun toString(): String { + return "V2XWarningEntity{" + + "type=" + type + + ", lat=" + lat + + ", lon=" + lon + + ", targetColor='" + targetColor + '\'' + + ", distance=" + distance + + ", collisionLat=" + collisionLat + + ", collisionLon=" + collisionLon + + ", angle=" + angle + + ", direction=" + direction + + ", speed=" + speed + + ", stopLines=" + stopLines + + ", stopLineDistance=" + stopLineDistance + + ", roadId='" + roadId + '\'' + + ", laneId='" + laneId + '\'' + + ", uuid='" + uuid + '\'' + + ", color='" + color + '\'' + + ", carId='" + carId + '\'' + + ", warningContent='" + warningContent + '\'' + + ", heading=" + heading + + ", systemTime=" + systemTime + + ", satelliteTime=" + satelliteTime + + ", showTime=" + showTime + + ", roadwidth=" + roadwidth + + ", tts='" + tts + '\'' + + ", carLocation=" + carLocation + + '}' + } +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/event/V2XEvent.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/event/V2XEvent.kt new file mode 100644 index 0000000000..40bf0b65c4 --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/event/V2XEvent.kt @@ -0,0 +1,75 @@ +package com.mogo.eagle.core.function.v2x.internal.event + +import com.mogo.eagle.core.function.v2x.internal.data.* +import roadwork.Road.RW_PB + +sealed class V2XEvent { + + /** + * 长链-路口碰撞预警、盲区预警等通用Bean + */ + class ForwardsWarning(val type: Int = 404000, val data: V2XAdvanceWarning): V2XEvent() { + override fun toString(): String { + return "ForwardsWarning(type=$type, data=$data)" + } + } + + /** + * 长链-最优推荐线种 + */ + class OptimalRoute(val type: Int = 402000, val data: V2XOptimalRoute): V2XEvent() { + override fun toString(): String { + return "OptimalRoute(type=$type, data=$data)" + } + } + + /** + * 长链-预警目标物 + */ + class Warning(val type: Int = 401018, val data: V2XWarningTarget): V2XEvent() { + override fun toString(): String { + return "Warning(type=$type, data=$data)" + } + } + + /** + * 长链-道路事件 + */ + class Road(val type: Int = 401012, val data: V2XMarkerCardResult): V2XEvent() { + override fun toString(): String { + return "Road(type=$type, data=$data)" + } + } + + /** + * 长链-道路事件云识别 + */ + class RoadAI(val type: Int = 503000, val data: RW_PB): V2XEvent() { + + override fun toString(): String { + return "RoadAI(type=$type, data=$data)" + } + } + + + /** + * 短链-道路标记事件 + */ + class Marker(val data: V2XMarkerResponse): V2XEvent() { + + override fun toString(): String { + return "Marker(data=$data)" + } + } + + + /** + * 长链-道路事件扩展数据结构 + */ + class RoadEventX(val type: Int = 70001, val data: V2XRoadXData): V2XEvent() { + + override fun toString(): String { + return "RoadEventX(type=$type, data=$data)" + } + } +} diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/executor/Executors.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/executor/Executors.kt new file mode 100755 index 0000000000..aed7f4549c --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/executor/Executors.kt @@ -0,0 +1,35 @@ +package com.mogo.eagle.core.function.v2x.internal.executor + +import java.util.concurrent.* +import java.util.concurrent.atomic.AtomicLong +import kotlin.math.max +import kotlin.math.min + + +internal object Executors { + + private val group: ThreadGroup by lazy { + ThreadGroup("v2x-group") + } + + private val CPU_CORE_COUNT by lazy { + Runtime.getRuntime().availableProcessors() + } + + private val DEFAULT_CORE_COUNT by lazy { + (max(2, min(CPU_CORE_COUNT - 1, 6)) * 3) + 1 + } + + private const val DEFAULT_MAX_COUNT_4_IO = 128 + + val IO by lazy { + val idGenerator = AtomicLong(0) + ThreadPoolExecutor( + DEFAULT_CORE_COUNT, DEFAULT_MAX_COUNT_4_IO, 30, TimeUnit.SECONDS, LinkedBlockingDeque() + ) { r -> + Thread(group, r).apply { + name = "io-thread-${idGenerator.getAndIncrement()}" + } + } + } +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/http/V2XRefreshModel.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/http/V2XRefreshModel.kt new file mode 100644 index 0000000000..2b57db3ab8 --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/http/V2XRefreshModel.kt @@ -0,0 +1,84 @@ +package com.mogo.eagle.core.function.v2x.internal.http + +import com.elegant.network.utils.GsonUtil +import com.elegant.network.utils.SignUtil +import com.elegant.utils.CommonUtils +import com.mogo.cloud.network.RetrofitFactory +import com.mogo.eagle.core.function.v2x.internal.V2XManager +import com.mogo.eagle.core.function.v2x.internal.config.V2XConfig +import com.mogo.eagle.core.function.v2x.internal.data.V2XLocation +import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerResponse +import com.mogo.eagle.core.function.v2x.internal.http.api.V2XApiService +import com.mogo.eagle.core.function.v2x.internal.http.body.V2XRefreshEntity +import com.mogo.eagle.core.function.v2x.internal.http.callback.IV2XRefreshCallback +import com.mogo.eagle.core.function.v2x.internal.utils.DeviceUtils +import io.reactivex.android.schedulers.AndroidSchedulers +import io.reactivex.disposables.Disposable +import io.reactivex.schedulers.Schedulers + +internal class V2XRefreshModel { + + companion object { + + fun querySnapshot( + longitude: Double, + latitude: Double, + callback: IV2XRefreshCallback? + ): Disposable? { + val config = V2XManager.getConfig() + val retrofit = RetrofitFactory.getInstance(config.baseUrl) ?: return null + return retrofit + .create(V2XApiService::class.java) + .querySnapshotSync(buildParams(longitude, latitude, config)) + .subscribeOn(Schedulers.from(config.executor)) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe({ data -> + if (data == null) { + callback?.onFail("returned data is null.") + return@subscribe + } + if (data.code != 0 && data.code != 200) { + callback?.onFail("code:${data.code}, msg: ${data.msg}") + } else { + callback?.onSuccess(data) + } + }, { + callback?.onFail(it.message) + }) + } + + private fun buildParams( + longitude: Double, + latitude: Double, + config: V2XConfig + ): Map = mutableMapOf().apply { + putAll(config.staticParams.let { + val handled = mutableMapOf() + it.asIterable().forEach { itx -> + val value = itx.value + if (value != null) { + handled[itx.key] = value + } + } + handled + }) + this["netType"] = CommonUtils.getNetworkType(config.context) + this["cellId"] = DeviceUtils.getCellId(config.context) ?: "" + this["sn"] = config.aiCloudConfig.sn + this["ticket"] = config.aiCloudConfig.token + this["sig"] = SignUtil.createSign(this, "JGjZx6") + this["data"] = GsonUtil.jsonFromObject(V2XRefreshEntity().apply { + limit = 999 + location = V2XLocation().also { + it.lat = latitude + it.lon = longitude + } + radius = 1000 + dataType.add("CARD_TYPE_ROAD_CONDITION") + viewPush = true + }) + } + } + + +} diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/http/api/V2XApiService.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/http/api/V2XApiService.kt new file mode 100644 index 0000000000..a8f3266337 --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/http/api/V2XApiService.kt @@ -0,0 +1,14 @@ +package com.mogo.eagle.core.function.v2x.internal.http.api + +import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerResponse +import io.reactivex.Maybe +import retrofit2.http.FieldMap +import retrofit2.http.FormUrlEncoded +import retrofit2.http.POST + +internal interface V2XApiService { + + @FormUrlEncoded + @POST("/yycp-launcherSnapshot/launcherSnapshot/querySnapshotSync") + fun querySnapshotSync(@FieldMap parameters: Map): Maybe +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/http/body/V2XRefreshEntity.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/http/body/V2XRefreshEntity.kt new file mode 100644 index 0000000000..82d5661ab5 --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/http/body/V2XRefreshEntity.kt @@ -0,0 +1,39 @@ +package com.mogo.eagle.core.function.v2x.internal.http.body + +import androidx.annotation.Keep +import com.mogo.eagle.core.function.v2x.internal.data.V2XLocation + +/** + * 刷新地图信息接口 + */ +@Keep +internal class V2XRefreshEntity { + + @JvmField + var dataType: MutableList = mutableListOf() // 要查询的类型 + + @JvmField + var limit = 50 // 请求数量 + + @JvmField + var radius = 2000 // 地理围栏半径(米) + + @JvmField + var location // 坐标 + : V2XLocation? = null + @JvmField + var sn: String? = null + + @JvmField + var onlyFocus // 是否仅查询已关注的好友 + = false + @JvmField + var onlySameCity // 是否仅查询注册城市相同的同城用户 + = false + @JvmField + var viewPush // 是否走V2X通道 ,true-401011,false -401001 + = false + @JvmField + var onlyRealUser = false + +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/http/callback/IV2XRefreshCallback.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/http/callback/IV2XRefreshCallback.kt new file mode 100644 index 0000000000..3fb17ffef7 --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/http/callback/IV2XRefreshCallback.kt @@ -0,0 +1,11 @@ +package com.mogo.eagle.core.function.v2x.internal.http.callback + +/** + * 刷新回调 + */ +internal interface IV2XRefreshCallback { + + fun onSuccess(result: T) + + fun onFail(msg: String?) +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/logger/Logger.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/logger/Logger.kt new file mode 100644 index 0000000000..c230c13abf --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/logger/Logger.kt @@ -0,0 +1,24 @@ +package com.mogo.eagle.core.function.v2x.internal.logger + +import android.util.Log + +internal object Logger { + + var loggable: Boolean = false + + fun v(tag: String, msg: String) = if (loggable) Log.v(tag, msg) else 0 + + fun d(tag: String, msg: String) = if (loggable) Log.d(tag, msg) else 0 + + fun i(tag: String, msg: String) = if (loggable) Log.i(tag, msg) else 0 + + fun w(tag: String, msg: String) = if (loggable) Log.w(tag, msg) else 0 + + fun e(tag: String, msg: String, t: Throwable? = null) = if (loggable) { + if (t == null) { + Log.e(tag, msg) + } else { + Log.e(tag, msg, t) + } + } else 0 +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_401012.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_401012.kt new file mode 100644 index 0000000000..94fa71b532 --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_401012.kt @@ -0,0 +1,27 @@ +package com.mogo.eagle.core.function.v2x.internal.socket + +import com.mogo.cloud.socket.IMogoCloudSocketOnMessageListener +import com.mogo.eagle.core.function.v2x.internal.V2XManager +import com.mogo.eagle.core.function.v2x.internal.callback.IV2XCallback +import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerCardResult +import com.mogo.eagle.core.function.v2x.internal.event.V2XEvent +import com.mogo.eagle.core.function.v2x.internal.logger.Logger + +internal class V2XMessageListener_401012(val cbs: Iterable?): IMogoCloudSocketOnMessageListener { + + override fun target(msgType: Int): Class = V2XMarkerCardResult::class.java + + override fun onMsgReceived(msgType: Int, data: V2XMarkerCardResult?) { + if (msgType != 401012) { + return + } + if (data == null) { + Logger.i(V2XManager.TAG, "V2XMessageListener_401012:message is null!") + return + } + Logger.i(V2XManager.TAG, "V2XMessageListener_401012:$data") + cbs?.forEach { + it.onAck(V2XEvent.Road(data = data)) + } + } +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_401018.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_401018.kt new file mode 100644 index 0000000000..b9f8c8747d --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_401018.kt @@ -0,0 +1,27 @@ +package com.mogo.eagle.core.function.v2x.internal.socket + +import com.mogo.cloud.socket.IMogoCloudSocketOnMessageListener +import com.mogo.eagle.core.function.v2x.internal.V2XManager +import com.mogo.eagle.core.function.v2x.internal.callback.IV2XCallback +import com.mogo.eagle.core.function.v2x.internal.event.V2XEvent +import com.mogo.eagle.core.function.v2x.internal.data.V2XWarningTarget +import com.mogo.eagle.core.function.v2x.internal.logger.Logger + +internal class V2XMessageListener_401018(val cbs: Iterable?): IMogoCloudSocketOnMessageListener { + + override fun target(msgType: Int): Class = V2XWarningTarget::class.java + + override fun onMsgReceived(msgType: Int, data: V2XWarningTarget?) { + if (msgType != 401018) { + return + } + if (data == null) { + Logger.i(V2XManager.TAG, "V2XMessageListener_401018:message is null!") + return + } + Logger.i(V2XManager.TAG, "V2XMessageListener_401018:$data") + cbs?.forEach { + it.onAck(V2XEvent.Warning(data = data)) + } + } +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_402000.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_402000.kt new file mode 100644 index 0000000000..c968eb1e5a --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_402000.kt @@ -0,0 +1,27 @@ +package com.mogo.eagle.core.function.v2x.internal.socket + +import com.mogo.cloud.socket.IMogoCloudSocketOnMessageListener +import com.mogo.eagle.core.function.v2x.internal.V2XManager +import com.mogo.eagle.core.function.v2x.internal.callback.IV2XCallback +import com.mogo.eagle.core.function.v2x.internal.data.V2XOptimalRoute +import com.mogo.eagle.core.function.v2x.internal.event.V2XEvent +import com.mogo.eagle.core.function.v2x.internal.logger.Logger + +internal class V2XMessageListener_402000(val cbs: Iterable?): IMogoCloudSocketOnMessageListener { + + override fun target(msgType: Int): Class = V2XOptimalRoute::class.java + + override fun onMsgReceived(msgType: Int, data: V2XOptimalRoute?) { + if (msgType != 402000) { + return + } + if (data == null) { + Logger.i(V2XManager.TAG, "V2XMessageListener_402000:message is null!") + return + } + Logger.i(V2XManager.TAG, "V2XMessageListener_402000:$data") + cbs?.forEach { + it.onAck(V2XEvent.OptimalRoute(data = data)) + } + } +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_404000.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_404000.kt new file mode 100644 index 0000000000..4d9c046429 --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_404000.kt @@ -0,0 +1,27 @@ +package com.mogo.eagle.core.function.v2x.internal.socket + +import com.mogo.cloud.socket.IMogoCloudSocketOnMessageListener +import com.mogo.eagle.core.function.v2x.internal.V2XManager +import com.mogo.eagle.core.function.v2x.internal.callback.IV2XCallback +import com.mogo.eagle.core.function.v2x.internal.data.V2XAdvanceWarning +import com.mogo.eagle.core.function.v2x.internal.event.V2XEvent +import com.mogo.eagle.core.function.v2x.internal.logger.Logger + +internal class V2XMessageListener_404000(val cbs: Iterable?): IMogoCloudSocketOnMessageListener { + + override fun target(msgType: Int): Class = V2XAdvanceWarning::class.java + + override fun onMsgReceived(msgType: Int, data: V2XAdvanceWarning?) { + if (msgType != 404000) { + return + } + if (data == null) { + Logger.i(V2XManager.TAG, "V2XMessageListener_404000:message is null!") + return + } + Logger.i(V2XManager.TAG, "V2XMessageListener_404000:$data") + cbs?.forEach { + it.onAck(V2XEvent.ForwardsWarning(data = data)) + } + } +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_503000.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_503000.kt new file mode 100644 index 0000000000..cbfeca79df --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_503000.kt @@ -0,0 +1,27 @@ +package com.mogo.eagle.core.function.v2x.internal.socket + +import com.mogo.cloud.socket.IMogoCloudSocketOnMessageListener +import com.mogo.eagle.core.function.v2x.internal.V2XManager +import com.mogo.eagle.core.function.v2x.internal.callback.IV2XCallback +import com.mogo.eagle.core.function.v2x.internal.event.V2XEvent.RoadAI +import com.mogo.eagle.core.function.v2x.internal.logger.Logger +import roadwork.Road.RW_PB + +internal class V2XMessageListener_503000(val cbs: Iterable?): IMogoCloudSocketOnMessageListener { + + override fun target(msgType: Int): Class = RW_PB::class.java + + override fun onMsgReceived(msgType: Int, data: RW_PB?) { + if (msgType != 503000) { + return + } + if (data == null) { + Logger.i(V2XManager.TAG, "V2XMessageListener_503000:message is null!") + return + } + Logger.i(V2XManager.TAG, "V2XMessageListener_503000:$data") + cbs?.forEach { + it.onAck(RoadAI(data = data)) + } + } +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_70001.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_70001.kt new file mode 100644 index 0000000000..cb1b9be044 --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_70001.kt @@ -0,0 +1,27 @@ +package com.mogo.eagle.core.function.v2x.internal.socket + +import com.mogo.cloud.socket.IMogoCloudSocketOnMessageListener +import com.mogo.eagle.core.function.v2x.internal.V2XManager +import com.mogo.eagle.core.function.v2x.internal.callback.IV2XCallback +import com.mogo.eagle.core.function.v2x.internal.data.V2XRoadXData +import com.mogo.eagle.core.function.v2x.internal.event.V2XEvent +import com.mogo.eagle.core.function.v2x.internal.logger.Logger + +internal class V2XMessageListener_70001(val cbs: Iterable?): IMogoCloudSocketOnMessageListener { + + override fun target(msgType: Int): Class = V2XRoadXData::class.java + + override fun onMsgReceived(msgType: Int, data: V2XRoadXData?) { + if (msgType != 70001) { + return + } + if (data == null) { + Logger.i(V2XManager.TAG, "V2XMessageListener_70001:message is null!") + return + } + Logger.i(V2XManager.TAG, "V2XMessageListener_70001:$data") + cbs?.forEach { + it.onAck(V2XEvent.RoadEventX(data = data)) + } + } +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/utils/DeviceUtils.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/utils/DeviceUtils.kt new file mode 100644 index 0000000000..b7c6dc3312 --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/utils/DeviceUtils.kt @@ -0,0 +1,46 @@ +package com.mogo.eagle.core.function.v2x.internal.utils + +import android.Manifest +import android.annotation.SuppressLint +import android.content.Context +import android.content.pm.PackageManager +import android.telephony.CellLocation +import android.telephony.TelephonyManager +import android.telephony.cdma.CdmaCellLocation +import android.telephony.gsm.GsmCellLocation +import java.lang.Exception + +internal class DeviceUtils { + + companion object { + + @SuppressLint("MissingPermission") + @JvmStatic + fun getCellId(context: Context): String? { + val tm = context.getSystemService(Context.TELEPHONY_SERVICE) as TelephonyManager + val pm = context.packageManager + val accessCoarseLocationPermission = PackageManager.PERMISSION_GRANTED == + pm.checkPermission(Manifest.permission.ACCESS_COARSE_LOCATION, context.packageName) + val accessFineLocationPermission = PackageManager.PERMISSION_GRANTED == + pm.checkPermission(Manifest.permission.ACCESS_FINE_LOCATION, context.packageName) + if (!accessCoarseLocationPermission || !accessFineLocationPermission) return "noPermission" + var location: CellLocation? = null + try { + location = tm.cellLocation + } catch (e: Exception) { + e.printStackTrace() + } + if (location != null) { + // Gsm网络 , 联通移动的网络属于这一套 + if (location is GsmCellLocation) { + val cellid = location.cid + return cellid.toString() + // Cdma网络 , 电信网络属于这一种 + } else if (location is CdmaCellLocation) { + return location.baseStationId.toString() + } + } + return null + } + } +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/utils/DistanceUtils.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/utils/DistanceUtils.kt new file mode 100644 index 0000000000..43f59ca92c --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/utils/DistanceUtils.kt @@ -0,0 +1,52 @@ +package com.mogo.eagle.core.function.v2x.internal.utils + +import kotlin.math.asin +import kotlin.math.cos +import kotlin.math.sin +import kotlin.math.sqrt + +internal class DistanceUtils { + + companion object { + + /** + * @param lon1 + * @param lat1 + * @param lon2 + * @param lat2 + * @return 两坐标的距离 单位:米(M) + */ + fun calculateLineDistance(lon1: Double, lat1: Double, lon2: Double, lat2: Double): Float { + return try { + var var2 = lon1 + var var4 = lat1 + var var6 = lon2 + var var8 = lat2 + var2 *= 0.01745329251994329 + var4 *= 0.01745329251994329 + var6 *= 0.01745329251994329 + var8 *= 0.01745329251994329 + val var10 = sin(var2) + val var12 = sin(var4) + val var14 = cos(var2) + val var16 = cos(var4) + val var18 = sin(var6) + val var20 = sin(var8) + val var22 = cos(var6) + val var24 = cos(var8) + val var28 = DoubleArray(3) + val var29 = DoubleArray(3) + var28[0] = var16 * var14 + var28[1] = var16 * var10 + var28[2] = var12 + var29[0] = var24 * var22 + var29[1] = var24 * var18 + var29[2] = var20 + (asin(sqrt((var28[0] - var29[0]) * (var28[0] - var29[0]) + (var28[1] - var29[1]) * (var28[1] - var29[1]) + (var28[2] - var29[2]) * (var28[2] - var29[2])) / 2.0) * 1.27420015798544E7).toFloat() + } catch (var26: Throwable) { + var26.printStackTrace() + 0.0f + } + } + } +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/redlightwarning/RedLightWarningManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/redlightwarning/RedLightWarningManager.kt index 49004bae3e..93f23984b6 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/redlightwarning/RedLightWarningManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/redlightwarning/RedLightWarningManager.kt @@ -20,7 +20,7 @@ import com.mogo.eagle.core.function.v2x.trafficlight.core.MogoTrafficLightManage import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X import com.mogo.eagle.core.utilcode.util.ThreadUtils -import com.mogo.eagle.core.data.enums.EventTypeEnum +import com.mogo.eagle.core.data.enums.EventTypeEnumNew import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.data.msgbox.V2XMsg @@ -208,16 +208,16 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener, CallerMsgBoxManager.saveMsgBox( MsgBoxBean( MsgBoxType.V2X, - V2XMsg(EventTypeEnum.TYPE_USECASE_ID_IVP.poiType, - EventTypeEnum.TYPE_USECASE_ID_IVP.content, - EventTypeEnum.TYPE_USECASE_ID_IVP.tts) + V2XMsg(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, + EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.content, + EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.tts) ) ) CallerHmiManager.warningV2X( - EventTypeEnum.TYPE_USECASE_ID_IVP.poiType, - EventTypeEnum.TYPE_USECASE_ID_IVP.content, - EventTypeEnum.TYPE_USECASE_ID_IVP.tts, - EventTypeEnum.TYPE_USECASE_ID_IVP.poiType, + EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, + EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.content, + EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.tts, + EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, null, true, 5000L @@ -233,11 +233,11 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener, CallerLogger.d("$M_V2X$TAG", "=====绿灯通行预警=====") ThreadUtils.runOnUiThread { val content = String.format( - EventTypeEnum.getWarningContent(EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType), + EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType), speed ) val tts = String.format( - EventTypeEnum.getWarningTts(EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType), + EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType), speed ) if (content.isNullOrEmpty() || tts.isNullOrEmpty()) { @@ -246,16 +246,16 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener, CallerMsgBoxManager.saveMsgBox( MsgBoxBean( MsgBoxType.V2X, - V2XMsg(EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType, + V2XMsg(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, content, tts) ) ) CallerHmiManager.warningV2X( - EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType, + EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, content, tts, - EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType, + EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, null, true, 5000L diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/road/V2XEventResult.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/road/V2XEventResult.kt new file mode 100644 index 0000000000..7a98c26ab4 --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/road/V2XEventResult.kt @@ -0,0 +1,73 @@ +package com.mogo.eagle.core.function.v2x.road + +import androidx.annotation.Keep + +import com.google.gson.annotations.SerializedName +import com.mogo.eagle.core.data.BaseData + + +@Keep +data class V2XEventResult ( + @SerializedName("result") + var result: Result? +): BaseData() + +@Keep +data class Result( + @SerializedName("eventList") + var v2XEventList: List? +) + +@Keep +data class V2XEvent( + @SerializedName("receiveTime") + var receiveTime: Long, + + @SerializedName("detectTime") + var detectTime: Long, + + @SerializedName("id") + var id: String?, + + @SerializedName("center") + var center: Center?, + + @SerializedName("centerRoad") + var centerRoad: CenterRoad?, + + @SerializedName("radius") + var radius: Double, + + @SerializedName("poiType") + var poiType: String?, + + @SerializedName("coordinateType") + var coordinateType:Int? = null +) + +@Keep +data class Center( + @SerializedName("lat") + var lat: Double, + + @SerializedName("lon") + var lon: Double +) + +@Keep +data class CenterRoad( + @SerializedName("bearing") + var bearing: Double, + + @SerializedName("laneNo") + var laneNo: Long, + + @SerializedName("roadId") + var roadId: String?, + + @SerializedName("roadName") + var roadName: String?, + + @SerializedName("tileId") + var tileId: Long +) \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/road/V2XEventServiceApi.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/road/V2XEventServiceApi.kt new file mode 100644 index 0000000000..5b73866375 --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/road/V2XEventServiceApi.kt @@ -0,0 +1,11 @@ +package com.mogo.eagle.core.function.v2x.road + +import io.reactivex.Observable +import retrofit2.http.GET +import retrofit2.http.Query + +interface V2XEventServiceApi { + + @GET("/eagleEye-mis/config/queryV2NInformation") + fun queryAllV2XEventsByLineId(@Query("lineId") lineId: String, @Query("sn") sn: String): Observable +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/speedlimit/SpeedLimitDataManager.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/speedlimit/SpeedLimitDataManager.java index 15769c64cc..14daa288d9 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/speedlimit/SpeedLimitDataManager.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/speedlimit/SpeedLimitDataManager.java @@ -54,16 +54,16 @@ public class SpeedLimitDataManager implements IMogoCarLocationChangedListener2 { @BizConfig(biz = V2I,dependentBizNode = "",bizNode = BIZ_SLW) private void getSpeedLimit() { - if (!isShowObuLimitSpeedView) { +// if (!isShowObuLimitSpeedView) { int speedLimit = MogoMapUIController.getInstance().getLimitSpeed(mLocation.getLongitude(), mLocation.getLatitude(), mLocation.getBearing()); UiThreadHandler.post(() -> { if (speedLimit > 0) { - CallerHmiManager.INSTANCE.showLimitingVelocity(speedLimit); +// CallerHmiManager.INSTANCE.showLimitingVelocity(speedLimit); CallLimitingVelocityListenerManager.INSTANCE.invokeOnLimitingVelocityChange(speedLimit); } }); } - } +// } } public void start() { diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/speedlimit/SpeedLimitDispatcher.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/speedlimit/SpeedLimitDispatcher.kt new file mode 100644 index 0000000000..ac370c082f --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/speedlimit/SpeedLimitDispatcher.kt @@ -0,0 +1,80 @@ +package com.mogo.eagle.core.function.v2x.speedlimit + +import android.content.Context +import android.os.Handler +import android.util.Log +import com.mogo.eagle.core.data.trafficlight.TrafficLightResult +import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener +import com.mogo.eagle.core.function.api.obu.IMoGoObuTrafficLightListener +import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener +import com.mogo.eagle.core.function.api.v2x.LimitingVelocityListener +import com.mogo.eagle.core.function.api.v2x.ObuLimitingSpeedListener +import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager +import com.mogo.eagle.core.function.call.hmi.CallerHmiManager +import com.mogo.eagle.core.function.call.obu.CallerObuTrafficLightListenerManager +import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager +import com.mogo.eagle.core.function.call.v2x.CallLimitingVelocityListenerManager +import com.mogo.eagle.core.function.call.v2x.CallObuLimitingSpeedListenerManager +import com.mogo.eagle.core.function.v2x.trafficlight.TrafficLightHMIManager +import perception.TrafficLightOuterClass +import perception.TrafficLightOuterClass.TrafficLight + +/** + * @author lixiaopeng + * @description 对多个限速进行调度(map,rsu ...) + * @since: 2023/1/12 + */ +class SpeedLimitDispatcher : LimitingVelocityListener, ObuLimitingSpeedListener { + companion object { + const val TAG = "SpeedLimitDispatcher" + val INSTANCE: SpeedLimitDispatcher by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) { + SpeedLimitDispatcher() + } + } + + private var mContext: Context? = null + + //是否有AI获取红绿灯灯态 + private var hasObuStatus: Boolean = false + + + fun initLimit(context: Context) { + mContext = context + //注册监听MAP的限速 + CallLimitingVelocityListenerManager.addListener(TAG, this) + //注册监听OBU的限速 + CallObuLimitingSpeedListenerManager.addListener(TAG, this) + } + + /** + * 地图限速数据 + */ + override fun onLimitingVelocityChange(limitingVelocity: Int) { +// CallerHmiManager.disableLimitingVelocity() + if (!hasObuStatus) { + CallerHmiManager.showLimitingVelocity(limitingVelocity, 1) + } + } + + /** + * obu限速 + */ + override fun onObuLimitingSpeedChange(limitingSpeed: Int) { +// CallerHmiManager.disableLimitingVelocity() + if (limitingSpeed > 0) { + hasObuStatus = true + CallerHmiManager.showLimitingVelocity(limitingSpeed, 2) + } else { + hasObuStatus = false + CallerHmiManager.disableLimitingVelocity() + } + } + + fun destroy() { + //取消注册监听AI云获取红绿灯状态 + CallerTrafficLightListenerManager.unRegisterTrafficLightListener(TAG) + //取消注册监听工控机感知红绿灯 + CallerAutopilotIdentifyListenerManager.removeListener(TAG) + } + +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/TrafficLightHMIManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/TrafficLightHMIManager.kt index 247cea2317..7010257c06 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/TrafficLightHMIManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/TrafficLightHMIManager.kt @@ -1,5 +1,6 @@ package com.mogo.eagle.core.function.v2x.trafficlight +import android.util.Log import com.mogo.eagle.core.data.trafficlight.* import com.mogo.eagle.core.function.call.hmi.CallerHmiManager diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/core/MogoTrafficLightManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/core/MogoTrafficLightManager.kt index 332fe3ba85..f8864f79a2 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/core/MogoTrafficLightManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/core/MogoTrafficLightManager.kt @@ -98,10 +98,10 @@ class MogoTrafficLightManager : IMogoCarLocationChangedListener2 { 2_000L ) } - if (TrafficLightHMIManager.INSTANCE.isWarningTrafficLightShow()) { - TrafficLightHMIManager.INSTANCE.hideTrafficLight() - CallerTrafficLightListenerManager.resetTrafficLightData() - } +// if (TrafficLightHMIManager.INSTANCE.isWarningTrafficLightShow()) { +// TrafficLightHMIManager.INSTANCE.hideTrafficLight() +// CallerTrafficLightListenerManager.resetTrafficLightData() +// } CallerTrafficLightListenerManager.invokeTrafficRequestError() }) @@ -137,8 +137,8 @@ class MogoTrafficLightManager : IMogoCarLocationChangedListener2 { trafficLightResult = null firstLoopCrossRoad = true mThreadHandler?.sendEmptyMessage(MSG_WHAT_STOP_SEARCH_TRAFFIC_LIGHT) - TrafficLightHMIManager.INSTANCE.hideTrafficLight() - CallerTrafficLightListenerManager.resetTrafficLightData() +// TrafficLightHMIManager.INSTANCE.hideTrafficLight() +// CallerTrafficLightListenerManager.resetTrafficLightData() } } } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/core/TrafficLightDispatcher.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/core/TrafficLightDispatcher.kt index 90c0cad445..03ca1b2c9d 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/core/TrafficLightDispatcher.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/core/TrafficLightDispatcher.kt @@ -2,11 +2,14 @@ package com.mogo.eagle.core.function.v2x.trafficlight.core import android.content.Context import android.os.Handler +import android.util.Log import com.mogo.eagle.core.data.trafficlight.TrafficLightResult import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener +import com.mogo.eagle.core.function.api.obu.IMoGoObuTrafficLightListener import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager import com.mogo.eagle.core.function.call.hmi.CallerHmiManager +import com.mogo.eagle.core.function.call.obu.CallerObuTrafficLightListenerManager import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager import com.mogo.eagle.core.function.v2x.trafficlight.TrafficLightHMIManager import perception.TrafficLightOuterClass @@ -17,30 +20,36 @@ import perception.TrafficLightOuterClass.TrafficLight * @description 对多个红绿灯信号来源进行统一调度(AI云、工控机) * @since: 2022/4/28 */ -class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener , IMoGoTrafficLightListener { +class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLightListener, + IMoGoObuTrafficLightListener { - companion object{ + companion object { const val TAG = "TrafficLightDispatcher" - val INSTANCE: TrafficLightDispatcher by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED){ + val INSTANCE: TrafficLightDispatcher by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) { TrafficLightDispatcher() } } private var mContext: Context? = null + //是否有AI获取红绿灯灯态 private var hasAiLightStatus: Boolean = false + //obu数据 + private var hasObuLightStatus: Boolean = false - fun initServer(context: Context){ + fun initServer(context: Context) { mContext = context //注册监听AI云获取红绿灯状态 CallerTrafficLightListenerManager.registerTrafficLightListener(TAG, this) //注册监听AI云进入路口 CallerTrafficLightListenerManager.registerEnterCrossRoadListener(TAG, this) //注册监听红绿灯请求失败 - CallerTrafficLightListenerManager.registerTrafficRequestErrorListener(TAG,this) + CallerTrafficLightListenerManager.registerTrafficRequestErrorListener(TAG, this) //注册监听工控机感知红绿灯 CallerAutopilotIdentifyListenerManager.addListener(TAG, this) + //obu红绿灯数据 + CallerObuTrafficLightListenerManager.registerObuTrafficLightListener(TAG, this) } /** @@ -48,46 +57,48 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener , IMoGoTrafficLigh * @param trafficLights 感知红绿灯 */ override fun onAutopilotPerceptionTrafficLight(trafficLights: TrafficLightOuterClass.TrafficLights?) { - if(!hasAiLightStatus){ - trafficLights?.let { it -> - var light :TrafficLight?= null - if(it.hasStraight()){ - light = it.straight - }else if(it.hasLeft()){ - light = it.left - }else if(it.hasRight()){ - light = it.right - }else if(it.hasUTurn()){ - light = it.uTurn - } - if(light == null){ - //隐藏红绿灯显示 - TrafficLightHMIManager.INSTANCE.hideTrafficLight() - }else{ - when (light.state) { - TrafficLightOuterClass.LightState.STATE_RED -> { - //红灯 - CallerHmiManager.showWarningTrafficLight(1,2) - CallerHmiManager.changeCountdownGreen(0) - } - TrafficLightOuterClass.LightState.STATE_YELLOW -> { - //黄灯 - CallerHmiManager.showWarningTrafficLight(2,2) - CallerHmiManager.changeCountdownGreen(0) - } - TrafficLightOuterClass.LightState.STATE_GREEN -> { - //绿灯 - CallerHmiManager.showWarningTrafficLight(3,2) - CallerHmiManager.changeCountdownGreen(0) - } - TrafficLightOuterClass.LightState.STATE_OFF -> { - //黑灯,隐藏红绿灯显示 - TrafficLightHMIManager.INSTANCE.hideTrafficLight() - } - else -> {} + if (!hasObuLightStatus) { + if (!hasAiLightStatus) { + trafficLights?.let { it -> + var light: TrafficLight? = null + if (it.hasStraight()) { + light = it.straight + } else if (it.hasLeft()) { + light = it.left + } else if (it.hasRight()) { + light = it.right + } else if (it.hasUTurn()) { + light = it.uTurn + } + if (light == null) { + //隐藏红绿灯显示 + TrafficLightHMIManager.INSTANCE.hideTrafficLight() + } else { + when (light.state) { + TrafficLightOuterClass.LightState.STATE_RED -> { + //红灯 + CallerHmiManager.showWarningTrafficLight(1, 2) + CallerHmiManager.changeCountdownGreen(0) + } + TrafficLightOuterClass.LightState.STATE_YELLOW -> { + //黄灯 + CallerHmiManager.showWarningTrafficLight(2, 2) + CallerHmiManager.changeCountdownGreen(0) + } + TrafficLightOuterClass.LightState.STATE_GREEN -> { + //绿灯 + CallerHmiManager.showWarningTrafficLight(3, 2) + CallerHmiManager.changeCountdownGreen(0) + } + TrafficLightOuterClass.LightState.STATE_OFF -> { + //黑灯,隐藏红绿灯显示 + TrafficLightHMIManager.INSTANCE.hideTrafficLight() + } + else -> {} + } } - } + } } } } @@ -96,21 +107,28 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener , IMoGoTrafficLigh * AI云获取红绿灯状态 */ override fun onTrafficLightStatus(trafficLightResult: TrafficLightResult) { - TrafficLightHMIManager.INSTANCE.updateTrafficLight(trafficLightResult) - hasAiLightStatus = true + if (!hasObuLightStatus) { + TrafficLightHMIManager.INSTANCE.updateTrafficLight(trafficLightResult) + hasAiLightStatus = true + } } /** - * 车辆进入路口 + * 车辆进入路口回调 + * @param enter true:进入路口;false:离开路口 */ override fun onEnterCrossRoad(enter: Boolean) { - if(!enter){ + if (!enter) { Handler().postDelayed({ hasAiLightStatus = false + hasObuLightStatus = false }, 5000) + CallerTrafficLightListenerManager.resetTrafficLightData() + //如果没有OBU灯态则进行隐藏,如果有OBU灯态,则交由OBU管理 + if(!hasObuLightStatus){ + TrafficLightHMIManager.INSTANCE.hideTrafficLight() + } } - - } /** @@ -118,10 +136,24 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener , IMoGoTrafficLigh */ override fun onTrafficRequestError() { hasAiLightStatus = false + CallerTrafficLightListenerManager.resetTrafficLightData() + if(!hasObuLightStatus){ + if (TrafficLightHMIManager.INSTANCE.isWarningTrafficLightShow()) { + TrafficLightHMIManager.INSTANCE.hideTrafficLight() + } + } } + /** + * obu 红绿灯数据 + */ + override fun onObuTrafficLight(light: Int) { + super.onObuTrafficLight(light) + hasObuLightStatus = true + CallerHmiManager.showWarningTrafficLight(light, 3) + } - fun destroy(){ + fun destroy() { //取消注册监听AI云获取红绿灯状态 CallerTrafficLightListenerManager.unRegisterTrafficLightListener(TAG) //取消注册监听工控机感知红绿灯 diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/vip/VipCarManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/vip/VipCarManager.kt index 61bd434cb7..5320af1324 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/vip/VipCarManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/vip/VipCarManager.kt @@ -10,7 +10,7 @@ import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager import com.mogo.cloud.passport.MoGoAiCloudClientConfig import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_VIP import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2N -import com.mogo.eagle.core.data.enums.EventTypeEnum +import com.mogo.eagle.core.data.enums.EventTypeEnumNew import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.data.msgbox.V2XMsg @@ -211,17 +211,17 @@ class VipCarManager : IMogoOnMessageListener, IMoGoTrafficLightListe val light = this.result?.currentRoadTrafficLight() if (light != null && light.isGreen()) { showWarning( - EventTypeEnum.TYPE_VIP_IDENTIFICATION_EXTEND.poiType, - EventTypeEnum.TYPE_VIP_IDENTIFICATION_EXTEND.content, - EventTypeEnum.TYPE_VIP_IDENTIFICATION_EXTEND.tts, - EventTypeEnum.TYPE_VIP_IDENTIFICATION_EXTEND.poiType + EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.poiType, + EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.content, + EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.tts, + EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.poiType ) } else { showWarning( - EventTypeEnum.TYPE_VIP_IDENTIFICATION_PASS.poiType, - EventTypeEnum.TYPE_VIP_IDENTIFICATION_PASS.content, - EventTypeEnum.TYPE_VIP_IDENTIFICATION_PASS.tts, - EventTypeEnum.TYPE_VIP_IDENTIFICATION_PASS.poiType + EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.poiType, + EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.content, + EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.tts, + EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.poiType ) } return@turnLightToGreen @@ -230,10 +230,10 @@ class VipCarManager : IMogoOnMessageListener, IMoGoTrafficLightListe // 请求变灯失败,根据灯态来提示。 此处灯态未获取到 if (this.result == null || this.result?.currentRoadTrafficLight() == null) { showWarning( - EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.poiType, - EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.content + ", 稍后重试", - EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.tts, - EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.poiType + EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.poiType, + EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.content + ", 稍后重试", + EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.tts, + EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.poiType ) return@turnLightToGreen } @@ -251,10 +251,10 @@ class VipCarManager : IMogoOnMessageListener, IMoGoTrafficLightListe "${temp}秒后重试" } showWarning( - EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.poiType, - EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.content + time, - EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.tts, - EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.poiType + EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.poiType, + EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.content + time, + EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.tts, + EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.poiType ) } else { CallerLogger.d( diff --git a/core/function-impl/mogo-core-function-v2x/src/main/proto/road.proto b/core/function-impl/mogo-core-function-v2x/src/main/proto/road.proto new file mode 100644 index 0000000000..71c087aa5b --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/proto/road.proto @@ -0,0 +1,59 @@ +syntax = "proto2"; + +package roadwork; + +message RW_PB { + required Roadwork_PB roadwork =1; + optional Header header = 2; +} + +message Roadwork_PB{ + optional string id = 1; // 对应id + required int32 score = 2; // 置信度 + required int64 detect_time = 3; // 发送时间 + required int32 poi_type = 4; // poi 类型 + optional int32 type = 5; // 事件类型 + required Center_PB center = 6; // 中心点坐标 + repeated GPSPoint_PB polygon = 7; // 多边形范围 + repeated Road_PB road = 8; // 车道集合信息 +} + +message GPSPoint_PB { + required double lat = 1; // 纬度 + required double lon = 2; // 经度 + optional double hgt = 3; // 高程 +} + +message Road_PB{ + required string road_id = 1; // 路段id + required string lane_no = 2; // 车道号 + required string tile_id = 3; // 瓦片id + required int32 bearing = 4; // 方向角,正北是0度 顺时针 +} + +message Center_PB{ + required Road_PB road = 1; // 道路信息 + required GPSPoint_PB point = 2; // 坐标 +} + +// header + +message Time { + optional uint32 sec = 1; // 秒 + optional uint32 nsec = 2; // 纳秒 +} + +message Header { + // Sequence number for each message. Each module maintains its own counter for + // sequence_num, always starting from 1 on boot. + optional uint32 seq = 1; + + // Message publishing time in seconds. + optional Time stamp = 2; + + // frame id + optional string frame_id = 3; + + // Module name. + optional string module_name = 4; +} diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/pnc/PncActionsHelper.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/pnc/PncActionsHelper.kt index 753b04d1ce..f5d607a9ce 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/pnc/PncActionsHelper.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/pnc/PncActionsHelper.kt @@ -13,7 +13,7 @@ class PncActionsHelper { } // 车道保持 driving_action: 1:车道保持状态,2:跟车状态 LANKE_KEEP_VALUE -> { - if(driveAction == 2) "正在跟随车辆行驶" else "" + if (driveAction == 2) "正在跟随车辆行驶" else "" } // 红绿灯通行状态 driving_action:1 表示停止动作;driving_action:2 表示通行动作 TRAFFIC_LIGHT_VALUE -> { @@ -43,6 +43,18 @@ class PncActionsHelper { PULL_OVER_VALUE -> { if (driveAction == 1) "正在进站" else if (driveAction == 2) "正在等待进站" else "" } + // 同 AUTO_LANE_CHANGE_LEFT_VALUE 、AUTO_LANE_CHANGE_RIGHT_VALUE + AUTO_LANE_CHANGE_LEFT_V2N_VALUE, AUTO_LANE_CHANGE_RIGHT_V2N_VALUE -> { + if (driveAction == 2) "正在绕过前方道路事件" else "" + } + // 同 LANE_AVOID_LEFT_VALUE 、LANE_AVOID_RIGHT_VALUE + LANE_AVOID_LEFT_V2N_VALUE, LANE_AVOID_RIGHT_V2N_VALUE -> { + if (driveAction == 2) "正在避让前方道路事件" else "" + } + // 正在等待变道避让施工场景 driving_action:1 表示正在等待;driving_action:2 表示等待超时请求平行驾驶; + WAITING_V2N_VALUE -> { + if (driveAction == 1) "正在尝试绕过前方道路事件" else if (driveAction == 2) "正在请求远程协助" else "" + } else -> "" } } diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/CloudPoiManager.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/CloudPoiManager.java index 540ffc7574..1359dd3e6b 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/CloudPoiManager.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/CloudPoiManager.java @@ -6,7 +6,7 @@ import android.util.ArrayMap; import com.elegant.network.utils.GsonUtil; import com.mogo.eagle.core.data.R; -import com.mogo.eagle.core.data.enums.EventTypeEnum; +import com.mogo.eagle.core.data.enums.EventTypeEnumNew; import com.mogo.eagle.core.data.map.PoiWrapper; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr; @@ -38,37 +38,37 @@ public class CloudPoiManager { public void generateDefault() { if (poiWrapper.isEmpty()) { - poiWrapper.put(EventTypeEnum.TRAFFIC_CHECK.getPoiType(), new PoiWrapper(EventTypeEnum.TRAFFIC_CHECK.getPoiType(), + poiWrapper.put(EventTypeEnumNew.TRAFFIC_CHECK.getPoiType(), new PoiWrapper(EventTypeEnumNew.TRAFFIC_CHECK.getPoiType(), R.drawable.module_common_icon_map_marker_road_check2, R.drawable.module_common_icon_map_marker_road_check2_white, "交通检查")); - poiWrapper.put(EventTypeEnum.ROAD_CLOSED.getPoiType(), new PoiWrapper(EventTypeEnum.ROAD_CLOSED.getPoiType(), + poiWrapper.put(EventTypeEnumNew.ROAD_CLOSED.getPoiType(), new PoiWrapper(EventTypeEnumNew.ROAD_CLOSED.getPoiType(), R.drawable.module_common_icon_map_marker_road_block_off2, R.drawable.module_common_icon_map_marker_road_block_off2_white, "封路")); - poiWrapper.put(EventTypeEnum.FOURS_ROAD_WORK.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_ROAD_WORK.getPoiType(), + poiWrapper.put(EventTypeEnumNew.FOURS_ROAD_WORK.getPoiType(), new PoiWrapper(EventTypeEnumNew.FOURS_ROAD_WORK.getPoiType(), R.drawable.module_common_icon_map_marker_road_work2, R.drawable.module_common_icon_map_marker_road_work2_white, "施工")); - poiWrapper.put(EventTypeEnum.AI_ROAD_WORK.getPoiType(), new PoiWrapper(EventTypeEnum.AI_ROAD_WORK.getPoiType(), + poiWrapper.put(EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType(), new PoiWrapper(EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType(), R.drawable.module_common_icon_map_marker_road_work2, R.drawable.module_common_icon_map_marker_road_work2_white, "施工")); - poiWrapper.put(EventTypeEnum.FOURS_BLOCK_UP.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_BLOCK_UP.getPoiType(), + poiWrapper.put(EventTypeEnumNew.FOURS_BLOCK_UP.getPoiType(), new PoiWrapper(EventTypeEnumNew.FOURS_BLOCK_UP.getPoiType(), R.drawable.module_common_icon_map_marker_road_block_up2, R.drawable.module_common_icon_map_marker_road_block_up2_white, "拥堵")); - poiWrapper.put(EventTypeEnum.FOURS_PONDING.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_PONDING.getPoiType(), + poiWrapper.put(EventTypeEnumNew.FOURS_PONDING.getPoiType(), new PoiWrapper(EventTypeEnumNew.FOURS_PONDING.getPoiType(), R.drawable.module_common_icon_map_marker_pondingl2, R.drawable.module_common_icon_map_marker_pondingl2_white, "积水")); - poiWrapper.put(EventTypeEnum.FOURS_FOG.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_FOG.getPoiType(), + poiWrapper.put(EventTypeEnumNew.FOURS_FOG.getPoiType(), new PoiWrapper(EventTypeEnumNew.FOURS_FOG.getPoiType(), R.drawable.module_common_ic_rc_dark_frog2, R.drawable.module_common_ic_rc_dark_frog2_white, "浓雾")); - poiWrapper.put(EventTypeEnum.FOURS_ICE.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_ICE.getPoiType(), + poiWrapper.put(EventTypeEnumNew.FOURS_ICE.getPoiType(), new PoiWrapper(EventTypeEnumNew.FOURS_ICE.getPoiType(), R.drawable.module_common_ic_rc_freeze2, R.drawable.module_common_ic_rc_freeze2_white, "结冰")); - poiWrapper.put(EventTypeEnum.FOURS_ACCIDENT.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_ACCIDENT.getPoiType(), + poiWrapper.put(EventTypeEnumNew.FOURS_ACCIDENT.getPoiType(), new PoiWrapper(EventTypeEnumNew.FOURS_ACCIDENT.getPoiType(), R.drawable.module_common_ic_rc_accident3, R.drawable.module_common_ic_rc_accident3_white, "事故")); - poiWrapper.put(EventTypeEnum.FOURS_ACCIDENT_01.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_ACCIDENT_01.getPoiType(), + poiWrapper.put(EventTypeEnumNew.FOURS_ACCIDENT_01.getPoiType(), new PoiWrapper(EventTypeEnumNew.FOURS_ACCIDENT_01.getPoiType(), R.drawable.module_common_ic_rc_accident3, R.drawable.module_common_ic_rc_accident3_white, "重大事故")); - poiWrapper.put(EventTypeEnum.FOURS_ACCIDENT_02.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_ACCIDENT_02.getPoiType(), + poiWrapper.put(EventTypeEnumNew.FOURS_ACCIDENT_02.getPoiType(), new PoiWrapper(EventTypeEnumNew.FOURS_ACCIDENT_02.getPoiType(), R.drawable.module_common_ic_rc_accident3, R.drawable.module_common_ic_rc_accident3_white, "特大事故")); - poiWrapper.put(EventTypeEnum.FOURS_ACCIDENT_03.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_ACCIDENT_03.getPoiType(), + poiWrapper.put(EventTypeEnumNew.FOURS_ACCIDENT_03.getPoiType(), new PoiWrapper(EventTypeEnumNew.FOURS_ACCIDENT_03.getPoiType(), R.drawable.module_common_ic_rc_accident3, R.drawable.module_common_ic_rc_accident3_white, "较大事故")); - poiWrapper.put(EventTypeEnum.FOURS_ACCIDENT_04.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_ACCIDENT_04.getPoiType(), + poiWrapper.put(EventTypeEnumNew.FOURS_ACCIDENT_04.getPoiType(), new PoiWrapper(EventTypeEnumNew.FOURS_ACCIDENT_04.getPoiType(), R.drawable.module_common_ic_rc_accident3, R.drawable.module_common_ic_rc_accident3_white, "一般事故")); - poiWrapper.put(EventTypeEnum.FOURS_ACCIDENT_05.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_ACCIDENT_05.getPoiType(), + poiWrapper.put(EventTypeEnumNew.FOURS_ACCIDENT_05.getPoiType(), new PoiWrapper(EventTypeEnumNew.FOURS_ACCIDENT_05.getPoiType(), R.drawable.module_common_ic_rc_accident3, R.drawable.module_common_ic_rc_accident3_white, "轻微事故")); - poiWrapper.put(EventTypeEnum.FOURS_LIVING.getPoiType(), new PoiWrapper(EventTypeEnum.FOURS_LIVING.getPoiType(), + poiWrapper.put(EventTypeEnumNew.FOURS_LIVING.getPoiType(), new PoiWrapper(EventTypeEnumNew.FOURS_LIVING.getPoiType(), R.drawable.module_common_icon_map_marker_living, R.drawable.module_common_icon_map_marker_living_white, "实时路况")); - poiWrapper.put(EventTypeEnum.ILLEGAL_PARK_LIVING.getPoiType(), new PoiWrapper(EventTypeEnum.ILLEGAL_PARK_LIVING.getPoiType(), + poiWrapper.put(EventTypeEnumNew.ILLEGAL_PARK_LIVING.getPoiType(), new PoiWrapper(EventTypeEnumNew.ILLEGAL_PARK_LIVING.getPoiType(), R.drawable.module_common_ic_rc_illegal_park, R.drawable.module_common_ic_rc_illegal_park_white, "违章停车")); // 分享里用到的故障求助 poiWrapper.put("9999", new PoiWrapper("9999", diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/FunctionBuildConfig.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/FunctionBuildConfig.kt index 690adf88a0..ffeb84a730 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/FunctionBuildConfig.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/FunctionBuildConfig.kt @@ -45,6 +45,14 @@ object FunctionBuildConfig { @JvmField var detouringSpeed = 3 + /** + * 是否从车端融合过来的v2n事件 + * 默认关闭,开启后接收车端融合预警,关闭云端长链V2N + */ + @Volatile + @JvmField + var isV2NFromCar = false + /** * 是否是感知优化模式 * 默认开启 @@ -56,6 +64,20 @@ object FunctionBuildConfig { @JvmField var isBeautyMode = true + /** + * 是否绘制云端感知物 + */ + @Volatile + @JvmField + var isDrawAiCloudFusion = true + + /** + * 是否开启roma + */ + @Volatile + @JvmField + var isRomaMode = true + /** * 是否开启感知物替换颜色功能 * 默认关闭 @@ -171,4 +193,5 @@ object FunctionBuildConfig { @JvmField var isPNCWarning = true + } \ No newline at end of file diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/MogoServicePaths.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/MogoServicePaths.java index 0b2ca7cbbe..8b135ecf92 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/MogoServicePaths.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/MogoServicePaths.java @@ -153,4 +153,7 @@ public class MogoServicePaths { @Keep public static final String PATH_MSG_BOX_MODULE = "/msg_box/api"; + + @Keep + public static final String PATH_IDENTIFY = "/map/identify"; } diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnum.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnum.kt index 604d540451..e291c91433 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnum.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnum.kt @@ -619,7 +619,7 @@ enum class EventTypeEnum( fun getMarker3DRes(poiType: String?): Int { return when (poiType) { FOURS_BLOCK_UP.poiType -> R.raw.v2x_yongdu - FOURS_ACCIDENT.poiType -> R.raw.v2x_shigu + FOURS_ACCIDENT.poiType,FOURS_ACCIDENT_04.poiType -> R.raw.v2x_shigu FOURS_LIVING.poiType -> R.raw.v2x_shishilukuang FOURS_FOG.poiType -> R.raw.v2x_nongwu TRAFFIC_CHECK.poiType -> R.raw.v2x_jiaotongjiancha diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt index 748b847aef..d6f6595483 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt @@ -33,12 +33,6 @@ enum class EventTypeEnumNew( "注意施工占道", "注意施工占道" ), - //施工-AI云下发 - AI_ROAD_WORK( - "100061", "道路施工", "前方施工", R.drawable.icon_warning_v2x_road_construction, - "前方施工", "道路施工" - ), - //拥堵 FOURS_BLOCK_UP( "10007", "道路拥堵", "前方拥堵", R.drawable.icon_warning_v2x_congestion, @@ -112,6 +106,12 @@ enum class EventTypeEnumNew( GHOST_PROBE("10024", "前方盲区行人预警", "前方盲区行人预警", R.drawable.icon_warning_v2x_pedestrian_crossing, "前方盲区行人通行,请注意", "前方盲区即将有行人通过,请减速慢行"), + //接管 + TAKE_OVER_EVENT( + "20000", "注意周围、立即接管", "注意周围、立即接管", R.drawable.icon_warning_take_over, + "注意周围、立即接管", "自动驾驶退出请立即接管" + ), + // 前方静止or慢速车辆报警 ALERT_FRONT_CAR("99999"), @@ -124,7 +124,7 @@ enum class EventTypeEnumNew( // 红绿灯事件、一种是绿灯不足3秒 ALERT_TRAFFIC_LIGHT_WARNING("99996"), - // 故障车辆 + // 故障车辆 TODO ALERT_CAR_TROUBLE_WARNING("20007"), // 疲劳驾驶 @@ -133,21 +133,30 @@ enum class EventTypeEnumNew( // 违章停车 ALERT_ILLEGAL_PARK("99992"), - //-------------v2n start ------------> + //TODO 这个确认值 + TYPE_USECASE_OPTIMAL_LANE( + 0x2B06.toString(), + "最优车道", + poiTypeSrcVr = R.drawable.v2x_icon_live_logo, + content = "最优车道", + tts = "最优车道" + ), + + //-------------obu v2v start ------------> TYPE_USECASE_ID_FCW( - 2000.toString(), + 2010.toString(), "前向碰撞预警", poiTypeSrcVr = R.drawable.icon_warning_v2x_collision_warning, content = "前车碰撞预警", tts = "小心前车" ), - // TYPE_USECASE_ID_ICW( - // 1.toString(), - // "交叉路口碰撞预警", - // poiTypeSrcVr = R.drawable.icon_warning_v2x_collision_warning, - // content = "交叉路口碰撞预警", - // tts = "注意交叉路口车辆" - // ), + TYPE_USECASE_ID_ICW( + 2009.toString(), + "交叉路口碰撞预警", + poiTypeSrcVr = R.drawable.icon_warning_v2x_collision_warning, + content = "交叉路口碰撞预警", + tts = "注意交叉路口车辆" + ), TYPE_USECASE_ID_LTA( 2001.toString(), "左转辅助", @@ -205,16 +214,15 @@ enum class EventTypeEnumNew( content = "注意特种车辆通行", tts = "请避让特种车辆" ), - //-------------v2n end ------------> + //-------------obu v2v end ------------> - - //---------弱势交通参与者 start ------> + //---------弱势交通参与者 obu and cloud start ------> TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES( 1001.toString(), "弱势交通参与者碰撞预警", poiTypeSrcVr = R.drawable.icon_warning_v2x_motorcycle_collision, - content = "注意机动车", - tts = "注意机动车" + content = "注意摩托车", + tts = "注意摩托车" ), TYPE_USECASE_ID_VRUCW_NOT_MOTOR_VEHICLES( 1002.toString(), @@ -237,10 +245,9 @@ enum class EventTypeEnumNew( content = "前方有未知障碍物", tts = "前方有未知障碍物" ), - //---------弱势交通参与者 end --------> + //---------弱势交通参与者 obu and cloud end --------> - - //--------------红绿灯 start -------> TODO 修改重复 + //--------------红绿灯 start -------> TYPE_USECASE_ID_IVP_RED( 1666.toString(), "闯红灯预警", @@ -258,7 +265,7 @@ enum class EventTypeEnumNew( ), //-------------红绿灯 end ----------> - //-----------道路危险情况预警 start ---------------> + //-----------道路危险情况预警 obu start ---------------> TYPE_USECASE_ID_BREAKDOWN_WARNING( //故障车辆 101.toString(), "车辆故障", @@ -308,11 +315,10 @@ enum class EventTypeEnumNew( content = "您已超速,请减速行驶", tts = "您已超速,请减速行驶" ), - //------------道路危险情况预警 end -----------> + //------------道路危险情况预警 obu end -----------> - - //------------车内标牌 start --------------> - TYPE_ID_SHAPR_TURNS( + //------------车内标牌 obu start --------------> + TYPE_ID_SHAPR_TURNS( //TODO 2.toString(), "急转弯", poiTypeSrcVr = R.drawable.icon_warning_v2x_turn_left_sharp, @@ -447,13 +453,44 @@ enum class EventTypeEnumNew( ), TYPE_USECASE_ID_ACCIDENT( 244.toString(), - "事故", + "交通事故", poiTypeSrcVr = R.drawable.v2x_icon_jiaotongshigu_vr, - content = "前方%s米事故", - tts = "前方%s米事故" + content = "前方%s米交通事故", + tts = "前方%s米交通事故" ), - //------------车内标牌 end --------------> + //------------车内标牌 obu end --------------> + TYPE_SOCKET_ROAD_CONGESTION( + "100071", + "交通拥堵", + poiTypeSrcVr = R.drawable.v2x_icon_yongdu_vr, + content = "前方%s米交通拥堵", + tts = "前方%s米交通拥堵" + ), + + TYPE_SOCKET_ROAD_JINGZHI( + "100251", + "前方%s米静止障碍物占道", + poiTypeSrcVr = R.drawable.v2x_icon_jingzhi_zhangai, + content = "前方%s米静止障碍物占道", + tts = "前方%s米静止障碍物占道" + ), + + TYPE_SOCKET_ROAD_SHIGU( + "100321", + "前方%s米道路事故", + poiTypeSrcVr = R.drawable.v2x_icon_shigu_sanjiaopai, + content = "前方%s米道路事故", + tts = "前方%s米道路事故" + ), + + TYPE_SOCKET_ROAD_SHIGONG( + "100061", + "前方%s米道路施工", + poiTypeSrcVr = R.drawable.v2x_icon_shigong_zhandao, + content = "前方%s米道路施工", + tts = "前方%s米道路施工" + ), TYPE_ERROR( 0.toString(), @@ -463,8 +500,9 @@ enum class EventTypeEnumNew( tts = "" ), - TYPE_VIP_IDENTIFICATION("10022", "", "", R.drawable.icon_warning_v2x_vip_turn_light, "VIP车辆优先通行", "已为您变灯,请优先通行"), - + TYPE_VIP_IDENTIFICATION_PASS("20022", "", "", R.drawable.icon_warning_v2x_vip_turn_light, "VIP车辆优先通行,已为您变为绿灯", "VIP车辆优先通行,已为您变为绿灯"), + TYPE_VIP_IDENTIFICATION_EXTEND("20023", "", "", R.drawable.icon_warning_v2x_vip_turn_light, "VIP车辆优先通行,已为您延长绿灯", "VIP车辆优先通行,已为您延长绿灯"), + TYPE_VIP_ERROR_IDENTIFICATION("20024", "", "", R.drawable.icon_warning_v2x_vip_turn_light, "请求失败,", "请求失败,稍后重试"), TYPE_OPTIMAL_ROUTE_RECOMMEND("2000", "", "", R.drawable.icon_warning_v2x_optimal_route, "为您推荐最优路线", "已为您选择最优路线"); @@ -480,7 +518,6 @@ enum class EventTypeEnumNew( TRAFFIC_CHECK.poiType -> TRAFFIC_CHECK.poiTypeStr ROAD_CLOSED.poiType -> ROAD_CLOSED.poiTypeStr FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.poiTypeStr - AI_ROAD_WORK.poiType -> AI_ROAD_WORK.poiTypeStr FOURS_BLOCK_UP.poiType -> FOURS_BLOCK_UP.poiTypeStr FOURS_PONDING.poiType -> FOURS_PONDING.poiTypeStr FOURS_FOG.poiType -> FOURS_FOG.poiTypeStr @@ -502,7 +539,6 @@ enum class EventTypeEnumNew( TRAFFIC_CHECK.poiType -> TRAFFIC_CHECK.poiTypeStrVr ROAD_CLOSED.poiType -> ROAD_CLOSED.poiTypeStrVr FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.poiTypeStrVr - AI_ROAD_WORK.poiType -> AI_ROAD_WORK.poiTypeStrVr FOURS_BLOCK_UP.poiType -> FOURS_BLOCK_UP.poiTypeStrVr FOURS_PONDING.poiType -> FOURS_PONDING.poiTypeStrVr FOURS_FOG.poiType -> FOURS_FOG.poiTypeStrVr @@ -524,7 +560,6 @@ enum class EventTypeEnumNew( TRAFFIC_CHECK.poiType -> TRAFFIC_CHECK.poiTypeSrcVr ROAD_CLOSED.poiType -> ROAD_CLOSED.poiTypeSrcVr FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.poiTypeSrcVr - AI_ROAD_WORK.poiType -> AI_ROAD_WORK.poiTypeSrcVr FOURS_BLOCK_UP.poiType -> FOURS_BLOCK_UP.poiTypeSrcVr FOURS_PONDING.poiType -> FOURS_PONDING.poiTypeSrcVr FOURS_FOG.poiType -> FOURS_FOG.poiTypeSrcVr @@ -546,7 +581,7 @@ enum class EventTypeEnumNew( fun getPoiTypeBg(poiType: String, isVrMode: Boolean): Int { return when (poiType) { FOURS_BLOCK_UP.poiType, FOURS_LIVING.poiType-> if (isVrMode) R.drawable.bg_v2x_event_type_orange_vr else R.drawable.bg_v2x_event_type_orange - TRAFFIC_CHECK.poiType, ROAD_CLOSED.poiType, FOURS_ROAD_WORK.poiType, AI_ROAD_WORK.poiType, + TRAFFIC_CHECK.poiType, ROAD_CLOSED.poiType, FOURS_ROAD_WORK.poiType, FOURS_PONDING.poiType, FOURS_FOG.poiType, FOURS_ICE.poiType, FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType, FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> if (isVrMode) R.drawable.bg_v2x_event_type_red_vr else R.drawable.bg_v2x_event_type_read @@ -562,7 +597,7 @@ enum class EventTypeEnumNew( FOURS_BLOCK_UP.poiType, FOURS_LIVING.poiType -> R.drawable.bg_v2x_event_type_orange TRAFFIC_CHECK.poiType, ROAD_CLOSED.poiType, - FOURS_ROAD_WORK.poiType, AI_ROAD_WORK.poiType, FOURS_PONDING.poiType, + FOURS_ROAD_WORK.poiType, FOURS_PONDING.poiType, FOURS_FOG.poiType, FOURS_ICE.poiType, FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType, FOURS_ACCIDENT_03.poiType, @@ -579,65 +614,40 @@ enum class EventTypeEnumNew( fun isRoadEvent(poiType: String?): Boolean { return when (poiType) { TRAFFIC_CHECK.poiType, ROAD_CLOSED.poiType, - FOURS_ROAD_WORK.poiType, AI_ROAD_WORK.poiType, FOURS_BLOCK_UP.poiType, + FOURS_ROAD_WORK.poiType, FOURS_BLOCK_UP.poiType, FOURS_PONDING.poiType, FOURS_FOG.poiType, FOURS_ICE.poiType, FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType, FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, - FOURS_ACCIDENT_05.poiType, GHOST_PROBE.poiType, AI_ROAD_WORK.poiType -> true + FOURS_ACCIDENT_05.poiType, GHOST_PROBE.poiType, + TYPE_SOCKET_ROAD_SHIGONG.poiType, + TYPE_SOCKET_ROAD_JINGZHI.poiType, + TYPE_SOCKET_ROAD_SHIGU.poiType, + TYPE_SOCKET_ROAD_CONGESTION.poiType -> true else -> false } } - /** - * 是否需要UGC预警 - */ - @JvmStatic - fun isNeedRoadEventUgc(poiType: String?): Boolean { - return when (poiType) { - ROAD_CLOSED.poiType, FOURS_ROAD_WORK.poiType, AI_ROAD_WORK.poiType, - FOURS_BLOCK_UP.poiType, FOURS_ACCIDENT.poiType, - FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType, - FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, - FOURS_ACCIDENT_05.poiType, GHOST_PROBE.poiType -> true - else -> false - } - } - - @JvmStatic fun getTts(poiType: String?): String { return when (poiType) { TRAFFIC_CHECK.poiType -> TRAFFIC_CHECK.tts ROAD_CLOSED.poiType -> ROAD_CLOSED.tts FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.tts - AI_ROAD_WORK.poiType -> AI_ROAD_WORK.tts FOURS_BLOCK_UP.poiType -> FOURS_BLOCK_UP.tts FOURS_PONDING.poiType -> FOURS_PONDING.tts FOURS_FOG.poiType -> FOURS_FOG.tts FOURS_ICE.poiType -> FOURS_ICE.tts FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType, FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> FOURS_ACCIDENT.tts + TYPE_SOCKET_ROAD_SHIGONG.poiType -> TYPE_SOCKET_ROAD_SHIGONG.tts + TYPE_SOCKET_ROAD_JINGZHI.poiType -> TYPE_SOCKET_ROAD_JINGZHI.tts + TYPE_SOCKET_ROAD_SHIGU.poiType -> TYPE_SOCKET_ROAD_SHIGU.tts + TYPE_SOCKET_ROAD_CONGESTION.poiType -> TYPE_SOCKET_ROAD_CONGESTION.tts else -> "道路事件" } } - @JvmStatic - fun getTtsWithFeedback(poiType: String?): String { - return when (poiType) { - TRAFFIC_CHECK.poiType -> "交通检查" - ROAD_CLOSED.poiType -> "封路" - FOURS_ROAD_WORK.poiType -> "施工" - AI_ROAD_WORK.poiType -> "施工" - FOURS_BLOCK_UP.poiType -> "道路拥堵" - FOURS_PONDING.poiType -> "道路积水" - FOURS_FOG.poiType -> "出现浓雾" - FOURS_ICE.poiType -> "路面结冰" - FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType, - FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> "交通事故" - else -> "道路事件" - } - } @JvmStatic fun getAlarmContent(poiType: String?): String { @@ -645,7 +655,6 @@ enum class EventTypeEnumNew( TRAFFIC_CHECK.poiType -> TRAFFIC_CHECK.content ROAD_CLOSED.poiType -> ROAD_CLOSED.content FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.content - AI_ROAD_WORK.poiType -> AI_ROAD_WORK.content FOURS_BLOCK_UP.poiType -> FOURS_BLOCK_UP.content FOURS_PONDING.poiType -> FOURS_PONDING.content FOURS_FOG.poiType -> FOURS_FOG.content @@ -654,136 +663,93 @@ enum class EventTypeEnumNew( FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> FOURS_ACCIDENT.content GHOST_PROBE.poiType -> GHOST_PROBE.content + TYPE_SOCKET_ROAD_SHIGONG.poiType -> TYPE_SOCKET_ROAD_SHIGONG.content + TYPE_SOCKET_ROAD_JINGZHI.poiType -> TYPE_SOCKET_ROAD_JINGZHI.content + TYPE_SOCKET_ROAD_SHIGU.poiType -> TYPE_SOCKET_ROAD_SHIGU.content + TYPE_SOCKET_ROAD_CONGESTION.poiType -> TYPE_SOCKET_ROAD_CONGESTION.content else -> "道路事件" } } - @JvmStatic - fun getTypeSmallRes(type: String): Int { - return when (type) { - TRAFFIC_CHECK.poiType -> - R.drawable.mogo_image_jiaotongjiancha_small - ROAD_CLOSED.poiType -> R.drawable.mogo_image_fenglu_small - FOURS_ROAD_WORK.poiType -> R.drawable.mogo_image_daolushigong_small - AI_ROAD_WORK.poiType -> R.drawable.mogo_image_daolushigong_small - FOURS_BLOCK_UP.poiType -> R.drawable.mogo_image_yongdu_small - FOURS_PONDING.poiType -> R.drawable.mogo_image_jishui_small - FOURS_ICE.poiType -> R.drawable.mogo_image_jiebing_small - FOURS_FOG.poiType -> R.drawable.mogo_image_nongwu_small - FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType, - FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> - R.drawable.mogo_image_accident_small - else -> R.drawable.mogo_image_shishilukuang_small - } - } - - @JvmStatic - fun getTypeRes(type: String): Int { - return when (type) { - TRAFFIC_CHECK.poiType -> R.drawable.mogo_image_jiaotongjiancha_nor - ROAD_CLOSED.poiType -> R.drawable.mogo_image_fenglu_nor - FOURS_ROAD_WORK.poiType -> R.drawable.mogo_image_daolushigong_nor - AI_ROAD_WORK.poiType -> R.drawable.mogo_image_daolushigong_nor - FOURS_BLOCK_UP.poiType -> R.drawable.mogo_image_yongdu_nor - FOURS_PONDING.poiType -> R.drawable.mogo_image_jishui_nor - FOURS_ICE.poiType -> R.drawable.mogo_image_jiebing_nor - FOURS_FOG.poiType -> R.drawable.mogo_image_nongwu_nor - FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType, - FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> - R.drawable.mogo_image_jiaotongshigu_nor - else -> R.drawable.mogo_image_shishlukuang_nor - } - } - - @JvmStatic - fun getTypeName(type: String?): String { - return when (type) { - ROAD_CLOSED.poiType -> "封路" - FOURS_ICE.poiType -> "道路结冰" - FOURS_FOG.poiType -> "浓雾" - TRAFFIC_CHECK.poiType -> "交通检查" - FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType, - FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> "交通事故" - FOURS_BLOCK_UP.poiType -> "拥堵" - FOURS_ROAD_WORK.poiType -> "施工" - AI_ROAD_WORK.poiType -> "施工" - FOURS_PONDING.poiType -> "道路积水" - else -> "实时路况" - } - } @JvmStatic fun getMarker3DRes(poiType: String?): Int { return when (poiType) { FOURS_BLOCK_UP.poiType -> R.raw.v2x_yongdu - FOURS_ACCIDENT.poiType -> R.raw.v2x_shigu + FOURS_ACCIDENT.poiType,FOURS_ACCIDENT_04.poiType -> R.raw.v2x_shigu FOURS_LIVING.poiType -> R.raw.v2x_shishilukuang FOURS_FOG.poiType -> R.raw.v2x_nongwu TRAFFIC_CHECK.poiType -> R.raw.v2x_jiaotongjiancha FOURS_ROAD_WORK.poiType -> R.raw.v2x_daolushigong - AI_ROAD_WORK.poiType -> R.raw.v2x_daolushigong FOURS_ICE.poiType -> R.raw.v2x_daolujiebing FOURS_PONDING.poiType -> R.raw.v2x_daolujishui GHOST_PROBE.poiType -> R.raw.v2x_guzhangqiuzhu + TYPE_SOCKET_ROAD_SHIGONG.poiType -> R.raw.v2x_shigong_warning + TYPE_SOCKET_ROAD_JINGZHI.poiType -> R.raw.v2x_zhangai + TYPE_SOCKET_ROAD_SHIGU.poiType -> R.raw.v2x_shigu_sanjiaopai + TYPE_SOCKET_ROAD_CONGESTION.poiType -> R.raw.v2x_yongdu else -> 0 } } - @JvmStatic - fun getTypeNameTTS(type: String?): String { - return when (type) { - ROAD_CLOSED.poiType -> "封路" - FOURS_ICE.poiType -> "道路结冰" - FOURS_FOG.poiType -> "浓雾" - TRAFFIC_CHECK.poiType -> "交通检查" - FOURS_ACCIDENT.poiType, FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType, - FOURS_ACCIDENT_03.poiType, FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> "交通事故" - FOURS_BLOCK_UP.poiType -> "拥堵" - FOURS_ROAD_WORK.poiType -> "施工" - AI_ROAD_WORK.poiType -> "施工" - FOURS_PONDING.poiType -> "道路积水" - else -> "实时路况" - } - } - @JvmStatic fun getUpdateIconRes(poiType: String?): Int { return when (poiType) { //交通检查 TRAFFIC_CHECK.poiType -> { - R.drawable.v_to_x_marker_2 + R.drawable.v2x_icon_jiaotongjiancha_vr } //封路 ROAD_CLOSED.poiType -> { - R.drawable.v_to_x_marker_16 + R.drawable.v2x_icon_fenglu_vr } //施工 FOURS_ROAD_WORK.poiType -> { - R.drawable.v_to_x_marker_11 - } - //AI施工 - AI_ROAD_WORK.poiType -> { - R.drawable.v_to_x_marker_11 + R.drawable.icon_warning_v2x_road_construction } + TYPE_SOCKET_ROAD_SHIGONG.poiType -> R.drawable.icon_warning_v2x_road_construction + TYPE_SOCKET_ROAD_JINGZHI.poiType -> R.drawable.v2x_icon_jingzhi_zhangai + TYPE_SOCKET_ROAD_SHIGU.poiType -> R.drawable.v2x_icon_shigu_sanjiaopai + TYPE_SOCKET_ROAD_CONGESTION.poiType -> R.drawable.v2x_icon_yongdu_vr //拥堵 FOURS_BLOCK_UP.poiType -> { - R.drawable.v_to_x_marker_5 + R.drawable.icon_warning_v2x_congestion } //积水 FOURS_PONDING.poiType -> { - R.drawable.v_to_x_marker_6 + R.drawable.v2x_icon_jishui_vr } //浓雾 FOURS_FOG.poiType -> { - R.drawable.v_to_x_marker_9 + R.drawable.v2x_icon_nongwu_vr } //结冰 FOURS_ICE.poiType -> { - R.drawable.v_to_x_marker_8 + R.drawable.v2x_icon_jiebing_vr } //事故 FOURS_ACCIDENT.poiType -> { - R.drawable.v_to_x_marker_7 + R.drawable.v2x_icon_jiaotongshigu_vr + } + //重大事故 + FOURS_ACCIDENT_01.poiType -> { + R.drawable.v2x_icon_jiaotongshigu_vr + } + //特大事故 + FOURS_ACCIDENT_02.poiType -> { + R.drawable.v2x_icon_jiaotongshigu_vr + } + //较大事故 + FOURS_ACCIDENT_03.poiType -> { + R.drawable.v2x_icon_jiaotongshigu_vr + } + //一般事故 + FOURS_ACCIDENT_04.poiType -> { + R.drawable.v2x_icon_jiaotongshigu_vr + } + //轻微事故 + FOURS_ACCIDENT_05.poiType -> { + R.drawable.v2x_icon_jiaotongshigu_vr } //事故 FOURS_LIVING.poiType -> { @@ -805,16 +771,38 @@ enum class EventTypeEnumNew( ALERT_CAR_TROUBLE_WARNING.poiType -> { R.drawable.icon_car_red } - - //闯红灯预警 - TYPE_USECASE_ID_IVP_RED.poiType -> { - R.drawable.icon_warning_v2x_traffic_lights_red + //VIP车辆优先通行,已为您变为绿灯 + TYPE_VIP_IDENTIFICATION_PASS.poiType -> { + R.drawable.icon_warning_v2x_vip_turn_light + } + //VIP车辆优先通行,已为您延长绿灯 + TYPE_VIP_IDENTIFICATION_EXTEND.poiType -> { + R.drawable.icon_warning_v2x_vip_turn_light + } + //VIP变灯请求失败 + TYPE_VIP_ERROR_IDENTIFICATION.poiType -> { + R.drawable.icon_warning_v2x_vip_turn_light + } + //最优路线 + TYPE_OPTIMAL_ROUTE_RECOMMEND.poiType -> { + R.drawable.icon_warning_v2x_optimal_route } //绿波通行 TYPE_USECASE_ID_IVP_GREEN.poiType -> { R.drawable.icon_warning_v2x_traffic_lights_green } - + //闯红灯预警 + TYPE_USECASE_ID_IVP_RED.poiType -> { + R.drawable.icon_warning_v2x_traffic_lights_red + } + //鬼探头类型 + GHOST_PROBE.poiType -> { + R.drawable.icon_warning_v2x_pedestrian_crossing + } + //接管 + TAKE_OVER_EVENT.poiType -> { + R.drawable.icon_warning_take_over + } //机动车 TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES.poiType -> { R.drawable.icon_warning_v2x_motorcycle_collision @@ -872,7 +860,7 @@ enum class EventTypeEnumNew( return when (poiType) { TYPE_USECASE_ID_EBW.poiType -> TYPE_USECASE_ID_EBW.poiTypeSrcVr TYPE_USECASE_ID_FCW.poiType -> TYPE_USECASE_ID_FCW.poiTypeSrcVr -// TYPE_USECASE_ID_ICW.poiType -> TYPE_USECASE_ID_ICW.poiTypeSrcVr + TYPE_USECASE_ID_ICW.poiType -> TYPE_USECASE_ID_ICW.poiTypeSrcVr TYPE_USECASE_ID_CLW.poiType -> TYPE_USECASE_ID_CLW.poiTypeSrcVr TYPE_USECASE_ID_DNPW.poiType -> TYPE_USECASE_ID_DNPW.poiTypeSrcVr TYPE_USECASE_ID_AVW.poiType -> TYPE_USECASE_ID_AVW.poiTypeSrcVr @@ -880,11 +868,15 @@ enum class EventTypeEnumNew( TYPE_USECASE_ID_LCW.poiType -> TYPE_USECASE_ID_LCW.poiTypeSrcVr TYPE_USECASE_ID_EVW.poiType -> TYPE_USECASE_ID_EVW.poiTypeSrcVr TYPE_USECASE_ID_LTA.poiType -> TYPE_USECASE_ID_LTA.poiTypeSrcVr - TYPE_VIP_IDENTIFICATION.poiType -> TYPE_VIP_IDENTIFICATION.poiTypeSrcVr + TYPE_VIP_IDENTIFICATION_PASS.poiType -> TYPE_VIP_IDENTIFICATION_PASS.poiTypeSrcVr + TYPE_VIP_IDENTIFICATION_EXTEND.poiType -> TYPE_VIP_IDENTIFICATION_EXTEND.poiTypeSrcVr TYPE_ERROR.poiType -> TYPE_ERROR.poiTypeSrcVr TYPE_OPTIMAL_ROUTE_RECOMMEND.poiType -> TYPE_OPTIMAL_ROUTE_RECOMMEND.poiTypeSrcVr GHOST_PROBE.poiType -> GHOST_PROBE.poiTypeSrcVr - AI_ROAD_WORK.poiType -> AI_ROAD_WORK.poiTypeSrcVr + TYPE_SOCKET_ROAD_SHIGONG.poiType -> TYPE_SOCKET_ROAD_SHIGONG.poiTypeSrcVr + TYPE_SOCKET_ROAD_JINGZHI.poiType -> TYPE_SOCKET_ROAD_JINGZHI.poiTypeSrcVr + TYPE_SOCKET_ROAD_SHIGU.poiType -> TYPE_SOCKET_ROAD_SHIGU.poiTypeSrcVr + TYPE_SOCKET_ROAD_CONGESTION.poiType -> TYPE_SOCKET_ROAD_CONGESTION.poiTypeSrcVr TYPE_USECASE_ID_IVP_RED.poiType -> TYPE_USECASE_ID_IVP_RED.poiTypeSrcVr TYPE_USECASE_ID_IVP_GREEN.poiType -> TYPE_USECASE_ID_IVP_GREEN.poiTypeSrcVr @@ -933,7 +925,7 @@ enum class EventTypeEnumNew( return when (poiType) { TYPE_USECASE_ID_EBW.poiType -> TYPE_USECASE_ID_EBW.content TYPE_USECASE_ID_FCW.poiType -> TYPE_USECASE_ID_FCW.content -// TYPE_USECASE_ID_ICW.poiType -> TYPE_USECASE_ID_ICW.content + TYPE_USECASE_ID_ICW.poiType -> TYPE_USECASE_ID_ICW.content TYPE_USECASE_ID_CLW.poiType -> TYPE_USECASE_ID_CLW.content TYPE_USECASE_ID_DNPW.poiType -> TYPE_USECASE_ID_DNPW.content TYPE_USECASE_ID_AVW.poiType -> TYPE_USECASE_ID_AVW.content @@ -941,9 +933,13 @@ enum class EventTypeEnumNew( TYPE_USECASE_ID_LCW.poiType -> TYPE_USECASE_ID_LCW.content TYPE_USECASE_ID_EVW.poiType -> TYPE_USECASE_ID_EVW.content TYPE_USECASE_ID_LTA.poiType -> TYPE_USECASE_ID_LTA.content - TYPE_VIP_IDENTIFICATION.poiType -> TYPE_VIP_IDENTIFICATION.content + TYPE_VIP_IDENTIFICATION_PASS.poiType -> TYPE_VIP_IDENTIFICATION_PASS.content + TYPE_VIP_IDENTIFICATION_EXTEND.poiType -> TYPE_VIP_IDENTIFICATION_EXTEND.content FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.content - AI_ROAD_WORK.poiType -> AI_ROAD_WORK.content + TYPE_SOCKET_ROAD_SHIGONG.poiType -> TYPE_SOCKET_ROAD_SHIGONG.content + TYPE_SOCKET_ROAD_JINGZHI.poiType -> TYPE_SOCKET_ROAD_JINGZHI.content + TYPE_SOCKET_ROAD_SHIGU.poiType -> TYPE_SOCKET_ROAD_SHIGU.content + TYPE_SOCKET_ROAD_CONGESTION.poiType -> TYPE_SOCKET_ROAD_CONGESTION.content TYPE_ERROR.poiType -> TYPE_ERROR.content TYPE_OPTIMAL_ROUTE_RECOMMEND.poiType -> TYPE_OPTIMAL_ROUTE_RECOMMEND.content GHOST_PROBE.poiType -> GHOST_PROBE.content @@ -996,7 +992,7 @@ enum class EventTypeEnumNew( return when (poiType) { TYPE_USECASE_ID_EBW.poiType -> TYPE_USECASE_ID_EBW.tts TYPE_USECASE_ID_FCW.poiType -> TYPE_USECASE_ID_FCW.tts -// TYPE_USECASE_ID_ICW.poiType -> TYPE_USECASE_ID_ICW.tts + TYPE_USECASE_ID_ICW.poiType -> TYPE_USECASE_ID_ICW.tts TYPE_USECASE_ID_CLW.poiType -> TYPE_USECASE_ID_CLW.tts TYPE_USECASE_ID_DNPW.poiType -> TYPE_USECASE_ID_DNPW.tts TYPE_USECASE_ID_AVW.poiType -> TYPE_USECASE_ID_AVW.tts @@ -1004,9 +1000,13 @@ enum class EventTypeEnumNew( TYPE_USECASE_ID_LCW.poiType -> TYPE_USECASE_ID_LCW.tts TYPE_USECASE_ID_EVW.poiType -> TYPE_USECASE_ID_EVW.tts TYPE_USECASE_ID_LTA.poiType -> TYPE_USECASE_ID_LTA.tts - TYPE_VIP_IDENTIFICATION.poiType -> TYPE_VIP_IDENTIFICATION.tts + TYPE_VIP_IDENTIFICATION_PASS.poiType -> TYPE_VIP_IDENTIFICATION_PASS.tts + TYPE_VIP_IDENTIFICATION_EXTEND.poiType -> TYPE_VIP_IDENTIFICATION_EXTEND.tts FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.tts - AI_ROAD_WORK.poiType -> AI_ROAD_WORK.tts + TYPE_SOCKET_ROAD_SHIGONG.poiType -> TYPE_SOCKET_ROAD_SHIGONG.tts + TYPE_SOCKET_ROAD_JINGZHI.poiType -> TYPE_SOCKET_ROAD_JINGZHI.tts + TYPE_SOCKET_ROAD_SHIGU.poiType -> TYPE_SOCKET_ROAD_SHIGU.tts + TYPE_SOCKET_ROAD_CONGESTION.poiType -> TYPE_SOCKET_ROAD_CONGESTION.tts TYPE_ERROR.poiType -> TYPE_ERROR.tts TYPE_OPTIMAL_ROUTE_RECOMMEND.poiType -> TYPE_OPTIMAL_ROUTE_RECOMMEND.tts GHOST_PROBE.poiType -> GHOST_PROBE.tts @@ -1053,6 +1053,16 @@ enum class EventTypeEnumNew( else -> TYPE_ERROR.tts } } - } + @JvmStatic + fun isCloudSocketEvent(poiType: String?): Boolean { + return when(poiType) { + TYPE_SOCKET_ROAD_SHIGONG.poiType, + TYPE_SOCKET_ROAD_JINGZHI.poiType, + TYPE_SOCKET_ROAD_SHIGU.poiType, + TYPE_SOCKET_ROAD_CONGESTION.poiType -> true + else -> false + } + } + } } \ No newline at end of file diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeHelper.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeHelper.kt index 8f8cd1ff35..b1da3cc519 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeHelper.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeHelper.kt @@ -29,20 +29,20 @@ class EventTypeHelper { when { direction.isLeft() -> { data.invoke( - EventTypeEnum.getWarningContent(appId.toString() + "左"), - EventTypeEnum.getWarningTts(appId.toString() + "左") + EventTypeEnumNew.getWarningContent(appId.toString() + "左"), + EventTypeEnumNew.getWarningTts(appId.toString() + "左") ) } direction.isRight() -> { data.invoke( - EventTypeEnum.getWarningContent(appId.toString() + "右"), - EventTypeEnum.getWarningTts(appId.toString() + "右") + EventTypeEnumNew.getWarningContent(appId.toString() + "右"), + EventTypeEnumNew.getWarningTts(appId.toString() + "右") ) } else -> { data.invoke( - EventTypeEnum.getWarningContent(appId.toString()), - EventTypeEnum.getWarningTts(appId.toString()) + EventTypeEnumNew.getWarningContent(appId.toString()), + EventTypeEnumNew.getWarningTts(appId.toString()) ) } } @@ -56,8 +56,8 @@ class EventTypeHelper { data: ((alert: String, tts: String) -> Unit) ) { data.invoke( - EventTypeEnum.getWarningContent(appId.toString() + direction.desc), - EventTypeEnum.getWarningContent(appId.toString() + direction.desc) + EventTypeEnumNew.getWarningContent(appId.toString() + direction.desc), + EventTypeEnumNew.getWarningContent(appId.toString() + direction.desc) ) } @@ -65,8 +65,8 @@ class EventTypeHelper { @BizConfig(V2V, "", BIZ_LTA) fun getLTA(appId: Int, data: ((alert: String, tts: String) -> Unit)) { data.invoke( - EventTypeEnum.getWarningContent(appId.toString()), - EventTypeEnum.getWarningTts(appId.toString()) + EventTypeEnumNew.getWarningContent(appId.toString()), + EventTypeEnumNew.getWarningTts(appId.toString()) ) } @@ -78,8 +78,8 @@ class EventTypeHelper { data: ((alert: String, tts: String) -> Unit) ) { data.invoke( - EventTypeEnum.getWarningContent(appId.toString() + direction.desc), - EventTypeEnum.getWarningTts(appId.toString() + direction.desc) + EventTypeEnumNew.getWarningContent(appId.toString() + direction.desc), + EventTypeEnumNew.getWarningTts(appId.toString() + direction.desc) ) } @@ -93,22 +93,22 @@ class EventTypeHelper { when { direction.isLeft() -> { data.invoke( - EventTypeEnum.getWarningContent(appId.toString() + "左"), - EventTypeEnum.getWarningTts(appId.toString() + "左"), + EventTypeEnumNew.getWarningContent(appId.toString() + "左"), + EventTypeEnumNew.getWarningTts(appId.toString() + "左"), true ) } direction.isRight() -> { data.invoke( - EventTypeEnum.getWarningContent(appId.toString() + "右"), - EventTypeEnum.getWarningTts(appId.toString() + "右"), + EventTypeEnumNew.getWarningContent(appId.toString() + "右"), + EventTypeEnumNew.getWarningTts(appId.toString() + "右"), true ) } else -> { data.invoke( - EventTypeEnum.getWarningContent(appId.toString()), - EventTypeEnum.getWarningTts(appId.toString()), + EventTypeEnumNew.getWarningContent(appId.toString()), + EventTypeEnumNew.getWarningTts(appId.toString()), false ) } @@ -119,9 +119,9 @@ class EventTypeHelper { @BizConfig(V2N, "", BIZ_VRU) fun getVRU(data: ((appId: Int, tts: String, content: String) -> Unit)) { data.invoke( - EventTypeEnum.TYPE_USECASE_ID_VRUCW_PERSON.poiType.toInt(), - EventTypeEnum.TYPE_USECASE_ID_VRUCW_PERSON.tts, - EventTypeEnum.TYPE_USECASE_ID_VRUCW_PERSON.content + EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_PERSON.poiType.toInt(), + EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_PERSON.tts, + EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_PERSON.content ) } @@ -129,7 +129,7 @@ class EventTypeHelper { @BizConfig(V2N, "", BIZ_VRU_RI) fun getVRURI(data: ((appId: Int, tts: String, content: String) -> Unit)) { data.invoke( - EventTypeEnum.TYPE_USECASE_ID_VRUCW_PERSON.poiType.toInt(), + EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_PERSON.poiType.toInt(), "行人逆行预警", "行人逆行预警" ) @@ -139,18 +139,18 @@ class EventTypeHelper { @BizConfig(V2N, "", BIZ_OPT_LINE) fun getOptLine(data: ((appId: Int, tts: String, content: String) -> Unit)) { data.invoke( - EventTypeEnum.TYPE_USECASE_OPTIMAL_LANE.poiType.toInt(), - EventTypeEnum.TYPE_USECASE_OPTIMAL_LANE.tts, - EventTypeEnum.TYPE_USECASE_OPTIMAL_LANE.content + EventTypeEnumNew.TYPE_USECASE_OPTIMAL_LANE.poiType.toInt(), + EventTypeEnumNew.TYPE_USECASE_OPTIMAL_LANE.tts, + EventTypeEnumNew.TYPE_USECASE_OPTIMAL_LANE.content ) } //前方道路拥堵预警 fun getTJW(data: ((appId: Int, tts: String, content: String) -> Unit)) { data.invoke( - EventTypeEnum.FOURS_BLOCK_UP.poiType.toInt(), - EventTypeEnum.FOURS_BLOCK_UP.tts, - EventTypeEnum.FOURS_BLOCK_UP.content + EventTypeEnumNew.FOURS_BLOCK_UP.poiType.toInt(), + EventTypeEnumNew.FOURS_BLOCK_UP.tts, + EventTypeEnumNew.FOURS_BLOCK_UP.content ) } @@ -158,8 +158,8 @@ class EventTypeHelper { @BizConfig(V2V, "", BIZ_EBW) fun getEBW(appId: Int, data: ((tts: String, content: String) -> Unit)) { data.invoke( - EventTypeEnum.getWarningContent(appId.toString()), - EventTypeEnum.getWarningTts(appId.toString()) + EventTypeEnumNew.getWarningContent(appId.toString()), + EventTypeEnumNew.getWarningTts(appId.toString()) ) } @@ -167,8 +167,8 @@ class EventTypeHelper { @BizConfig(V2V, "", BIZ_FCW) fun getFCW(appId: Int, data: ((tts: String, content: String) -> Unit)) { data.invoke( - EventTypeEnum.getWarningContent(appId.toString()), - EventTypeEnum.getWarningTts(appId.toString()) + EventTypeEnumNew.getWarningContent(appId.toString()), + EventTypeEnumNew.getWarningTts(appId.toString()) ) } @@ -176,8 +176,8 @@ class EventTypeHelper { @BizConfig(V2V, "", BIZ_DNPW) fun getDNPW(appId: Int, data: ((tts: String, content: String) -> Unit)) { data.invoke( - EventTypeEnum.getWarningContent(appId.toString()), - EventTypeEnum.getWarningTts(appId.toString()) + EventTypeEnumNew.getWarningContent(appId.toString()), + EventTypeEnumNew.getWarningTts(appId.toString()) ) } diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/V2XRoadEventEntity.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/V2XRoadEventEntity.java index eea9b6b93e..4e1ae694ce 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/V2XRoadEventEntity.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/V2XRoadEventEntity.java @@ -1,9 +1,7 @@ package com.mogo.eagle.core.data.map.entity; import android.text.TextUtils; - - -import com.mogo.eagle.core.data.enums.EventTypeEnum; +import com.mogo.eagle.core.data.enums.EventTypeEnumNew; import java.io.Serializable; import java.util.Objects; @@ -37,6 +35,7 @@ public class V2XRoadEventEntity implements Serializable { // 绑定 MarkerView 的数据, 业务需要啥数据就传入啥数据 private Object bindObj; + public MarkerLocation getLocation() { return location; } @@ -57,12 +56,12 @@ public class V2XRoadEventEntity implements Serializable { } public String getTts(boolean haveLiveCar) { - if (EventTypeEnum.GHOST_PROBE.getPoiType().equals(poiType)) { - tts = EventTypeEnum.GHOST_PROBE.getTts(); + if (EventTypeEnumNew.GHOST_PROBE.getPoiType().equals(poiType)) { + tts = EventTypeEnumNew.GHOST_PROBE.getTts(); return tts; } tts = "前方#" + (int) getDistance() + "米#"; - tts += EventTypeEnum.getTts(getPoiType()); + tts += EventTypeEnumNew.getTts(getPoiType()); if (haveLiveCar) { tts += ",查看实况请说确定。"; setShowEventButton(true); @@ -73,18 +72,8 @@ public class V2XRoadEventEntity implements Serializable { return tts; } - /** - * 检测到附近#道路施工#,确认该信息是否正确?您可以说“正确”或“错误”帮助其他车友。 - */ - public String getTtsWithFeedback() { - tts = "检测到附近"; - tts += EventTypeEnum.getTtsWithFeedback(getPoiType()); - tts += ",确认该信息是否正确?您可以说“正确”或“错误”帮助其他车友。"; - return tts; - } - public String getTts() { - return tts; + return EventTypeEnumNew.getTts(getPoiType()); } public void setTts(String tts) { @@ -100,7 +89,7 @@ public class V2XRoadEventEntity implements Serializable { } public String getAlarmContent() { - alarmContent = EventTypeEnum.getAlarmContent(getPoiType()); + alarmContent = EventTypeEnumNew.getAlarmContent(getPoiType()); return alarmContent; } diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/DataSourceType.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/DataSourceType.kt new file mode 100644 index 0000000000..af15d0b8a7 --- /dev/null +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/DataSourceType.kt @@ -0,0 +1,9 @@ +package com.mogo.eagle.core.data.msgbox + +enum class DataSourceType { + DEFAULT, + OBU, + TELEMATIC, + AICLOUD, + SUMMARY// V2X事件汇总 +} \ No newline at end of file diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/MsgBoxBean.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/MsgBoxBean.kt index 7a08d71212..9c370be85d 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/MsgBoxBean.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/MsgBoxBean.kt @@ -3,4 +3,5 @@ package com.mogo.eagle.core.data.msgbox data class MsgBoxBean(val type: MsgBoxType, val bean: Any) { var timestamp: Long = 0 var bean2Json: String = "" + var sourceType: DataSourceType = DataSourceType.DEFAULT } diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/view/IViewLimitingVelocity.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/view/IViewLimitingVelocity.kt index aef782d2d6..3d566205ef 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/view/IViewLimitingVelocity.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/view/IViewLimitingVelocity.kt @@ -14,5 +14,5 @@ abstract class IViewLimitingVelocity(context: Context?, attrs: AttributeSet?, de * 更新限速数据 * @param limitingSpeed 限速值,单位:km/h */ - open fun updateLimitingSpeed(limitingSpeed: Int) {} + open fun updateLimitingSpeed(limitingSpeed: Int, limitSource: Int) {} } \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/view/IViewTrafficLight.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/view/IViewTrafficLight.kt index 42bebf7c4c..54fe8e8e87 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/view/IViewTrafficLight.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/view/IViewTrafficLight.kt @@ -14,7 +14,7 @@ abstract class IViewTrafficLight(context: Context?, attrs: AttributeSet?, defSty * 展示红绿灯预警 * * @param checkLightId 0-都是默认,1-红,2-黄,3-绿 - * @param lightSource 1:云端下发;2:自车感知 + * @param lightSource 1:云端下发;2:自车感知;3:OBU */ open fun showWarningTrafficLight(checkLightId: Int,lightSource: Int) {} diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoWaringProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoWaringProvider.kt index c56983d24c..6927c467f3 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoWaringProvider.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoWaringProvider.kt @@ -114,7 +114,7 @@ interface IMoGoWaringProvider : IMoGoHmiViewProxy { * 展示红绿灯预警 * * @param checkLightId 0-都是默认,1-红,2-黄,3-绿 - * @param lightSource 1:云端下发;2:自车感知 + * @param lightSource 1:云端下发;2:自车感知;3:OBU */ fun showWarningTrafficLight(checkLightId: Int,lightSource: Int) @@ -159,8 +159,9 @@ interface IMoGoWaringProvider : IMoGoHmiViewProxy { * 展示限速预警 * * @param limitingSpeed 限速速度 + * @param limitSpeedSource 限速来源 1:MAP, 2:RSU */ - fun showLimitingVelocity(limitingSpeed: Int) + fun showLimitingVelocity(limitingSpeed: Int, limitSpeedSource: Int) /** * 关闭限速预警 diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/marker/IMoGoIdentifyListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/marker/IMoGoIdentifyListener.kt new file mode 100644 index 0000000000..ad40f975f0 --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/marker/IMoGoIdentifyListener.kt @@ -0,0 +1,10 @@ +package com.mogo.eagle.core.function.api.map.marker + +import com.alibaba.android.arouter.facade.template.IProvider +import mogo.telematics.pad.MessagePad + +interface IMoGoIdentifyListener :IProvider{ + + fun getIdentifyObj(uuid: String): MessagePad.TrackedObject? + +} \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/msgbox/IMsgBoxEventListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/msgbox/IMsgBoxEventListener.kt new file mode 100644 index 0000000000..cebfca9d9b --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/msgbox/IMsgBoxEventListener.kt @@ -0,0 +1,9 @@ +package com.mogo.eagle.core.function.api.msgbox +/** + * @author XuXinChao + * @date 2023/1/16 + * 消息盒子事件监听回调 + */ +interface IMsgBoxEventListener { + fun onSummaryClickEvent() +} \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuTrafficLightListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuTrafficLightListener.kt new file mode 100644 index 0000000000..1b4be4e95c --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuTrafficLightListener.kt @@ -0,0 +1,15 @@ +package com.mogo.eagle.core.function.api.obu + + +/** + * @author lixiaopeng + * @date 2022/1/30 10:28 下午 + * OBU 灯态信息 + */ +interface IMoGoObuTrafficLightListener { + /** + * @param light 灯的信息 + */ + fun onObuTrafficLight(light: Int){} + +} \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obucombine/IMoGoObuDcCombineListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obucombine/IMoGoObuDcCombineListener.kt new file mode 100644 index 0000000000..942102318c --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obucombine/IMoGoObuDcCombineListener.kt @@ -0,0 +1,17 @@ +package com.mogo.eagle.core.function.api.obucombine + +import mogo.v2x.ObuWarningEvent + +/** + * obu和dc 通道打通融合 + */ +interface IMoGoObuDcCombineListener { + + /** + * obu透传v2i数据,(标牌,弱势交通,红绿灯,限速,道路危险状况) + * @param obuWarningData + */ + fun onMoGoObuDcCombineData(obuWarningData: ObuWarningEvent.ObuWarningData?) + + + } \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/IV2XEventProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/IV2XEventProvider.kt new file mode 100644 index 0000000000..629ed5938d --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/IV2XEventProvider.kt @@ -0,0 +1,7 @@ +package com.mogo.eagle.core.function.api.v2x + +import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider + +interface IV2XEventProvider: IMoGoFunctionServerProvider { + fun queryWholeRoadEvents() +} \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/ObuLimitingSpeedListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/ObuLimitingSpeedListener.kt new file mode 100644 index 0000000000..1fb84cdeaa --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/ObuLimitingSpeedListener.kt @@ -0,0 +1,8 @@ +package com.mogo.eagle.core.function.api.v2x + +/** + * 限速信息 + */ +interface ObuLimitingSpeedListener { + fun onObuLimitingSpeedChange(limitingSpeed: Int) +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiManager.kt index 93429c52c0..e256ba1691 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiManager.kt @@ -1,5 +1,6 @@ package com.mogo.eagle.core.function.call.hmi +import android.util.Log import android.view.View import android.view.ViewGroup import com.alibaba.android.arouter.launcher.ARouter @@ -184,7 +185,7 @@ object CallerHmiManager : CallerBase() { * 展示红绿灯预警 * * @param checkLightId 0-都是默认,1-红,2-黄,3-绿 - * @param lightSource 1:云端下发;2:自车感知 + * @param lightSource 1:云端下发;2:自车感知;3:OBU */ fun showWarningTrafficLight(checkLightId: Int, lightSource: Int) { waringProviderApi?.showWarningTrafficLight(checkLightId, lightSource) @@ -245,10 +246,11 @@ object CallerHmiManager : CallerBase() { * 展示限速预警 * * @param limitingSpeed 限速速度 + * @param limitSpeedSource 限速来源 1:MAP, 2:RSU */ @BizConfig(V2I, "", BIZ_SLW) - fun showLimitingVelocity(limitingSpeed: Int) { - waringProviderApi?.showLimitingVelocity(limitingSpeed) + fun showLimitingVelocity(limitingSpeed: Int, limitSpeedSource: Int) { + waringProviderApi?.showLimitingVelocity(limitingSpeed, limitSpeedSource) } /** diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapIdentifyManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapIdentifyManager.kt new file mode 100644 index 0000000000..2064246a9c --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapIdentifyManager.kt @@ -0,0 +1,19 @@ +package com.mogo.eagle.core.function.call.map + +import com.alibaba.android.arouter.launcher.ARouter +import com.mogo.eagle.core.data.constants.MogoServicePaths.PATH_IDENTIFY +import com.mogo.eagle.core.function.api.map.marker.IMoGoIdentifyListener +import com.mogo.eagle.core.function.call.base.CallerBase +import mogo.telematics.pad.MessagePad + +object CallerMapIdentifyManager : CallerBase() { + + private val identifyApi: IMoGoIdentifyListener + get() = ARouter.getInstance().build(PATH_IDENTIFY) + .navigation() as IMoGoIdentifyListener + + fun getIdentifyObj(uuid: String): MessagePad.TrackedObject? { + return identifyApi.getIdentifyObj(uuid) + } + +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerSmpManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerSmpManager.kt index b910a61e25..9d2b6a3222 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerSmpManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerSmpManager.kt @@ -3,8 +3,10 @@ package com.mogo.eagle.core.function.call.map import android.os.Looper import com.alibaba.android.arouter.launcher.ARouter import com.mogo.eagle.core.data.constants.MoGoFragmentPaths +import com.mogo.eagle.core.data.constants.MogoServicePaths import com.mogo.eagle.core.data.map.MogoLatLng import com.mogo.eagle.core.function.api.map.smp.IMogoSmallMapProvider +import com.mogo.eagle.core.function.api.v2x.IV2XEventProvider import com.mogo.eagle.core.function.call.base.CallerBase import com.mogo.eagle.core.utilcode.util.UiThreadHandler @@ -22,6 +24,10 @@ object CallerSmpManager : CallerBase() { get() = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_OVERVIEW) .navigation() as IMogoSmallMapProvider + private val v2xProvider: IV2XEventProvider + get() = ARouter.getInstance().build(MogoServicePaths.PATH_V2X_MODULE) + .navigation() as IV2XEventProvider + /** * 绘制路径线 */ @@ -58,9 +64,11 @@ object CallerSmpManager : CallerBase() { fun startQueryV2XEvents() { if (Thread.currentThread() !== Looper.getMainLooper().thread) { UiThreadHandler.post { + v2xProvider.queryWholeRoadEvents() mogoOverViewMapProvider.startQueryV2XEvents() } } else { + v2xProvider.queryWholeRoadEvents() mogoOverViewMapProvider.startQueryV2XEvents() } } diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerVisualAngleManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerVisualAngleManager.kt index c01e0b89d7..a3c5cd7144 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerVisualAngleManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerVisualAngleManager.kt @@ -242,11 +242,20 @@ object CallerVisualAngleManager { PriorityQueue() } + private var mLevel:Boolean = false + + fun updateLongSightLevel(level:Boolean){ + mLevel = level + } + fun changeVisualAngle(current: Scene) { val appIdentityMode = FunctionBuildConfig.appIdentityMode if (AppIdentityModeUtils.isBus(appIdentityMode) && AppIdentityModeUtils.isPassenger(appIdentityMode)) { return } + if(mLevel){ + return + } val triggerTime = SystemClock.elapsedRealtime() scope.launch { Log.d("${M_DEVA}${TAG}", "--- 1 ---") @@ -301,9 +310,12 @@ object CallerVisualAngleManager { return@launch } } - + if (prev.priority == current.priority) { + Log.d("${M_DEVA}${TAG}", "--- 9 --- 场景[$prev]正在展示,尚未收到关闭,优先级一致,直接return") + return@launch + } if (prev.priority > current.priority && prev.displayThreshold < 0) { - Log.d("${M_DEVA}${TAG}", "--- 6 --- 场景[$prev]正在展示,尚未收到关闭,场景,依然展示当前场景,直接return") + Log.d("${M_DEVA}${TAG}", "--- 10 --- 场景[$prev]正在展示,尚未收到关闭,场景,依然展示当前场景,直接return") return@launch } doRealVisualAngleChange(triggerTime, current, displayed) diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/msgbox/CallerMsgBoxEventListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/msgbox/CallerMsgBoxEventListenerManager.kt new file mode 100644 index 0000000000..3696e0f471 --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/msgbox/CallerMsgBoxEventListenerManager.kt @@ -0,0 +1,70 @@ +package com.mogo.eagle.core.function.call.msgbox + +import androidx.annotation.Nullable +import com.mogo.eagle.core.function.api.msgbox.IMsgBoxEventListener +import com.mogo.eagle.core.function.call.base.CallerBase +import java.util.concurrent.ConcurrentHashMap + +/** + * @author XuXinChao + * @date 2023/1/16 + * 消息盒子事件监听管理 + */ +object CallerMsgBoxEventListenerManager: CallerBase() { + + private val statusListeners: ConcurrentHashMap = + ConcurrentHashMap() + + /** + * 添加数据监听 + * @param tag 标记,用来注销监听使用 + * @param listener 监听回调 + */ + fun addListener(@Nullable tag: String,@Nullable listener: IMsgBoxEventListener){ + if (statusListeners.containsKey(tag)) { + return + } + statusListeners[tag] = listener + } + + /** + * 删除状态监听 + * @param tag 标记,用来注销监听使用 + */ + fun removeListener(@Nullable tag: String) { + if (!statusListeners.containsKey(tag)) { + return + } + statusListeners.remove(tag) + } + + /** + * 删除状态监听 + * @param listener 要删除的监听对象 + */ + fun removeListener(@Nullable listener: IMsgBoxEventListener){ + if (!statusListeners.containsValue(listener)) { + return + } + var tag = "" + statusListeners.forEach { + if (it.value == listener) { + tag = it.key + statusListeners.remove(it.key) + } + } + } + + /** + * 触发监听 + */ + fun invokeListener(){ + statusListeners.forEach { + val tag = it.key + val listener = it.value + listener.onSummaryClickEvent() + } + } + + +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/msgbox/CallerMsgBoxManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/msgbox/CallerMsgBoxManager.kt index ba2b039546..68431d877c 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/msgbox/CallerMsgBoxManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/msgbox/CallerMsgBoxManager.kt @@ -1,6 +1,7 @@ package com.mogo.eagle.core.function.call.msgbox import android.content.Context +import android.util.Log import com.mogo.eagle.core.data.constants.MogoServicePaths import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.function.api.msgbox.IMsgBoxProvider diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuTrafficLightListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuTrafficLightListenerManager.kt new file mode 100644 index 0000000000..a53d5b350e --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuTrafficLightListenerManager.kt @@ -0,0 +1,64 @@ +package com.mogo.eagle.core.function.call.obu + +import com.mogo.eagle.core.function.api.obu.IMoGoObuTrafficLightListener +import java.util.concurrent.ConcurrentHashMap + +object CallerObuTrafficLightListenerManager { + + private val M_OBU_TRAFFIC_LIGHT_LISTENER: ConcurrentHashMap = + ConcurrentHashMap() + + var mLight: Int = 0 + + /** + * 添加监听 + * @param tag 标记,用来注销监听使用 + * @param listener 监听回调 + */ + fun registerObuTrafficLightListener( + tag: String, + listener: IMoGoObuTrafficLightListener + ) { + if (M_OBU_TRAFFIC_LIGHT_LISTENER.containsKey(tag)) { + return + } + listener.onObuTrafficLight(mLight) + M_OBU_TRAFFIC_LIGHT_LISTENER[tag] = listener + } + + /** + * 删除监听 + * @param tag 标记,用来注销监听使用 + */ + fun unRegisterObuTrafficLightListener(tag: String) { + if (!M_OBU_TRAFFIC_LIGHT_LISTENER.containsKey(tag)) { + return + } + M_OBU_TRAFFIC_LIGHT_LISTENER.remove(tag) + } + + /** + * 删除监听 + * @param listener 要删除的监听对象 + */ + fun unRegisterObuTrafficLightListener(listener: IMoGoObuTrafficLightListener) { + if (!M_OBU_TRAFFIC_LIGHT_LISTENER.containsValue(listener)) { + return + } + M_OBU_TRAFFIC_LIGHT_LISTENER.forEach { + if (it.value == listener) { + M_OBU_TRAFFIC_LIGHT_LISTENER.remove(it.key) + } + } + } + + fun invokeObuTrafficLight(light: Int) { + this.mLight = light + M_OBU_TRAFFIC_LIGHT_LISTENER.forEach { + val tag = it.key + val listener = it.value + listener.onObuTrafficLight(light) + } + } + +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obucombine/CallerObuDcCombineListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obucombine/CallerObuDcCombineListenerManager.kt new file mode 100644 index 0000000000..8e126441f2 --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obucombine/CallerObuDcCombineListenerManager.kt @@ -0,0 +1,65 @@ +package com.mogo.eagle.core.function.call.obucombine + +import androidx.annotation.Nullable +import com.mogo.eagle.core.function.api.obucombine.IMoGoObuDcCombineListener +import com.mogo.eagle.core.function.call.base.CallerBase +import mogo.v2x.ObuWarningEvent +import java.util.concurrent.ConcurrentHashMap + +/** + * obu和dc数据通道 回调监听 + */ +object CallerObuDcCombineListenerManager : CallerBase() { + // 存储所有注册了监听的对象,invokeXXXX进行遍历回调,将信息同步 + private val M_DC_COMBINE_LISTENERS: ConcurrentHashMap = + ConcurrentHashMap() + + /** + * 添加 obu和dc数据通道 监听 + * @param tag 标记,用来注销监听使用 + * @param listener 监听回调 + */ + fun addListener( + @Nullable tag: String, + @Nullable listener: IMoGoObuDcCombineListener + ) { + if (M_DC_COMBINE_LISTENERS.containsKey(tag)) { + return + } + M_DC_COMBINE_LISTENERS[tag] = listener + } + + /** + * 删除监听 + * @param tag 标记,用来注销监听使用 + */ + fun removeListener(@Nullable tag: String) { + if (!M_DC_COMBINE_LISTENERS.containsKey(tag)) { + return + } + M_DC_COMBINE_LISTENERS.remove(tag) + } + + /** + * 删除自动驾驶按钮选中监听 + * @param listener 要删除的监听对象 + */ + fun removeListener(@Nullable listener: IMoGoObuDcCombineListener) { + M_DC_COMBINE_LISTENERS.forEach { + if (it.value == listener) { + M_DC_COMBINE_LISTENERS.remove(it.key) + } + } + } + + /** + * v2i数据 + */ + fun invokeObuDcData(obuWarningData: ObuWarningEvent.ObuWarningData?){ + M_DC_COMBINE_LISTENERS.forEach{ + val listener = it.value + listener.onMoGoObuDcCombineData(obuWarningData) + } + } + +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallObuLimitingSpeedListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallObuLimitingSpeedListenerManager.kt new file mode 100644 index 0000000000..5248f609f3 --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallObuLimitingSpeedListenerManager.kt @@ -0,0 +1,74 @@ +package com.mogo.eagle.core.function.call.v2x + +import androidx.annotation.Nullable +import com.mogo.eagle.core.function.api.v2x.LimitingVelocityListener +import com.mogo.eagle.core.function.api.v2x.ObuLimitingSpeedListener +import com.mogo.eagle.core.utilcode.util.LogUtils +import java.util.concurrent.ConcurrentHashMap + +/** + * 限速信息监听 + */ +object CallObuLimitingSpeedListenerManager { + + private const val TAG = "CallObuLimitingSpeedListenerManager" + private val M_TRAFFIC_LIGHT_LISTENER: ConcurrentHashMap = + ConcurrentHashMap() + private var mObuLimitSpeed = 0 + + /** + * 添加监听 + * @param tag 标记,用来注销监听使用 + * @param listener 监听回调 + */ + fun addListener( + @Nullable tag: String, + @Nullable listener: ObuLimitingSpeedListener + ) { + if (M_TRAFFIC_LIGHT_LISTENER.containsKey(tag)) { + LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag") + return + } + listener.onObuLimitingSpeedChange(mObuLimitSpeed) + M_TRAFFIC_LIGHT_LISTENER[tag] = listener + } + + /** + * 删除监听 + * @param tag 标记,用来注销监听使用 + */ + fun removeListener(@Nullable tag: String) { + if (!M_TRAFFIC_LIGHT_LISTENER.containsKey(tag)) { + LogUtils.eTag(TAG, "Tag:$tag not exists") + return + } + M_TRAFFIC_LIGHT_LISTENER.remove(tag) + } + + /** + * 删除监听 + * @param listener 要删除的监听对象 + */ + fun removeListener(@Nullable listener: ObuLimitingSpeedListener) { + if (!M_TRAFFIC_LIGHT_LISTENER.containsValue(listener)) { + LogUtils.eTag(TAG, "listener:$listener not exists") + return + } + M_TRAFFIC_LIGHT_LISTENER.forEach { + if (it.value == listener) { + M_TRAFFIC_LIGHT_LISTENER.remove(it.key) + } + } + } + + + fun invokeOnObuLimitingSpeedChange(limitingSpeed: Int) { + this.mObuLimitSpeed = limitingSpeed + M_TRAFFIC_LIGHT_LISTENER.forEach { + val tag = it.key + val listener = it.value + listener.onObuLimitingSpeedChange(limitingSpeed) + } + } + +} \ No newline at end of file diff --git a/core/mogo-core-res/src/main/function-hmi-res/drawable-xhdpi/icon_v2x_obstacle.png b/core/mogo-core-res/src/main/function-hmi-res/drawable-xhdpi/icon_v2x_obstacle.png new file mode 100644 index 0000000000..c5e2711db3 Binary files /dev/null and b/core/mogo-core-res/src/main/function-hmi-res/drawable-xhdpi/icon_v2x_obstacle.png differ diff --git a/core/mogo-core-res/src/main/function-hmi-res/drawable-xhdpi/icon_v2x_road_accidents.png b/core/mogo-core-res/src/main/function-hmi-res/drawable-xhdpi/icon_v2x_road_accidents.png new file mode 100644 index 0000000000..10e3accd56 Binary files /dev/null and b/core/mogo-core-res/src/main/function-hmi-res/drawable-xhdpi/icon_v2x_road_accidents.png differ diff --git a/core/mogo-core-res/src/main/function-hmi-res/drawable-xhdpi/icon_v2x_road_congestion.png b/core/mogo-core-res/src/main/function-hmi-res/drawable-xhdpi/icon_v2x_road_congestion.png new file mode 100644 index 0000000000..390ed0bdef Binary files /dev/null and b/core/mogo-core-res/src/main/function-hmi-res/drawable-xhdpi/icon_v2x_road_congestion.png differ diff --git a/core/mogo-core-res/src/main/res/drawable-xhdpi/v2x_icon_jingzhi_zhangai.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/v2x_icon_jingzhi_zhangai.png new file mode 100644 index 0000000000..c5e2711db3 Binary files /dev/null and b/core/mogo-core-res/src/main/res/drawable-xhdpi/v2x_icon_jingzhi_zhangai.png differ diff --git a/core/mogo-core-res/src/main/res/drawable-xhdpi/v2x_icon_shigong_zhandao.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/v2x_icon_shigong_zhandao.png new file mode 100644 index 0000000000..0a21b49728 Binary files /dev/null and b/core/mogo-core-res/src/main/res/drawable-xhdpi/v2x_icon_shigong_zhandao.png differ diff --git a/core/mogo-core-res/src/main/res/drawable-xhdpi/v2x_icon_shigu_sanjiaopai.png b/core/mogo-core-res/src/main/res/drawable-xhdpi/v2x_icon_shigu_sanjiaopai.png new file mode 100644 index 0000000000..10e3accd56 Binary files /dev/null and b/core/mogo-core-res/src/main/res/drawable-xhdpi/v2x_icon_shigu_sanjiaopai.png differ diff --git a/core/mogo-core-res/src/main/res/raw/v2x_shigu_sanjiaopai.nt3d b/core/mogo-core-res/src/main/res/raw/v2x_shigu_sanjiaopai.nt3d new file mode 100644 index 0000000000..79c8df21ad Binary files /dev/null and b/core/mogo-core-res/src/main/res/raw/v2x_shigu_sanjiaopai.nt3d differ diff --git a/core/mogo-core-res/src/main/res/raw/v2x_zhangai.nt3d b/core/mogo-core-res/src/main/res/raw/v2x_zhangai.nt3d new file mode 100644 index 0000000000..a5a7d00b5f Binary files /dev/null and b/core/mogo-core-res/src/main/res/raw/v2x_zhangai.nt3d differ diff --git a/foudations/mogo-aicloud-services-sdk/src/main/java/com/mogo/aicloud/services/socket/MogoAiCloudSocketManager.java b/foudations/mogo-aicloud-services-sdk/src/main/java/com/mogo/aicloud/services/socket/MogoAiCloudSocketManager.java index c6ab9969de..5285ac617c 100644 --- a/foudations/mogo-aicloud-services-sdk/src/main/java/com/mogo/aicloud/services/socket/MogoAiCloudSocketManager.java +++ b/foudations/mogo-aicloud-services-sdk/src/main/java/com/mogo/aicloud/services/socket/MogoAiCloudSocketManager.java @@ -69,9 +69,9 @@ public class MogoAiCloudSocketManager extends ConnectionLifecycleListener implem @Override public void init(Context context, String appId, double lat, double lon) { this.mAppId = appId; - SocketManager.getInstance().init(context, lat, lon); SocketManager.getInstance().registerSocketConnCallback(this); SocketManager.getInstance().registerSocketErrorCallback(TAG, this); + SocketManager.getInstance().init(context, lat, lon); } @Override diff --git a/foudations/mogo-commons/build.gradle b/foudations/mogo-commons/build.gradle index 296811e92f..c8fe582aea 100644 --- a/foudations/mogo-commons/build.gradle +++ b/foudations/mogo-commons/build.gradle @@ -41,7 +41,7 @@ dependencies { implementation rootProject.ext.dependencies.arouter annotationProcessor rootProject.ext.dependencies.aroutercompiler implementation rootProject.ext.dependencies.rxjava - implementation rootProject.ext.dependencies.mogoaicloudrealtime + api rootProject.ext.dependencies.mogoaicloudrealtime implementation rootProject.ext.dependencies.amapnavi3dmap if (Boolean.valueOf(USE_MAVEN_PACKAGE)) { diff --git a/foudations/mogo-commons/src/main/java/com/mogo/commons/module/MogoServices.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/MogoServices.java index 5926f0af9d..bfd828a29b 100644 --- a/foudations/mogo-commons/src/main/java/com/mogo/commons/module/MogoServices.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/MogoServices.java @@ -58,9 +58,6 @@ public class MogoServices implements IMogoIntentListener { intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); mContext.sendBroadcast(intent); -// if (DebugConfig.isNeedUploadCoordinatesDurationInTime()) { -// MoGoAiCloudRealTime.startRealTime(mContext, DebugConfig.getSocketAppId()); -// } } private void registerMogoReceiver(Context context) { diff --git a/gradle.properties b/gradle.properties index a700ede798..3e8a59fb97 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ org.gradle.daemon=true org.gradle.configureondemand=true org.gradle.parallel=true -org.gradle.jvmargs=-Xmx4096m +org.gradle.jvmargs=-Xmx4096M #开启gradle缓存 org.gradle.caching=true android.enableBuildCache=true @@ -63,29 +63,29 @@ BIZCONFIG_VERSION=1.3.2 SERVICE_BIZ_VERSION=1.2.4 ################ 外部依赖引用 ################ # loglib -LOGLIB_VERSION=1.5.8 +LOGLIB_VERSION=1.5.9 ######## MogoAiCloudSDK Version ######## # 网络请求LOGLIB_VERSION -MOGO_NETWORK_VERSION=1.4.3.27 +MOGO_NETWORK_VERSION=1.4.3.32 # 鉴权 -MOGO_PASSPORT_VERSION=1.4.3.27 +MOGO_PASSPORT_VERSION=1.4.3.32 # 常链接 -MOGO_SOCKET_VERSION=1.4.3.27 +MOGO_SOCKET_VERSION=1.4.3.32 # 数据采集 -MOGO_REALTIME_VERSION=1.4.3.27 +MOGO_REALTIME_VERSION=1.4.3.32 # 探路,道路事件发布,获取 -MOGO_TANLU_VERSION=1.4.3.27 +MOGO_TANLU_VERSION=1.4.3.32 # 直播推流 -MOGO_LIVE_VERSION=1.4.3.27 +MOGO_LIVE_VERSION=1.4.3.32 # 直播拉流 -MOGO_TRAFFICLIVE_VERSION=1.4.3.27 +MOGO_TRAFFICLIVE_VERSION=1.4.3.32 # 定位服务 -MOGO_LOCATION_VERSION=1.4.3.27 +MOGO_LOCATION_VERSION=1.4.3.32 # 远程通讯模块 -MOGO_TELEMATIC_VERSION=1.4.3.27 +MOGO_TELEMATIC_VERSION=1.4.3.32 ######## MogoAiCloudSDK Version ######## # 自研地图 -MAP_SDK_VERSION=2.8.0.11 +MAP_SDK_VERSION=2.9.0.14_test_06 MAP_SDK_OPERATION_VERSION=1.1.4.1 # websocket WEBSOCKET_VERSION=1.1.7 @@ -93,8 +93,8 @@ WEBSOCKET_VERSION=1.1.7 applicationId=com.mogo.launcer applicationName=IntelligentPilot # RoboBus司机端:2.5.1;RoboTaxi司机端:2.5.1;RoboTaxi乘客端:1.0.0 -versionCode=2130000 -versionName=2.13.0 +versionCode=2130200 +versionName=2.13.2 ################# 新架构模块Maven版本管理 ################# MOGO_CORE_FUNCTION_AUTOPILOT_VERSION=0.0.58.10 @@ -157,8 +157,7 @@ MOGO_OCH_NOOP_VERSION=2.0.66 MOGO_OCH_TAXI_VERSION=2.0.66 # mogoAiCloud sdk services MOGO_AICLOUD_SERVICES_SDK_VERSION=2.1.16.10 -# v2x-sdk -MOGO_V2X_SDK_VERSION=1.4.3.20 + ################# 旧版本架构模块版本 ################# @@ -175,4 +174,4 @@ ADAS_DATA_LIB_CHILD_VERSION=.0 # 线程优化版本 -THREAD_OPT_VERSION=3.0.2 +THREAD_OPT_VERSION=4.0.0 diff --git a/libraries/mogo-adas-data/src/main/proto/SocketDownDataProto3.proto b/libraries/mogo-adas-data/src/main/proto/SocketDownDataProto3.proto new file mode 100644 index 0000000000..b101f6234c --- /dev/null +++ b/libraries/mogo-adas-data/src/main/proto/SocketDownDataProto3.proto @@ -0,0 +1,78 @@ +syntax = "proto3"; +package mogo.yycp.service; +option java_package = "mogo.yycp.api.proto"; +option java_outer_classname = "SocketDownData"; +/* +message xxx { + // 字段规则:required -> 字段只能也必须出现 1 次 + // 字段规则:optional -> 字段可出现 0 次或1次 + // 字段规则:repeated -> 字段可出现任意多次(包括 0) + // 类型:int32、int64、sint32、sint64、string、32-bit .... + // 字段编号:0 ~ 536870911(除去 19000 到 19999 之间的数字) + 字段规则 类型 名称 = 字段编号; +} +*/ +//返回车机主实体 +message SocketDownDataProto { + uint64 seq = 1; + uint32 msgType = 2; + string sn = 3; + LauncherSnapshotProto data = 4; + uint64 utcTime = 5; + uint64 upUtcTime = 6; + string cityCode = 7; +} + +//LauncherSnapshot数据响应VO +message LauncherSnapshotProto { + //总数据集合 RoadDataVo + repeated CloudRoadDataProto allList = 1; + //前方50米数据集合 RoadDataVo + repeated CloudRoadDataProto nearList = 2; + //摄像头 RoadDataVo + CloudRoadDataProto camera = 3; + string msgId = 4; + uint64 time = 5; + //过期时间 + uint64 expire = 6; +} +//RoadDataVo +message CloudRoadDataProto { + /**物体类型 1-人 2-自行车 3-小轿车 4-摩托车 5-红绿灯 6-bus 8-truck 9-路边摄像头*/ + uint32 type = 1; + /**数据来源 1,"自车数据" 2,"ADAS数据" 3,"路测设备识别数据" */ + uint32 fromType = 2; + /** + * 车机上行pgs坐标给lat,lon两个成员变量 + * + * 在下发车机时计算高德经纬度 + * 1.将gps(lat,lon)给wgslat,wgalon + * 2.高德算法算出高德经纬度,给lat,lon + */ + double lat = 3; //gps->gd + double lon = 4; //gps->gd + double wgslat = 5; //原gps + double wgslon = 6; //原gps + //车机sn + string sn = 7; + //车辆UUID + string uuid = 8; + /** 车牌号 */ + string cardId = 9; + /**速度*/ + double speed = 10; + /**方向*/ + double heading = 11; + /** 系统时间 */ + uint64 systemTime = 12; + /** 星历时间 */ + uint64 satelliteTime = 13; + /**红绿灯状态 1红 2绿 3黄*/ + uint32 lightStatus = 14; + /**红绿灯剩余时间 读秒*/ + uint32 lightLeftTime = 15; + /**视频流直播地址*/ + string rtmpUrl = 16; + /**距离*/ + double distance = 17; +} diff --git a/libraries/mogo-adas-data/src/main/proto/chassis.proto b/libraries/mogo-adas-data/src/main/proto/chassis.proto index c0d10d8dca..015f089efb 100644 --- a/libraries/mogo-adas-data/src/main/proto/chassis.proto +++ b/libraries/mogo-adas-data/src/main/proto/chassis.proto @@ -24,7 +24,8 @@ enum PilotMode { MODE_STEER_ONLY = 2; MODE_SPEED_ONLY = 3; MODE_REMOTE_DRIVE = 6; - CHASSID_TELECONTROL_DRIVE = 7; + MODE_TELECONTROL_DRIVE = 7; + MODE_INVALID = 8; } enum LongitudeDrivingMode { @@ -98,4 +99,4 @@ enum CleanSystemControlMode { Clean_PureWash_Both_Side_Work = 12; Clean_PureWash_Left_Work = 13; Clean_PureWash_Right_Work = 14; -} \ No newline at end of file +} diff --git a/libraries/mogo-adas-data/src/main/proto/message_pad.proto b/libraries/mogo-adas-data/src/main/proto/message_pad.proto index 91ac5b1b84..465b5a675d 100644 --- a/libraries/mogo-adas-data/src/main/proto/message_pad.proto +++ b/libraries/mogo-adas-data/src/main/proto/message_pad.proto @@ -452,9 +452,14 @@ enum DrivingState AUTO_LANE_CHANGE_RIGHT = 6; //主动向左变道状态: driving_action:1 表示触发变道;driving_action:2 表示执行变道;driving_action:3 表示变道取消;driving_action:4 表示变道完成 LANE_AVOID_LEFT = 7; //主动向左绕行状态: driving_action:1 表示触发绕行;driving_action:2 表示执行绕行;driving_action:3 表示绕行取消;driving_action:4 表示绕行完成 LANE_AVOID_RIGHT = 8; //主动向右绕行状态: driving_action:1 表示触发绕行;driving_action:2 表示执行绕行;driving_action:3 表示绕行取消;driving_action:4 表示绕行完成 - START_UP = 9; //起步状态: driving_action:1 表示正常启动;driving_action:2 表示择机起步; - PULL_OVER = 10; //靠边停车状态: driving_action:1 表示正常靠边停车;driving_action:2 表示择机靠边停车; - UN_PROTECTED_INTERSECTION = 11; //路口预测响应状态: driving_action:1 表示触发了预测响应; + START_UP = 9; //起步状态: driving_action:1 表示正常启动;driving_action:2 表示择机起步 + PULL_OVER = 10; //靠边停车状态: driving_action:1 表示正常靠边停车;driving_action:2 表示择机靠边停车 + UN_PROTECTED_INTERSECTION = 11; //路口预测响应状态: driving_action:1 表示触发了预测响应 + AUTO_LANE_CHANGE_LEFT_V2N = 12; //V2N主动向左变道状态: driving_action:1 表示触发变道;driving_action:2 表示执行变道;driving_action:3 表示变道取消;driving_action:4 表示变道完成 + AUTO_LANE_CHANGE_RIGHT_V2N = 13; //V2N主动向右变道状态: driving_action:1 表示触发变道;driving_action:2 表示执行变道;driving_action:3 表示变道取消;driving_action:4 表示变道完成 + LANE_AVOID_LEFT_V2N = 14; //V2N主动向左绕行状态: driving_action:1 表示触发绕行;driving_action:2 表示执行绕行;driving_action:3 表示绕行取消;driving_action:4 表示绕行完成 + LANE_AVOID_RIGHT_V2N = 15; //V2N主动向右绕行状态: driving_action:1 表示触发绕行;driving_action:2 表示执行绕行;driving_action:3 表示绕行取消;driving_action:4 表示绕行完成 + WAITING_V2N = 16; //V2N正在等待变道避让施工场景/静止障碍物: driving_action:1 表示正在等待;driving_action:2 表示等待超时请求平行驾驶; } enum DrivingAction diff --git a/libraries/mogo-adas-data/src/main/proto/obu_warning_event.proto b/libraries/mogo-adas-data/src/main/proto/obu_warning_event.proto index 3d3f89e613..5dd9552082 100644 --- a/libraries/mogo-adas-data/src/main/proto/obu_warning_event.proto +++ b/libraries/mogo-adas-data/src/main/proto/obu_warning_event.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package mogo.v2x.v2i; +package mogo.v2x; import "header.proto"; import "mogo_v2x.proto"; @@ -91,10 +91,27 @@ message SpatWarningData{ repeated SpatLight lights = 3; /* 灯色信息集合 */ } -message ObuWarningData{ - common.Header header = 1; - int32 MsgDataType = 2; /*1:rsiEvent; 2:RsmEvent; 3:SpatEvent*/ - RsiWarningData rsiEvent = 3; - RsmWarningData RsmEvent = 4; - SpatWarningData SpatEvent = 5; +message NodeID{ + int32 region = 1;/* 定义地图中划分区域的ID号 */ + int32 id = 2; /* 定义地图节点ID */ } + +message MapMatchData{ + int32 status = 1;/* 状态信息,0:更新,1:添加,2:删除 */ + int32 unitMask = 2;/* 描述所属字段有效性 */ + NodeID currentNodeID = 3;/* 前方节点信息 */ + NodeID upstreamNodeID = 4;/* 上游节点信息 */ + int32 matchingLaneID = 5;/* 匹配车道ID,0:无效 */ + int32 speedMaxLimit = 6;/* 建议最大车速,单位(0.02m/s) */ + int32 speedMinLimit = 7;/* 建议最小车速,单位(0.02m/s) */ +} + +message ObuWarningData{ + common.Header header = 1; + int32 msgDataType = 2; /*1:rsiEvent; 2:rsmEvent; 3:spatEvent; 4:mapMatchData*/ + RsiWarningData rsiEvent = 3; + RsmWarningData rsmEvent = 4; + SpatWarningData spatEvent = 5; + MapMatchData mapMatchData = 6; +} + diff --git a/libraries/mogo-adas-data/src/main/proto/system_status_info.proto b/libraries/mogo-adas-data/src/main/proto/system_status_info.proto index 58c511d8c8..0a4953f7f8 100644 --- a/libraries/mogo-adas-data/src/main/proto/system_status_info.proto +++ b/libraries/mogo-adas-data/src/main/proto/system_status_info.proto @@ -30,7 +30,6 @@ message HealthInfo{ message TopicInfo{ optional string name = 1; //topic name optional int32 hz = 2; //Topic发送的频率 - // optional int32 max_delay = 3; //unit: msec } message DropTopic{ @@ -38,10 +37,28 @@ message DropTopic{ repeated TopicInfo topic = 2; } +message NodeInfo{ + optional string node_name = 1; //node name + optional string launch_name = 2; //launch name + optional int32 state = 3; //0:未知状态None,1:依赖未就绪Waiting,2:启动中Starting,3:运行running,4:停止stopping,5:无法启动状态,6:人为启动状态,7:人为关闭状态 +} + +message NodeFaultList{ + required int32 sum = 1; //下述node总数 + repeated NodeInfo node = 2; +} message StatusInfo { - required SystemState sys_state=1; // 当前消息状态 + required SystemState sys_state=1; // 当前系统状态 repeated HealthInfo health_info=2; // 健康检查状态信息 optional DropTopic topic_drop_info=3; // topic 掉频信息, 如有掉频添加没有不添加 - optional string reserved = 4; // 预留可选字段,用于接口扩充或者,其他信息补充 + optional string reserved = 4; // 用于表示idle模式,'idle' 表示idle模式 'work' 表示正常工作 + // add by liyl 20220907 + optional int32 pilot_mode = 5; // 0: manaul 1: autopilot 2: RemotePilot + optional string map_version = 6; // MAP 版本信息 + optional string master_version = 7; // system_master 版本信息 + optional bool auto_pilot_ready = 8; // 自动驾驶状态就绪, 20221111增加 + optional bool remote_pilot_ready = 9; // 平行驾驶状态就绪 + optional NodeFaultList auto_pilot_unready_list = 10; //20221128 增加 + optional NodeFaultList remote_pilot_unready_list = 11; //20221128 增加 } diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/OnAdasListener.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/OnAdasListener.java index 649cbf48d7..5f0b6395e8 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/OnAdasListener.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/OnAdasListener.java @@ -6,6 +6,7 @@ import com.zhidao.support.adas.high.common.ProtocolStatus; import chassis.VehicleStateOuterClass; import mogo.telematics.pad.MessagePad; +import mogo.v2x.ObuWarningEvent; import mogo_msg.MogoReportMsg; import perception.TrafficLightOuterClass; import prediction.Prediction; @@ -180,6 +181,13 @@ public interface OnAdasListener { */ void onPlanningActionMsg(MessagePad.Header header, MessagePad.PlanningActionMsg planningActionMsg); + /** + * OBU预警事件 + * + * @param header 头 + * @param obuWarningData 数据 + */ + void onObuWarningData(MessagePad.Header header, ObuWarningEvent.ObuWarningData obuWarningData); /** * 是否有能力启动自动驾驶 diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/MessageType.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/MessageType.java index af484038ee..2de37de94f 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/MessageType.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/MessageType.java @@ -53,7 +53,8 @@ public enum MessageType { TYPE_SEND_TRIP_INFO_REQ(MessagePad.MessageType.MsgTypeTripInfoEvent, "行程信息"), TYPE_SEND_SPECIAL_VEHICLE_TASK_CMD(MessagePad.MessageType.MsgTypeSpecialVehicleTaskCmd, "特种车辆命令"), //透传 原始pb文件中不存在以下type。由于Java中无法强转所以在mogo-adas-data message_pad.proto中放开注释 - TYPE_RECEIVE_PLANNING_DECISION_STATE(MessagePad.MessageType.MsgTypePlanningDecisionState, "Planning决策状态"); + TYPE_RECEIVE_PLANNING_DECISION_STATE(MessagePad.MessageType.MsgTypePlanningDecisionState, "Planning决策状态"), + TYPE_RECEIVE_OBU_WARNING_DATA(MessagePad.MessageType.MsgTypeObuWarningData, "OBU预警事件"); /** diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/MyMessageFactory.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/MyMessageFactory.java index 5786c0803b..db9df5b63e 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/MyMessageFactory.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/MyMessageFactory.java @@ -31,6 +31,7 @@ public class MyMessageFactory implements IMyMessageFactory { private IMsg statusQueryRespMessage;//状态查询应答 private IMsg recordDataConfigRespMessage;//数据采集配置应答 private IMsg planningDecisionStateMessage;//planning决策状态 + private IMsg obuWarningDataMessage;//工控机透传OBU V2I数据 private final AutopilotReview autopilotReview; @@ -148,6 +149,12 @@ public class MyMessageFactory implements IMyMessageFactory { planningDecisionStateMessage = new PlanningDecisionStateMessage(); } return planningDecisionStateMessage; + } else if (messageType == MessageType.TYPE_RECEIVE_OBU_WARNING_DATA.typeCode) { + //OBU预警事件 + if (obuWarningDataMessage == null) { + obuWarningDataMessage = new ObuWarningDataMessage(); + } + return obuWarningDataMessage; } else { //MessageType.TYPE_DEFAULT.typeCode return null; diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/ObuWarningDataMessage.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/ObuWarningDataMessage.java new file mode 100644 index 0000000000..98075ce004 --- /dev/null +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/ObuWarningDataMessage.java @@ -0,0 +1,31 @@ +package com.zhidao.support.adas.high.msg; + +import android.os.SystemClock; + +import com.google.protobuf.InvalidProtocolBufferException; +import com.zhidao.support.adas.high.AdasChannel; +import com.zhidao.support.adas.high.OnAdasListener; +import com.zhidao.support.adas.high.common.CupidLogUtils; +import com.zhidao.support.adas.high.protocol.RawData; + +import mogo.v2x.ObuWarningEvent; + + +/** + * OBU预警事件 + */ +public class ObuWarningDataMessage extends MyAbstractMessageHandler { + + @Override + public void handlerMsg(RawData raw, OnAdasListener adasListener) throws InvalidProtocolBufferException { + ObuWarningEvent.ObuWarningData obuWarningData = ObuWarningEvent.ObuWarningData.parser().parseFrom(raw.originalData.toByteArray(), raw.getOffsetValue(), raw.getPackageLengthValue() - raw.getOffsetValue()); + AdasChannel.calculateTimeConsumingOnDispatchRaw("OBU预警事件", raw.receiveTime); + long nowTime = 0; + if (CupidLogUtils.isEnableLog()) + nowTime = SystemClock.elapsedRealtime(); + if (adasListener != null) { + adasListener.onObuWarningData(raw.getHeader(), obuWarningData); + } + AdasChannel.calculateTimeConsumingBusiness("OBU预警事件", nowTime); + } +} diff --git a/libraries/mogo-map-api/src/main/java/com/mogo/map/IMogoMap.java b/libraries/mogo-map-api/src/main/java/com/mogo/map/IMogoMap.java index baec754e0c..b52d9b6db4 100644 --- a/libraries/mogo-map-api/src/main/java/com/mogo/map/IMogoMap.java +++ b/libraries/mogo-map-api/src/main/java/com/mogo/map/IMogoMap.java @@ -1,5 +1,6 @@ package com.mogo.map; +import com.mogo.eagle.core.data.map.MogoLatLng; import com.mogo.map.center.CenterLine; import com.mogo.map.marker.IMogoMarker; import com.mogo.map.marker.MogoMarkerOptions; @@ -12,6 +13,7 @@ import java.util.ArrayList; import java.util.HashMap; import mogo.telematics.pad.MessagePad; +import mogo.yycp.api.proto.SocketDownData; /** * @author congtaowang @@ -42,7 +44,7 @@ public interface IMogoMap { * @param options * @return */ - IMogoMarker addMarker( String tag, MogoMarkerOptions options ); + IMogoMarker addMarker(String tag, MogoMarkerOptions options); /** @@ -50,7 +52,14 @@ public interface IMogoMap { * * @param optionsArrayList 锚点集合 */ - void updateBatchMarkerPosition(HashMap optionsArrayList); + void updateBatchMarkerPosition(HashMap optionsArrayList); + + /** + * 批量更新锚点位置 + * + * @param optionsArrayList 锚点集合 + */ + void updateBatchAiMarkerPosition(HashMap optionsArrayList); /** * 添加感知使用到的3d模型 @@ -75,7 +84,7 @@ public interface IMogoMap { * @param moveToCenter * @return */ - ArrayList< IMogoMarker > addMarkers( String tag, ArrayList< MogoMarkerOptions > options, boolean moveToCenter ); + ArrayList addMarkers(String tag, ArrayList options, boolean moveToCenter); /** * 从地图上删除所有的overlay(marker,circle,polyline 等对象)。 @@ -87,7 +96,7 @@ public interface IMogoMap { * * @param isKeepMyLocationOverlay */ - void clear( boolean isKeepMyLocationOverlay ); + void clear(boolean isKeepMyLocationOverlay); /** * 设置屏幕上的某个像素点为地图中心点。 @@ -95,42 +104,42 @@ public interface IMogoMap { * @param x * @param y */ - void setPointToCenter( int x, int y ); + void setPointToCenter(int x, int y); /** * 设置地图POI是否允许点击。 * * @param touchPoiEnable */ - void setTouchPoiEnable( boolean touchPoiEnable ); + void setTouchPoiEnable(boolean touchPoiEnable); /** * 设置是否打开交通路况图层。 * * @param enable */ - void setTrafficEnable( boolean enable ); + void setTrafficEnable(boolean enable); /** * 设置是否显示3D建筑物,默认显示。 * * @param enabled */ - void showBuildings( boolean enabled ); + void showBuildings(boolean enabled); /** * 设置是否显示室内地图,默认不显示。 * * @param enable */ - void showIndoorMap( boolean enable ); + void showIndoorMap(boolean enable); /** * 设置是否显示底图文字标注,默认显示。 * * @param enable */ - void showMapText( boolean enable ); + void showMapText(boolean enable); /** * 停止当前执行的改变地图状态的动画。 @@ -149,7 +158,7 @@ public interface IMogoMap { * * @param zoom */ - void changeZoom( float zoom ); + void changeZoom(float zoom); /** * 获取缩放比例 @@ -169,13 +178,14 @@ public interface IMogoMap { * @param options * @return */ - IMogoPolyline addPolyline( MogoPolylineOptions options ); + IMogoPolyline addPolyline(MogoPolylineOptions options); /** * 获取行驶方向一定长度的中心线 - * @param lon 经度 - * @param lat 纬度 - * @param angle 航向角 + * + * @param lon 经度 + * @param lat 纬度 + * @param angle 航向角 * @param distance 获取车道中心线的长度,> 0: 行驶方向前方距离, <0 行驶方向后方距离 * @return 中心线相关数据 */ @@ -184,10 +194,20 @@ public interface IMogoMap { /** * 根据自车经纬度和航向角,获取道路名称 - * @param lon 经度 - * @param lat 纬度 + * + * @param lon 经度 + * @param lat 纬度 * @param angle 航向角 * @return 道路名称等相关信息 */ RoadNameInfo getRoadName(double lon, double lat, float angle); + + /** + * 经纬度转换 wgs84 -> 高德 + * + * @param lon + * @param lat + * @return + */ + MogoLatLng switchLonLat(double lon, double lat); } diff --git a/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/IMogoMarkerManager.java b/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/IMogoMarkerManager.java index 626bfd6b4f..8e7e2db59f 100644 --- a/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/IMogoMarkerManager.java +++ b/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/IMogoMarkerManager.java @@ -10,6 +10,7 @@ import java.util.List; import java.util.Map; import mogo.telematics.pad.MessagePad; +import mogo.yycp.api.proto.SocketDownData; /** * @author congtaowang @@ -44,6 +45,13 @@ public interface IMogoMarkerManager { */ void updateBatchMarkerPosition(HashMap optionsArrayList); + /** + * 批量更新锚点位置 + * + * @param optionsArrayList 锚点集合 + */ + void updateBatchAiMarkerPosition(HashMap optionsArrayList); + /** * 添加感知使用到的3d模型 * diff --git a/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/IMogoMapUIController.java b/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/IMogoMapUIController.java index 67ac1eb874..09ebf694d4 100644 --- a/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/IMogoMapUIController.java +++ b/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/IMogoMapUIController.java @@ -45,6 +45,17 @@ public interface IMogoMapUIController { */ void changeMapVisualAngle(VisualAngleMode angelMode, MogoLatLng mogoLatLng); + /** + * 设置漫游路径 + * @param trajectory + */ + void setRoamTrajectory(String trajectory); + + /** + * 设置漫游模式 , 0:自由漫游,1:路径漫游 + */ + void setRomaMode(int mode); + /** * 获得当前地图视距模式 * diff --git a/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/VisualAngleMode.java b/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/VisualAngleMode.java index 61d453ed1d..1b3748d975 100644 --- a/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/VisualAngleMode.java +++ b/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/VisualAngleMode.java @@ -35,7 +35,12 @@ public enum VisualAngleMode implements IMogoMapVisualAngle { /** * 十字路口视角 */ - MAP_STYLE_VR_ANGLE_CROSS(5); + MAP_STYLE_VR_ANGLE_CROSS(5), + + /** + * 漫游模式 + */ + MAP_STYLE_VR_ROMA(7); private final int code; @@ -62,4 +67,8 @@ public enum VisualAngleMode implements IMogoMapVisualAngle { public boolean isMediumSight() { return code == MODE_MEDIUM_SIGHT.getCode(); } + + public boolean isRoma(){ + return code == MAP_STYLE_VR_ROMA.getCode(); + } } diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/AMapViewWrapper.java b/libraries/mogo-map/src/main/java/com/mogo/map/AMapViewWrapper.java index b063d1edee..e1266b96c7 100644 --- a/libraries/mogo-map/src/main/java/com/mogo/map/AMapViewWrapper.java +++ b/libraries/mogo-map/src/main/java/com/mogo/map/AMapViewWrapper.java @@ -8,6 +8,7 @@ import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_MAP import static com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_300; import static com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_CROSS; import static com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_TOP; +import static com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ROMA; import static com.mogo.map.uicontroller.VisualAngleMode.MODE_CLOSE_SIGHT; import static com.mogo.map.uicontroller.VisualAngleMode.MODE_LONG_SIGHT; import static com.mogo.map.uicontroller.VisualAngleMode.MODE_MEDIUM_SIGHT; @@ -380,6 +381,16 @@ public class AMapViewWrapper implements IMogoMapView, } } + @Override + public void setRoamTrajectory(String trajectory) { + mMapView.getMapAutoViewHelper().setRoamTrajectory(ROMA_ROAD); + } + + @Override + public void setRomaMode(int mode) { + mMapView.getMapAutoViewHelper().setRoamStyle(mode,1800, MapAutoApi.ROAM_SPEED_40); + } + @Override public VisualAngleMode getCurrentMapVisualAngle() { return mVisualAngleMode; @@ -835,9 +846,19 @@ public class AMapViewWrapper implements IMogoMapView, initMapView(); initMyLocation(); loadPreVehicleModel(); + loadRomaRoad(); //todo for show of hengyang } } + private static final String ROMA_ROAD = "112.577698,26.82026482,112.5776649,26.82024463,112.5776315,26.82022433,112.5775976,26.82020375,112.5775631,26.8201828,112.5775278,26.8201614,112.5774918,26.82013967,112.5774553,26.82011768,112.5774184,26.82009541,112.5773801,26.82007238,112.577343,26.82005009,112.5773046,26.82002699,112.5772689,26.82000566,112.5772343,26.81998499,112.5771981,26.8199634,112.5771604,26.81994093,112.5771241,26.81991927,112.5770863,26.81989686,112.577048,26.81987432,112.5770092,26.81985169,112.5769702,26.81982908,112.5769311,26.8198067,112.5768912,26.81978399,112.5768525,26.81976202,112.5768148,26.81974082,112.5767765,26.81971934,112.5767375,26.8196976,112.5767005,26.81967709,112.5766627,26.81965632,112.5766243,26.8196354,112.5765873,26.81961534,112.5765514,26.81959614,112.5765094,26.81957391,112.5764739,26.81955537,112.5764377,26.81953663,112.5763962,26.8195154,112.5763611,26.81949759,112.5763253,26.81947942,112.5762886,26.81946081,112.5762538,26.81944299,112.5762181,26.81942459,112.5761771,26.81940327,112.5761425,26.81938516,112.5761026,26.81936424,112.5760665,26.81934525,112.5760283,26.81932496,112.5759929,26.81930612,112.5759553,26.81928594,112.5759164,26.819265,112.5758797,26.81924523,112.5758431,26.81922557,112.5758043,26.81920481,112.5757701,26.81918656,112.5757372,26.81916931,112.575705,26.81915323,112.5756723,26.8191394,112.5756388,26.81913008,112.5756042,26.81912741,112.5755689,26.81913241,112.5755345,26.81914523,112.575501,26.81916323,112.5754702,26.81918345,112.5754414,26.81920591,112.5754142,26.81923028,112.5753873,26.8192577,112.5753624,26.81928628,112.5753385,26.81931747,112.575318,26.81934811,112.5752981,26.81938112,112.575279,26.81941509,112.5752615,26.81944712,112.5752441,26.81947941,112.5752259,26.8195132,112.5752073,26.81954787,112.5751884,26.81958344,112.5751691,26.81961976,112.5751494,26.81965723,112.57513,26.81969415,112.575111,26.81973053,112.5750914,26.81976802,112.5750718,26.81980571,112.5750521,26.81984347,112.5750319,26.81988209,112.5750139,26.81991636,112.5749962,26.81995017,112.5749754,26.81998984,112.5749573,26.82002443,112.5749386,26.8200601,112.5749197,26.82009614,112.5749008,26.82013245,112.5748813,26.82016981,112.5748627,26.82020577,112.574843,26.82024356,112.5748242,26.82027988,112.5748048,26.8203173,112.5747853,26.82035503,112.5747657,26.82039302,112.5747457,26.82043198,112.5747264,26.82046932,112.5747067,26.82050756,112.5746869,26.82054576,112.5746677,26.82058291,112.5746479,26.82062126,112.5746291,26.82065783,112.5746089,26.82069715,112.5745902,26.82073333,112.5745732,26.82076629,112.5745548,26.82080203,112.5745377,26.82083496,112.5745212,26.82086682,112.574505,26.82089828,112.5744891,26.82092935,112.574473,26.82096083,112.5744574,26.82099114,112.5744427,26.82102038,112.5744341,26.82105102,112.5744217,26.82108217,112.5744034,26.82111193,112.5743842,26.821142,112.5743648,26.82117413,112.5743472,26.82120453,112.5743279,26.82123795,112.5743097,26.82127083,112.5742903,26.82130636,112.5742724,26.8213397,112.5742548,26.82137277,112.574237,26.8214064,112.5742188,26.82144091,112.5742005,26.82147546,112.5741813,26.82151155,112.5741619,26.8215485,112.5741421,26.82158628,112.574124,26.82162082,112.5741058,26.8216558,112.5740873,26.82169111,112.5740687,26.82172683,112.5740495,26.8217638,112.5740308,26.82179956,112.5740115,26.82183663,112.5739919,26.82187428,112.573972,26.82191258,112.5739519,26.82195149,112.5739332,26.82198747,112.5739153,26.82202211,112.5738944,26.82206251,112.5738756,26.82209882,112.5738567,26.8221355,112.5738378,26.82217255,112.5738182,26.82221085,112.5737995,26.82224751,112.5737803,26.82228527,112.5737607,26.82232415,112.5737419,26.82236124,112.5737225,26.82239931,112.5737029,26.82243731,112.5736827,26.82247603,112.5736634,26.82251246,112.5736438,26.82254928,112.5736243,26.82258572,112.5736043,26.82262308,112.5735852,26.82265864,112.5735657,26.82269511,112.5735457,26.82273244,112.5735268,26.82276772,112.5735077,26.82280347,112.5734861,26.82284394,112.5734658,26.822882,112.5734452,26.82292018,112.5734247,26.82295753,112.5734042,26.82299402,112.5733832,26.82303027,112.5733626,26.82306378,112.5733406,26.82309759,112.573319,26.82312874,112.5732941,26.82316277,112.5732689,26.82319562,112.5732434,26.82322829,112.5732177,26.82326103,112.573125,26.823276,112.5730926,26.82319509,112.5731186,26.82316135,112.5731418,26.82313049,112.5731671,26.82309585,112.5731906,26.82306251,112.5732133,26.82302916,112.5732356,26.82299504,112.5732575,26.82296012,112.5732792,26.8229244,112.5733004,26.82288868,112.5733224,26.82285045,112.5733415,26.82281652,112.5733631,26.82277759,112.5733823,26.82274233,112.5734012,26.8227074,112.5734232,26.82266644,112.5734429,26.82262949,112.5734628,26.82259213,112.5734828,26.82255438,112.573503,26.82251618,112.5735232,26.82247772,112.5735441,26.82243805,112.573564,26.82240019,112.5735849,26.82236028,112.5736054,26.82232125,112.5736254,26.82228313,112.5736465,26.82224299,112.5736666,26.82220471,112.5736877,26.82216437,112.5737079,26.8221259,112.5737285,26.8220863,112.5737493,26.82204643,112.5737701,26.82200633,112.5737916,26.82196499,112.5738122,26.82192543,112.5738339,26.82188365,112.5738547,26.82184377,112.5738767,26.82180167,112.5738956,26.82176558,112.5739167,26.82172515,112.5739391,26.82168239,112.5739605,26.82164148,112.573983,26.8215983,112.5740045,26.82155708,112.5740266,26.82151468,112.5740465,26.8214764,112.5740659,26.8214391,112.5740854,26.82140175,112.574105,26.82136438,112.5741274,26.8213217,112.5741469,26.82128434,112.5741666,26.82124703,112.5741861,26.82120977,112.5742058,26.82117251,112.5742277,26.82113096,112.574248,26.82109253,112.5742678,26.8210551,112.5742876,26.82101759,112.5743103,26.82097465,112.5743301,26.82093699,112.5743495,26.82090037,112.5743727,26.82085623,112.5743926,26.82081862,112.5744124,26.82078108,112.5744321,26.82074358,112.5744518,26.82070609,112.5744715,26.82066866,112.5744938,26.82062594,112.5745133,26.82058863,112.574535,26.82054716,112.5745549,26.82050899,112.5745741,26.82047199,112.5745933,26.82043511,112.5746145,26.82039418,112.574634,26.82035661,112.5746549,26.82031624,112.574676,26.82027535,112.5746968,26.82023518,112.5747177,26.82019483,112.5747373,26.82015724,112.5747573,26.82011956,112.5747776,26.82008238,112.5747981,26.82004564,112.5748193,26.82000863,112.5748421,26.81996979,112.5748629,26.81993507,112.5748842,26.81989978,112.574907,26.81986224,112.5749281,26.81982769,112.5749484,26.81979457,112.5749701,26.8197589,112.5749921,26.81972245,112.5750122,26.81968835,112.5750325,26.81965318,112.5750515,26.81961904,112.5750695,26.81958583,112.5750898,26.81954748,112.5751093,26.81951021,112.5751277,26.81947433,112.5751461,26.81943786,112.5751632,26.8194037,112.5751818,26.81936582,112.575199,26.81933074,112.5752154,26.81929703,112.575232,26.81926305,112.5752475,26.81923084,112.5752623,26.81920053,112.5752764,26.8191712,112.5752904,26.81914362,112.5753061,26.81911433,112.5753237,26.81908528,112.5753441,26.81905648,112.5753677,26.81902905,112.5753944,26.81900493,112.5754244,26.81898445,112.5754583,26.81896707,112.575493,26.81895367,112.5755294,26.81894349,112.575567,26.81893672,112.5756041,26.81893372,112.5756415,26.8189344,112.5756798,26.81893869,112.5757186,26.81894678,112.5757544,26.81895756,112.5757898,26.81897108,112.5758268,26.81898715,112.5758655,26.81900556,112.5759008,26.81902323,112.5759373,26.81904202,112.5759748,26.81906168,112.5760131,26.81908211,112.5760514,26.81910281,112.5760868,26.81912227,112.5761239,26.81914281,112.5761608,26.81916343,112.5761975,26.81918408,112.5762367,26.81920643,112.5762756,26.81922888,112.5763151,26.81925176,112.57635,26.81927208,112.5763891,26.81929497,112.5764295,26.81931871,112.5764661,26.81934025,112.5765068,26.81936437,112.5765425,26.81938563,112.5765836,26.81941011,112.5766186,26.81943106,112.5766557,26.81945345,112.5766919,26.81947536,112.5767284,26.81949747,112.576764,26.81951916,112.5768011,26.81954171,112.5768394,26.81956507,112.5768758,26.81958727,112.5769144,26.81961095,112.5769511,26.81963345,112.576989,26.81965674,112.5770281,26.81968076,112.5770662,26.81970418,112.5771043,26.81972764,112.5771414,26.81975049,112.5771808,26.81977472,112.5772192,26.81979831,112.5772577,26.81982191,112.5772952,26.81984484,112.577335,26.81986907,112.5773736,26.81989259,112.5774123,26.81991606,112.5774498,26.81993877,112.5774882,26.81996205,112.5775276,26.81998588,112.5775644,26.82000825,112.5776031,26.82003178,112.5776393,26.82005387,112.5776772,26.82007712,112.5777137,26.82009957,112.5777488,26.82012121,112.5777907,26.82014706,112.5778261,26.82016891,112.5778652,26.820193,112.577905,26.82021753,112.5779449,26.82024206,112.5779859,26.8202672,112.5780257,26.82029165,112.5780603,26.82031297,112.5780997,26.82033728,112.578138,26.82036083,112.5781768,26.82038473,112.5782161,26.82040883,112.5782537,26.82043183,112.5782895,26.82045365,112.5783251,26.82047532,112.5783596,26.82049637,112.5783979,26.82051971,112.5784329,26.82054099,112.5784705,26.82056384,112.5785066,26.82058588,112.57854,26.82060632,112.5785745,26.82062766,112.5786093,26.82064924,112.5786404,26.82066849,112.5786713,26.82068759,112.5787014,26.82070605,112.5787297,26.82072339,112.5787569,26.82074014,112.5787857,26.8207589,112.5788141,26.82077914,112.5788421,26.82080214,112.5788692,26.8208285,112.578893,26.82085669,112.578913,26.82088621,112.5789302,26.82091859,112.5789438,26.82095338,112.5789539,26.82098972,112.5789601,26.82102729,112.5789619,26.8210634,112.5789595,26.82110054,112.5789525,26.82113842,112.5789405,26.8211768,112.5789249,26.82121207,112.5789047,26.82124716,112.5788828,26.82127905,112.5788587,26.82131182,112.5788364,26.8213422,112.5788121,26.82137567,112.5787872,26.82140995,112.5787614,26.82144538,112.5787355,26.82148084,112.5787084,26.82151799,112.5786832,26.82155261,112.5786581,26.82158701,112.5786326,26.82162203,112.5786075,26.82165672,112.5785815,26.82169273,112.5785547,26.82172993,112.5785284,26.82176648,112.5785021,26.82180326,112.5784763,26.8218394,112.5784498,26.82187675,112.5784225,26.8219154,112.5783962,26.82195248,112.5783691,26.82199081,112.5783411,26.82203039,112.5783137,26.82206924,112.5782862,26.82210834,112.5782587,26.82214764,112.5782353,26.82218122,112.5782077,26.82222088,112.5781836,26.82225567,112.5781588,26.82229152,112.5781347,26.82232641,112.5781077,26.82236534,112.5780829,26.82240132,112.5780587,26.82243632,112.5780345,26.82247136,112.578011,26.82250546,112.5779827,26.82254669,112.5779586,26.82258199,112.5779345,26.82261734,112.5779112,26.82265173,112.5778864,26.82268825,112.577863,26.82272287,112.5778382,26.82275969,112.5778141,26.82279565,112.5777908,26.82283063,112.5777662,26.82286771,112.5777431,26.8229028,112.5777187,26.82294001,112.577695,26.82297621,112.5776713,26.8230124,112.5776476,26.82304855,112.5776247,26.82308364,112.5775972,26.82312593,112.5775744,26.82316101,112.5775477,26.82320226,112.5775237,26.82323937,112.5775004,26.82327543,112.5774737,26.82331663,112.5774504,26.82335271,112.5774237,26.82339398,112.5774004,26.82343015,112.5773771,26.82346637,112.5773538,26.82350264,112.5773311,26.82353795,112.5773045,26.82357962,112.5772805,26.82361727,112.5772579,26.82365292,112.5772305,26.82369605,112.5772038,26.82373828,112.5771804,26.82377537,112.5771576,26.82381151,112.5771335,26.8238499,112.57711,26.82388731,112.5770866,26.82392483,112.5770632,26.82396247,112.5770399,26.82400024,112.5770172,26.82403706,112.5769932,26.8240762,112.5769706,26.82411333,112.5769466,26.82415281,112.5769239,26.82419023,112.5769006,26.8242289,112.5768766,26.82426888,112.5768538,26.82430686,112.5768304,26.82434619,112.5768062,26.82438686,112.5767826,26.82442659,112.576759,26.8244664,112.5767362,26.82450513,112.576712,26.82454613,112.5766887,26.82458599,112.5766654,26.82462584,112.5766429,26.82466453,112.5766198,26.82470431,112.5765961,26.82474519,112.5765731,26.82478489,112.5765508,26.82482342,112.5765272,26.8248642,112.5765044,26.82490376,112.5764823,26.82494211,112.5764597,26.82498158,112.5764365,26.82502214,112.5764141,26.82506156,112.5763923,26.82509987,112.5763694,26.82514046,112.5763479,26.82517884,112.5763253,26.82521944,112.5763041,26.82525765,112.5762819,26.82529789,112.5762605,26.82533679,112.5762399,26.82537422,112.5762184,26.82541343,112.5761953,26.82545571,112.5761739,26.82549472,112.5761508,26.82553699,112.5761295,26.82557604,112.5761059,26.82561945,112.5760853,26.82565746,112.5760653,26.8256944,112.5760443,26.82573355,112.5760238,26.82577161,112.5760035,26.82580955,112.5759834,26.82584724,112.5759607,26.82588994,112.5759383,26.82593221,112.5759161,26.82597406,112.5758938,26.82601648,112.5758733,26.82605542,112.5758519,26.8260963,112.5758305,26.82613716,112.5758087,26.82617896,112.5757879,26.82621856,112.5757669,26.82625897,112.5757456,26.82630002,112.5757251,26.82633968,112.5757048,26.82637922,112.5756853,26.82641773,112.5756651,26.82645798,112.5756464,26.82649596,112.5756275,26.82653452,112.575609,26.82657262,112.5755908,26.82661047,112.5755725,26.82664893,112.575555,26.82668614,112.5755378,26.82672289,112.5755189,26.82676373,112.5755008,26.82680306,112.5754827,26.82684261,112.5754649,26.82688149,112.5754474,26.82691971,112.5754297,26.82695807,112.5754129,26.82699406,112.5753942,26.8270344,112.5753769,26.82707138,112.5753601,26.82710745,112.5753433,26.82714345,112.5753269,26.82717861,112.5753107,26.82721345,112.5752958,26.8272458,112.5752809,26.82727812,112.5752663,26.82730994,112.5752524,26.82734051,112.5752393,26.82736945,112.575226,26.82739794,112.5752118,26.82742821,112.5751971,26.82745922,112.5751817,26.82749174,112.5751666,26.8275242,112.5751515,26.8275565,112.5751352,26.82759177,112.5751203,26.82762466,112.5751043,26.8276599,112.5750881,26.82769574,112.5750729,26.82772944,112.5750574,26.82776339,112.5750421,26.82779694,112.5750261,26.82783198,112.5750105,26.82786635,112.5749952,26.82790045,112.5749799,26.82793441,112.5749647,26.82796847,112.5749503,26.82800031,112.5749367,26.82803037,112.5749241,26.82805848,112.5749101,26.82808862,112.5748948,26.8281212,112.574879,26.82815463,112.5748635,26.82818708,112.5748472,26.8282214,112.5748312,26.82825531,112.574814,26.82829177,112.5747983,26.82832525,112.5747814,26.82836176,112.5747645,26.82839855,112.574748,26.82843472,112.5747317,26.82847055,112.5747144,26.82850911,112.5746971,26.82854794,112.5746795,26.82858784,112.5746636,26.82862412,112.5746474,26.82866127,112.5746311,26.8286993,112.5746145,26.82873817,112.5745982,26.82877687,112.5745814,26.82881732,112.5745645,26.82885843,112.5745476,26.82890018,112.5745304,26.8289424,112.5745128,26.82898606,112.5744961,26.82902786,112.5744789,26.82907101,112.5744616,26.82911452,112.5744436,26.82915967,112.5744281,26.82919867,112.5744125,26.82923804,112.5743967,26.82927771,112.5743813,26.82931649,112.5743654,26.82935656,112.5743471,26.82940243,112.5743307,26.82944378,112.5743129,26.82948851,112.5742967,26.82952975,112.5742814,26.82956861,112.5742631,26.82961532,112.5742459,26.8296596,112.5742301,26.82970036,112.5742151,26.82973993,112.5742002,26.82977939,112.5741854,26.82981876,112.5741692,26.82986254,112.5741527,26.8299073,112.5741363,26.82995202,112.5741217,26.82999225,112.5741054,26.83003703,112.5740891,26.83008201,112.5740748,26.83012154,112.574061,26.8301602,112.5740467,26.83020022,112.5740318,26.83024179,112.5740173,26.83028262,112.5740027,26.83032378,112.5739884,26.83036406,112.5739736,26.83040576,112.5739583,26.83044889,112.5739435,26.83049099,112.5739291,26.83053203,112.5739143,26.83057443,112.5738996,26.83061691,112.573885,26.83065939,112.57387,26.83070302,112.5738554,26.83074539,112.5738409,26.83078771,112.5738269,26.8308288,112.5738121,26.83087228,112.5737977,26.83091457,112.5737834,26.83095689,112.5737692,26.83099924,112.5737555,26.83104042,112.5737416,26.83108282,112.5737276,26.83112527,112.5737134,26.83116903,112.5736999,26.83121044,112.5736861,26.83125311,112.5736724,26.83129583,112.5736587,26.83133862,112.5736452,26.83138146,112.5736317,26.83142437,112.5736183,26.83146737,112.5736045,26.83151168,112.5735913,26.83155482,112.573578,26.83159803,112.5735648,26.83164125,112.5735517,26.83168446,112.573539,26.83172641,112.5735257,26.83177076,112.5735132,26.83181264,112.5735001,26.83185701,112.5734872,26.83190019,112.5734744,26.83194343,112.5734616,26.83198674,112.5734487,26.83203012,112.573436,26.8320736,112.5734232,26.83211711,112.5734109,26.83215929,112.573398,26.83220391,112.5733859,26.832246,112.573373,26.83229048,112.5733606,26.83233362,112.5733483,26.83237662,112.573336,26.83241948,112.5733237,26.83246218,112.5733116,26.83250468,112.5732998,26.83254575,112.5732879,26.83258779,112.5732757,26.83263079,112.5732641,26.8326724,112.5732526,26.83271382,112.5732416,26.83275385,112.5732301,26.83279609,112.573219,26.83283702,112.5732079,26.83287792,112.5731968,26.83291878,112.573186,26.83295848,112.5731747,26.83300056,112.5731637,26.8330415,112.5731527,26.83308249,112.5731421,26.83312245,112.573131,26.83316484,112.5731204,26.8332061,112.5731098,26.83324731,112.5730979,26.83329449,112.5730876,26.83333567,112.5730774,26.83337685,112.5730674,26.83341796,112.5730575,26.83345902,112.5730477,26.83350006,112.5730378,26.83354109,112.5730281,26.833581,112.5730183,26.83362208,112.5730082,26.83366432,112.5729983,26.83370531,112.5729885,26.83374624,112.5729785,26.83378717,112.5729685,26.8338281,112.5729587,26.83386787,112.5729483,26.83391,112.5729369,26.83395684,112.572927,26.83399787,112.5729158,26.83404479,112.5729065,26.83408467,112.5728968,26.83412688,112.5728875,26.83416797,112.5728781,26.83420907,112.5728687,26.83425023,112.5728593,26.83429146,112.5728499,26.83433277,112.5728405,26.83437417,112.5728311,26.83441559,112.5728217,26.83445712,112.5728109,26.83450465,112.5728015,26.83454636,112.5727922,26.83458807,112.572783,26.83462974,112.572774,26.83467145,112.5727651,26.83471318,112.5727564,26.83475493,112.5727478,26.83479672,112.5727393,26.8348385,112.5727311,26.83487906,112.5727225,26.834922,112.5727129,26.83496964,112.5727046,26.83501131,112.5726952,26.83505885,112.5726858,26.83510637,112.5726778,26.83514682,112.5726694,26.83518971,112.5726604,26.83523626,112.572651,26.83528532,112.5726431,26.83532732,112.5726343,26.83537423,112.5726263,26.83541764,112.5726186,26.83545991,112.5726109,26.83550227,112.5726032,26.83554476,112.5725955,26.83558734,112.5725881,26.83562882,112.5725802,26.83567289,112.5725726,26.83571591,112.5725653,26.83575785,112.5725575,26.83580247,112.57255,26.83584605,112.5725425,26.83588981,112.5725352,26.83593248,112.5725275,26.83597781,112.5725202,26.83602077,112.5725125,26.83606641,112.5725052,26.83610966,112.5724976,26.83615563,112.5724904,26.83619918,112.5724828,26.83624548,112.5724754,26.8362907,112.572468,26.83633612,112.5724609,26.83638041,112.5724534,26.8364275,112.5724462,26.83647349,112.5724391,26.83651971,112.5724323,26.83656468,112.5724255,26.83661082,112.5724187,26.83665804,112.5724124,26.83670237,112.5724058,26.83674911,112.5723994,26.83679439,112.5723933,26.8368383,112.5723872,26.83688345,112.5723811,26.83692856,112.572375,26.83697362,112.572369,26.83701871,112.5723627,26.8370651,112.5723568,26.83710893,112.5723507,26.83715406,112.5723446,26.83719921,112.5723385,26.83724439,112.5723325,26.83728967,112.5723264,26.83733635,112.5723206,26.8373818,112.5723149,26.83742737,112.5723092,26.83747304,112.5723036,26.83751881,112.5722983,26.83756338,112.5722929,26.8376094,112.5722875,26.83765684,112.5722823,26.83770308,112.5722773,26.83774945,112.5722725,26.83779601,112.5722678,26.83784277,112.5722633,26.83788973,112.5722588,26.83793682,112.5722543,26.83798399,112.5722497,26.83803128,112.5722451,26.83807868,112.5722402,26.83812616,112.5722352,26.83817373,112.5722301,26.8382214,112.5722251,26.83826772,112.5722199,26.83831666,112.572215,26.83836403,112.5722103,26.83841106,112.5722058,26.83845773,112.5722014,26.83850393,112.5721972,26.83854851,112.5721929,26.83859432,112.5721884,26.83864135,112.572184,26.83868696,112.5721797,26.8387312,112.5721753,26.83877669,112.5721707,26.83882212,112.5721662,26.83886751,112.5721616,26.83891288,112.5721568,26.83895952,112.5721522,26.83900354,112.5721474,26.83905014,112.5721427,26.83909412,112.572138,26.83913936,112.5721333,26.83918457,112.5721286,26.83922975,112.5721238,26.83927622,112.5721192,26.83932139,112.5721145,26.83936654,112.5721098,26.83941167,112.5721051,26.83945547,112.5721002,26.83950183,112.5720954,26.83954687,112.5720907,26.83959058,112.5720858,26.83963502,112.5720807,26.83968067,112.5720758,26.83972506,112.572071,26.83976819,112.5720661,26.83981385,112.5720613,26.83985821,112.5720565,26.83990258,112.5720519,26.83994566,112.5720472,26.83998988,112.5720423,26.84003533,112.5720376,26.84007955,112.5720328,26.84012386,112.5720282,26.840167,112.5720233,26.8402128,112.5720184,26.84025612,112.5720131,26.84030211,112.5720077,26.84034695,112.5720023,26.84039055,112.5719966,26.84043554,112.5719906,26.8404819,112.5719847,26.84052699,112.5719789,26.8405721,112.5719732,26.84061592,112.5719672,26.84066228,112.5719614,26.84070739,112.5719557,26.84075117,112.5719497,26.84079748,112.5719438,26.84084247,112.5719378,26.84088749,112.5719317,26.84093258,112.5719255,26.8409777,112.5719194,26.84102155,112.5719129,26.84106808,112.5719066,26.84111343,112.5719001,26.84115892,112.5718937,26.84120458,112.5718873,26.84124916,112.5718806,26.84129651,112.571874,26.84134262,112.5718675,26.84138874,112.5718608,26.84143489,112.5718543,26.84147982,112.5718473,26.84152753,112.5718406,26.84157434,112.5718338,26.84162116,112.571827,26.84166798,112.5718201,26.84171482,112.5718132,26.84176168,112.5718062,26.84180853,112.571799,26.84185535,112.5717918,26.84190218,112.5717847,26.84194764,112.5717774,26.84199439,112.57177,26.84204102,112.5717624,26.84208882,112.5717551,26.842135,112.571748,26.84218082,112.571741,26.84222489,112.5717337,26.8422711,112.5717265,26.84231576,112.5717193,26.84236021,112.5717122,26.84240319,112.5717047,26.84244857,112.5716978,26.84249013,112.5716902,26.84253673,112.571683,26.84258083,112.5716761,26.8426237,112.5716691,26.84266786,112.5716618,26.84271345,112.5716548,26.84275665,112.5716475,26.84280248,112.5716403,26.8428471,112.571633,26.84289176,112.5716258,26.84293515,112.5716182,26.8429798,112.5716103,26.84302571,112.5716025,26.84307036,112.5715949,26.84311377,112.5715869,26.84315974,112.5715793,26.84320316,112.5715712,26.84324916,112.5715633,26.84329394,112.5715553,26.84333875,112.5715476,26.84338234,112.5715393,26.84342858,112.5715315,26.84347232,112.5715233,26.84351873,112.5715153,26.84356395,112.5715074,26.84360923,112.5714995,26.84365337,112.5714912,26.8437002,112.5714831,26.84374579,112.571475,26.84379143,112.5714669,26.84383711,112.5714587,26.8438828,112.5714505,26.84392853,112.5714423,26.84397429,112.5714343,26.84401877,112.5714258,26.8440659,112.5714176,26.8441118,112.5714093,26.84415776,112.5714009,26.84420378,112.5713925,26.84424984,112.5713842,26.84429593,112.5713758,26.84434205,112.5713676,26.8443869,112.571359,26.8444344,112.5713509,26.8444793,112.5713422,26.84452688,112.5713338,26.84457314,112.5713253,26.84461935,112.571317,26.84466415,112.5713082,26.84471147,112.5712998,26.84475603,112.5712908,26.8448031,112.5712818,26.84484878,112.5712726,26.84489446,112.5712634,26.84493882,112.5712539,26.84498451,112.571244,26.84503151,112.5712344,26.84507722,112.5712247,26.84512285,112.571215,26.84516837,112.5712056,26.84521246,112.5711957,26.84525888,112.5711865,26.84530236,112.5711768,26.84534804,112.5711673,26.84539214,112.5711581,26.84543471,112.5711487,26.84547826,112.571139,26.84552282,112.5711298,26.84556473,112.5711205,26.84560765,112.5711094,26.84565769,112.5711001,26.84569896,112.5710906,26.84574134,112.5710807,26.84578481,112.5710712,26.845827,112.5710616,26.84586907,112.5710521,26.84591106,112.5710431,26.84595172,112.5710323,26.84600064,112.5710232,26.84604221,112.5710128,26.84608957,112.5710037,26.84613087,112.5709946,26.84617214,112.5709854,26.8462134,112.5709763,26.84625465,112.5709672,26.84629582,112.570958,26.84633685,112.5709476,26.84638355,112.5709371,26.84642991,112.5709267,26.84647585,112.5709174,26.84651581,112.5709081,26.8465556,112.5708976,26.84659976,112.5708866,26.84664595,112.5708764,26.84668976,112.5708658,26.84673575,112.5708558,26.8467794,112.5708455,26.84682522,112.570836,26.84686882,112.570826,26.84691518,112.5708163,26.84696026,112.5708066,26.84700418,112.5707964,26.84705038,112.5707865,26.84709444,112.5707758,26.84714031,112.5707649,26.84718482,112.5707539,26.84722957,112.5707432,26.84727344,112.5707332,26.84731397,112.5707221,26.84735914,112.5707124,26.84739878,112.5707014,26.84744421,112.5706908,26.84748863,112.5706798,26.84753517,112.5706693,26.84757924,112.5706585,26.84762413,112.5706477,26.84766855,112.5706365,26.8477134,112.5706258,26.84775556,112.5706145,26.8477995,112.5706039,26.84784073,112.5705931,26.84788232,112.5705824,26.84792412,112.5705709,26.84796921,112.5705607,26.84800877,112.5705505,26.84804796,112.5705404,26.84808688,112.5705302,26.84812575,112.5705201,26.84816464,112.5705102,26.8482027,112.5704998,26.84824295,112.5704882,26.84828748,112.5704779,26.84832742,112.5704675,26.84836772,112.5704572,26.84840838,112.5704468,26.8484494,112.5704366,26.84848975,112.5704257,26.84853252,112.5704151,26.84857458,112.5704046,26.84861591,112.5703934,26.84865968,112.5703825,26.84870272,112.5703715,26.84874608,112.5703607,26.84878861,112.5703493,26.84883365,112.5703381,26.84887792,112.5703271,26.84892137,112.5703159,26.84896625,112.5703043,26.84901253,112.5702932,26.84905668,112.5702818,26.84910205,112.5702699,26.84914862,112.5702583,26.84919407,112.570248,26.84923387,112.5702366,26.84927827,112.5702249,26.84932388,112.5702129,26.84937066,112.5702026,26.84941056,112.570191,26.84945605,112.5701797,26.84950019,112.5701679,26.8495464,112.5701565,26.84959133,112.570145,26.84963618,112.570135,26.84967543,112.5701235,26.84972039,112.5701119,26.84976556,112.5701018,26.84980523,112.5700904,26.8498496,112.5700788,26.84989509,112.5700673,26.84994037,112.5700558,26.84998543,112.5700441,26.85003142,112.5700328,26.85007603,112.5700216,26.85012033,112.5700109,26.85016313,112.5699998,26.85020753,112.5699894,26.85024901,112.5699787,26.85029197,112.5699684,26.85033356,112.5699584,26.85037394,112.5699483,26.85041524,112.5699381,26.85045745,112.5699282,26.85049851,112.5699184,26.85053943,112.5699088,26.8505802,112.5698993,26.85062075,112.5698899,26.85066102,112.5698808,26.85070076,112.5698709,26.8507441,112.5698615,26.85078546,112.5698527,26.85082356,112.5698434,26.85086429,112.5698344,26.85090363,112.5698259,26.85094065,112.5698172,26.85097788,112.5698084,26.85101497,112.5698,26.85105005,112.5697919,26.85108314,112.5697842,26.8511138,112.5697767,26.85114401,112.5697686,26.85117697,112.5697602,26.85121048,112.5697515,26.85124505,112.5697425,26.85128118,112.5697337,26.8513163,112.5697242,26.85135425,112.5697152,26.8513906,112.5697064,26.85142572,112.5696974,26.85146147,112.5696879,26.85149941,112.5696783,26.85153659,112.5696681,26.85157572,112.5696578,26.85161485,112.5696472,26.8516542,112.5696371,26.85169159,112.5696266,26.85172999,112.5696155,26.85177033,112.5696046,26.85181023,112.5695929,26.85185299,112.5695823,26.85189162,112.5695719,26.85193022,112.569561,26.85197066,112.5695497,26.85201321,112.5695382,26.85205596,112.5695279,26.85209482,112.5695174,26.85213436,112.5695067,26.85217449,112.5694959,26.85221516,112.569485,26.85225633,112.5694743,26.85229688,112.5694633,26.85233886,112.5694524,26.85238113,112.5694413,26.85242466,112.5694308,26.8524661,112.5694198,26.85250956,112.5694092,26.85255178,112.5693988,26.85259279,112.569388,26.85263469,112.5693769,26.85267757,112.569366,26.8527194,112.5693554,26.85276025,112.5693443,26.85280333,112.5693334,26.85284558,112.5693225,26.85288805,112.5693117,26.85292966,112.5693002,26.85297363,112.5692891,26.85301569,112.5692777,26.85305902,112.569266,26.85310356,112.5692546,26.85314714,112.5692431,26.85319091,112.5692317,26.85323497,112.5692202,26.85327933,112.5692087,26.85332392,112.5691972,26.85336863,112.5691858,26.85341325,112.5691749,26.85345641,112.5691636,26.85350087,112.5691531,26.85354275,112.569143,26.85358335,112.5691331,26.85362307,112.5691222,26.85366725,112.5691124,26.85370644,112.5691027,26.85374561,112.569093,26.85378487,112.5690831,26.85382439,112.5690719,26.85386919,112.5690621,26.85390839,112.5690516,26.85395007,112.5690412,26.85399127,112.5690308,26.85403196,112.5690199,26.85407429,112.5690085,26.85411835,112.5689974,26.85416091,112.5689856,26.85420639,112.5689743,26.8542504,112.5689637,26.85429169,112.5689535,26.85433115,112.5689427,26.85437326,112.5689326,26.85441331,112.568922,26.8544548,112.568911,26.8544977,112.5689005,26.85453841,112.5688894,26.8545817,112.568879,26.85462277,112.5688678,26.85466638,112.5688567,26.85470901,112.5688457,26.8547519,112.5688345,26.85479502,112.5688235,26.8548371,112.5688122,26.85488059,112.5688006,26.85492545,112.5687893,26.85496911,112.5687782,26.85501151,112.5687664,26.85505634,112.568755,26.85509972,112.5687435,26.85514281,112.5687322,26.85518554,112.5687208,26.85522789,112.5687097,26.85526979,112.5686988,26.85531119,112.5686882,26.85535218,112.5686777,26.85539307,112.5686676,26.85543275,112.5686555,26.85548062,112.5686452,26.8555216,112.5686348,26.85556272,112.5686242,26.85560399,112.5686136,26.85564545,112.5686028,26.85568712,112.568592,26.855729,112.5685811,26.85577112,112.5685701,26.85581347,112.5685591,26.85585607,112.5685481,26.85589891,112.568537,26.85594198,112.5685261,26.85598526,112.5685154,26.85602751,112.568504,26.85607247,112.568493,26.85611635,112.5684822,26.85615918,112.5684712,26.85620345,112.5684604,26.85624665,112.5684487,26.85629386,112.568438,26.85633727,112.5684268,26.85638327,112.568416,26.85642808,112.5684053,26.85647302,112.5683947,26.85651807,112.5683842,26.85656321,112.5683738,26.85660839,112.5683637,26.85665351,112.568354,26.8566972,112.5683439,26.85674318,112.5683342,26.85678752,112.5683248,26.85683053,112.5683149,26.85687604,112.5683053,26.85692029,112.5682957,26.85696459,112.5682862,26.85700893,112.5682767,26.85705329,112.5682672,26.85709769,112.5682579,26.85714209,112.5682488,26.8571852,112.5682394,26.85723081,112.5682305,26.8572739,112.5682215,26.85731824,112.5682123,26.85736381,112.5682036,26.85740683,112.5681948,26.85745103,112.5681859,26.85749648,112.5681773,26.85754054,112.568169,26.85758313,112.5681604,26.8576279,112.568152,26.85767111,112.5681425,26.85772013,112.5681341,26.85776279,112.5681257,26.85780527,112.5681174,26.85784767,112.5681094,26.85788874,112.5681013,26.85793112,112.5680933,26.85797353,112.5680849,26.8580172,112.5680771,26.85805841,112.5680686,26.85810201,112.5680605,26.8581444,112.5680523,26.85818672,112.5680441,26.85822898,112.5680359,26.85827112,112.5680278,26.85831313,112.5680202,26.85835379,112.5680122,26.85839662,112.5680046,26.85843805,112.5679972,26.85847932,112.5679899,26.85852052,112.5679818,26.85856636,112.5679745,26.85860858,112.5679665,26.85865545,112.5679588,26.8587011,112.567951,26.85874787,112.5679442,26.85878995,112.5679376,26.85883087,112.5679301,26.85887767,112.5679228,26.85892331,112.5679156,26.85897016,112.5679081,26.85901824,112.5679019,26.85905934,112.5678958,26.85910045,112.5678899,26.85914155,112.5678832,26.85918852,112.5678766,26.85923428,112.5678697,26.85928233,112.5678631,26.85932918,112.5678564,26.859376,112.5678505,26.85941691,112.5678441,26.85946248,112.5678372,26.85951028,112.5678314,26.85955104,112.5678251,26.85959643,112.5678187,26.85964302,112.5678123,26.8596896,112.5678067,26.85973154,112.5678013,26.85977234,112.5677951,26.85981906,112.5677898,26.85986003,112.5677839,26.85990581,112.5677779,26.85995296,112.5677725,26.85999563,112.5677668,26.86004212,112.5677617,26.86008411,112.5677566,26.86012636,112.5677515,26.86017008,112.5677466,26.86021286,112.5677419,26.86025591,112.5677373,26.86029923,112.5677327,26.86034278,112.5677282,26.86038529,112.5677236,26.86043051,112.5677192,26.86047342,112.5677146,26.86051896,112.5677102,26.86056344,112.5677058,26.86060811,112.5677013,26.86065295,112.5676968,26.86069794,112.5676924,26.86074306,112.5676879,26.86078835,112.5676836,26.8608324,112.5676792,26.86087911,112.567675,26.86092323,112.5676707,26.86096996,112.5676667,26.86101413,112.5676625,26.86106091,112.5676586,26.86110507,112.5676547,26.86115052,112.5676509,26.86119722,112.5676471,26.86124256,112.5676436,26.86128659,112.5676401,26.86133193,112.5676365,26.86137856,112.567633,26.86142383,112.5676298,26.86146768,112.5676264,26.86151389,112.5676232,26.86155733,112.5676199,26.86160315,112.5676169,26.86164637,112.5676139,26.86169085,112.567611,26.8617353,112.5676082,26.86177972,112.5676055,26.8618241,112.567603,26.86186844,112.5676005,26.86191278,112.5675981,26.86195711,112.5675956,26.86200143,112.5675931,26.86204698,112.5675907,26.86209002,112.5675883,26.86213433,112.5675859,26.86217863,112.5675836,26.86222282,112.5675814,26.86226677,112.5675792,26.86231036,112.5675767,26.86236083,112.5675747,26.86240343,112.5675729,26.86244457,112.5675711,26.86248692,112.5675695,26.8625294,112.567568,26.8625734,112.5675665,26.86261653,112.5675649,26.86266005,112.5675634,26.86270397,112.5675619,26.86274699,112.5675604,26.8627929,112.5675589,26.86283793,112.5675573,26.86288327,112.5675557,26.86292896,112.5675542,26.86297495,112.5675527,26.86302126,112.5675513,26.8630665,112.5675498,26.86311466,112.5675484,26.86316171,112.567547,26.86320891,112.5675455,26.86325623,112.5675442,26.86330222,112.567543,26.86335091,112.567542,26.86339822,112.5675411,26.86344545,112.5675403,26.86349126,112.5675397,26.86353966,112.5675393,26.86358666,112.5675392,26.86363231,112.5675391,26.86368061,112.5675392,26.86372751,112.5675393,26.86377292,112.5675394,26.86381943,112.5675396,26.86386562,112.5675399,26.86391154,112.5675403,26.86395865,112.5675408,26.86400441,112.5675413,26.86405016,112.5675417,26.8640946,112.5675422,26.86414172,112.5675425,26.86418629,112.5675429,26.86423223,112.5675434,26.86427959,112.5675438,26.86432449,112.5675443,26.86437088,112.567545,26.86441879,112.5675456,26.86446553,112.5675463,26.86451242,112.567547,26.86455813,112.5675478,26.86460532,112.5675487,26.86465255,112.5675497,26.86469973,112.5675508,26.86474818,112.5675518,26.8647952,112.5675528,26.86484079,112.5675538,26.86488894,112.5675547,26.86493564,112.5675556,26.8649809,112.5675565,26.86502875,112.5675575,26.86507392,112.5675586,26.86512044,112.5675598,26.86516698,112.5675611,26.86521358,112.5675624,26.86526024,112.5675639,26.8653083,112.5675654,26.86535509,112.5675669,26.86540063,112.5675684,26.86544893,112.5675698,26.86549465,112.5675713,26.86554177,112.5675728,26.86558895,112.5675744,26.86563619,112.567576,26.86568345,112.5675777,26.86573073,112.5675794,26.86577797,112.5675811,26.86582519,112.5675828,26.86587235,112.5675845,26.86591946,112.5675862,26.86596643,112.5675879,26.86601314,112.5675896,26.86605953,112.5675914,26.86610556,112.5675931,26.8661511,112.5675948,26.86619611,112.5675965,26.86624066,112.5675981,26.86628506,112.5675997,26.86632938,112.5676012,26.8663736,112.5676026,26.86641774,112.567604,26.86646184,112.5676053,26.86650591,112.5676066,26.86654994,112.567608,26.86659387,112.5676093,26.86663766,112.5676107,26.86668755,112.5676122,26.86673861,112.5676135,26.86678214,112.5676148,26.86682564,112.5676161,26.86686787,112.5676175,26.86691253,112.5676188,26.86695465,112.5676203,26.86699922,112.5676217,26.86704242,112.5676234,26.86709151,112.5676248,26.86713429,112.5676263,26.867177,112.5676277,26.86721962,112.5676292,26.86726217,112.5676306,26.86730467,112.5676321,26.86734711,112.5676336,26.8673895,112.5676351,26.86743181,112.5676366,26.8674741,112.5676382,26.8675163,112.5676398,26.86755835,112.5676415,26.86760491,112.5676433,26.86765356,112.567645,26.86769974,112.5676466,26.86774824,112.5676482,26.86779427,112.5676499,26.86784246,112.5676513,26.86788327,112.5676529,26.86792937,112.5676544,26.86797508,112.567656,26.86801958,112.5676575,26.86806627,112.5676588,26.86811174,112.56766,26.86815602,112.5676612,26.86820255,112.5676624,26.86824785,112.5676636,26.86829295,112.5676648,26.86833755,112.567666,26.86838151,112.5676672,26.86842482,112.5676684,26.8684664,112.5676697,26.86850838,112.5676711,26.86855089,112.5676725,26.86859187,112.567674,26.86863133,112.5676758,26.86867703,112.5676775,26.8687205,112.5676792,26.86876492,112.567681,26.86881031,112.5676825,26.86884977,112.5676843,26.86889408,112.567686,26.86893806,112.5676878,26.86898149,112.5676896,26.86902318,112.5676916,26.86906601,112.5676934,26.8691061,112.5676951,26.86914758,112.5676967,26.86918727,112.5676983,26.86922862,112.5676999,26.86926787,112.5677015,26.86930793,112.5677032,26.86934797,112.5677049,26.86938941,112.5677064,26.86942616,112.5677079,26.86946374,112.5677094,26.86950196,112.5677106,26.86954073,112.5677116,26.86957671,112.5677125,26.86961395,112.5677133,26.86965285,112.5677139,26.86968931,112.5677145,26.86972855,112.5677152,26.8697684,112.5677158,26.86980514,112.5677164,26.86984473,112.5677172,26.8698842,112.567718,26.86992669,112.5677189,26.86996511,112.5677198,26.8700034,112.5677211,26.87004334,112.5677225,26.87008406,112.5677242,26.87012649,112.567726,26.8701677,112.5677276,26.87020653,112.5677294,26.87024957,112.5677313,26.87029304,112.5677331,26.8703369,112.5677348,26.87038102,112.5677365,26.87042525,112.567738,26.87046473,112.5677394,26.8705044,112.5677409,26.8705492,112.5677422,26.87058911,112.5677437,26.87063399,112.5677452,26.87067786,112.5677468,26.87072362,112.5677482,26.87076329,112.5677498,26.87080678,112.5677515,26.87085218,112.5677531,26.87089667,112.5677545,26.87093638,112.5677562,26.87098112,112.5677578,26.87102582,112.5677592,26.87107049,112.5677606,26.87111427,112.567762,26.87115923,112.5677631,26.87120044,112.5677642,26.87123993,112.5677654,26.87128176,112.5677665,26.87132284,112.5677676,26.8713641,112.5677689,26.87140948,112.5677702,26.87145066,112.5677716,26.87149177,112.5677732,26.87153386,112.5677748,26.87157488,112.5677765,26.87161593,112.5677786,26.8716622,112.5677808,26.87170338,112.5677835,26.87174867,112.5677865,26.87179597,112.5677896,26.87184229,112.5677925,26.87188359,112.5677954,26.87192509,112.5677982,26.8719657,112.5678013,26.87200843,112.5678045,26.87205014,112.5678077,26.87209078,112.5678113,26.87213258,112.567815,26.87217562,112.5678187,26.8722168,112.5678227,26.87225928,112.5678271,26.8723031,112.5678317,26.87234609,112.5678365,26.87238934,112.5678416,26.87243287,112.5678467,26.87247555,112.5678524,26.87252062,112.567858,26.87256366,112.5678641,26.87260796,112.5678706,26.87265354,112.5678773,26.87269815,112.5678839,26.8727407,112.5678915,26.87278791,112.567899,26.87283305,112.5679065,26.8728772,112.5679145,26.87292261,112.5679226,26.87296804,112.567931,26.87301448,112.5679391,26.87305842,112.5679478,26.87310415,112.5679564,26.87314812,112.5679649,26.87319042,112.5679736,26.87323363,112.5679826,26.87327784,112.5679916,26.87332101,112.5680006,26.87336323,112.5680102,26.87340774,112.5680196,26.87345008,112.5680296,26.8734945,112.5680396,26.87353764,112.5680496,26.87357952,112.5680603,26.87362338,112.5680708,26.87366498,112.5680817,26.87370763,112.5680931,26.87375136,112.5681043,26.87379404,112.5681154,26.87383572,112.5681271,26.87387854,112.5681393,26.87392248,112.5681511,26.87396431,112.5681637,26.87400834,112.5681759,26.87405007,112.5681886,26.8740926,112.5682013,26.87413495,112.5682144,26.87417813,112.5682272,26.87421989,112.56824,26.87426146,112.5682525,26.87430187,112.5682659,26.87434423,112.5682791,26.87438543,112.5682921,26.87442549,112.5683057,26.87446646,112.56832,26.87450832,112.568334,26.87454804,112.5683486,26.87458865,112.568364,26.87463007,112.5683791,26.87467028,112.5683941,26.87470935,112.56841,26.87475022,112.5684256,26.87478982,112.5684413,26.87482925,112.5684568,26.87486759,112.5684732,26.87490781,112.568489,26.87494607,112.5685057,26.87498631,112.5685218,26.87502462,112.5685388,26.87506496,112.5685556,26.87510438,112.5685721,26.87514287,112.5685892,26.8751824,112.5686068,26.87522304,112.568624,26.87526283,112.568641,26.87530174,112.5686592,26.87534279,112.568677,26.87538192,112.5686957,26.87542207,112.5687154,26.87546328,112.5687351,26.87550355,112.568755,26.87554395,112.5687746,26.87558345,112.5687955,26.87562508,112.5688159,26.87566582,112.5688355,26.87570463,112.5688567,26.87574661,112.568878,26.87578862,112.5688985,26.87582857,112.5689196,26.87586951,112.568941,26.87591038,112.5689627,26.87595119,112.5689853,26.87599293,112.569007,26.8760326,112.5690296,26.87607324,112.56905,26.8761098,112.5690701,26.87614531,112.5690904,26.87618078,112.5691108,26.87621621,112.5691343,26.87625667,112.5691573,26.87629595,112.5691788,26.87633201,112.5692021,26.87637086,112.5692267,26.87641147,112.5692478,26.87644601,112.5692713,26.87648445,112.5692954,26.87652374,112.5693195,26.87656287,112.5693444,26.87660277,112.5693688,26.87664153,112.5693928,26.87667913,112.5694177,26.8767176,112.5694428,26.87675601,112.5694681,26.87679436,112.5694934,26.8768325,112.5695192,26.87687128,112.5695444,26.87690883,112.5695692,26.87694517,112.5695956,26.87698314,112.5696213,26.8770199,112.5696464,26.87705539,112.569672,26.87709121,112.5696972,26.87712641,112.569723,26.87716213,112.5697476,26.8771959,112.5697728,26.87723028,112.5697986,26.87726528,112.5698239,26.8772992,112.5698491,26.87733279,112.5698735,26.87736502,112.5698982,26.87739742,112.5699227,26.87742931,112.5699511,26.87746567,112.5699759,26.87749705,112.5700034,26.87753144,112.5700292,26.87756355,112.5700572,26.87759807,112.5700836,26.87763027,112.5701094,26.87766161,112.5701346,26.87769192,112.5701602,26.87772271,112.5701894,26.87775754,112.5702175,26.8777908,112.5702444,26.8778225,112.5702724,26.87785521,112.570299,26.87788639,112.5703262,26.87791827,112.5703535,26.87795024,112.5703812,26.87798232,112.570409,26.87801452,112.5704378,26.87804762,112.5704656,26.87807942,112.5704943,26.87811207,112.5705239,26.87814573,112.57055,26.87817517,112.5705795,26.87820838,112.5706086,26.87824094,112.5706386,26.87827435,112.570666,26.87830487,112.5706921,26.87833411,112.5707197,26.87836502,112.5707467,26.8783954,112.570773,26.87842527,112.5708042,26.87846069,112.5708307,26.87849089,112.5708578,26.87852192,112.5708848,26.8785529,112.570912,26.87858398,112.5709392,26.87861513,112.5709665,26.87864642,112.5709939,26.87867787,112.5710219,26.8787103,112.5710486,26.87874138,112.5710768,26.87877439,112.5711043,26.87880694,112.571132,26.87883986,112.5711591,26.87887224,112.5711876,26.87890658,112.5712147,26.87893953,112.5712425,26.87897356,112.5712712,26.87900876,112.5712984,26.87904251,112.5713269,26.87907826,112.5713541,26.8791125,112.5713825,26.87914884,112.57141,26.87918475,112.5714367,26.8792201,112.571464,26.87925676,112.5714918,26.87929472,112.5715181,26.87933117,112.5715449,26.87936889,112.5715714,26.87940687,112.5715983,26.8794462,112.5716211,26.87948,112.5716464,26.87951792,112.5716723,26.87955689,112.5716984,26.87959697,112.5717229,26.87963516,112.5717477,26.87967437,112.5717729,26.87971472,112.5717972,26.87975423,112.5718185,26.8797889,112.5718396,26.87982372,112.5718608,26.87985863,112.5718819,26.87989362,112.571903,26.87992869,112.5719239,26.87996384,112.5719447,26.87999908,112.5719653,26.88003445,112.5719887,26.88007503,112.5720089,26.88011061,112.572029,26.88014626,112.5720489,26.88018204,112.5720709,26.88022205,112.5720934,26.88026317,112.5721136,26.8803002,112.572136,26.88034131,112.5721555,26.88037712,112.5721749,26.88041272,112.5721961,26.88045213,112.5722175,26.8804922,112.572239,26.88053295,112.5722596,26.88057256,112.5722793,26.88061094,112.5722997,26.88065126,112.5723193,26.88069069,112.5723382,26.88072932,112.5723575,26.88076921,112.5723772,26.88081047,112.5723963,26.88085103,112.5724146,26.88089089,112.5724336,26.88093314,112.5724515,26.88097353,112.5724694,26.88101512,112.5724872,26.88105683,112.5725052,26.88109967,112.5725227,26.8811415,112.5725395,26.88118231,112.572557,26.88122519,112.5725734,26.88126585,112.5725904,26.88130857,112.5726065,26.88134921,112.5726229,26.88139095,112.5726396,26.88143384,112.5726552,26.88147476,112.5726711,26.88151689,112.5726866,26.8815592,112.5727023,26.88160268,112.5727169,26.88164415,112.5727321,26.88168776,112.5727464,26.88173044,112.57276,26.88177213,112.5727736,26.88181505,112.5727873,26.88185923,112.5728003,26.8819025,112.5728126,26.88194482,112.5728253,26.88198937,112.572837,26.88203166,112.5728489,26.88207502,112.5728608,26.88211844,112.5728729,26.882163,112.5728846,26.88220661,112.5728961,26.88224934,112.5729081,26.88229451,112.5729196,26.88233889,112.572931,26.88238354,112.5729418,26.88242734,112.5729529,26.88247365,112.5729622,26.88251337,112.5729727,26.88255892,112.5729816,26.88259894,112.5729912,26.88264369,112.5730007,26.8826898,112.5730102,26.88273723,112.5730191,26.8827836,112.5730274,26.88282886,112.5730357,26.88287527,112.573043,26.88291695,112.5730506,26.88296203,112.5730574,26.8830035,112.5730637,26.88304359,112.5730707,26.88308921,112.5730772,26.88313361,112.5730837,26.88318019,112.5730898,26.88322456,112.5730956,26.88327006,112.573101,26.88331559,112.573106,26.8833612,112.5731108,26.88340803,112.5731151,26.88345264,112.5731193,26.88349962,112.5731233,26.88354552,112.573127,26.88359032,112.5731309,26.88363636,112.5731351,26.8836824,112.5731394,26.8837294,112.573143,26.88377382,112.5731465,26.88382025,112.5731496,26.88386438,112.5731524,26.88390964,112.5731552,26.88395614,112.5731577,26.88400177,112.57316,26.88404771,112.5731619,26.88409275,112.5731635,26.88414031,112.5731646,26.88418646,112.5731655,26.88422689,112.5731662,26.88426731,112.573167,26.88431228,112.5731677,26.88435821,112.5731684,26.8844051,112.573169,26.88444973,112.5731696,26.88449555,112.5731703,26.88454143,112.5731709,26.88458853,112.5731715,26.88463453,112.5731721,26.88467941,112.5731728,26.88472542,112.5731736,26.88477119,112.5731744,26.88481672,112.5731753,26.88486222,112.5731762,26.88490886,112.5731771,26.88495433,112.5731779,26.8849986,112.5731787,26.88504505,112.5731794,26.88509026,112.5731799,26.88513432,112.5731805,26.8851807,112.5731811,26.88522601,112.5731816,26.88526913,112.573182,26.8853157,112.5731824,26.8853622,112.5731827,26.88540748,112.573183,26.88545269,112.5731833,26.88549665,112.5731835,26.88554242,112.5731839,26.885587,112.5731845,26.88563051,112.5731855,26.8856763,112.5731867,26.88571988,112.5731879,26.88576573,112.5731892,26.88580938,112.5731906,26.88585532,112.573192,26.88590019,112.5731937,26.88594398,112.5731957,26.8859888,112.5731981,26.88603332,112.5732009,26.88607752,112.5732041,26.88612163,112.5732075,26.88616681,112.5732105,26.88620981,112.5732134,26.886254,112.573216,26.8862994,112.5732182,26.88634383,112.5732201,26.88638838,112.573222,26.88643187,112.5732235,26.8864765,112.5732247,26.88652111,112.5732257,26.8865668,112.5732264,26.88661012,112.5732272,26.88665429,112.5732279,26.8866991,112.5732287,26.88674112,112.5732294,26.88678376,112.5732302,26.88682736,112.5732311,26.88686979,112.573232,26.88691107,112.5732329,26.88695441,112.5732338,26.88699665,112.5732348,26.88703772,112.5732358,26.88707964,112.5732369,26.88712224,112.5732379,26.88716342,112.5732389,26.88720337,112.57324,26.88724526,112.5732411,26.88728608,112.5732423,26.88732683,112.5732435,26.88737261,112.5732447,26.88741327,112.573246,26.88745799,112.5732472,26.88749974,112.5732483,26.88754058,112.5732495,26.88758659,112.5732505,26.88762748,112.5732515,26.88766725,112.5732527,26.88771383,112.5732537,26.88775403,112.5732548,26.88779323,112.5732559,26.88783443,112.573257,26.88787467,112.5732581,26.88791397,112.5732592,26.88795426,112.5732604,26.88799539,112.5732615,26.8880351,112.5732628,26.88807811,112.5732642,26.88812219,112.5732656,26.88816439,112.5732669,26.88820476,112.5732681,26.88824514,112.5732693,26.88828462,112.5732704,26.88832748,112.5732712,26.88836919,112.573272,26.88841039,112.573273,26.88845229,112.5732744,26.88849209,112.5732763,26.88853272,112.5732786,26.8885709,112.5732813,26.88860951,112.5732843,26.88864863,112.5732876,26.88868959,112.5732905,26.88872781,112.5732929,26.88876477,112.5732951,26.88880399"; + private static final String ROMA_ROAD_1 = ",112.5732967,26.88884312,112.573298,26.88888136,112.5732992,26.88892276,112.5733003,26.8889593,112.5733014,26.88899739,112.5733025,26.8890355,112.5733035,26.88907108,112.5733047,26.88910874,112.5733058,26.88914569,112.5733066,26.88917961,112.5733074,26.88921312,112.5733083,26.88924725,112.5733091,26.88928032,112.5733103,26.88931571,112.5733115,26.88934913,112.5733125,26.88938455,112.5733134,26.88941967,112.5733143,26.8894553,112.5733152,26.88949305,112.573316,26.88953007,112.5733168,26.88956712,112.5733176,26.88960438,112.5733185,26.88964099,112.5733192,26.88967683,112.5733199,26.8897127,112.5733206,26.88974841,112.5733212,26.88978519,112.5733219,26.88982266,112.5733226,26.88985869,112.5733237,26.88989748,112.5733249,26.88993489,112.5733263,26.88997389,112.5733277,26.8900134,112.573329,26.8900502,112.5733303,26.89008916,112.5733317,26.89012966,112.5733332,26.89017157,112.5733347,26.89021087,112.5733361,26.89025122,112.5733373,26.89029287,112.5733381,26.89033146,112.5733386,26.89037135,112.5733389,26.89040761,112.5733389,26.89044447,112.5733388,26.89048254,112.5733387,26.89051882,112.5733386,26.89055676,112.5733386,26.8905955,112.5733387,26.89063273,112.5733388,26.89067132,112.5733391,26.89071264,112.5733393,26.89075182,112.5733397,26.89079314,112.5733402,26.89083474,112.5733409,26.89087733,112.5733415,26.89091545,112.5733423,26.89096038,112.5733432,26.8910007,112.5733441,26.89104087,112.573345,26.89108273,112.5733458,26.89112539,112.5733466,26.89116976,112.5733473,26.89121255,112.5733479,26.89125243,112.5733484,26.89129414,112.573349,26.89133951,112.5733495,26.89138274,112.5733501,26.89142482,112.5733507,26.89146856,112.5733513,26.89150994,112.573352,26.89155147,112.5733526,26.89159204,112.5733532,26.89163237,112.5733538,26.89167485,112.5733543,26.89171622,112.5733548,26.89175582,112.5733552,26.89179554,112.5733555,26.89183582,112.5733557,26.89187439,112.5733559,26.89191337,112.5733562,26.89195256,112.5733565,26.89199002,112.5733569,26.89203278,112.5733573,26.89207054,112.5733578,26.89210966,112.5733582,26.89214979,112.5733586,26.89219126,112.5733589,26.89223355,112.5733593,26.89227699,112.5733597,26.89231949,112.5733601,26.89236064,112.5733606,26.89240248,112.5733612,26.89244543,112.5733618,26.89248381,112.5733625,26.89252191,112.5733633,26.89256242,112.573364,26.89260178,112.5733649,26.89264348,112.5733658,26.89268478,112.5733666,26.89272566,112.5733673,26.89276889,112.573368,26.89281071,112.5733688,26.89285489,112.5733695,26.89289371,112.5733705,26.89293683,112.5733713,26.8929815,112.5733722,26.89302808,112.5733729,26.89306938,112.5733733,26.89311028,112.5733737,26.89315388,112.5733739,26.89319699,112.573374,26.89323947,112.5733742,26.89328454,112.5733746,26.89332775,112.5733751,26.89337233,112.5733757,26.89341704,112.5733763,26.89346293,112.573377,26.89350663,112.5733776,26.8935515,112.573378,26.89359639,112.5733785,26.89364237,112.5733789,26.89368712,112.5733794,26.8937306,112.5733801,26.89377614,112.5733808,26.89382037,112.5733815,26.89386435,112.5733822,26.89390691,112.573383,26.89395145,112.5733837,26.89399472,112.5733844,26.89403673,112.5733851,26.89407956,112.5733857,26.89412318,112.5733862,26.89416548,112.5733868,26.89420647,112.5733873,26.8942483,112.5733878,26.89428988,112.5733883,26.89433615,112.5733888,26.8943777,112.5733893,26.89441781,112.5733899,26.89446164,112.5733907,26.89450614,112.5733915,26.89455137,112.5733923,26.89459049,112.5733931,26.89463334,112.5733939,26.89467329,112.5733947,26.89471224,112.5733956,26.89475591,112.5733964,26.89479847,112.5733971,26.89484176,112.5733979,26.89488484,112.5733985,26.89492867,112.5733989,26.8949712,112.5733991,26.89501312,112.5733994,26.89505325,112.5733996,26.89509321,112.5733999,26.89513677,112.5734002,26.89517651,112.5734006,26.89521431,112.573401,26.89525288,112.5734013,26.89529152,112.5734017,26.89533116,112.5734021,26.89536936,112.5734025,26.89540959,112.5734029,26.89545278,112.5734034,26.89549274,112.5734039,26.89553381,112.5734043,26.89557331,112.5734049,26.89561481,112.5734053,26.89565445,112.5734057,26.89569472,112.5734059,26.89573454,112.5734062,26.8957736,112.5734064,26.89581245,112.5734065,26.89585335,112.5734066,26.89589289,112.5734068,26.89593014,112.573407,26.89596891,112.5734072,26.89600663,112.5734071,26.89604329,112.5734065,26.89607874,112.5734033,26.8961115,112.5733885,26.89614048,112.5733594,26.89615626,112.5733261,26.89616072,112.5732919,26.89616149,112.5732556,26.89616183,112.573221,26.89616196,112.5731862,26.89616097,112.5731528,26.89615707,112.57312,26.89614683,112.5730933,26.89612524,112.5730807,26.89609266,112.5730791,26.89605794,112.5730796,26.89602181,112.5730799,26.89598458,112.57308,26.89594866,112.5730801,26.89591138,112.5730804,26.89586999,112.5730807,26.89583017,112.5730809,26.89579278,112.5730809,26.89575293,112.5730811,26.89571153,112.5730813,26.89566893,112.5730815,26.89562531,112.5730817,26.89558522,112.5730818,26.89554443,112.5730816,26.89550201,112.5730812,26.89546086,112.5730807,26.89541728,112.5730801,26.89537506,112.5730794,26.89533041,112.5730788,26.89528732,112.5730781,26.89524696,112.5730773,26.89520359,112.5730763,26.89515832,112.5730753,26.89511534,112.5730741,26.895072,112.573073,26.89502936,112.573072,26.89498744,112.573071,26.89494533,112.5730702,26.89490572,112.5730693,26.89486505,112.5730684,26.89482173,112.5730676,26.89478014,112.573067,26.89473705,112.5730666,26.8946958,112.5730665,26.8946542,112.5730664,26.89461166,112.5730661,26.89456982,112.5730655,26.8945277,112.5730648,26.89448509,112.5730641,26.89444724,112.5730633,26.89440734,112.5730627,26.8943688,112.5730623,26.89432806,112.573062,26.89428862,112.5730619,26.89424679,112.5730619,26.89420622,112.5730619,26.89416428,112.5730617,26.894122,112.5730614,26.89407948,112.5730611,26.89403586,112.5730608,26.89399505,112.5730604,26.89395071,112.57306,26.89390857,112.5730596,26.89386637,112.5730592,26.89382411,112.5730588,26.89378642,112.5730584,26.89374473,112.5730579,26.89370185,112.5730574,26.89365882,112.5730569,26.89361566,112.5730563,26.89357237,112.5730557,26.89352906,112.5730552,26.89348503,112.5730547,26.89344298,112.5730542,26.89339899,112.5730537,26.89335682,112.5730532,26.89331263,112.5730527,26.89326926,112.5730523,26.8932269,112.5730518,26.89318296,112.5730513,26.89314193,112.5730508,26.89309986,112.5730501,26.89305483,112.5730493,26.89301059,112.5730485,26.89296809,112.5730477,26.89292827,112.5730469,26.89288538,112.5730462,26.89284648,112.5730456,26.89280284,112.5730449,26.89275812,112.5730442,26.89271515,112.5730434,26.89267005,112.5730426,26.89262685,112.5730418,26.89258263,112.5730412,26.89253851,112.5730411,26.89249867,112.5730408,26.89245598,112.5730404,26.89241124,112.57304,26.89236733,112.5730397,26.89232821,112.5730395,26.8922852,112.5730393,26.89224026,112.573039,26.89219719,112.5730386,26.89215689,112.5730382,26.89211347,112.5730377,26.89206894,112.5730371,26.89202329,112.5730364,26.89198359,112.5730357,26.89194406,112.5730348,26.89190081,112.573034,26.89186042,112.5730331,26.89181692,112.5730323,26.89177132,112.5730315,26.89172754,112.5730306,26.89168257,112.5730298,26.8916364,112.5730292,26.8915963,112.5730286,26.89155153,112.573028,26.89151226,112.5730275,26.89146971,112.5730269,26.89142553,112.5730263,26.89138216,112.5730257,26.89134344,112.5730252,26.8913007,112.5730247,26.89125681,112.5730242,26.89121279,112.5730237,26.89116805,112.5730232,26.89112542,112.5730228,26.89108565,112.5730222,26.89104309,112.5730216,26.891,112.573021,26.89095657,112.5730204,26.89091571,112.5730197,26.89087365,112.573019,26.89083393,112.5730182,26.89079307,112.5730175,26.89075464,112.5730167,26.89071179,112.5730158,26.890669,112.573015,26.89062799,112.5730143,26.8905879,112.5730137,26.89054827,112.5730132,26.89050954,112.5730129,26.89047035,112.5730126,26.89043179,112.5730124,26.89039326,112.5730124,26.89035626,112.5730126,26.8903165,112.5730128,26.89027831,112.5730131,26.89023978,112.5730135,26.89020133,112.5730142,26.89016195,112.573015,26.8901229,112.573016,26.89008347,112.5730169,26.8900436,112.5730175,26.89000409,112.5730179,26.88996363,112.573018,26.88992305,112.573018,26.88988251,112.5730178,26.88984153,112.5730175,26.88980195,112.5730172,26.889763,112.5730168,26.88972426,112.5730164,26.88968621,112.5730159,26.8896472,112.5730156,26.8896077,112.5730153,26.88956763,112.5730149,26.8895263,112.573015,26.88948602,112.5730154,26.88944825,112.5730163,26.88941028,112.5730175,26.88937211,112.5730192,26.88933369,112.5730211,26.88929501,112.5730231,26.88925521,112.5730251,26.88921664,112.5730272,26.88917695,112.5730293,26.88913726,112.5730312,26.88909752,112.5730329,26.88905761,112.5730342,26.88901694,112.5730351,26.88897695,112.5730358,26.88893662,112.5730363,26.88889578,112.5730366,26.88885506,112.5730368,26.88881282,112.5730368,26.88877344,112.5730367,26.88873567,112.5730363,26.88869385,112.5730358,26.88865167,112.5730355,26.88861355,112.5730352,26.88857604,112.5730353,26.88853783,112.573036,26.88850285,112.5730381,26.8884678,112.5730414,26.88843287,112.5730459,26.88839641,112.5730501,26.88836049,112.5730538,26.88832288,112.5730569,26.8882834,112.5730593,26.88824441,112.5730612,26.88820407,112.5730624,26.88816653,112.5730632,26.88812675,112.5730636,26.88808468,112.5730638,26.88804298,112.5730638,26.88800383,112.5730637,26.8879638,112.5730636,26.88792198,112.5730633,26.88788025,112.573063,26.88783868,112.5730628,26.88779446,112.5730627,26.88775538,112.5730626,26.88771081,112.5730625,26.88767077,112.5730624,26.88763149,112.5730622,26.8875858,112.5730618,26.88754374,112.5730614,26.88750332,112.5730609,26.88746145,112.5730603,26.88741917,112.5730596,26.8873754,112.573059,26.88733334,112.5730582,26.88728878,112.5730574,26.88724606,112.5730566,26.88720198,112.5730558,26.88715766,112.573055,26.88711198,112.5730542,26.88706716,112.5730535,26.88702326,112.5730528,26.88697691,112.5730521,26.88693149,112.5730515,26.88688703,112.5730509,26.88684114,112.5730503,26.88679492,112.5730497,26.886753,112.5730491,26.88670608,112.5730486,26.88666481,112.573048,26.88661866,112.5730474,26.88657015,112.5730468,26.88652287,112.5730463,26.8864815,112.5730457,26.88643422,112.5730451,26.8863882,112.5730444,26.88634004,112.5730438,26.88629326,112.5730432,26.88624779,112.5730427,26.88620128,112.5730422,26.88615365,112.5730418,26.886113,112.5730414,26.88607235,112.5730409,26.88603171,112.5730404,26.88599109,112.5730399,26.88594474,112.5730393,26.88590428,112.5730388,26.88585928,112.5730381,26.88581315,112.5730375,26.88576584,112.573037,26.8857254,112.5730363,26.88568022,112.5730356,26.88563363,112.5730349,26.88558562,112.5730342,26.88554445,112.5730335,26.88550318,112.5730328,26.88546189,112.5730319,26.88541473,112.5730311,26.88537343,112.5730303,26.88533212,112.5730294,26.88529089,112.5730285,26.88524512,112.5730277,26.88519833,112.5730271,26.88515065,112.5730267,26.88511019,112.5730263,26.88506425,112.573026,26.88502088,112.5730257,26.88497335,112.5730256,26.88492856,112.5730256,26.88488519,112.5730258,26.88484095,112.5730259,26.88479582,112.5730259,26.88475206,112.5730256,26.88470963,112.5730251,26.88466503,112.5730246,26.88462156,112.5730239,26.88457918,112.5730232,26.88453565,112.5730224,26.88449103,112.5730216,26.8844475,112.5730207,26.88440509,112.5730197,26.88436157,112.5730186,26.88431671,112.5730174,26.88427269,112.5730161,26.8842295,112.5730145,26.8841838,112.5730127,26.88413884,112.5730109,26.88409464,112.573009,26.884049,112.573007,26.88400193,112.5730051,26.8839615,112.5730028,26.883915,112.5730006,26.88387428,112.5729984,26.88383342,112.5729959,26.88379245,112.5729932,26.8837514,112.5729903,26.88371044,112.5729871,26.88366959,112.5729834,26.88362416,112.5729793,26.88357766,112.5729748,26.88353023,112.5729708,26.8834899,112.5729666,26.88344952,112.5729623,26.88340907,112.5729577,26.88336862,112.5729529,26.88332817,112.5729479,26.8832878,112.5729426,26.88324749,112.572937,26.88320728,112.5729312,26.88316723,112.5729244,26.88312256,112.5729171,26.8830766,112.5729094,26.88303051,112.5729012,26.88298303,112.572894,26.88294231,112.5728871,26.88290217,112.5728796,26.8828595,112.572872,26.88281792,112.5728644,26.88277586,112.5728569,26.88273482,112.5728484,26.88269156,112.5728399,26.88264966,112.5728312,26.88260788,112.572822,26.88256629,112.5728127,26.88252487,112.572803,26.88248338,112.5727931,26.88244204,112.5727834,26.88240206,112.5727731,26.88236009,112.572763,26.88231966,112.5727512,26.88227392,112.5727396,26.88222985,112.5727291,26.88219079,112.5727169,26.88214677,112.5727042,26.88210204,112.572692,26.8820596,112.5726793,26.88201625,112.5726665,26.88197324,112.5726533,26.88192965,112.5726405,26.88188865,112.5726268,26.88184561,112.5726132,26.8818036,112.5725997,26.88176259,112.5725855,26.88172043,112.5725707,26.8816771,112.5725565,26.8816358,112.5725415,26.88159334,112.5725264,26.88155081,112.572511,26.88150823,112.5724954,26.8814657,112.5724795,26.88142339,112.5724634,26.8813813,112.5724465,26.8813382,112.57243,26.88129717,112.5724129,26.88125502,112.5723955,26.88121281,112.5723774,26.88116959,112.5723601,26.8811287,112.5723417,26.88108614,112.5723237,26.88104504,112.5723062,26.88100556,112.5722884,26.88096593,112.5722703,26.88092599,112.5722526,26.88088738,112.5722353,26.88085008,112.5722176,26.88081218,112.5721995,26.8807741,112.572182,26.88073772,112.5721629,26.88069858,112.5721449,26.88066292,112.5721255,26.88062533,112.5721058,26.88058778,112.5720862,26.88055066,112.5720664,26.88051342,112.5720459,26.88047514,112.5720259,26.88043827,112.5720047,26.88039948,112.5719839,26.88036225,112.5719622,26.88032409,112.5719404,26.88028602,112.5719179,26.88024716,112.5718961,26.88020984,112.5718754,26.88017492,112.5718528,26.88013739,112.5718313,26.8801023,112.5718101,26.88006792,112.571789,26.88003419,112.5717638,26.87999408,112.5717419,26.87995981,112.5717189,26.87992442,112.5716948,26.8798879,112.5716709,26.87985208,112.5716472,26.87981711,112.571622,26.87978042,112.571597,26.87974467,112.5715723,26.8797097,112.5715467,26.87967372,112.5715206,26.8796376,112.5714936,26.87960038,112.5714675,26.87956482,112.5714407,26.87952843,112.5714134,26.87949148,112.5713876,26.87945693,112.5713616,26.87942227,112.5713353,26.87938759,112.5713099,26.87935455,112.5712856,26.87932296,112.5712568,26.8792859,112.5712316,26.87925359,112.5712068,26.87922198,112.571181,26.87918931,112.5711542,26.87915546,112.5711282,26.87912288,112.571101,26.87908911,112.5710725,26.87905404,112.5710447,26.8790202,112.5710158,26.87898511,112.5709866,26.87894977,112.5709565,26.87891343,112.5709276,26.87887888,112.5708978,26.87884366,112.5708673,26.87880792,112.5708378,26.87877355,112.5708093,26.87874059,112.5707796,26.87870656,112.570751,26.87867398,112.570723,26.87864244,112.5706941,26.87861029,112.5706641,26.87857742,112.5706344,26.87854533,112.5706052,26.878514,112.5705752,26.87848191,112.570545,26.87844992,112.5705142,26.87841731,112.5704852,26.87838658,112.5704558,26.87835547,112.5704261,26.87832404,112.5703985,26.87829459,112.5703672,26.87826116,112.5703368,26.87822827,112.5703064,26.87819522,112.5702777,26.87816376,112.5702477,26.87813063,112.570219,26.87809865,112.5701894,26.87806568,112.5701592,26.87803168,112.5701329,26.87800179,112.5701039,26.87796856,112.5700766,26.87793705,112.5700499,26.87790587,112.5700237,26.87787493,112.569996,26.87784169,112.5699686,26.8778085,112.5699416,26.87777537,112.5699135,26.87774068,112.5698846,26.8777044,112.5698576,26.87767022,112.5698286,26.87763295,112.5698002,26.87759619,112.5697744,26.87756276,112.5697462,26.87752631,112.5697199,26.87749247,112.5696942,26.87745934,112.5696691,26.87742689,112.5696431,26.87739326,112.5696164,26.87735855,112.5695906,26.87732475,112.569565,26.87729089,112.5695402,26.87725792,112.5695106,26.87721804,112.5694856,26.87718389,112.5694607,26.87714969,112.569436,26.87711554,112.5694115,26.87708153,112.5693874,26.87704768,112.5693611,26.8770101,112.5693345,26.87697143,112.5693076,26.87693169,112.5692849,26.87689765,112.5692599,26.87685958,112.5692347,26.87682032,112.5692129,26.87678588,112.5691882,26.8767465,112.5691633,26.87670629,112.5691402,26.87666829,112.5691169,26.87662984,112.569094,26.87659195,112.5690706,26.8765532,112.5690484,26.87651636,112.5690252,26.87647757,112.5690028,26.8764397,112.5689811,26.87640275,112.5689591,26.87636474,112.5689367,26.87632568,112.568915,26.8762874,112.568894,26.8762499,112.5688728,26.87621139,112.5688515,26.87617194,112.5688316,26.87613461,112.5688116,26.87609641,112.5687913,26.87605717,112.5687715,26.87601885,112.5687522,26.87598143,112.5687323,26.87594291,112.5687123,26.87590424,112.5686917,26.87586442,112.568672,26.87582637,112.5686514,26.87578619,112.5686319,26.8757478,112.568612,26.87570831,112.5685921,26.87566873,112.568572,26.87562808,112.5685524,26.87558833,112.5685336,26.87554945,112.5685142,26.87550855,112.5684958,26.8754687,112.5684783,26.87542992,112.5684608,26.87539031,112.5684435,26.87535077,112.5684264,26.87531125,112.5684095,26.87527174,112.5683928,26.87523232,112.5683759,26.87519204,112.5683599,26.87515375,112.5683436,26.87511442,112.5683268,26.87507399,112.568311,26.87503544,112.5682949,26.87499591,112.568279,26.87495635,112.5682629,26.8749157,112.5682473,26.87487598,112.5682324,26.87483724,112.5682169,26.87479641,112.5682019,26.87475651,112.5681875,26.87471759,112.568173,26.87467768,112.5681584,26.87463682,112.5681444,26.87459696,112.5681311,26.87455821,112.5681179,26.87451876,112.5681048,26.87447884,112.5680927,26.8744415,112.5680788,26.87439836,112.5680659,26.874358,112.5680528,26.87431705,112.5680408,26.87427962,112.5680289,26.87424188,112.568016,26.87420139,112.5680032,26.87416169,112.56799,26.87412103,112.5679778,26.8740834,112.5679648,26.87404224,112.5679536,26.87400567,112.5679423,26.87396694,112.5679319,26.87392933,112.5679214,26.87389029,112.5679109,26.87384999,112.567901,26.87381101,112.5678909,26.87376984,112.5678812,26.87373004,112.567871,26.87368804,112.5678611,26.87364741,112.5678508,26.87360523,112.5678402,26.87356236,112.5678304,26.87352268,112.5678211,26.87348436,112.5678103,26.87343955,112.5678007,26.87339815,112.5677916,26.87335822,112.5677825,26.87331672,112.5677733,26.87327368,112.5677649,26.87323236,112.5677563,26.87318953,112.5677481,26.87314629,112.5677399,26.87310163,112.5677323,26.87305885,112.5677249,26.87301482,112.5677177,26.87296977,112.5677112,26.8729271,112.5677047,26.87288338,112.5676982,26.87283962,112.5676916,26.87279458,112.5676853,26.87275153,112.5676788,26.87270728,112.5676724,26.87266312,112.5676659,26.87261775,112.5676599,26.87257434,112.5676537,26.87252853,112.5676479,26.87248363,112.5676424,26.87243961,112.5676371,26.87239419,112.5676319,26.87234731,112.5676275,26.87230706,112.5676225,26.87226078,112.5676182,26.87222008,112.5676139,26.87217914,112.5676096,26.87213798,112.5676051,26.87209184,112.5676007,26.87204309,112.5675971,26.87200134,112.5675937,26.87196062,112.5675905,26.8719185,112.5675875,26.87187621,112.5675849,26.87183377,112.5675826,26.87179121,112.5675808,26.87174733,112.5675795,26.87170582,112.5675783,26.87166177,112.5675774,26.87162009,112.5675765,26.87157093,112.5675757,26.87152664,112.5675747,26.87148478,112.5675736,26.87144041,112.5675724,26.87139718,112.5675711,26.87135386,112.5675699,26.87131048,112.5675688,26.87126725,112.5675673,26.87122412,112.5675654,26.8711811,112.5675634,26.87113938,112.5675611,26.87109529,112.567559,26.87105253,112.5675571,26.87100987,112.5675554,26.87096736,112.5675537,26.87092512,112.567552,26.87087727,112.5675504,26.87083084,112.5675488,26.87078346,112.5675474,26.87073649,112.5675462,26.87069473,112.5675448,26.87064901,112.5675435,26.87060517,112.5675421,26.87056099,112.5675407,26.87051645,112.5675395,26.8704748,112.5675383,26.87043287,112.567537,26.87039053,112.5675358,26.87034983,112.5675346,26.87031065,112.5675331,26.87026466,112.5675317,26.87022081,112.5675299,26.87017502,112.5675282,26.87013109,112.5675264,26.87009001,112.5675247,26.87004982,112.5675232,26.87001052,112.5675214,26.8699641,112.5675199,26.86992484,112.5675183,26.86988464,112.5675165,26.86984338,112.5675144,26.86979907,112.5675123,26.86975781,112.5675103,26.8697176,112.5675084,26.86967842,112.5675064,26.86963225,112.5675048,26.8695931,112.567503,26.86954786,112.5675014,26.86950648,112.5675001,26.86946691,112.5674988,26.86942606,112.5674976,26.86938392,112.5674965,26.86934351,112.5674954,26.86930177,112.5674943,26.86925977,112.5674932,26.86921749,112.5674921,26.86917495,112.567491,26.86913224,112.5674898,26.86908935,112.5674886,26.86904525,112.5674874,26.86900313,112.5674863,26.86895978,112.5674852,26.8689163,112.567484,26.86887162,112.5674827,26.86882903,112.5674813,26.86878515,112.5674798,26.86873992,112.5674783,26.86869666,112.5674766,26.86865197,112.5674749,26.86860584,112.5674731,26.8685605,112.5674712,26.868516,112.5674694,26.86847009,112.5674675,26.86842391,112.5674659,26.86838218,112.5674642,26.86834152,112.5674626,26.86830078,112.5674609,26.86825999,112.5674592,26.86821914,112.5674574,26.86817355,112.5674555,26.86812672,112.5674536,26.86807979,112.5674518,26.86803165,112.5674501,26.86799053,112.5674485,26.86794938,112.5674468,26.86790817,112.567445,26.86786215,112.5674431,26.86781487,112.5674412,26.86776628,112.5674395,26.86771875,112.5674379,26.86767233,112.5674362,26.86762341,112.5674346,26.86757562,112.5674331,26.86752895,112.5674315,26.86748102,112.5674298,26.86743174,112.5674284,26.8673908,112.567427,26.86734857,112.5674256,26.86730509,112.5674242,26.86726398,112.5674228,26.8672216,112.5674214,26.86717915,112.56742,26.86713666,112.5674185,26.86709288,112.567417,26.86705026,112.5674156,26.86700761,112.5674142,26.86696616,112.5674127,26.86692347,112.5674112,26.86687958,112.5674097,26.86683694,112.5674082,26.86679552,112.5674066,26.86675284,112.5674051,26.86671013,112.5674036,26.86666735,112.567402,26.8666245,112.5674003,26.86658036,112.5673988,26.86653862,112.5673972,26.86649561,112.5673955,26.86645253,112.5673936,26.86640201,112.567392,26.86635884,112.56739,26.86630946,112.5673881,26.86626128,112.5673862,26.86621183,112.5673844,26.86616862,112.5673828,26.86612551,112.5673811,26.86608121,112.5673795,26.86603937,112.5673779,26.86599629,112.5673764,26.8659532,112.567375,26.86591009,112.5673736,26.86586696,112.567372,26.86582258,112.5673705,26.86578066,112.5673689,26.86573754,112.567367,26.86569438,112.5673651,26.86565124,112.5673632,26.86560809,112.5673614,26.86556491,112.5673597,26.86552172,112.567358,26.8654711,112.5673566,26.8654279,112.5673553,26.86538593,112.567354,26.86534148,112.5673527,26.86529826,112.5673513,26.86525503,112.5673501,26.86521301,112.5673488,26.86516974,112.5673475,26.86512644,112.5673463,26.86508189,112.5673452,26.8650398,112.567344,26.86499649,112.5673427,26.86495199,112.5673416,26.86490877,112.5673405,26.86486555,112.5673396,26.86482358,112.5673386,26.86478042,112.5673378,26.8647373,112.5673369,26.86469429,112.5673361,26.86465025,112.5673354,26.86460882,112.5673348,26.86456629,112.5673343,26.86452384,112.5673338,26.86448017,112.5673334,26.86443894,112.5673331,26.86439528,112.5673328,26.86435283,112.5673325,26.86431159,112.5673322,26.86426913,112.5673319,26.86422543,112.5673317,26.86418416,112.5673316,26.86414044,112.5673315,26.86409911,112.5673315,26.86405653,112.5673316,26.86401274,112.5673317,26.86397137,112.5673318,26.86392876,112.567332,26.86388614,112.5673321,26.86384351,112.5673322,26.86380086,112.5673322,26.86375816,112.5673321,26.86371536,112.5673321,26.86367248,112.5673321,26.86362955,112.5673326,26.86357924,112.5673332,26.86353624,112.5673342,26.86349317,112.5673352,26.86345126,112.5673365,26.86340684,112.5673378,26.86336361,112.5673391,26.86332033,112.5673403,26.86327822,112.5673412,26.86323356,112.5673419,26.86319004,112.5673425,26.86314639,112.5673432,26.86310264,112.5673439,26.86306,112.5673446,26.86301475,112.5673455,26.86297064,112.5673465,26.86292645,112.5673477,26.86288212,112.567349,26.86283769,112.5673504,26.86279316,112.5673518,26.86274854,112.5673534,26.8627051,112.567355,26.86265906,112.5673568,26.86261425,112.5673586,26.86257067,112.5673607,26.86252576,112.5673629,26.8624808,112.5673651,26.8624345,112.5673673,26.86239072,112.5673697,26.86234436,112.5673719,26.86230063,112.5673743,26.86225443,112.5673767,26.86220961,112.5673791,26.8621662,112.5673816,26.8621217,112.5673844,26.86207613,112.5673871,26.86203196,112.5673898,26.86198919,112.5673927,26.86194408,112.5673957,26.86190044,112.5673986,26.86185828,112.5674016,26.86181519,112.5674047,26.86177236,112.5674078,26.86172852,112.5674109,26.86168607,112.5674139,26.86164492,112.5674171,26.86160136,112.5674202,26.86155902,112.5674234,26.86151665,112.5674267,26.86147546,112.5674301,26.86143301,112.5674335,26.86139048,112.567437,26.86134783,112.5674405,26.861305,112.5674442,26.86126202,112.5674481,26.86121756,112.5674518,26.86117533,112.5674556,26.86113159,112.5674595,26.86108761,112.5674634,26.86104335,112.5674673,26.86099883,112.5674714,26.86095276,112.5674752,26.860909,112.5674793,26.86086241,112.5674832,26.8608182,112.5674871,26.86077258,112.5674911,26.86072692,112.5674952,26.86068139,112.5674993,26.86063475,112.5675033,26.86059091,112.5675075,26.86054592,112.5675119,26.86050102,112.5675163,26.86045621,112.5675209,26.8604115,112.5675255,26.86036692,112.5675301,26.86032249,112.5675347,26.86027832,112.5675395,26.86023447,112.5675443,26.86019094,112.5675499,26.86014143,112.5675551,26.86009704,112.5675602,26.86005525,112.5675657,26.86001113,112.5675712,26.85996839,112.5675769,26.85992583,112.5675827,26.85988345,112.5675885,26.85984244,112.5675945,26.85979918,112.5676003,26.8597573,112.5676061,26.85971567,112.5676127,26.85966849,112.5676184,26.85962746,112.5676248,26.85958196,112.5676315,26.8595343,112.567638,26.85948797,112.5676438,26.85944753,112.5676496,26.85940715,112.5676555,26.85936687,112.567662,26.85932217,112.5676688,26.85927647,112.5676758,26.85922972,112.5676827,26.85918415,112.5676895,26.85913975,112.5676964,26.85909433,112.5677036,26.85904794,112.5677103,26.859004,112.5677173,26.8589591,112.5677244,26.85891326,112.5677315,26.85886871,112.5677384,26.85882537,112.5677455,26.85878094,112.5677529,26.85873538,112.5677601,26.85869095,112.5677673,26.85864762,112.567775,26.85860196,112.5677826,26.85855723,112.5677901,26.85851344,112.5677978,26.85846829,112.5678058,26.85842178,112.5678136,26.85837618,112.5678205,26.8583361,112.5678275,26.85829587,112.5678355,26.85825086,112.5678437,26.85820449,112.5678512,26.85816261,112.5678596,26.85811587,112.567868,26.85807012,112.5678758,26.85802773,112.5678835,26.85798637,112.5678914,26.8579449,112.5678993,26.8579033,112.5679074,26.85786158,112.5679155,26.85781974,112.5679237,26.85777775,112.5679318,26.85773564,112.56794,26.85769342,112.5679492,26.85764624,112.5679588,26.8575977,112.5679674,26.85755387,112.5679756,26.85751238,112.5679844,26.85746833,112.5679928,26.85742662,112.5680018,26.85738235,112.5680105,26.85734049,112.5680197,26.85729609,112.5680285,26.8572541,112.5680377,26.85721086,112.5680468,26.85716763,112.5680559,26.85712438,112.5680653,26.85707988,112.5680744,26.85703659,112.5680834,26.85699454,112.5680927,26.85695129,112.5681021,26.85690798,112.5681117,26.85686472,112.5681214,26.85682142,112.5681316,26.85677687,112.5681412,26.85673477,112.5681512,26.85669142,112.5681612,26.85664807,112.5681713,26.85660471,112.5681815,26.8565613,112.5681918,26.85651784,112.5682022,26.85647436,112.5682125,26.85643085,112.568223,26.85638731,112.5682334,26.85634374,112.5682438,26.85630014,112.5682542,26.85625653,112.5682646,26.85621292,112.568275,26.85616934,112.5682856,26.85612576,112.5682961,26.85608222,112.5683068,26.85603871,112.5683175,26.85599523,112.5683283,26.85595174,112.5683391,26.85590827,112.56835,26.85586481,112.5683608,26.85582135,112.5683716,26.8557779,112.5683824,26.85573445,112.5683932,26.85569109,112.5684039,26.85564784,112.5684146,26.85560469,112.5684253,26.85556164,112.5684359,26.85551869,112.5684465,26.85547585,112.5684571,26.8554331,112.5684692,26.85538435,112.5684798,26.85534179,112.5684907,26.855298,112.568501,26.85525659,112.5685119,26.85521269,112.5685225,26.85516999,112.5685328,26.85512851,112.5685435,26.85508584,112.5685545,26.85504202,112.5685652,26.85499958,112.568576,26.85495741,112.5685865,26.85491681,112.5685972,26.85487547,112.5686081,26.85483341,112.56862,26.85478737,112.5686301,26.85474766,112.5686411,26.85470406,112.5686521,26.85466006,112.568663,26.85461675,112.5686741,26.85457261,112.5686845,26.85453065,112.5686953,26.85448763,112.5687062,26.85444347,112.5687171,26.85440031,112.5687278,26.85435814,112.568739,26.85431482,112.5687505,26.85427036,112.5687615,26.854228,112.5687728,26.85418444,112.5687842,26.85414074,112.568796,26.85409578,112.5688072,26.85405281,112.5688186,26.85400854,112.5688303,26.85396292,112.5688403,26.8539238,112.5688516,26.85387999,112.5688634,26.85383485,112.5688757,26.85378837,112.5688879,26.85374282,112.5688998,26.85369813,112.5689122,26.85365202,112.5689231,26.85361148,112.568934,26.85357073,112.568945,26.85352976,112.5689563,26.85348742,112.5689669,26.85344729,112.5689777,26.85340595,112.5689884,26.85336456,112.568999,26.85332314,112.5690095,26.85328177,112.5690201,26.85323937,112.5690301,26.85319962,112.5690419,26.85315203,112.5690519,26.85311185,112.5690618,26.85307214,112.5690725,26.85302843,112.5690834,26.85298416,112.5690945,26.85293939,112.5691052,26.85289631,112.5691153,26.85285525,112.5691254,26.85281427,112.5691363,26.85276925,112.5691467,26.85272479,112.5691558,26.85268448,112.5691642,26.85264604,112.5691739,26.85260068,112.5691823,26.85256148,112.5691914,26.85251902,112.5692006,26.85247698,112.5692099,26.85243617,112.5692195,26.85239528,112.5692291,26.85235591,112.5692383,26.85231832,112.5692483,26.85227828,112.5692577,26.85224057,112.5692673,26.85220256,112.5692765,26.85216641,112.5692852,26.85213217,112.5692934,26.85209921,112.5693012,26.85206782,112.5693088,26.8520366,112.5693165,26.85200596,112.5693244,26.85197473,112.5693329,26.85194174,112.5693415,26.85190886,112.5693505,26.85187391,112.5693596,26.85183913,112.5693689,26.8518038,112.5693786,26.85176767,112.5693886,26.85173053,112.5693987,26.85169321,112.5694093,26.8516548,112.5694193,26.85161924,112.5694299,26.85158166,112.5694409,26.85154281,112.5694525,26.85150268,112.5694646,26.85146038,112.5694754,26.85142303,112.5694865,26.85138403,112.5694981,26.85134331,112.5695094,26.8513035,112.5695209,26.85126192,112.5695315,26.85122334,112.5695429,26.85118118,112.5695535,26.85114123,112.5695636,26.8511028,112.5695755,26.85105703,112.569586,26.85101676,112.5695962,26.85097701,112.5696067,26.85093573,112.5696177,26.85089286,112.5696282,26.85085165,112.5696391,26.85080916,112.5696501,26.85076663,112.5696614,26.8507231,112.5696721,26.85068191,112.5696831,26.85064005,112.5696943,26.85059766,112.5697049,26.8505579,112.5697157,26.8505174,112.5697268,26.8504759,112.5697376,26.85043546,112.5697479,26.85039631,112.5697583,26.85035632,112.569769,26.85031532,112.5697793,26.85027546,112.5697893,26.85023657,112.5697997,26.85019564,112.5698107,26.85015163,112.5698219,26.85010653,112.5698321,26.8500653,112.5698417,26.85002598,112.5698515,26.84998557,112.5698615,26.84994409,112.5698711,26.84990454,112.5698812,26.84986385,112.5698918,26.84982193,112.5699024,26.84978088,112.5699128,26.84974064,112.5699238,26.84969806,112.5699346,26.84965622,112.569945,26.84961514,112.5699557,26.84957283,112.5699663,26.84953049,112.5699772,26.84948722,112.5699876,26.84944638,112.5699983,26.84940488,112.570009,26.84936345,112.57002,26.84932117,112.5700303,26.84928134,112.5700409,26.84924079,112.5700518,26.8491992,112.5700621,26.84915954,112.5700727,26.8491187,112.5700833,26.8490776,112.5700944,26.84903516,112.5701051,26.8489945,112.5701161,26.84895247,112.5701271,26.84891002,112.5701384,26.84886612,112.5701492,26.84882402,112.5701606,26.84877956,112.5701718,26.84873609,112.5701827,26.84869375,112.5701938,26.84865055,112.5702048,26.84860776,112.5702158,26.84856529,112.5702268,26.8485228,112.5702382,26.84847919,112.5702493,26.84843653,112.5702603,26.84839485,112.5702715,26.848352,112.5702828,26.84830902,112.5702945,26.84826488,112.5703052,26.8482239,112.5703166,26.84817971,112.5703278,26.84813556,112.5703382,26.84809355,112.5703487,26.84805035,112.5703592,26.84800699,112.57037,26.8479623,112.5703803,26.8479196,112.5703909,26.84787565,112.5704018,26.84783026,112.570412,26.84778789,112.5704233,26.84774191,112.5704349,26.84769563,112.570446,26.84765133,112.5704563,26.84761025,112.5704663,26.8475702,112.5704764,26.84753009,112.5704865,26.84748987,112.5704967,26.8474496,112.5705069,26.84740932,112.5705171,26.84736909,112.5705271,26.84732902,112.5705369,26.84728922,112.5705466,26.84724972,112.5705562,26.84721025,112.5705668,26.84716626,112.5705776,26.84712107,112.5705886,26.84707583,112.5705999,26.84702942,112.5706107,26.84698518,112.5706216,26.84693969,112.5706323,26.84689405,112.5706416,26.84685284,112.5706517,26.84680806,112.5706608,26.84676669,112.5706698,26.84672647,112.5706787,26.84668626,112.5706888,26.84664152,112.5706994,26.84659467,112.5707094,26.84655054,112.5707195,26.84650579,112.5707294,26.84646167,112.5707392,26.8464178,112.5707492,26.84637281,112.5707587,26.84633008,112.5707686,26.84628626,112.5707786,26.8462413,112.5707883,26.84619855,112.5707984,26.84615469,112.5708087,26.84610965,112.5708187,26.84606559,112.5708286,26.84602245,112.5708386,26.84597801,112.5708489,26.84593231,112.5708586,26.84588861,112.5708685,26.84584351,112.5708785,26.84579714,112.5708871,26.84575753,112.5708955,26.84571792,112.5709038,26.84567829,112.5709132,26.84563323,112.5709222,26.84558947,112.5709313,26.84554459,112.5709406,26.84549855,112.5709496,26.84545356,112.5709584,26.84540959,112.5709675,26.84536402,112.5709769,26.84531752,112.5709851,26.84527773,112.5709933,26.84523775,112.5710016,26.84519755,112.5710098,26.84515713,112.5710181,26.84511659,112.5710263,26.84507603,112.5710345,26.84503528,112.5710427,26.84499453,112.5710509,26.84495367,112.5710591,26.84491286,112.5710672,26.84487214,112.5710754,26.84483149,112.5710846,26.84478523,112.5710925,26.84474496,112.5711013,26.8447002,112.5711105,26.84465306,112.5711191,26.84460815,112.571127,26.84456655,112.5711347,26.84452593,112.5711424,26.84448508,112.57115,26.84444403,112.5711577,26.8444028,112.571165,26.8443626,112.5711726,26.84432108,112.5711805,26.84427818,112.571188,26.8442375,112.5711962,26.84419424,112.5712043,26.84415208,112.5712123,26.8441098,112.5712203,26.84406849,112.5712286,26.84402576,112.5712372,26.84398154,112.5712456,26.84393827,112.571254,26.84389472,112.5712622,26.84385088,112.5712704,26.84380676,112.5712782,26.84376361,112.5712865,26.84371764,112.5712944,26.84367271,112.5713022,26.84362883,112.5713104,26.84358216,112.5713184,26.84353655,112.5713263,26.84349208,112.5713344,26.84344615,112.5713428,26.8433988,112.571351,26.84335266,112.5713591,26.84330645,112.5713672,26.84326013,112.5713751,26.84321383,112.5713831,26.84316752,112.571391,26.84312124,112.571399,26.84307506,112.5714069,26.84302917,112.5714143,26.8429849,112.5714221,26.84293842,112.5714296,26.84289371,112.5714368,26.84285079,112.5714443,26.84280575,112.5714514,26.84276205,112.5714584,26.8427197,112.5714654,26.8426762,112.5714726,26.84263154,112.5714795,26.84258815,112.5714863,26.84254605,112.5714934,26.84250158,112.5715002,26.84245846,112.5715068,26.84241668,112.5715137,26.8423725,112.5715205,26.84232956,112.5715271,26.8422866,112.5715338,26.84224355,112.5715404,26.84220166,112.5715471,26.84215849,112.5715539,26.84211527,112.5715609,26.84207078,112.5715677,26.84202744,112.5715745,26.84198409,112.5715811,26.84194197,112.5715878,26.84189863,112.5715945,26.84185531,112.5716012,26.84181201,112.5716083,26.84176755,112.5716152,26.84172559,112.5716224,26.84168113,112.5716292,26.84163906,112.5716361,26.84159567,112.5716428,26.84155208,112.5716495,26.84150697,112.5716558,26.8414629,112.5716621,26.84141857,112.5716681,26.84137527,112.5716743,26.84133048,112.5716804,26.84128548,112.5716863,26.84124022,112.5716922,26.8411947,112.5716982,26.84114767,112.5717038,26.84110308,112.5717098,26.84105704,112.5717158,26.84101086,112.5717222,26.84096328,112.5717283,26.84091824,112.5717347,26.84087052,112.5717408,26.84082539,112.5717472,26.84077764,112.5717533,26.84073261,112.5717595,26.84068633,112.5717657,26.84064021,112.5717717,26.8405942,112.5717776,26.84054829,112.5717835,26.84050127,112.571789,26.84045706,112.5717946,26.84041174,112.5718002,26.84036654,112.5718058,26.84032018,112.5718112,26.84027644,112.5718166,26.84023153,112.5718221,26.84018682,112.5718275,26.84014242,112.5718329,26.84009818,112.5718382,26.84005414,112.5718435,26.84001029,112.5718487,26.8399667,112.5718545,26.83991705,112.5718596,26.8398725,112.5718645,26.83982929,112.5718693,26.83978622,112.571874,26.83974449,112.5718789,26.83970042,112.5718836,26.83965766,112.5718883,26.83961497,112.5718927,26.83957366,112.5718974,26.83953004,112.5719019,26.8394877,112.5719061,26.83944662,112.5719104,26.83940439,112.5719148,26.83936105,112.5719191,26.83931893,112.5719233,26.83927806,112.5719275,26.83923605,112.5719317,26.83919408,112.5719358,26.83915211,112.57194,26.83910895,112.571944,26.83906821,112.5719481,26.83902626,112.5719523,26.8389844,112.5719566,26.83894137,112.571961,26.83890078,112.5719663,26.83885186,112.5719707,26.83881012,112.571975,26.83876837,112.5719791,26.83872667,112.5719834,26.83868499,112.571988,26.83863857,112.5719926,26.83859103,112.5719972,26.83854363,112.5720014,26.83850125,112.5720058,26.83845578,112.5720098,26.83841426,112.5720141,26.8383695,112.5720184,26.83832369,112.5720227,26.83827689,112.572027,26.83823128,112.5720312,26.83818691,112.5720357,26.83814037,112.57204,26.83809507,112.5720443,26.83805101,112.5720486,26.8380059,112.5720531,26.83795988,112.5720575,26.83791423,112.5720617,26.83787247,112.5720662,26.83782923,112.572071,26.8377853,112.5720758,26.83774361,112.5720807,26.83770091,112.5720857,26.83765715,112.5720904,26.83761439,112.5720949,26.83757271,112.5720996,26.83753004,112.5721046,26.83748653,112.5721096,26.83744437,112.5721145,26.83740363,112.5721197,26.83736224,112.572125,26.83732131,112.5721303,26.83728088,112.5721354,26.83724088,112.5721413,26.83719506,112.5721463,26.83715633,112.5721522,26.83711078,112.572158,26.83706731,112.5721641,26.837023,112.5721705,26.83697868,112.5721765,26.83693825,112.5721825,26.83689968,112.5721886,26.83685976,112.5721949,26.83681839,112.5722009,26.83677757,112.5722068,26.83673729,112.5722129,26.83669555,112.5722192,26.83665242,112.5722255,26.83660994,112.5722316,26.83656812,112.572238,26.83652481,112.5722444,26.83648114,112.5722509,26.83643723,112.5722575,26.83639331,112.5722642,26.83634823,112.5722708,26.83630512,112.5722776,26.83626056,112.5722846,26.83621557,112.5722919,26.83616898,112.5722982,26.83612874,112.5723046,26.83608814,112.5723111,26.83604724,112.5723177,26.83600605,112.5723245,26.83596463,112.5723311,26.83592419,112.5723382,26.83588113,112.5723453,26.83583914,112.5723523,26.83579702,112.5723594,26.83575467,112.5723666,26.83571207,112.572374,26.83566922,112.5723817,26.83562614,112.5723895,26.83558271,112.5723976,26.83553901,112.5724059,26.83549503,112.5724143,26.83545079,112.5724229,26.83540627,112.5724315,26.83536147,112.5724401,26.83531642,112.5724488,26.83527114,112.5724575,26.83522564,112.5724664,26.83517992,112.5724752,26.83513403,112.5724842,26.83508794,112.5724933,26.83504165,112.5725024,26.83499516,112.5725118,26.83494849,112.5725209,26.834903,112.5725308,26.83485461,112.5725403,26.8348087,112.5725506,26.8347599,112.5725606,26.83471224,112.5725708,26.8346645,112.5725806,26.83461812,112.5725911,26.83456913,112.5726011,26.83452165,112.5726109,26.83447571,112.572621,26.83442874,112.572631,26.8343821,112.5726414,26.83433449,112.5726516,26.83428852,112.5726613,26.83424417,112.5726714,26.83419885,112.5726813,26.83415383,112.5726916,26.83410786,112.5727013,26.83406474,112.5727114,26.83402068,112.5727214,26.83397694,112.5727315,26.83393352,112.5727418,26.83388918,112.5727515,26.83384759,112.5727615,26.83380507,112.5727715,26.83376283,112.5727815,26.83371968,112.5727909,26.8336792,112.5728009,26.83363665,112.5728104,26.83359677,112.5728217,26.83354905,112.5728314,26.83350861,112.572841,26.83346845,112.5728507,26.83342848,112.5728616,26.8333838,112.572873,26.83333783,112.5728849,26.83329071,112.5728965,26.83324462,112.5729067,26.83320424,112.572917,26.83316383,112.5729284,26.83311875,112.5729402,26.83307238,112.5729525,26.83302465,112.5729631,26.83298372,112.5729738,26.8329426,112.5729844,26.8329025,112.5729958,26.83285996,112.5730072,26.83281861,112.5730184,26.83277862,112.5730303,26.83273646,112.5730417,26.83269686,112.5730539,26.83265527,112.5730674,26.83260946,112.5730807,26.83256518,112.5730945,26.83251871,112.5731065,26.83247888,112.57312,26.83243315,112.5731319,26.83239295,112.5731433,26.83235378,112.5731555,26.83231219,112.5731674,26.83227166,112.5731794,26.83223112,112.5731914,26.83219068,112.5732032,26.83215049,112.5732161,26.83210599,112.5732293,26.83206025,112.5732425,26.83201454,112.573256,26.83196793,112.5732675,26.83192843,112.5732791,26.83188899,112.5732908,26.83184951,112.5733039,26.83180549,112.5733175,26.8317603,112.5733316,26.8317139,112.5733436,26.83167425,112.5733558,26.83163458,112.5733698,26.8315893,112.5733821,26.83154987,112.5733944,26.83151079,112.5734066,26.83147204,112.5734202,26.83142885,112.5734342,26.83138452,112.5734487,26.83133903,112.5734624,26.83129566,112.5734767,26.83125107,112.5734911,26.83120637,112.5735061,26.83116058,112.573519,26.83112147,112.573532,26.83108228,112.5735451,26.83104302,112.5735599,26.83099919,112.5735752,26.8309542,112.5735908,26.83090917,112.573607,26.83086304,112.573621,26.83082368,112.5736349,26.83078442,112.5736503,26.83074088,112.5736657,26.83069655,112.5736812,26.83065148,112.5736957,26.83060895,112.5737105,26.83056584,112.5737252,26.83052315,112.5737404,26.83047951,112.573755,26.83043811,112.5737699,26.83039589,112.5737851,26.83035311,112.5737998,26.83031175,112.5738143,26.83027152,112.5738295,26.83022924,112.5738443,26.83018799,112.5738588,26.83014777,112.5738736,26.83010652,112.5738883,26.83006519,112.5739035,26.8300227,112.573918,26.82998218,112.5739327,26.82994066,112.5739474,26.82989933,112.573962,26.82985842,112.5739762,26.82981797,112.5739904,26.82977773,112.5740048,26.82973659,112.5740185,26.82969752,112.5740324,26.82965751,112.5740466,26.82961668,112.57406,26.82957815,112.5740736,26.82953912,112.5740889,26.82949478,112.5741018,26.82945758,112.574115,26.82941969,112.5741286,26.82938128,112.5741418,26.82934446,112.5741565,26.82930484,112.5741718,26.82926535,112.5741873,26.82922699,112.5742027,26.82918967,112.5742192,26.82914978,112.5742349,26.82911184,112.5742491,26.82907713,112.5742631,26.82904236,112.5742775,26.82900665,112.5742914,26.82897283,112.5743051,26.82893948,112.5743175,26.82890905,112.5743294,26.82887934,112.5743412,26.82884938,112.5743534,26.82881806,112.5743662,26.82878494,112.5743792,26.82875159,112.5743932,26.82871695,112.5744066,26.82868419,112.574421,26.82864938,112.5744352,26.82861544,112.5744495,26.82858142,112.5744645,26.82854579,112.5744802,26.82850912,112.5744965,26.82847139,112.5745119,26.82843644,112.5745277,26.82840103,112.5745437,26.82836521,112.5745602,26.82832832,112.5745767,26.82829174,112.5745933,26.82825533,112.5746107,26.82821768,112.5746284,26.82817956,112.5746464,26.82814074,112.5746648,26.82810122,112.5746816,26.82806509,112.5746987,26.82802857,112.5747161,26.82799153,112.5747337,26.82795388,112.5747518,26.82791476,112.5747694,26.82787675,112.574788,26.82783641,112.574806,26.82779729,112.5748231,26.8277604,112.5748395,26.82772485,112.5748564,26.82768796,112.5748761,26.82764503,112.5748931,26.82760822,112.5749106,26.82757017,112.5749288,26.82753095,112.5749462,26.82749347,112.5749641,26.82745489,112.5749821,26.82741615,112.5750005,26.82737629,112.5750181,26.82733827,112.5750362,26.82729917,112.5750545,26.82725996,112.5750729,26.82722067,112.5750915,26.82718128,112.5751103,26.82714182,112.5751297,26.82710132,112.5751483,26.82706278,112.5751674,26.82702322,112.5751871,26.82698264,112.5752058,26.826944,112.5752251,26.82690436,112.5752444,26.82686463,112.5752644,26.8268238,112.5752836,26.82678487,112.5753034,26.82674487,112.5753233,26.82670481,112.5753432,26.82666475,112.5753631,26.82662487,112.5753828,26.82658516,112.5754031,26.82654453,112.5754223,26.82650587,112.5754421,26.82646619,112.5754619,26.82642647,112.5754823,26.82638576,112.5755017,26.826347,112.5755218,26.8263072,112.5755424,26.82626639,112.5755621,26.82622756,112.5755823,26.82618778,112.5756025,26.82614805,112.5756233,26.82610736,112.575643,26.82606871,112.5756633,26.82602905,112.5756843,26.82598828,112.5757044,26.8259494,112.5757253,26.8259094,112.5757462,26.82586928,112.5757678,26.82582818,112.5757884,26.82578909,112.5758095,26.82574899,112.5758308,26.82570888,112.5758521,26.8256687,112.5758736,26.82562842,112.5758957,26.82558697,112.5759169,26.82554742,112.5759365,26.82551078,112.5759557,26.82547503,112.575975,26.82543918,112.5759945,26.82540325,112.5760165,26.82536312,112.576037,26.82532598,112.5760593,26.82528568,112.5760823,26.82524415,112.5761058,26.82520135,112.5761282,26.82516047,112.5761512,26.8251184,112.5761715,26.82508155,112.5761918,26.8250446,112.5762122,26.8250075,112.5762328,26.82497025,112.5762536,26.8249329,112.5762747,26.82489549,112.576296,26.82485808,112.5763176,26.82482065,112.5763394,26.82478315,112.5763614,26.82474563,112.5763836,26.82470807,112.5764059,26.82467045,112.5764282,26.82463279,112.5764507,26.82459504,112.5764732,26.82455714,112.5764959,26.82451906,112.5765187,26.8244808,112.5765414,26.82444236,112.5765643,26.82440377,112.5765873,26.82436503,112.5766103,26.8243262,112.5766333,26.8242873,112.5766563,26.82424836,112.5766793,26.82420936,112.5767024,26.82417035,112.5767255,26.82413139,112.5767486,26.82409266,112.5767718,26.82405426,112.5767952,26.82401617,112.5768184,26.82397842,112.5768415,26.82394106,112.5768675,26.82389881,112.57689,26.8238624,112.5769121,26.82382648,112.5769377,26.82378503,112.5769617,26.82374607,112.5769862,26.82370623,112.5770106,26.82366648,112.5770325,26.8236307,112.577056,26.82359184,112.5770776,26.82355585,112.5770985,26.82352077,112.5771191,26.82348565,112.5771395,26.82345051,112.5771598,26.82341535,112.5771798,26.82338019,112.5772019,26.82334115,112.5772242,26.82330145,112.5772462,26.82326217,112.5772682,26.82322307,112.5772905,26.82318416,112.577313,26.82314536,112.5773362,26.82310578,112.5773584,26.8230684,112.5773813,26.82303052,112.5774047,26.82299227,112.5774275,26.82295555,112.5774498,26.82292036,112.5774726,26.82288478,112.577496,26.82284873,112.577518,26.82281481,112.5775436,26.82277584,112.5775668,26.8227404,112.5775889,26.82270667,112.5776116,26.82267202,112.577635,26.82263636,112.5776572,26.82260227,112.5776799,26.82256708,112.5777022,26.82253158,112.5777246,26.82249483,112.5777455,26.82245955,112.5777668,26.8224232,112.5777883,26.82238602,112.5778084,26.82235089,112.5778313,26.82231089,112.5778521,26.82227511,112.5778746,26.82223755,112.5778983,26.82219925,112.5779212,26.82216358,112.5779447,26.82212803,112.5779687,26.82209266,112.5779915,26.82205946,112.5780155,26.82202476,112.5780386,26.82199153,112.578063,26.82195673,112.5780866,26.82192336,112.5781108,26.82188914,112.5781349,26.82185496,112.5781588,26.82182106,112.578183,26.82178691,112.5782056,26.82175498,112.5782284,26.82172268,112.578252,26.82168907,112.5782738,26.82165769,112.578297,26.82162352,112.578319,26.82159035,112.57834,26.82155755,112.5783603,26.82152419,112.578379,26.82149185,112.5783968,26.82146083,112.5784156,26.8214279,112.5784338,26.82139713,112.5784526,26.82136704,112.5784737,26.82133537,112.5784954,26.82130434,112.5785179,26.82127371,112.5785392,26.82124509,112.5785613,26.82121474,112.5785826,26.82118459,112.578603,26.82115312,112.5786192,26.82112113,112.5786297,26.82108804,112.5786344,26.82105208,112.5786328,26.82101569,112.5786258,26.82097918,112.5786153,26.82094473,112.5786011,26.8209112,112.5785817,26.82087705,112.5785582,26.82084558,112.5785324,26.82081834,112.5785038,26.82079259,112.5784737,26.8207676,112.5784418,26.82074259,112.5784091,26.82071846,112.578379,26.82069718,112.5783473,26.82067552,112.5783147,26.82065364,112.5782815,26.82063157,112.5782474,26.82060937,112.5782152,26.82058867,112.5781801,26.8205663,112.5781471,26.8205455,112.5781091,26.82052165,112.5780759,26.82050087,112.578042,26.82047964,112.5780081,26.8204585,112.5779742,26.82043738,112.5779398,26.82041587,112.577907,26.82039532,112.5778726,26.82037382,112.57784,26.82035339,112.5778063,26.82033228,112.5777708,26.82030994,112.5777338,26.82028685"; + + private void loadRomaRoad() { + StringBuffer buffer = new StringBuffer(); + buffer.append(ROMA_ROAD).append(ROMA_ROAD_1); + setRoamTrajectory(buffer.toString()); + } + @Override public boolean onTouch(@Nullable MotionEvent motionEvent) { MogoMapListenerHandler.getInstance().onTouch(motionEvent); @@ -887,8 +908,10 @@ public class AMapViewWrapper implements IMogoMapView, return MAP_STYLE_VR_ANGLE_TOP; case 5: return MAP_STYLE_VR_ANGLE_CROSS; + case 7: + return MAP_STYLE_VR_ROMA; default: - throw new IllegalStateException("mode is unCorrect"); + return MODE_MEDIUM_SIGHT; } } @@ -1129,7 +1152,7 @@ public class AMapViewWrapper implements IMogoMapView, @Override public void setLockMode(boolean isLock) { if (checkAMapView()) { - mMapView.getMapAutoViewHelper().setLockMode(true); + mMapView.getMapAutoViewHelper().setLockMode(isLock); } } diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/AMapWrapper.java b/libraries/mogo-map/src/main/java/com/mogo/map/AMapWrapper.java index d2a1c9ab79..6b0c2a8c40 100644 --- a/libraries/mogo-map/src/main/java/com/mogo/map/AMapWrapper.java +++ b/libraries/mogo-map/src/main/java/com/mogo/map/AMapWrapper.java @@ -6,6 +6,7 @@ import android.graphics.Point; import android.util.Pair; import com.mogo.eagle.core.data.config.FunctionBuildConfig; +import com.mogo.eagle.core.data.map.MogoLatLng; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.map.center.CenterLine; import com.mogo.map.marker.AMapInfoWindowAdapter; @@ -39,8 +40,10 @@ import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; import mogo.telematics.pad.MessagePad; +import mogo.yycp.api.proto.SocketDownData; /** * @author congtaowang @@ -120,7 +123,25 @@ public class AMapWrapper implements IMogoMap { } }); long time = markerOptionsArrayList.get(0).getTime(); - MarkerHelper.INSTANCE.updateBatchMarkerPositon(markerOptionsArrayList, false, FunctionBuildConfig.isBeautyMode ? 8.0f : 0f, 1, time, 1); + MarkerHelper.INSTANCE.updateBatchMarkerPositon(markerOptionsArrayList, false, FunctionBuildConfig.isBeautyMode ? 8.0f : 0f, 1, time, 0); + } + + @SuppressLint("NewApi") + @Override + public void updateBatchAiMarkerPosition(HashMap optionsArrayList) { + if (!checkAMap()) { + return; + } + ArrayList markerOptionsArrayList = new ArrayList<>(); + optionsArrayList.forEach((s, trackedObject) -> { + MarkerSimpleData markerOptions = ObjectUtils.fromAiData(trackedObject); + if (markerOptions != null) { + markerOptionsArrayList.add(markerOptions); + } + }); + long time = markerOptionsArrayList.get(0).getTime(); + //todo 最后一个参数,是否管理锚点的删除 + MarkerHelper.INSTANCE.updateBatchMarkerPositon(markerOptionsArrayList, false, FunctionBuildConfig.isBeautyMode ? 8.0f : 0f, 1, time, 0); } @Override @@ -321,12 +342,17 @@ public class AMapWrapper implements IMogoMap { @Override public CenterLine getCenterLineRangeInfo(double lon, double lat, float angle, float distance) { - com.zhidaoauto.map.sdk.open.road.CenterLine info = MapDataApi.INSTANCE.getCenterLineRangeInfo(lon, lat, angle, distance); - CenterLine ret = null; - if (info != null) { - ret = new CenterLine(info.id, info.tile_id, info.road_id, info.lane_id, convert(info.points), info.angle == null ? 0f : info.angle); + try { + com.zhidaoauto.map.sdk.open.road.CenterLine info = MapDataApi.INSTANCE.getCenterLineRangeInfo(lon, lat, angle, distance); + CenterLine ret = null; + if (info != null) { + ret = new CenterLine(info.id, info.tile_id, info.road_id, info.lane_id, convert(info.points), info.angle == null ? 0f : info.angle); + } + return ret; + } catch (Throwable t) { + t.printStackTrace(); + return null; } - return ret; } @Override @@ -339,6 +365,12 @@ public class AMapWrapper implements IMogoMap { return null; } + @Override + public MogoLatLng switchLonLat(double lon, double lat) { + LonLatPoint lonLatPoint = MapTools.INSTANCE.switchLonLat(new LonLatPoint(lon,lat)); + return new MogoLatLng(lonLatPoint.latitude,lonLatPoint.longitude); + } + private List> convert(List points) { if (points == null || points.isEmpty()) { return Collections.emptyList(); diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapUIController.java b/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapUIController.java index f92b08dae0..431623fe4e 100644 --- a/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapUIController.java +++ b/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapUIController.java @@ -68,7 +68,6 @@ public class MogoMapUIController implements IMogoMapUIController { return MapControlResult.ERROR; } - @Override public void changeMapVisualAngle(VisualAngleMode angelMode, MogoLatLng mogoLatLng) { initDelegate(); @@ -78,6 +77,23 @@ public class MogoMapUIController implements IMogoMapUIController { } } + @Override + public void setRoamTrajectory(String trajectory) { + initDelegate(); + if (mDelegate != null) { + mDelegate.setRoamTrajectory(trajectory); + } + } + + @Override + public void setRomaMode(int mode) { + initDelegate(); + if (mDelegate != null) { + CallerLogger.INSTANCE.d(TAG, "set setRomaMode: " + mode); + mDelegate.setRomaMode(mode); + } + } + @Override public VisualAngleMode getCurrentMapVisualAngle() { initDelegate(); diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/MogoMarkerManager.java b/libraries/mogo-map/src/main/java/com/mogo/map/MogoMarkerManager.java index 184dabddf4..36635a93aa 100644 --- a/libraries/mogo-map/src/main/java/com/mogo/map/MogoMarkerManager.java +++ b/libraries/mogo-map/src/main/java/com/mogo/map/MogoMarkerManager.java @@ -15,6 +15,7 @@ import java.util.List; import java.util.Map; import mogo.telematics.pad.MessagePad; +import mogo.yycp.api.proto.SocketDownData; /** * @author congtaowang @@ -79,6 +80,15 @@ public class MogoMarkerManager implements IMogoMarkerManager { } } + @Override + public void updateBatchAiMarkerPosition(HashMap optionsArrayList) { + try { + MogoMap.getInstance().getMogoMap().updateBatchAiMarkerPosition(optionsArrayList); + } catch (Exception e) { + e.printStackTrace(); + } + } + @Override public String addPreVehicleModel(int type, int modelRes) { try { diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/uicontroller/AMapUIController.java b/libraries/mogo-map/src/main/java/com/mogo/map/uicontroller/AMapUIController.java index 67bd34ea4d..7b75cd8e64 100644 --- a/libraries/mogo-map/src/main/java/com/mogo/map/uicontroller/AMapUIController.java +++ b/libraries/mogo-map/src/main/java/com/mogo/map/uicontroller/AMapUIController.java @@ -68,6 +68,20 @@ public class AMapUIController implements IMogoMapUIController { } } + @Override + public void setRoamTrajectory(String trajectory) { + if (mClient != null) { + mClient.setRoamTrajectory(trajectory); + } + } + + @Override + public void setRomaMode(int mode) { + if (mClient != null) { + mClient.setRomaMode(mode); + } + } + @Override public VisualAngleMode getCurrentMapVisualAngle() { if (mClient != null) { diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/utils/ObjectUtils.java b/libraries/mogo-map/src/main/java/com/mogo/map/utils/ObjectUtils.java index a681ad9254..b3a7541987 100644 --- a/libraries/mogo-map/src/main/java/com/mogo/map/utils/ObjectUtils.java +++ b/libraries/mogo-map/src/main/java/com/mogo/map/utils/ObjectUtils.java @@ -48,6 +48,7 @@ import java.util.ArrayList; import java.util.List; import mogo.telematics.pad.MessagePad; +import mogo.yycp.api.proto.SocketDownData; /** * @author congtaowang @@ -142,6 +143,26 @@ public class ObjectUtils { return markerOptions; } + public static MarkerSimpleData fromAiData(SocketDownData.CloudRoadDataProto aiData) { + if (aiData == null) { + return null; + } + MarkerSimpleData markerOptions = null; + try { + markerOptions = new MarkerSimpleData(); + markerOptions.setId(aiData.getUuid().hashCode()); + markerOptions.setMarkerType(aiData.getType()); + markerOptions.setRotateAngle((float) aiData.getHeading()); + markerOptions.setLat(aiData.getWgslat()); + markerOptions.setLon(aiData.getWgslon()); + markerOptions.setTime(Double.valueOf(aiData.getSatelliteTime()).longValue()); + markerOptions.setColor("#00FF00FF"); + } catch (Exception e) { + e.printStackTrace(); + } + return markerOptions; + } + private static BitmapDescriptor getBitmapDescriptorFromMogo(MogoMarkerOptions options) { if (options == null) { return null;