[3,4,0-map-sdk] merge 6.1.0

This commit is contained in:
zhongchao
2023-09-20 18:37:46 +08:00
24 changed files with 292 additions and 66 deletions

View File

@@ -87,7 +87,17 @@ object CharterTrajectoryManager {
// 5. 轨迹管理_轨迹下载超时
d(SceneConstant.M_CHARTER_D + TAG, "onAutopilotGuardian() 轨迹下载超时")
// ToastUtils.showShort("轨迹下载超时");
} else if ("ISSM_FUNC_AUTO_PILOT_READY" == guardianInfo.getCode()) {
} else if ("EMAP_ATTITUDE_INIT_FAILED" == guardianInfo.getCode()) {
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.OPERATION,
OperationMsg(
System.currentTimeMillis(), "请尽快操作车辆至适当位置掉头!", -1
)
)
)
SoundPoolHelper.getSoundPoolHelper().playSoundWithRedId(ActivityUtils.getTopActivity(), R.raw.startautopilot)
} else if ("EMAP_ATTITUDE_INIT_FAILED" == guardianInfo.getCode()) {
// 收到ssm的自动驾驶变为ready再次下发轨迹下载.解决域控重启或者102域控启动太早107节点初始化未完成导致的轨迹未进行下载。
d(SceneConstant.M_CHARTER_D + TAG, "onAutopilotGuardian() ssm ready再次发起下载")
syncTrajectoryInfo(get().getBusOrderResult()?.lineId!!,

View File

@@ -53,6 +53,7 @@ import io.reactivex.Observable
import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
import mogo.telematics.pad.MessagePad
import mogo_msg.MogoReportMsg
import java.util.*
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.TimeUnit
@@ -197,6 +198,14 @@ object CharterPassengerModel {
d(M_BUS_P + TAG, "底盘给到站信息")
arriveDest()
}
override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {
super.onAutopilotGuardian(guardianInfo)
guardianInfo?.let {
if (it.code=="IMAP_TRA_LOADED") {
ToastCharterUtils.showToastShort("请等待车辆完成掉头后再出发吧~")
}
}
}
}
/**

View File

@@ -13,6 +13,9 @@ import kotlinx.android.synthetic.main.m1_itinerary_info.view.tv_distance_surplus
import kotlinx.android.synthetic.main.m1_itinerary_info.view.tv_distance_unit
import kotlinx.android.synthetic.main.m1_itinerary_info.view.tv_speed
/**
* 速度、剩余时间、剩余距离和到达时间
*/
class ItineraryView : ConstraintLayout, ItineraryViewModel.ItineraryViewCallback {
private val TAG = "ItineraryView"

View File

@@ -19,6 +19,9 @@ import kotlinx.android.synthetic.main.m1_devices_fragment.view.actv_order_times
import kotlinx.android.synthetic.main.m1_devices_fragment.view.cl_order_info
import kotlinx.android.synthetic.main.m1_devices_fragment.view.cl_order_info_endorder_comfit
/**
* 剩余时间和结束订单入口
*/
class OrderInfoView : ConstraintLayout, OrderInfoViewModel.ItineraryViewCallback {
private val TAG = "OrderInfoView"

View File

@@ -41,6 +41,9 @@ import kotlinx.android.synthetic.main.m1_order_loading.view.iv_loading_wait_ent
import me.jessyan.autosize.utils.AutoSizeUtils
import org.greenrobot.eventbus.EventBus
/**
* 选择线路
*/
class SelectLineView : ConstraintLayout, SelectLineViewModel.SelectLineViewCallback {
private val TAG = "OrderInfoView"

View File

@@ -72,6 +72,9 @@ import kotlinx.android.synthetic.main.m1_soft_fragment.view.tv_temperature_title
import me.jessyan.autosize.utils.AutoSizeUtils
import java.util.concurrent.TimeUnit
/**
* 空调、暖风机、声音控制
*/
class SoftControlView : ConstraintLayout, SoftControlViewModel.SoftControlCallback {
private val TAG = "OrderInfoView"

View File

@@ -92,12 +92,14 @@
app:layout_constraintEnd_toEndOf="@+id/viewBusPM1MsgBoxButton"
app:layout_constraintTop_toBottomOf="@+id/viewBusPM1MsgBoxButton" />
<!--速度、剩余时间、剩余距离和到达时间-->
<com.mogo.och.charter.passenger.ui.itinerary.ItineraryView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--剩余时间和结束订单入口-->
<com.mogo.och.charter.passenger.ui.orderinfo.OrderInfoView
android:id="@+id/biz_orderinfo"
android:layout_width="match_parent"
@@ -107,12 +109,14 @@
app:layout_constraintBottom_toTopOf="@+id/bb_boorombar"
app:layout_constraintTop_toTopOf="parent" />
<!--空调、暖风机、声音控制-->
<com.mogo.och.charter.passenger.ui.softcontrol.SoftControlView
android:id="@+id/biz_softcontrol"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone" />
<!--选择线路-->
<com.mogo.och.charter.passenger.ui.selectline.SelectLineView
android:id="@+id/biz_selectline"
android:layout_width="0dp"
@@ -124,13 +128,14 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--视频播放-->
<com.mogo.och.charter.passenger.ui.video.VideoView
android:id="@+id/biz_video"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone" />
<!--底部导航栏-->
<com.mogo.och.charter.passenger.ui.bottom.BottomBar
android:id="@+id/bb_boorombar"
android:layout_width="match_parent"
@@ -139,6 +144,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<!--调试面板-->
<com.mogo.och.charter.passenger.ui.debugview.DebugView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -147,6 +153,7 @@
app:layout_constraintEnd_toEndOf="@+id/mapBizView"
app:layout_constraintTop_toTopOf="parent" />
<!--锁定状态和解锁入口-->
<com.mogo.och.charter.passenger.ui.lockview.UnlockView
android:id="@+id/uv_only_unlock"
android:visibility="gone"
@@ -158,6 +165,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<!--锁定和解锁入口-->
<com.mogo.och.charter.passenger.ui.lockview.LockAndUnlockView
android:layout_width="@dimen/dp_138"
android:layout_height="@dimen/dp_138"

View File

@@ -47,7 +47,7 @@ import com.mogo.och.sweepercloud.util.AutopilotModeConfigManager;
import com.mogo.och.sweepercloud.util.SweeperCloudTaskUtils;
import com.mogo.och.sweepercloud.view.SweeperTrafficDataView;
import com.mogo.och.sweepercloud.view.WeltSmallMapView;
import com.zhjt.mogo.adas.data.sweeper.SweeperCloudTask;
import com.zhjt.mogo.adas.data.AiCloudTask;
import java.math.BigDecimal;
import java.math.RoundingMode;
@@ -181,7 +181,7 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
);
// 模拟 云端发送任务
findViewById(R.id.btnSendTask).setOnClickListener(view -> {
SweeperCloudTaskUtils.mockSendCloudTaskInfo(SweeperCloudTask.MessageType.CloudPushTask);
SweeperCloudTaskUtils.mockSendCloudTaskInfo(AiCloudTask.MessageType.CloudPushTask);
UiThreadHandler.postDelayed(() -> {
debugEndSubTask();
}, 5000);

View File

@@ -35,7 +35,7 @@ import com.mogo.och.sweepercloud.util.SweeperCloudTaskUtils.createSweeperTaskRes
import com.mogo.och.sweepercloud.util.SweeperCloudTaskUtils.createSweeperTaskSuspendDialog
import com.mogo.och.sweepercloud.util.SweeperCloudTaskUtils.printMessage
import com.mogo.och.sweepercloud.view.SweeperCurrentTaskInfoView
import com.zhjt.mogo.adas.data.sweeper.SweeperCloudTask
import com.zhjt.mogo.adas.data.AiCloudTask
import com.zhjt.mogo.adas.data.sweeper.bootable.SweeperBootable
import com.zhjt.mogo.adas.data.sweeper.common.SweeperCommon
import com.zhjt.mogo.adas.data.sweeper.common.SweeperCommon.TaskStatus
@@ -205,7 +205,7 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
* 设置云端任务信息
*/
fun onSweeperCloudTask(
messageType: SweeperCloudTask.MessageType,
messageType: AiCloudTask.MessageType,
taskInfo: SweeperTask.TaskInfo?
) {
this.mTaskInfo = taskInfo
@@ -216,7 +216,7 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
return
}
//主动拉取云端正在执行的任务,有则直接在任务列表展示
if (messageType == SweeperCloudTask.MessageType.PadSendGetTaskReq) {
if (messageType == AiCloudTask.MessageType.PadSendGetTaskReq) {
getCurrentTaskView().setData(taskInfo, getCurrentRunningSubTaskPosition())
setShowCurrentTaskPanelView(true)
addTaskData()

View File

@@ -17,7 +17,7 @@ import com.mogo.och.sweepercloud.callback.ISweeperTaskRouteCallback;
import com.mogo.och.sweepercloud.database.bean.WeltDataBean;
import com.mogo.och.sweepercloud.fragment.SweeperFragment;
import com.mogo.och.sweepercloud.model.SweeperTaskModel;
import com.zhjt.mogo.adas.data.sweeper.SweeperCloudTask;
import com.zhjt.mogo.adas.data.AiCloudTask;
import com.zhjt.mogo.adas.data.sweeper.bootable.SweeperBootable;
import com.zhjt.mogo.adas.data.sweeper.common.SweeperCommon;
import com.zhjt.mogo.adas.data.sweeper.task.SweeperTask;
@@ -190,7 +190,7 @@ public class SweeperPresenter extends Presenter<SweeperFragment>
}
@Override
public void onSweeperCloudTask(@NonNull SweeperCloudTask.MessageType messageType, SweeperTask.TaskInfo taskInfo) {
public void onSweeperCloudTask(@NonNull AiCloudTask.MessageType messageType, SweeperTask.TaskInfo taskInfo) {
ThreadUtils.runOnUiThread(() -> mView.onSweeperCloudTask(messageType, taskInfo));
}
@@ -210,7 +210,7 @@ public class SweeperPresenter extends Presenter<SweeperFragment>
}
@Override
public void onSweeperCloudTaskSuspendResume(@NonNull SweeperCloudTask.MessageType messageType, @NonNull String taskId,
public void onSweeperCloudTaskSuspendResume(@NonNull AiCloudTask.MessageType messageType, @NonNull String taskId,
@NonNull String subTaskId, SweeperCommon.Code code) {
}

View File

@@ -48,8 +48,6 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
private static final String TAG = TaxiPresenter.class.getSimpleName();
private int preAutopilotStatus = 0;
public TaxiPresenter(TaxiFragment view) {
super(view);
TaxiModel.getInstance().init(AbsMogoApplication.getApp());
@@ -192,30 +190,24 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
public void onAutopilotEnable() {
runOnUIThread(() -> mView.updateAutopilotStatus(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE));
preAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE;
}
@Override
public void onAutopilotDisable() {
runOnUIThread(() -> mView.updateAutopilotStatus(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE));
preAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE;
}
@Override
public void onAutopilotRunning() {
if (preAutopilotStatus != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING){
runOnUIThread(() -> mView.updateAutopilotStatus(
runOnUIThread(() -> mView.updateAutopilotStatus(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING));
}
preAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING;
}
@Override
public void onManMachineCoDriving() {
runOnUIThread(() -> mView.onManMachineCoDriving(IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING));
preAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING;
}
@Override

View File

@@ -224,8 +224,11 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
findViewById(R.id.btnAutopilotmanco).setOnClickListener(view ->
onAutopilotStatusChanged(IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING));
tvOperationStatus.setOnClickListener(view -> {
onChangeOperationStatus();
tvOperationStatus.setOnClickListener(new OnPreventFastClickListener() {
@Override
public void onClickImpl(View v) {
onChangeOperationStatus();
}
});
mCloseNaviIcon.setOnClickListener(v -> {
showAmapNaviToStationFragment(false);
@@ -333,21 +336,13 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
public void onBagManagerResult(@NonNull BagManagerOuterClass.BagManager bagManager) {
}
/**
* 改变自动驾驶状态
*
* @param status 2 - running 1 - enable 2 - disable
*/
private int mPrevAPStatus = -1;
public void onAutopilotStatusChanged(int status) {
getActivity().runOnUiThread(() -> {
if (isStarting && IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING != status) {
// 1. 主动开启自动驾驶中不为2为0、1则继续loading
return;
}
if (isStarting && IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == status
&& mPrevAPStatus != status) {
if (isStarting && IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == status) {
// 2. 主动开启自动驾驶中为2则停止loading并isStarting = false
startAutopilotDone(true);
return;
@@ -355,7 +350,6 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
// 3. 其他过程直接更新
startOrStopLoadingAnim(false);
autopilotStatusAnimchanged(status);
mPrevAPStatus = status;
});
}
@@ -365,10 +359,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
}
public void onManMachineCoDriving(int manMachineCoDriving) {
if (mPrevAPStatus != manMachineCoDriving) {
autopilotStatusAnimchanged(manMachineCoDriving);
}
mPrevAPStatus = manMachineCoDriving;
autopilotStatusAnimchanged(manMachineCoDriving);
}
public void updateCtvAutopilotStatusTag(boolean tag) {

View File

@@ -195,7 +195,12 @@ abstract class BaseTaxiTabFragment<V : IView, P : Presenter<V>> : MvpFragment<V,
LocalBroadcastManager.getInstance(requireContext()).sendBroadcast(intent)
}
module_mogo_och_operation_status.setOnClickListener { onChangeOperationStatus() }
module_mogo_och_operation_status.setOnClickListener(object : OnPreventFastClickListener() {
override fun onClickImpl(v: View?) {
onChangeOperationStatus()
}
})
taxi_close_navi_icon.setOnClickListener {
showAmapNaviToStationFragment(false)
showRoutingToStationFragment(false)
@@ -288,8 +293,6 @@ abstract class BaseTaxiTabFragment<V : IView, P : Presenter<V>> : MvpFragment<V,
super.onDestroy()
}
private var mPreAutoPilotStatus = -1
/**
* 改变自动驾驶状态
*
@@ -301,7 +304,7 @@ abstract class BaseTaxiTabFragment<V : IView, P : Presenter<V>> : MvpFragment<V,
// 1. 主动开启自动驾驶中不为2为0、1则继续loading
return@runOnUiThread
}
if (isStarting && IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == status && mPreAutoPilotStatus != status
if (isStarting && IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == status
) {
// 2. 主动开启自动驾驶中为2则停止loading并isStarting = false
startAutopilotDone(true)
@@ -310,7 +313,6 @@ abstract class BaseTaxiTabFragment<V : IView, P : Presenter<V>> : MvpFragment<V,
// 3. 其他过程直接更新
startOrStopLoadingAnim(false)
updateAutopilotBtnByStatus(status)
mPreAutoPilotStatus = status
})
}
@@ -326,10 +328,7 @@ abstract class BaseTaxiTabFragment<V : IView, P : Presenter<V>> : MvpFragment<V,
* 平行驾驶 【开启自动驾驶按钮】 更新
*/
fun onParallelDrivingStatus(parallelDrivingValue: Int) {
if (mPreAutoPilotStatus != parallelDrivingValue) {
updateAutopilotBtnByStatus(parallelDrivingValue)
}
mPreAutoPilotStatus = parallelDrivingValue
updateAutopilotBtnByStatus(parallelDrivingValue)
}
private fun updateCtvAutopilotStatusTag(tag: Boolean) {

View File

@@ -33,8 +33,6 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
private static final String TAG = TaxiPresenter.class.getSimpleName();
private int preAutopilotStatus = 0;
public TaxiPresenter(TaxiFragment view) {
super(view);
TaxiTaskModel.INSTANCE.init();
@@ -103,29 +101,23 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
public void onAutopilotEnable() {
runOnUIThread(() -> mView.updateAutopilotStatus(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE));
preAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE;
}
@Override
public void onAutopilotDisable() {
runOnUIThread(() -> mView.updateAutopilotStatus(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE));
preAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE;
}
@Override
public void onAutopilotRunning() {
if (preAutopilotStatus != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
runOnUIThread(() -> mView.updateAutopilotStatus(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING));
}
preAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING;
runOnUIThread(() -> mView.updateAutopilotStatus(
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING));
}
@Override
public void onParallelDrivingStatus() {
runOnUIThread(() -> mView.onParallelDrivingStatus(IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING));
preAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING;
}
@Override

View File

@@ -1,5 +1,6 @@
package com.mogo.eagle.core.function.datacenter.autopilot.adapter
import android.util.Log
import bag_manager.BagManagerOuterClass
import chassis.ChassisStatesOuterClass
import chassis.VehicleStateOuterClass
@@ -163,6 +164,9 @@ class MoGoAdasListenerImpl : OnAdasListener {
vehicleState: VehicleStateOuterClass.VehicleState?
) {
if (vehicleState != null) {
Log.i(
"xfk",
"底盘 onVehicleState 刹车=${vehicleState.brake}")
//转向灯数据
CallerChassisLamplightListenerManager.invokeAutopilotLightSwitchData(vehicleState.light)
//刹车灯数据
@@ -252,6 +256,9 @@ class MoGoAdasListenerImpl : OnAdasListener {
CallerChassisThrottleStateListenerManager.invokeAutopilotThrottle(it.throttleResponsePosition)
}
chassisStates.brakeSystemStates?.let {
Log.i(
"xfk",
"底盘 onVehicleState 刹车=${it.brakePedalResponsePosition}")
//刹车
CallerChassisBrakeStateListenerManager.invokeAutopilotBrake(it.brakePedalResponsePosition)
}

View File

@@ -50,6 +50,7 @@ import com.mogo.eagle.core.data.obu.ObuStatusInfo
import com.mogo.eagle.core.function.api.autopilot.*
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.api.devatools.IMoGoDevaToolsFuncConfigListener
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
import com.mogo.eagle.core.function.call.autopilot.*
@@ -61,6 +62,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
@@ -121,7 +123,8 @@ internal class DebugSettingView @JvmOverloads constructor(
IMoGoChassisBrakeStateListener,
IMoGoChassisThrottleStateListener,
IMoGoSweeperFutianCleanSystemListener,
IMoGoObuInfoListener {
IMoGoObuInfoListener,
ISopSettingListener {
private val TAG = "DebugSettingView"
@@ -230,6 +233,8 @@ internal class DebugSettingView @JvmOverloads constructor(
CallerDevaToolsListenerManager.addListener(TAG, this)
//添加 底盘灯光数据 监听
CallerChassisLamplightListenerManager.addListener(TAG, this)
//雨天、美化、点云设置同步
CallerSopSettingManager.addListener(TAG,this)
//添加 业务配置监听
CallerDevaToolsFuncConfigListenerManager.registerDevaToolsFuncConfigListener(
@@ -277,6 +282,8 @@ internal class DebugSettingView @JvmOverloads constructor(
CallerChassisLamplightListenerManager.removeListener(TAG)
// 移除 obu获取信息 监听
CallerObuInfoListenerManager.removeListener(TAG)
//雨天、美化、点云设置同步
CallerSopSettingManager.removeListener(TAG)
// 移除 业务配置监听
CallerDevaToolsFuncConfigListenerManager.unRegisterDevaToolsFuncConfigListener(
@@ -697,11 +704,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)
@@ -734,9 +744,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)) {
@@ -854,10 +868,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)
}
//设置点云大小
@@ -2230,4 +2248,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,16 +1,18 @@
package com.mogo.eagle.core.function.hmi.ui.widget
import android.animation.ObjectAnimator
import android.animation.ValueAnimator
import android.annotation.SuppressLint
import android.content.Context
import android.graphics.Color
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.animation.LinearInterpolator
import android.widget.ImageView
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.voice.AIAssist
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotActionsListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoParallelDrivingActionsListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoParallelDrivingStatusListener
@@ -22,7 +24,6 @@ import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason.SourceType
import mogo.yycp.paralleldriving.protocol.ParallelDrivingRequest.ParallelRequest
import mogo.yycp.paralleldriving.protocol.ParallelTaskProcessNoticeOuterClass
@@ -50,6 +51,7 @@ class ParallelDriveView @JvmOverloads constructor(
//1:ready, 2:自动驾驶中, 7:平行驾驶中
@Volatile
private var autopilotState: Int = 1
@Volatile
private var isAutoDriving: Boolean = false
@@ -60,6 +62,7 @@ class ParallelDriveView @JvmOverloads constructor(
private lateinit var statusIcon: ImageView
private lateinit var statusTitle: TextView
private var listener: ClickEventListener? = null
private var animator: ObjectAnimator? = null
init {
LayoutInflater.from(context).inflate(R.layout.view_parallel_drive, this, true)
@@ -115,11 +118,13 @@ class ParallelDriveView @JvmOverloads constructor(
}, ThreadUtils.MODE.QUEUE)
}
}
2 -> {
if (this.autopilotState != state) {
isAutoDriving = true
}
}
else -> {
if (this.autopilotState != state) {
isAutoDriving = false
@@ -161,30 +166,37 @@ class ParallelDriveView @JvmOverloads constructor(
state = SYNCHRONIZING
updateUI(SYNCHRONIZING)
}
"EXCEPTION_EXIT_SYNC" -> {// 同步异常结束
state = ONE_EXCEPTION
updateUI(ONE_EXCEPTION)
}
"TASK_REJECTED" -> {// 任务已被拒绝
state = FAILURE
updateUI(FAILURE)
AIAssist.getInstance(context).speakTTSVoice("请求已被拒绝")
}
"PARALLEL_EXCEPTION_MANUAL_DRIVING" -> {// 异常请人工驾驶
state = TWO_EXCEPTION
updateUI(TWO_EXCEPTION)
}
"EXCEPTION_EXIT_PARALLEL_DRIVING" -> {// 平行驾驶异常结束
state = ONE_EXCEPTION
updateUI(ONE_EXCEPTION)
}
"EXIT_SYNC" -> {// 同步结束
checkAvailableAndUpdateUI()
}
"UNABLE_TAKEOVER" -> {// 无法接管
state = ONE_EXCEPTION
updateUI(ONE_EXCEPTION)
}
"VEHICLE_IN_TROUBLE_PARALLEL_REQUESTED" -> {// 车辆遇困请求平行驾驶
state = AD_REQUESTING
updateUI(AD_REQUESTING)
@@ -198,6 +210,7 @@ class ParallelDriveView @JvmOverloads constructor(
private fun updateUI(state: Int) {
when (state) {
0 -> {
stopRotateAnimation()
rootLayout.isEnabled = true
rootLayout.alpha = 1f
statusIcon.background =
@@ -215,6 +228,7 @@ class ParallelDriveView @JvmOverloads constructor(
resources.getDrawable(R.drawable.icon_para_requesting, null)
statusTitle.setTextColor(Color.parseColor("#FFFFFF"))
statusIcon.alpha = 1f
startRotateAnimation()
statusTitle.text = context.getString(R.string.parallel_drive_requesting)
rootLayout.background = resources.getDrawable(R.drawable.bg_auto_pilot, null)
}
@@ -226,11 +240,13 @@ class ParallelDriveView @JvmOverloads constructor(
resources.getDrawable(R.drawable.icon_para_requesting, null)
statusTitle.setTextColor(Color.parseColor("#FFFFFF"))
statusIcon.alpha = 1f
startRotateAnimation()
statusTitle.text = context.getString(R.string.parallel_drive_requesting)
rootLayout.background = resources.getDrawable(R.drawable.bg_auto_pilot, null)
}
SYNCHRONIZING -> {
stopRotateAnimation()
rootLayout.isEnabled = false
rootLayout.alpha = 1f
statusIcon.background =
@@ -242,6 +258,7 @@ class ParallelDriveView @JvmOverloads constructor(
}
PARALLEL_DRIVING -> {
stopRotateAnimation()
rootLayout.isEnabled = false
rootLayout.alpha = 1f
statusIcon.background =
@@ -254,6 +271,7 @@ class ParallelDriveView @JvmOverloads constructor(
}
FAILURE -> {
stopRotateAnimation()
rootLayout.isEnabled = false
rootLayout.alpha = 1f
rootLayout.postDelayed({
@@ -268,6 +286,7 @@ class ParallelDriveView @JvmOverloads constructor(
}
ONE_EXCEPTION -> {
stopRotateAnimation()
rootLayout.isEnabled = false
rootLayout.alpha = 1f
rootLayout.postDelayed({
@@ -282,6 +301,7 @@ class ParallelDriveView @JvmOverloads constructor(
}
TWO_EXCEPTION -> {
stopRotateAnimation()
rootLayout.isEnabled = false
rootLayout.alpha = 1f
rootLayout.postDelayed({
@@ -296,6 +316,7 @@ class ParallelDriveView @JvmOverloads constructor(
}
UNAVAILABLE -> {
stopRotateAnimation()
rootLayout.isEnabled = false
rootLayout.alpha = 0.4f
statusIcon.background =
@@ -351,6 +372,27 @@ class ParallelDriveView @JvmOverloads constructor(
}
}
@SuppressLint("Recycle")
private fun startRotateAnimation() {
if (animator == null) {
animator = ObjectAnimator.ofFloat(statusIcon, "rotation", 0f, 360f).apply {
duration = 1500
repeatMode = ValueAnimator.RESTART
repeatCount = ValueAnimator.INFINITE
interpolator = LinearInterpolator()
}
}
animator?.start()
}
private fun stopRotateAnimation() {
animator?.let {
if (it.isRunning) {
it.cancel()
}
}
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerAutoPilotStatusListenerManager.removeListener(TAG)

View File

@@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.hmi.ui.widget
import android.content.Context
import android.util.AttributeSet
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout
@@ -377,9 +378,13 @@ class SystemVersionView @JvmOverloads constructor(
* HQ、M1 MAP350开始弃用其他车型MAP360开始弃用
*/
override fun onAutopilotStatusRespByQuery(status: SystemStatusInfo.StatusInfo) {
Log.i(TAG,"hdMapVer="+status.hdMapVer)
//hdMapVer返回示例/home/mogo/autopilot/share/hadmap_engine/data/hadmap_data/db.sqlite|bj|2.2.7|对bus路线上的junction进行修改对原609场景修改为6091、6092、6201、 6202四种细分场景并对通往园区路口改为619
if(status.hdMapVer!= null && status.hdMapVer.isNotEmpty()){
//对地图版本进行截取
AppConfigInfo.adHdMapVersion = status.hdMapVer.substringAfter("/hadmap_data/").substringBefore(".sqlite")
val city = status.hdMapVer.substringAfter(".sqlite|").substringBefore("|")
val version =status.hdMapVer.substringAfter("$city|").substringBefore("|")
AppConfigInfo.adHdMapVersion = "${city}_${version}"
updateAdHdMapVersion()
}
@@ -392,9 +397,13 @@ class SystemVersionView @JvmOverloads constructor(
* @param statusInf 数据
*/
override fun onSystemStatus(statusInf: SsmInfo.SsmStatusInf) {
Log.i(TAG,"hdMapVer="+statusInf.hdMapVer)
//hdMapVer返回示例/home/mogo/autopilot/share/hadmap_engine/data/hadmap_data/db.sqlite|bj|2.2.7|对bus路线上的junction进行修改对原609场景修改为6091、6092、6201、 6202四种细分场景并对通往园区路口改为619
if(statusInf.hdMapVer!= null && statusInf.hdMapVer.isNotEmpty()){
//对地图版本进行截取
AppConfigInfo.adHdMapVersion = statusInf.hdMapVer.substringAfter("/hadmap_data/").substringBefore(".sqlite")
val city = statusInf.hdMapVer.substringAfter(".sqlite|").substringBefore("|")
val version =statusInf.hdMapVer.substringAfter("$city|").substringBefore("|")
AppConfigInfo.adHdMapVersion = "${city}_${version}"
updateAdHdMapVersion()
}
}

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

@@ -35,6 +35,7 @@ class ChainConstant {
const val CHAIN_TYPE_WEAK_NETWORK = 400
const val CHAIN_TYPE_OCH = 500
//注意,如果新增/改动文件名称,需要与服务端同步信息,预警需要
const val CHAIN_LINK_LOG_INIT = "-eagleInitStatus"
const val CHAIN_LINK_LOG_ADAS_GNSS = "-adasGnssInfo"
const val CHAIN_LINK_LOG_ADAS_AUTO = "-adasAutoPilot"

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

@@ -1,5 +1,6 @@
package com.mogo.eagle.core.function.call.autopilot
import android.util.Log
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotActionsListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason
@@ -61,6 +62,9 @@ object CallerAutopilotActionsListenerManager : CallerBase<IMoGoAutopilotActionsL
fun invokeAutopilotAbility(
isAutopilotAbility: Boolean, unableAutopilotReasons: ArrayList<UnableLaunchReason>?
) {
Log.i(
"xfk",
"CallerAutopilotActionsListenerManager invokeAutopilotAbility=${CallerAutopilotActionsListenerManager.isAutopilotAbility} ${(if (CallerAutopilotActionsListenerManager.unableAutopilotReasons == null) null else CallerAutopilotActionsListenerManager.unableAutopilotReasons.toString())}")
if (isConnected) {
var isEquals: Boolean = true
if (unableAutopilotReasons != null && this.unableAutopilotReasons != null) {
@@ -91,6 +95,9 @@ object CallerAutopilotActionsListenerManager : CallerBase<IMoGoAutopilotActionsL
}
private fun notification() {
Log.i(
"xfk",
"CallerAutopilotActionsListenerManager 通知=${isAutopilotAbility} ${(if (unableAutopilotReasons == null) null else unableAutopilotReasons.toString())}")
M_LISTENERS.forEach {
val listener = it.value
listener.onAutopilotAbility(isAutopilotAbility, unableAutopilotReasons)

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