diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPassengerTrafficLightView.kt b/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPassengerTrafficLightView.kt index f6d8d9f47c..67fbc4b554 100644 --- a/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPassengerTrafficLightView.kt +++ b/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPassengerTrafficLightView.kt @@ -6,7 +6,7 @@ import android.view.LayoutInflater import android.widget.LinearLayout import com.mogo.eagle.core.data.enums.DataSourceType import com.mogo.eagle.core.data.enums.TrafficLightEnum -import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener +import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTrafficLightListener import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager import com.mogo.eagle.core.utilcode.util.UiThreadHandler import com.mogo.och.bus.passenger.R diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperLimitingVelocityView.kt b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperLimitingVelocityView.kt index afb9ba0c65..17e414c40d 100644 --- a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperLimitingVelocityView.kt +++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperLimitingVelocityView.kt @@ -8,9 +8,10 @@ import android.widget.LinearLayout import com.mogo.eagle.core.data.enums.DataSourceType import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.LimitingVelocityView_TAG -import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener +import com.mogo.eagle.core.function.api.datacenter.union.ILimitingVelocityListener import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager +import com.mogo.eagle.core.utilcode.util.ThreadUtils import com.mogo.och.sweeper.R import kotlinx.android.synthetic.main.sweeper_limiting_speed.view.* @@ -34,11 +35,13 @@ class SweeperLimitingVelocityView( } override fun onLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) { - if (limitingVelocity > 0) { - this.visibility = View.VISIBLE - tvLimitingVelocity.text = "$limitingVelocity" - } else { - this.visibility = View.GONE + ThreadUtils.runOnUiThread { + if (limitingVelocity > 0) { + this.visibility = View.VISIBLE + tvLimitingVelocity.text = "$limitingVelocity" + } else { + this.visibility = View.GONE + } } } diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficDataView.java b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficDataView.java index 32db9adef0..0fb7be8343 100644 --- a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficDataView.java +++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficDataView.java @@ -10,16 +10,12 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.constraintlayout.widget.ConstraintLayout; -import com.mogo.eagle.core.data.enums.DataSourceType; import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGearStateListener; import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener; import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisSteeringStateListener; -import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener; import com.mogo.eagle.core.function.call.autopilot.CallerChassisGearStateListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerChassisSteeringStateListenerManager; -import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager; -import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager; import com.mogo.eagle.core.function.hmi.ui.widget.TapPositionView; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.util.ThreadUtils; @@ -89,7 +85,7 @@ public class SweeperTrafficDataView extends ConstraintLayout */ @Override public void onAutopilotLightSwitchData(@org.jetbrains.annotations.Nullable Chassis.LightSwitch lightSwitch) { - ThreadUtils.runOnUiThread { + ThreadUtils.runOnUiThread(() -> { //转向灯状态 0是正常 1是左转 2是右转 if (lightSwitch != null) { CallerLogger.INSTANCE.d(TAG, "车辆转向灯:" + lightSwitch.toString()); @@ -101,7 +97,7 @@ public class SweeperTrafficDataView extends ConstraintLayout sweeperTurnSignal.showDirection(); } } - } + }); } /** diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficLightView.kt b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficLightView.kt index d56a099ad8..19a7a466bd 100644 --- a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficLightView.kt +++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficLightView.kt @@ -6,7 +6,7 @@ import android.view.LayoutInflater import android.widget.LinearLayout import com.mogo.eagle.core.data.enums.DataSourceType import com.mogo.eagle.core.data.enums.TrafficLightEnum -import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener +import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTrafficLightListener import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager import com.mogo.eagle.core.utilcode.util.UiThreadHandler import com.mogo.och.sweeper.R 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 9a7964d873..8f52315f09 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 @@ -30,8 +30,8 @@ import com.mogo.eagle.core.data.msgbox.MsgBoxBean; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener; import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener; -import com.mogo.eagle.core.function.api.msgbox.IMsgBoxEventListener; -import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener; +import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxEventListener; +import com.mogo.eagle.core.function.api.datacenter.union.ILimitingVelocityListener; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager; 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 0173533e1e..d74028ff9d 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 @@ -2,7 +2,6 @@ package com.mogo.och.taxi.passenger.presenter; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI_P; -import android.location.Location; import android.os.Looper; import androidx.annotation.NonNull; @@ -12,7 +11,6 @@ import com.mogo.commons.AbsMogoApplication; import com.mogo.commons.mvp.Presenter; import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; -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.UiThreadHandler; import com.mogo.och.common.module.manager.OCHAdasAbilityManager; @@ -236,7 +234,8 @@ public class BaseTaxiPassengerPresenter extends Presenter - + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/FuncBizProvider.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/FuncBizProvider.kt index c820952fa3..d4b9bc0d22 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/FuncBizProvider.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/FuncBizProvider.kt @@ -17,6 +17,8 @@ import com.mogo.eagle.function.biz.v2x.overview.OverViewDataManager import com.mogo.eagle.function.biz.v2x.overview.db.OverviewDb import com.mogo.eagle.function.biz.v2x.road.LineUploadManager import com.mogo.eagle.function.biz.v2x.trafficlight.core.MogoTrafficLightManager +import com.mogo.eagle.function.biz.v2x.v2n.V2XEventManager +import com.mogo.eagle.function.biz.v2x.v2n.V2XPoiLoader.Companion.v2xPoiLoader import com.mogo.eagle.function.biz.v2x.vip.VipCarManager @Route(path = MogoServicePaths.PATH_FUNC_BIZ) @@ -35,6 +37,10 @@ class FuncBizProvider : IMoGoFuncBizProvider { OverviewDb.getDb(context) MogoTrafficLightManager.INSTANCE.initServer(context) VipCarManager.INSTANCE.initServer(context) + if(!(AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) + && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode))){ + V2XEventManager.init(context) + } if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){ LineUploadManager.getInstance(context)?.init() } @@ -84,12 +90,21 @@ class FuncBizProvider : IMoGoFuncBizProvider { OverViewDataManager.getAllV2XEventsByLineId(MoGoAiCloudClientConfig.getInstance().sn) } + override fun queryV2XEvents() { + v2xPoiLoader.queryWholeRoadEvents() + } + override fun onDestroy() { noticeSocketManager.release() dispatchAutoPilotManager.release() cronTaskManager.release() VipCarManager.INSTANCE.destroy() + + if(!(AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) + && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode))){ + V2XEventManager.onDestroy() + } if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){ mContext?.let { LineUploadManager.getInstance(it)?.onDestroy() diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/overview/OverViewDataManager.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/overview/OverViewDataManager.kt index eef88f1602..e022c3d245 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/overview/OverViewDataManager.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/overview/OverViewDataManager.kt @@ -22,7 +22,7 @@ import java.util.concurrent.TimeUnit object OverViewDataManager { - const val TAG = "OverViewDataManager" + private const val TAG = "OverViewDataManager" private val overviewDao by lazy { OverviewDb.getDb(AbsMogoApplication.getApp()).overviewDao() diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/overview/remote/OverViewServiceApi.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/overview/remote/OverViewServiceApi.kt index 365f5f0d29..ffdf2be1c6 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/overview/remote/OverViewServiceApi.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/overview/remote/OverViewServiceApi.kt @@ -1,5 +1,6 @@ package com.mogo.eagle.function.biz.v2x.overview.remote +import com.mogo.eagle.core.data.v2x.V2XEventResult import io.reactivex.Observable import retrofit2.http.GET import retrofit2.http.Query diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/overview/remote/V2XEventResult.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/overview/remote/V2XEventResult.kt deleted file mode 100644 index 0650d29817..0000000000 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/overview/remote/V2XEventResult.kt +++ /dev/null @@ -1,20 +0,0 @@ -package com.mogo.eagle.function.biz.v2x.overview.remote - -import androidx.annotation.Keep - -import com.google.gson.annotations.SerializedName -import com.mogo.eagle.core.data.BaseData -import com.mogo.eagle.core.data.v2x.V2XEvent - - -@Keep -data class V2XEventResult ( - @SerializedName("result") - var result: Result? -): BaseData() - -@Keep -data class Result( - @SerializedName("eventList") - var v2XEventList: List? -) \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/redlightwarning/RedLightWarningManager.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/redlightwarning/RedLightWarningManager.kt index d84b81416c..72c3b3431d 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/redlightwarning/RedLightWarningManager.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/redlightwarning/RedLightWarningManager.kt @@ -13,7 +13,7 @@ import com.mogo.eagle.core.data.msgbox.V2XMsg import com.mogo.eagle.core.data.trafficlight.* import com.mogo.eagle.core.data.trafficlight.TrafficLightStatusHelper.getCurrentRoadTrafficLight import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener -import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener +import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTrafficLightListener import com.mogo.eagle.core.function.api.v2x.IMoGoVipSetListener import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager 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/events/V2XEventManager.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/V2XEventManager.kt similarity index 72% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/V2XEventManager.kt index 920a297268..32fd455865 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/V2XEventManager.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.events +package com.mogo.eagle.function.biz.v2x.v2n import android.annotation.SuppressLint import android.content.Context @@ -7,16 +7,9 @@ import android.os.Handler import android.os.Looper import android.util.Log import androidx.localbroadcastmanager.content.LocalBroadcastManager -import com.mogo.cloud.passport.IMoGoTokenCallback -import com.mogo.cloud.passport.MoGoAiCloudClient -import com.mogo.cloud.passport.MoGoAiCloudClientConfig -import com.mogo.commons.constants.HostConst -import com.mogo.commons.module.ServiceConst.CARD_TYPE_ROAD_CONDITION -import com.mogo.commons.network.ParamsUtil 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 -import com.mogo.eagle.core.data.enums.DataSourceType import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.enums.EventTypeEnumNew import com.mogo.eagle.core.data.enums.EventTypeHelper @@ -28,11 +21,11 @@ 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.TrafficData +import com.mogo.eagle.core.data.v2x.V2XAdvanceWarning import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener import com.mogo.eagle.core.function.api.map.angle.* -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager import com.mogo.eagle.core.function.call.hmi.CallerHmiManager @@ -40,44 +33,37 @@ import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager 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.alarm.V2XAlarmServer -import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi -import com.mogo.eagle.core.function.v2x.events.consts.V2XConst.BROADCAST_SCENE_EXTRA_KEY -import com.mogo.eagle.core.function.v2x.events.consts.V2XConst.BROADCAST_SCENE_HANDLER_ACTION -import com.mogo.eagle.core.function.v2x.events.receiver.SceneBroadcastReceiver -import com.mogo.eagle.core.function.v2x.events.scenario.impl.V2XScenarioManager -import com.mogo.eagle.core.function.v2x.events.utils.toRoadMarker -import com.mogo.eagle.core.function.v2x.events.utils.toV2XRoadEventEntity -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.* -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.function.biz.v2x.v2n.alarm.V2XAlarmServer +import com.mogo.eagle.function.biz.v2x.v2n.bridge.BridgeApi +import com.mogo.eagle.function.biz.v2x.v2n.consts.V2XConst.BROADCAST_SCENE_EXTRA_KEY +import com.mogo.eagle.function.biz.v2x.v2n.consts.V2XConst.BROADCAST_SCENE_HANDLER_ACTION +import com.mogo.eagle.function.biz.v2x.v2n.receiver.SceneBroadcastReceiver +import com.mogo.eagle.function.biz.v2x.v2n.scenario.impl.V2XScenarioManager +import com.mogo.eagle.function.biz.v2x.v2n.utils.toRoadMarker +import com.mogo.eagle.core.data.v2x.V2XEvent +import com.mogo.eagle.core.data.v2x.V2XMarkerCardResult +import com.mogo.eagle.core.data.v2x.V2XWarningTarget +import com.mogo.eagle.core.function.api.cloud.IMoGoCloudListener +import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager +import com.mogo.eagle.function.biz.v2x.v2n.V2XPoiLoader.Companion.v2xPoiLoader import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.Logger 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.utilcode.util.UiThreadHandler import com.mogo.eagle.core.utilcode.util.Utils -import com.mogo.map.marker.MogoMarkersHandler.Companion.mogoMarkersHandler +import com.mogo.eagle.function.biz.v2x.v2n.network.callback.IV2XCallback +import com.mogo.eagle.function.biz.v2x.v2n.utils.toV2XRoadEventEntity import com.zhjt.service.chain.ChainLog import com.zhjt.service.chain.TracingConstants -import io.reactivex.android.schedulers.AndroidSchedulers -import io.reactivex.disposables.Disposable -import io.reactivex.schedulers.Schedulers import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.android.asCoroutineDispatcher import kotlinx.coroutines.cancel import kotlinx.coroutines.launch -import java.util.concurrent.TimeUnit import java.util.concurrent.atomic.AtomicBoolean import mogo.telematics.pad.MessagePad -object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback, IV2XCallback, - IMoGoAutopilotIdentifyListener { +object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback, + IMoGoAutopilotIdentifyListener, IMoGoCloudListener { private const val TAG = "V2XEventManager" @@ -87,57 +73,34 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback, private val hasInit by lazy { AtomicBoolean(false) } - - var v2xEventDisposable: Disposable? = null - fun init(context: Context) { BridgeApi.init(context) if (hasInit.compareAndSet(false, true)) { - if (!V2XManager.hasInit()) { - V2XManager.init(V2XConfig.Builder().also { - it.aiCloudConfig(MoGoAiCloudClientConfig.getInstance()) - it.context(context) - it.loggable(false) - it.distanceForTriggerRefresh(200f) //行驶超过200(包含)米,刷新道路周边信息(短链请求) - it.durationForTriggerRefresh( - 60, - TimeUnit.SECONDS - ) // 每隔1分钟,根据自车定位,刷新道路周边信息(短链请求) - it.executor(ThreadUtils.getIoPool()) //用到的线程池(IO类型) - it.staticParams(ParamsUtil.getStaticParams()) - }.build()) - V2XManager.start() - } registerListener() - V2XManager.forceRefresh() - MoGoAiCloudClient.getInstance().addTokenCallbacks(this) + v2xPoiLoader.startLoopPoi() // 注册广播接收场景弹窗使用的 SceneBroadcastReceiver.register(context) } } private fun registerListener() { - V2XManager.addCallback(this) - CallerChassisLocationGCJ02ListenerManager.addListener(TAG, this) + CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 1,this) + v2xPoiLoader.addCallback(this) + CallerCloudListenerManager.addListener(TAG,this) CallerAutopilotIdentifyListenerManager.addListener(TAG, this) } private fun unRegisterListener() { - V2XManager.removeCallback(this) CallerChassisLocationGCJ02ListenerManager.removeListener(TAG) + v2xPoiLoader.removeCallback(this) + CallerCloudListenerManager.removeListener(TAG) CallerAutopilotIdentifyListenerManager.removeListener(TAG) - mogoMarkersHandler.unregisterMarkerClickListener(CARD_TYPE_ROAD_CONDITION) } override fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) { BridgeApi.location.set(mogoLocation) mogoLocation?.let { - if (V2XManager.hasInit()) { - V2XManager.onLocationChanged( - longitude = it.longitude, - latitude = mogoLocation.latitude - ) - } + v2xPoiLoader.updateCheck(mogoLocation.longitude,mogoLocation.latitude) refreshCarState(mogoLocation) } } @@ -167,12 +130,6 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback, } } - override fun onTokenGot(token: String?, sn: String?) { - if (V2XManager.hasInit()) { - V2XManager.updateSnAndToken(sn, token) - } - } - /** * V2XEvent事件回调 */ @@ -202,12 +159,11 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback, handleWarningTargetEvent(event.data) } is V2XEvent.RoadAI -> { - if(FunctionBuildConfig.isV2NFromCar){ + if (FunctionBuildConfig.isV2NFromCar) { return } handleRoadMarkerEvent(event.data.toRoadMarker()) } - is V2XEvent.RoadEventX -> { handleRoadMarkerEvent(event.data.toRoadMarker()) } @@ -220,7 +176,7 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback, @SuppressLint("NewApi") override fun onAutopilotIdentifyPlanningObj(planningObjects: List?) { super.onAutopilotIdentifyPlanningObj(planningObjects) - if(!FunctionBuildConfig.isV2NFromCar){ + if (!FunctionBuildConfig.isV2NFromCar) { return } planningObjects?.let { @@ -277,6 +233,7 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback, } } + //todo 可优化,与obu解析类似 private fun handleAdvanceWarningEvent(event: V2XEvent.ForwardsWarning) { scope.launch { val message = event.data @@ -421,70 +378,10 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback, } } - 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") } - override fun onError(code: Int, msg: String?) {} - fun onDestroy() { if (hasInit.compareAndSet(true, false)) { try { @@ -494,6 +391,7 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback, } finally { unRegisterListener() } + v2xPoiLoader.stopLoopPoi() } } diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/V2XPoiLoader.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/V2XPoiLoader.kt new file mode 100644 index 0000000000..9fa780cba4 --- /dev/null +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/V2XPoiLoader.kt @@ -0,0 +1,184 @@ +package com.mogo.eagle.function.biz.v2x.v2n + +import android.os.Handler +import android.os.Looper +import com.mogo.cloud.passport.MoGoAiCloudClientConfig +import com.mogo.eagle.core.data.enums.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.v2x.V2XEvent +import com.mogo.eagle.core.data.v2x.V2XMarkerResponse +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager +import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant +import com.mogo.eagle.core.utilcode.util.UiThreadHandler +import com.mogo.eagle.function.biz.v2x.v2n.network.V2XRefreshModel +import com.mogo.eagle.function.biz.v2x.v2n.network.callback.IV2XCallback +import com.mogo.eagle.function.biz.v2x.v2n.network.callback.IV2XRefreshCallback +import com.mogo.eagle.function.biz.v2x.v2n.utils.DistanceUtils +import java.util.concurrent.CopyOnWriteArrayList +import java.util.concurrent.TimeUnit +import java.util.concurrent.atomic.AtomicReference + +class V2XPoiLoader private constructor() { + + companion object { + + private const val TAG = "V2XPoiLoader" + + val v2xPoiLoader by lazy(LazyThreadSafetyMode.SYNCHRONIZED) { + V2XPoiLoader() + } + } + + 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 handler by lazy { + Handler(Looper.getMainLooper()) + } + + private val cbs by lazy { + CopyOnWriteArrayList() + } + + /** + * 添加相关信息接口回调 + * @param cb 要添加的回调接口 + */ + fun addCallback(cb: IV2XCallback) { + if (cbs.contains(cb)) { + return + } + cbs += cb + } + + /** + * 移除相关信息接口回调 + * @param cb 要移除的回调接口 + */ + fun removeCallback(cb: IV2XCallback) { + if (!cbs.contains(cb)) { + return + } + cbs.remove(cb) + } + + fun updateCheck(longitude: Double, latitude: Double) { + 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) { + handler.removeCallbacks(refreshTask) + handler.post(refreshTask) + update = true + return + } + if (DistanceUtils.calculateLineDistance(oldLon, oldLat, longitude, latitude) >= 200f) { + handler.removeCallbacks(refreshTask) + handler.post(refreshTask) + update = true + } + } finally { + if (update) { + lastLatitude.set(latitude) + lastLongitude.set(longitude) + } + } + } + + /** + * 开启loop Poi事件 + */ + fun startLoopPoi() { + handler.removeCallbacks(refreshTask) + handler.post(refreshTask) + } + + private val refreshTask = object : Runnable { + override fun run() { + V2XRefreshModel.querySnapshot( + longitude = realLongitude.get(), latitude = realLatitude.get(), + refreshCallback + ) + handler.postDelayed(this, TimeUnit.SECONDS.toMillis(60)) + } + } + + fun stopLoopPoi() { + handler.removeCallbacks(refreshTask) + lastLatitude.set(0.0) + lastLongitude.set(0.0) + } + + 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 ?: "") + } + } + } + + + /** + * 查询全览路径上的事件信息 + */ + fun queryWholeRoadEvents() { + V2XRefreshModel.roadEventDispose() + 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 getLineId(): Long { + var lineId: Long = -1 + val parameter = CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo() + .autopilotControlParameters + if (parameter != null) { + if (parameter.autoPilotLine != null) { + lineId = parameter.autoPilotLine!!.lineId + CallerLogger.d(SceneConstant.M_V2X + TAG, "lineId为:$lineId") + } else { + CallerLogger.d(SceneConstant.M_V2X + TAG, "parameter.autoPilotLine为null") + } + } else { + CallerLogger.d(SceneConstant.M_V2X + TAG, "parameter为null") + } + return lineId + } + + private fun realQueryV2xEvents(lineId: String, sn: String) { + V2XRefreshModel.getRoadEvents(lineId, sn) { + val size = it?.size ?: 0 + if (size > 0) { + val msgBoxBean = + MsgBoxBean(MsgBoxType.V2X, V2XMsg("", "查询到当前全程共${size}个事件", "")) + msgBoxBean.sourceType = DataSourceType.SUMMARY + CallerMsgBoxManager.saveMsgBox(msgBoxBean) + } + } + } +} \ 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/alarm/V2XAlarmServer.java similarity index 99% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/alarm/V2XAlarmServer.java rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/alarm/V2XAlarmServer.java index 0156f41948..8c3b605103 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/alarm/V2XAlarmServer.java @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.events.alarm; +package com.mogo.eagle.function.biz.v2x.v2n.alarm; import com.mogo.eagle.core.data.enums.EventTypeEnumNew; import com.mogo.eagle.core.data.map.MogoLocation; diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/bridge/BridgeApi.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/bridge/BridgeApi.kt similarity index 58% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/bridge/BridgeApi.kt rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/bridge/BridgeApi.kt index 8a9b602209..366a3c55ef 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/bridge/BridgeApi.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/bridge/BridgeApi.kt @@ -1,11 +1,14 @@ -package com.mogo.eagle.core.function.v2x.events.bridge +package com.mogo.eagle.function.biz.v2x.v2n.bridge import android.content.Context import com.alibaba.android.arouter.launcher.ARouter import com.mogo.eagle.core.data.map.MogoLocation -import com.mogo.eagle.core.function.v2x.events.consts.MoGoV2XServicePaths -import com.mogo.eagle.core.function.v2x.events.manager.* +import com.mogo.eagle.function.biz.v2x.v2n.consts.MoGoV2XServicePaths import com.mogo.eagle.core.utilcode.util.Utils +import com.mogo.eagle.function.biz.v2x.v2n.manager.IMoGoPersonWarnPolylineManager +import com.mogo.eagle.function.biz.v2x.v2n.manager.IMoGoStopPolylineManager +import com.mogo.eagle.function.biz.v2x.v2n.manager.IMoGoV2XMarkerManager +import com.mogo.eagle.function.biz.v2x.v2n.manager.IMoGoWarnPolylineManager import java.lang.ref.WeakReference import java.util.concurrent.atomic.AtomicReference @@ -24,22 +27,28 @@ internal object BridgeApi { } private val v2xWarnPolyline by lazy { - ARouter.getInstance().build(MoGoV2XServicePaths.PATH_V2X_WARN_POLYLINE_MANAGER).navigation(context()) as? IMoGoWarnPolylineManager + ARouter.getInstance().build(MoGoV2XServicePaths.PATH_V2X_WARN_POLYLINE_MANAGER).navigation( + context() + ) as? IMoGoWarnPolylineManager } private val v2xPersonWarnPolyline by lazy { - ARouter.getInstance().build(MoGoV2XServicePaths.PATH_V2X_PERSON_WARN_POLYLINE_MANAGER).navigation(context()) as? IMoGoPersonWarnPolylineManager + ARouter.getInstance().build(MoGoV2XServicePaths.PATH_V2X_PERSON_WARN_POLYLINE_MANAGER).navigation( + context() + ) as? IMoGoPersonWarnPolylineManager } private val v2xStopPolyline by lazy { - ARouter.getInstance().build(MoGoV2XServicePaths.PATH_V2X_STOP_POLYLINE_MANAGER).navigation(context()) as? IMoGoStopPolylineManager + ARouter.getInstance().build(MoGoV2XServicePaths.PATH_V2X_STOP_POLYLINE_MANAGER).navigation( + context() + ) as? IMoGoStopPolylineManager } fun init(context: Context) { - this.context.set(WeakReference(context)) + BridgeApi.context.set(WeakReference(context)) } - fun context(): Context = this.context.get()?.get() ?: Utils.getApp() + fun context(): Context = context.get()?.get() ?: Utils.getApp() fun v2xMarker() = v2xMarker diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/consts/MoGoV2XServicePaths.java b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/consts/MoGoV2XServicePaths.java similarity index 94% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/consts/MoGoV2XServicePaths.java rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/consts/MoGoV2XServicePaths.java index cccd481291..4e4e959694 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/consts/MoGoV2XServicePaths.java +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/consts/MoGoV2XServicePaths.java @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.events.consts; +package com.mogo.eagle.function.biz.v2x.v2n.consts; import androidx.annotation.Keep; 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/consts/V2XConst.java similarity index 89% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/consts/V2XConst.java rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/consts/V2XConst.java index b6dee1cb0f..c2f4fd35d5 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/consts/V2XConst.java @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.events.consts; +package com.mogo.eagle.function.biz.v2x.v2n.consts; /** * author : donghongyu diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoPersonWarnPolylineManager.java b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/manager/IMoGoPersonWarnPolylineManager.java similarity index 91% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoPersonWarnPolylineManager.java rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/manager/IMoGoPersonWarnPolylineManager.java index d15a9c589d..81ff12f98f 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoPersonWarnPolylineManager.java +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/manager/IMoGoPersonWarnPolylineManager.java @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.events.manager; +package com.mogo.eagle.function.biz.v2x.v2n.manager; import android.content.Context; diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoStopPolylineManager.java b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/manager/IMoGoStopPolylineManager.java similarity index 91% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoStopPolylineManager.java rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/manager/IMoGoStopPolylineManager.java index e0cca0ed76..2df7a2d0fd 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoStopPolylineManager.java +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/manager/IMoGoStopPolylineManager.java @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.events.manager; +package com.mogo.eagle.function.biz.v2x.v2n.manager; import android.content.Context; 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/manager/IMoGoV2XMarkerManager.java similarity index 90% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoV2XMarkerManager.java rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/manager/IMoGoV2XMarkerManager.java index fdfe8dec63..4118457e0c 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/manager/IMoGoV2XMarkerManager.java @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.events.manager; +package com.mogo.eagle.function.biz.v2x.v2n.manager; import android.content.Context; @@ -6,7 +6,7 @@ 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.eagle.core.function.v2x.internal.data.V2XMarkerCardResult; +import com.mogo.eagle.core.data.v2x.V2XMarkerCardResult; import java.util.concurrent.CopyOnWriteArrayList; diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoWarnPolylineManager.java b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/manager/IMoGoWarnPolylineManager.java similarity index 91% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoWarnPolylineManager.java rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/manager/IMoGoWarnPolylineManager.java index a79527e857..b888d21d03 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/IMoGoWarnPolylineManager.java +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/manager/IMoGoWarnPolylineManager.java @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.events.manager; +package com.mogo.eagle.function.biz.v2x.v2n.manager; import android.content.Context; diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoPersonWarnPolylineManager.java b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/manager/impl/MoGoPersonWarnPolylineManager.java similarity index 88% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoPersonWarnPolylineManager.java rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/manager/impl/MoGoPersonWarnPolylineManager.java index 3f73403da5..e1da74057e 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoPersonWarnPolylineManager.java +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/manager/impl/MoGoPersonWarnPolylineManager.java @@ -1,18 +1,17 @@ -package com.mogo.eagle.core.function.v2x.events.manager.impl; +package com.mogo.eagle.function.biz.v2x.v2n.manager.impl; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X; import android.content.Context; import com.alibaba.android.arouter.facade.annotation.Route; -import com.mogo.commons.AbsMogoApplication; import com.mogo.eagle.core.data.map.MogoLatLng; import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; -import com.mogo.eagle.core.function.v2x.events.consts.MoGoV2XServicePaths; -import com.mogo.eagle.core.function.v2x.events.consts.V2XConst; +import com.mogo.eagle.function.biz.v2x.v2n.consts.MoGoV2XServicePaths; +import com.mogo.eagle.function.biz.v2x.v2n.consts.V2XConst; import com.mogo.eagle.core.data.v2x.DrawLineInfo; -import com.mogo.eagle.core.function.v2x.events.manager.IMoGoPersonWarnPolylineManager; +import com.mogo.eagle.function.biz.v2x.v2n.manager.IMoGoPersonWarnPolylineManager; import com.mogo.map.overlay.IMogoOverlayManager; import com.mogo.map.overlay.IMogoPolyline; import com.mogo.map.overlay.MogoPolylineOptions; diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoStopPolylineManager.java b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/manager/impl/MoGoStopPolylineManager.java similarity index 89% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoStopPolylineManager.java rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/manager/impl/MoGoStopPolylineManager.java index 287be0c2c7..806688aabf 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoStopPolylineManager.java +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/manager/impl/MoGoStopPolylineManager.java @@ -1,18 +1,17 @@ -package com.mogo.eagle.core.function.v2x.events.manager.impl; +package com.mogo.eagle.function.biz.v2x.v2n.manager.impl; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X; import android.content.Context; import com.alibaba.android.arouter.facade.annotation.Route; -import com.mogo.commons.AbsMogoApplication; import com.mogo.eagle.core.data.map.MogoLatLng; import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; -import com.mogo.eagle.core.function.v2x.events.consts.MoGoV2XServicePaths; -import com.mogo.eagle.core.function.v2x.events.consts.V2XConst; +import com.mogo.eagle.function.biz.v2x.v2n.consts.MoGoV2XServicePaths; +import com.mogo.eagle.function.biz.v2x.v2n.consts.V2XConst; import com.mogo.eagle.core.data.v2x.DrawLineInfo; -import com.mogo.eagle.core.function.v2x.events.manager.IMoGoStopPolylineManager; +import com.mogo.eagle.function.biz.v2x.v2n.manager.IMoGoStopPolylineManager; import com.mogo.map.overlay.IMogoOverlayManager; import com.mogo.map.overlay.IMogoPolyline; import com.mogo.map.overlay.MogoPolylineOptions; 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/manager/impl/MoGoV2XMarkerManager.java similarity index 91% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XMarkerManager.java rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/manager/impl/MoGoV2XMarkerManager.java index 327a28d209..b8d394e893 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/manager/impl/MoGoV2XMarkerManager.java @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.events.manager.impl; +package com.mogo.eagle.function.biz.v2x.v2n.manager.impl; import static com.mogo.commons.module.ServiceConst.CARD_TYPE_NOVELTY; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X; @@ -16,14 +16,11 @@ import com.mogo.eagle.core.data.map.entity.MarkerShowEntity; import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager; import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager; -import com.mogo.eagle.core.function.v2x.events.consts.MoGoV2XServicePaths; -import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XMarkerManager; -import com.mogo.eagle.core.function.v2x.events.marker.V2XMarkerAdapter; -import com.mogo.eagle.core.function.v2x.events.utils.EntityUtilsKt; -import com.mogo.eagle.core.function.v2x.events.utils.MapUtils; -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 com.mogo.eagle.function.biz.v2x.v2n.consts.MoGoV2XServicePaths; +import com.mogo.eagle.function.biz.v2x.v2n.manager.IMoGoV2XMarkerManager; +import com.mogo.eagle.function.biz.v2x.v2n.marker.V2XMarkerAdapter; +import com.mogo.eagle.function.biz.v2x.v2n.utils.MapUtils; +import com.mogo.eagle.core.data.v2x.V2XMarkerCardResult; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.map.marker.IMogoMarker; import com.mogo.map.marker.IMogoMarkerClickListener; diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoWarnPolylineManager.java b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/manager/impl/MoGoWarnPolylineManager.java similarity index 92% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoWarnPolylineManager.java rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/manager/impl/MoGoWarnPolylineManager.java index a5ed5eda32..b0ae820d1f 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoWarnPolylineManager.java +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/manager/impl/MoGoWarnPolylineManager.java @@ -1,17 +1,16 @@ -package com.mogo.eagle.core.function.v2x.events.manager.impl; +package com.mogo.eagle.function.biz.v2x.v2n.manager.impl; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X; import android.content.Context; import com.alibaba.android.arouter.facade.annotation.Route; -import com.mogo.commons.AbsMogoApplication; import com.mogo.eagle.core.data.map.MogoLatLng; import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; -import com.mogo.eagle.core.function.v2x.events.consts.MoGoV2XServicePaths; +import com.mogo.eagle.function.biz.v2x.v2n.consts.MoGoV2XServicePaths; import com.mogo.eagle.core.data.v2x.DrawLineInfo; -import com.mogo.eagle.core.function.v2x.events.manager.IMoGoWarnPolylineManager; +import com.mogo.eagle.function.biz.v2x.v2n.manager.IMoGoWarnPolylineManager; import com.mogo.map.overlay.IMogoOverlayManager; import com.mogo.map.overlay.IMogoPolyline; import com.mogo.map.overlay.MogoPolylineOptions; 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/marker/V2XMarkerAdapter.java similarity index 98% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/marker/V2XMarkerAdapter.java rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/marker/V2XMarkerAdapter.java index 12a6e872f0..a144505d5c 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/marker/V2XMarkerAdapter.java @@ -1,11 +1,11 @@ -package com.mogo.eagle.core.function.v2x.events.marker; +package com.mogo.eagle.function.biz.v2x.v2n.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.function.v2x.events.view.V2XMarkerRoadEventView; +import com.mogo.eagle.core.function.biz.R; +import com.mogo.eagle.function.biz.v2x.v2n.view.V2XMarkerRoadEventView; import java.util.ArrayList; /** 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/network/V2XRefreshModel.kt similarity index 51% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/http/V2XRefreshModel.kt rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/network/V2XRefreshModel.kt index f3e8a4f56a..cbf3207f39 100644 --- 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/network/V2XRefreshModel.kt @@ -1,17 +1,22 @@ -package com.mogo.eagle.core.function.v2x.internal.http +package com.mogo.eagle.function.biz.v2x.v2n.network 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.cloud.passport.MoGoAiCloudClientConfig +import com.mogo.commons.AbsMogoApplication import com.mogo.commons.constants.HostConst -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.commons.network.ParamsUtil +import com.mogo.eagle.core.data.v2x.V2XEventData +import com.mogo.eagle.core.data.v2x.V2XLocation +import com.mogo.eagle.core.data.v2x.V2XMarkerResponse +import com.mogo.eagle.function.biz.v2x.v2n.network.api.V2XApiService +import com.mogo.eagle.function.biz.v2x.v2n.network.body.V2XRefreshEntity +import com.mogo.eagle.function.biz.v2x.v2n.network.callback.IV2XRefreshCallback +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 com.mogo.eagle.core.utilcode.util.DeviceUtils import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.disposables.Disposable @@ -21,17 +26,18 @@ internal class V2XRefreshModel { companion object { + private const val TAG = "V2XRefreshModel" + fun querySnapshot( longitude: Double, latitude: Double, callback: IV2XRefreshCallback? ): Disposable? { - val config = V2XManager.getConfig() val retrofit = RetrofitFactory.getInstance(HostConst.getEagleHost()) ?: return null return retrofit .create(V2XApiService::class.java) - .querySnapshotSync(buildParams(longitude, latitude, config)) - .subscribeOn(Schedulers.from(config.executor)) + .querySnapshotSync(buildParams(longitude, latitude)) + .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe({ data -> if (data == null) { @@ -51,9 +57,8 @@ internal class V2XRefreshModel { private fun buildParams( longitude: Double, latitude: Double, - config: V2XConfig ): Map = mutableMapOf().apply { - putAll(config.staticParams.let { + putAll(ParamsUtil.getStaticParams().let { val handled = mutableMapOf() it.asIterable().forEach { itx -> val value = itx.value @@ -63,10 +68,10 @@ internal class V2XRefreshModel { } handled }) - this["netType"] = CommonUtils.getNetworkType(config.context) + this["netType"] = CommonUtils.getNetworkType(AbsMogoApplication.getApp()) this["cellId"] = DeviceUtils.getCellId() ?: "" - this["sn"] = config.aiCloudConfig.sn - this["ticket"] = config.aiCloudConfig.token + this["sn"] = MoGoAiCloudClientConfig.getInstance().sn + this["ticket"] = MoGoAiCloudClientConfig.getInstance().token this["sig"] = SignUtil.createSign(this, "JGjZx6") this["data"] = GsonUtil.jsonFromObject(V2XRefreshEntity().apply { limit = 999 @@ -79,6 +84,34 @@ internal class V2XRefreshModel { viewPush = true }) } + + private var v2xEventDisposable: Disposable? = null + + fun roadEventDispose(){ + if (v2xEventDisposable != null && !v2xEventDisposable!!.isDisposed) { + v2xEventDisposable!!.dispose() + } + } + + fun getRoadEvents(lineId: String, sn: String, onSuccess:((List?) -> Unit)){ + v2xEventDisposable = MoGoRetrofitFactory.getInstance(HostConst.getHost()) + .create(V2XApiService::class.java) + .queryAllV2XEventsByLineId(lineId, sn) + .map { + if (it.code == 200 || it.code == 0) { + CallerLogger.d(SceneConstant.M_V2X + TAG, "请求成功,size为:${it.result?.v2XEventList?.size}") + return@map it.result?.v2XEventList + } else { + CallerLogger.d(SceneConstant.M_V2X + TAG, "请求失败,code为:${it.code}") + return@map ArrayList() + } + } + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe { + onSuccess.invoke(it) + } + } } diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/network/api/V2XApiService.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/network/api/V2XApiService.kt new file mode 100644 index 0000000000..2730863ae3 --- /dev/null +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/network/api/V2XApiService.kt @@ -0,0 +1,18 @@ +package com.mogo.eagle.function.biz.v2x.v2n.network.api + +import com.mogo.eagle.core.data.v2x.V2XEventResult +import com.mogo.eagle.core.data.v2x.V2XMarkerResponse +import io.reactivex.Maybe +import io.reactivex.Observable +import retrofit2.http.* + +internal interface V2XApiService { + + @FormUrlEncoded + @POST("eagle-eye-dns/yycp-launcherSnapshot/launcherSnapshot/querySnapshotSync") + fun querySnapshotSync(@FieldMap parameters: Map): Maybe + + @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/internal/http/body/V2XRefreshEntity.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/network/body/V2XRefreshEntity.kt similarity index 86% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/http/body/V2XRefreshEntity.kt rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/network/body/V2XRefreshEntity.kt index 82d5661ab5..fead17f6fb 100644 --- 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/network/body/V2XRefreshEntity.kt @@ -1,7 +1,7 @@ -package com.mogo.eagle.core.function.v2x.internal.http.body +package com.mogo.eagle.function.biz.v2x.v2n.network.body import androidx.annotation.Keep -import com.mogo.eagle.core.function.v2x.internal.data.V2XLocation +import com.mogo.eagle.core.data.v2x.V2XLocation /** * 刷新地图信息接口 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/network/callback/IV2XCallback.kt similarity index 85% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/callback/IV2XCallback.kt rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/network/callback/IV2XCallback.kt index f755c465e4..e4778e5baf 100644 --- 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/network/callback/IV2XCallback.kt @@ -1,6 +1,6 @@ -package com.mogo.eagle.core.function.v2x.internal.callback +package com.mogo.eagle.function.biz.v2x.v2n.network.callback -import com.mogo.eagle.core.function.v2x.internal.event.V2XEvent +import com.mogo.eagle.core.data.v2x.V2XEvent interface IV2XCallback { 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/network/callback/IV2XRefreshCallback.kt similarity index 67% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/http/callback/IV2XRefreshCallback.kt rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/network/callback/IV2XRefreshCallback.kt index 3fb17ffef7..2dd97cb6be 100644 --- 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/network/callback/IV2XRefreshCallback.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.internal.http.callback +package com.mogo.eagle.function.biz.v2x.v2n.network.callback /** * 刷新回调 diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/receiver/SceneBroadcastReceiver.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/receiver/SceneBroadcastReceiver.kt similarity index 85% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/receiver/SceneBroadcastReceiver.kt rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/receiver/SceneBroadcastReceiver.kt index 44a19d8500..1d07fc9312 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/receiver/SceneBroadcastReceiver.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/receiver/SceneBroadcastReceiver.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.events.receiver +package com.mogo.eagle.function.biz.v2x.v2n.receiver import android.content.BroadcastReceiver import android.content.Context @@ -6,8 +6,8 @@ import android.content.Intent import android.content.IntentFilter import androidx.localbroadcastmanager.content.LocalBroadcastManager import com.mogo.eagle.core.data.map.entity.V2XMessageEntity -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.function.biz.v2x.v2n.consts.V2XConst +import com.mogo.eagle.function.biz.v2x.v2n.scenario.impl.V2XScenarioManager class SceneBroadcastReceiver : BroadcastReceiver() { diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/remove/MarkerRemoveManager.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/remove/MarkerRemoveManager.kt similarity index 99% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/remove/MarkerRemoveManager.kt rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/remove/MarkerRemoveManager.kt index 5afb5fc401..cc40d5d4ff 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/remove/MarkerRemoveManager.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/remove/MarkerRemoveManager.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.events.remove +package com.mogo.eagle.function.biz.v2x.v2n.remove import android.os.Handler import android.os.HandlerThread diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/IV2XScenario.java b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/IV2XScenario.java similarity index 92% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/IV2XScenario.java rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/IV2XScenario.java index 40ef63740f..99ed07daf8 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/IV2XScenario.java +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/IV2XScenario.java @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.events.scenario; +package com.mogo.eagle.function.biz.v2x.v2n.scenario; import com.mogo.eagle.core.data.map.entity.V2XMessageEntity; diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/IV2XScenarioManager.java b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/IV2XScenarioManager.java similarity index 84% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/IV2XScenarioManager.java rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/IV2XScenarioManager.java index 7e055dcca3..13e03f1f10 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/IV2XScenarioManager.java +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/IV2XScenarioManager.java @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.events.scenario; +package com.mogo.eagle.function.biz.v2x.v2n.scenario; import com.mogo.eagle.core.data.map.entity.V2XMessageEntity; 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/impl/AbsV2XScenario.java similarity index 88% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/impl/AbsV2XScenario.java rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/impl/AbsV2XScenario.java index 88baed92e0..6708c38ef9 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/impl/AbsV2XScenario.java @@ -1,11 +1,11 @@ -package com.mogo.eagle.core.function.v2x.events.scenario.impl; +package com.mogo.eagle.function.biz.v2x.v2n.scenario.impl; import androidx.annotation.Nullable; 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 com.mogo.eagle.function.biz.v2x.v2n.scenario.IV2XScenario; +import com.mogo.eagle.function.biz.v2x.v2n.scenario.view.IV2XMarker; import java.util.concurrent.atomic.AtomicReference; 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/impl/V2XScenarioManager.java similarity index 89% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/impl/V2XScenarioManager.java rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/impl/V2XScenarioManager.java index d9d77b72df..20061490ec 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/impl/V2XScenarioManager.java @@ -1,22 +1,18 @@ -package com.mogo.eagle.core.function.v2x.events.scenario.impl; +package com.mogo.eagle.function.biz.v2x.v2n.scenario.impl; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X; -import android.content.Intent; - import androidx.localbroadcastmanager.content.LocalBroadcastManager; import com.mogo.commons.module.status.MogoStatusManager; import com.mogo.eagle.core.data.config.HmiBuildConfig; import com.mogo.eagle.core.data.map.entity.V2XMessageEntity; import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager; -import com.mogo.eagle.core.function.v2x.events.consts.V2XConst; -import com.mogo.eagle.core.function.v2x.events.scenario.IV2XScenarioManager; -import com.mogo.eagle.core.function.v2x.events.scenario.scene.road.V2XRoadEventScenario; -import com.mogo.eagle.core.function.v2x.events.scenario.scene.warning.V2XFrontWarningScenario; +import com.mogo.eagle.function.biz.v2x.v2n.scenario.IV2XScenarioManager; +import com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.road.V2XRoadEventScenario; +import com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.warning.V2XFrontWarningScenario; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.util.ThreadUtils; -import com.mogo.eagle.core.utilcode.util.Utils; import com.mogo.map.uicontroller.IMogoMapUIController; import com.mogo.map.uicontroller.VisualAngleMode; 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/airoad/AiRoadMarker.kt similarity index 96% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/airoad/AiRoadMarker.kt rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/airoad/AiRoadMarker.kt index c088868c50..91f0bbbf7a 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/airoad/AiRoadMarker.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad +package com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.airoad import android.animation.ArgbEvaluator import android.graphics.Color @@ -11,7 +11,7 @@ import com.mogo.eagle.core.data.map.MogoLatLng import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity import com.mogo.eagle.core.function.call.autopilot.* import com.mogo.eagle.core.function.call.map.* -import com.mogo.eagle.core.function.v2x.events.scenario.scene.road.V2XAiRoadEventMarker +import com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.road.V2XAiRoadEventMarker import com.mogo.eagle.core.utilcode.mogo.logger.Logger import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils import com.mogo.map.MogoMap @@ -20,8 +20,8 @@ import com.mogo.map.overlay.MogoPolylineOptions import java.util.* import java.util.concurrent.atomic.AtomicReference import java.util.concurrent.ConcurrentHashMap -import com.mogo.eagle.core.function.v2x.events.remove.MarkerRemoveManager -import com.mogo.eagle.core.function.v2x.events.remove.MarkerWrapper +import com.mogo.eagle.function.biz.v2x.v2n.remove.MarkerRemoveManager +import com.mogo.eagle.function.biz.v2x.v2n.remove.MarkerWrapper /** * Ai云道路施工事件,道路颜色标记类 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/road/V2XAiRoadEventMarker.kt similarity index 88% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XAiRoadEventMarker.kt rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/road/V2XAiRoadEventMarker.kt index 2a1ee214bd..6ffc579935 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/road/V2XAiRoadEventMarker.kt @@ -1,14 +1,13 @@ -package com.mogo.eagle.core.function.v2x.events.scenario.scene.road +package com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.road import android.graphics.Color 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.V2XRoadEventEntity import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager -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.remove.MarkerWrapper +import com.mogo.eagle.function.biz.v2x.v2n.bridge.BridgeApi.context +import com.mogo.eagle.function.biz.v2x.v2n.bridge.BridgeApi.v2xMarker +import com.mogo.eagle.function.biz.v2x.v2n.remove.MarkerWrapper import com.mogo.map.marker.IMogoMarker import com.mogo.map.overlay.IMogoPolyline import com.mogo.map.overlay.MogoPolylineOptions 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/road/V2XRoadEventMarker.java similarity index 87% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventMarker.java rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/road/V2XRoadEventMarker.java index b97689f35b..992c0c3c33 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/road/V2XRoadEventMarker.java @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.events.scenario.scene.road; +package com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.road; import android.util.Log; import androidx.core.util.Pair; @@ -6,12 +6,12 @@ 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.remove.MarkerWrapper; -import com.mogo.eagle.core.function.v2x.events.remove.MarkerRemoveManager; -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.function.biz.v2x.v2n.bridge.BridgeApi; +import com.mogo.eagle.function.biz.v2x.v2n.manager.IMoGoV2XMarkerManager; +import com.mogo.eagle.function.biz.v2x.v2n.remove.MarkerWrapper; +import com.mogo.eagle.function.biz.v2x.v2n.remove.MarkerRemoveManager; +import com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.airoad.AiRoadMarker; +import com.mogo.eagle.function.biz.v2x.v2n.scenario.view.IV2XMarker; import com.mogo.map.marker.IMogoMarker; import java.util.ArrayList; import java.util.List; 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/road/V2XRoadEventScenario.java similarity index 97% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventScenario.java rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/road/V2XRoadEventScenario.java index c604e02cc3..27f28c1e21 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/road/V2XRoadEventScenario.java @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.events.scenario.scene.road; +package com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.road; import com.mogo.commons.AbsMogoApplication; import com.mogo.eagle.core.data.enums.EventTypeEnumNew; @@ -17,8 +17,8 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.hmi.CallerHmiManager; 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.scenario.impl.AbsV2XScenario; -import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker; +import com.mogo.eagle.function.biz.v2x.v2n.scenario.impl.AbsV2XScenario; +import com.mogo.eagle.function.biz.v2x.v2n.scenario.view.IV2XMarker; import com.mogo.eagle.core.network.utils.GsonUtil; import com.mogo.eagle.core.utilcode.mogo.logger.Logger; import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr; diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XFrontWarningScenario.java b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/warning/V2XFrontWarningScenario.java similarity index 95% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XFrontWarningScenario.java rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/warning/V2XFrontWarningScenario.java index 5ee305f4b3..18573dfa04 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XFrontWarningScenario.java +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/warning/V2XFrontWarningScenario.java @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.events.scenario.scene.warning; +package com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.warning; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X; @@ -21,9 +21,9 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Liste 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.msgbox.CallerMsgBoxManager; -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.function.v2x.internal.data.V2XWarningTarget; +import com.mogo.eagle.function.biz.v2x.v2n.scenario.impl.AbsV2XScenario; +import com.mogo.eagle.function.biz.v2x.v2n.scenario.view.IV2XMarker; +import com.mogo.eagle.core.data.v2x.V2XWarningTarget; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import java.math.BigDecimal; diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XWarningMarker.java b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/warning/V2XWarningMarker.java similarity index 97% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XWarningMarker.java rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/warning/V2XWarningMarker.java index b81750d42c..8ad6643354 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XWarningMarker.java +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/warning/V2XWarningMarker.java @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.events.scenario.scene.warning; +package com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.warning; import static com.mogo.eagle.core.data.constants.DataTypes.TYPE_MARKER_CLOUD_STOP_LINE_DATA; import static com.mogo.eagle.core.data.constants.DataTypes.TYPE_MARKER_CLOUD_WARN_DATA; @@ -13,13 +13,13 @@ import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.data.v2x.DrawLineInfo; import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager; import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager; -import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi; -import com.mogo.eagle.core.function.v2x.events.manager.IMoGoPersonWarnPolylineManager; -import com.mogo.eagle.core.function.v2x.events.manager.IMoGoStopPolylineManager; -import com.mogo.eagle.core.function.v2x.events.manager.IMoGoWarnPolylineManager; -import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker; -import com.mogo.eagle.core.function.v2x.internal.data.V2XLocation; -import com.mogo.eagle.core.function.v2x.internal.data.V2XWarningTarget; +import com.mogo.eagle.function.biz.v2x.v2n.bridge.BridgeApi; +import com.mogo.eagle.function.biz.v2x.v2n.manager.IMoGoPersonWarnPolylineManager; +import com.mogo.eagle.function.biz.v2x.v2n.manager.IMoGoStopPolylineManager; +import com.mogo.eagle.function.biz.v2x.v2n.manager.IMoGoWarnPolylineManager; +import com.mogo.eagle.function.biz.v2x.v2n.scenario.view.IV2XMarker; +import com.mogo.eagle.core.data.v2x.V2XLocation; +import com.mogo.eagle.core.data.v2x.V2XWarningTarget; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler; import com.mogo.eagle.core.utilcode.util.UiThreadHandler; diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/view/IV2XMarker.java b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/view/IV2XMarker.java similarity index 77% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/view/IV2XMarker.java rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/view/IV2XMarker.java index 8dcf008880..7a88880088 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/view/IV2XMarker.java +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/view/IV2XMarker.java @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.events.scenario.view; +package com.mogo.eagle.function.biz.v2x.v2n.scenario.view; /** * author : donghongyu diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/test/TestConsts.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/test/TestConsts.kt similarity index 79% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/test/TestConsts.kt rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/test/TestConsts.kt index 98e85df379..4aa9ccd60f 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/test/TestConsts.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/test/TestConsts.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.events.test +package com.mogo.eagle.function.biz.v2x.v2n.test class TestConsts { diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/test/TestOnLineCarUtils.java b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/test/TestOnLineCarUtils.java similarity index 98% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/test/TestOnLineCarUtils.java rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/test/TestOnLineCarUtils.java index 08a55061f4..ed34ea7a0f 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/test/TestOnLineCarUtils.java +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/test/TestOnLineCarUtils.java @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.events.test; +package com.mogo.eagle.function.biz.v2x.v2n.test; import static com.mogo.eagle.core.data.map.entity.V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING; @@ -7,8 +7,8 @@ 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.map.entity.V2XWarningEntity; -import com.mogo.eagle.core.function.v2x.R; import com.mogo.eagle.core.data.v2x.V2XOptimalRouteDataRes; +import com.mogo.eagle.core.function.biz.R; import com.mogo.eagle.core.network.utils.GsonUtil; import com.mogo.eagle.core.utilcode.util.Utils; diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/test/TestV2XReceiver.java b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/test/TestV2XReceiver.java similarity index 97% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/test/TestV2XReceiver.java rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/test/TestV2XReceiver.java index acd5440e71..12ece21973 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/test/TestV2XReceiver.java +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/test/TestV2XReceiver.java @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.events.test; +package com.mogo.eagle.function.biz.v2x.v2n.test; import android.content.BroadcastReceiver; import android.content.Context; @@ -10,7 +10,7 @@ import com.mogo.eagle.core.data.map.MogoLatLng; import com.mogo.eagle.core.data.map.entity.V2XMessageEntity; import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; import com.mogo.eagle.core.data.v2x.V2XOptimalRouteDataRes; -import com.mogo.eagle.core.function.v2x.events.consts.V2XConst; +import com.mogo.eagle.function.biz.v2x.v2n.consts.V2XConst; import java.util.List; 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/utils/DistanceUtils.kt similarity index 96% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/utils/DistanceUtils.kt rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/utils/DistanceUtils.kt index 43f59ca92c..89538c294e 100644 --- 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-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/utils/DistanceUtils.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.internal.utils +package com.mogo.eagle.function.biz.v2x.v2n.utils import kotlin.math.asin import kotlin.math.cos diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/EntityUtils.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/utils/EntityUtils.kt similarity index 94% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/EntityUtils.kt rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/utils/EntityUtils.kt index 0b8602e86e..89b9608339 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/EntityUtils.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/utils/EntityUtils.kt @@ -1,12 +1,13 @@ -package com.mogo.eagle.core.function.v2x.events.utils +package com.mogo.eagle.function.biz.v2x.v2n.utils import androidx.core.util.Pair import com.mogo.eagle.core.data.enums.EventTypeEnumNew.Companion.isRoadEvent 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.scenario.scene.airoad.AiRoadMarker -import com.mogo.eagle.core.function.v2x.internal.data.* +import com.mogo.eagle.core.data.v2x.V2XMarkerCardResult +import com.mogo.eagle.core.data.v2x.V2XRoadXData +import com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.airoad.AiRoadMarker import com.mogo.eagle.core.utilcode.util.CoordinateTransform import mogo.telematics.pad.MessagePad import roadwork.Road diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/MapUtils.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/utils/MapUtils.kt similarity index 96% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/MapUtils.kt rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/utils/MapUtils.kt index c49b645366..3615906cb1 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/MapUtils.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/utils/MapUtils.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.events.utils +package com.mogo.eagle.function.biz.v2x.v2n.utils import android.content.Context import android.graphics.Rect diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/view/V2XMarkerRoadEventView.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/view/V2XMarkerRoadEventView.kt similarity index 95% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/view/V2XMarkerRoadEventView.kt rename to core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/view/V2XMarkerRoadEventView.kt index c9d1589194..dc1640cb25 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/view/V2XMarkerRoadEventView.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/view/V2XMarkerRoadEventView.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.events.view +package com.mogo.eagle.function.biz.v2x.v2n.view import android.content.Context @@ -7,7 +7,7 @@ import android.view.LayoutInflater import androidx.constraintlayout.widget.ConstraintLayout 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.function.biz.R import com.mogo.eagle.core.utilcode.util.ViewUtils import kotlinx.android.synthetic.main.view_marker_event_car.view.* diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/vip/VipCarManager.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/vip/VipCarManager.kt index 915a90d83e..39a009b500 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/vip/VipCarManager.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/vip/VipCarManager.kt @@ -19,7 +19,7 @@ import com.mogo.eagle.core.data.trafficlight.currentRoadTrafficLight import com.mogo.eagle.core.data.trafficlight.isGreen import com.mogo.eagle.core.data.trafficlight.isRed import com.mogo.eagle.core.data.v2x.VipMessage -import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener +import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTrafficLightListener import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager import com.mogo.eagle.core.function.call.hmi.CallerHmiManager import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_1.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_1.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_1.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi-1920x1000/v_to_x_marker_1.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi-1920x1000/v_to_x_warning_car_red.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi-1920x1000/v_to_x_warning_car_red.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi-1920x1000/v_to_x_warning_car_red.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi-1920x1000/v_to_x_warning_car_red.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_marker_1.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_marker_1.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_marker_1.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_marker_1.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_car_red.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_car_red.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_car_red.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_car_red.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00011.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00011.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00011.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00011.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00012.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00012.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00012.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00012.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00013.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00013.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00013.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00013.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00014.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00014.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00014.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00014.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00015.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00015.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00015.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00015.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00016.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00016.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00016.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00016.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00017.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00017.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00017.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00017.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00018.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00018.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00018.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00018.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00019.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00019.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00019.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00019.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00020.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00020.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00020.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00020.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00021.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00021.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00021.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00021.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00022.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00022.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00022.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00022.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00023.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00023.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00023.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00023.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00024.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00024.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00024.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00024.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00025.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00025.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00025.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00025.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00026.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00026.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00026.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00026.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00027.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00027.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00027.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00027.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00028.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00028.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00028.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00028.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00029.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00029.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00029.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00029.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00030.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00030.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00030.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00030.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00031.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00031.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00031.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00031.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00032.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00032.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00032.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00032.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00033.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00033.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00033.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00033.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00034.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00034.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00034.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00034.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00035.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00035.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00035.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00035.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00036.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00036.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00036.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00036.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00037.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00037.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00037.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00037.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00038.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00038.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00038.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00038.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00039.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00039.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00039.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00039.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00040.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00040.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00040.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00040.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00041.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00041.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00041.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00041.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00042.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00042.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00042.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00042.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00043.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00043.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00043.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00043.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00044.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00044.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00044.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00044.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00045.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00045.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00045.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00045.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00046.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00046.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00046.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00046.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00047.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00047.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00047.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00047.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00048.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00048.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00048.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_orange_00048.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00011.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00011.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00011.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00011.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00012.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00012.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00012.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00012.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00013.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00013.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00013.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00013.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00014.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00014.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00014.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00014.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00015.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00015.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00015.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00015.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00016.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00016.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00016.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00016.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00017.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00017.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00017.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00017.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00018.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00018.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00018.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00018.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00019.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00019.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00019.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00019.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00020.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00020.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00020.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00020.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00021.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00021.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00021.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00021.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00022.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00022.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00022.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00022.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00023.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00023.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00023.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00023.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00024.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00024.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00024.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00024.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00025.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00025.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00025.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00025.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00026.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00026.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00026.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00026.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00027.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00027.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00027.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00027.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00028.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00028.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00028.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00028.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00029.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00029.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00029.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00029.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00030.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00030.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00030.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00030.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00031.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00031.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00031.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00031.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00032.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00032.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00032.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00032.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00033.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00033.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00033.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00033.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00034.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00034.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00034.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00034.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00035.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00035.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00035.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00035.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00036.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00036.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00036.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00036.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00037.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00037.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00037.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00037.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00038.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00038.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00038.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00038.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00039.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00039.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00039.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00039.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00040.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00040.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00040.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00040.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00041.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00041.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00041.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00041.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00042.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00042.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00042.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00042.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00043.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00043.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00043.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00043.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00044.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00044.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00044.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00044.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00045.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00045.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00045.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00045.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00046.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00046.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00046.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00046.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00047.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00047.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00047.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00047.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00048.png b/core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00048.png similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00048.png rename to core/function-impl/mogo-core-function-biz/src/main/res/drawable-xhdpi/v_to_x_warning_circle_red_00048.png diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/layout/view_marker_event_car.xml b/core/function-impl/mogo-core-function-biz/src/main/res/layout/view_marker_event_car.xml similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/layout/view_marker_event_car.xml rename to core/function-impl/mogo-core-function-biz/src/main/res/layout/view_marker_event_car.xml diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/layout/view_marker_event_road.xml b/core/function-impl/mogo-core-function-biz/src/main/res/layout/view_marker_event_road.xml similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/layout/view_marker_event_road.xml rename to core/function-impl/mogo-core-function-biz/src/main/res/layout/view_marker_event_road.xml diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/raw/scenario_road_event_data.json b/core/function-impl/mogo-core-function-biz/src/main/res/raw/scenario_road_event_data.json similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/raw/scenario_road_event_data.json rename to core/function-impl/mogo-core-function-biz/src/main/res/raw/scenario_road_event_data.json diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/raw/scenario_warning_event_data_left.json b/core/function-impl/mogo-core-function-biz/src/main/res/raw/scenario_warning_event_data_left.json similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/raw/scenario_warning_event_data_left.json rename to core/function-impl/mogo-core-function-biz/src/main/res/raw/scenario_warning_event_data_left.json diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/raw/scenario_warning_event_data_pedestrians.json b/core/function-impl/mogo-core-function-biz/src/main/res/raw/scenario_warning_event_data_pedestrians.json similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/raw/scenario_warning_event_data_pedestrians.json rename to core/function-impl/mogo-core-function-biz/src/main/res/raw/scenario_warning_event_data_pedestrians.json diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/raw/scenario_warning_event_data_right.json b/core/function-impl/mogo-core-function-biz/src/main/res/raw/scenario_warning_event_data_right.json similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/raw/scenario_warning_event_data_right.json rename to core/function-impl/mogo-core-function-biz/src/main/res/raw/scenario_warning_event_data_right.json diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/raw/test_coordinates.json b/core/function-impl/mogo-core-function-biz/src/main/res/raw/test_coordinates.json similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/raw/test_coordinates.json rename to core/function-impl/mogo-core-function-biz/src/main/res/raw/test_coordinates.json diff --git a/core/function-impl/mogo-core-function-v2x/src/main/res/raw/test_data_v2x_zuiyouluxian.json b/core/function-impl/mogo-core-function-biz/src/main/res/raw/test_data_v2x_zuiyouluxian.json similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/res/raw/test_data_v2x_zuiyouluxian.json rename to core/function-impl/mogo-core-function-biz/src/main/res/raw/test_data_v2x_zuiyouluxian.json diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/aicloud/AiCloudSocketBizProvider.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/aicloud/AiCloudSocketBizProvider.kt new file mode 100644 index 0000000000..8f94b5a59d --- /dev/null +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/aicloud/AiCloudSocketBizProvider.kt @@ -0,0 +1,28 @@ +package com.mogo.eagle.core.function.datacenter.aicloud + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.mogo.cloud.socket.SocketManager +import com.mogo.commons.AbsMogoApplication +import com.mogo.eagle.core.data.constants.MogoServicePaths +import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider + +@Route(path = MogoServicePaths.PATH_AI_CLOUD) +class AiCloudSocketBizProvider : IMoGoFunctionServerProvider { + override val functionName: String + get() = "AiCloudSocketBizProvider" + + override fun init(context: Context?) { + SocketManager.getInstance().init(AbsMogoApplication.getApp(), 0.0, 0.0) + SocketManager.getInstance().registerOnMessageListener(401012, V2XMessageListener401012()) + SocketManager.getInstance().registerOnMessageListener(401018, V2XMessageListener401018()) + SocketManager.getInstance().registerOnMessageListener(402000, V2XMessageListener402000()) + SocketManager.getInstance().registerOnMessageListener(404000, V2XMessageListener404000()) + //SocketManager.getInstance().registerOnMessageListener(503000, V2XMessageListener503000()) + SocketManager.getInstance().registerOnMessageListener(70001, V2XMessageListener70001()) + } + + override fun onDestroy() { + + } +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/aicloud/V2XMessageListener.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/aicloud/V2XMessageListener.kt new file mode 100644 index 0000000000..059f4ce01a --- /dev/null +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/aicloud/V2XMessageListener.kt @@ -0,0 +1,96 @@ +package com.mogo.eagle.core.function.datacenter.aicloud + +import com.mogo.cloud.socket.IMogoCloudSocketOnMessageListener +import com.mogo.eagle.core.data.v2x.* +import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager +import roadwork.Road + +internal class V2XMessageListener70001: IMogoCloudSocketOnMessageListener { + + override fun target(msgType: Int): Class = V2XRoadXData::class.java + + override fun onMsgReceived(msgType: Int, data: V2XRoadXData?) { + if (msgType != 70001) { + return + } + if (data == null) { + return + } + CallerCloudListenerManager.invokeSocketAck(V2XEvent.RoadEventX(data = data)) + } +} + +internal class V2XMessageListener401012: IMogoCloudSocketOnMessageListener { + + override fun target(msgType: Int): Class = V2XMarkerCardResult::class.java + + override fun onMsgReceived(msgType: Int, data: V2XMarkerCardResult?) { + if (msgType != 401012) { + return + } + if (data == null) { + return + } + CallerCloudListenerManager.invokeSocketAck(V2XEvent.Road(data = data)) + } +} + +internal class V2XMessageListener401018: IMogoCloudSocketOnMessageListener { + + override fun target(msgType: Int): Class = V2XWarningTarget::class.java + + override fun onMsgReceived(msgType: Int, data: V2XWarningTarget?) { + if (msgType != 401018) { + return + } + if (data == null) { + return + } + CallerCloudListenerManager.invokeSocketAck(V2XEvent.Warning(data = data)) + } +} + +internal class V2XMessageListener402000: IMogoCloudSocketOnMessageListener { + + override fun target(msgType: Int): Class = V2XOptimalRoute::class.java + + override fun onMsgReceived(msgType: Int, data: V2XOptimalRoute?) { + if (msgType != 402000) { + return + } + if (data == null) { + return + } + CallerCloudListenerManager.invokeSocketAck(V2XEvent.OptimalRoute(data = data)) + } +} + +internal class V2XMessageListener404000: IMogoCloudSocketOnMessageListener { + + override fun target(msgType: Int): Class = V2XAdvanceWarning::class.java + + override fun onMsgReceived(msgType: Int, data: V2XAdvanceWarning?) { + if (msgType != 404000) { + return + } + if (data == null) { + return + } + CallerCloudListenerManager.invokeSocketAck(V2XEvent.ForwardsWarning(data = data)) + } +} + +internal class V2XMessageListener503000: IMogoCloudSocketOnMessageListener { + + override fun target(msgType: Int): Class = Road.RW_PB::class.java + + override fun onMsgReceived(msgType: Int, data: Road.RW_PB?) { + if (msgType != 503000) { + return + } + if (data == null) { + return + } + CallerCloudListenerManager.invokeSocketAck(V2XEvent.RoadAI(data = data)) + } +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasMsgConnectStatusListenerImpl.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasMsgConnectStatusListenerImpl.kt index 6a19fe588d..f96c1a7bde 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasMsgConnectStatusListenerImpl.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasMsgConnectStatusListenerImpl.kt @@ -1,5 +1,6 @@ package com.mogo.eagle.core.function.datacenter.autopilot.adapter +import android.content.Context import com.mogo.cloud.passport.MoGoAiCloudClientConfig import com.mogo.commons.debug.DebugConfig.* import com.mogo.eagle.core.data.config.FunctionBuildConfig @@ -27,12 +28,15 @@ class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener, IMoGoAutopilotStatusListener, IMoGoCloudListener { - private val TAG = "ConnectStatus" + + companion object{ + private const val TAG = "ConnectStatus" + } private var connectStatus = false init { - CallerCloudListenerManager.registerCloudListener(TAG, this) + CallerCloudListenerManager.addListener(TAG, this) } override fun onConnectionIPCStatus(ipcConnectionStatus: Int, reason: String?) { diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/server/AsyncDataToAutopilotServer.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/server/AsyncDataToAutopilotServer.kt index a5bfe75e4b..6a33aa8008 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/server/AsyncDataToAutopilotServer.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/server/AsyncDataToAutopilotServer.kt @@ -1,7 +1,7 @@ package com.mogo.eagle.core.function.datacenter.autopilot.server import com.mogo.eagle.core.data.trafficlight.TrafficLightResult -import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener +import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTrafficLightListener import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MoGoObuProvider.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MoGoObuProvider.kt index 29eb90cdbc..0e6f1f200d 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MoGoObuProvider.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MoGoObuProvider.kt @@ -20,7 +20,6 @@ import com.mogo.support.obu.MogoObuManager @Route(path = MogoServicePaths.PATH_V2X_OBU_MOGO) class MoGoObuProvider : IMoGoObuProvider { private val TAG = "MoGoObuProvider" - private var mContext: Context? = null private val taxiObuIp = "192.168.1.199" //obu的taxi和bus的ip已经全部统一成1网段ip @@ -36,10 +35,11 @@ class MoGoObuProvider : IMoGoObuProvider { MogoObuDcCombineManager.INSTANCE.init(context) CallerLogger.d("$M_OBU$TAG", "初始化蘑菇自研OBU…… localIp = " + CommonUtils.getLocalIPAddress()) - //bus乘客版本obu功能去掉,大理项目需要全部车辆接收,不在限制 + //bus乘客版本obu功能去掉,大理项目需要全部车辆接收,不再限制 mContext = context mContext?.let { - val ipAddress = SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, taxiObuIp) + val ipAddress = + SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, taxiObuIp) //mogo obu MogoPrivateObuNewManager.INSTANCE.connectObu( it, @@ -53,32 +53,28 @@ class MoGoObuProvider : IMoGoObuProvider { * 通过控制面板设置ip,进行传递 */ override fun connect(ipAddress: String) { - if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) - && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) - ) { - //不处理 - } else { - mContext?.let { - // 保存本地OBU IP地址 - SharedPrefsMgr.getInstance(it).putString(MoGoConfig.OBU_IP, ipAddress) + mContext?.let { + // 保存本地OBU IP地址 + SharedPrefsMgr.getInstance(it).putString(MoGoConfig.OBU_IP, ipAddress) - //连接 mogo obu - MogoPrivateObuNewManager.INSTANCE.connectObu( - it, - ipAddress, - CommonUtils.getIpAddressString() - ) - - } + //连接 mogo obu + MogoPrivateObuNewManager.INSTANCE.connectObu( + it, + ipAddress, + CommonUtils.getIpAddressString() + ) } } override fun disConnect() { - MogoPrivateObuNewManager.INSTANCE.disconnect() + MogoPrivateObuNewManager.INSTANCE.disConnectObu() } override fun isConnected(): Boolean { - return MogoObuManager.getInstance().connectStatus == 1 + return MogoPrivateObuNewManager.INSTANCE.isConnected() } + override fun setObuLog(isChecked: Boolean) { + MogoPrivateObuNewManager.INSTANCE.setObuLog(isChecked) + } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt index 71a0eab932..7ab13fcfb4 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt @@ -29,9 +29,11 @@ import com.mogo.support.obu.ObuBase import com.mogo.support.obu.ObuScene import com.mogo.support.obu.constants.MogoObuComType import com.mogo.support.obu.constants.MogoObuConstants +import com.mogo.support.obu.constants.MogoObuLogLevel import com.mogo.support.obu.constants.MogoObuTopicId import com.mogo.support.obu.model.* import com.mogo.support.obu.option.MogoObuCom +import com.mogo.support.obu.option.MogoObuLog import com.mogo.support.obu.option.MogoObuOptions import com.zhidao.support.obu.ObuManager import com.zhidao.support.obu.OnObuListener @@ -74,7 +76,7 @@ class MogoPrivateObuNewManager private constructor() { .build() //每次连接的时候如果连接连接了,先断开,防止ip改变等导致的连接失败 - if (ObuManager.getInstance().connectStatus == 1) { + if (ObuManager.getInstance().connectStatus == MogoObuConstants.CONNECT_STATUS.CONNECTED) { try { ObuManager.getInstance().disconnect() } catch (e: Exception) { @@ -84,12 +86,32 @@ class MogoPrivateObuNewManager private constructor() { ObuManager.getInstance().connect(options) } - fun getMogoObuListener(): OnObuListener { - return mogoObuListener + /** + * 断开新obu + */ + fun disConnectObu() { + try { + ObuManager.getInstance().disconnect() + } catch (e: Exception) { + e.printStackTrace() + } } - fun disconnect() { - ObuManager.getInstance().disconnect() + /** + * 新obu是否连接 + */ + fun isConnected(): Boolean { + return ObuManager.getInstance().connectStatus == MogoObuConstants.CONNECT_STATUS.CONNECTED + } + + fun setObuLog(isChecked: Boolean) { + ObuManager.getInstance().setEnableLog(isChecked) + val builder: com.mogo.support.obu.option.MogoObuLog.Builder = + MogoObuLog.newBuilder().setEnableStdio(isChecked) + if (isChecked) { + builder.setStdioLevel(MogoObuLogLevel.DBG) + } + ObuManager.getInstance().logConfig(builder.build()) } private val mogoObuListener: OnObuListener = object : OnObuListener { @@ -133,15 +155,16 @@ class MogoPrivateObuNewManager private constructor() { * v2v预警信息 CvxRvInfoIndInfo CvxV2vThreatIndInfo 他车 */ override fun onObuRvWarning(data: ObuScene.RvWarningData) { -// if (HmiBuildConfig.isShowObuV2vView) { //TODO 临时需要关闭v2v开关 - if (data.warningMsg != null && !data.warningMsg.warningDataList.isNullOrEmpty()) { - // 更新数据,远车数据,之前要匹配uuid - TrafficDataConvertUtilsNew.cvxRvInfoIndInfo2TrafficData(data.vehBasicsMsg)?.let { - CallerMapUIServiceManager.getMarkerService()?.updateITrafficLocationInfo(it) - } + if (HmiBuildConfig.isShowObuV2vView) { + if (data.warningMsg != null) { + // 更新数据,远车数据,之前要匹配uuid + TrafficDataConvertUtilsNew.cvxRvInfoIndInfo2TrafficData(data.vehBasicsMsg) + ?.let { + CallerMapUIServiceManager.getMarkerService() + ?.updateITrafficLocationInfo(it) + } - CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", data.toString()) - data.let { + CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", data.toString()) //预警信息,预警类型 threat_level 2、3 data.vehBasicsMsg?.let { //预警方位 @@ -150,14 +173,12 @@ class MogoPrivateObuNewManager private constructor() { var appId = "" var level = -1 var status = -1 - data.warningMsg?.let { - if (data.warningMsg.warningDataList != null && data.warningMsg.warningDataList.size > 0) { - level = data.warningMsg.warningDataList[0].warningLevel - appId = data.warningMsg.warningDataList[0].warningType.toString() - status = data.warningMsg.warningDataList[0].status - //拼凑数据 - handleSdkObu(appId, direction, status, level, data) - } + if (data.warningMsg.warningDataList != null && data.warningMsg.warningDataList.size > 0) { + level = data.warningMsg.warningDataList[0].warningLevel + appId = data.warningMsg.warningDataList[0].warningType.toString() + status = data.warningMsg.warningDataList[0].status + //拼凑数据 + handleSdkObu(appId, direction, status, level, data) } CallerLogger.d( @@ -169,224 +190,230 @@ class MogoPrivateObuNewManager private constructor() { } } } -// } } /** * 红绿灯预警信息 CvxIvpThreatIndInfo */ override fun onObuSpatWarning(data: ObuScene.SpatWarningData) { - handlerTrafficLight( - data.warningType, - data.status, - data.lightsList - ) + if (HmiBuildConfig.isShowObuV2iView) { + handlerTrafficLight( + data.warningType, + data.status, + data.lightsList + ) + } } /** * RSI预警信息 onMogoObuRsiWarning(交通标志预警(前方限速、前方学校等等),交通事件预警(前方拥堵、前方积水等等)) */ override fun onObuRsiWarning(data: ObuScene.RsiWarningData) { -// if (HmiBuildConfig.isShowObuV2iView) { - if (data.warningMsgList != null && data.warningMsgList.size > 0) { - var alertContent = "" - var ttsContent = "" - var appId = data.warningMsgList[0].sceneType.toString() - val status = data.status - val level = data.warningMsgList[0].warningLevel - val direction = getMessageDirection(data.warningMsgList[0].targetPosition) - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", - "onMogoObuRsiWarning appId = $appId --status = $status --level = $level -- eventSerialNum = ${data.warningMsgList[0].eventSerialNum} ---signSerialNum = ${data.warningMsgList[0].signSerialNum} --- direction = $direction -- targetPosition = ${data.warningMsgList[0].targetPosition}" - ) + if (HmiBuildConfig.isShowObuV2iView) { + if (data.warningMsgList != null && data.warningMsgList.size > 0) { + var alertContent = "" + var ttsContent = "" + var appId = data.warningMsgList[0].sceneType.toString() + val status = data.status + val level = data.warningMsgList[0].warningLevel + val direction = getMessageDirection(data.warningMsgList[0].targetPosition) + CallerLogger.d( + "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", + "onMogoObuRsiWarning appId = $appId --status = $status --level = $level -- eventSerialNum = ${data.warningMsgList[0].eventSerialNum} ---signSerialNum = ${data.warningMsgList[0].signSerialNum} --- direction = $direction -- targetPosition = ${data.warningMsgList[0].targetPosition}" + ) - if (appId != "0") { - when (appId) { - // 道路危险情况预警 - MogoObuConstants.RSI_SCENE_TYPE.HLW.toString() -> { - when (data.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 - } + if (appId != "0") { + when (appId) { + // 道路危险情况预警 + MogoObuConstants.RSI_SCENE_TYPE.HLW.toString() -> { + when (data.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 + 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(data.warningMsgList[0].distance).toString(), + Math.round(data.warningMsgList[0].eventRadius).toString() + ) + ttsContent = String.format( + ttsContent, + Math.round(data.warningMsgList[0].distance).toString(), + Math.round(data.warningMsgList[0].eventRadius).toString() + ) } - alertContent = EventTypeEnumNew.getWarningContent(appId) - ttsContent = EventTypeEnumNew.getWarningTts(appId) - alertContent = String.format( //事件才有影响范围 - alertContent, - Math.round(data.warningMsgList[0].distance).toString(), - Math.round(data.warningMsgList[0].eventRadius).toString() - ) - ttsContent = String.format( - ttsContent, - Math.round(data.warningMsgList[0].distance).toString(), - Math.round(data.warningMsgList[0].eventRadius).toString() - ) - } - //车内标牌 - MogoObuConstants.RSI_SCENE_TYPE.IVS.toString() -> { - when (data.warningMsgList[0].signSerialNum) { - 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.RSI_SCENE_TYPE.IVS.toString() -> { + when (data.warningMsgList[0].signSerialNum) { + 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_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 + 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(data.warningMsgList[0].distance).toString() + ) + ttsContent = String.format( + ttsContent, + Math.round(data.warningMsgList[0].distance).toString() + ) } - alertContent = EventTypeEnumNew.getWarningContent(appId) - ttsContent = EventTypeEnumNew.getWarningTts(appId) - alertContent = String.format( //标牌是没有影响范围的 - alertContent, - Math.round(data.warningMsgList[0].distance).toString() - ) - ttsContent = String.format( - ttsContent, - Math.round(data.warningMsgList[0].distance).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(data.warningMsgList[0].distance).toString(), - Math.round(data.warningMsgList[0].eventRadius).toString() - ) - ttsContent = String.format( - ttsContent, - Math.round(data.warningMsgList[0].distance).toString(), - Math.round(data.warningMsgList[0].eventRadius).toString() - ) - } - - //限速预警, ADD处理一次 - MogoObuConstants.RSI_SCENE_TYPE.SLW.toString() -> { - appId = EventTypeEnumNew.TYPE_USECASE_ID_ROAD_SPEED_LIMIT.poiType - alertContent = EventTypeEnumNew.getWarningContent(appId) - ttsContent = EventTypeEnumNew.getWarningTts(appId) - } - } - - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", - "new onMogoObuRsiWarning appId = $appId ---status = $status --- ttsContent = $ttsContent --alertContent = $alertContent -- eventSerialNum = ${data.warningMsgList[0].eventSerialNum} ---signSerialNum = ${data.warningMsgList[0].signSerialNum} ---direction = ${direction.direction} --distance = ${ - Math.round(data.warningMsgList[0].distance) - } ---eventRadius = ${Math.round(data.warningMsgList[0].eventRadius)} --speedMaxLimit = ${data.warningMsgList[0].speedMaxLimit.toInt()}" - ) - - when (status) { - MogoObuConstants.STATUS.ADD -> { // 添加 - //不显示弹框,语音提示,数据在消息盒子里面展示,此处不在处理弹框 - if (alertContent.isEmpty() || ttsContent.isEmpty()) { - return + // 拥堵 + 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(data.warningMsgList[0].distance).toString(), + Math.round(data.warningMsgList[0].eventRadius).toString() + ) + ttsContent = String.format( + ttsContent, + Math.round(data.warningMsgList[0].distance).toString(), + Math.round(data.warningMsgList[0].eventRadius).toString() + ) } - saveObuData(appId, alertContent, ttsContent) - showWarning(appId, alertContent, ttsContent, direction) - // 更新数据 - TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(data)?.let { - CallerMapUIServiceManager.getMarkerService() - ?.updateITrafficThreatLevelInfo(it) + //限速预警, ADD处理一次 + MogoObuConstants.RSI_SCENE_TYPE.SLW.toString() -> { + appId = EventTypeEnumNew.TYPE_USECASE_ID_ROAD_SPEED_LIMIT.poiType + alertContent = EventTypeEnumNew.getWarningContent(appId) + ttsContent = EventTypeEnumNew.getWarningTts(appId) } } - MogoObuConstants.STATUS.UPDATE -> { // 更新 - } + CallerLogger.d( + "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", + "new onMogoObuRsiWarning appId = $appId ---status = $status --- ttsContent = $ttsContent --alertContent = $alertContent -- eventSerialNum = ${data.warningMsgList[0].eventSerialNum} ---signSerialNum = ${data.warningMsgList[0].signSerialNum} ---direction = ${direction.direction} --distance = ${ + Math.round(data.warningMsgList[0].distance) + } ---eventRadius = ${Math.round(data.warningMsgList[0].eventRadius)} --speedMaxLimit = ${data.warningMsgList[0].speedMaxLimit.toInt()}" + ) - MogoObuConstants.STATUS.DELETE -> { // 删除 - // 更新数据 - TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(data) - ?.let { - // 事件结束,还原车辆颜色 - it.threatLevel = 0x01 - CallerMapUIServiceManager.getMarkerService() - ?.updateITrafficInfo(it) + when (status) { + MogoObuConstants.STATUS.ADD -> { // 添加 + //不显示弹框,语音提示,数据在消息盒子里面展示,此处不在处理弹框 + if (alertContent.isEmpty() || ttsContent.isEmpty()) { + return } + saveObuData(appId, alertContent, ttsContent) + showWarning(appId, alertContent, ttsContent, direction) + + // 更新数据 + TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(data) + ?.let { + CallerMapUIServiceManager.getMarkerService() + ?.updateITrafficThreatLevelInfo(it) + } + } + + MogoObuConstants.STATUS.UPDATE -> { // 更新 + } + + MogoObuConstants.STATUS.DELETE -> { // 删除 + // 更新数据 + TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(data) + ?.let { + // 事件结束,还原车辆颜色 + it.threatLevel = 0x01 + CallerMapUIServiceManager.getMarkerService() + ?.updateITrafficInfo(it) + } + } } } } } -// } } /** @@ -405,133 +432,135 @@ class MogoPrivateObuNewManager private constructor() { "$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 - } - - val ttsContent = EventTypeEnumNew.getWarningTts(v2xType) - val alertContent = - EventTypeEnumNew.getWarningContent(v2xType) - var level = -1 - val direction = getMessageDirection(data.participant.targetPosition) - - //物体数据绘制 - CallerLogger.d( - "$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) - } + 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 } - MogoObuConstants.STATUS.UPDATE -> { // 更新 - } + val ttsContent = EventTypeEnumNew.getWarningTts(v2xType) + val alertContent = + EventTypeEnumNew.getWarningContent(v2xType) + var level = -1 + val direction = getMessageDirection(data.participant.targetPosition) - MogoObuConstants.STATUS.DELETE -> { // 删除 - // 更新数据 TODO 删除原来的,改变颜色,删除marker。不影响别的模型添加 - TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data) - ?.let { - // 事件结束,还原交通参与者颜色 - it.threatLevel = 0x01 - CallerMapUIServiceManager.getMarkerService() - ?.updateITrafficThreatLevelInfo(it) - } - - //删除弱势交通元素 - CallerMapUIServiceManager.getMarkerService() - ?.removeCvxRvInfoIndInfo(data.participant.ptcId.toString()) - } - } - - //预警status - if (data.warningMsg != null && data.warningMsg.warningDataList != null && data.warningMsg.warningDataList.size > 0) { - level = data.warningMsg.warningDataList[0].warningLevel //默认是1个 + //物体数据绘制 CallerLogger.d( "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", - "onMogoObuRsmWarning ---status---> ${data.status} ---data.warningMsg.warningData[0].status = ${data.warningMsg.warningDataList[0].status} ---v2xType = $v2xType ---alertContent = $alertContent ---ttsContent = $ttsContent ---level = $level" + "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.warningMsg.warningDataList[0].status) { + when (data.status) { MogoObuConstants.STATUS.ADD -> { // 添加 - //更新模型的颜色 + // 更新数据,模型变色的时候是不是update,如果不是更新,可能导致模型不变色,(add的时候,是否有level高的) TODO TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data) ?.let { CallerMapUIServiceManager.getMarkerService() ?.updateITrafficThreatLevelInfo(it) } - - if (alertContent.isEmpty() || ttsContent.isEmpty()) { - return - } - saveObuData(v2xType, alertContent, ttsContent) - showWarning(v2xType, alertContent, ttsContent, direction) } - MogoObuConstants.STATUS.UPDATE -> {// 更新 + MogoObuConstants.STATUS.UPDATE -> { // 更新 } MogoObuConstants.STATUS.DELETE -> { // 删除 - // 关闭警告红边 - CallerHmiManager.dismissWarning(WarningDirectionEnum.ALERT_WARNING_ALL) + // 更新数据 TODO 删除原来的,改变颜色,删除marker。不影响别的模型添加 + TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data) + ?.let { + // 事件结束,还原交通参与者颜色 + it.threatLevel = 0x01 + CallerMapUIServiceManager.getMarkerService() + ?.updateITrafficThreatLevelInfo(it) + } + //删除弱势交通元素 CallerMapUIServiceManager.getMarkerService() ?.removeCvxRvInfoIndInfo(data.participant.ptcId.toString()) } } + + //预警status + if (data.warningMsg != null && data.warningMsg.warningDataList != null && data.warningMsg.warningDataList.size > 0) { + level = data.warningMsg.warningDataList[0].warningLevel //默认是1个 + CallerLogger.d( + "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", + "onMogoObuRsmWarning ---status---> ${data.status} ---data.warningMsg.warningData[0].status = ${data.warningMsg.warningDataList[0].status} ---v2xType = $v2xType ---alertContent = $alertContent ---ttsContent = $ttsContent ---level = $level" + ) + when (data.warningMsg.warningDataList[0].status) { + MogoObuConstants.STATUS.ADD -> { // 添加 + //更新模型的颜色 + TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data) + ?.let { + CallerMapUIServiceManager.getMarkerService() + ?.updateITrafficThreatLevelInfo(it) + } + + if (alertContent.isEmpty() || ttsContent.isEmpty()) { + return + } + saveObuData(v2xType, alertContent, ttsContent) + showWarning(v2xType, alertContent, ttsContent, direction) + } + + MogoObuConstants.STATUS.UPDATE -> {// 更新 + } + + MogoObuConstants.STATUS.DELETE -> { // 删除 + // 关闭警告红边 + CallerHmiManager.dismissWarning(WarningDirectionEnum.ALERT_WARNING_ALL) + //删除弱势交通元素 + CallerMapUIServiceManager.getMarkerService() + ?.removeCvxRvInfoIndInfo(data.participant.ptcId.toString()) + } + } + } } } } -// } } /** * 地图匹配 是OBU算法输出地图匹配结果,主车匹配道路哪条路或者哪条车道 */ override fun onObuMapMath(data: ObuScene.MapMatchData?) { - if (data != null) { - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", - "onMogoObuMapMath = ${data.status} --speedMaxLimit = ${(data.speedMaxLimit * 3.6).roundToInt()}" - ) - when (data.status) { - MogoObuConstants.STATUS.ADD -> { // 添加 - UiThreadHandler.post { - if (data.speedMaxLimit > 0) { - CallerLimitingVelocityListenerManager.invokeUnion( - (data.speedMaxLimit * 3.6).roundToInt(), DataSourceType.OBU - ) + if (HmiBuildConfig.isShowObuV2iView) { + if (data != null) { + CallerLogger.d( + "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", + "onMogoObuMapMath = ${data.status} --speedMaxLimit = ${(data.speedMaxLimit * 3.6).roundToInt()}" + ) + when (data.status) { + MogoObuConstants.STATUS.ADD -> { // 添加 + UiThreadHandler.post { + if (data.speedMaxLimit > 0) { + CallerLimitingVelocityListenerManager.invokeUnion( + (data.speedMaxLimit * 3.6).roundToInt(), DataSourceType.OBU + ) + } } } - } - MogoObuConstants.STATUS.UPDATE -> { // 更新 - } + MogoObuConstants.STATUS.UPDATE -> { // 更新 + } - MogoObuConstants.STATUS.DELETE -> { // 删除 - UiThreadHandler.post { - CallerLimitingVelocityListenerManager.invokeUnion( - -1, - DataSourceType.OBU - ) + MogoObuConstants.STATUS.DELETE -> { // 删除 + UiThreadHandler.post { + CallerLimitingVelocityListenerManager.invokeUnion( + -1, + DataSourceType.OBU + ) + } } } } @@ -543,7 +572,6 @@ class MogoPrivateObuNewManager private constructor() { * 获取消息的方位 车辆相关 */ private fun getMessageDirection(targetClassification: Int): WarningDirectionEnum { - // 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 //正前方 @@ -589,7 +617,9 @@ class MogoPrivateObuNewManager private constructor() { if (FunctionBuildConfig.isObuWarningFusionUnion) { alertContent = "前车距离过近" ttsContent = "前车距离过近" - CallerObuWarningListenerManager.invokeTrackerFusionData(ObuManager.getInstance().obuRvToTrackedObject(info)) + CallerObuWarningListenerManager.invokeTrackerFusionData( + ObuManager.getInstance().obuRvToTrackedObject(info) + ) } else { alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType) @@ -650,7 +680,7 @@ class MogoPrivateObuNewManager private constructor() { ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType) v2xType = EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType - if ( + if ( direction == WarningDirectionEnum.ALERT_WARNING_LEFT || direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT || direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/v2x/SpeedLimitDispatcher.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/v2x/SpeedLimitDispatcher.kt index 6742f81aa8..0346113ae1 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/v2x/SpeedLimitDispatcher.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/v2x/SpeedLimitDispatcher.kt @@ -2,7 +2,7 @@ package com.mogo.eagle.core.function.datacenter.v2x import android.content.Context import com.mogo.eagle.core.data.enums.DataSourceType -import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener +import com.mogo.eagle.core.function.api.datacenter.union.ILimitingVelocityListener import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager /** diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/v2x/TrafficLightDispatcher.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/v2x/TrafficLightDispatcher.kt index da18deaa54..b4f9c1f98a 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/v2x/TrafficLightDispatcher.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/v2x/TrafficLightDispatcher.kt @@ -6,7 +6,7 @@ import com.mogo.eagle.core.data.enums.DataSourceType import com.mogo.eagle.core.data.enums.TrafficLightEnum import com.mogo.eagle.core.data.trafficlight.* import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener -import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener +import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTrafficLightListener import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager import perception.TrafficLightOuterClass diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/msgbox/MsgBoxProvider.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/msgbox/MsgBoxProvider.kt index d3c4d49cd4..5c1729cbfd 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/msgbox/MsgBoxProvider.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/msgbox/MsgBoxProvider.kt @@ -4,7 +4,7 @@ import android.content.Context import com.alibaba.android.arouter.facade.annotation.Route import com.mogo.eagle.core.data.constants.MogoServicePaths.PATH_MSG_BOX_MODULE import com.mogo.eagle.core.data.msgbox.MsgBoxBean -import com.mogo.eagle.core.function.api.msgbox.IMsgBoxProvider +import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxProvider import com.mogo.eagle.core.function.msgbox.DataManager.saveAllMessages2Disk @Route(path = PATH_MSG_BOX_MODULE) diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarNetWorkManager.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarNetWorkManager.kt index dca175382b..9daa99f962 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarNetWorkManager.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarNetWorkManager.kt @@ -152,6 +152,9 @@ class BindingCarNetWorkManager private constructor() { } private fun updateCarVrIconRes(brandId: String?) { + if(!DebugConfig.isCarModelChange()){ + return + } if (brandId == null || brandId.isEmpty()) { return } diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/trace/TraceManager.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/trace/TraceManager.kt index 95ec88c2af..ccbb9080a5 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/trace/TraceManager.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/trace/TraceManager.kt @@ -43,7 +43,7 @@ class TraceManager : IMoGoCloudListener, IMoGoAutopilotCarConfigListener { // 初始化Trace抓取服务 val pkgName = Utils.getApp().packageName ChainTraceStarter.start(pkgName, DeviceUtils.getMacAddress(), false) - CallerCloudListenerManager.registerCloudListener(TAG, this) + CallerCloudListenerManager.addListener(TAG, this) CallerAutopilotCarConfigListenerManager.addListener(TAG, this) // Trace过程中进行日志抓取,对日志进行配置 diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/tts/TtsManager.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/tts/TtsManager.kt index 2cf11f8d9f..75c46d37ec 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/tts/TtsManager.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/tts/TtsManager.kt @@ -23,7 +23,7 @@ class TtsManager : IMoGoCloudListener { fun initTts(context: Context) { val sn = SharedPrefsMgr.getInstance(context).getString("sn") if (sn.isNullOrEmpty()) { - CallerCloudListenerManager.registerCloudListener(TraceManager.TAG, this) + CallerCloudListenerManager.addListener(TraceManager.TAG, this) } AIAssist.getInstance(context) } diff --git a/core/function-impl/mogo-core-function-hmi/build.gradle b/core/function-impl/mogo-core-function-hmi/build.gradle index 852be9bd7f..5229ec0dd4 100644 --- a/core/function-impl/mogo-core-function-hmi/build.gradle +++ b/core/function-impl/mogo-core-function-hmi/build.gradle @@ -68,7 +68,6 @@ dependencies { // debugImplementation rootProject.ext.dependencies.debugleakcanary // releaseImplementation rootProject.ext.dependencies.releaseleakcanary - implementation project(':libraries:mogo-obu') implementation rootProject.ext.dependencies.arouter kapt rootProject.ext.dependencies.aroutercompiler diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/map/OfflineMapDialog.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/map/OfflineMapDialog.kt new file mode 100644 index 0000000000..0adbe08c49 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/map/OfflineMapDialog.kt @@ -0,0 +1,167 @@ +package com.mogo.eagle.core.function.hmi.ui.map + +import android.annotation.SuppressLint +import android.content.Context +import android.view.View +import android.widget.ImageView +import android.widget.ProgressBar +import android.widget.TextView +import androidx.constraintlayout.widget.ConstraintLayout +import androidx.core.content.ContextCompat +import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager +import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager +import com.mogo.eagle.core.function.hmi.R +import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog +import com.mogo.map.hdcache.IHdCacheListener +import me.jessyan.autosize.utils.AutoSizeUtils + +/** + * 离线地图缓存 + */ +class OfflineMapDialog(context: Context): BaseFloatDialog(context) { + + private var roundRootLayout: ConstraintLayout? = null + private var offlineTitleView: TextView? = null + private var leftView: TextView? = null + private var rightView: TextView? = null + private var okView: TextView? = null + private var vertLineView: View? = null + private var horizontalLineView: View? = null + private var cacheTipView: TextView? = null + + private var progressBar: ProgressBar? = null + private var downloadPercentView: TextView? = null + private var downloadResultImg: ImageView? = null + + private var isLoading = false + private var isConfirm = true + private var isRetry = false + + init { + setContentView(R.layout.dialog_offline_map) + setCanceledOnTouchOutside(true) + + initView() + } + + private fun initView() { + roundRootLayout = findViewById(R.id.roundRootLayout) + offlineTitleView = findViewById(R.id.tv_cache_title) + progressBar = findViewById(R.id.progressBar) + downloadPercentView = findViewById(R.id.tvDownloadProgress) + leftView = findViewById(R.id.tv_cache_confirm) + rightView = findViewById(R.id.tv_cache_cancel) + okView = findViewById(R.id.tv_cache_ok) + vertLineView = findViewById(R.id.view_vertical_line) + horizontalLineView = findViewById(R.id.view_horizontal_line) + cacheTipView = findViewById(R.id.tv_cache_tips) + downloadResultImg = findViewById(R.id.iv_download_Status) + + leftView?.setOnClickListener { + when { + isConfirm -> { + cacheHDOfflineData() + showNewContent(isLoading = true, false) + } + else -> { + dismiss() + } + } + } + + rightView?.setOnClickListener { + when { + isRetry -> { + cacheHDOfflineData() + } + else -> { + dismiss() + } + } + } + + okView?.setOnClickListener { + dismiss() + } + } + + private fun cacheHDOfflineData() { + CallerMapUIServiceManager.cacheHDDataByCity(object : IHdCacheListener { + override fun onMapHdCacheProgress(cityId: Int, progress: Double) { + updateProgress(progress.toInt()) + } + }) + } + + @SuppressLint("SetTextI18n") + private fun updateProgress(progress: Int) { + if (this@OfflineMapDialog.isShowing) { + progressBar?.let { + if (it.visibility == View.VISIBLE) { + it.progress = if (progress in 1..5) 5 else progress + } + } + downloadPercentView?.text = "$progress%" + if (progress == 100) { + showNewContent(isLoading = false, true) + CallerHmiListenerManager.invokeHDDataCacheStatus(true) + } + } + } + + private fun change2NewStyle() { + roundRootLayout?.layoutParams?.width = AutoSizeUtils.dp2px(context, 1110f) + roundRootLayout?.layoutParams?.height = AutoSizeUtils.dp2px(context, 668f) + + val titleParams = offlineTitleView?.layoutParams as ConstraintLayout.LayoutParams + titleParams.topMargin = AutoSizeUtils.dp2px(context, 51f) + + val horizontalLineParams = horizontalLineView?.layoutParams as ConstraintLayout.LayoutParams + horizontalLineParams.topMargin = AutoSizeUtils.dp2px(context, 374f) + + progressBar?.visibility = View.VISIBLE + downloadPercentView?.visibility = View.VISIBLE + okView?.visibility = View.VISIBLE + + vertLineView?.visibility = View.GONE + leftView?.visibility = View.GONE + rightView?.visibility = View.GONE + cacheTipView?.visibility = View.INVISIBLE + } + + @SuppressLint("UseCompatLoadingForDrawables") + private fun showNewContent(isLoading: Boolean, isSuccess: Boolean) { + change2NewStyle() + when { + isLoading -> { + okView?.text = context.resources.getString(R.string.cancel) + offlineTitleView?.text = context.resources.getString(R.string.offline_downloading) + downloadResultImg?.visibility = View.GONE + } + else -> { + downloadResultImg?.visibility = View.VISIBLE + when { + isSuccess -> { + okView?.visibility = View.VISIBLE + okView?.text = context.resources.getString(R.string.ok_tip) + offlineTitleView?.text = context.resources.getString(R.string.offline_download_success) + progressBar?.visibility = View.GONE + downloadPercentView?.visibility = View.GONE + downloadResultImg?.background = ContextCompat.getDrawable(context, R.drawable.download_success_icon) + } + else -> { + offlineTitleView?.text = context.resources.getString(R.string.offline_download_failure) + okView?.visibility = View.GONE + progressBar?.visibility = View.GONE + downloadPercentView?.visibility = View.GONE + leftView?.visibility = View.VISIBLE + rightView?.visibility = View.VISIBLE + vertLineView?.visibility = View.VISIBLE + rightView?.text = context.resources.getString(R.string.retry) + downloadResultImg?.background = ContextCompat.getDrawable(context, R.drawable.download_fail_icon) + } + } + } + } + } +} \ 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/DriverMsgBoxBubbleView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxBubbleView.kt index db43edc926..93ae969800 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxBubbleView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxBubbleView.kt @@ -9,7 +9,7 @@ import androidx.constraintlayout.widget.ConstraintLayout import androidx.recyclerview.widget.LinearLayoutManager import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.MsgCategory -import com.mogo.eagle.core.function.api.msgbox.IMsgBoxListener +import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxButtonView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxButtonView.kt index 5fe939bf50..1bda3f2e9b 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxButtonView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxButtonView.kt @@ -6,7 +6,7 @@ import android.view.LayoutInflater import android.view.View import androidx.constraintlayout.widget.ConstraintLayout import com.mogo.eagle.core.data.msgbox.MsgBoxBean -import com.mogo.eagle.core.function.api.msgbox.IMsgBoxEventListener +import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxEventListener import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager import com.mogo.eagle.core.function.hmi.R import kotlinx.android.synthetic.main.view_driver_msg_box_button.view.* 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 c06b07f82b..0a24a50f88 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 @@ -9,8 +9,8 @@ import androidx.constraintlayout.widget.ConstraintLayout import androidx.recyclerview.widget.LinearLayoutManager import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.MsgCategory -import com.mogo.eagle.core.function.api.msgbox.IMsgBoxEventListener -import com.mogo.eagle.core.function.api.msgbox.IMsgBoxListener +import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxEventListener +import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MBoxBubbleView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MBoxBubbleView.kt index 61fd81fb64..30ff6c7f23 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MBoxBubbleView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MBoxBubbleView.kt @@ -9,7 +9,7 @@ import androidx.recyclerview.widget.LinearLayoutManager import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.data.msgbox.MsgCategory -import com.mogo.eagle.core.function.api.msgbox.IMsgBoxListener +import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager import com.mogo.eagle.core.function.hmi.R diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/PassengerMsgBoxBubbleView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/PassengerMsgBoxBubbleView.kt index 7625fbec80..0112f09266 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/PassengerMsgBoxBubbleView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/PassengerMsgBoxBubbleView.kt @@ -6,18 +6,15 @@ import android.util.AttributeSet import android.view.* import androidx.constraintlayout.widget.ConstraintLayout import androidx.recyclerview.widget.LinearLayoutManager -import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.data.msgbox.MsgCategory -import com.mogo.eagle.core.function.api.msgbox.IMsgBoxListener -import com.mogo.eagle.core.function.call.hmi.CallerHmiManager +import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.function.hmi.ui.msgbox.adapter.PassengerMsgBoxBubbleAdapter import com.mogo.eagle.core.function.msgbox.MsgBoxConfig -import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils import com.mogo.eagle.core.utilcode.util.UiThreadHandler import kotlinx.android.synthetic.main.layout_passenger_msg_box_bubble.view.* diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/PassengerMsgBoxButtonView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/PassengerMsgBoxButtonView.kt index 3080907378..606affc6f5 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/PassengerMsgBoxButtonView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/PassengerMsgBoxButtonView.kt @@ -6,7 +6,7 @@ import android.view.LayoutInflater import android.view.View import androidx.constraintlayout.widget.ConstraintLayout import com.mogo.eagle.core.data.msgbox.MsgBoxBean -import com.mogo.eagle.core.function.api.msgbox.IMsgBoxEventListener +import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxEventListener import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager import com.mogo.eagle.core.function.hmi.R import kotlinx.android.synthetic.main.view_passenger_msg_box_button.view.* diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/PassengerMsgBoxListView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/PassengerMsgBoxListView.kt index 8abbc15a48..cc8418f8d2 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/PassengerMsgBoxListView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/PassengerMsgBoxListView.kt @@ -7,18 +7,16 @@ import android.view.LayoutInflater import androidx.constraintlayout.widget.ConstraintLayout import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.LinearLayoutManager -import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.data.msgbox.MsgCategory -import com.mogo.eagle.core.function.api.msgbox.IMsgBoxEventListener -import com.mogo.eagle.core.function.api.msgbox.IMsgBoxListener +import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxEventListener +import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.function.hmi.ui.msgbox.adapter.PassengerMsgBoxListAdapter -import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils import com.mogo.eagle.core.utilcode.util.ResourceUtils.getDrawable import com.mogo.eagle.core.utilcode.util.UiThreadHandler import kotlinx.android.synthetic.main.layout_passenger_msg_box_list.view.* 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 034930adbf..76059bf6c6 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 @@ -73,9 +73,6 @@ import com.mogo.eagle.core.utilcode.mogo.toast.TipToast import com.mogo.eagle.core.utilcode.util.* import com.mogo.map.uicontroller.VisualAngleMode import com.mogo.map.uicontroller.VisualAngleMode.* -import com.mogo.support.obu.MogoObuManager -import com.mogo.support.obu.constants.MogoObuLogLevel -import com.mogo.support.obu.option.MogoObuLog import kotlinx.android.synthetic.main.view_debug_setting.view.* import kotlinx.coroutines.launch import mogo.telematics.pad.MessagePad @@ -1204,14 +1201,7 @@ internal class DebugSettingView @JvmOverloads constructor( * 设置是否输出OBU日志 true-打印日志,false-不打印日志 */ tbObuLog.setOnCheckedChangeListener { _, isChecked -> - MogoObuManager.getInstance().setEnableLog(isChecked) - - val builder: com.mogo.support.obu.option.MogoObuLog.Builder = - MogoObuLog.newBuilder().setEnableStdio(isChecked) - if (isChecked) { - builder.setStdioLevel(MogoObuLogLevel.DBG) - } - MogoObuManager.getInstance().logConfig(builder.build()) + CallerObuApiManager.setObuLog(isChecked) } /** 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 6327b04bed..2b6dadfb77 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 @@ -95,18 +95,19 @@ internal class SOPSettingView @JvmOverloads constructor( } /** - * obu V2V开关 + * obu V2V开关,默认打开 */ + tbObuV2vView.isChecked = HmiBuildConfig.isShowObuV2vView tbObuV2vView.setOnCheckedChangeListener { _, isChecked -> // 默认关闭 HmiBuildConfig.isShowObuV2vView = isChecked } /** - * obu V2i开关 + * obu V2i开关,默认打开 */ + tbObuV2iView.isChecked = HmiBuildConfig.isShowObuV2iView tbObuV2iView.setOnCheckedChangeListener { _, isChecked -> - // 默认关闭 HmiBuildConfig.isShowObuV2iView = isChecked } @@ -174,7 +175,7 @@ internal class SOPSettingView @JvmOverloads constructor( //OBU控制总开关 tbObu.isChecked = CallerObuApiManager.isConnected() tbObu.setOnCheckedChangeListener { _, isChecked -> - if (!isChecked) { + if (isChecked) { CallerObuApiManager.resetObuIpAddress("192.168.1.199") } else { //断开链接 diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt index 608c5e94b2..f340aa4891 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt @@ -184,6 +184,10 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor( systemVersionView?.showAdUpgradeStatus(ipcUpgradeStateInfo) } + fun updateHDDataCacheStatus(isCached: Boolean) { + systemVersionView?.updateHDDataCacheStatus(isCached) + } + override fun onAttachedToWindow() { super.onAttachedToWindow() CallerAutoPilotStatusListenerManager.addListener(TAG, this) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/PncActionsView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/PncActionsView.kt index 66a1a68404..5cf624ff40 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/PncActionsView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/PncActionsView.kt @@ -4,7 +4,6 @@ import android.content.Context import android.util.AttributeSet import android.util.TypedValue.COMPLEX_UNIT_PX import android.view.LayoutInflater -import android.view.ViewGroup import androidx.appcompat.content.res.AppCompatResources import androidx.constraintlayout.widget.ConstraintLayout import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo @@ -17,7 +16,7 @@ import com.mogo.eagle.core.data.trafficlight.isRed import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningActionsListener import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener.Companion.STATUS_AUTOPILOT_RUNNING -import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener +import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTrafficLightListener import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerPlanningActionsListenerManager import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager @@ -25,8 +24,6 @@ import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.utilcode.util.UiThreadHandler import com.zhjt.service_biz.BizConfig import kotlinx.android.synthetic.main.view_pnc_actions.view.* -import me.jessyan.autosize.AutoSize -import me.jessyan.autosize.utils.AutoSizeUtils import mogo.telematics.pad.MessagePad class PncActionsView @JvmOverloads constructor( @@ -52,16 +49,25 @@ class PncActionsView @JvmOverloads constructor( init { LayoutInflater.from(context).inflate(R.layout.view_pnc_actions, this, true) val a = context.obtainStyledAttributes(attrs, R.styleable.PncActionsView, defStyleAttr, 0) - bgResources = a.getResourceId(R.styleable.PncActionsView_background_resource, R.drawable.pnc_actions_bg) - topMargin = a.getResourceId(R.styleable.PncActionsView_pnc_top_margin,resources.getDimension(R.dimen.dp_30).toInt()) - txtSize = a.getResourceId(R.styleable.PncActionsView_pnc_size,resources.getDimension(R.dimen.dp_34).toInt()) + bgResources = a.getResourceId( + R.styleable.PncActionsView_background_resource, + R.drawable.pnc_actions_bg + ) + topMargin = a.getResourceId( + R.styleable.PncActionsView_pnc_top_margin, + resources.getDimension(R.dimen.dp_30).toInt() + ) + txtSize = a.getResourceId( + R.styleable.PncActionsView_pnc_size, + resources.getDimension(R.dimen.dp_34).toInt() + ) a.recycle() } override fun onAttachedToWindow() { super.onAttachedToWindow() (tvHmiPncActions.layoutParams as MarginLayoutParams).topMargin = topMargin - tvHmiPncActions.setTextSize(COMPLEX_UNIT_PX,txtSize.toFloat()) + tvHmiPncActions.setTextSize(COMPLEX_UNIT_PX, txtSize.toFloat()) CallerAutoPilotStatusListenerManager.addListener(TAG, this) CallerPlanningActionsListenerManager.addListener(TAG, this) @@ -124,6 +130,9 @@ class PncActionsView @JvmOverloads constructor( tvHmiPncActions.text = actions } } + } else { + this.background = null + tvHmiPncActions.text = "" } } 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 8746a17300..de83239e19 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 @@ -2,14 +2,13 @@ package com.mogo.eagle.core.function.hmi.ui.widget import android.content.Context import android.util.AttributeSet -import android.util.Log import android.view.LayoutInflater import android.view.View import androidx.constraintlayout.widget.ConstraintLayout import com.mogo.eagle.core.data.enums.DataSourceType import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.LimitingVelocityView_TAG -import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener +import com.mogo.eagle.core.function.api.datacenter.union.ILimitingVelocityListener import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager import com.mogo.eagle.core.function.hmi.R @@ -43,7 +42,6 @@ class LimitingVelocityView constructor( if (limitingVelocity > 0) { visibility = View.VISIBLE tvLimitingVelocity.text = "$limitingVelocity" - Log.d("emArrow","limit : ${ DataSourceType.getName(sourceType)}") tvLimitingSource.text = DataSourceType.getName(sourceType) } else { visibility = View.GONE 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 fbd045ab7e..f770db1fbe 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 @@ -13,7 +13,7 @@ import com.mogo.eagle.core.data.enums.DataSourceType import com.mogo.eagle.core.data.enums.TrafficLightEnum import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.TrafficLightView_TAG -import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener +import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTrafficLightListener import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager import com.mogo.eagle.core.function.hmi.R 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 bd8cdb8807..b7f531c972 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 @@ -8,12 +8,11 @@ import android.widget.FrameLayout import com.mogo.eagle.core.data.enums.DataSourceType import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener -import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener +import com.mogo.eagle.core.function.api.datacenter.union.ILimitingVelocityListener import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.utilcode.util.UiThreadHandler -import java.util.* class SpeedPanelView @JvmOverloads constructor( context: Context, 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 913da911a7..1ae6ab1b7d 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 @@ -10,10 +10,14 @@ import com.mogo.eagle.core.data.bindingcar.AdUpgradeStateHelper import com.mogo.eagle.core.data.bindingcar.IPCUpgradeStateInfo import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener +import com.mogo.eagle.core.function.api.hmi.autopilot.IMoGoCheckAutoPilotBtnListener import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager +import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager +import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager import com.mogo.eagle.core.function.hmi.R +import com.mogo.eagle.core.function.hmi.ui.map.OfflineMapDialog 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.utilcode.util.AppUtils @@ -33,7 +37,7 @@ class SystemVersionView @JvmOverloads constructor( attrs: AttributeSet? = null, defStyleAttr: Int = 0 ) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoAutopilotStatusListener, - IMoGoDevaToolsListener { + IMoGoDevaToolsListener, IMoGoCheckAutoPilotBtnListener { companion object { const val TAG = "SystemVersionView" @@ -50,6 +54,8 @@ class SystemVersionView @JvmOverloads constructor( private var previousProgress: Int = -1 //前一秒的下载进度,用于计算下载剩余时间 private var currentProgress: Int = -1 //当前已下载包体大小 + private var isHDCached = false + init { LayoutInflater.from(context).inflate(R.layout.view_system_version, this, true) initView() @@ -135,6 +141,16 @@ class SystemVersionView @JvmOverloads constructor( } + ivHDCache.setOnClickListener { + if (isHDCached) {// 已缓存 + ToastUtils.showShort(resources.getString(R.string.offline_had_downloaded)) + } else {// 未缓存 + OfflineMapDialog(context).show() + } + } + + updateHDDataCacheStatus(CallerMapUIServiceManager.isCityDataCached()) + if(AdUpgradeStateHelper.isConfirmUpgrade()){ //将角标改为“下载中” ivAdStatus?.setImageResource(R.drawable.icon_downloading) @@ -239,6 +255,15 @@ class SystemVersionView @JvmOverloads constructor( } + override fun updateHDDataCacheStatus(isCached: Boolean) { + if (isCached) { + ivHDCacheStatus?.setImageResource(R.drawable.icon_latest_version) + } else { + ivHDCacheStatus?.setImageResource(R.drawable.icon_be_updated) + } + isHDCached = isCached + } + /** * 展示当前鹰眼版本 */ @@ -267,6 +292,7 @@ class SystemVersionView @JvmOverloads constructor( if (isInEditMode) { return } + CallerHmiListenerManager.addListener(TAG, this) CallerAutoPilotStatusListenerManager.addListener(TAG, this) CallerDevaToolsListenerManager.addListener(TAG,this) needQueryContainers = true @@ -277,6 +303,7 @@ class SystemVersionView @JvmOverloads constructor( if (isInEditMode) { return } + CallerHmiListenerManager.removeListener(TAG) CallerAutoPilotStatusListenerManager.removeListener(TAG) CallerDevaToolsListenerManager.removeListener(TAG) needQueryContainers = false 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 d1cead5ff1..1a12130971 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 @@ -124,8 +124,6 @@ public abstract class MainMoGoApplication extends AbsMogoApplication { MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_FUNC_BIZ, "IMoGoNoticeProvider")); // todo 后置 车聊聊,IM MogoModulePaths.addModuleFunctionServer(new MogoModule(ChatConsts.CHAT_PROVIDER_PATH, ChatConsts.CHAT_MODULE_NAME)); - // V2X 模块 - MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_V2X_MODULE, "V2XProvider")); // 司机身份专属 if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { // todo 后置 地图数据收集模块 diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/download_fail_icon.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/download_fail_icon.png new file mode 100644 index 0000000000..809d7ee414 Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/download_fail_icon.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/download_success_icon.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/download_success_icon.png new file mode 100644 index 0000000000..f6f1197a93 Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/download_success_icon.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_be_updated.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_be_updated.png new file mode 100644 index 0000000000..b9268797cf Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_be_updated.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_hd_map.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_hd_map.png new file mode 100644 index 0000000000..ccbe7ffd56 Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_hd_map.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/progressbar_corner_bg.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/progressbar_corner_bg.xml new file mode 100644 index 0000000000..753149f4ea --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/progressbar_corner_bg.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/dialog_offline_map.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/dialog_offline_map.xml new file mode 100644 index 0000000000..6ae72b0a13 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/dialog_offline_map.xml @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_sop_setting.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_sop_setting.xml index e9830e19b0..8c7522b317 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_sop_setting.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_sop_setting.xml @@ -203,11 +203,13 @@ app:layout_constraintTop_toBottomOf="@id/tbCloudWeaknessTrafficSop" /> + - + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/values/color.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/values/color.xml index 574b9fc2f3..ff8c61e6bf 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/values/color.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/values/color.xml @@ -71,7 +71,5 @@ #FF282F62 #FFFFFF - - - + #E63B4577 \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/values/strings.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/values/strings.xml index f12f7f9bc0..a792f63bf1 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/values/strings.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/values/strings.xml @@ -65,4 +65,12 @@ 车辆将开启自动驾驶,并行驶至: 确认 取消 + 离线地图缓存提醒 + 是否缓存最新版本离线地图? + 离线地图下载中 + 离线地图下载成功 + 离线地图下载失败 + 当前已为最新版本 + 确定 + 重试 diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt index f26b486ee8..7470a9932c 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt @@ -22,10 +22,10 @@ import com.amap.api.maps.TextureMapView import com.amap.api.maps.model.* import com.mogo.eagle.core.data.map.Infrastructure import com.mogo.eagle.core.data.map.MogoLocation -import com.mogo.eagle.core.data.v2x.V2XEvent +import com.mogo.eagle.core.data.v2x.V2XEventData import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener -import com.mogo.eagle.core.function.api.v2x.IFuncBizProvider +import com.mogo.eagle.core.function.api.biz.IFuncBizProvider import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.getGlobalPath import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager @@ -300,8 +300,8 @@ class OverMapView @JvmOverloads constructor( geoHashInfMap = map } - override fun onV2XEvents(v2xEvents: List?) { - showV2XEventMarkers(v2xEvents) + override fun onV2XEvents(v2XEventData: List?) { + showV2XEventMarkers(v2XEventData) } }) // 主动查一次全局路径规划的数据 @@ -389,11 +389,11 @@ class OverMapView @JvmOverloads constructor( /** * 显示V2X事件的Marker */ - private fun showV2XEventMarkers(v2XEvents: List?) { - if (v2XEvents == null || v2XEvents.isEmpty()) return + private fun showV2XEventMarkers(v2XEventData: List?) { + if (v2XEventData == null || v2XEventData.isEmpty()) return clearV2XMarkers() val markerOptionsList = ArrayList() - for (v2xEvent in v2XEvents) { + for (v2xEvent in v2XEventData) { val center = v2xEvent.center if (center != null) { val markerOption = MarkerOptions() diff --git a/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/MogoStartUpProvider.kt b/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/MogoStartUpProvider.kt index 0e66e82922..29acccff70 100644 --- a/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/MogoStartUpProvider.kt +++ b/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/MogoStartUpProvider.kt @@ -8,10 +8,7 @@ import com.mogo.eagle.core.function.api.startup.IStartUpProvider import com.mogo.eagle.core.function.startup.stageone.APMStartup import com.mogo.eagle.core.function.startup.stageone.HttpDnsStartUp import com.mogo.eagle.core.function.startup.stageone.ThreadOptStartup -import com.mogo.eagle.core.function.startup.stagetwo.AutopilotStartUp -import com.mogo.eagle.core.function.startup.stagetwo.DataCenterStartUp -import com.mogo.eagle.core.function.startup.stagetwo.ObuStartUp -import com.mogo.eagle.core.function.startup.stagetwo.MapBizStartUp +import com.mogo.eagle.core.function.startup.stagetwo.* import com.rousetime.android_startup.StartupListener import com.rousetime.android_startup.StartupManager import com.rousetime.android_startup.model.CostTimesModel @@ -20,7 +17,7 @@ import com.rousetime.android_startup.model.StartupConfig import org.greenrobot.eventbus.EventBus @Route(path = MogoServicePaths.PATH_STARTUP_PROVIDER) -class MogoStartUpProvider: IStartUpProvider { +class MogoStartUpProvider : IStartUpProvider { private var context: Context? = null @@ -39,8 +36,7 @@ class MogoStartUpProvider: IStartUpProvider { } override fun initStageOne() { - var config: StartupConfig? = null - config = if (DebugConfig.isDebug()) { + val config = if (DebugConfig.isDebug()) { StartupConfig.Builder() .setLoggerLevel(LoggerLevel.DEBUG) .setOpenStatistics(true) @@ -78,6 +74,7 @@ class MogoStartUpProvider: IStartUpProvider { StartupManager.Builder() .addStartup(DataCenterStartUp()) .addStartup(AutopilotStartUp()) + .addStartup(AiCloudBizStartUp()) .addStartup(ObuStartUp()) .addStartup(MapBizStartUp()) .setConfig(config) diff --git a/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stagetwo/AiCloudBizStartUp.kt b/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stagetwo/AiCloudBizStartUp.kt new file mode 100644 index 0000000000..903e705355 --- /dev/null +++ b/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stagetwo/AiCloudBizStartUp.kt @@ -0,0 +1,28 @@ +package com.mogo.eagle.core.function.startup.stagetwo + +import android.content.Context +import com.alibaba.android.arouter.launcher.ARouter +import com.mogo.eagle.core.data.constants.MogoServicePaths +import com.rousetime.android_startup.AndroidStartup + +class AiCloudBizStartUp : AndroidStartup() { + + override fun create(context: Context): Boolean { + ARouter.getInstance().build(MogoServicePaths.PATH_AI_CLOUD).navigation() + return true + } + + override fun callCreateOnMainThread(): Boolean { + return true + } + + override fun waitOnMainThread(): Boolean { + return false + } + + override fun dependenciesByName(): List { + val deps = arrayListOf() + deps.add("com.mogo.eagle.core.function.startup.stagetwo.DataCenterStartUp") + return deps + } +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/.gitignore b/core/function-impl/mogo-core-function-v2x/.gitignore deleted file mode 100644 index 42afabfd2a..0000000000 --- a/core/function-impl/mogo-core-function-v2x/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build \ 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 deleted file mode 100644 index 0548690b35..0000000000 --- a/core/function-impl/mogo-core-function-v2x/build.gradle +++ /dev/null @@ -1,84 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-android-extensions' - id 'kotlin-kapt' - id 'com.alibaba.arouter' - id 'com.google.protobuf' -} -android { - compileSdkVersion rootProject.ext.android.compileSdkVersion - defaultConfig { - minSdkVersion rootProject.ext.android.minSdkVersion - targetSdkVersion rootProject.ext.android.targetSdkVersion - versionCode Integer.valueOf(VERSION_CODE) - versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION") - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles 'consumer-rules.pro' - //ARouter apt 参数 - kapt { - useBuildCache = false - arguments { - arg("AROUTER_MODULE_NAME", project.getName()) - } - } - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - protobuf { - protoc { - artifact = rootProject.ext.dependencies.protoc - } - generateProtoTasks { - all().each { task -> - task.builtins { - java {} - } - } - } - } - -} - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation rootProject.ext.dependencies.kotlinstdlibjdk7 - implementation rootProject.ext.dependencies.coroutinescore - implementation rootProject.ext.dependencies.coroutinesandroid - implementation rootProject.ext.dependencies.androidxccorektx - implementation rootProject.ext.dependencies.androidxappcompat - implementation rootProject.ext.dependencies.androidxconstraintlayout - implementation rootProject.ext.dependencies.localbroadcastmanager - implementation rootProject.ext.dependencies.arouter - implementation rootProject.ext.dependencies.rxandroid - kapt rootProject.ext.dependencies.aroutercompiler - 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 - implementation rootProject.ext.dependencies.mogo_core_utils - implementation rootProject.ext.dependencies.mogo_core_function_call - implementation rootProject.ext.dependencies.mogo_core_res - } else { - implementation project(":foudations:mogo-commons") - implementation project(':core:mogo-core-utils') - implementation project(':core:mogo-core-function-call') - implementation project(':core:mogo-core-res') - } -} - -apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString() diff --git a/core/function-impl/mogo-core-function-v2x/consumer-rules.pro b/core/function-impl/mogo-core-function-v2x/consumer-rules.pro deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/core/function-impl/mogo-core-function-v2x/gradle.properties b/core/function-impl/mogo-core-function-v2x/gradle.properties deleted file mode 100644 index 63866596d3..0000000000 --- a/core/function-impl/mogo-core-function-v2x/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -GROUP=com.mogo.eagle.core.function.impl -POM_ARTIFACT_ID=v2x -VERSION_CODE=1 diff --git a/core/function-impl/mogo-core-function-v2x/proguard-rules.pro b/core/function-impl/mogo-core-function-v2x/proguard-rules.pro deleted file mode 100644 index 481bb43481..0000000000 --- a/core/function-impl/mogo-core-function-v2x/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-v2x/src/main/AndroidManifest.xml b/core/function-impl/mogo-core-function-v2x/src/main/AndroidManifest.xml deleted file mode 100644 index 246d716c51..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/AndroidManifest.xml +++ /dev/null @@ -1,13 +0,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/V2XProvider.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/V2XProvider.kt deleted file mode 100644 index 214567d3fa..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/V2XProvider.kt +++ /dev/null @@ -1,36 +0,0 @@ -package com.mogo.eagle.core.function.v2x - -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.v2x.IV2XEventProvider -import com.mogo.eagle.core.function.v2x.events.V2XEventManager -import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils - -@Route(path = PATH_V2X_MODULE) -class V2XProvider : IV2XEventProvider { - - override val functionName: String - get() = "V2XProvider" - - override fun init(context: Context) { - if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) { - //不处理 - } else { - V2XEventManager.init(context) - } - } - - override fun queryWholeRoadEvents() { - V2XEventManager.queryWholeRoadEvents() - } - - override fun onDestroy() { - if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) { - //不处理 - } else { - V2XEventManager.onDestroy() - } - } -} \ 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 deleted file mode 100755 index 1245d6244f..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/V2XManager.kt +++ /dev/null @@ -1,257 +0,0 @@ -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.V2XLogger -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) { - V2XLogger.d(TAG, "-- init --") - if (V2XManager.config.get() != null) { - throw IllegalStateException("V2XManager has been initialized, don't initialize repeatably.") - } - V2XManager.config.set(config) - V2XLogger.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() { - V2XLogger.d(TAG, "-- start --") - val config = config.get() ?: throw IllegalStateException("V2XManager has not been initialized, please invoke V2XManager#init(config: X2XConfig) firstly.") - if (started.get()) { - V2XLogger.d(TAG, "-- has been started --") - return - } - if (config.aiCloudConfig.sn?.isBlank() == true) { - V2XLogger.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) { - V2XLogger.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)) { - V2XLogger.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() { - V2XLogger.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)) { - V2XLogger.d(TAG, "-- stop real --") - SocketManager.getInstance().release() - handler.removeCallbacks(refreshTask) - lastLatitude.set(0.0) - lastLongitude.set(0.0) - } - } - - /** - * 添加相关信息接口回调 - * @param cb 要添加的回调接口 - */ - fun addCallback(cb: IV2XCallback) { - V2XLogger.d(TAG, "-- addCallback --") - if (cbs.contains(cb)) { - return - } - cbs += cb - } - - /** - * 移除相关信息接口回调 - * @param cb 要移除的回调接口 - */ - fun removeCallback(cb: IV2XCallback) { - V2XLogger.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 - } - //V2XLogger.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) { - V2XLogger.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) { - V2XLogger.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/config/V2XConfig.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/config/V2XConfig.kt deleted file mode 100755 index 1ab70b67ac..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/config/V2XConfig.kt +++ /dev/null @@ -1,174 +0,0 @@ -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/event/V2XEvent.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/event/V2XEvent.kt deleted file mode 100644 index 40bf0b65c4..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/event/V2XEvent.kt +++ /dev/null @@ -1,75 +0,0 @@ -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 deleted file mode 100755 index aed7f4549c..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/executor/Executors.kt +++ /dev/null @@ -1,35 +0,0 @@ -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/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 deleted file mode 100644 index 1b9bc293db..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/http/api/V2XApiService.kt +++ /dev/null @@ -1,14 +0,0 @@ -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("eagle-eye-dns/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/logger/V2XLogger.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/logger/V2XLogger.kt deleted file mode 100644 index 58463eb45c..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/logger/V2XLogger.kt +++ /dev/null @@ -1,24 +0,0 @@ -package com.mogo.eagle.core.function.v2x.internal.logger - -import android.util.Log - -internal object V2XLogger { - - 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 deleted file mode 100644 index 23ca38f148..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_401012.kt +++ /dev/null @@ -1,27 +0,0 @@ -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.V2XLogger - -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) { - V2XLogger.i(V2XManager.TAG, "V2XMessageListener_401012:message is null!") - return - } - V2XLogger.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 deleted file mode 100644 index a7cf8e8933..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_401018.kt +++ /dev/null @@ -1,27 +0,0 @@ -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.V2XLogger - -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) { - V2XLogger.i(V2XManager.TAG, "V2XMessageListener_401018:message is null!") - return - } - V2XLogger.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 deleted file mode 100644 index e5b94036de..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_402000.kt +++ /dev/null @@ -1,27 +0,0 @@ -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.V2XLogger - -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) { - V2XLogger.i(V2XManager.TAG, "V2XMessageListener_402000:message is null!") - return - } - V2XLogger.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 deleted file mode 100644 index c8b402cedd..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_404000.kt +++ /dev/null @@ -1,27 +0,0 @@ -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.V2XLogger - -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) { - V2XLogger.i(V2XManager.TAG, "V2XMessageListener_404000:message is null!") - return - } - V2XLogger.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 deleted file mode 100644 index dbfc7f7ff4..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_503000.kt +++ /dev/null @@ -1,27 +0,0 @@ -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.V2XLogger -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) { - V2XLogger.i(V2XManager.TAG, "V2XMessageListener_503000:message is null!") - return - } - V2XLogger.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 deleted file mode 100644 index 320b6529d4..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_70001.kt +++ /dev/null @@ -1,27 +0,0 @@ -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.V2XLogger - -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) { - V2XLogger.i(V2XManager.TAG, "V2XMessageListener_70001:message is null!") - return - } - V2XLogger.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/road/V2XEventServiceApi.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/road/V2XEventServiceApi.kt deleted file mode 100644 index 5b73866375..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/road/V2XEventServiceApi.kt +++ /dev/null @@ -1,11 +0,0 @@ -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/mogo-core-data/build.gradle b/core/mogo-core-data/build.gradle index 4bda16c773..6bbadbc935 100644 --- a/core/mogo-core-data/build.gradle +++ b/core/mogo-core-data/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 @@ -46,6 +47,19 @@ android { targetCompatibility JavaVersion.VERSION_1_8 } + protobuf { + protoc { + artifact = rootProject.ext.dependencies.protoc + } + generateProtoTasks { + all().each { task -> + task.builtins { + java {} + } + } + } + } + } dependencies { @@ -61,6 +75,9 @@ dependencies { implementation rootProject.ext.dependencies.androidxroomktx kapt rootProject.ext.dependencies.androidxroomcompiler + implementation rootProject.ext.dependencies.protobuf_java + implementation rootProject.ext.dependencies.protobuf_java_util + if (Boolean.valueOf(USE_MAVEN_PACKAGE)) { implementation rootProject.ext.dependencies.mogo_core_res } else { diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/HmiBuildConfig.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/HmiBuildConfig.kt index 01d8b51754..ffffb227fa 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/HmiBuildConfig.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/HmiBuildConfig.kt @@ -61,14 +61,14 @@ object HmiBuildConfig { */ @JvmField @Volatile - var isShowObuV2vView = false + var isShowObuV2vView = true /** * 是否展示obu的v2i */ @JvmField @Volatile - var isShowObuV2iView = false + var isShowObuV2iView = true /** * 是否展示obu通过工控机展示的v2i 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 6e4f6af620..7d24ab39d1 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 @@ -41,12 +41,6 @@ public class MogoServicePaths { @Keep public static final String PATH_STATUS_VIEW_MANAGER = "/statusview/api"; - /** - * v2x 模块 - */ - @Deprecated - public static final String PATH_V2X_MODULE = "/v2x_api/module"; - /** * obu-mogo 模块 */ @@ -60,6 +54,12 @@ public class MogoServicePaths { @Keep public static final String PATH_AUTO_PILOT = "/auto_pilot/api"; + /** + * AiCloud socket 数据透出业务模块 + */ + @Keep + public static final String PATH_AI_CLOUD = "/ai_cloud/api"; + /** * 业务Biz 模块 */ diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/OperationMsg.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/OperationMsg.kt index 230e98dca5..75e7be26bd 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/OperationMsg.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/OperationMsg.kt @@ -1,8 +1,16 @@ package com.mogo.eagle.core.data.msgbox +import android.util.Log +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import java.io.Serializable /** * 运营消息:-1表示初始值 */ -data class OperationMsg(val timestamp : Long, val content: String, val type: Int = -1): Serializable +data class OperationMsg(val timestamp : Long, val content: String, val type: Int = -1): Serializable { + init { + if (content.isEmpty()) { + CallerLogger.e("MsgBox", Log.getStackTraceString(Throwable())) + } + } +} diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/V2XMsg.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/V2XMsg.kt index 374c545563..b4f98777f5 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/V2XMsg.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/V2XMsg.kt @@ -1,5 +1,7 @@ package com.mogo.eagle.core.data.msgbox +import android.util.Log +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import java.io.Serializable data class V2XMsg(var type: String = "", var content: String? = "", var tts: String? = ""): Serializable { @@ -9,5 +11,8 @@ data class V2XMsg(var type: String = "", var content: String? = "", var tts: Str init { timeStamp = System.currentTimeMillis() + if (content.isNullOrEmpty()) { + CallerLogger.e("MsgBox", Log.getStackTraceString(Throwable())) + } } } \ No newline at end of file diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/obu/ObuStatusInfo.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/obu/ObuStatusInfo.kt index 1331f1a366..42f3a8e029 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/obu/ObuStatusInfo.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/obu/ObuStatusInfo.kt @@ -6,11 +6,6 @@ package com.mogo.eagle.core.data.obu * @date 2021/9/30 5:38 下午 */ class ObuStatusInfo { - /** - * 当前链接的IP地址, 默认地址 192.168.1.199 - */ - var connectIP: String = "192.168.1.199" - /** * OBU SDK 版本 */ 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/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XAdvanceWarning.kt similarity index 97% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XAdvanceWarning.kt rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XAdvanceWarning.kt index df71ca8175..64c2962c37 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XAdvanceWarning.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XAdvanceWarning.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.internal.data +package com.mogo.eagle.core.data.v2x import androidx.annotation.Keep import java.io.Serializable 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/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XBaseData.kt similarity index 64% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XBaseData.kt rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XBaseData.kt index d7df5b04f0..4f2b36d406 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XBaseData.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XBaseData.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.internal.data +package com.mogo.eagle.core.data.v2x open class V2XBaseData { diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XEvent.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XEvent.kt index c9c1bbb61e..322e89b0e1 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XEvent.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XEvent.kt @@ -1,59 +1,70 @@ package com.mogo.eagle.core.data.v2x -import androidx.annotation.Keep +sealed class V2XEvent { -import com.google.gson.annotations.SerializedName + /** + * 长链-路口碰撞预警、盲区预警等通用Bean + */ + class ForwardsWarning(val type: Int = 404000, val data: V2XAdvanceWarning): V2XEvent() { + override fun toString(): String { + return "ForwardsWarning(type=$type, data=$data)" + } + } -@Keep -data class V2XEvent( - @SerializedName("receiveTime") - var receiveTime: Long, + /** + * 长链-最优推荐线种 + */ + class OptimalRoute(val type: Int = 402000, val data: V2XOptimalRoute): V2XEvent() { + override fun toString(): String { + return "OptimalRoute(type=$type, data=$data)" + } + } - @SerializedName("detectTime") - var detectTime: Long, + /** + * 长链-预警目标物 + */ + class Warning(val type: Int = 401018, val data: V2XWarningTarget): V2XEvent() { + override fun toString(): String { + return "Warning(type=$type, data=$data)" + } + } - @SerializedName("id") - var id: String?, + /** + * 长链-道路事件 + */ + class Road(val type: Int = 401012, val data: V2XMarkerCardResult): V2XEvent() { + override fun toString(): String { + return "Road(type=$type, data=$data)" + } + } - @SerializedName("center") - var center: Center?, + /** + * 长链-道路事件云识别 + */ + class RoadAI(val type: Int = 503000, val data: roadwork.Road.RW_PB): V2XEvent() { - @SerializedName("centerRoad") - var centerRoad: CenterRoad?, + override fun toString(): String { + return "RoadAI(type=$type, data=$data)" + } + } - @SerializedName("radius") - var radius: Double, + /** + * 短链-道路标记事件 + */ + class Marker(val data: V2XMarkerResponse): V2XEvent() { - @SerializedName("poiType") - var poiType: String?, + override fun toString(): String { + return "Marker(data=$data)" + } + } - @SerializedName("coordinateType") - var coordinateType:Int? = null -) + /** + * 长链-道路事件扩展数据结构 + */ + class RoadEventX(val type: Int = 70001, val data: V2XRoadXData): V2XEvent() { -@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 + 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/road/V2XEventResult.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XEventResult.kt similarity index 87% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/road/V2XEventResult.kt rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XEventResult.kt index 7a98c26ab4..8d444bedc0 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/road/V2XEventResult.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XEventResult.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.road +package com.mogo.eagle.core.data.v2x import androidx.annotation.Keep @@ -15,11 +15,11 @@ data class V2XEventResult ( @Keep data class Result( @SerializedName("eventList") - var v2XEventList: List? + var v2XEventList: List? ) @Keep -data class V2XEvent( +data class V2XEventData( @SerializedName("receiveTime") var receiveTime: Long, @@ -33,7 +33,7 @@ data class V2XEvent( var center: Center?, @SerializedName("centerRoad") - var centerRoad: CenterRoad?, + var centerRoad: CenterRoadData?, @SerializedName("radius") var radius: Double, @@ -55,7 +55,7 @@ data class Center( ) @Keep -data class CenterRoad( +data class CenterRoadData( @SerializedName("bearing") var bearing: Double, 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/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XLocation.kt similarity index 87% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XLocation.kt rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XLocation.kt index 3ce50a38f0..9b09a721c6 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XLocation.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XLocation.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.internal.data +package com.mogo.eagle.core.data.v2x import androidx.annotation.Keep import java.io.Serializable 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/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XMarkerCardResult.kt similarity index 99% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XMarkerCardResult.kt rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XMarkerCardResult.kt index a486687d10..df4a3c2f5e 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XMarkerCardResult.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XMarkerCardResult.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.internal.data +package com.mogo.eagle.core.data.v2x import androidx.annotation.Keep import com.mogo.eagle.core.data.map.entity.MarkerExploreWay 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/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XMarkerResponse.kt similarity index 80% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XMarkerResponse.kt rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XMarkerResponse.kt index 790bd71b0a..ee36ee0c9b 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XMarkerResponse.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XMarkerResponse.kt @@ -1,8 +1,7 @@ -package com.mogo.eagle.core.function.v2x.internal.data +package com.mogo.eagle.core.data.v2x import androidx.annotation.Keep import com.elegant.network.BaseResp -import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerCardResult import java.io.Serializable @Keep 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/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XOptimalRoute.kt similarity index 89% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XOptimalRoute.kt rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XOptimalRoute.kt index dd27d302af..414b29895e 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XOptimalRoute.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XOptimalRoute.kt @@ -1,7 +1,6 @@ -package com.mogo.eagle.core.function.v2x.internal.data +package com.mogo.eagle.core.data.v2x import androidx.annotation.Keep -import com.mogo.eagle.core.function.v2x.internal.data.V2XLocation import java.io.Serializable /** 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/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XRoadXEvent.kt similarity index 95% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XRoadXEvent.kt rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XRoadXEvent.kt index a692c2dfa7..08882f868a 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XRoadXEvent.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XRoadXEvent.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.v2x.internal.data +package com.mogo.eagle.core.data.v2x import androidx.annotation.Keep 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/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XWarningTarget.kt similarity index 96% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XWarningTarget.kt rename to core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XWarningTarget.kt index 8173032600..0dcecfaa99 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XWarningTarget.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/V2XWarningTarget.kt @@ -1,7 +1,6 @@ -package com.mogo.eagle.core.function.v2x.internal.data +package com.mogo.eagle.core.data.v2x import androidx.annotation.Keep -import com.mogo.eagle.core.function.v2x.internal.data.V2XLocation import java.io.Serializable /** diff --git a/core/function-impl/mogo-core-function-v2x/src/main/proto/road.proto b/core/mogo-core-data/src/main/proto/road.proto similarity index 100% rename from core/function-impl/mogo-core-function-v2x/src/main/proto/road.proto rename to core/mogo-core-data/src/main/proto/road.proto diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/IFuncBizProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/biz/IFuncBizProvider.kt similarity index 65% rename from core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/IFuncBizProvider.kt rename to core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/biz/IFuncBizProvider.kt index d25c01434a..594d2cbfeb 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/IFuncBizProvider.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/biz/IFuncBizProvider.kt @@ -1,7 +1,7 @@ -package com.mogo.eagle.core.function.api.v2x +package com.mogo.eagle.core.function.api.biz import com.mogo.eagle.core.data.map.Infrastructure -import com.mogo.eagle.core.data.v2x.V2XEvent +import com.mogo.eagle.core.data.v2x.V2XEventData interface IFuncBizProvider { /** @@ -12,5 +12,5 @@ interface IFuncBizProvider { /** * 根据lineId获取整条道路的V2X事件 */ - fun onV2XEvents(v2xEvents: List?) {} + fun onV2XEvents(v2XEventData: List?) {} } \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/biz/IMoGoFuncBizProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/biz/IMoGoFuncBizProvider.kt index 360416ca62..a3e8171204 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/biz/IMoGoFuncBizProvider.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/biz/IMoGoFuncBizProvider.kt @@ -56,4 +56,8 @@ interface IMoGoFuncBizProvider : IMoGoFunctionServerProvider { fun fetchInfStructures() fun getAllV2XEvents() + + fun queryV2XEvents() + + } \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/cloud/IMoGoCloudListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/cloud/IMoGoCloudListener.kt index 89cf1c82cc..ac98d5713f 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/cloud/IMoGoCloudListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/cloud/IMoGoCloudListener.kt @@ -1,6 +1,25 @@ package com.mogo.eagle.core.function.api.cloud -interface IMoGoCloudListener { +import com.mogo.eagle.core.data.v2x.V2XEvent - fun tokenGot(token: String, sn: String) +interface IMoGoCloudListener{ + + fun tokenGot(token: String, sn: String){} + + /** + * 获取到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/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/datacenter/msgbox/IMsgBoxEventListener.kt similarity index 91% rename from core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/msgbox/IMsgBoxEventListener.kt rename to core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/datacenter/msgbox/IMsgBoxEventListener.kt index 8cd6469ae6..b6568d1187 100644 --- 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/datacenter/msgbox/IMsgBoxEventListener.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.api.msgbox +package com.mogo.eagle.core.function.api.datacenter.msgbox import com.mogo.eagle.core.data.msgbox.MsgBoxBean diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/msgbox/IMsgBoxListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/datacenter/msgbox/IMsgBoxListener.kt similarity index 82% rename from core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/msgbox/IMsgBoxListener.kt rename to core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/datacenter/msgbox/IMsgBoxListener.kt index f09b416e68..bcd01a377e 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/msgbox/IMsgBoxListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/datacenter/msgbox/IMsgBoxListener.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.api.msgbox +package com.mogo.eagle.core.function.api.datacenter.msgbox import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.MsgCategory diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/msgbox/IMsgBoxProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/datacenter/msgbox/IMsgBoxProvider.kt similarity index 93% rename from core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/msgbox/IMsgBoxProvider.kt rename to core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/datacenter/msgbox/IMsgBoxProvider.kt index 9dbac58bbd..78007ffe72 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/msgbox/IMsgBoxProvider.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/datacenter/msgbox/IMsgBoxProvider.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.api.msgbox +package com.mogo.eagle.core.function.api.datacenter.msgbox import android.content.Context import com.mogo.eagle.core.data.msgbox.MsgBoxBean diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/ILimitingVelocityListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/datacenter/union/ILimitingVelocityListener.kt similarity index 82% rename from core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/ILimitingVelocityListener.kt rename to core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/datacenter/union/ILimitingVelocityListener.kt index c47ab242d8..425d43aa73 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/ILimitingVelocityListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/datacenter/union/ILimitingVelocityListener.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.api.v2x +package com.mogo.eagle.core.function.api.datacenter.union import com.mogo.eagle.core.data.enums.DataSourceType diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/IMoGoTrafficLightListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/datacenter/union/IMoGoTrafficLightListener.kt similarity index 96% rename from core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/IMoGoTrafficLightListener.kt rename to core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/datacenter/union/IMoGoTrafficLightListener.kt index 216a936e78..195217b4ae 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/IMoGoTrafficLightListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/datacenter/union/IMoGoTrafficLightListener.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.api.v2x +package com.mogo.eagle.core.function.api.datacenter.union import com.mogo.eagle.core.data.enums.DataSourceType import com.mogo.eagle.core.data.enums.TrafficLightEnum diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/autopilot/IMoGoCheckAutoPilotBtnListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/autopilot/IMoGoCheckAutoPilotBtnListener.kt index cbfb84bd8a..ba1f2dfa8d 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/autopilot/IMoGoCheckAutoPilotBtnListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/autopilot/IMoGoCheckAutoPilotBtnListener.kt @@ -6,5 +6,7 @@ package com.mogo.eagle.core.function.api.hmi.autopilot * 自动驾驶控制按钮回调监听 */ interface IMoGoCheckAutoPilotBtnListener { - fun onCheck(isChecked: Boolean) + fun onCheck(isChecked: Boolean) {} + + fun updateHDDataCacheStatus(isCached: Boolean) {} } \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuProvider.kt index 7f07c4f11e..10251bc371 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuProvider.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuProvider.kt @@ -14,4 +14,6 @@ interface IMoGoObuProvider : IMoGoFunctionServerProvider { fun disConnect() fun isConnected(): Boolean + + fun setObuLog(isChecked: Boolean) } \ 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 deleted file mode 100644 index 629ed5938d..0000000000 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/v2x/IV2XEventProvider.kt +++ /dev/null @@ -1,7 +0,0 @@ -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-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisLocationGCJ02ListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisLocationGCJ02ListenerManager.kt index 7fd0976c7e..1edd553d64 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisLocationGCJ02ListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisLocationGCJ02ListenerManager.kt @@ -16,7 +16,7 @@ import com.mogo.eagle.core.utilcode.util.TimeUtils */ object CallerChassisLocationGCJ02ListenerManager : CallerBase() { - val TAG = "CallerChassisLocationGCJ20ListenerManager" + private const val TAG = "CallerChassisLocationGCJ20ListenerManager" @Volatile private var mGnssInfo: MogoLocation? = null @@ -36,6 +36,8 @@ object CallerChassisLocationGCJ02ListenerManager : CallerBase() { @@ -24,10 +24,10 @@ object CallerFuncBizListenerManager: CallerBase() { } @MainThread - fun invokeV2XEvents(v2xEvents: List?) { + fun invokeV2XEvents(v2XEventData: List?) { M_LISTENERS.forEach { val listener = it.value - listener.onV2XEvents(v2xEvents) + listener.onV2XEvents(v2XEventData) } } } \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/cloud/CallerCloudListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/cloud/CallerCloudListenerManager.kt index ca770c35ca..bed5a7977a 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/cloud/CallerCloudListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/cloud/CallerCloudListenerManager.kt @@ -1,61 +1,26 @@ package com.mogo.eagle.core.function.call.cloud +import com.mogo.eagle.core.data.v2x.V2XEvent import com.mogo.eagle.core.function.api.cloud.IMoGoCloudListener -import java.util.concurrent.ConcurrentHashMap +import com.mogo.eagle.core.function.call.base.CallerBase -object CallerCloudListenerManager { - - private val M_CLOUD_LISTENER: ConcurrentHashMap = - ConcurrentHashMap() - - /** - * 添加监听 - * @param tag 标记,用来注销监听使用 - * @param listener 监听回调 - */ - fun registerCloudListener( - tag: String, - listener: IMoGoCloudListener - ) { - if (M_CLOUD_LISTENER.containsKey(tag)) { - return - } - M_CLOUD_LISTENER[tag] = listener - } - - /** - * 删除监听 - * @param tag 标记,用来注销监听使用 - */ - fun unRegisterCloudListener(tag: String) { - if (!M_CLOUD_LISTENER.containsKey(tag)) { - return - } - M_CLOUD_LISTENER.remove(tag) - } - - /** - * 删除监听 - * @param listener 要删除的监听对象 - */ - fun unRegisterCloudListener(listener: IMoGoCloudListener) { - if (!M_CLOUD_LISTENER.containsValue(listener)) { - return - } - M_CLOUD_LISTENER.forEach { - if (it.value == listener) { - M_CLOUD_LISTENER.remove(it.key) - } - } - } +object CallerCloudListenerManager : CallerBase() { /** * 分发获取到的设备sn */ fun invokeCloudTokenGot(token: String, sn: String) { - M_CLOUD_LISTENER.forEach { + M_LISTENERS.forEach { val listener = it.value listener.tokenGot(token, sn) } } + + fun invokeSocketAck(event: V2XEvent) { + M_LISTENERS.forEach { + val listener = it.value + listener.onAck(event) + } + } + } \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiListenerManager.kt index eae3b6cac2..d8cb8b533e 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiListenerManager.kt @@ -30,5 +30,11 @@ object CallerHmiListenerManager : CallerBase() { } } - + fun invokeHDDataCacheStatus(isCached: Boolean) { + M_LISTENERS.forEach { + val tag = it.key + val listener = it.value + listener.updateHDDataCacheStatus(isCached) + } + } } \ 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 8339a0c006..663a89c7bf 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 @@ -211,5 +211,4 @@ object CallerHmiManager { fun updateStatusBarDownloadView(insert: Boolean, tag: String, progress: Int) { hmiProviderApi?.updateStatusBarDownloadView(insert, tag, progress) } - } \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapUIServiceManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapUIServiceManager.kt index cb8288ae15..1c5104a623 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapUIServiceManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapUIServiceManager.kt @@ -5,6 +5,7 @@ import com.mogo.eagle.core.data.constants.MogoServicePaths import com.mogo.eagle.core.function.api.map.IMogoMapService import com.mogo.eagle.core.function.api.map.marker.IMogoMarkerService import com.mogo.eagle.core.function.call.base.CallerBase +import com.mogo.map.hdcache.IHdCacheListener import com.mogo.map.location.IMogoGDLocationClient import com.mogo.map.marker.IMogoMarkerManager import com.mogo.map.overlay.IMogoOverlayManager @@ -30,11 +31,19 @@ object CallerMapUIServiceManager { return serviceProvider?.markerService } + fun cacheHDDataByCity(listener: IHdCacheListener) { + serviceProvider?.mapUIController?.cacheHDDataByCity(listener) + } + + fun isCityDataCached(): Boolean { + return serviceProvider?.mapUIController?.isCityDataCached ?: true + } + fun getOverlayManager(): IMogoOverlayManager?{ return serviceProvider?.overlayManager } - fun getGDLocationServer(context: Context):IMogoGDLocationClient?{ + fun getGDLocationServer(context: Context): IMogoGDLocationClient?{ return serviceProvider?.getGDLocationServer(context) } } \ 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 deleted file mode 100644 index 1b2f35eff9..0000000000 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerSmpManager.kt +++ /dev/null @@ -1,78 +0,0 @@ -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.MogoServicePaths -import com.mogo.eagle.core.data.map.MogoLatLng -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 - -/** - * @author xiaoyuzhou - * @date 2021/9/17 6:15 下午 - * 小地图调用者管理,这里对外及其他模块提供小地图功能的调用,用啥写啥,不要过度设计,不允许直接将Provider暴露出去 - */ -object CallerSmpManager : CallerBase() { -// private val mogoSmallMapProvider: IMogoSmallMapProvider -// get() = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_SMP) -// .navigation() as IMogoSmallMapProvider - - private val v2xProvider: IV2XEventProvider - get() = ARouter.getInstance().build(MogoServicePaths.PATH_V2X_MODULE) - .navigation() as IV2XEventProvider - - /** - * 绘制路径线 - */ - @JvmStatic - fun drawablePolyline(coordinates: List?) { -// mogoSmallMapProvider.drawablePolyline(coordinates) - } - - /** - * 清除路径线 - */ - @JvmStatic - fun clearPolyline() { -// mogoSmallMapProvider.clearPolyline() - } - - /** - * 显示面板 - */ - @JvmStatic - fun showPanel() { -// mogoSmallMapProvider.showPanel() - } - - /** - * 隐藏面板 - */ - @JvmStatic - fun hidePanel() { -// mogoSmallMapProvider.hidePanel() - } - - @JvmStatic - fun startQueryV2XEvents() { - if (Thread.currentThread() !== Looper.getMainLooper().thread) { - UiThreadHandler.post { - v2xProvider.queryWholeRoadEvents() - } - } else { - v2xProvider.queryWholeRoadEvents() - } - } - - @JvmStatic - fun clearV2XMarkers() { -// if (Thread.currentThread() !== Looper.getMainLooper().thread) { -// UiThreadHandler.post { -// mogoOverViewMapProvider.clearV2XMarkers() -// } -// } else { -// mogoOverViewMapProvider.clearV2XMarkers() -// } - } -} \ No newline at end of file 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 index 35470b458f..bc761537ec 100644 --- 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 @@ -1,10 +1,8 @@ package com.mogo.eagle.core.function.call.msgbox -import androidx.annotation.Nullable import com.mogo.eagle.core.data.msgbox.MsgBoxBean -import com.mogo.eagle.core.function.api.msgbox.IMsgBoxEventListener +import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxEventListener import com.mogo.eagle.core.function.call.base.CallerBase -import java.util.concurrent.ConcurrentHashMap /** * @author XuXinChao diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/msgbox/CallerMsgBoxListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/msgbox/CallerMsgBoxListenerManager.kt index 3117b859a5..ba89cc5e6d 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/msgbox/CallerMsgBoxListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/msgbox/CallerMsgBoxListenerManager.kt @@ -2,7 +2,7 @@ package com.mogo.eagle.core.function.call.msgbox import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.MsgCategory -import com.mogo.eagle.core.function.api.msgbox.IMsgBoxListener +import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener import com.mogo.eagle.core.function.call.base.CallerBase /** 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..0bcd26be6a 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 @@ -3,7 +3,7 @@ package com.mogo.eagle.core.function.call.msgbox import android.content.Context 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 +import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxProvider import com.mogo.eagle.core.function.call.base.CallerBase object CallerMsgBoxManager { diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuApiManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuApiManager.kt index 0bc8fae569..66327389bc 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuApiManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuApiManager.kt @@ -40,4 +40,11 @@ object CallerObuApiManager { return providerApi.isConnected() } + /** + * 设置obu sdk的 日志 + */ + fun setObuLog(isSet: Boolean) { + providerApi.setObuLog(isSet) + } + } \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerLimitingVelocityListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerLimitingVelocityListenerManager.kt index a31d075db4..4c8811e2a1 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerLimitingVelocityListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerLimitingVelocityListenerManager.kt @@ -1,7 +1,7 @@ package com.mogo.eagle.core.function.call.v2x import com.mogo.eagle.core.data.enums.DataSourceType -import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener +import com.mogo.eagle.core.function.api.datacenter.union.ILimitingVelocityListener import com.mogo.eagle.core.function.call.base.CallerBase /** diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerTrafficLightListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerTrafficLightListenerManager.kt index 60e4cd4e78..b463b1400c 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerTrafficLightListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerTrafficLightListenerManager.kt @@ -3,7 +3,7 @@ package com.mogo.eagle.core.function.call.v2x import com.mogo.eagle.core.data.enums.DataSourceType import com.mogo.eagle.core.data.enums.TrafficLightEnum import com.mogo.eagle.core.data.trafficlight.TrafficLightResult -import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener +import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTrafficLightListener import com.mogo.eagle.core.function.call.base.CallerBase object CallerTrafficLightListenerManager : CallerBase() { diff --git a/libraries/mogo-map-api/src/main/java/com/mogo/map/hdcache/IHdCacheListener.kt b/libraries/mogo-map-api/src/main/java/com/mogo/map/hdcache/IHdCacheListener.kt new file mode 100644 index 0000000000..4761e40fff --- /dev/null +++ b/libraries/mogo-map-api/src/main/java/com/mogo/map/hdcache/IHdCacheListener.kt @@ -0,0 +1,5 @@ +package com.mogo.map.hdcache + +interface IHdCacheListener { + fun onMapHdCacheProgress(cityId: Int, progress: Double) +} \ No newline at end of file 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 362b48f839..8235fe8a36 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 @@ -9,6 +9,9 @@ import androidx.annotation.RawRes; import com.mogo.eagle.core.data.map.CenterLine; import com.mogo.eagle.core.data.map.MogoLatLng; +import com.mogo.map.hdcache.IHdCacheListener; + +import org.json.JSONObject; import com.mogo.eagle.core.data.map.MogoLocation; import java.util.List; @@ -348,4 +351,11 @@ public interface IMogoMapUIController { * @param color // color:"#RRGGBB* */ void setPointCloudColor(String color); + void cacheHDDataByCity(IHdCacheListener listener); + + /** + * 当前城市离线数据是否已缓存 + * @return + */ + boolean isCityDataCached(); } 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 e264f883ad..68c15404f3 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 @@ -17,12 +17,14 @@ import android.content.Context; import android.graphics.Point; import android.graphics.Rect; import android.os.Bundle; +import android.os.Looper; import android.os.Trace; import android.text.TextUtils; import android.util.Log; import android.view.MotionEvent; import android.view.View; +import androidx.annotation.MainThread; import androidx.annotation.NonNull; import com.mogo.commons.debug.DebugConfig; @@ -40,13 +42,16 @@ import com.mogo.eagle.core.function.call.map.CallerMapStyleListenerManager; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.mogo.toast.TipToast; import com.mogo.eagle.core.utilcode.util.UiThreadHandler; +import com.mogo.map.hdcache.IHdCacheListener; import com.mogo.map.listener.MogoMapListenerHandler; +import com.mogo.map.location.GDLocationClient; import com.mogo.map.uicontroller.CarCursorOption; import com.mogo.map.uicontroller.EnumMapUI; import com.mogo.map.uicontroller.IMogoMapUIController; import com.mogo.map.uicontroller.MapCameraPosition; import com.mogo.map.uicontroller.MapControlResult; import com.mogo.map.uicontroller.VisualAngleMode; +import com.mogo.map.utils.HDMapUtils; import com.mogo.map.utils.MogoMapUtils; import com.mogo.map.utils.ObjectUtils; import com.mogo.map.utils.ResIdCache; @@ -64,6 +69,7 @@ import com.zhidaoauto.map.sdk.open.business.PointCloudHelper; import com.zhidaoauto.map.sdk.open.camera.CameraPosition; import com.zhidaoauto.map.sdk.open.camera.CameraUpdateFactory; import com.zhidaoauto.map.sdk.open.camera.LatLngBounds; +import com.zhidaoauto.map.sdk.open.data.CityInfo; import com.zhidaoauto.map.sdk.open.data.MapDataApi; import com.zhidaoauto.map.sdk.open.location.LocationClient; import com.zhidaoauto.map.sdk.open.location.MyLocationStyle; @@ -115,6 +121,8 @@ public class AMapViewWrapper implements IMogoMapView, private boolean mIsFirstLocated = true; private boolean mIsDelayed = false; + private IHdCacheListener hdCacheListener; + public AMapViewWrapper(MapAutoView mMapView) { CallerLogger.INSTANCE.i(M_MAP + TAG, "autoop--AMapViewWrapper: init"); this.mMapView = mMapView; @@ -1035,4 +1043,47 @@ public class AMapViewWrapper implements IMogoMapView, } + + @Override + public void cacheHDDataByCity(IHdCacheListener listener) { + if (mMapView.getMapAutoViewHelper() != null) { + String gdCityCode = GDLocationClient.getInstance(getContext()).getLastCityCode(); + Integer id = HDMapUtils.getHDCityCode(gdCityCode); + if (id != null) { + hdCacheListener = listener; + mMapView.getMapAutoViewHelper().cacheHDDataByCity(id, (cityId, progress) -> { + if (Thread.currentThread() == Looper.getMainLooper().getThread()) { + if (hdCacheListener != null) { + hdCacheListener.onMapHdCacheProgress(cityId, progress * 100); + } + } else { + UiThreadHandler.post(() -> { + if (hdCacheListener != null) { + hdCacheListener.onMapHdCacheProgress(cityId, progress * 100); + } + }); + } + }); + } + } + } + + @Override + public boolean isCityDataCached() { + if (mMapView.getMapAutoViewHelper() != null) { + String gdCityCode = GDLocationClient.getInstance(getContext()).getLastCityCode(); + Integer id = HDMapUtils.getHDCityCode(gdCityCode); + if (id != null) { + List cityInfoList = mMapView.getMapAutoViewHelper().getAllCityCode(); + if (cityInfoList != null) { + for (CityInfo cityInfo : cityInfoList) { + if (id == cityInfo.getCityCode()) { + return cityInfo.isCache; + } + } + } + } + } + return true; + } } 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 f525de00c5..fbbb4ab578 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 @@ -2,12 +2,14 @@ package com.mogo.map; import android.graphics.Point; import android.graphics.Rect; +import android.location.Location; import android.view.View; import com.mogo.eagle.core.data.map.CenterLine; import com.mogo.eagle.core.data.map.MogoLatLng; import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; +import com.mogo.map.hdcache.IHdCacheListener; import com.mogo.map.uicontroller.AMapUIController; import com.mogo.map.uicontroller.CarCursorOption; import com.mogo.map.uicontroller.IMogoMapUIController; @@ -449,4 +451,19 @@ public class MogoMapUIController implements IMogoMapUIController { mDelegate.setPointCloudColor(color); } } + + @Override + public void cacheHDDataByCity(IHdCacheListener listener) { + if (mDelegate != null) { + mDelegate.cacheHDDataByCity(listener); + } + } + + @Override + public boolean isCityDataCached() { + if (mDelegate != null) { + return mDelegate.isCityDataCached(); + } + return true; + } } 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 9da7c35e7a..f48f36cc66 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 @@ -6,6 +6,7 @@ import android.view.View; import com.mogo.eagle.core.data.map.CenterLine; import com.mogo.eagle.core.data.map.MogoLatLng; +import com.mogo.map.hdcache.IHdCacheListener; import com.mogo.eagle.core.data.map.MogoLocation; import com.zhidaoauto.map.sdk.open.MapAutoApi; @@ -389,4 +390,19 @@ public class AMapUIController implements IMogoMapUIController { mClient.setPointCloudColor(color); } } + + @Override + public void cacheHDDataByCity(IHdCacheListener listener) { + if (mClient != null) { + mClient.cacheHDDataByCity(listener); + } + } + + @Override + public boolean isCityDataCached() { + if (mClient != null) { + return mClient.isCityDataCached(); + } + return true; + } } diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/utils/HDMapUtils.kt b/libraries/mogo-map/src/main/java/com/mogo/map/utils/HDMapUtils.kt new file mode 100644 index 0000000000..72e8eadaa5 --- /dev/null +++ b/libraries/mogo-map/src/main/java/com/mogo/map/utils/HDMapUtils.kt @@ -0,0 +1,28 @@ +package com.mogo.map.utils + +object HDMapUtils { + private val cityCodeMap by lazy(LazyThreadSafetyMode.SYNCHRONIZED) { + val map = HashMap() + // TODO:("高精地图自己去做") + map["0831"] = 5115// 宜宾市 + map["0512"] = 3205// 苏州市 + map["0872"] = 5329// 大理市 + map["0711"] = 4207// 鄂州市 + map["028"] = 5101// 成都市 + map["0931"] = 6201// 兰州市 + map["0535"] = 3706// 烟台市 + map["027"] = 4201// 武汉市 + map["010"] = 1101// 北京市 + map["0734"] = 4304// 衡阳市 + map + } + + /** + * gdCityCode: 高德CityCode + * return: 高精地图CityCode + */ + @JvmStatic + fun getHDCityCode(gdCityCode: String?): Int? { + return cityCodeMap[gdCityCode] + } +} \ No newline at end of file diff --git a/modules.txt b/modules.txt index acc4c7544b..a44a7cf029 100644 --- a/modules.txt +++ b/modules.txt @@ -20,7 +20,6 @@ :core:function-impl:mogo-core-function-datacenter :core:function-impl:mogo-core-function-hmi :core:function-impl:mogo-core-function-map -:core:function-impl:mogo-core-function-v2x :core:function-impl:mogo-core-function-chat :core:function-impl:mogo-core-function-devatools :core:function-impl:mogo-core-function-biz diff --git a/settings.gradle b/settings.gradle index 45b91c2c77..b04aa2b3f4 100644 --- a/settings.gradle +++ b/settings.gradle @@ -26,8 +26,6 @@ include ':core:function-impl:mogo-core-function-hmi' // 小地图控件 // 地图控件,HD-高精地图 include ':core:function-impl:mogo-core-function-map' -// v2x预警业务,本地+云端预警 -include ':core:function-impl:mogo-core-function-v2x' // 车聊聊业务 include ':core:function-impl:mogo-core-function-chat' // 业务biz