Merge remote-tracking branch 'origin/dev_robotaxi-d_230912_6.1.0' into dev_robotaxi-d_230912_6.1.0

This commit is contained in:
wangmingjun
2023-09-20 18:16:38 +08:00
5 changed files with 155 additions and 20 deletions

View File

@@ -51,6 +51,7 @@ import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsFuncConfigListen
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
import com.mogo.eagle.core.function.api.datacenter.obu.IMoGoObuConnectListener
import com.mogo.eagle.core.function.api.datacenter.obu.IMoGoObuInfoListener
import com.mogo.eagle.core.function.api.setting.ISopSettingListener
import com.mogo.eagle.core.function.call.autopilot.*
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsFuncConfigListenerManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
@@ -60,6 +61,7 @@ import com.mogo.eagle.core.function.call.obu.CallerObuApiManager
import com.mogo.eagle.core.function.call.obu.CallerObuConnectListenerManager
import com.mogo.eagle.core.function.call.obu.CallerObuInfoListenerManager
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager
import com.mogo.eagle.core.function.call.setting.CallerSopSettingManager
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.ui.logcatch.ILogViewListener
@@ -118,7 +120,8 @@ internal class DebugSettingView @JvmOverloads constructor(
IMoGoChassisBrakeStateListener,
IMoGoChassisThrottleStateListener,
IMoGoSweeperFutianCleanSystemListener,
IMoGoObuInfoListener {
IMoGoObuInfoListener,
ISopSettingListener {
private val TAG = "DebugSettingView"
@@ -227,6 +230,8 @@ internal class DebugSettingView @JvmOverloads constructor(
CallerDevaToolsListenerManager.addListener(TAG, this)
//添加 底盘灯光数据 监听
CallerChassisLamplightListenerManager.addListener(TAG, this)
//雨天、美化、点云设置同步
CallerSopSettingManager.addListener(TAG,this)
//添加 业务配置监听
CallerDevaToolsFuncConfigListenerManager.registerDevaToolsFuncConfigListener(
@@ -274,6 +279,8 @@ internal class DebugSettingView @JvmOverloads constructor(
CallerChassisLamplightListenerManager.removeListener(TAG)
// 移除 obu获取信息 监听
CallerObuInfoListenerManager.removeListener(TAG)
//雨天、美化、点云设置同步
CallerSopSettingManager.removeListener(TAG)
// 移除 业务配置监听
CallerDevaToolsFuncConfigListenerManager.unRegisterDevaToolsFuncConfigListener(
@@ -685,11 +692,14 @@ internal class DebugSettingView @JvmOverloads constructor(
// 演示模式,上一次勾选的数据
tbIsDemoMode.isChecked = FunctionBuildConfig.isDemoMode
// 演示模式
tbIsDemoMode.setOnCheckedChangeListener { _, _ ->
tbIsDemoMode.setOnCheckedChangeListener { compoundButton, isChecked ->
if(!compoundButton.isPressed){
return@setOnCheckedChangeListener
}
FunctionBuildConfig.isDemoMode = !FunctionBuildConfig.isDemoMode
CallerAutoPilotControlManager.setDemoMode(FunctionBuildConfig.isDemoMode)
CallerSopSettingManager.invokeDemoModeListener(isChecked)
if (!FunctionBuildConfig.isDemoMode) {
//关闭美化模式时,通知工控机
CallerAutoPilotControlManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode)
@@ -720,9 +730,13 @@ internal class DebugSettingView @JvmOverloads constructor(
// 雨天模式,上一次勾选的数据
tbIsRainMode.isChecked = FunctionBuildConfig.isRainMode
//雨天模式
tbIsRainMode.setOnCheckedChangeListener { _, isChecked ->
tbIsRainMode.setOnCheckedChangeListener { compoundButton, isChecked ->
if(!compoundButton.isPressed){
return@setOnCheckedChangeListener
}
CallerAutoPilotControlManager.setRainMode(isChecked)
FunctionBuildConfig.isRainMode = isChecked
CallerSopSettingManager.invokeRainModeListener(isChecked)
}
//雨天模式按钮只在司机屏生效,乘客屏不显示
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
@@ -840,10 +854,14 @@ internal class DebugSettingView @JvmOverloads constructor(
//初始化点云数据渲染情况
tbDrawPointCloudData.isChecked = FunctionBuildConfig.isDrawPointCloudData
//是否渲染点云数据
tbDrawPointCloudData.setOnCheckedChangeListener { _, isChecked ->
tbDrawPointCloudData.setOnCheckedChangeListener { compoundButton, isChecked ->
if(!compoundButton.isPressed){
return@setOnCheckedChangeListener
}
CallerAutoPilotControlManager.setIsDrawPointCloud(isChecked)
FunctionBuildConfig.isDrawPointCloudData = isChecked
CallerMapUIServiceManager.getMapUIController()?.setIsDrawPointCloud(isChecked)
CallerSopSettingManager.invokePointCloudListener(isChecked)
}
//设置点云大小
@@ -1721,18 +1739,6 @@ internal class DebugSettingView @JvmOverloads constructor(
mTrajectoryInfoSize = 0
mRouteInfoSize = 0
if (FunctionBuildConfig.isDemoMode) {
tbIsDemoMode?.text = "关闭美化模式"
} else {
tbIsDemoMode?.text = "开启美化模式"
}
if(FunctionBuildConfig.isRainMode){
tbIsRainMode?.text = "关闭雨天模式"
} else {
tbIsRainMode?.text = "开启雨天模式"
}
obuConnectStatusTv.text = Html.fromHtml(
"OBU连接状态${
if (AppConfigInfo.isConnectObu) {
@@ -2181,4 +2187,26 @@ internal class DebugSettingView @JvmOverloads constructor(
}
}
}
/**
* 美化模式
*/
override fun onDemoModeClickEvent(status: Boolean) {
tbIsDemoMode.isChecked = status
}
/**
* 雨天模式
*/
override fun onRainModeClickEvent(status: Boolean) {
tbIsRainMode.isChecked = status
}
/**
* 点云模式
*/
override fun onPointCloudClickEvent(status: Boolean) {
tbDrawPointCloudData.isChecked = status
}
}

View File

@@ -18,6 +18,7 @@ import com.mogo.eagle.core.function.api.devatools.mofang.*
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.FUNC_MODE_DEMO
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.FUNC_MODE_RAIN
import com.mogo.eagle.core.function.api.setting.ISopSettingListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotGetParamResponseDispatcher
import com.mogo.eagle.core.function.call.devatools.*
@@ -26,6 +27,7 @@ import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.obu.CallerObuApiManager
import com.mogo.eagle.core.function.call.setting.CallerSopSettingManager
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
import com.mogo.eagle.core.function.hmi.ui.utils.HmiActionLog.Companion.hmiAction
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
@@ -45,7 +47,7 @@ internal class SOPSettingView @JvmOverloads constructor(
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoDevaToolsFuncConfigListener,
IViewControlListener, IMoGoMoFangProvider.OnMoFangStatusListener,
IMoGoGetParamResponseListener {
IMoGoGetParamResponseListener, ISopSettingListener {
companion object {
const val TAG = "SOPSettingView"
@@ -361,7 +363,10 @@ internal class SOPSettingView @JvmOverloads constructor(
//初始化点云数据渲染情况
scDrawPointCloudData.isChecked = FunctionBuildConfig.isDrawPointCloudData
//是否渲染点云数据
scDrawPointCloudData.setOnCheckedChangeListener { _, isChecked ->
scDrawPointCloudData.setOnCheckedChangeListener { compoundButton, isChecked ->
if(!compoundButton.isPressed){
return@setOnCheckedChangeListener
}
//打开点云效果时,如果自车光圈是关闭状态,则自动打开自车光圈(点云是跟随光圈的 默认没有光圈就不显示点云的)
if(isChecked && !FunctionBuildConfig.isDisplayAnimEnable){
scCarAperture.isChecked = true
@@ -371,6 +376,7 @@ internal class SOPSettingView @JvmOverloads constructor(
CallerAutoPilotControlManager.setIsDrawPointCloud(isChecked)
FunctionBuildConfig.isDrawPointCloudData = isChecked
CallerMapUIServiceManager.getMapUIController()?.setIsDrawPointCloud(isChecked)
CallerSopSettingManager.invokePointCloudListener(isChecked)
hmiAction("SOP 是否渲染点云数据, ",isChecked)
Log.i(TAG,"SOP 是否渲染点云数据, $isChecked")
}
@@ -403,7 +409,7 @@ internal class SOPSettingView @JvmOverloads constructor(
// 演示模式,上一次勾选的数据
scDemoMode.isChecked = FunctionBuildConfig.isDemoMode
scDemoMode.setOnCheckedChangeListener { compoundButton, _ ->
scDemoMode.setOnCheckedChangeListener { compoundButton, isChecked ->
if(!compoundButton.isPressed){
return@setOnCheckedChangeListener
}
@@ -412,6 +418,7 @@ internal class SOPSettingView @JvmOverloads constructor(
FunctionBuildConfig.isDemoMode = !FunctionBuildConfig.isDemoMode
CallerAutoPilotControlManager.setDemoMode(FunctionBuildConfig.isDemoMode)
CallerHmiViewControlListenerManager.invokeFuncMode(FUNC_MODE_DEMO, FunctionBuildConfig.isDemoMode)
CallerSopSettingManager.invokeDemoModeListener(isChecked)
if (!FunctionBuildConfig.isDemoMode) {
//关闭美化模式时,通知工控机
CallerAutoPilotControlManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode)
@@ -433,6 +440,7 @@ internal class SOPSettingView @JvmOverloads constructor(
FunctionBuildConfig.isRainMode = isChecked
CallerAutoPilotControlManager.setRainMode(isChecked)
CallerHmiViewControlListenerManager.invokeFuncMode(FUNC_MODE_RAIN, isChecked)
CallerSopSettingManager.invokeRainModeListener(isChecked)
}
//雨天模式按钮只在司机屏生效,乘客屏不显示
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
@@ -647,6 +655,8 @@ internal class SOPSettingView @JvmOverloads constructor(
CallerAutopilotGetParamResponseDispatcher.addListener(TAG, this)
//查询融合模式
CallerAutoPilotControlManager.sendGetParamReq(AdasConstants.MapSystemParamType.FUSION_MODE)
//雨天、美化、点云设置同步
CallerSopSettingManager.addListener(TAG,this)
}
override fun updateFuncMode(tag: String, boolean: Boolean) {
@@ -666,6 +676,8 @@ internal class SOPSettingView @JvmOverloads constructor(
CallerHmiViewControlListenerManager.removeListener(TAG)
CallerAutopilotGetParamResponseDispatcher.removeListener(TAG)
CallerDevaToolsManager.mofang()?.unRegisterMoFangStatusListener(this)
//雨天、美化、点云设置同步
CallerSopSettingManager.removeListener(TAG)
}
@@ -730,6 +742,27 @@ internal class SOPSettingView @JvmOverloads constructor(
override fun onMoFangStatusError(msg: String) {}
/**
* 美化模式
*/
override fun onDemoModeClickEvent(status: Boolean) {
scDemoMode.isChecked = status
}
/**
* 雨天模式
*/
override fun onRainModeClickEvent(status: Boolean) {
scRainMode.isChecked = status
}
/**
* 点云模式
*/
override fun onPointCloudClickEvent(status: Boolean) {
scDrawPointCloudData.isChecked = status
}
/**
* 工控机配置参数获取
*/

View File

@@ -1,5 +1,7 @@
package com.mogo.eagle.core.function.business.routeoverlay;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -61,6 +63,7 @@ public class MogoRouteOverlayManager implements
@Override
public void onAutopilotTrajectory(@NonNull List<MessagePad.TrajectoryPoint> items) {
Log.d(TAG, "-- onAutopilotTrajectory --: " + (items != null ? items.size() : "0"));
synchronized (queue) {
queue.clear();
queue.offer(items);
@@ -72,15 +75,18 @@ public class MogoRouteOverlayManager implements
if (gnssInfo == null) {
return;
}
Log.d(TAG, "-- onChassisLocationGCJ02 -- 1 ---" + ":auto-mode:" + autopilotMode.get() + ", isArriveAtStation: " + isArriveAtStation.get());
if (isArriveAtStation.get() && autopilotMode.get() != 2) {
RouteOverlayDrawer.getInstance().clearMogoRouteOverlay();
return;
}
Log.d(TAG, "-- onChassisLocationGCJ02 -- 2 ---" + "auto-mode:" + autopilotMode.get() + ", isDemoMode:" + FunctionBuildConfig.isDemoMode + ", force:" + FunctionBuildConfig.isForceDrawAutopilotTrajectoryByDebugSettingView);
boolean force = FunctionBuildConfig.isForceDrawAutopilotTrajectoryByDebugSettingView || FunctionBuildConfig.isDemoMode && FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData;
if (!force && autopilotMode.get() != 2) {
RouteOverlayDrawer.getInstance().clearMogoRouteOverlay();
return;
}
Log.d(TAG, "-- onChassisLocationGCJ02 -- 3 ---");
synchronized (queue) {
if (!queue.isEmpty()) {
List<MessagePad.TrajectoryPoint> items = queue.pollLast();
@@ -96,6 +102,7 @@ public class MogoRouteOverlayManager implements
if (state == 2) {
isArriveAtStation.set(false);
}
Log.d(TAG, "-- onAutopilotStatusResponse ---: state:" + state);
this.autopilotMode.set(state);
}
@@ -105,12 +112,15 @@ public class MogoRouteOverlayManager implements
@Override
public void onAutopilotArriveAtStation(MessagePad.ArrivalNotification arrivalNotification) {
Log.d(TAG, "-- onAutopilotArriveAtStation --- 1 ---");
if (arrivalNotification == null) {
return;
}
Log.d(TAG, "-- onAutopilotArriveAtStation --- 2 ---");
if(!HdMapBuildConfig.isMapLoaded){
return;
}
Log.d(TAG, "-- onAutopilotArriveAtStation --- 3 ---");
if (!isArriveAtStation.get()) {
isArriveAtStation.set(true);
}

View File

@@ -0,0 +1,23 @@
package com.mogo.eagle.core.function.api.setting
/**
* 运营面板、调试面板设置事件监听回调
*/
interface ISopSettingListener {
/**
* 美化模式
*/
fun onDemoModeClickEvent(status: Boolean){}
/**
* 雨天模式
*/
fun onRainModeClickEvent(status: Boolean){}
/**
* 点云
*/
fun onPointCloudClickEvent(status: Boolean){}
}

View File

@@ -0,0 +1,41 @@
package com.mogo.eagle.core.function.call.setting
import com.mogo.eagle.core.function.api.setting.ISopSettingListener
import com.mogo.eagle.core.function.call.base.CallerBase
/**
* 运营面板、调试面板设置事件监听管理
*/
object CallerSopSettingManager: CallerBase<ISopSettingListener>() {
/**
* 触发演示模式事件监听
*/
fun invokeDemoModeListener(status: Boolean){
M_LISTENERS.forEach {
val listener = it.value
listener.onDemoModeClickEvent(status)
}
}
/**
* 触发雨天模式事件监听
*/
fun invokeRainModeListener(status: Boolean){
M_LISTENERS.forEach {
val listener = it.value
listener.onRainModeClickEvent(status)
}
}
/**
* 触发点云事件监听
*/
fun invokePointCloudListener(status: Boolean){
M_LISTENERS.forEach{
val listener = it.value
listener.onPointCloudClickEvent(status)
}
}
}