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

@@ -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)
}
}