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

This commit is contained in:
xinfengkun
2023-04-19 19:24:01 +08:00
45 changed files with 492 additions and 258 deletions

View File

@@ -9,13 +9,18 @@ import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.widget.ContentLoadingProgressBar;
import com.mogo.commons.mvp.IView;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.commons.mvp.Presenter;
import com.mogo.eagle.core.data.multidisplay.TelematicConstant;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener;
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager;
import com.mogo.eagle.core.function.hmi.ui.widget.DriverMonitorView;
import com.mogo.eagle.core.function.view.MapBizView;
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
@@ -42,6 +47,12 @@ public abstract class BusPassengerBaseFragment<V extends IView, P extends Presen
private View mLiveBtn;
private View mLiveShadow;
private DriverMonitorView driverMonitorView;
// 记录司机端是否打开了显示开关,
// 开关开启时,有视频流的车辆持续常驻展示视频流,无视频流的车辆不展示(无占位);
// 开关关闭时,无论是否有视频流,均不展示(无占位);开关默认关闭
private boolean driverToggle = false;
/**
* 改变自动驾驶状态
*
@@ -70,8 +81,15 @@ public abstract class BusPassengerBaseFragment<V extends IView, P extends Presen
mProgressBar = findViewById(R.id.bus_progress_bar);
mLiveShadow = findViewById(R.id.liveShadow);
driverMonitorView = findViewById(R.id.driverMonitorView);
mLiveBtn = findViewById(R.id.liveBtn);
driverMonitorView.setLiveListener(
() -> {
mLiveShadow.setVisibility(View.GONE);
}
);
mLiveBtn.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
@@ -79,6 +97,30 @@ public abstract class BusPassengerBaseFragment<V extends IView, P extends Presen
return true;
}
});
CallerTelematicListenerManager.INSTANCE.addListener(TAG, new IReceivedMsgListener() {
@Override
public void onReceivedServerSn(@Nullable String sn) {
}
@Override
public void onReceivedMsg(int type, @NonNull byte[] byteArray) {
if (type == TelematicConstant.CONTROL_PASSENGER_DRIVER_MONITOR) {
switch (new String(byteArray)) {
// 乘客端开启漫游
case "0": {
mLiveShadow.setVisibility(View.GONE);
break;
}
// 乘客端关闭漫游
case "1": {
mLiveShadow.setVisibility(View.VISIBLE);
break;
}
}
}
}
});
showRouteFragment();

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
@@ -8,9 +9,9 @@
android:id="@+id/mapBizView"
android:layout_width="@dimen/dp_1860"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
app:layout_constraintTop_toTopOf="parent" />
<com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugViewTrigger
android:layout_width="@dimen/dp_400"
@@ -33,28 +34,20 @@
android:id="@+id/bus_p_autopilot_iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="@dimen/bus_p_curent_station_panel_margin"
android:layout_marginTop="@dimen/dp_112"
android:scaleType="fitXY"
android:visibility="gone"
android:layout_gravity="center_horizontal"
android:src="@drawable/bus_p_un_auto_nor"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
app:layout_constraintTop_toTopOf="parent" />
<!--浓雾预警动画-->
<com.mogo.eagle.core.function.hmi.ui.widget.V2XFogEventView
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="match_parent" />
<!--pnc行为决策-->
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_100"
android:layout_marginBottom="@dimen/dp_110"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<com.mogo.eagle.core.function.hmi.ui.widget.RomaPassengerView
android:id="@+id/ivMoGoLogo"
@@ -63,10 +56,10 @@
android:layout_marginRight="@dimen/dp_751"
android:layout_marginBottom="@dimen/dp_59"
android:background="@drawable/roma_bus_p_bg_selector"
app:roma_close="@drawable/roma_bus_p_bg_selector"
app:roma_open="@drawable/iv_roma_bus_passenger_press_bg"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent" />
app:layout_constraintRight_toRightOf="parent"
app:roma_close="@drawable/roma_bus_p_bg_selector"
app:roma_open="@drawable/iv_roma_bus_passenger_press_bg" />
<com.mogo.och.common.module.wigets.OCHBorderShadowLayout
android:id="@+id/arrive_station_shadow"
@@ -117,14 +110,15 @@
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="@+id/bus_p_cur_station_title"
app:layout_constraintTop_toBottomOf="@+id/bus_p_cur_station_title" />
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_27"
app:layout_constraintTop_toTopOf="@+id/bus_p_cur_station_name"
android:layout_marginRight="@dimen/dp_10"
android:src="@drawable/station_arrow"
app:layout_constraintBottom_toBottomOf="@+id/bus_p_cur_station_name"
app:layout_constraintRight_toLeftOf="@+id/bus_p_cur_station_name"
android:layout_marginRight="@dimen/dp_10"
android:src="@drawable/station_arrow">
app:layout_constraintTop_toTopOf="@+id/bus_p_cur_station_name">
</androidx.appcompat.widget.AppCompatImageView>
@@ -143,26 +137,26 @@
<androidx.core.widget.ContentLoadingProgressBar
android:id="@+id/bus_progress_bar"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width="0dp"
android:layout_height="@dimen/dp_10"
android:progress="0"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginLeft="@dimen/dp_12"
android:layout_marginRight="@dimen/dp_15"
app:layout_constraintRight_toRightOf="parent"
android:progressDrawable="@drawable/bus_progress_bar_bg" />
android:progress="0"
android:progressDrawable="@drawable/bus_progress_bar_bg"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.mogo.och.common.module.wigets.OCHBorderShadowLayout>
<com.mogo.och.common.module.wigets.OCHBorderShadowLayout
android:id="@+id/liveShadow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/bus_p_curent_station_panel_margin_left"
android:visibility="gone"
app:bgColor="@android:color/transparent"
app:blurRadius="@dimen/dp_30"
app:layout_constraintBottom_toBottomOf="@+id/arrive_station_shadow"
@@ -171,7 +165,8 @@
app:shadowColor="@color/bus_p_panel_edge_shadow"
app:shadowRadius="@dimen/dp_30"
app:xOffset="0dp"
app:yOffset="0dp">
app:yOffset="0dp"
tools:visibility="visible">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="wrap_content"
@@ -179,6 +174,7 @@
android:background="@drawable/bus_p_panel_cur_station_panel">
<com.mogo.eagle.core.function.hmi.ui.widget.DriverMonitorView
android:id="@+id/driverMonitorView"
android:layout_width="@dimen/bus_p_live_station_panel_width"
android:layout_height="@dimen/bus_p_curent_station_panel_height" />
</androidx.appcompat.widget.LinearLayoutCompat>
@@ -203,10 +199,17 @@
<com.mogo.eagle.core.function.hmi.ui.msgbox.BusPassengerMsgBoxBubbleView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintRight_toLeftOf="@+id/bus_p_route_panel"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginRight="@dimen/dp_40"
android:layout_marginTop="@dimen/dp_100"
/>
android:layout_marginRight="@dimen/dp_40"
app:layout_constraintRight_toLeftOf="@+id/bus_p_route_panel"
app:layout_constraintTop_toTopOf="parent" />
<!--pnc行为决策-->
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_100"
android:layout_marginBottom="@dimen/dp_110"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -19,70 +19,70 @@ class ANRFix {
companion object {
@JvmStatic
@TargetClass(value = "android.os.Handler", scope = ALL)
@TargetMethod(methodName = "post")
@ReplaceInvoke
fun handlerPostProxy(handler: Handler, action: Runnable): Boolean {
if (Looper.getMainLooper() != handler.looper) {
return handler.post(action)
}
val what = ObjectHashCodeUtils.getHashCodeIfNeed(action)
handler.removeMessages(what)
val msg = Message.obtain(handler, action)
msg.what = what
return handler.sendMessage(msg)
}
@JvmStatic
@TargetClass(value = "android.os.Handler", scope = ALL)
@TargetMethod(methodName = "postDelayed")
@ReplaceInvoke
fun handlerPostDelayProxy(handler: Handler, action: Runnable, delayMillis: Long): Boolean {
if (Looper.getMainLooper() != handler.looper) {
return handler.postDelayed(action, delayMillis)
}
val what = ObjectHashCodeUtils.getHashCodeIfNeed(action)
handler.removeMessages(what)
val msg = Message.obtain(handler, action)
msg.what = what
return handler.sendMessageDelayed(msg, delayMillis)
}
@JvmStatic
@TargetClass(value = "android.app.Activity", scope = ALL)
@TargetMethod(methodName = "post")
@ReplaceInvoke
fun runOnUiThreadOfActivityProxy(activity: Activity, action: Runnable) {
if (Looper.myLooper() != Looper.getMainLooper()) {
UiThreadHandler.post(action)
} else {
activity.runOnUiThread(action)
}
}
@JvmStatic
@TargetClass(value = "android.view.View", scope = ALL)
@TargetMethod(methodName = "post")
@ReplaceInvoke
fun postOfViewProxy(view: View, action: Runnable): Boolean {
return if (Looper.myLooper() != Looper.getMainLooper()) {
UiThreadHandler.post(action)
} else {
view.post(action)
}
}
@JvmStatic
@TargetClass(value = "android.view.View", scope = ALL)
@TargetMethod(methodName = "postDelayed")
@ReplaceInvoke
fun postDelayedOfViewProxy(view: View, action: Runnable, delayMillis: Long): Boolean {
return if (Looper.myLooper() != Looper.getMainLooper()) {
UiThreadHandler.postDelayed(action, delayMillis)
} else {
view.postDelayed(action, delayMillis)
}
}
// @JvmStatic
// @TargetClass(value = "android.os.Handler", scope = ALL)
// @TargetMethod(methodName = "post")
// @ReplaceInvoke
// fun handlerPostProxy(handler: Handler, action: Runnable): Boolean {
// if (Looper.getMainLooper() != handler.looper) {
// return handler.post(action)
// }
// val what = ObjectHashCodeUtils.getHashCodeIfNeed(action)
// handler.removeMessages(what)
// val msg = Message.obtain(handler, action)
// msg.what = what
// return handler.sendMessage(msg)
// }
//
// @JvmStatic
// @TargetClass(value = "android.os.Handler", scope = ALL)
// @TargetMethod(methodName = "postDelayed")
// @ReplaceInvoke
// fun handlerPostDelayProxy(handler: Handler, action: Runnable, delayMillis: Long): Boolean {
// if (Looper.getMainLooper() != handler.looper) {
// return handler.postDelayed(action, delayMillis)
// }
// val what = ObjectHashCodeUtils.getHashCodeIfNeed(action)
// handler.removeMessages(what)
// val msg = Message.obtain(handler, action)
// msg.what = what
// return handler.sendMessageDelayed(msg, delayMillis)
// }
//
// @JvmStatic
// @TargetClass(value = "android.app.Activity", scope = ALL)
// @TargetMethod(methodName = "post")
// @ReplaceInvoke
// fun runOnUiThreadOfActivityProxy(activity: Activity, action: Runnable) {
// if (Looper.myLooper() != Looper.getMainLooper()) {
// UiThreadHandler.post(action)
// } else {
// activity.runOnUiThread(action)
// }
// }
//
// @JvmStatic
// @TargetClass(value = "android.view.View", scope = ALL)
// @TargetMethod(methodName = "post")
// @ReplaceInvoke
// fun postOfViewProxy(view: View, action: Runnable): Boolean {
// return if (Looper.myLooper() != Looper.getMainLooper()) {
// UiThreadHandler.post(action)
// } else {
// view.post(action)
// }
// }
//
// @JvmStatic
// @TargetClass(value = "android.view.View", scope = ALL)
// @TargetMethod(methodName = "postDelayed")
// @ReplaceInvoke
// fun postDelayedOfViewProxy(view: View, action: Runnable, delayMillis: Long): Boolean {
// return if (Looper.myLooper() != Looper.getMainLooper()) {
// UiThreadHandler.postDelayed(action, delayMillis)
// } else {
// view.postDelayed(action, delayMillis)
// }
// }
}
}

View File

@@ -107,6 +107,10 @@ class FuncBizProvider : IMoGoFuncBizProvider {
OverViewDataManager.getAllV2XEventsByLineId(MoGoAiCloudClientConfig.getInstance().sn)
}
override fun stopQueryV2XEvents() {
OverViewDataManager.stopQueryV2XEvents()
}
override fun queryV2XEvents() {
if ((AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) && !FunctionBuildConfig.isNewV2NData)
|| AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {

View File

@@ -2,13 +2,13 @@ package com.mogo.eagle.function.biz.v2x.road
import android.content.Context
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.constants.HostConst.DATA_CENTER_HOST
import com.mogo.commons.constants.HostConst.getEagleHost
import com.mogo.eagle.core.data.v2x.LineUploadData
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.network.MoGoRetrofitFactory
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.function.biz.v2x.V2XBizTrace
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
@@ -48,6 +48,7 @@ class LineUploadManager private constructor(context: Context) : IMoGoAutopilotSt
override fun onAutopilotRouteLineId(lineId: Long) {
super.onAutopilotRouteLineId(lineId)
V2XBizTrace.onAck("onAutopilotRouteLineId", "lineId: $lineId")
if (lineId > 0) {
uploadLine(lineId)
}

View File

@@ -37,7 +37,7 @@ public class V2XAlarmServer {
CopyOnWriteArrayList<V2XRoadEventEntity> v2XRoadEventEntityList,
MogoLocation currentLocation) {
try {
//Logger.d(TAG, "getDriveFrontAlarmEvent --- 1 ---" + currentLocation );
Logger.d(TAG, "getDriveFrontAlarmEvent --- 1 ---" + currentLocation );
if (!showedEvents.isEmpty()) {
Iterator<V2XRoadEventEntity> iterator = showedEvents.iterator();
while (iterator.hasNext()) {
@@ -54,7 +54,7 @@ public class V2XAlarmServer {
}
}
}
//Logger.d(TAG, "getDriveFrontAlarmEvent --- 2 ---" + currentLocation);
Logger.d(TAG, "getDriveFrontAlarmEvent --- 2 ---" + currentLocation);
if (currentLocation != null && v2XRoadEventEntityList != null) {
// 因为集合是按照距离排序后的所以这里检索出来第一个就发出警告
for (V2XRoadEventEntity v2XRoadEventEntity : v2XRoadEventEntityList) {
@@ -65,7 +65,7 @@ public class V2XAlarmServer {
MarkerLocation eventLocation = v2XRoadEventEntity.getLocation();
// 1、判断是否到达了触发距离,20 ~ 500,
double distance = v2XRoadEventEntity.getDistance();
//Logger.d(TAG, "distance:" + distance);
Logger.d(TAG, "distance:" + distance + ",poiType:" + v2XRoadEventEntity.getPoiType());
if (distance <= 500) {
if (EventTypeEnumNew.GHOST_PROBE.getPoiType().equals(v2XRoadEventEntity.getPoiType())) {
if (distance > 25) {
@@ -76,8 +76,8 @@ public class V2XAlarmServer {
double carBearing = currentLocation.getHeading();
double eventBearing = eventLocation.getAngle();
double diffAngle = DrivingDirectionUtils.getAngleDiff(carBearing, eventBearing);
//Logger.d(TAG, "car_bearing:" + carBearing + ",eventBearing:" + eventBearing + ",diffAngle:" + diffAngle);
if (diffAngle <= 20) {
Logger.d(TAG, "car_bearing:" + carBearing + ",eventBearing:" + eventBearing + ",diffAngle:" + diffAngle);
if (diffAngle <= 30) {
// 3、计算当前车辆行驶方向与事件位置之间夹角《20度保证道路事件在车辆前方
double eventAngle = DrivingDirectionUtils.getDegreeOfCar2Poi(
currentLocation.getLongitude(),
@@ -87,12 +87,12 @@ public class V2XAlarmServer {
(int) currentLocation.getHeading()
);
//Logger.d(TAG, "eventAngle:" + eventAngle);
if (0 <= eventAngle && eventAngle <= 20) {
Logger.d(TAG, "eventAngle:" + eventAngle);
if (0 <= eventAngle && eventAngle <= 25) {
if (showedEvents.contains(v2XRoadEventEntity)) {
return null;
}
//Logger.d(TAG, "showed---");
Logger.d(TAG, "showed---");
showedEvents.add(v2XRoadEventEntity);
return v2XRoadEventEntity;
}

View File

@@ -18,6 +18,7 @@ import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager.saveMsgBox
import com.mogo.eagle.core.utilcode.mogo.*
import com.mogo.eagle.core.utilcode.mogo.logger.*
import com.mogo.eagle.core.utilcode.util.*
import com.mogo.eagle.function.biz.v2x.V2XBizTrace
import com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.airoad.*
import com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.airoad.AiRoadMarker.Marker
import mogo.telematics.pad.MessagePad.Header
@@ -56,7 +57,7 @@ internal object V2NIdentifyDrawer {
AiRoadMarker().apply {
val poiType = getPoiType(itx.type).poiType
val polygon = itx.polygonList.map { Pair.create(it.longitude, it.latitude) }
marker(Marker(id, poiType, itx.longitude, itx.latitude, itx.heading, polygon, null,
marker(Marker(id, poiType, itx.latitude,itx.longitude, itx.heading, polygon, null,
V2XRoadEventEntity().also { e ->
e.poiType = poiType
e.location = MarkerLocation().also { l ->
@@ -111,7 +112,7 @@ internal object V2NIdentifyDrawer {
AiRoadMarker.aiMakers.getOrPut(id) {
AiRoadMarker().apply {
val poiType = getPoiType(itx.eventType).poiType
marker(Marker(id, poiType, lon, lat, car.heading, null, null,
marker(Marker(id, poiType, lat, lon, car.heading, null, null,
V2XRoadEventEntity().also { e ->
e.poiType = poiType
e.location = MarkerLocation().also { l ->
@@ -199,8 +200,15 @@ internal object V2NIdentifyDrawer {
override fun onAutopilotIdentifyDataUpdate(trafficData: List<TrackedObject>?) {
super.onAutopilotIdentifyDataUpdate(trafficData)
val shiGong = trafficData?.filter { it.type == 501 || it.type == 502 }
try {
if (trafficData != null) {
V2XBizTrace.onAck("onAutopilotIdentifyDataUpdate", trafficData)
}
} catch (t: Throwable) {
t.printStackTrace()
}
Logger.d(TAG, "--- onAutopilotIdentifyDataUpdate -- : trafficData: ${ trafficData?.joinToString(",") }")
val shiGong = trafficData?.filter { it.type == 501 || it.type == 502 }
if (shiGong != null && shiGong.isNotEmpty()) {
drawShiGong(shiGong)
}
@@ -212,6 +220,13 @@ internal object V2NIdentifyDrawer {
override fun onAutopilotV2nCongestionEvent(header: Header, rsi: RSI_PB) {
super.onAutopilotV2nCongestionEvent(header, rsi)
Logger.d(TAG, "--- onAutopilotV2nCongestionEvent -- : rsi: ${ GsonUtils.toJson(rsi) }")
try {
V2XBizTrace.onAck("onAutopilotV2nCongestionEvent", rsi)
} catch (t: Throwable) {
t.printStackTrace()
}
rsi.rsiFrame?.rtes?.rteDataList?.filter {
it.eventType == 102
}?.takeIf {

View File

@@ -4,6 +4,7 @@ import android.animation.ArgbEvaluator
import android.graphics.Color
import android.os.Handler
import android.os.Looper
import android.util.Log
import android.view.animation.DecelerateInterpolator
import androidx.core.util.Pair
import com.mogo.eagle.core.data.map.MogoLatLng
@@ -88,6 +89,7 @@ class AiRoadMarker {
300f
)
//施工中心点后方的自车行驶方向上300米距离
Log.d(TAG, "--- marker --- 3 --- l1:$l1")
V2XBizTrace.onAck("$TAG --- marker --- 3 --- l1:", l1)
val l2 = MogoMap.getInstance().mogoMap.getCenterLineRangeInfo(
marker.poi_lon,
@@ -96,9 +98,11 @@ class AiRoadMarker {
-300f
)
if (l1.points.isEmpty() || l2.points.isEmpty()) {
Log.d(TAG, " --- marker --- 3 --- return ----")
V2XBizTrace.onAck("$TAG --- marker --- 3 --- return ----", "")
return
}
Log.d(TAG, " --- marker --- 4 --- l2: $l2")
V2XBizTrace.onAck("$TAG --- marker --- 4 --- l2:", l2)
val points = LinkedList<MogoLatLng>()
if (l2 != null && l2.points.isNotEmpty()) {
@@ -108,6 +112,7 @@ class AiRoadMarker {
}
val centerX = marker.poi_lon
val centerY = marker.poi_lat
Log.d(TAG, "--- marker --- 5 --- marker: $marker")
V2XBizTrace.onAck("$TAG --- marker --- 5 --- marker:", marker)
val farthestPoint = marker.polygon?.let {
var find: Pair<Double, Double> = Pair(centerX, centerY)
@@ -128,6 +133,7 @@ class AiRoadMarker {
MogoLatLng(find.second, find.first)
} ?: MogoLatLng(centerY, centerX)
marker.farthestPoint = Pair(farthestPoint.lon, farthestPoint.lat)
Log.d(TAG, "--- marker --- 6 --- marker:$marker")
V2XBizTrace.onAck("$TAG --- marker --- 6 --- marker:", marker)
if (l1 != null && l1.points.isNotEmpty()) {
for (l in l1.points) {
@@ -160,6 +166,7 @@ class AiRoadMarker {
var line = line.get()
options.points(points)
options.colorValues(colors)
Log.d(TAG, "--- marker --- 7 --- points:${points.size}")
V2XBizTrace.onAck("$TAG --- marker --- 7 --- points:", "${points.size}")
if (line == null || line.isDestroyed) {
val l = overlayManager?.addPolyline(options)
@@ -183,8 +190,10 @@ class AiRoadMarker {
private fun removeLine() {
val old = line.get()
Log.d(TAG, " --- removeRedLine --- 1")
V2XBizTrace.onAck("$TAG --- removeRedLine --- 1", "")
if (old != null) {
Log.d(TAG,"--- removeRedLine --- 2")
V2XBizTrace.onAck("$TAG --- removeRedLine --- 2", "")
line.set(null)
old.isVisible = false
@@ -193,6 +202,7 @@ class AiRoadMarker {
}
private fun unMarker(marker: Marker) {
Log.d(TAG,"$TAG --- unMarker ---")
V2XBizTrace.onAck("$TAG --- unMarker ---", "")
this.marker.set(null)
removeLine()
@@ -202,11 +212,13 @@ class AiRoadMarker {
}
fun receive() {
Log.d(TAG, " --- receive --- 1 ---")
V2XBizTrace.onAck("$TAG --- receive --- 1 ---", "")
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)
Log.d(TAG ," --- receive --- 2 ---car:[${car.longitude}, ${car.latitude}] -> poi:[${poi.poi_lon}, ${poi.poi_lat}] --> distance:$distance")
V2XBizTrace.onAck(
"$TAG --- receive --- 2 ---",
"car:[${car.longitude}, ${car.latitude}] -> poi:[${poi.poi_lon}, ${poi.poi_lat}] --> distance:$distance"
@@ -214,6 +226,7 @@ class AiRoadMarker {
if (distance < 500) {
checkExpired()
} else {
unMarker(poi)
handler.removeCallbacks(checkExpiredTask)
}
} else {

View File

@@ -149,6 +149,11 @@ class TeleMsgHandler : IMsgHandler {
CallerTelematicListenerManager.invokeReceivedMsg(TelematicConstant.OPEN_ROMA_STATUS,it.body)
}
}
TelematicConstant.CONTROL_PASSENGER_DRIVER_MONITOR -> {
ThreadUtils.runOnUiThread {
CallerTelematicListenerManager.invokeReceivedMsg(TelematicConstant.CONTROL_PASSENGER_DRIVER_MONITOR,it.body)
}
}
else -> {
}
}

View File

@@ -60,7 +60,7 @@ class UpgradeAppNetWorkManager private constructor() {
provider?.recordUpgradeRecord(sn ?: "", macAddress, type, FunctionBuildConfig.isSupportPatchUpgrade)
provider?.recordUpgradeRequestStart()
val info = mUpgradeApiService.getUpgradeInfo(requestBody)
SharedPrefsMgr.getInstance(context).putString(SharedPrefsConstants.APP_UPGRADE_CONTENT, if (info.result != null) GsonUtils.toJson(info) + "--mac:$macAddress --type:$type --sn:$sn --versionName:$versionName" else "info.result == null --mac:$macAddress --type:$type --sn:$sn --versionName:$versionName")
SharedPrefsMgr.getInstance(context).putString(SharedPrefsConstants.APP_UPGRADE_CONTENT, if (info.result != null) GsonUtils.toJson(info) + "--mac:$macAddress --type:$type --sn:$sn --versionName:$versionName" else "info.result == null --mac:$macAddress --type:$type --sn:$sn --versionName:$versionName --versionCode:$versionCode")
if (info.result != null) {
provider?.recordUpgradeRequestSuccess(GsonUtils.toJson(info))
doUpgrade(info)

View File

@@ -2,6 +2,7 @@ package com.zhjt.mogo_core_function_devatools.upgrade
import android.content.Context
import android.content.pm.PackageInstaller
import android.util.Log
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.function.api.upgrade.IMoGoUpgradeProvider
import com.mogo.eagle.core.function.call.base.CallerBase
@@ -52,7 +53,7 @@ class UpgradeManager : IDownload {
fun downLoadPackage(context: Context, type: DownloadType, downloadKey: String, downloadUrl: String) {
CallerLogger.d("${SceneConstant.M_OBU}${MogoObuConst.TAG_UPGRADE_OBU}", "UpgradeManager downLoadPackage = " + downloadUrl.contains(".zip") + "----downloadKey = $downloadKey ---downloadUrl = $downloadUrl")
CallerLogger.d("$M_DEVA$TAG", "UpgradeManager downLoadPackage = " + downloadUrl.contains(".zip") + "---type =" + type + "----downloadKey = $downloadKey ---downloadUrl = $downloadUrl")
types[downloadUrl] = type
DownloadUtils.downLoad(
context,
@@ -229,10 +230,17 @@ class UpgradeManager : IDownload {
CallerDevaToolsUpgradeListenerManager.addListener(
TAG,
object : IMogoDevaToolsUpgradeListener {
override fun onStart(url: String?) {}
override fun onPause(url: String?) {}
override fun onStart(url: String?) {
CallerLogger.d("$M_DEVA$TAG", "updateUpgradeProgress onStart ----> ")
}
override fun onPause(url: String?) {
CallerLogger.d("$M_DEVA$TAG", "updateUpgradeProgress onPause ----> ")
}
override fun onProgress(url: String?, length: Int) {
updateStatusBarDownloadView(true, "download", length)
// CallerLogger.d("$M_DEVA$TAG", "updateUpgradeProgress onPause ----> length = $length")
if (length in 1..99) {
updateStatusBarDownloadView(true, "download", length)
}
}
override fun onFinished(url: String?, localPath: String) {
@@ -242,6 +250,10 @@ class UpgradeManager : IDownload {
}
override fun onError(url: String?, errorMsg: String?) {
CallerLogger.d("$M_DEVA$TAG", "updateUpgradeProgress errorMsg = $errorMsg")
Log.e(TAG, "updateUpgradeProgress errorMsg = $errorMsg")
//出错后去掉下载进度ui提示检查网络
updateStatusBarDownloadView(false, "download", 0)
}
})
}

View File

@@ -52,7 +52,7 @@ class BusPassengerMsgBoxBubbleView @JvmOverloads constructor(
}
override fun onDataChanged(category: MsgCategory, msgBoxList: MsgBoxBean){
UiThreadHandler.post{
UiThreadHandler.post({
if(category == MsgCategory.NOTICE){
if(msgBoxList.type == MsgBoxType.NOTICE || msgBoxList.type == MsgBoxType.V2X
|| msgBoxList.type == MsgBoxType.OBU || msgBoxList.type == MsgBoxType.OPERATION){
@@ -65,7 +65,7 @@ class BusPassengerMsgBoxBubbleView @JvmOverloads constructor(
}
}
}
}
},UiThreadHandler.MODE.QUEUE)
}
override fun onAttachedToWindow() {

View File

@@ -70,7 +70,7 @@ class DriverMsgBoxBubbleView @JvmOverloads constructor(
}
override fun onDataChanged(category: MsgCategory, msgBoxBean: MsgBoxBean) {
UiThreadHandler.post {
UiThreadHandler.post({
when (category) {
MsgCategory.NOTICE -> {
MsgBoxConfig.noticeList.add(msgBoxBean)
@@ -98,7 +98,7 @@ class DriverMsgBoxBubbleView @JvmOverloads constructor(
driverMsgBoxBubbleAdapter?.setData(dataList)
}
}
}
}, UiThreadHandler.MODE.QUEUE)
}
override fun onAttachedToWindow() {

View File

@@ -171,7 +171,7 @@ class DriverMsgBoxListView @JvmOverloads constructor(
}
override fun onDataChanged(category: MsgCategory, msgBoxList: MsgBoxBean) {
UiThreadHandler.post{
UiThreadHandler.post({
when (category) {
MsgCategory.NOTICE -> {
noticeList?.add(0,msgBoxList)
@@ -192,7 +192,7 @@ class DriverMsgBoxListView @JvmOverloads constructor(
}
}
}
}
},UiThreadHandler.MODE.QUEUE)
}
override fun onAttachedToWindow() {

View File

@@ -55,7 +55,7 @@ class MBoxBubbleView @JvmOverloads constructor(
}
override fun onDataChanged(category: MsgCategory, msgBoxList: MsgBoxBean) {
UiThreadHandler.post {
UiThreadHandler.post({
if(category == MsgCategory.NOTICE){
if(msgBoxList.type == MsgBoxType.NOTICE || msgBoxList.type == MsgBoxType.V2X
|| msgBoxList.type == MsgBoxType.OBU || msgBoxList.type == MsgBoxType.OPERATION){
@@ -68,7 +68,7 @@ class MBoxBubbleView @JvmOverloads constructor(
}
}
}
}
},UiThreadHandler.MODE.QUEUE)
}
override fun onAttachedToWindow() {

View File

@@ -49,14 +49,14 @@ class MMsgBoxBubbleView @JvmOverloads constructor(
}
override fun onDataChanged(category: MsgCategory, msgBoxList: MsgBoxBean) {
UiThreadHandler.post {
UiThreadHandler.post({
if(category == MsgCategory.NOTICE){
if(msgBoxList.type == MsgBoxType.NOTICE || msgBoxList.type == MsgBoxType.V2X
|| msgBoxList.type == MsgBoxType.OBU || msgBoxList.type == MsgBoxType.OPERATION){
update(msgBoxList)
}
}
}
},UiThreadHandler.MODE.QUEUE)
}
private fun update(msgBoxList: MsgBoxBean){

View File

@@ -56,7 +56,7 @@ class MMsgBoxListView @JvmOverloads constructor(
}
override fun onDataChanged(category: MsgCategory, msgBoxList: MsgBoxBean) {
UiThreadHandler.post{
UiThreadHandler.post({
if(category == MsgCategory.NOTICE){
if(msgBoxList.type == MsgBoxType.NOTICE || msgBoxList.type == MsgBoxType.V2X
|| msgBoxList.type == MsgBoxType.OBU || msgBoxList.type == MsgBoxType.OPERATION){
@@ -66,7 +66,7 @@ class MMsgBoxListView @JvmOverloads constructor(
}
}
}
}
},UiThreadHandler.MODE.QUEUE)
}
override fun onAttachedToWindow() {

View File

@@ -57,7 +57,7 @@ class PassengerMsgBoxBubbleView @JvmOverloads constructor(
}
override fun onDataChanged(category: MsgCategory, msgBoxList: MsgBoxBean) {
UiThreadHandler.post {
UiThreadHandler.post({
if(category == MsgCategory.NOTICE){
if(msgBoxList.type == MsgBoxType.NOTICE || msgBoxList.type == MsgBoxType.V2X
|| msgBoxList.type == MsgBoxType.OBU){
@@ -70,7 +70,7 @@ class PassengerMsgBoxBubbleView @JvmOverloads constructor(
}
}
}
}
},UiThreadHandler.MODE.QUEUE)
}
override fun onAttachedToWindow() {

View File

@@ -60,7 +60,7 @@ class PassengerMsgBoxListView @JvmOverloads constructor(
}
override fun onDataChanged(category: MsgCategory, msgBoxList: MsgBoxBean) {
UiThreadHandler.post{
UiThreadHandler.post({
if(category == MsgCategory.NOTICE){
if(msgBoxList.type == MsgBoxType.NOTICE || msgBoxList.type == MsgBoxType.V2X
|| msgBoxList.type == MsgBoxType.OBU){
@@ -70,7 +70,7 @@ class PassengerMsgBoxListView @JvmOverloads constructor(
}
}
}
}
},UiThreadHandler.MODE.QUEUE)
}
override fun onAttachedToWindow() {

View File

@@ -45,6 +45,7 @@ import com.mogo.eagle.core.data.map.MogoLocation
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
@@ -581,6 +582,17 @@ internal class DebugSettingView @JvmOverloads constructor(
}
}
/**
* 控制乘客屏直播监控
*/
tbControlPassengerDriverMonitor.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) {
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.CONTROL_PASSENGER_DRIVER_MONITOR, "1".toByteArray())
} else {
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.CONTROL_PASSENGER_DRIVER_MONITOR, "0".toByteArray())
}
}
//设置鹰眼本地参数配置监听
setEagleEyeConfigListener()
//域控制器中心事件点击监听

View File

@@ -5,6 +5,7 @@ import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
@@ -31,6 +32,10 @@ class TakeOverView @JvmOverloads constructor(
const val TAG = "TakeOverView"
}
private var autopilotStatus: Int = 0 //自动驾驶状态 0代表不可自动驾驶,1代表可自动驾驶,2代表自动驾驶中,7:平行驾驶中
private var isParallel: Boolean = false //是否是平行驾驶
init {
LayoutInflater.from(context).inflate(R.layout.view_take_over, this, true)
}
@@ -42,6 +47,20 @@ class TakeOverView @JvmOverloads constructor(
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
}
/**
* 自动驾驶状态信息
*
* @param autoPilotStatusInfo 状态信息
*/
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
autopilotStatus = autoPilotStatusInfo.state
if(autoPilotStatusInfo.state == 7){
isParallel = true
}else if(autoPilotStatusInfo.state == 0 || autoPilotStatusInfo.state == 1){
isParallel = false
}
}
/**
* 工控机监控节点上报
*/
@@ -84,38 +103,41 @@ class TakeOverView @JvmOverloads constructor(
takeOver = false
visibility = View.GONE
}
},isFromObu = false
)
}
,isFromObu = false)
}
//弱网
MogoReport.Code.Error.EMAP.EPARALLEL_AICLOUD_NETWORK_WEAK,
MogoReport.Code.Error.EMAP.EPARALLEL_AICLOUD_CONNECTION_ERROR -> {
CallerHmiManager.warningV2X(
EventTypeEnumNew.NETWORK_WEAK_EVENT.poiType,
EventTypeEnumNew.NETWORK_WEAK_EVENT.content,
EventTypeEnumNew.NETWORK_WEAK_EVENT.tts,
object : IMoGoWarningStatusListener {
override fun onShow() {
takeOver = true
visibility = View.VISIBLE
//加入消息盒子
saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X, V2XMsg(
EventTypeEnumNew.NETWORK_WEAK_EVENT.poiType,
EventTypeEnumNew.NETWORK_WEAK_EVENT.content,
EventTypeEnumNew.NETWORK_WEAK_EVENT.tts
//如果是平行驾驶状态下,提示弱网接管
if(isParallel){
CallerHmiManager.warningV2X(
EventTypeEnumNew.NETWORK_WEAK_EVENT.poiType,
EventTypeEnumNew.NETWORK_WEAK_EVENT.content,
EventTypeEnumNew.NETWORK_WEAK_EVENT.tts,
object : IMoGoWarningStatusListener {
override fun onShow() {
takeOver = true
visibility = View.VISIBLE
//加入消息盒子
saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X, V2XMsg(
EventTypeEnumNew.NETWORK_WEAK_EVENT.poiType,
EventTypeEnumNew.NETWORK_WEAK_EVENT.content,
EventTypeEnumNew.NETWORK_WEAK_EVENT.tts
)
)
)
)
}
}
override fun onDismiss() {
takeOver = false
visibility = View.GONE
override fun onDismiss() {
takeOver = false
visibility = View.GONE
}
}
},isFromObu = false
)
,isFromObu = false)
}
}
}
}

View File

@@ -15,7 +15,10 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.widget.RoundConstraintLayout
import kotlinx.android.synthetic.main.view_driver_monitor.view.*
import kotlinx.android.synthetic.main.view_driver_monitor.view.ivNormal
import kotlinx.android.synthetic.main.view_driver_monitor.view.liveProgressBar
import kotlinx.android.synthetic.main.view_driver_monitor.view.textureViewDriverMonitor
import kotlinx.android.synthetic.main.view_driver_monitor.view.tvLoadingHit
/**
* 乘客端查看当前车辆驾驶舱的司机监控View
@@ -56,6 +59,8 @@ class DriverMonitorView :
)
}
var liveListener: LiveListener? = null
constructor(context: Context?) : super(context) {
initView(context)
}
@@ -110,26 +115,41 @@ class DriverMonitorView :
fun showLive() {
if (!isLived) {
// sopShowDriverMap[CallerTelematicManager.getServerToken()]?.let {
// Logger.d(
// "${SceneConstant.M_HMI}$TAG",
// "检查司机直播……isLived=$isLived 当前车上的司机端SN=${sopShowDriverMap[CallerTelematicManager.getServerToken()]}"
// )
// CallerLogger.d(
// "${SceneConstant.M_HMI}$TAG",
// "检查司机直播……isLived=$isLived 当前车上的司机端SN=${sopShowDriverMap[CallerTelematicManager.getServerToken()]}"
// )
// MoGoAiCloudTrafficLive.viewDesignativeVehicleLive(
// it,
// textureViewDriverMonitor,
// carLiveCallBack
// )
// }
MoGoAiCloudTrafficLive.viewDesignativeVehicleLive(
"F803EB2046PZD00164",
textureViewDriverMonitor,
carLiveCallBack
)
sopShowDriverMap[CallerTelematicManager.getServerToken()]?.let {
Logger.d(
"${SceneConstant.M_HMI}$TAG",
"检查司机直播……isLived=$isLived 当前车上的司机端SN=${sopShowDriverMap[CallerTelematicManager.getServerToken()]}"
)
CallerLogger.d(
"${SceneConstant.M_HMI}$TAG",
"检查司机直播……isLived=$isLived 当前车上的司机端SN=${sopShowDriverMap[CallerTelematicManager.getServerToken()]}"
)
MoGoAiCloudTrafficLive.viewDesignativeVehicleLive(
it,
textureViewDriverMonitor,
carLiveCallBack
)
} ?: let {
//为空又怎么撸
if (CallerTelematicManager.getServerToken().isNotEmpty()) {
Logger.d(
"${SceneConstant.M_HMI}$TAG",
"检查司机直播……isLived=$isLived 当前车辆SN=${CallerTelematicManager.getServerToken()} 不支持直播"
)
CallerLogger.d(
"${SceneConstant.M_HMI}$TAG",
"检查司机直播……isLived=$isLived 当前车辆SN=${CallerTelematicManager.getServerToken()} 不支持直播"
)
// 乘客屏幕连接上了司机屏,但是司机屏不在直播范围内,进行隐藏操作。
liveListener?.onPlayError()
}
}
// TODO 测试用的
// MoGoAiCloudTrafficLive.viewDesignativeVehicleLive(
// "F803EB2046PZD00164",
// textureViewDriverMonitor,
// carLiveCallBack
// )
}
}
@@ -185,4 +205,8 @@ class DriverMonitorView :
}
}
interface LiveListener {
fun onPlayError()
}
}

View File

@@ -25,6 +25,9 @@ class RomaPassengerView @JvmOverloads constructor(
@Volatile
private var romaMode = false
@Volatile
private var click = true
private val openRes: Int
private val normalRes: Int
@@ -36,10 +39,16 @@ class RomaPassengerView @JvmOverloads constructor(
normalRes = a.getResourceId(R.styleable.RomaPassengerView_roma_close, 0)
a.recycle()
setOnClickListener {
if(!click){
return@setOnClickListener
}
click = false
romaMode = !romaMode
romaTrigger(romaMode) { mode ->
click = true
romaMode = mode
}
}
}
@@ -65,6 +74,7 @@ class RomaPassengerView @JvmOverloads constructor(
}
override fun romaStatus(status: Boolean) {
click = true
if (status) {
romaMode = true
if (openRes != 0) {

View File

@@ -24,9 +24,16 @@ class RomaView @JvmOverloads constructor(
@Volatile
private var romaMode = false
@Volatile
private var click = false
init {
LayoutInflater.from(context).inflate(R.layout.view_roma_bg, this, true)
setOnClickListener {
if(!click){
return@setOnClickListener
}
click = false
romaMode = !romaMode
// 司机屏发送事件给乘客屏
if (romaMode) {
@@ -49,6 +56,7 @@ class RomaView @JvmOverloads constructor(
}
override fun onReceivedMsg(type: Int, byteArray: ByteArray) {
click = true
when(type){
TelematicConstant.OPEN_ROMA_STATUS -> {
when (String(byteArray)) {

View File

@@ -143,6 +143,7 @@ class SystemVersionView @JvmOverloads constructor(
ToastUtils.showShort(resources.getString(R.string.location_try_again))
} else {// 拿到了高精的经纬度
val dialog = OfflineMapDialog(context)
CallerLogger.i("$M_HMI$$TAG", "location lon is:${location?.longitude}, lat is:${location?.latitude}")
dialog.location = location
dialog.show()
}

View File

@@ -1355,8 +1355,8 @@
android:background="@drawable/setting_toggle_button_background"
android:drawableEnd="@drawable/icon_right"
android:padding="@dimen/dp_20"
android:textOff="HMI控制"
android:textOn="HMI控制"
android:textOff="打开HMI控制"
android:textOn="关闭HMI控制"
android:textSize="@dimen/dp_24" />
<GridLayout
@@ -1367,6 +1367,20 @@
android:visibility="gone"
tools:visibility="visible">
<ToggleButton
android:id="@+id/tbControlPassengerDriverMonitor"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_columnWeight="1"
android:layout_margin="2dp"
android:gravity="center"
android:textOff="开启乘客屏直播监控"
android:textOn="关闭乘客屏直播监控"
android:padding="@dimen/dp_20"
android:textSize="@dimen/dp_24"
app:layout_constraintLeft_toRightOf="@+id/tbChangeCurrentCarIcon"
app:layout_constraintTop_toTopOf="@id/tbChangeCurrentCarIcon" />
<ToggleButton
android:id="@+id/tbChangeCurrentSkinMode"
android:layout_width="wrap_content"

View File

@@ -128,17 +128,14 @@ class AiCloudIdentifyDataManager : IMogoMapListener, IReceivedMsgListener,
private fun openRoma() {
if (!MogoMapUIController.getInstance().currentMapVisualAngle.isRoma) {
requestRangeOfIdentify(true)
updateLongSightLevel(true)
requestRangeOfIdentify(true)
}
}
private fun closeRoma(manual: Boolean = true) {
if (!showAiCloud.get()) {
return
}
requestRangeOfIdentify(false)
updateLongSightLevel(false)
requestRangeOfIdentify(false)
MapIdentifySubscriber.instance.clearAiCloudRoma()
// 主动关闭roma回到中景视角
if (manual) {
@@ -157,6 +154,7 @@ class AiCloudIdentifyDataManager : IMogoMapListener, IReceivedMsgListener,
// CallerMapRomaListener.invokeMapRoma(false)
// sendMsgToServer(TelematicConstant.OPEN_ROMA_STATUS, "4".toByteArray())
// }
MapBizTrace.log(TAG,"开启请求data:$dataReceive")
aiCloudIdentifyNetWorkModel.requestIdentifyRange(dataReceive, serverSn, {
MapBizTrace.log(
TAG,
@@ -176,6 +174,9 @@ class AiCloudIdentifyDataManager : IMogoMapListener, IReceivedMsgListener,
TAG,
"requestIdentifyRange error : $it , startRange:$START_METRE, endRange:$END_METRE, dataReceive:$dataReceive"
)
updateLongSightLevel(false)
CallerMapRomaListener.invokeMapRoma(false)
sendMsgToServer(TelematicConstant.OPEN_ROMA_STATUS, "4".toByteArray())
if(DebugConfig.isDebug()){
ToastUtils.showShort("漫游请求异常msg:$it")
}
@@ -194,8 +195,8 @@ class AiCloudIdentifyDataManager : IMogoMapListener, IReceivedMsgListener,
else -> {
if (showAiCloud.get()) {
MapBizTrace.log(TAG, "onMapVisualAngleChanged, invoke close roma")
closeRoma(false)
showAiCloud.set(false)
closeRoma(false)
FunctionBuildConfig.isDrawIdentifyData = true
}
}

View File

@@ -18,7 +18,8 @@ class AiCloudIdentifyNetWorkModel private constructor(){
}
}
private fun getNetWorkApi(baseUrl: String = getEagleHost()): IAiCloudIdentifyApiService {
// private fun getNetWorkApi(baseUrl: String = getEagleHost()): IAiCloudIdentifyApiService {
private fun getNetWorkApi(baseUrl: String = "http://dzt-qa-city.zhidaozhixing.com/"): IAiCloudIdentifyApiService { //todo 2023/4/19 衡阳临时测试
return MoGoRetrofitFactory.getInstanceNoCallAdapter(baseUrl)
.create(IAiCloudIdentifyApiService::class.java)
}

View File

@@ -8,7 +8,8 @@ import retrofit2.http.POST
interface IAiCloudIdentifyApiService {
@Headers("Content-type:application/json;charset=UTF-8")
@POST("eagle-eye-dns/yycp-c-v2x-service/dataFusion/remoteDrivingSet")
// @POST("eagle-eye-dns/yycp-c-v2x-service/dataFusion/remoteDrivingSet")
// @POST("yycp-data-center-service1/remoteDrivingSet")
@POST("yycp-c-v2x-service/dataFusion/remoteDrivingSet") //todo 2023/4/19 衡阳临时测试
suspend fun identifyRange(@Body map: MutableMap<String, Any>): BaseResponse<Any>
}

View File

@@ -466,7 +466,7 @@ class OverMapView @JvmOverloads constructor(
return bitmap
}
private fun clearV2XMarkers() {
fun clearV2XMarkers() {
if (currMarkerList != null) {
for (marker in currMarkerList!!) {
marker.destroy()

View File

@@ -52,10 +52,11 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
private var context: Context? = null
@Volatile
private var gotToken = false
private var httpDnsSimpleLocation by Delegates.observable(getDefaultSimpleLocation()) { _, oldValue, newValue ->
if (oldValue.cityCode != newValue.cityCode) {
if (gotToken && oldValue.cityCode != newValue.cityCode) {
reConnectSocket(oldValue.cityCode, newValue.cityCode)
}
}

View File

@@ -12,5 +12,6 @@ class TelematicConstant {
const val HIDE_TRAFFIC_LIGHT = 102
const val OPEN_ROMA_STATUS = 103
const val ROMA_UPDATE = 104
const val CONTROL_PASSENGER_DRIVER_MONITOR = 105
}
}

View File

@@ -73,6 +73,8 @@ interface IMoGoFuncBizProvider : IMoGoFunctionServerProvider {
fun getAllV2XEvents()
fun stopQueryV2XEvents()
fun queryV2XEvents()

View File

@@ -1,16 +0,0 @@
package com.mogo.eagle.core.function.api.datacenter.obu.obucombine
import mogo.v2x.ObuWarningEvent
/**
* obu和dc 通道打通融合
*/
interface IMoGoObuDcCombineListener {
/**
* obu透传v2i数据标牌弱势交通红绿灯限速道路危险状况
* @param obuWarningData
*/
fun onMoGoObuDcCombineData(obuWarningData: ObuWarningEvent.ObuWarningData?)
}

View File

@@ -27,16 +27,12 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
if(newValue == null){
return@observable
}
M_AUTOPILOT_STATUS_LISTENERS.forEach {
M_LISTENERS.forEach {
val listener = it.value
listener.onAutopilotRouteLineId(newValue)
}
}
// 存储所有注册了监听的对象invokeXXXX进行遍历回调将信息同步
private val M_AUTOPILOT_STATUS_LISTENERS: ConcurrentHashMap<String, IMoGoAutopilotStatusListener> =
ConcurrentHashMap()
@Volatile
private var autoPilotMessageCode: String = ""

View File

@@ -1,26 +0,0 @@
package com.mogo.eagle.core.function.call.obucombine
import com.mogo.eagle.core.function.api.datacenter.obu.obucombine.IMoGoObuDcCombineListener
import com.mogo.eagle.core.function.call.base.CallerBase
import mogo.v2x.ObuWarningEvent
import java.util.concurrent.ConcurrentHashMap
/**
* obu和dc数据通道 回调监听
*/
object CallerObuDcCombineListenerManager : CallerBase<IMoGoObuDcCombineListener>() {
// 存储所有注册了监听的对象invokeXXXX进行遍历回调将信息同步
private val M_DC_COMBINE_LISTENERS: ConcurrentHashMap<String, IMoGoObuDcCombineListener> =
ConcurrentHashMap()
/**
* v2i数据
*/
fun invokeObuDcData(obuWarningData: ObuWarningEvent.ObuWarningData?){
M_DC_COMBINE_LISTENERS.forEach{
val listener = it.value
listener.onMoGoObuDcCombineData(obuWarningData)
}
}
}

View File

@@ -41,7 +41,7 @@ object CallerTelematicManager {
/**
* 发送数据给所有客户端
* type保存在TelematicConstant中
* type保存在 TelematicConstant
*/
fun sendMsgToAllClients(type: Int, byteArray: ByteArray) {
providerApi?.sendMsgToAllClients(type, byteArray)

View File

@@ -31,4 +31,10 @@ public interface DownloadCallBack {
* @param localPath
*/
void threadDownLoadFinished(String url, ThreadBean threadBean, String localPath);
/**
* 下载错误
* @param msg
*/
void errorCallBack(String url, String msg);
}

View File

@@ -161,6 +161,14 @@ public class DownloadService implements InitThread.InitCallBack, DownloadCallBac
}
}
@Override
public void errorCallBack(String url, String msg) {
IDownload iDownload = callBacks.get(url);
if (iDownload != null) {
iDownload.onError(url, msg);
}
}
@Override
public void onConnected(NetworkUtils.NetworkType networkType) {
//网络连接已连接

View File

@@ -153,6 +153,11 @@ public class DownloadTask implements DownloadCallBack {
}
}
@Override
public void errorCallBack(String url, String msg) {
UiThreadHandler.post(() -> downloadCallBack.errorCallBack(url, msg));
}
public FileBean getFileBean() {
return fileBean;
}

View File

@@ -82,6 +82,8 @@ public class DownloadThread extends Thread {
DownloadData downloadData = new DownloadData();
downloadData.setUrl(fileBean.getUrl());
downloadData.setMsg(e.getMessage());
UiThreadHandler.post(() -> callback.errorCallBack(this.fileBean.getUrl(), e.getMessage()));
// EventMessage eventMessage = new EventMessage(EventMessage.TYPE_ERROR,downloadData);
// EventBus.getDefault().post(eventMessage);
} finally {

View File

@@ -53,6 +53,18 @@ public final class ThreadUtils {
private static Executor sDeliver;
public enum MODE {
/**
* 多次post同一个Runnable对象只会执行最后一次
*/
LATEST,
/**
* 多次post在主线程消息队列中排队执行
*/
QUEUE
}
/**
* Return whether the thread is the main thread.
*
@@ -63,23 +75,40 @@ public final class ThreadUtils {
}
public static void runOnUiThread(final Runnable r) {
runOnUiThread(r, MODE.LATEST);
}
public static void runOnUiThread(final Runnable r, MODE mode) {
if (Looper.myLooper() == Looper.getMainLooper()) {
r.run();
} else {
int what = ObjectHashCodeUtils.getHashCodeIfNeed(r);
HANDLER.removeMessages(what);
Message msg = Message.obtain(HANDLER, r);
msg.what = what;
HANDLER.sendMessage(msg);
if (mode == MODE.LATEST) {
int what = ObjectHashCodeUtils.getHashCodeIfNeed(r);
HANDLER.removeMessages(what);
Message msg = Message.obtain(HANDLER, r);
msg.what = what;
HANDLER.sendMessage(msg);
} else {
HANDLER.post(r);
}
}
}
public static void runOnUiThreadDelayed(final Runnable r, long delayMillis) {
int what = ObjectHashCodeUtils.getHashCodeIfNeed(r);
HANDLER.removeMessages(what);
Message msg = Message.obtain(HANDLER, r);
msg.what = what;
HANDLER.sendMessageDelayed(msg, delayMillis);
runOnUiThreadDelayed(r, delayMillis, MODE.LATEST);
}
public static void runOnUiThreadDelayed(final Runnable r, long delayMillis, MODE mode) {
if (mode == MODE.LATEST) {
int what = ObjectHashCodeUtils.getHashCodeIfNeed(r);
HANDLER.removeMessages(what);
Message msg = Message.obtain(HANDLER, r);
msg.what = what;
HANDLER.sendMessageDelayed(msg, delayMillis);
} else {
HANDLER.postDelayed(r, delayMillis);
}
}
/**

View File

@@ -10,24 +10,58 @@ public class UiThreadHandler {
private UiThreadHandler() { }
public enum MODE {
/**
* 多次post同一个Runnable对象只会执行最后一次
*/
LATEST,
/**
* 多次post在主线程消息队列中排队执行
*/
QUEUE
}
public static boolean post( Runnable r ) {
int what = ObjectHashCodeUtils.getHashCodeIfNeed(r);
sUiHandler.removeMessages(what);
Message msg = Message.obtain(sUiHandler, r);
msg.what = what;
return sUiHandler.sendMessage(msg);
return post(r, MODE.LATEST);
}
public static boolean post(Runnable r, MODE mode) {
if (mode == MODE.LATEST) {
int what = ObjectHashCodeUtils.getHashCodeIfNeed(r);
sUiHandler.removeMessages(what);
Message msg = Message.obtain(sUiHandler, r);
msg.what = what;
return sUiHandler.sendMessage(msg);
}
return sUiHandler.post(r);
}
public static boolean postDelayed( Runnable r, long delayMillis ) {
int what = ObjectHashCodeUtils.getHashCodeIfNeed(r);
sUiHandler.removeMessages(what);
Message msg = Message.obtain(sUiHandler, r);
msg.what = what;
return sUiHandler.sendMessageDelayed(msg, delayMillis);
return postDelayed(r, delayMillis, MODE.LATEST);
}
public static boolean postDelayed( Runnable r, long delayMillis, MODE mode ) {
if (mode == MODE.LATEST) {
int what = ObjectHashCodeUtils.getHashCodeIfNeed(r);
sUiHandler.removeMessages(what);
Message msg = Message.obtain(sUiHandler, r);
msg.what = what;
return sUiHandler.sendMessageDelayed(msg, delayMillis);
}
return sUiHandler.postDelayed(r, delayMillis);
}
public static void removeCallbacks( Runnable r ) {
int what = ObjectHashCodeUtils.getHashCodeIfNeed(r);
sUiHandler.removeMessages(what);
removeCallbacks(r, MODE.LATEST);
}
public static void removeCallbacks( Runnable r, MODE mode ) {
if (mode == MODE.LATEST) {
int what = ObjectHashCodeUtils.getHashCodeIfNeed(r);
sUiHandler.removeMessages(what);
} else {
sUiHandler.removeCallbacks(r);
}
}
}

View File

@@ -63,7 +63,7 @@ bytex.ASM_API=ASM7
#SERVICE_BIZ_VERSION=1.2.4
################ 外部依赖引用 ################
# loglib
LOGLIB_VERSION=1.5.26
LOGLIB_VERSION=1.5.27
######## MogoAiCloudSDK Version ########
# 网络请求LOGLIB_VERSION
MOGO_NETWORK_VERSION=1.4.6.7

View File

@@ -1048,6 +1048,7 @@ public class AMapViewWrapper implements IMogoMapView,
public void cacheHDDataByCity(IHdCacheListener listener) {
if (mMapView.getMapAutoViewHelper() != null) {
String gdCityCode = GDLocationClient.getInstance(getContext()).getLastCityCode();
CallerLogger.INSTANCE.i(M_MAP + TAG, "gdCityCode is:" + gdCityCode);
Integer id = HDMapUtils.getHDCityCode(gdCityCode);
if (id != null) {
hdCacheListener = listener;
@@ -1090,6 +1091,7 @@ public class AMapViewWrapper implements IMogoMapView,
public void cacheHDDataByCity(IHdCacheListener listener, MogoLocation location) {
if (mMapView.getMapAutoViewHelper() != null) {
hdCacheListener = listener;
CallerLogger.INSTANCE.i(M_MAP + TAG, "location lon is:" + location.getLongitude() + ",lat is:" + location.getLatitude());
mMapView.getMapAutoViewHelper().cacheHDDataByCityByLonLat(location.getLongitude(), location.getLatitude(), new OnHdDataDownByCityListener() {
@Override
public void onMapHDDataCacheProgressByCity(int cityId, double progress) {
@@ -1128,6 +1130,7 @@ public class AMapViewWrapper implements IMogoMapView,
public boolean isCityDataCached() {
if (mMapView.getMapAutoViewHelper() != null) {
String gdCityCode = GDLocationClient.getInstance(getContext()).getLastCityCode();
CallerLogger.INSTANCE.i(M_MAP + TAG, "gdCityCode is:" + gdCityCode);
Integer id = HDMapUtils.getHDCityCode(gdCityCode);
if (id != null) {
List<CityInfo> cityInfoList = mMapView.getMapAutoViewHelper().getAllCityCode();