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-18 17:24:01 +08:00
4 changed files with 90 additions and 54 deletions

View File

@@ -16,6 +16,7 @@ import com.mogo.commons.mvp.MvpFragment;
import com.mogo.commons.mvp.Presenter;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
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 +43,7 @@ public abstract class BusPassengerBaseFragment<V extends IView, P extends Presen
private View mLiveBtn;
private View mLiveShadow;
private DriverMonitorView driverMonitorView;
/**
* 改变自动驾驶状态
*
@@ -70,8 +72,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) {

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,21 +137,20 @@
<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"
@@ -171,7 +164,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 +173,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 +198,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

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

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