Merge branch 'dev_robotaxi-d_230912_6.1.0' of gitlab.zhidaoauto.com:SCA/L4HA/AndroidApp/MoGoEagleEye into dev_robotaxi-d_230912_6.1.0

This commit is contained in:
xinfengkun
2023-09-25 15:09:12 +08:00
1542 changed files with 77840 additions and 7659 deletions

View File

@@ -118,7 +118,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
"$M_V2X$TAG",
"路口经度为:${trafficLightResult.lon},纬度为:${trafficLightResult.lat};车的经度为:${it.longitude},纬度为:${it.latitude};两点距离为:${distance}"
)
val remainTime = trafficLightStatus.remain
val remainTime = trafficLightStatus.time()
val arriveTime = distance / speed
CallerLogger.d(
"$M_V2X$TAG",
@@ -235,7 +235,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
speed
)
if (content.isNullOrEmpty() || tts.isNullOrEmpty()) {
if (content.isEmpty() || tts.isEmpty()) {
Log.d("MsgBox-RedLightWarManaG", "alertContent或ttsContent为空!")
}
CallerMsgBoxManager.saveMsgBox(
@@ -263,8 +263,8 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
}
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
gnssInfo?.let {
override fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) {
mogoLocation?.let {
mLocation = it
}
}

View File

@@ -11,7 +11,7 @@ import com.mogo.eagle.core.data.biz.trafficlight.isInRange
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
@@ -21,7 +21,8 @@ import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandl
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_STOP_SEARCH_TRAFFIC_LIGHT
import com.mogo.eagle.function.biz.v2x.trafficlight.network.TrafficLightNetWorkModel
class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener,
CallerMapRoadListenerManager.OnRoadListener {
companion object {
@@ -40,7 +41,7 @@ class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
private var roadIDResult: RoadIDResult? = null
@Volatile
private var trafficLightResult: TrafficLightResult? = null
@Volatile
private var inRange: Boolean = false
@Volatile
private var firstLoopCrossRoad: Boolean = true //开启循环请求路口
@@ -50,6 +51,7 @@ class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
fun initServer(context: Context) {
mContext = context
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, this)
CallerMapRoadListenerManager.registerRoadListener(TAG, this)
mThreadHandler =
TrafficLightThreadHandler(Looper.getMainLooper(), {
//第一次查询路口时,如果红绿灯显示,则隐藏掉
@@ -119,29 +121,46 @@ class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
mThreadHandler?.sendEmptyMessageDelayed(MSG_WHAT_LOOP_SEARCH_CROSS_ROAD, 5_000L)
}
override fun onRoadChange(cross: Boolean) {
super.onRoadChange(cross)
if(!cross){
outOfCrossRange()
}
}
private fun checkOutOfRange() {
mLocation?.let { loc ->
roadIDResult?.let {
// 检测是否开过路口,开过路口则停止读灯。并重置 trafficLightResult 值为 null
if (trafficLightResult != null && it.isInRange(loc.latitude, loc.longitude)) {
if(inRange){
return
}
inRange = true
// CallerLogger.d(M_V2X + TAG, "进入路口")
CallerLogger.d(M_V2X + TAG, "进入路口")
CallerTrafficLightListenerManager.invokeEnterCrossRoad(true)
return
}
if (inRange) {
// CallerLogger.d(M_V2X + TAG, "离开路口")
CallerTrafficLightListenerManager.invokeEnterCrossRoad(false)
inRange = false
trafficLightResult = null
firstLoopCrossRoad = true
mThreadHandler?.sendEmptyMessage(MSG_WHAT_STOP_SEARCH_TRAFFIC_LIGHT)
CallerTrafficLightListenerManager.resetTrafficLightStatus()
outOfCrossRange()
}
}
}
}
private fun outOfCrossRange(){
CallerLogger.d(M_V2X + TAG, "离开路口 , inRange:$inRange")
if(!inRange){
return
}
CallerTrafficLightListenerManager.invokeEnterCrossRoad(false)
inRange = false
trafficLightResult = null
firstLoopCrossRoad = true
mThreadHandler?.sendEmptyMessage(MSG_WHAT_STOP_SEARCH_TRAFFIC_LIGHT)
CallerTrafficLightListenerManager.resetTrafficLightStatus()
}
fun getRoadResult(): RoadIDResult? {
return roadIDResult
}

View File

@@ -4,12 +4,12 @@ import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.constants.HostConst
import com.mogo.eagle.core.data.BaseResponse
import com.mogo.eagle.core.data.biz.trafficlight.*
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.network.MoGoRetrofitFactory
import com.mogo.eagle.core.network.apiCall
import com.mogo.eagle.core.network.cancel
import com.mogo.eagle.core.network.request
import com.mogo.eagle.core.utilcode.util.GsonUtils
import com.mogo.map.MogoData.Companion.mogoMapData
class TrafficLightNetWorkModel {
@@ -28,8 +28,7 @@ class TrafficLightNetWorkModel {
request<BaseResponse<RoadIDResult>>("requestRoadID") {
loader {
apiCall {
val tileId = CallerMapUIServiceManager.getMapUIController()
?.getTileId(lon, lat) ?: 0
val tileId = mogoMapData.get()?.getTileId(lon, lat)?:0
val map = hashMapOf<String, String>()
val roadIDRequestData = RoadIDRequestData(tileId, lat, lon, bearing)
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn

View File

@@ -1,8 +1,7 @@
package com.mogo.eagle.function.biz.v2x.v2n.scenario.impl;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import static com.mogo.map.MogoMap.DEFAULT;
import com.mogo.commons.module.status.MogoStatusManager;
import com.mogo.eagle.core.data.config.HmiBuildConfig;
@@ -25,24 +24,19 @@ import com.mogo.map.uicontroller.VisualAngleMode;
* version: 1.0
*/
public class V2XScenarioManager implements IV2XScenarioManager {
private static V2XScenarioManager mV2XScenarioManager;
private static final String TAG = "V2XScenarioManager";
private AbsV2XScenario mV2XScenario = null;
private V2XScenarioManager() {
}
public static V2XScenarioManager getInstance() {
if (mV2XScenarioManager == null) {
synchronized (V2XScenarioManager.class) {
if (mV2XScenarioManager == null) {
mV2XScenarioManager = new V2XScenarioManager();
}
}
}
return mV2XScenarioManager;
private static final class MV2XScenarioManagerHolder {
static final V2XScenarioManager mV2XScenarioManager = new V2XScenarioManager();
}
public static V2XScenarioManager getInstance() {
return MV2XScenarioManagerHolder.mV2XScenarioManager;
}
@Override
public void handlerMessage(V2XMessageEntity v2XMessageEntity) {
@@ -93,7 +87,7 @@ public class V2XScenarioManager implements IV2XScenarioManager {
* 道路事件触发后,切换到中景
*/
private void sceneChange() {
IMogoMapUIController mapUiController = CallerMapUIServiceManager.INSTANCE.getMapUIController();
IMogoMapUIController mapUiController = CallerMapUIServiceManager.INSTANCE.getMapUIController(DEFAULT);
if (mapUiController != null && mapUiController.getCurrentMapVisualAngle() != VisualAngleMode.MODE_MEDIUM_SIGHT) {
mapUiController.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
}

View File

@@ -18,11 +18,13 @@ import com.mogo.eagle.function.biz.v2x.v2n.consts.V2XConst
import com.mogo.eagle.function.biz.v2x.v2n.remove.MarkerRemoveManager
import com.mogo.eagle.function.biz.v2x.v2n.remove.MarkerWrapper
import com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.road.V2XAiRoadEventMarker
import com.mogo.map.MogoMap
import com.mogo.map.MogoData.Companion.mogoMapData
import com.mogo.map.overlay.core.Level.ROAD_CENTER_LINE
import com.mogo.map.overlay.line.*
import com.mogo.map.overlay.line.Polyline
import com.zhidaoauto.map.data.road.CenterLine
import java.util.*
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.atomic.AtomicInteger
import java.util.concurrent.atomic.AtomicReference
/**
@@ -33,9 +35,9 @@ class AiRoadMarker {
companion object {
@JvmField
val aiMakers = ConcurrentHashMap<String, AiRoadMarker>()
}
private val TAG = "AiRoadMarker"
private const val TAG = "AiRoadMarker"
}
private val marker by lazy { AtomicReference<Marker>() }
@@ -49,20 +51,26 @@ class AiRoadMarker {
private val roadMarker by lazy { V2XAiRoadEventMarker() }
private val line = AtomicReference<Polyline>()
private val countDown = AtomicInteger(0)
private val handler by lazy {
Handler(Looper.getMainLooper())
}
private val v2nDrawHandler by lazy {
HandlerThread("v2n_draw_thread").let { it.start(); Handler(it.looper)}
HandlerThread("v2n_draw_thread").let { it.start(); Handler(it.looper) }
}
private val checkExpiredTask = Runnable {
val poi = this.marker.get()
val car = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
if (poi != null) {
val distance = CoordinateUtils.calculateLineDistance(car.longitude, car.latitude, poi.poi_lon, poi.poi_lat)
val distance = CoordinateUtils.calculateLineDistance(
car.longitude,
car.latitude,
poi.poi_lon,
poi.poi_lat
)
if (distance < 500) {
unMarker(poi)
}
@@ -70,7 +78,8 @@ class AiRoadMarker {
}
private val builder by lazy {
Polyline.Options.Builder(V2XConst.V2X_MARKER_OWNER, ROAD_CENTER_LINE).setIsGradient(true).setWidth(50f).setUseGps(true)
Polyline.Options.Builder(V2XConst.V2X_MARKER_OWNER, ROAD_CENTER_LINE).setIsGradient(true)
.setWidth(50f).setUseGps(true)
}
fun marker(marker: Marker, drawMarker: Boolean, drawRoadLine: Boolean = false) {
@@ -83,99 +92,130 @@ class AiRoadMarker {
}
if (drawRoadLine) {
//施工中心点前方的自车行驶方向上300米距离
val l1 = MogoMap.getInstance().mogoMap.getCenterLineRangeInfo(
var l1: CenterLine? = null
var l2: CenterLine? = null
mogoMapData.get()?.getCenterLineRangeInfo(
marker.poi_lon,
marker.poi_lat,
location.heading.toFloat(),
300f
)
//施工中心点后方的自车行驶方向上300米距离
V2XBizTrace.onAck("$TAG --- marker --- 3 --- l1:", l1)
val l2 = MogoMap.getInstance().mogoMap.getCenterLineRangeInfo(
marker.poi_lon,
marker.poi_lat,
location.heading.toFloat(),
-300f
)
if (l1.points.isEmpty() || l2.points.isEmpty()) {
V2XBizTrace.onAck("$TAG --- marker --- 3 --- return ----", "")
return@post
}
V2XBizTrace.onAck("$TAG --- marker --- 4 --- l2:", l2)
val points = LinkedList<MogoLatLng>()
if (l2 != null && l2.points.isNotEmpty()) {
points.addAll(l2.points.reversed().map {
MogoLatLng(it.second, it.first)
300f, call = { result ->
//施工中心点后方的自车行驶方向上300米距离
result?.let {
V2XBizTrace.onAck("$TAG --- marker --- 3 --- l1:", it)
l1 = result
}
countDown.incrementAndGet()
realMark(marker, wrapper, l1, l2, location.heading)
})
}
val centerX = marker.poi_lon
val centerY = marker.poi_lat
V2XBizTrace.onAck("$TAG --- marker --- 5 --- marker:", marker)
val farthestPoint = marker.polygon?.let {
var find: Pair<Double, Double> = Pair(centerX, centerY)
var min = Long.MAX_VALUE
for (p in it) {
val angle = DrivingDirectionUtils.getDegreeOfCar2Poi2(
centerX,
centerY,
p.first,
p.second,
location.heading
)
if (angle < min) {
min = angle
find = p
mogoMapData.get()?.getCenterLineRangeInfo(
marker.poi_lon,
marker.poi_lat,
location.heading.toFloat(),
-300f, call = { result ->
result?.let {
V2XBizTrace.onAck("$TAG --- marker --- 3 --- l2:", it)
l2 = result
}
}
MogoLatLng(find.second, find.first)
} ?: MogoLatLng(centerY, centerX)
marker.farthestPoint = Pair(farthestPoint.lon, farthestPoint.lat)
V2XBizTrace.onAck("$TAG --- marker --- 6 --- marker:", marker)
if (l1 != null && l1.points.isNotEmpty()) {
for (l in l1.points) {
if (DrivingDirectionUtils.getDegreeOfCar2Poi2(
farthestPoint.lon,
farthestPoint.lat,
l.first,
l.second,
(location.heading + 180)
) < 90L
) {
points.add(l.let { MogoLatLng(it.second, it.first) })
}
}
}
if (points.size <= 1) {
return@post
}
val evaluator = ArgbEvaluator()
val interceptor = DecelerateInterpolator(1.5f)
val total = points.size
val colors = ArrayList<Int>()
(0..total).forEach { i ->
colors += evaluator.evaluate(
interceptor.getInterpolation(i * 1f / total),
START_COLOR,
END_COLOR
) as Int
}
builder.points(points)
builder.colors(colors)
builder.setVisible(true)
V2XBizTrace.onAck("$TAG --- marker --- 7 --- points:", "${points.size}")
val line = overlayManager?.showOrUpdateLine(builder.build())
if (line != null) {
this.line.set(line)
wrapper.addLine(line)
}
countDown.incrementAndGet()
realMark(marker, wrapper, l1, l2, location.heading)
})
}
wrapper.onRemoved = { id ->
aiMakers.remove(id)
}
MarkerRemoveManager.addMarker(wrapper)
}
}
@Synchronized
private fun realMark(
marker: Marker,
wrapper: MarkerWrapper,
l1: CenterLine?,
l2: CenterLine?,
heading: Double
) {
if (countDown.get() != 2) {
return
}
if (l1 == null || l2 == null) {
V2XBizTrace.onAck("$TAG --- marker --- 3 --- line null return ----", "")
return
}
if (l1.points.isEmpty() || l2.points.isEmpty()) {
V2XBizTrace.onAck("$TAG --- marker --- 3 --- line points null return ----", "")
return
}
V2XBizTrace.onAck("$TAG --- marker --- 4 --- l2:", l2)
val points = LinkedList<MogoLatLng>()
if (l2.points.isNotEmpty()) {
points.addAll(l2.points.reversed().map {
MogoLatLng(it.latitude, it.longitude)
})
}
val centerX = marker.poi_lon
val centerY = marker.poi_lat
V2XBizTrace.onAck("$TAG --- marker --- 5 --- marker:", marker)
val farthestPoint = marker.polygon?.let {
var find: Pair<Double, Double> = Pair(centerX, centerY)
var min = Long.MAX_VALUE
for (p in it) {
val angle = DrivingDirectionUtils.getDegreeOfCar2Poi2(
centerX,
centerY,
p.first,
p.second,
heading
)
if (angle < min) {
min = angle
find = p
}
}
MogoLatLng(find.second, find.first)
} ?: MogoLatLng(centerY, centerX)
marker.farthestPoint = Pair(farthestPoint.lon, farthestPoint.lat)
V2XBizTrace.onAck("$TAG --- marker --- 6 --- marker:", marker)
if (l1.points.isNotEmpty()) {
for (l in l1.points) {
if (DrivingDirectionUtils.getDegreeOfCar2Poi2(
farthestPoint.lon,
farthestPoint.lat,
l.longitude,
l.latitude,
(heading + 180)
) < 90L
) {
points.add(l.let { MogoLatLng(it.latitude, it.longitude) })
}
}
}
if (points.size <= 1) {
return
}
val evaluator = ArgbEvaluator()
val interceptor = DecelerateInterpolator(1.5f)
val total = points.size
val colors = ArrayList<Int>()
(0..total).forEach { i ->
colors += evaluator.evaluate(
interceptor.getInterpolation(i * 1f / total),
START_COLOR,
END_COLOR
) as Int
}
builder.points(points)
builder.colors(colors)
builder.setVisible(true)
V2XBizTrace.onAck("$TAG --- marker --- 7 --- points:", "${points.size}")
val line = overlayManager?.showOrUpdateLine(builder.build())
if (line != null) {
this.line.set(line)
wrapper.addLine(line)
}
wrapper.onRemoved = { id ->
aiMakers.remove(id)
}
MarkerRemoveManager.addMarker(wrapper)
countDown.set(0)
}
private fun removeLine() {
val old = line.get()
V2XBizTrace.onAck("$TAG --- removeRedLine --- 1", "")
@@ -202,7 +242,12 @@ class AiRoadMarker {
val poi = this.marker.get()
val car = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
if (poi != null) {
val distance = CoordinateUtils.calculateLineDistance(car.longitude, car.latitude, poi.poi_lon, poi.poi_lat)
val distance = CoordinateUtils.calculateLineDistance(
car.longitude,
car.latitude,
poi.poi_lon,
poi.poi_lat
)
V2XBizTrace.onAck(
"$TAG --- receive --- 2 ---",
"car:[${car.longitude}, ${car.latitude}] -> poi:[${poi.poi_lon}, ${poi.poi_lat}] --> distance:$distance"

View File

@@ -1,6 +1,7 @@
package com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.road;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X;
import static com.mogo.map.MogoMap.DEFAULT;
import androidx.core.util.Pair;
import com.mogo.eagle.core.data.enums.EventTypeEnumNew;
@@ -54,7 +55,7 @@ public class V2XRoadEventMarker implements IV2XMarker<V2XRoadEventEntity> {
.longitude(entity.getLocation().getLon())
.latitude(entity.getLocation().getLat())
.set3DMode(true)
.icon3DRes(EventTypeEnumNew.getMarker3DRes(entity.getPoiType())).build());
.icon3DRes(EventTypeEnumNew.getMarker3DRes(entity.getPoiType())).build(),DEFAULT);
if (point != null) {
V2XBizTrace.Companion.onAck("V2XRoadEventMarker -> --- add Marker type: ", entity.getPoiType());
ArrayList<Point> markers = new ArrayList<>();

View File

@@ -5,8 +5,6 @@ import com.mogo.commons.utils.MogoAnalyticUtils
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.enums.CommunicationType
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.function.api.biz.IFuncBizProvider
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.biz.CallerFuncBizListenerManager
@@ -17,7 +15,7 @@ import java.util.concurrent.atomic.AtomicBoolean
/**
* V2X消息播报埋点统计
*/
object V2XEventAnalyticsManager: IMoGoChassisLocationWGS84Listener,IFuncBizProvider{
object V2XEventAnalyticsManager: IFuncBizProvider{
private const val TAG = "V2XEventAnalyticsManager"
private val hasInit by lazy { AtomicBoolean(false) }
@@ -38,10 +36,6 @@ object V2XEventAnalyticsManager: IMoGoChassisLocationWGS84Listener,IFuncBizProvi
private const val EVENT_PARAMS_LATITUDE ="latitude" // 纬度
private const val EVENT_PARAMS_HEADING ="heading" // 航向角
private var longitude: Double?=null //经度
private var latitude: Double?=null //纬度
private var heading: Double?=null //航向角
private var oldTime = System.currentTimeMillis()
fun init(){
@@ -52,13 +46,11 @@ object V2XEventAnalyticsManager: IMoGoChassisLocationWGS84Listener,IFuncBizProvi
private fun registerListener(){
// 添加 ADAS车辆状态&定位 监听
CallerChassisLocationWGS84ListenerManager.addListener(TAG, this)
CallerFuncBizListenerManager.addListener(TAG,this)
}
private fun unRegisterListener(){
// 移除 ADAS车辆状态&定位 监听
CallerChassisLocationWGS84ListenerManager.removeListener(TAG)
CallerFuncBizListenerManager.removeListener(TAG)
}
@@ -87,9 +79,9 @@ object V2XEventAnalyticsManager: IMoGoChassisLocationWGS84Listener,IFuncBizProvi
msgEventParams[EVENT_PARAMS_PLATE_NUMBER] = AppConfigInfo.plateNumber //车牌号
msgEventParams[EVENT_PARAMS_CAR_SN] = MoGoAiCloudClientConfig.getInstance().sn //鹰眼SN
msgEventParams[EVENT_PARAMS_EYE_VERSION] = AppUtils.getAppVersionName() //鹰眼版本
msgEventParams[EVENT_PARAMS_LONGITUDE] = "$longitude" //经度
msgEventParams[EVENT_PARAMS_LATITUDE] = "$latitude" //纬度
msgEventParams[EVENT_PARAMS_HEADING] = "$heading" //航向角
msgEventParams[EVENT_PARAMS_LONGITUDE] = "${CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().longitude}" //经度
msgEventParams[EVENT_PARAMS_LATITUDE] = "${CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().latitude}" //纬度
msgEventParams[EVENT_PARAMS_HEADING] = "${CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().heading}" //航向角
MogoAnalyticUtils.track(EVENT_KEY_RECEIVE_V2X_MSG,msgEventParams)
}
@@ -109,20 +101,12 @@ object V2XEventAnalyticsManager: IMoGoChassisLocationWGS84Listener,IFuncBizProvi
msgEventParams[EVENT_PARAMS_PLATE_NUMBER] = AppConfigInfo.plateNumber //车牌号
msgEventParams[EVENT_PARAMS_CAR_SN] = MoGoAiCloudClientConfig.getInstance().sn //鹰眼SN
msgEventParams[EVENT_PARAMS_EYE_VERSION] = AppUtils.getAppVersionName() //鹰眼版本
msgEventParams[EVENT_PARAMS_LONGITUDE] = "$longitude" //经度
msgEventParams[EVENT_PARAMS_LATITUDE] = "$latitude" //纬度
msgEventParams[EVENT_PARAMS_HEADING] = "$heading" //航向角
msgEventParams[EVENT_PARAMS_LONGITUDE] = "${CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().longitude}" //经度
msgEventParams[EVENT_PARAMS_LATITUDE] = "${CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().latitude}" //纬度
msgEventParams[EVENT_PARAMS_HEADING] = "${CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().heading}" //航向角
MogoAnalyticUtils.track(EVENT_KEY_V2X_MSG_EVENT,msgEventParams)
}
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
gnssInfo.let {
longitude = it.longitude
latitude = it.latitude
heading = it.heading
}
}
fun onDestroy(){
if (hasInit.compareAndSet(true, false)){
unRegisterListener()

View File

@@ -11,6 +11,7 @@ import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.biz.trafficlight.TrafficLightResult
import com.mogo.eagle.core.data.biz.trafficlight.currentRoadTrafficLight
import com.mogo.eagle.core.data.biz.trafficlight.isGreen
import com.mogo.eagle.core.data.biz.trafficlight.time
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_VIP
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2N
import com.mogo.eagle.core.data.enums.CommunicationType
@@ -34,6 +35,7 @@ import com.mogo.eagle.function.biz.v2x.trafficlight.core.MogoTrafficLightManager
import com.mogo.eagle.function.biz.v2x.v2n.utils.V2XEventAnalyticsManager
import com.mogo.eagle.function.biz.v2x.vip.network.VipNetWorkModel
import com.zhjt.service_biz.BizConfig
import kotlin.math.abs
class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListener,
Handler.Callback {
@@ -133,7 +135,7 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
if (!turnLight) {
// 首次判断,变灯
turnLight = true
val controlTime = if (currentResult!!.isGreen()) 45 - currentResult.remain else 45
val controlTime = if (currentResult!!.isGreen()) 45 - abs(currentResult.time()) else 45
turnLight(controlTime)
}

View File

@@ -212,7 +212,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
* 底盘数据
*
* @param header 头
* @param vehicleState 数据
* @param chassisStates 数据
*/
@ChainLog(
linkChainLog = CHAIN_TYPE_SOCKET_VEHICLE,

View File

@@ -1,6 +1,7 @@
package com.mogo.eagle.core.function.datacenter.obu
import android.content.Context
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.config.HmiBuildConfig
import com.mogo.eagle.core.data.enums.CommunicationType
import com.mogo.eagle.core.data.enums.DataSourceType
@@ -62,25 +63,25 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
}
override fun onMoGoObuRsiWarning(rsiWarningData: ObuScene.RsiWarningData) {
if (HmiBuildConfig.isShowObuV2iView) {
if (FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2iView) {
onMogoObuDcRsiWarning(rsiWarningData)
}
}
override fun onMoGoObuRsmWarning(rsmWarningData: ObuScene.RsmWarningData) {
if (HmiBuildConfig.isShowObuV2iView) {
if (FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2iView) {
onMogoObuDcRsmWarning(rsmWarningData)
}
}
override fun onMoGoObuSpatWarning(spatWarningData: ObuScene.SpatWarningData) {
if (HmiBuildConfig.isShowObuV2iView) {
if (FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2iView) {
onMogoObuDcSpatWarning(spatWarningData)
}
}
override fun onMoGoObuMapMath(mapMatchData: ObuScene.MapMatchData) {
if (HmiBuildConfig.isShowObuV2iView) {
if (FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2iView) {
onMogoObuMapMath(mapMatchData)
}
}
@@ -561,7 +562,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
}
1 -> { //闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT 一个红灯周期只显示一次
if(HmiBuildConfig.isShowObuV2iView){
if(FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2iView){
if (HmiBuildConfig.isShowRunRedLightView) {
if (!isShowRunRedLight) {
isShowRunRedLight = true
@@ -594,7 +595,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
}
2 -> { //绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION 一个绿灯周期只显示一次
if (HmiBuildConfig.isShowGreenWaveView) {
if (FunctionBuildConfig.v2xMainSwitch && FunctionBuildConfig.v2nMainSwitch && HmiBuildConfig.isShowGreenWaveView) {
if (!isShowGreenWave) {
isShowGreenWave = true
CallerLogger.d(
@@ -602,14 +603,14 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
"MogoObuDcCombineManager 绿波通行引导 --------> speed_min = ${currentLight.suggestMinSpeed} --speed_max = ${currentLight.suggestMaxSpeed}"
)
var minSpeedTemp = Math.round(currentLight.suggestMinSpeed * 3.6)
var maxSpeedTemp = Math.round(currentLight.suggestMaxSpeed * 3.6)
val maxSpeedTemp = Math.round(currentLight.suggestMaxSpeed * 3.6)
if (minSpeedTemp == maxSpeedTemp) {
minSpeedTemp -= 5
}
val maxSpeed = currentLight.suggestMaxSpeed
if (maxSpeed > 0) {
var currentSpeed =
val currentSpeed =
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02().gnssSpeed.toDouble()
if (currentSpeed > 0) {
ttsContentNew =

View File

@@ -346,7 +346,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
* 红绿灯预警信息 CvxIvpThreatIndInfo
*/
override fun onObuSpatWarning(data: ObuScene.SpatWarningData) {
if (HmiBuildConfig.isShowObuV2iView) {
if (FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2iView) {
handlerTrafficLight(
data.warningType,
data.status,
@@ -359,7 +359,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
* RSI预警信息 onMogoObuRsiWarning交通标志预警前方限速、前方学校等等交通事件预警前方拥堵、前方积水等等
*/
override fun onObuRsiWarning(data: ObuScene.RsiWarningData) {
if (HmiBuildConfig.isShowObuV2iView) {
if (FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2iView) {
if (data.warningMsgList != null && data.warningMsgList.size > 0) {
var alertContent = ""
var ttsContent = ""
@@ -632,7 +632,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
"onMogoObuRsmWarning ------> ${data?.toString()}"
)
if (HmiBuildConfig.isShowObuV2iView) {
if (FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2iView) {
if (HmiBuildConfig.isShowObuWeaknessTrafficView) {
// 交通参与者类型 0x0:未知 UNKNOWN | 1机动车 2:非机动车 NON_MOTOR | 3:行人 PEDESTRIAN 4:obu
if (data != null && data.participant != null) {
@@ -725,7 +725,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
* 地图匹配 是OBU算法输出地图匹配结果主车匹配道路哪条路或者哪条车道
*/
override fun onObuMapMath(data: ObuScene.MapMatchData?) {
if (HmiBuildConfig.isShowObuV2iView) {
if (FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2iView) {
if (data != null) {
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
@@ -1042,7 +1042,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
}
1 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT 一个红灯周期只显示一次
if(HmiBuildConfig.isShowObuV2iView){
if(FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2iView){
if (HmiBuildConfig.isShowRunRedLightView) {
if (!isShowRunRedLight) {
isShowRunRedLight = true

View File

@@ -293,10 +293,10 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
"updateTrafficLight ----- currentTrafficLight = $currentTrafficLight"
)
currentTrafficLight?.let {
val remain = if (it.remain > 99) {
val remain = if (it.time() > 99) {
99
} else {
it.remain
it.time()
}
onTrafficLightPlusSource(it.convert(), remain, DataSourceType.AICLOUD)
}

View File

@@ -17,12 +17,10 @@ import com.mogo.eagle.core.data.deva.badcase.BagDescriptionEntity
import com.mogo.eagle.core.data.deva.badcase.BagInfoEntity
import com.mogo.eagle.core.data.deva.badcase.BagManagerEntity
import com.mogo.eagle.core.data.deva.badcase.RecordCaseEntity
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
@@ -37,12 +35,10 @@ import com.zhidao.loglib.upload.UploadManager
import com.zhidao.loglib.util.FileUtil
import com.zhjt.mogo_core_function_devatools.R
import com.zhjt.mogo_core_function_devatools.badcase.BadCaseAnalyticsManager
import com.zhjt.mogo_core_function_devatools.badcase.BadCaseManager
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
import com.zhjt.mogo_core_function_devatools.badcase.record.RecordManager
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import mogo.telematics.pad.MessagePad
import record_cache.RecordPanelOuterClass
import java.io.File
import java.lang.StringBuilder
@@ -55,7 +51,7 @@ import java.util.*
* @since: 2022/7/13
*/
class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchListener,
IMoGoAutopilotRecordListener, IMoGoChassisLocationWGS84Listener {
IMoGoAutopilotRecordListener {
companion object {
const val TAG = "InitiativeBadCaseWindow"
@@ -94,8 +90,6 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
private var recordFileName: String?=null //录制文件包名
private var receiveTime: String?= null
private var uploadStamp: String = System.currentTimeMillis().toString()
private var longitude: Double?=null
private var latitude: Double?=null
private var bagManagerEntity: BagManagerEntity = BagManagerEntity()
@@ -109,7 +103,7 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
private var clickListener: ClickListener? = null
init {
initFloatWindow();
initFloatWindow()
}
private val presenter by lazy {
@@ -147,8 +141,6 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
//采集结果回调监听
CallerAutopilotRecordListenerManager.addListener(this.hashCode().toString(),this)
// 添加 ADAS车辆状态&定位 监听
CallerChassisLocationWGS84ListenerManager.addListener(this.hashCode().toString(), this)
viewAudioButton.setOnClickListener {
audioStatus = !audioStatus
setAudio(audioStatus)
@@ -309,14 +301,14 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
itx["audioUrl"] = downloadUrl?:"" //音频COS地址
itx["mapVersion"] = BadCaseConfig.dockerVersion ?:"" //工控机版本
itx["eyeVersion"] = AppUtils.getAppVersionName() //鹰眼版本
itx["coordinate"] = "latitude:${latitude};longitude:${longitude}" //坐标
itx["coordinate"] = "latitude:${getChassisLocationWGS84().latitude};longitude:${getChassisLocationWGS84().longitude}" //坐标
})
if (uploadResult == null || uploadResult.code != 200) {
TipToast.shortTip("上报失败")
} else {
TipToast.shortTip("上报成功")
//将上报BI的结果同步给工控机记录保存
recordKey?.let {
recordKey.let {
val hasAudio = downloadUrl != null
val descReqEntity = BagDescriptionEntity(uploadReason.toString(),hasAudio,downloadUrl.toString(),true)
bagManagerEntity.reqType = 5
@@ -324,15 +316,16 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
bagManagerEntity.descReq = descReqEntity
CallerAutoPilotControlManager.sendBagManagerCmd(bagManagerEntity)
}
val loc = getChassisLocationWGS84()
BadCaseAnalyticsManager.bagRecordUpload(recordKey.toString(),recordFileName?:"",uploadStamp,
"100",AppConfigInfo.plateNumber,BadCaseConfig.totalDuration.toString(),MoGoAiCloudClientConfig.getInstance().sn,
BadCaseConfig.dockerVersion ?:"",AppUtils.getAppVersionName(),latitude.toString(),longitude.toString(),
BadCaseConfig.dockerVersion ?:"",AppUtils.getAppVersionName(),loc.latitude.toString(),loc.longitude.toString(),
BadCaseConfig.identity,downloadUrl?:"",uploadReason.toString(),System.currentTimeMillis().toString(),"1")
//日志
CallerLogger.i("$M_DEVA$TAG", "BadCase Initiative Analytics="+"key="+recordKey+" filename="+recordFileName+
" receiveTime="+uploadStamp+" stat="+"100"+" plateNumber="+AppConfigInfo.plateNumber+
" totalDuration="+ BadCaseConfig.totalDuration +" carSn="+MoGoAiCloudClientConfig.getInstance().sn+" mapVersion="+BadCaseConfig.dockerVersion+
" eyeVersion="+AppUtils.getAppVersionName()+" latitude="+ latitude +" longitude="+ longitude+
" eyeVersion="+AppUtils.getAppVersionName()+" latitude="+ loc.latitude +" longitude="+ loc.longitude+
" identity="+BadCaseConfig.identity + " downloadUrl="+downloadUrl +" uploadReason="+uploadReason+
" uploadTime="+System.currentTimeMillis()+" channel="+"1")
BadCaseConfig.windowNum--
@@ -413,8 +406,6 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
fun hideFloatWindow() {
//注销采集结果回调监听
CallerAutopilotRecordListenerManager.removeListener(this.hashCode().toString())
// 移除 ADAS车辆状态&定位 监听
CallerChassisLocationWGS84ListenerManager.removeListener(this.hashCode().toString())
if (mFloatLayout.parent != null) mWindowManager!!.removeView(mFloatLayout)
}
@@ -440,9 +431,4 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
fun closeWindow()
}
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
latitude = gnssInfo.latitude
longitude = gnssInfo.longitude
}
}

View File

@@ -6,8 +6,6 @@ import android.graphics.Color
import android.graphics.PixelFormat
import android.os.CountDownTimer
import android.os.Handler
import android.os.Parcel
import android.os.Parcelable
import android.util.DisplayMetrics
import android.view.*
import android.widget.CheckBox
@@ -19,10 +17,8 @@ import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.deva.badcase.BagDescriptionEntity
import com.mogo.eagle.core.data.deva.badcase.BagManagerEntity
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.RecordBagMsg
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
@@ -38,7 +34,6 @@ import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
import com.zhjt.mogo_core_function_devatools.badcase.record.RecordManager
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import mogo.telematics.pad.MessagePad
import com.zhidao.loglib.upload.UploadManager
import com.zhidao.loglib.util.FileUtil
import com.zhjt.mogo_core_function_devatools.badcase.BadCaseAnalyticsManager
@@ -52,7 +47,7 @@ import java.io.File
* @since: 2022/7/17
*/
class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListener,
IMoGoChassisLocationWGS84Listener, CompoundButton.OnCheckedChangeListener {
CompoundButton.OnCheckedChangeListener {
companion object {
const val TAG = "PassiveBadCaseWindow"
@@ -74,8 +69,6 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
private var receiveTime: String ?= null //接收时间
private var stat: String = ""
private var boxBean: MsgBoxBean ?= null
private var longitude: Double = 0.0
private var latitude: Double = 0.0
private var mInViewX = 0f
private var mInViewY = 0f
@@ -100,7 +93,7 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
private lateinit var flReasonLayout: FlexboxLayout
init {
initFloatWindow();
initFloatWindow()
}
private val presenter by lazy {
@@ -126,8 +119,6 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
BadCaseConfig.windowNum++
tvPassiveTime.text = "时间:${millis2String(System.currentTimeMillis(),TimeUtils.getHourMinSecondFormat())}"
tvPassiveIdentity.text = "身份:${BadCaseConfig.identity}"
// 添加 ADAS车辆状态&定位 监听
CallerChassisLocationWGS84ListenerManager.addListener(TAG, this)
viewAudioButton.setOnClickListener {
audioStatus = !audioStatus
setAudio(audioStatus)
@@ -271,7 +262,7 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
itx["audioUrl"] = downloadUrl?:"" //音频COS地址
itx["mapVersion"] = BadCaseConfig.dockerVersion ?:"" //工控机版本
itx["eyeVersion"] = AppUtils.getAppVersionName() //鹰眼版本
itx["coordinate"] = "latitude:${latitude};longitude:${longitude}" //坐标
itx["coordinate"] = "latitude:${CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().latitude};longitude:${CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().longitude}" //坐标
})
if (uploadResult == null || uploadResult.code != 200) {
@@ -288,15 +279,16 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
CallerAutoPilotControlManager.sendBagManagerCmd(bagManagerEntity)
}
//被动上报埋点统计
val loc = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
BadCaseAnalyticsManager.bagRecordUpload(recordKey?:"",recordFileName?:"",receiveTime?:System.currentTimeMillis().toString(),
stat,AppConfigInfo.plateNumber,BadCaseConfig.totalDuration.toString(),MoGoAiCloudClientConfig.getInstance().sn,
BadCaseConfig.dockerVersion ?:"",AppUtils.getAppVersionName(),latitude.toString(),longitude.toString(),
BadCaseConfig.dockerVersion ?:"",AppUtils.getAppVersionName(),loc.latitude.toString(),loc.longitude.toString(),
BadCaseConfig.identity,downloadUrl?:"",uploadReason,System.currentTimeMillis().toString(),"0")
//日志
CallerLogger.i("$M_DEVA$TAG", "BadCase Passive Analytics="+"key="+recordKey+" filename="+recordFileName+
" receiveTime="+receiveTime+" stat="+"100"+" plateNumber="+AppConfigInfo.plateNumber+
" totalDuration="+ BadCaseConfig.totalDuration +" carSn="+MoGoAiCloudClientConfig.getInstance().sn+" mapVersion="+BadCaseConfig.dockerVersion+
" eyeVersion="+AppUtils.getAppVersionName()+" latitude="+ latitude +" longitude="+ longitude+
" eyeVersion="+AppUtils.getAppVersionName()+" latitude="+ loc.latitude +" longitude="+ loc.longitude+
" identity="+BadCaseConfig.identity + " downloadUrl="+downloadUrl +" uploadReason="+uploadReason+
" uploadTime="+System.currentTimeMillis()+" channel="+"0")
BadCaseConfig.windowNum--
@@ -390,7 +382,6 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
fun hideFloatWindow() {
// 移除 ADAS车辆状态&定位 监听
CallerChassisLocationWGS84ListenerManager.removeListener(TAG)
if (mFloatLayout.parent != null) mWindowManager!!.removeView(mFloatLayout)
}
@@ -411,9 +402,4 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
fun closeWindow()
}
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
latitude = gnssInfo.latitude
longitude = gnssInfo.longitude
}
}

View File

@@ -96,10 +96,12 @@ class BagManagerListAdapter: RecyclerView.Adapter<RecyclerView.ViewHolder>() {
//已上报
holder.tvBagReportStatus.text = "已上报"
holder.tvBagReportStatus.setBackgroundResource(R.drawable.bag_reported_button_bg)
holder.tvBagReportStatus.isClickable = false
}else{
//未上报
holder.tvBagReportStatus.text = "上报"
holder.tvBagReportStatus.setBackgroundResource(R.drawable.bag_report_button_bg)
holder.tvBagReportStatus.isClickable = true
holder.tvBagReportStatus.setOnClickListener {
bagClickListener?.uploadBI(bagInfoEntity)
}
@@ -127,11 +129,15 @@ class BagManagerListAdapter: RecyclerView.Adapter<RecyclerView.ViewHolder>() {
holder.tvBagSize.text = "${bagSize}G"
//时间
bagInfoEntity.timestamp?.let { time->
val hour = time.substring(8,10)
val min = time.substring(10,12)
val second = time.substring(12,14)
holder.tvBagTime.text = "${hour}:${min}:${second}"
bagInfoEntity.timestamp.let { time->
try {
val hour = time.substring(8,10)
val min = time.substring(10,12)
val second = time.substring(12,14)
holder.tvBagTime.text = "${hour}:${min}:${second}"
}catch (e: Exception){
e.printStackTrace()
}
}
}
}

View File

@@ -18,7 +18,6 @@ import com.mogo.eagle.core.function.api.map.deva.IMoGoMapDevaProvider
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapDevaListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.LogLevel
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
@@ -26,6 +25,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.map.MogoData
import com.zhidao.loglib.bean.RemoteLogPushContent
import com.zhidao.loglib.call.LogInfoManagerFactory
import com.zhidao.loglib.core.ILogListener
@@ -224,7 +224,7 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
config.isShowDebugLog = true
config.isShowNetDebugLog = true
}
CallerMapUIServiceManager.getMapUIController()?.setDebugMode(true)
// MogoData.mogoMapData.get()?.setDebugMode(true)
CallerAutoPilotControlManager.setEnableLog(true)
}
@@ -238,7 +238,7 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
config.isShowDebugLog = false
config.isShowNetDebugLog = false
}
CallerMapUIServiceManager.getMapUIController()?.setDebugMode(false)
// MogoData.mogoMapData.get()?.setDebugMode(false)
CallerAutoPilotControlManager.setEnableLog(false)
}

View File

@@ -23,9 +23,6 @@ import com.mogo.eagle.core.function.hmi.R;
import com.mogo.eagle.core.function.hmi.ui.utils.SearchCriteria;
import com.mogo.eagle.core.function.hmi.ui.utils.TagColorUtil;
import me.jessyan.autosize.AutoSizeCompat;
public class LogItemAdapter extends AbsRecyclerAdapter<AbsViewBinder<LogLine>, LogLine> implements Filterable {
public LogItemAdapter(Context context) {

View File

@@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.hmi.ui.map
import android.annotation.SuppressLint
import android.content.Context
import android.os.Looper
import android.view.View
import android.widget.ImageView
import android.widget.ProgressBar
@@ -10,16 +11,16 @@ import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat
import com.mogo.eagle.core.data.map.MogoLocation
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 com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.map.MogoData.Companion.mogoMapData
import me.jessyan.autosize.utils.AutoSizeUtils
/**
* 离线地图缓存
*/
class OfflineMapDialog(context: Context): BaseFloatDialog(context) {
class OfflineMapDialog(context: Context) : BaseFloatDialog(context) {
private var roundRootLayout: ConstraintLayout? = null
private var offlineTitleView: TextView? = null
@@ -86,37 +87,29 @@ class OfflineMapDialog(context: Context): BaseFloatDialog(context) {
okView?.setOnClickListener {
if (isLoading) {
CallerMapUIServiceManager.cancelDownloadCacheData()
mogoMapData.get()?.cancelDownloadCacheData()
}
dismiss()
}
}
private fun cacheHDDataByCityByLonLat() {
CallerMapUIServiceManager.cacheHDDataByCityByLonLat(object : IHdCacheListener {
override fun onMapHdCacheProgress(cityId: Int, progress: Double) {
mogoMapData.get()?.cacheHDDataByCityByLonLat(location!!, { _, progress ->
updateProgress(progress.toInt())
}, { _, state ->
if (state == 0) {// 失败
showNewContent(isLoading = false, false)
}
override fun onMapHdCacheResult(cityId: Int, state: Int) {
if (state == 0) {// 失败
showNewContent(isLoading = false, false)
}
}
}, location!!)
})
}
private fun cacheHDOfflineData() {
if (location == null) {// 拿到了高德地图的cityCode
CallerMapUIServiceManager.cacheHDDataByCity(object : IHdCacheListener {
override fun onMapHdCacheProgress(cityId: Int, progress: Double) {
updateProgress(progress.toInt())
}
override fun onMapHdCacheResult(cityId: Int, state: Int) {
if (state == 0) {// 失败
showNewContent(isLoading = false, false)
}
mogoMapData.get()?.cacheHDDataByCity({ _, progress ->
updateProgress(progress.toInt())
}, { _, state ->
if (state == 0) {// 失败
showNewContent(isLoading = false, false)
}
})
} else {// 只拿到了高精的经纬度
@@ -176,15 +169,18 @@ class OfflineMapDialog(context: Context): BaseFloatDialog(context) {
isSuccess -> {
okView?.visibility = View.VISIBLE
okView?.text = context.resources.getString(R.string.ok_tip)
offlineTitleView?.text = context.resources.getString(R.string.offline_download_success)
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)
downloadResultImg?.background =
ContextCompat.getDrawable(context, R.drawable.download_success_icon)
}
else -> {
isRetry = true
isConfirm = false
offlineTitleView?.text = context.resources.getString(R.string.offline_download_failure)
offlineTitleView?.text =
context.resources.getString(R.string.offline_download_failure)
okView?.visibility = View.GONE
progressBar?.visibility = View.GONE
downloadPercentView?.visibility = View.GONE
@@ -193,7 +189,8 @@ class OfflineMapDialog(context: Context): BaseFloatDialog(context) {
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)
downloadResultImg?.background =
ContextCompat.getDrawable(context, R.drawable.download_fail_icon)
}
}
}

View File

@@ -7,7 +7,6 @@ import android.content.ClipboardManager
import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.net.*
import android.os.Build
import android.os.Process
import android.text.Html
@@ -18,8 +17,8 @@ import androidx.annotation.RequiresApi
import androidx.appcompat.widget.PopupMenu
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat
import androidx.core.content.FileProvider
import androidx.core.view.*
import androidx.core.view.MenuCompat
import androidx.core.view.isVisible
import androidx.lifecycle.lifecycleScope
import chassis.Chassis
import com.mogo.cloud.passport.MoGoAiCloudClient
@@ -38,19 +37,19 @@ import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_FULL_
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_RAIN_MODE
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_WARNING_UPLOAD
import com.mogo.eagle.core.data.deva.chain.ChainConstant
import com.mogo.eagle.core.data.deva.report.ReportEntity
import com.mogo.eagle.core.data.deva.scene.SceneModule
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
import com.mogo.eagle.core.data.gnss.AccelerationEntity
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.data.multidisplay.TelematicConstant
import com.mogo.eagle.core.data.obu.MogoObuConst
import com.mogo.eagle.core.data.obu.ObuStatusInfo
import com.mogo.eagle.core.data.deva.report.ReportEntity
import com.mogo.eagle.core.data.multidisplay.TelematicConstant
import com.mogo.eagle.core.function.api.autopilot.*
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsFuncConfigListener
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
import com.mogo.eagle.core.function.api.datacenter.obu.IMoGoObuConnectListener
import com.mogo.eagle.core.function.api.datacenter.obu.IMoGoObuInfoListener
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsFuncConfigListener
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
import com.mogo.eagle.core.function.api.setting.ISopSettingListener
import com.mogo.eagle.core.function.call.autopilot.*
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsFuncConfigListenerManager
@@ -66,7 +65,10 @@ import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.ui.logcatch.ILogViewListener
import com.mogo.eagle.core.function.hmi.ui.logcatch.LogInfoView
import com.mogo.eagle.core.utilcode.kotlin.*
import com.mogo.eagle.core.utilcode.kotlin.currentPadding
import com.mogo.eagle.core.utilcode.kotlin.lifecycleOwner
import com.mogo.eagle.core.utilcode.kotlin.onClick
import com.mogo.eagle.core.utilcode.kotlin.scope
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.LogLevel
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
@@ -75,11 +77,10 @@ import com.mogo.eagle.core.utilcode.mogo.permissions.BackgrounderPermission
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
import com.mogo.eagle.core.utilcode.util.*
import com.mogo.map.hdcache.IHdCacheListener
import com.mogo.map.MogoData.Companion.mogoMapData
import com.mogo.map.uicontroller.VisualAngleMode
import com.mogo.map.uicontroller.VisualAngleMode.*
import kotlinx.android.synthetic.main.view_debug_setting.view.*
import kotlinx.android.synthetic.main.view_debug_setting.view.tbRouteDynamicEffect
import kotlinx.coroutines.*
import mogo.telematics.pad.MessagePad
import mogo_msg.MogoReportMsg
@@ -194,10 +195,10 @@ internal class DebugSettingView @JvmOverloads constructor(
*/
private val timerTaskRefresh = object : TimerTask() {
override fun run() {
if(this@DebugSettingView == null){
if (this@DebugSettingView == null) {
return
}
if(!isRunCheck){
if (!isRunCheck) {
return
}
UiThreadHandler.post {
@@ -231,7 +232,7 @@ internal class DebugSettingView @JvmOverloads constructor(
//添加 底盘灯光数据 监听
CallerChassisLamplightListenerManager.addListener(TAG, this)
//雨天、美化、点云设置同步
CallerSopSettingManager.addListener(TAG,this)
CallerSopSettingManager.addListener(TAG, this)
//添加 业务配置监听
CallerDevaToolsFuncConfigListenerManager.registerDevaToolsFuncConfigListener(
@@ -299,11 +300,12 @@ internal class DebugSettingView @JvmOverloads constructor(
}
}
@SuppressLint("SetTextI18n")
private fun initView() {
post {
val maxHeight = ScreenUtils.getScreenHeight()-BarUtils.getStatusBarHeight()
val maxHeight = ScreenUtils.getScreenHeight() - BarUtils.getStatusBarHeight()
val height = clDebugContain.height
if(height>maxHeight){
if (height > maxHeight) {
val layoutParamsOther = clDebugContain.layoutParams
layoutParamsOther.height = maxHeight
clDebugContain.layoutParams = layoutParamsOther
@@ -593,12 +595,9 @@ internal class DebugSettingView @JvmOverloads constructor(
}
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
ThreadUtils.getIoPool().execute {
val isCached = CallerMapUIServiceManager.isCityDataCached()
isHDCached = isCached
UiThreadHandler.post {
btn_cache_hd_map.text = "缓存高精离线地图(${if (isCached) "已是最新版" else "待更新"}!)"
}
mogoMapData.get()?.isCityDataCached {
isHDCached = it
btn_cache_hd_map.text = "缓存高精离线地图(${if (it) "已是最新版" else "待更新"}!)"
}
btn_cache_hd_map.visibility = View.VISIBLE
}
@@ -633,9 +632,15 @@ internal class DebugSettingView @JvmOverloads constructor(
*/
tbControlPassengerDriverMonitor.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) {
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.CONTROL_PASSENGER_DRIVER_MONITOR, "1".toByteArray())
CallerTelematicManager.sendMsgToAllClients(
TelematicConstant.CONTROL_PASSENGER_DRIVER_MONITOR,
"1".toByteArray()
)
} else {
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.CONTROL_PASSENGER_DRIVER_MONITOR, "0".toByteArray())
CallerTelematicManager.sendMsgToAllClients(
TelematicConstant.CONTROL_PASSENGER_DRIVER_MONITOR,
"0".toByteArray()
)
}
}
@@ -661,7 +666,8 @@ internal class DebugSettingView @JvmOverloads constructor(
// 初始化OBU IP信息
val ipAddress =
SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, MogoObuConst.OBU_DEFAULT_IP)
SharedPrefsMgr.getInstance(context)
.getString(MoGoConfig.OBU_IP, MogoObuConst.OBU_DEFAULT_IP)
etObuIP.setText(ipAddress)
etObuIP.text?.let { etObuIP.setSelection(it.length) }
@@ -694,7 +700,7 @@ internal class DebugSettingView @JvmOverloads constructor(
tbIsDemoMode.isChecked = FunctionBuildConfig.isDemoMode
// 演示模式
tbIsDemoMode.setOnCheckedChangeListener { compoundButton, isChecked ->
if(!compoundButton.isPressed){
if (!compoundButton.isPressed) {
return@setOnCheckedChangeListener
}
FunctionBuildConfig.isDemoMode = !FunctionBuildConfig.isDemoMode
@@ -716,9 +722,11 @@ internal class DebugSettingView @JvmOverloads constructor(
}
tbIsStrictMode?.also {
it.isChecked = SharedPrefs.getInstance(Utils.getApp()).getBoolean("MOGO_STRICT_MODE_ENABLED", false)
it.isChecked = SharedPrefs.getInstance(Utils.getApp())
.getBoolean("MOGO_STRICT_MODE_ENABLED", false)
it.setOnCheckedChangeListener { _, isChecked ->
SharedPrefs.getInstance(Utils.getApp()).putBoolean("MOGO_STRICT_MODE_ENABLED", isChecked)
SharedPrefs.getInstance(Utils.getApp())
.putBoolean("MOGO_STRICT_MODE_ENABLED", isChecked)
scope.launch {
ToastUtils.showShort("配置生效, 2秒后重启应用...")
delay(2000)
@@ -731,7 +739,7 @@ internal class DebugSettingView @JvmOverloads constructor(
tbIsRainMode.isChecked = FunctionBuildConfig.isRainMode
//雨天模式
tbIsRainMode.setOnCheckedChangeListener { compoundButton, isChecked ->
if(!compoundButton.isPressed){
if (!compoundButton.isPressed) {
return@setOnCheckedChangeListener
}
CallerAutoPilotControlManager.setRainMode(isChecked)
@@ -848,16 +856,37 @@ internal class DebugSettingView @JvmOverloads constructor(
//TODO
tbIsDrawPath.setOnCheckedChangeListener { _, isChecked ->
ToastUtils.showShort("功能开发中")
}
if(FunctionBuildConfig.isDrawPointCloudData){
//如果点云效果是打开的,则自车光圈也跟随打开
tbCarAperture.isChecked = true
}else{
tbCarAperture.isChecked = FunctionBuildConfig.isDisplayAnimEnable
}
tbCarAperture.setOnCheckedChangeListener { compoundButton, isChecked ->
CallerMapUIServiceManager.getMapUIController()?.setDisplayAnimEnable(isChecked)
CallerSopSettingManager.invokeCarApertureListener(isChecked)
if(!compoundButton.isPressed){
return@setOnCheckedChangeListener
}
FunctionBuildConfig.isDisplayAnimEnable = isChecked
}
//初始化点云数据渲染情况
tbDrawPointCloudData.isChecked = FunctionBuildConfig.isDrawPointCloudData
//是否渲染点云数据
tbDrawPointCloudData.setOnCheckedChangeListener { compoundButton, isChecked ->
if(!compoundButton.isPressed){
if (!compoundButton.isPressed) {
return@setOnCheckedChangeListener
}
//打开点云效果时,如果自车光圈是关闭状态,则自动打开自车光圈(点云是跟随光圈的 默认没有光圈就不显示点云的)
if(isChecked && !FunctionBuildConfig.isDisplayAnimEnable){
tbCarAperture.isChecked = true
}else{
tbCarAperture.isChecked = FunctionBuildConfig.isDisplayAnimEnable
}
CallerAutoPilotControlManager.setIsDrawPointCloud(isChecked)
FunctionBuildConfig.isDrawPointCloudData = isChecked
CallerMapUIServiceManager.getMapUIController()?.setIsDrawPointCloud(isChecked)
@@ -872,7 +901,8 @@ internal class DebugSettingView @JvmOverloads constructor(
} else {
try {
val cloudSizeFloat = cloudSize.toFloat()
CallerMapUIServiceManager.getMapUIController()?.setPointCloudSize(cloudSizeFloat)
CallerMapUIServiceManager.getMapUIController()
?.setPointCloudSize(cloudSizeFloat)
} catch (e: Exception) {
ToastUtils.showShort("点云大小格式输入不正确")
}
@@ -918,7 +948,7 @@ internal class DebugSettingView @JvmOverloads constructor(
tbADASLog.isChecked = CallerAutoPilotControlManager.isEnableLog()
//如果工控机异常上报列表窗口为展示状态,则显示上报异常布局
if(CallerDevaToolsManager.getReportWindowStatus()){
if (CallerDevaToolsManager.getReportWindowStatus()) {
reportMsgLayout.visibility = View.VISIBLE
tbReportMore.isChecked = true
}
@@ -951,7 +981,7 @@ internal class DebugSettingView @JvmOverloads constructor(
clipboardManager?.setPrimaryClip(
ClipData.newPlainText(
"DockVersion",
CallerAutoPilotStatusListenerManager.getDockerVersion()?:""
CallerAutoPilotStatusListenerManager.getDockerVersion() ?: ""
)
)
ToastUtils.showLong("docker版本复制成功")
@@ -1041,7 +1071,7 @@ internal class DebugSettingView @JvmOverloads constructor(
//设置连接司机屏IP
btnConnectServerIp.setOnClickListener {
val ip = etConnectServerIp.text.toString()
if (!ip.isNullOrEmpty()) {
if (!ip.isEmpty()) {
CallerAutoPilotControlManager.connectSpecifiedServer(ip)
}
}
@@ -1064,13 +1094,15 @@ internal class DebugSettingView @JvmOverloads constructor(
}
if (!AppIdentityModeUtils.isTaxiDriver(FunctionBuildConfig.appIdentityMode)
&& !AppIdentityModeUtils.isBusDriver(FunctionBuildConfig.appIdentityMode)){
&& !AppIdentityModeUtils.isBusDriver(FunctionBuildConfig.appIdentityMode)
) {
tbStartAutopilotCommand.visibility = GONE
}
//切换环境
tvCurEnv.text = "当前环境:${CallerDevaToolsManager.getEnvCityName()}${CallerDevaToolsManager.getEnvNetMode()}"
tvCurEnv.text =
"当前环境:${CallerDevaToolsManager.getEnvCityName()}${CallerDevaToolsManager.getEnvNetMode()}"
btChangeEnv.onClick {
PopupMenu(context, btChangeEnv).also { p ->
p.menuInflater.inflate(R.menu.menu_env_pop, p.menu)
@@ -1086,13 +1118,22 @@ internal class DebugSettingView @JvmOverloads constructor(
R.id.env_reset ->
CallerDevaToolsManager.envConfigReset()
R.id.hy_product ->
CallerDevaToolsManager.envConfigChange("0734", DebugConfig.NET_MODE_RELEASE)
CallerDevaToolsManager.envConfigChange(
"0734",
DebugConfig.NET_MODE_RELEASE
)
R.id.hy_qa ->
CallerDevaToolsManager.envConfigChange("0734", DebugConfig.NET_MODE_QA)
R.id.hy_demo ->
CallerDevaToolsManager.envConfigChange("0734", DebugConfig.NET_MODE_DEMO)
CallerDevaToolsManager.envConfigChange(
"0734",
DebugConfig.NET_MODE_DEMO
)
R.id.bj_product ->
CallerDevaToolsManager.envConfigChange("010", DebugConfig.NET_MODE_RELEASE)
CallerDevaToolsManager.envConfigChange(
"010",
DebugConfig.NET_MODE_RELEASE
)
R.id.bj_qa ->
CallerDevaToolsManager.envConfigChange("010", DebugConfig.NET_MODE_QA)
R.id.bj_demo ->
@@ -1293,7 +1334,7 @@ internal class DebugSettingView @JvmOverloads constructor(
* 设置是否输出高精地图日志 true-打印日志false-不打印日志
*/
tbHdMapLog.setOnCheckedChangeListener { _, isChecked ->
CallerMapUIServiceManager.getMapUIController()?.setDebugMode(isChecked)
mogoMapData.get()?.setDebugMode(isChecked)
}
cbTraceLog.isChecked = CallerDevaToolsManager.getTraceLogStatus()
@@ -1575,8 +1616,10 @@ internal class DebugSettingView @JvmOverloads constructor(
/**
* 版本信息
*/
tvAppVersionName.text = "鹰眼版本:${AppUtils.getAppVersionName()} Git Hash${AppConfigInfo.workingBranchHash} \n渠道信息:${AppConfigInfo.flavor}"
tvAppVersionNameKey.text = "鹰眼版本:${AppUtils.getAppVersionName()} Git Hash${AppConfigInfo.workingBranchHash}\n渠道信息:${AppConfigInfo.flavor}"
tvAppVersionName.text =
"鹰眼版本:${AppUtils.getAppVersionName()} Git Hash${AppConfigInfo.workingBranchHash} \n渠道信息:${AppConfigInfo.flavor}"
tvAppVersionNameKey.text =
"鹰眼版本:${AppUtils.getAppVersionName()} Git Hash${AppConfigInfo.workingBranchHash}\n渠道信息:${AppConfigInfo.flavor}"
tvAutopilotProtocolVersionInfo.text =
"Autopilot协议版本${CallerAutoPilotControlManager.getProtocolVersion()}"
@@ -1593,9 +1636,12 @@ internal class DebugSettingView @JvmOverloads constructor(
tvGitBranchInfo.text = "Git分支${AppConfigInfo.workingBranchName}"
tvAppBuildTimeInfo.text = "版本构建时间:${AppConfigInfo.appBuildTime}"
if(tbBeautyMode.isVisible){
val version = ParseVersionUtils.parseVersion(true, CallerAutoPilotStatusListenerManager.getDockerVersion())
if(version >= 30100 && AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)){
if (tbBeautyMode.isVisible) {
val version = ParseVersionUtils.parseVersion(
true,
CallerAutoPilotStatusListenerManager.getDockerVersion()
)
if (version >= 30100 && AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) {
tbBeautyMode.visibility = View.GONE
}
}
@@ -1628,7 +1674,7 @@ internal class DebugSettingView @JvmOverloads constructor(
"移动数据"
} else {
//WiFi
CommonUtils.getWifiName(context)?:""
CommonUtils.getWifiName(context) ?: ""
}
} else {
@@ -1703,11 +1749,14 @@ internal class DebugSettingView @JvmOverloads constructor(
tvIpcInfo.text = it
tvIpcInfoKey.text = it
}
tvCmdbCarInfoContent.text = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.CAR_INFO)?:""
tvCmdbCarInfoContent.text =
SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.CAR_INFO) ?: ""
//APP升级功能
tvAppHost.text = "HOST地址" + SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.HOST_ADDRESS)?:""
tvAppContent.text = "APP升级数据" + SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.APP_UPGRADE_CONTENT)?:""
tvAppHost.text = "HOST地址" + SharedPrefsMgr.getInstance(context)
.getString(SharedPrefsConstants.HOST_ADDRESS) ?: ""
tvAppContent.text = "APP升级数据" + SharedPrefsMgr.getInstance(context)
.getString(SharedPrefsConstants.APP_UPGRADE_CONTENT) ?: ""
tvCarInfo.text =
"GPS时间${(mGnssInfo?.satelliteTime?.times(1000))?.toLong()}\n" +
@@ -1739,6 +1788,18 @@ internal class DebugSettingView @JvmOverloads constructor(
mTrajectoryInfoSize = 0
mRouteInfoSize = 0
if (FunctionBuildConfig.isDemoMode) {
tbIsDemoMode?.text = "关闭美化模式"
} else {
tbIsDemoMode?.text = "开启美化模式"
}
if (FunctionBuildConfig.isRainMode) {
tbIsRainMode?.text = "关闭雨天模式"
} else {
tbIsRainMode?.text = "开启雨天模式"
}
obuConnectStatusTv.text = Html.fromHtml(
"OBU连接状态${
if (AppConfigInfo.isConnectObu) {
@@ -2120,56 +2181,47 @@ internal class DebugSettingView @JvmOverloads constructor(
}
private fun restartApp() {
Utils.getApp().startActivity(Utils.getApp().packageManager.getLaunchIntentForPackage(Utils.getApp().packageName))
Utils.getApp()
.startActivity(Utils.getApp().packageManager.getLaunchIntentForPackage(Utils.getApp().packageName))
Process.killProcess(Process.myPid())
}
private fun cacheHDOfflineData(isGaoDe: Boolean) {
var progss = 0
if (isGaoDe) {// 拿到了高德地图的cityCode
CallerMapUIServiceManager.cacheHDDataByCity(object : IHdCacheListener {
override fun onMapHdCacheProgress(cityId: Int, progress: Double) {
// 更新进度
progss = progress.toInt()
if (progss == 100) {
isHDCached = true
btn_cache_hd_map.text = "缓存高精离线地图(已是最新版!)"
} else {
btn_cache_hd_map.text = "缓存高精离线地图(进度:${progss}%)"
}
}
override fun onMapHdCacheResult(cityId: Int, state: Int) {
if (state == 0) {// 失败
btn_cache_hd_map.text = "缓存高精离线地图(下载失败!)"
ToastUtils.showShort("下载失败,请重试!")
}
}
mogoMapData.get()?.cacheHDDataByCity({ _, progress ->
cacheHDCityProgressUpdate(progress)
}, { _, state ->
cacheHDCityResult(state)
})
} else {// 只拿到了高精的经纬度
mGnssInfo?.let { loc ->
CallerMapUIServiceManager.cacheHDDataByCityByLonLat(object : IHdCacheListener {
override fun onMapHdCacheProgress(cityId: Int, progress: Double) {
progss = progress.toInt()
if (progss == 100) {
isHDCached = true
btn_cache_hd_map.text = "缓存高精离线地图(已是最新版!)"
} else {
btn_cache_hd_map.text = "缓存高精离线地图(进度:${progss}%)"
}
}
override fun onMapHdCacheResult(cityId: Int, state: Int) {
if (state == 0) {// 失败
btn_cache_hd_map.text = "缓存高精离线地图(下载失败!)"
ToastUtils.showShort("下载失败,请重试!")
}
}
}, loc)
mogoMapData.get()?.cacheHDDataByCityByLonLat(loc, { _, progress ->
cacheHDCityProgressUpdate(progress)
}, { _, state ->
cacheHDCityResult(state)
})
}
}
}
private fun cacheHDCityProgressUpdate(progress: Double) {
// 更新进度
val progss = progress.toInt()
if (progss == 100) {
isHDCached = true
btn_cache_hd_map.text = "缓存高精离线地图(已是最新版!)"
} else {
btn_cache_hd_map.text = "缓存高精离线地图(进度:${progss}%)"
}
}
private fun cacheHDCityResult(state: Int) {
if (state == 0) {// 失败
btn_cache_hd_map.text = "缓存高精离线地图(下载失败!)"
ToastUtils.showShort("下载失败,请重试!")
}
}
override fun fwThreadClose() {
refreshTraceInfo()
}
@@ -2209,4 +2261,11 @@ internal class DebugSettingView @JvmOverloads constructor(
tbDrawPointCloudData.isChecked = status
}
/**
* 自车光圈
*/
override fun onCarApertureClickEvent(status: Boolean) {
tbCarAperture.isChecked = status
}
}

View File

@@ -390,6 +390,7 @@ internal class SOPSettingView @JvmOverloads constructor(
}
scCarAperture.setOnCheckedChangeListener { compoundButton, isChecked ->
CallerMapUIServiceManager.getMapUIController()?.setDisplayAnimEnable(isChecked)
CallerSopSettingManager.invokeCarApertureListener(isChecked)
hmiAction("SOP 是否展示自车光圈,",isChecked)
Log.i(TAG,"SOP 是否展示自车光圈,$isChecked")
if(!compoundButton.isPressed){
@@ -768,6 +769,10 @@ internal class SOPSettingView @JvmOverloads constructor(
scDrawPointCloudData.isChecked = status
}
override fun onCarApertureClickEvent(status: Boolean) {
scCarAperture.isChecked = status
}
/**
* 工控机配置参数获取
*/

View File

@@ -10,6 +10,7 @@ import com.mogo.eagle.core.data.autopilot.pnc.PncActionsHelper
import com.mogo.eagle.core.data.biz.trafficlight.TrafficLightResult
import com.mogo.eagle.core.data.biz.trafficlight.currentRoadTrafficLight
import com.mogo.eagle.core.data.biz.trafficlight.isRed
import com.mogo.eagle.core.data.biz.trafficlight.time
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_PNC_ACTIONS
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.FOUNDATION
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningActionsListener
@@ -137,7 +138,7 @@ class PncActionsView @JvmOverloads constructor(
&& mTrafficLightResult!!.currentRoadTrafficLight() != null
&& mTrafficLightResult!!.currentRoadTrafficLight()!!.isRed()
) {
mTrafficLightResult!!.currentRoadTrafficLight()!!.remain.toString()
mTrafficLightResult!!.currentRoadTrafficLight()!!.time().toString()
} else {
""
}

View File

@@ -46,28 +46,26 @@ class SteeringBrakeView(context: Context, attrs: AttributeSet?) : ConstraintLayo
}
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
if (gnssInfo != null) {
//设置刹车信息,小于默认认为是刹车
brakeLight =
if (gnssInfo.acceleration < SharedPrefsMgr.getInstance(Utils.getApp()).getFloat(
MoGoConfig.BRAKE_ACCELERATION_THRESHOLD, -2.5f
)
) {
1
} else {
0
}
CallerLogger.d(
"$M_HMI$TAG",
"---onAutopilotLightSwitchData ---Acceleration = " + gnssInfo.acceleration + "-- brakeLight = " + brakeLight
)
ThreadUtils.runOnUiThread {
if (!isShowTurnLight) { //在不展示转向灯的情况下,展示车辆刹车的动效
brakeView.visibility = View.VISIBLE
brakeView.setBrakeLight(brakeLight)
} else {
brakeView.visibility = View.GONE
}
//设置刹车信息,小于默认认为是刹车 //todo 优化sp获取不要每次回调都去调用sp
brakeLight =
if (gnssInfo.acceleration < SharedPrefsMgr.getInstance(Utils.getApp()).getFloat(
MoGoConfig.BRAKE_ACCELERATION_THRESHOLD, -2.5f
)
) {
1
} else {
0
}
CallerLogger.d(
"$M_HMI$TAG",
"---onAutopilotLightSwitchData ---Acceleration = " + gnssInfo.acceleration + "-- brakeLight = " + brakeLight
)
ThreadUtils.runOnUiThread {
if (!isShowTurnLight) { //在不展示转向灯的情况下,展示车辆刹车的动效
brakeView.visibility = View.VISIBLE
brakeView.setBrakeLight(brakeLight)
} else {
brakeView.visibility = View.GONE
}
}
}

View File

@@ -1,46 +0,0 @@
package com.mogo.eagle.core.function.hmi.ui.widget
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import android.widget.FrameLayout
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getMapUIController
import com.mogo.eagle.core.function.hmi.R
import com.mogo.map.uicontroller.VisualAngleMode
import kotlinx.android.synthetic.main.view_perspective_switch.view.*
/**
*@author xiaoyuzhou
*@date 2021/10/15 11:34 上午
* 视角切换按钮
*/
class PerspectiveSwitchView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : FrameLayout(context, attrs, defStyleAttr), View.OnClickListener{
override fun onAttachedToWindow() {
super.onAttachedToWindow()
LayoutInflater.from(context).inflate(R.layout.view_perspective_switch, this, true)
setBackgroundResource(R.drawable.module_switch_map_bg)
setOnClickListener(this)
}
override fun onClick(v: View?) {
getMapUIController()?.let {
if (it.currentMapVisualAngle.isLongSight) {
it.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
textSwitch.setText(R.string.module_map_model_normal)
} else if (it.currentMapVisualAngle.isMediumSight) {
it.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null)
textSwitch.setText(R.string.module_map_model_faster)
} else {
it.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null)
textSwitch.setText(R.string.module_map_model_faster)
}
}
}
}

View File

@@ -10,7 +10,9 @@ import com.mogo.eagle.core.function.api.map.roma.IMoGoRomaListener
import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager.romaTrigger
import com.mogo.eagle.core.function.call.map.CallerMapRomaListener
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.util.*
import com.mogo.eagle.core.utilcode.util.ClickUtils
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import kotlinx.android.synthetic.main.view_roma_taxi_bg.view.ivRomaView
import kotlinx.android.synthetic.main.view_roma_taxi_bg.view.ll_roma_bg

View File

@@ -9,13 +9,11 @@ import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.deva.bindingcar.AdUpgradeStateHelper
import com.mogo.eagle.core.data.deva.bindingcar.IPCUpgradeStateInfo
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
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.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84
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
@@ -26,6 +24,7 @@ import com.mogo.eagle.core.function.hmi.ui.utils.HmiActionLog.Companion.hmiActio
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.*
import com.mogo.map.MogoData.Companion.mogoMapData
import kotlinx.android.synthetic.main.view_system_version.view.*
import system_master.SsmInfo
import system_master.SystemStatusInfo
@@ -41,7 +40,7 @@ class SystemVersionView @JvmOverloads constructor(
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoAutopilotStatusListener,
IMoGoDevaToolsListener, IMoGoCheckAutoPilotBtnListener, IMoGoChassisLocationWGS84Listener {
IMoGoDevaToolsListener, IMoGoCheckAutoPilotBtnListener {
companion object {
const val TAG = "SystemVersionView"
@@ -56,7 +55,6 @@ class SystemVersionView @JvmOverloads constructor(
private var currentProgress: Int = -1 //当前已下载包体大小
private var isHDCached = false
private var location: MogoLocation? = null
init {
LayoutInflater.from(context).inflate(R.layout.view_system_version, this, true)
@@ -140,17 +138,17 @@ class SystemVersionView @JvmOverloads constructor(
ivHDCache.setOnClickListener {
hmiAction(
"$M_HMI$TAG",
"HD map view click , isHDCached:$isHDCached , lon:${location?.longitude} , lat:${location?.latitude}"
"HD map view click , isHDCached:$isHDCached , lon:${getChassisLocationWGS84().longitude} , lat:${getChassisLocationWGS84().latitude}"
)
if (isHDCached) {// 已缓存
ToastUtils.showShort(resources.getString(R.string.offline_had_downloaded))
} else {// 未缓存
if (CallerMapUIServiceManager.getCityCode().isNullOrEmpty()) {// 未拿到高德的cityCode
if (location == null || (location!!.longitude <= 0.0 && location!!.latitude <= 0.0)) {// 未拿到高精的经纬度
if ((getChassisLocationWGS84().longitude <= 0.0 && getChassisLocationWGS84().latitude <= 0.0)) {// 未拿到高精的经纬度
ToastUtils.showShort(resources.getString(R.string.location_try_again))
} else {// 拿到了高精的经纬度
val dialog = OfflineMapDialog(context)
dialog.location = location
dialog.location = getChassisLocationWGS84()
dialog.show()
}
} else {// 拿到高德的cityCode
@@ -159,11 +157,8 @@ class SystemVersionView @JvmOverloads constructor(
}
}
ThreadUtils.getIoPool().execute {
val isCached = CallerMapUIServiceManager.isCityDataCached()
UiThreadHandler.post {
updateHDDataCacheStatus(isCached)
}
mogoMapData.get()?.isCityDataCached {
updateHDDataCacheStatus(it)
}
if (AdUpgradeStateHelper.isConfirmUpgrade()) {
@@ -311,7 +306,6 @@ class SystemVersionView @JvmOverloads constructor(
CallerHmiListenerManager.addListener(TAG, this)
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
CallerDevaToolsListenerManager.addListener(TAG, this)
CallerChassisLocationWGS84ListenerManager.addListener(TAG, this)
needQueryContainers = true
}
@@ -323,7 +317,6 @@ class SystemVersionView @JvmOverloads constructor(
CallerHmiListenerManager.removeListener(TAG)
CallerAutoPilotStatusListenerManager.removeListener(TAG)
CallerDevaToolsListenerManager.removeListener(TAG)
CallerChassisLocationWGS84ListenerManager.removeListener(TAG)
needQueryContainers = false
}
@@ -366,22 +359,18 @@ class SystemVersionView @JvmOverloads constructor(
adCircularProgressView?.visibility = View.GONE
}
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
location = gnssInfo
}
/**
* 状态查询应答
* @param status 数据
* HQ、M1 MAP350开始弃用其他车型MAP360开始弃用
*/
override fun onAutopilotStatusRespByQuery(status: SystemStatusInfo.StatusInfo) {
Log.i(TAG,"hdMapVer="+status.hdMapVer)
Log.i(TAG, "hdMapVer=" + status.hdMapVer)
//hdMapVer返回示例/home/mogo/autopilot/share/hadmap_engine/data/hadmap_data/db.sqlite|bj|2.2.7|对bus路线上的junction进行修改对原609场景修改为6091、6092、6201、 6202四种细分场景并对通往园区路口改为619
if(status.hdMapVer!= null && status.hdMapVer.isNotEmpty()){
if (status.hdMapVer != null && status.hdMapVer.isNotEmpty()) {
//对地图版本进行截取
val city = status.hdMapVer.substringAfter(".sqlite|").substringBefore("|")
val version =status.hdMapVer.substringAfter("$city|").substringBefore("|")
val version = status.hdMapVer.substringAfter("$city|").substringBefore("|")
AppConfigInfo.adHdMapVersion = "${city}_${version}"
updateAdHdMapVersion()
}
@@ -395,12 +384,12 @@ class SystemVersionView @JvmOverloads constructor(
* @param statusInf 数据
*/
override fun onSystemStatus(statusInf: SsmInfo.SsmStatusInf) {
Log.i(TAG,"hdMapVer="+statusInf.hdMapVer)
Log.i(TAG, "hdMapVer=" + statusInf.hdMapVer)
//hdMapVer返回示例/home/mogo/autopilot/share/hadmap_engine/data/hadmap_data/db.sqlite|bj|2.2.7|对bus路线上的junction进行修改对原609场景修改为6091、6092、6201、 6202四种细分场景并对通往园区路口改为619
if(statusInf.hdMapVer!= null && statusInf.hdMapVer.isNotEmpty()){
if (statusInf.hdMapVer != null && statusInf.hdMapVer.isNotEmpty()) {
//对地图版本进行截取
val city = statusInf.hdMapVer.substringAfter(".sqlite|").substringBefore("|")
val version =statusInf.hdMapVer.substringAfter("$city|").substringBefore("|")
val version = statusInf.hdMapVer.substringAfter("$city|").substringBefore("|")
AppConfigInfo.adHdMapVersion = "${city}_${version}"
updateAdHdMapVersion()
}
@@ -409,8 +398,8 @@ class SystemVersionView @JvmOverloads constructor(
/**
* 更新工控机高精地图版本
*/
private fun updateAdHdMapVersion(){
if(tvAdHdMapVersionContent.text.isNullOrEmpty() && AppConfigInfo.adHdMapVersion.isNotEmpty() || tvAdHdMapVersionContent.text != AppConfigInfo.adHdMapVersion){
private fun updateAdHdMapVersion() {
if (tvAdHdMapVersionContent.text.isNullOrEmpty() && AppConfigInfo.adHdMapVersion.isNotEmpty() || tvAdHdMapVersionContent.text != AppConfigInfo.adHdMapVersion) {
ThreadUtils.runOnUiThread {
tvAdHdMapVersionContent.text = AppConfigInfo.adHdMapVersion
}

View File

@@ -1,15 +1,12 @@
package com.mogo.eagle.core.function.main
import android.Manifest
import android.content.Intent
import android.content.pm.PackageManager
import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.provider.Settings
import android.view.*
import android.widget.FrameLayout
import androidx.core.app.ActivityCompat
import androidx.recyclerview.widget.LinearLayoutManager
import com.kwai.koom.base.MonitorManager.addMonitorConfig
import com.kwai.koom.javaoom.monitor.OOMHprofUploader
@@ -89,14 +86,12 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
initConnectInfoRV()
CallerHmiManager.init(this)
//申请悬浮窗权限
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
// 检查是否有悬浮窗权限
if (Settings.canDrawOverlays(this)) {
return
}
PermissionsDialogUtils.openAppDetails(this, "显示悬浮窗", REQUEST_CODE_DIALOG)
// 检查是否有悬浮窗权限
if (Settings.canDrawOverlays(this)) {
return
}
//申请悬浮窗权限
PermissionsDialogUtils.openAppDetails(this, "显示悬浮窗", REQUEST_CODE_DIALOG)
}
private fun injectStatusBar() {
@@ -121,7 +116,6 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
decorView.addView(statusBarView, statusBarLP)
}
// todo 优化 车聊聊
private fun injectFloatView() {
val decorView = this.window.decorView as? FrameLayout ?: return

View File

@@ -14,7 +14,6 @@ import android.os.Handler;
import android.os.Process;
import android.text.TextUtils;
import android.util.Log;
import android.view.KeyEvent;
import androidx.annotation.Nullable;
@@ -23,14 +22,11 @@ import com.mogo.commons.module.intent.IMogoIntentListener;
import com.mogo.commons.module.intent.IntentManager;
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener;
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.setting.CallerSkinModeListenerManager;
import com.mogo.eagle.core.function.hmi.R;
import com.mogo.eagle.core.function.main.moujie.BluetoothMonitorReceiver;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.rousetime.android_startup.model.CostTimesModel;
import com.zhjt.service.chain.ChainLog;
@@ -40,8 +36,6 @@ import org.greenrobot.eventbus.Subscribe;
import java.lang.reflect.Method;
import java.util.List;
import java.util.Set;
import java.util.Timer;
import java.util.TimerTask;
/**
* 针对作为Launcher的情况做个性化操作 TODO 测试用的,可删除
@@ -54,10 +48,6 @@ public class PassengerLauncherActivity extends MainActivity implements IMogoInte
private final static Handler handlerV2XEvent = new Handler();
private static Runnable runnableV2XEvent;
private volatile double accelerated;//加速度
private Timer timerHorn;
private Timer timerAcc;
private BluetoothMonitorReceiver mBluetoothReceiver = null;
private BluetoothAdapter mBluetoothAdapter;

View File

@@ -1775,6 +1775,22 @@
app:layout_constraintRight_toRightOf="@id/tbIsDrawAutopilotTrajectoryData"
app:layout_constraintTop_toBottomOf="@id/tbIsDrawAutopilotTrajectoryData" />
<ToggleButton
android:id="@+id/tbCarAperture"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:padding="@dimen/dp_20"
android:textColor="#000"
android:textOff="开启自车光圈"
android:textOn="关闭自车光圈"
android:textSize="@dimen/dp_24"
app:layout_constraintLeft_toRightOf="@id/tbChangeAutoPilotStatus"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tbIsDrawAutopilotTrajectoryData"
/>
<ToggleButton
android:id="@+id/tbDrawPointCloudData"
android:layout_width="0dp"
@@ -1785,9 +1801,10 @@
android:textOff="开启渲染点云数据"
android:textOn="关闭渲染点云数据"
android:textSize="@dimen/dp_24"
app:layout_constraintLeft_toRightOf="@id/tbChangeAutoPilotStatus"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tbIsDrawAutopilotTrajectoryData" />
app:layout_constraintLeft_toLeftOf="@id/tbChangeAutoPilotStatus"
app:layout_constraintRight_toRightOf="@id/tbChangeAutoPilotStatus"
app:layout_constraintTop_toBottomOf="@id/tbChangeAutoPilotStatus"
/>
<Button
android:id="@+id/btnPointCloudSize"

View File

@@ -1,31 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/module_switch_model_layout"
android:layout_width="@dimen/module_switch_map"
android:layout_height="@dimen/module_switch_map_height">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:id="@+id/iconSwitch"
android:layout_width="@dimen/module_switch_image"
android:layout_height="@dimen/module_switch_image"
android:layout_gravity="left|center_vertical"
android:paddingLeft="@dimen/module_switch_margin_left"
android:src="@drawable/module_switch_map_angle" />
<TextView
android:id="@+id/textSwitch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/module_switch_margin_left"
android:text="@string/module_map_model_normal"
android:textColor="@color/color_white"
android:textSize="@dimen/module_switch_text_size" />
</LinearLayout>
</FrameLayout>

View File

@@ -61,7 +61,8 @@ dependencies {
exclude group: 'com.zhidaoauto.machine', module: 'map'
}
implementation rootProject.ext.dependencies.mogocustommap
// implementation rootProject.ext.dependencies.mogocustommap
implementation project(':libraries:mapmodule')
implementation rootProject.ext.dependencies.amapnavi3dmap
implementation rootProject.ext.dependencies.androidxroomruntime

View File

@@ -13,6 +13,7 @@ import com.mogo.eagle.core.function.business.identify.MapIdentifySubscriber
import com.mogo.eagle.core.function.business.routeoverlay.MogoRouteOverlayManager
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
import com.mogo.eagle.core.utilcode.util.DeviceUtils
import com.mogo.map.MapDataWrapper
@Route(path = MogoServicePaths.PATH_MAP_BIZ)
class MapBizProvider :IMoGoFunctionServerProvider, IMogoRoma {
@@ -21,6 +22,7 @@ class MapBizProvider :IMoGoFunctionServerProvider, IMogoRoma {
get() = "MapBizProvider"
override fun init(context: Context?) {
MapDataWrapper.init()
MapIdentifySubscriber.instance
MogoRouteOverlayManager.getInstance().init()
MapPointCloudSubscriber.instance

View File

@@ -9,13 +9,13 @@ import androidx.lifecycle.Lifecycle.Event.ON_DESTROY
import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.data.map.*
import com.mogo.eagle.core.data.map.MapRoadInfo.StopLine
import com.mogo.eagle.core.function.api.map.angle.*
import com.mogo.eagle.core.function.api.map.angle.Scene
import com.mogo.eagle.core.function.call.autopilot.*
import com.mogo.eagle.core.function.call.map.*
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager.OnRoadListener
import com.mogo.eagle.core.utilcode.kotlin.*
import com.zhidaoauto.map.data.road.StopLine
import com.zhidaoauto.map.sdk.open.tools.*
import kotlinx.coroutines.*
import kotlinx.coroutines.android.*
@@ -90,11 +90,11 @@ class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider {
override fun onStopLineInfo(info: StopLine) {
Log.d(TAG, "-- onStopLineInfo --: ${info.distanceOfCarToStopLine}")
if (!hasCrossRoad && info.distanceOfCarToStopLine <= 30.0) {
Log.d(TAG, "-- onStopLineInfo --: ${info.distance}")
if (!hasCrossRoad && info.distance <= 30.0) {
hasCrossRoad = true
triggerRoadId.set(this.roadId.get())
distanceOfCarToStopLine.set(info.distanceOfCarToStopLine)
distanceOfCarToStopLine.set(info.distance)
triggerLocation.set(CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02())
changeAngle(CrossRoad(true))
}

View File

@@ -5,9 +5,9 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPointCloudListener
import com.mogo.eagle.core.function.api.base.IMoGoSubscriber
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPointCloudListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP
import com.zhidaoauto.map.sdk.open.business.PointCloudHelper
import java.math.BigDecimal
/**
@@ -47,26 +47,20 @@ class MapPointCloudSubscriber private constructor()
if (!isDrawPointCloud) {
CallerLogger.d(M_MAP + TAG, "====开启点云渲染====")
isDrawPointCloud = true
PointCloudHelper.setIsDrawPointCloud(true)//打开点云绘制
CallerMapUIServiceManager.getMapUIController()?.setIsDrawPointCloud(true)
}
PointCloudHelper.setIsDrawPointCloud(true)//打开点云绘制
CallerMapUIServiceManager.getMapUIController()?.setIsDrawPointCloud(true) //打开点云绘制
/**
* 更新点云数据
* @param dataStr 点云数据
* @param isTrasformer 是否需要转换坐标
* @param isResidual 是否需要差量更新
* @param isStrong 是否加粗显示
* @return 是否执行
*/
CallerLogger.d(M_MAP + TAG, "====开始传入地图点云数据====")
val result = PointCloudHelper.updatePointCloudDataByPb(pointCloud, true, false, false)
val result = CallerMapUIServiceManager.getMapUIController()?.updatePointCloud(pointCloud,
isTransformer = true, isResidual = false, isReset = false
)
CallerLogger.d(M_MAP + TAG, "====结束传入地图点云数据=====$result")
} else {
if (isDrawPointCloud) {
CallerLogger.d(M_MAP + TAG, "====停止点云绘制====")
isDrawPointCloud = false
PointCloudHelper.setIsDrawPointCloud(false)//停止点云绘制
CallerMapUIServiceManager.getMapUIController()?.setIsDrawPointCloud(false)//停止点云绘制
}
}
} catch (e: Exception) {

View File

@@ -1,15 +1,12 @@
package com.mogo.eagle.core.function.business;
import androidx.annotation.Nullable;
import com.mogo.eagle.core.data.enums.DataSourceType;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager;
import com.mogo.map.MapDataWrapper;
import java.util.Objects;
import java.util.Timer;
import java.util.TimerTask;
@@ -18,11 +15,9 @@ import java.util.TimerTask;
*
* @author mogoauto
*/
public class SpeedLimitDataManager implements IMoGoChassisLocationWGS84Listener {
public class SpeedLimitDataManager {
private final static String TAG = "SpeedLimitDataManager";
private static volatile SpeedLimitDataManager instance;
private volatile MogoLocation mLocation;
private SpeedLimitDataManager() {
}
@@ -38,31 +33,26 @@ public class SpeedLimitDataManager implements IMoGoChassisLocationWGS84Listener
return instance;
}
@Override
public void onChassisLocationWGS84(@Nullable MogoLocation gnssInfo) {
mLocation = gnssInfo;
}
private class SpeedTimerTask extends TimerTask {
private static class SpeedTimerTask extends TimerTask {
@Override
public void run() {
if (mLocation != null) {
if (CallerMapUIServiceManager.INSTANCE.getMapUIController() != null) {
getSpeedLimit();
}
}
getSpeedLimit();
}
private void getSpeedLimit() {
int speedLimit = Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).getLimitSpeed(mLocation.getLongitude(), mLocation.getLatitude(), (float) mLocation.getHeading());
if (speedLimit > 0) {
CallerLimitingVelocityListenerManager.INSTANCE.invokeUnion(speedLimit, DataSourceType.MAP);
MogoLocation loc = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84();
if (loc.getLatitude() > 0 && loc.getLongitude() > 0) {
MapDataWrapper.INSTANCE.getLimitSpeed(loc.getLongitude(), loc.getLatitude(), (float) loc.getHeading(), integer -> {
if (integer != null && integer > 0) {
CallerLimitingVelocityListenerManager.INSTANCE.invokeUnion(integer, DataSourceType.MAP);
}
return null;
});
}
}
}
public void start() {
CallerChassisLocationWGS84ListenerManager.INSTANCE.addListener(TAG, this);
Timer mTimer = new Timer();
mTimer.schedule(new SpeedTimerTask(), 3000, 1000);
}

View File

@@ -38,8 +38,8 @@ import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.updateLong
import com.mogo.eagle.core.function.utils.MapBizTrace
import com.mogo.eagle.core.function.utils.MapBizTrace.Companion.getCurrentCNode
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.map.MogoMapUIController
import com.mogo.map.uicontroller.VisualAngleMode
import com.zhidaoauto.map.data.point.LonLatPoint
import com.zhjt.service.chain.ChainLog
import mogo.telematics.pad.MessagePad
import mogo.yycp.api.proto.SocketDownData
@@ -179,8 +179,7 @@ class AiCloudIdentifyDataManager : IMoGoPlanningRottingListener,
MapIdentifySubscriber.instance.clearAiCloudRoma()
// 主动关闭roma回到中景视角
if (manual) {
MogoMapUIController.getInstance()
.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
CallerMapUIServiceManager.getMapUIController()?.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
}
}
@@ -216,7 +215,7 @@ class AiCloudIdentifyDataManager : IMoGoPlanningRottingListener,
)
if (dataReceive) {
// 请求地图开始漫游
MogoMapUIController.getInstance().setRomaMode(FunctionBuildConfig.romaModeStyle)
CallerMapUIServiceManager.getMapUIController()?.setRomaMode(FunctionBuildConfig.romaModeStyle)
}else{
// 保底清除策略
MapBizTrace.log("",CHAIN_CODE_ROMA_REQUEST_DELAY,TAG,mutableMapOf("delay" to true),true)
@@ -321,28 +320,24 @@ class AiCloudIdentifyDataManager : IMoGoPlanningRottingListener,
override fun onAutopilotRotting(globalPathResp: MessagePad.GlobalPathResp?) {
globalPathResp?.let {
if (it.wayPointsList != null && it.wayPointsList.size > 0) {
val builder = StringBuilder()
val roamList = ArrayList<LonLatPoint>()
it.wayPointsList.forEach { loc ->
builder.append(loc.longitude).append(",").append(loc.latitude).append(",")
roamList.add(LonLatPoint(loc.longitude,loc.latitude))
}
var romaRoute = builder.toString()
if (romaRoute.endsWith(",")) {
romaRoute = romaRoute.substring(0, builder.toString().length - 1)
}
updateRomaStyle(false, romaRoute)
updateRomaStyle(false, roamList)
}
}
}
private fun updateRomaStyle(auto: Boolean, route: String? = null) {
private fun updateRomaStyle(auto: Boolean, routeList: ArrayList<LonLatPoint>? = null) {
MapBizTrace.log(
"",
CHAIN_CODE_ROMA_ROUTE_MODE,
TAG,
"updateRomaStyle auto status:$auto, route:${route ?: "reset null"}"
"updateRomaStyle auto status:$auto, route:${routeList?.size ?: "reset null"}"
)
route?.let {
CallerMapUIServiceManager.getMapUIController()?.setRoamTrajectory(route)
routeList?.let {
CallerMapUIServiceManager.getMapUIController()?.setRoamTrajectory(it)
}
if (auto) {
FunctionBuildConfig.romaModeStyle = 0

View File

@@ -1,58 +1,51 @@
package com.mogo.eagle.core.function.business.cachemap
import android.util.Log
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.map.hdcache.IHdCacheListener
import com.mogo.map.MogoData.Companion.mogoMapData
object CacheHDMapManager: IMoGoChassisLocationWGS84Listener {
object CacheHDMapManager {
private const val TAG = "CacheHDMapManager"
@Volatile
private var location: MogoLocation? = null
fun scheduleGetLocation() {
if (!AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
CallerChassisLocationWGS84ListenerManager.addListener(TAG, this)
ThreadUtils.getIoPool().execute {
if (!CallerMapUIServiceManager.isCityDataCached()) {
while (true) {
if (location != null) {
Log.d(TAG, "开始下载")
CallerMapUIServiceManager.cacheHDDataByCityByLonLat(object : IHdCacheListener {
override fun onMapHdCacheProgress(cityId: Int, progress: Double) {
Log.d(TAG, "下载进度:${progress.toInt()}")
}
override fun onMapHdCacheResult(cityId: Int, state: Int) {
if (state == 0) {
Log.d(TAG, "下载失败")
}
}
}, location!!)
Log.d(TAG, "移除监听并关闭循环")
CallerChassisLocationWGS84ListenerManager.removeListener(TAG)
return@execute
mogoMapData.get()?.isCityDataCached {
if (!it) {
ThreadUtils.getIoPool().execute {
while (true) {
val loc =
CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
if (loc.latitude != 0.0 || loc.longitude != 0.0) {
CallerLogger.d(TAG, "开始下载")
mogoMapData.get()?.cacheHDDataByCityByLonLat(loc,
{ _, progress ->
CallerLogger.i(M_MAP + TAG, "下载进度:${progress.toInt()}")
},
{ _, state ->
if (state == 0) {
CallerLogger.i(M_MAP + TAG, "下载失败")
}
})
CallerLogger.i(M_MAP + TAG, "移除监听并关闭循环")
break
}
try {
CallerLogger.i(M_MAP + TAG, "开始休眠...")
Thread.sleep(1500)
} catch (e: Exception) {
}
}
try {
Log.d(TAG, "开始休眠...")
Thread.sleep(1500)
} catch (e: Exception) {}
}
} else {
Log.d(TAG, "高精地图缓存已下载!")
CallerLogger.i(M_MAP + TAG, "高精地图缓存已下载!")
}
}
}
}
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
location = gnssInfo
}
}

View File

@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.business.identify
import android.annotation.SuppressLint
import androidx.collection.ArraySet
import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.module.status.MogoStatusManager
import com.mogo.map.identify.MogoIdentifyManager
import mogo.yycp.api.proto.SocketDownData
@@ -10,10 +9,6 @@ import java.util.concurrent.ConcurrentHashMap
class IdentifyAiCloudDataDrawer : Identify {
companion object {
private const val TAG = "IdentifyDataDrawer"
}
/**
* 上一帧数据的缓存
*/
@@ -55,14 +50,14 @@ class IdentifyAiCloudDataDrawer : Identify {
val key = it.next() as String
it.remove()
mMarkersCaches.remove(key)
MogoIdentifyManager.getInstance(AbsMogoApplication.getApp())
MogoIdentifyManager.getInstance()
.removeMarker(key.hashCode().toString())
}
val filterList = filterTrafficData(resultList)
if (filterList.size > 0) {
// 绘制新数据
MogoIdentifyManager.getInstance(AbsMogoApplication.getApp())
MogoIdentifyManager.getInstance()
.updateBatchAiMarkerPosition(filterList)
}
}
@@ -90,7 +85,7 @@ class IdentifyAiCloudDataDrawer : Identify {
trafficDataUuidList.clear()
mMarkersCaches.forEach { (uuid, _) ->
mMarkersCaches.remove(uuid)
MogoIdentifyManager.getInstance(AbsMogoApplication.getApp())
MogoIdentifyManager.getInstance()
.removeMarker(uuid.hashCode().toString())
}
mFilterTrafficData.clear()

View File

@@ -1,7 +1,6 @@
package com.mogo.eagle.core.function.business.identify
import android.annotation.SuppressLint
import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.module.status.MogoStatusManager
import com.mogo.eagle.core.data.traffic.TrafficData
import com.mogo.map.identify.MogoIdentifyManager
@@ -13,10 +12,6 @@ import mogo.telematics.pad.MessagePad.TrackedObject
*/
class IdentifyBeautifyDataDrawer : Identify {
companion object {
private const val TAG = "IdentifyDataDrawer"
}
override fun renderPlanningWarningObj(planningObjects: List<MessagePad.PlanningObject>?) {
TrackManager.getInstance().renderPlanningWarningObj(planningObjects)
}
@@ -46,7 +41,7 @@ class IdentifyBeautifyDataDrawer : Identify {
val filterList = TrackManager.getInstance().filterTrafficData(resultList)
if (filterList.size > 0) {
// 绘制新数据
MogoIdentifyManager.getInstance(AbsMogoApplication.getApp())
MogoIdentifyManager.getInstance()
.updateBatchMarkerPosition(filterList)
}
}

View File

@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.business.identify
import android.annotation.SuppressLint
import androidx.collection.ArraySet
import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.module.status.MogoStatusManager
import com.mogo.eagle.core.data.traffic.TrafficData
import com.mogo.map.identify.MogoIdentifyManager
@@ -17,10 +16,6 @@ import java.util.concurrent.ConcurrentHashMap
*/
class IdentifyOriginDataDrawer : Identify {
companion object {
private const val TAG = "IdentifyDataDrawer"
}
/**
* 上一帧数据的缓存
*/
@@ -65,11 +60,11 @@ class IdentifyOriginDataDrawer : Identify {
//清除缓存
for (data in resultList) {
if (trafficDataUuidList.size > 0 && trafficDataUuidList.contains("" + data.uuid)) {
if (trafficDataUuidList.size > 0 && trafficDataUuidList.contains(data.uuid.toString())) {
if (TrackerSourceFilterHelper.filterData(data)) {
continue
}
trafficDataUuidList.remove("" + data.uuid)
trafficDataUuidList.remove(data.uuid.toString())
}
}
@@ -79,14 +74,14 @@ class IdentifyOriginDataDrawer : Identify {
val key = it.next() as String
it.remove()
mMarkersCaches.remove(key)
MogoIdentifyManager.getInstance(AbsMogoApplication.getApp())
MogoIdentifyManager.getInstance()
.removeMarker(key)
}
val filterList = filterTrafficData(resultList)
if (filterList.size > 0) {
// 绘制新数据
MogoIdentifyManager.getInstance(AbsMogoApplication.getApp())
MogoIdentifyManager.getInstance()
.updateBatchMarkerPosition(filterList)
}
}
@@ -105,7 +100,7 @@ class IdentifyOriginDataDrawer : Identify {
continue
}
var temp: TrackedObject = data
val uuid = "" + data.uuid
val uuid = data.uuid.toString()
val cacheData = mMarkersCaches[uuid]
if (cacheData != null) {
val color = TrackerSourceFilterHelper.getDefaultColor(data)
@@ -124,7 +119,7 @@ class IdentifyOriginDataDrawer : Identify {
@SuppressLint("NewApi")
override fun clearOldMarker() {
for (uuid in trafficDataUuidList) {
MogoIdentifyManager.getInstance(AbsMogoApplication.getApp())
MogoIdentifyManager.getInstance()
.removeMarker(uuid)
}
trafficDataUuidList.clear()

View File

@@ -1,11 +1,13 @@
package com.mogo.eagle.core.function.business.identify;
import android.annotation.SuppressLint;
import android.os.Build;
import android.util.ArraySet;
import androidx.annotation.RequiresApi;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.eagle.core.data.traffic.TrafficData;
import com.mogo.eagle.core.utilcode.geometry.S2CellId;
import com.mogo.eagle.core.utilcode.geometry.S2LatLng;
@@ -71,13 +73,13 @@ public class TrackManager {
public HashMap<String, MessagePad.TrackedObject> filterTrafficData(List<MessagePad.TrackedObject> trafficData) {
//清空上次返回数据,做到缓存复用
mFilterTrafficData.clear();
long cost = System.currentTimeMillis();
// long cost = System.currentTimeMillis();
//进入过滤机制的感知物体,首先从缓存队列中进行查找 uuid
for (MessagePad.TrackedObject data : trafficData) {
if (TrackerSourceFilterHelper.INSTANCE.filterData(data)) {
continue;
}
String uuid = "" + data.getUuid();
String uuid = Integer.toString(data.getUuid());
TrackObj trackObj = mMarkersCaches.get(uuid);
String color = TrackerSourceFilterHelper.INSTANCE.getDefaultColor(data);
@@ -93,24 +95,26 @@ public class TrackManager {
if (cellIdCaches.containsValue(pos)) {
String findSameValue = cellIdCaches.inverse().get(pos);
//uuid处理
data = data.toBuilder().setUuid(Integer.parseInt(findSameValue)).build();
TrackObj cacheTrack = mMarkersCaches.get(findSameValue);
if (cacheTrack != null) {
trackObj = cacheTrack;
MessagePad.TrackedObject cache = cacheTrack.getCache();
if (cache != null) {
//相对静止物体 感知融合同位置物体,使用缓存数据做覆盖
if (cacheTrack.relativeStatic()) {
if (data.getColor() != null && !data.getColor().isEmpty()) {
cache = cache.toBuilder().setColor(data.getColor()).build();
if(findSameValue != null && !findSameValue.isEmpty()){
data = data.toBuilder().setUuid(Integer.parseInt(findSameValue)).build();
TrackObj cacheTrack = mMarkersCaches.get(findSameValue);
if (cacheTrack != null) {
trackObj = cacheTrack;
MessagePad.TrackedObject cache = cacheTrack.getCache();
if (cache != null) {
//相对静止物体 感知融合同位置物体,使用缓存数据做覆盖
if (cacheTrack.relativeStatic()) {
if (data.getColor() != null && !data.getColor().isEmpty()) {
cache = cache.toBuilder().setColor(data.getColor()).build();
}
data = cache;
}
data = cache;
}
uuid = findSameValue;
trackObj.updateObj(data);
} else {
trackObj = new TrackObj(data,s2CellId,s2LatLng);
}
uuid = findSameValue;
trackObj.updateObj(data);
} else {
trackObj = new TrackObj(data,s2CellId,s2LatLng);
}
} else {
trackObj = new TrackObj(data,s2CellId,s2LatLng);
@@ -128,7 +132,7 @@ public class TrackManager {
public void clearCache(List<MessagePad.TrackedObject> resultList) {
//过滤现有元素
for (MessagePad.TrackedObject data : resultList) {
String uuid = "" + data.getUuid();
String uuid = Integer.toString(data.getUuid());
if (trafficDataUuid.size() > 0 && trafficDataUuid.contains(uuid)) {
if (TrackerSourceFilterHelper.INSTANCE.filterData(data)) {
continue;
@@ -150,17 +154,18 @@ public class TrackManager {
cellIdCaches.remove(key);
mMarkersCaches.remove(key);
WarningHelper.INSTANCE.remove(key);
MogoIdentifyManager.getInstance(AbsMogoApplication.getApp())
MogoIdentifyManager.getInstance()
.removeMarker(key);
}
@RequiresApi(api = Build.VERSION_CODES.N)
public void clearAll() {
cellIdCaches.clear();
trafficDataUuid.clear();
WarningHelper.INSTANCE.clear();
mMarkersCaches.forEach((uuid, trackObj) -> {
trackObj.clear();
MogoIdentifyManager.getInstance(AbsMogoApplication.getApp())
MogoIdentifyManager.getInstance()
.removeMarker(uuid);
});
mMarkersCaches.clear();

View File

@@ -4,7 +4,6 @@ import android.annotation.SuppressLint
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
import com.mogo.eagle.core.function.call.biz.CallerFuncBizListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import mogo.telematics.pad.MessagePad.*
object TrackerSourceFilterHelper {
@@ -12,7 +11,8 @@ object TrackerSourceFilterHelper {
@SuppressLint("NewApi")
fun filterData(data: TrackedObject): Boolean {
if (!FunctionBuildConfig.isDrawUnknownIdentifyData && (data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI.type
|| data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_501.type || data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_502.type)) {
|| data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_501.type || data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_502.type)
) {
return true
}
var trackIPCFilter = true
@@ -32,7 +32,7 @@ object TrackerSourceFilterHelper {
}
}
4 -> {
if(isV2nRSM(data).second){
if (isV2nRSM(data).second) {
trackIPCFilter = false
}
}
@@ -73,12 +73,10 @@ object TrackerSourceFilterHelper {
}
//僵尸车
if(data.addAttribute == AdditionalAttribute.ATTR_ZOMBIE){
if (data.addAttribute == AdditionalAttribute.ATTR_ZOMBIE) {
color = "#7A8499FF"
CallerMapUIServiceManager.getMapUIController()?.let {
if(it.isDayMode){
color = "#9BA8BCFF"
}
if (FunctionBuildConfig.skinMode == 1) {
color = "#9BA8BCFF"
}
//消息埋点
CallerFuncBizListenerManager.invokeAttrZombieAnalyticsEvent()

View File

@@ -41,7 +41,7 @@ object WarningHelper {
return
}
planningObjects.forEach(Consumer { planningObj: PlanningObject ->
val trackId = "" + planningObj.uuid
val trackId = planningObj.uuid.toString()
if (mMarkersCaches.containsKey(trackId)) {
mMarkersCaches[trackId] ?: return@Consumer
if (planningObj.type == 0) { //0是leading障碍物障碍物车身红色提示
@@ -72,7 +72,7 @@ object WarningHelper {
return
}
planningObjects.forEach(Consumer { planningObj: PlanningObject ->
val trackId = "" + planningObj.uuid
val trackId = planningObj.uuid.toString()
if (mMarkersCaches.containsKey(trackId)) {
mMarkersCaches[trackId] ?: return@Consumer
if (planningObj.type == 0) { //0是leading障碍物障碍物车身红色提示

View File

@@ -58,7 +58,7 @@ public class MogoRouteOverlayManager implements
@Override
public void onAutopilotTrajectory(@NonNull List<MessagePad.TrajectoryPoint> items) {
Log.d(TAG, "-- onAutopilotTrajectory --: " + (items != null ? items.size() : "0"));
// Log.d(TAG, "-- onAutopilotTrajectory --: " + (items != null ? items.size() : "0"));
synchronized (queue) {
queue.clear();
queue.offer(items);
@@ -72,18 +72,18 @@ public class MogoRouteOverlayManager implements
}
int autoPilotState = CallerAutoPilotStatusListenerManager.INSTANCE.getState();
boolean isArriveAtStation = CallerAutoPilotStatusListenerManager.INSTANCE.isArriveAtStation();
Log.d(TAG, "-- onChassisLocationGCJ02 -- 1 ---" + ":auto-mode:" + autoPilotState + ", isArriveAtStation: " + isArriveAtStation);
// Log.d(TAG, "-- onChassisLocationGCJ02 -- 1 ---" + ":auto-mode:" + autoPilotState + ", isArriveAtStation: " + isArriveAtStation);
if (isArriveAtStation && autoPilotState != 2) {
RouteOverlayDrawer.getInstance().clearMogoRouteOverlay();
return;
}
Log.d(TAG, "-- onChassisLocationGCJ02 -- 2 ---" + "auto-mode:" + autoPilotState + ", isDemoMode:" + FunctionBuildConfig.isDemoMode + ", force:" + FunctionBuildConfig.isForceDrawAutopilotTrajectoryByDebugSettingView);
// Log.d(TAG, "-- onChassisLocationGCJ02 -- 2 ---" + "auto-mode:" + autoPilotState + ", isDemoMode:" + FunctionBuildConfig.isDemoMode + ", force:" + FunctionBuildConfig.isForceDrawAutopilotTrajectoryByDebugSettingView);
boolean force = FunctionBuildConfig.isForceDrawAutopilotTrajectoryByDebugSettingView || FunctionBuildConfig.isDemoMode && FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData;
if (!force && autoPilotState != 2) {
RouteOverlayDrawer.getInstance().clearMogoRouteOverlay();
return;
}
Log.d(TAG, "-- onChassisLocationGCJ02 -- 3 ---");
// Log.d(TAG, "-- onChassisLocationGCJ02 -- 3 ---");
synchronized (queue) {
if (!queue.isEmpty()) {
List<MessagePad.TrajectoryPoint> items = queue.pollLast();

View File

@@ -1,5 +1,7 @@
package com.mogo.eagle.core.function.business.routeoverlay;
import static com.mogo.map.MogoMap.DEFAULT;
import android.annotation.SuppressLint;
import android.graphics.Color;
import android.os.Handler;
@@ -197,7 +199,7 @@ public class RouteOverlayDrawer {
if (mPolylineOptions == null) {
mPolylineOptions = options;
}
overlayManager.showOrUpdateLine(options);
overlayManager.showOrUpdateLine(options,DEFAULT);
} else {
isExcept = true;
}

View File

@@ -1,43 +0,0 @@
package com.mogo.eagle.core.function.impl;
import android.content.Context;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.eagle.core.data.constants.MogoServicePaths;
import com.mogo.eagle.core.function.api.map.IMogoMapService;
import com.mogo.map.MoGoOverlayManager;
import com.mogo.map.MogoMapUIController;
import com.mogo.map.location.GDLocationClient;
import com.mogo.map.location.IMogoGDLocationClient;
import com.mogo.map.overlay.IMoGoOverlayManager;
import com.mogo.map.uicontroller.IMogoMapUIController;
/**
* @author congtaowang
* @since 2019-12-18
* <p>
* 地图对外地接口
*/
@Route(path = MogoServicePaths.PATH_SERVICES_MAP)
public class MogoMapService implements IMogoMapService {
@Override
public IMogoMapUIController getMapUIController() {
return MogoMapUIController.getInstance();
}
@Override
public IMoGoOverlayManager getOverlayManager() {
return MoGoOverlayManager.INSTANCE.overlay();
}
@Override
public IMogoGDLocationClient getGDLocationServer(Context context) {
return GDLocationClient.getInstance(context);
}
@Override
public void init(Context context) {
}
}

View File

@@ -0,0 +1,37 @@
package com.mogo.eagle.core.function.impl
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.map.MoGoOverlayManager.overlay
import com.mogo.map.location.GDLocationClient.Companion.gdLocationClient
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.function.api.map.IMogoMapService
import com.mogo.map.uicontroller.IMogoMapUIController
import com.mogo.map.overlay.IMoGoOverlayManager
import com.mogo.map.MogoMap.Companion.mapInstance
import com.mogo.map.location.IMogoGDLocationClient
/**
* @author congtaowang
* @since 2019-12-18
*
*
* 地图对外地接口,多实例情况下,如果某个业务需要在多个地图上展示,需要业务提供监听接口,各个地图实例监听实现
*/
@Route(path = MogoServicePaths.PATH_SERVICES_MAP)
class MogoMapService : IMogoMapService {
override fun getMapUIController(mapTag:String): IMogoMapUIController? {
return mapInstance.getMogoMap().uiController
}
override fun getOverlayManager(): IMoGoOverlayManager {
return overlay()
}
override fun getGDLocationServer(): IMogoGDLocationClient {
return gdLocationClient
}
override fun init(context: Context) {}
}

View File

@@ -11,9 +11,13 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Liste
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
import com.mogo.map.MogoMapView
import com.mogo.map.overlay.line.Polyline
import com.mogo.map.overlay.point.Point
import com.mogo.map.overlay.proxy.line.IMapPolylineOverlay
import com.mogo.map.overlay.proxy.point.IMapPointOverlay
import com.mogo.map.uicontroller.IMogoMapUIController
class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context, attrs),
@@ -28,7 +32,6 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
super.onCreate(bundle)
map?.uiController?.showMyLocation(true)
initMapView()
CallerSkinModeListenerManager.addListener(TAG, this)
CallerChassisLocationWGS84ListenerManager.addListener(TAG, 20,this)
CallerChassisLamplightListenerManager.addListener(TAG, this)
@@ -48,7 +51,7 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
//设置旋转手势是否可用。
it.setRotateGesturesEnabled(false)
//设置比例尺控件是否可见
it.setScaleControlsEnabled(true)
it.setScaleControlsEnabled(false)
//设置拖拽手势是否可用。
it.setScrollGesturesEnabled(true)
//设置倾斜手势是否可用。
@@ -60,7 +63,19 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
}
}
override fun onSaveInstanceState(outState: Bundle?) {
fun getUI(): IMogoMapUIController? {
return map?.uiController
}
fun addLine(options:Polyline.Options): IMapPolylineOverlay? {
return map?.addLine(options)
}
fun addPoint(options: Point.Options): IMapPointOverlay?{
return map?.addPoint(options)
}
override fun onSaveInstanceState(outState: Bundle) {
super.onSaveInstanceState(outState)
}
@@ -74,9 +89,9 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
override fun onSkinModeChange(skinMode: Int) {
if (skinMode == 0) {
CallerMapUIServiceManager.getMapUIController()?.stepInVrMode(false)
getUI()?.stepInDayMode(false)
} else if (skinMode == 1) {
CallerMapUIServiceManager.getMapUIController()?.stepInVrMode(true)
getUI()?.stepInDayMode(true)
}
}
@@ -107,9 +122,9 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
private fun turn(lightNum: Int) {
if (currentLevel != lightNum) {
when (lightNum) {
0 -> CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(0, 500)
1 -> CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(1, 500)
2 -> CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(2, 500)
0 -> getUI()?.setCarLightsType(0, 500)
1 -> getUI()?.setCarLightsType(1, 500)
2 -> getUI()?.setCarLightsType(2, 500)
}
currentLevel = lightNum
}

View File

@@ -101,7 +101,7 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
}
private fun initGDLoc() {
CallerMapUIServiceManager.getGDLocationServer(context!!)?.start()
CallerMapUIServiceManager.getGDLocationServer()?.start(context!!)
}
private fun preparePassportEnvironment() {
@@ -170,10 +170,10 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
// 更新
httpDnsSimpleLocation = if (
mogoLocation.cityCode.isNullOrEmpty() &&
!CallerMapUIServiceManager.getGDLocationServer(context!!)?.lastCityCode.isNullOrEmpty()
!CallerMapUIServiceManager.getGDLocationServer()?.lastCityCode.isNullOrEmpty()
) {
SimpleLocation(
CallerMapUIServiceManager.getGDLocationServer(context!!)?.lastCityCode
CallerMapUIServiceManager.getGDLocationServer()?.lastCityCode
?: "010",
mogoLocation.latitude,
mogoLocation.longitude
@@ -354,13 +354,9 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
})
// 开启Socket长链服务
val lat =
if (location.latitude != 0.0) location.latitude else CallerMapUIServiceManager.getGDLocationServer(
context!!
)!!.lastLat
if (location.latitude != 0.0) location.latitude else CallerMapUIServiceManager.getGDLocationServer()!!.lastLat
val lon =
if (location.longitude != 0.0) location.longitude else CallerMapUIServiceManager.getGDLocationServer(
context!!
)!!.lastLon
if (location.longitude != 0.0) location.longitude else CallerMapUIServiceManager.getGDLocationServer()!!.lastLon
MogoAiCloudSocketManager.getInstance(context)
.init(context, sn, DebugConfig.getSocketAppId(), lat, lon)
}
@@ -381,11 +377,11 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
map["lat"] =
if (CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02().latitude != 0.0)
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02().latitude else
CallerMapUIServiceManager.getGDLocationServer(context!!)!!.lastLat
CallerMapUIServiceManager.getGDLocationServer()!!.lastLat
map["lon"] =
if (CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02().longitude != 0.0)
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02().longitude else
CallerMapUIServiceManager.getGDLocationServer(context!!)!!.lastLon
CallerMapUIServiceManager.getGDLocationServer()!!.lastLon
map["reason"] = msg
return map
}