[2.13.0-opt]remove service module and module-common

This commit is contained in:
zhongchao
2022-12-23 14:09:47 +08:00
parent 704200d03f
commit 40caefa91f
163 changed files with 13479 additions and 980 deletions

View File

@@ -60,6 +60,7 @@ import com.mogo.eagle.core.utilcode.util.TimeUtils
import com.mogo.eagle.core.utilcode.util.Utils
import com.mogo.map.listener.*
import com.mogo.map.marker.*
import com.mogo.map.marker.MogoMarkersHandler.Companion.mogoMarkersHandler
import com.mogo.v2x.*
import com.mogo.v2x.callback.*
import com.mogo.v2x.config.*
@@ -80,7 +81,7 @@ import java.util.concurrent.atomic.*
object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallback,
IMogoMapListener, IMogoStatusChangedListener {
IMogoStatusChangedListener {
private const val TAG = "V2XEventManager"
@@ -129,31 +130,28 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
private fun registerListener() {
V2XManager.addCallback(this)
CallerMapLocationListenerManager.addListener(TAG, this, false)
BridgeApi.registerCenter()?.let {
it.registerMogoMapListener(MODULE_NAME, this)
it.registerMogoMarkerClickListener(
CARD_TYPE_ROAD_CONDITION,
object : IMogoMarkerClickListener {
override fun onMarkerClicked(marker: IMogoMarker?): Boolean {
handleRoadConditionMarkerClick(marker)
return false
}
})
}
MogoStatusManager.getInstance().registerStatusChangedListener(MODULE_NAME, StatusDescriptor.ACC_STATUS, this)
MogoStatusManager.getInstance().registerStatusChangedListener(MODULE_NAME, StatusDescriptor.SEEK_HELPING, this)
mogoMarkersHandler.registerMarkerClickListener(CARD_TYPE_ROAD_CONDITION,
object : IMogoMarkerClickListener {
override fun onMarkerClicked(marker: IMogoMarker?): Boolean {
handleRoadConditionMarkerClick(marker)
return super.onMarkerClicked(marker)
}
})
MogoStatusManager.getInstance()
.registerStatusChangedListener(MODULE_NAME, StatusDescriptor.ACC_STATUS, this)
MogoStatusManager.getInstance()
.registerStatusChangedListener(MODULE_NAME, StatusDescriptor.SEEK_HELPING, this)
}
private fun unRegisterListener() {
V2XManager.removeCallback(this)
CallerMapLocationListenerManager.removeListener(TAG, false)
BridgeApi.registerCenter()?.let {
it.unregisterMogoMapListener(MODULE_NAME)
it.unregisterMogoMarkerClickListener(CARD_TYPE_ROAD_CONDITION)
}
MogoStatusManager.getInstance().unregisterStatusChangedListener(MODULE_NAME, StatusDescriptor.ACC_STATUS, this)
MogoStatusManager.getInstance().unregisterStatusChangedListener(MODULE_NAME, StatusDescriptor.SEEK_HELPING, this)
mogoMarkersHandler.unregisterMarkerClickListener(CARD_TYPE_ROAD_CONDITION)
MogoStatusManager.getInstance()
.unregisterStatusChangedListener(MODULE_NAME, StatusDescriptor.ACC_STATUS, this)
MogoStatusManager.getInstance()
.unregisterStatusChangedListener(MODULE_NAME, StatusDescriptor.SEEK_HELPING, this)
}
@@ -356,7 +354,10 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
if (v2XRoadEventEntity != null) { // CallerLogger.w("$M_V2X$TAG",
val distance = v2XRoadEventEntity.distance
val min = if (EventTypeEnum.AI_ROAD_WORK.poiType == v2XRoadEventEntity.poiType) 0 else 5
Logger.d(TAG, "--- trigger show before ---:data=>[${location.longitude}, ${location.latitude}, ${location.speed}], distance: $distance, minDistance: $min, poiType: ${v2XRoadEventEntity.poiType}")
Logger.d(
TAG,
"--- trigger show before ---:data=>[${location.longitude}, ${location.latitude}, ${location.speed}], distance: $distance, minDistance: $min, poiType: ${v2XRoadEventEntity.poiType}"
)
if (distance >= min) {
Logger.d(TAG, "--- trigger show ---:poiType:" + v2XRoadEventEntity.poiType)
TrackUtils.trackV2xRoadProduceEvent(1)
@@ -441,7 +442,12 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
Pair(d.lon, d.lat)
}
extra["gps_location"] = listOf(Pair(this.roadwork?.center?.point?.lon ?: 0.0, this.roadwork?.center?.point?.lat ?: 0.0))
extra["gps_location"] = listOf(
Pair(
this.roadwork?.center?.point?.lon ?: 0.0,
this.roadwork?.center?.point?.lat ?: 0.0
)
)
}
}
l1.exploreWay = ArrayList<V2XMarkerExploreWay>().also { l2 ->
@@ -449,7 +455,10 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
l3.poiType = this.roadwork?.poiType?.toString()
l3.generateTime = this.roadwork?.detectTime ?: 0L
l3.location = V2XMarkerLocation().also { l4 ->
val p = CoordinateUtils.transformWgsToGcj(this.roadwork?.center?.point?.lat ?: 0.0, this.roadwork?.center?.point?.lon ?: 0.0)
val p = CoordinateUtils.transformWgsToGcj(
this.roadwork?.center?.point?.lat ?: 0.0,
this.roadwork?.center?.point?.lon ?: 0.0
)
l4.lon = p[0]
l4.lat = p[1]
l4.angle = this.roadwork?.center?.road?.bearing?.toDouble() ?: 0.0
@@ -457,7 +466,16 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
})
}
AiRoadMarker.receive(Marker(this.roadwork?.center?.point?.lat ?: 0.0, this.roadwork?.center?.point?.lon ?: 0.0, this.roadwork?.center?.road?.bearing?.toDouble() ?: 0.0, null, null, null))
AiRoadMarker.receive(
Marker(
this.roadwork?.center?.point?.lat ?: 0.0,
this.roadwork?.center?.point?.lon ?: 0.0,
this.roadwork?.center?.road?.bearing?.toDouble() ?: 0.0,
null,
null,
null
)
)
}
// private fun buildRoadEntity(e: V2XMarkerExploreWay, extra: Map<String, Any>? = null): V2XRoadEventEntity { // 记录道路事件
@@ -513,7 +531,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
when (message.typeId) {
1001 -> {
// 弱势交通碰撞预警
EventTypeHelper.getVRU{ appId, tts, content ->
EventTypeHelper.getVRU { appId, tts, content ->
tempAppId = appId
tempTts = tts
tempContent = content
@@ -558,7 +576,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
}
2001 -> {
// 最优车道100061
EventTypeHelper.getOptLine{ appId, tts, content ->
EventTypeHelper.getOptLine { appId, tts, content ->
tempAppId = appId
tempTts = tts
tempContent = content
@@ -566,7 +584,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
}
3001 -> {
// 前方道路拥堵预警
EventTypeHelper.getTJW{ appId, tts, content ->
EventTypeHelper.getTJW { appId, tts, content ->
tempAppId = appId
tempTts = tts
tempContent = content
@@ -580,9 +598,11 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X,
V2XMsg(tempAppId.toString(),
V2XMsg(
tempAppId.toString(),
tempContent,
tempTts)
tempTts
)
)
)
CallerHmiManager.warningV2X(

View File

@@ -7,7 +7,6 @@ import com.mogo.eagle.core.function.v2x.events.consts.MoGoV2XServicePaths
import com.mogo.eagle.core.function.v2x.events.manager.*
import com.mogo.eagle.core.function.v2x.events.network.V2XRefreshModel
import com.mogo.eagle.core.utilcode.util.Utils
import com.mogo.module.common.MogoApisHandler
import java.lang.ref.WeakReference
import java.util.concurrent.atomic.AtomicReference
@@ -21,10 +20,6 @@ internal object BridgeApi {
AtomicReference<MogoLocation>()
}
private val apis by lazy {
MogoApisHandler.getInstance().apis
}
private val v2xMarker by lazy {
ARouter.getInstance().build(MoGoV2XServicePaths.PATH_V2X_MARKER_MANAGER).navigation(context()) as? IMoGoV2XMarkerManager
}
@@ -73,6 +68,4 @@ internal object BridgeApi {
fun refreshModel(): V2XRefreshModel = v2xRefreshModel
fun registerCenter() = apis?.registerCenterApi
}

View File

@@ -4,15 +4,15 @@ import static com.mogo.eagle.core.data.config.HmiBuildConfig.isShowObuLimitSpeed
import static com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.BIZ_SLW;
import static com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.V2I;
import android.location.Location;
import android.util.Log;
import androidx.annotation.Nullable;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
import com.mogo.eagle.core.function.call.v2x.CallLimitingVelocityListenerManager;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.map.MogoMapUIController;
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
import com.mogo.module.common.MogoApisHandler;
import com.zhjt.service_biz.BizConfig;
import java.util.Timer;
@@ -23,10 +23,11 @@ import java.util.TimerTask;
*
* @author mogoauto
*/
public class SpeedLimitDataManager implements IMogoCarLocationChangedListener2 {
public class SpeedLimitDataManager implements IMoGoMapLocationListener {
private final static String TAG = "SpeedLimitDataManager";
private static SpeedLimitDataManager instance;
private Location mLocation;
private MogoLocation mLocation;
private SpeedLimitDataManager() {
}
@@ -42,6 +43,11 @@ public class SpeedLimitDataManager implements IMogoCarLocationChangedListener2 {
return instance;
}
@Override
public void onLocationChanged(@Nullable MogoLocation location, int from, boolean isGps) {
mLocation = location;
}
private class SpeedTimerTask extends TimerTask {
@Override
public void run() {
@@ -52,7 +58,7 @@ public class SpeedLimitDataManager implements IMogoCarLocationChangedListener2 {
}
}
@BizConfig(biz = V2I,dependentBizNode = "",bizNode = BIZ_SLW)
@BizConfig(biz = V2I, dependentBizNode = "", bizNode = BIZ_SLW)
private void getSpeedLimit() {
if (!isShowObuLimitSpeedView) {
int speedLimit = MogoMapUIController.getInstance().getLimitSpeed(mLocation.getLongitude(), mLocation.getLatitude(), mLocation.getBearing());
@@ -67,15 +73,9 @@ public class SpeedLimitDataManager implements IMogoCarLocationChangedListener2 {
}
public void start() {
MogoApisHandler.getInstance().getApis().getRegisterCenterApi().registerCarLocationChangedListener("SpeedLimitDataManager", this);
CallerMapLocationListenerManager.INSTANCE.addListener(TAG, this, false);
Timer mTimer = new Timer();
mTimer.schedule(new SpeedTimerTask(), 3000, 1000);
}
@Override
public void onCarLocationChanged2(Location latLng) {
mLocation = latLng;
}
}

View File

@@ -1,12 +1,12 @@
package com.mogo.eagle.core.function.v2x.trafficlight.core
import android.content.Context
import android.location.Location
import android.os.Handler
import android.os.Looper
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.data.trafficlight.*
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.v2x.trafficlight.TrafficLightHMIManager
@@ -15,10 +15,10 @@ import com.mogo.eagle.core.function.v2x.trafficlight.core.TrafficLightThreadHand
import com.mogo.eagle.core.function.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_STOP_SEARCH_CROSS_ROAD
import com.mogo.eagle.core.function.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_STOP_SEARCH_TRAFFIC_LIGHT
import com.mogo.eagle.core.function.v2x.trafficlight.network.TrafficLightNetWorkModel
import com.mogo.map.navi.IMogoCarLocationChangedListener2
import com.mogo.module.common.MogoApisHandler
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
class MogoTrafficLightManager : IMogoCarLocationChangedListener2 {
class MogoTrafficLightManager : IMoGoMapLocationListener {
companion object {
@@ -31,7 +31,7 @@ class MogoTrafficLightManager : IMogoCarLocationChangedListener2 {
private var mContext: Context? = null
private val trafficLightNetWorkModel = TrafficLightNetWorkModel()
private var mLocation: Location? = null
private var mLocation: MogoLocation? = null
private var roadIDResult: RoadIDResult? = null
private var trafficLightResult: TrafficLightResult? = null
@@ -42,18 +42,18 @@ class MogoTrafficLightManager : IMogoCarLocationChangedListener2 {
fun initServer(context: Context) {
mContext = context
MogoApisHandler.getInstance().apis
.registerCenterApi.registerCarLocationChangedListener(TAG, this)
CallerMapLocationListenerManager.addListener(TAG, this, false)
mThreadHandler =
TrafficLightThreadHandler(Looper.getMainLooper(), {
//第一次查询路口时,如果红绿灯显示,则隐藏掉
if(firstLoopCrossRoad && TrafficLightHMIManager.INSTANCE.isWarningTrafficLightShow()){
if (firstLoopCrossRoad && TrafficLightHMIManager.INSTANCE.isWarningTrafficLightShow()) {
TrafficLightHMIManager.INSTANCE.hideTrafficLight()
CallerTrafficLightListenerManager.resetTrafficLightData()
}
firstLoopCrossRoad = false
mLocation?.let { it ->
val tileId = CallerMapUIServiceManager.getMapUIController()?.getTileId(it.longitude, it.latitude) ?: 0
val tileId = CallerMapUIServiceManager.getMapUIController()
?.getTileId(it.longitude, it.latitude) ?: 0
trafficLightNetWorkModel.requestRoadID(
tileId, it.latitude, it.longitude, it.bearing.toDouble(),
{
@@ -173,9 +173,9 @@ class MogoTrafficLightManager : IMogoCarLocationChangedListener2 {
)
}
override fun onCarLocationChanged2(latLng: Location?) {
latLng?.let {
mLocation = latLng
override fun onLocationChanged(location: MogoLocation?, from: Int, isGps: Boolean) {
location?.let {
mLocation = it
checkOutOfRange()
}
}
@@ -187,4 +187,5 @@ class MogoTrafficLightManager : IMogoCarLocationChangedListener2 {
trafficLightResult = null
}
}