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:
lixiaopeng
2023-04-19 15:27:05 +08:00
29 changed files with 332 additions and 144 deletions

View File

@@ -9,13 +9,17 @@ 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;
@@ -44,6 +48,11 @@ public abstract class BusPassengerBaseFragment<V extends IView, P extends Presen
private View mLiveBtn;
private View mLiveShadow;
private DriverMonitorView driverMonitorView;
// 记录司机端是否打开了显示开关,
// 开关开启时,有视频流的车辆持续常驻展示视频流,无视频流的车辆不展示(无占位);
// 开关关闭时,无论是否有视频流,均不展示(无占位);开关默认关闭
private boolean driverToggle = false;
/**
* 改变自动驾驶状态
*
@@ -88,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

@@ -156,6 +156,7 @@
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"

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

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

@@ -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
@@ -199,6 +200,14 @@ internal object V2NIdentifyDrawer {
override fun onAutopilotIdentifyDataUpdate(trafficData: List<TrackedObject>?) {
super.onAutopilotIdentifyDataUpdate(trafficData)
try {
if (trafficData != null) {
V2XBizTrace.onAck("onAutopilotIdentifyDataUpdate", trafficData)
}
} catch (t: Throwable) {
t.printStackTrace()
}
val shiGong = trafficData?.filter { it.type == 501 || it.type == 502 }
Logger.d(TAG, "--- onAutopilotIdentifyDataUpdate -- : trafficData: ${ trafficData?.joinToString(",") }")
if (shiGong != null && shiGong.isNotEmpty()) {
@@ -212,6 +221,13 @@ internal object V2NIdentifyDrawer {
override fun onAutopilotV2nCongestionEvent(header: Header, rsi: RSI_PB) {
super.onAutopilotV2nCongestionEvent(header, rsi)
try {
V2XBizTrace.onAck("onAutopilotV2nCongestionEvent", rsi)
} catch (t: Throwable) {
t.printStackTrace()
}
rsi.rsiFrame?.rtes?.rteDataList?.filter {
it.eventType == 102
}?.takeIf {

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

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

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

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

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

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

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

@@ -1090,6 +1090,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 +1129,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();