diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/task/TaxiCurrentTaskFragment.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/task/TaxiCurrentTaskFragment.kt index c02256f181..b9c0a1276a 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/task/TaxiCurrentTaskFragment.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/task/TaxiCurrentTaskFragment.kt @@ -117,18 +117,14 @@ class TaxiCurrentTaskFragment : BaseFragment(), TAG, "hasCurrentTask = $hasCurrentTask" ) - try { - if (hasCurrentTask) { - noTaskData.visibility = View.GONE - mCurrentTaskLayout.visibility = View.VISIBLE - } else { - noTaskData.visibility = View.VISIBLE - noOrderDataTv.text = "暂无进行中订单" - mCurrentTaskLayout.visibility = View.GONE - taskOtherInfo.text = "距离 -- 公里, 用时 -- 分钟" - } - } catch (e: NullPointerException) { //可能会出现订单信息已经轮询回来,但进行中页面控件还未初始化完成的情况 - TaxiTaskModel.clearCurrentOCHOrder() + if (hasCurrentTask) { + noTaskData.visibility = View.GONE + mCurrentTaskLayout.visibility = View.VISIBLE + } else { + noTaskData.visibility = View.VISIBLE + noOrderDataTv.text = "暂无进行中订单" + mCurrentTaskLayout.visibility = View.GONE + taskOtherInfo.text = "距离 -- 公里, 用时 -- 分钟" } } diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/task/TaxiTaskModel.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/task/TaxiTaskModel.kt index ca009e35e4..abd84c7780 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/task/TaxiTaskModel.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/task/TaxiTaskModel.kt @@ -68,6 +68,7 @@ import mogo.telematics.pad.MessagePad.GlobalPathResp import mogo_msg.MogoReportMsg.MogoReportMessage import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.TimeUnit +import kotlin.math.ceil /** * @author: wangmingjun @@ -255,6 +256,7 @@ object TaxiTaskModel { } override fun onAutopilotStatusResponse(state: Int) { + i(TAG, "onAutopilotStatusResponse autopilotsState= $state") if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) { DebugView.printInfoMsg("[自驾状态变化] afterValue=STATUS_AUTOPILOT_RUNNING,meaning=自动驾驶中") mADASStatusCallback?.onAutopilotRunning() @@ -705,6 +707,7 @@ object TaxiTaskModel { listener.onTaskWithOrderDataChanged(null) } } + clearCurrentOCHOrder() return } @@ -837,7 +840,7 @@ object TaxiTaskModel { val listener = it.value listener.onOrderTripInfoChanged( data.data.mileage, - data.data.duration.toInt() + ceil(data.data.duration.toDouble()).toInt() //向上取整 ) } } @@ -1044,6 +1047,10 @@ object TaxiTaskModel { currentStatus < TaskStatusEnum.CompleteTask.code -> return } } + if (currentStatus == TaskStatusEnum.None.code && order != null){ + //订单送驾到站, 但是还没点服务完成的情况, 此时endSite == null currentStatus == 0 + return + } } mDriveToNearestStationTask = data.data mTaxiCarServiceCallback?.onCarStartServiceSuccess( @@ -1312,18 +1319,14 @@ object TaxiTaskModel { * 清除任务订单信息 */ fun clearCurrentOCHOrder() { - mCurrentTaskWithOrder = null - mDriveToNearestStationTask = null clearAutopilotControlParameters() - TaxiTrajectoryManager.getInstance().syncTrajectoryInfo() - SharedPrefsMgr.getInstance(mContext).remove(TaxiUnmannedConst.SP_KEY_OCH_TAXI_ORDER) isRestartAutopilot = false if (FunctionBuildConfig.isDemoMode) { // 当美化模式(演示模式)开启时: 取消或订单已完成时,置false FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false CallerAutoPilotControlManager.setIgnoreConditionDraw(false) CallerAutoPilotControlManager.setIPCDemoMode(false) - d(TAG, "美化模式-ignore:置为false(已完成or清除当前订单)") + d(TAG, "美化模式-ignore:置为false(已完成or清除当前任务)") } } diff --git a/config.gradle b/config.gradle index 2711344e63..d5d4d49b8c 100644 --- a/config.gradle +++ b/config.gradle @@ -89,7 +89,7 @@ ext { // obu sdk obusdk : "com.zhidao.enterprise.smartv2x:smartv2x:1.0.0.3", - mogoobu : 'com.mogo.support.obu:mogo-obu:1.1.1', + mogoobu : 'com.mogo.support.obu:mogo-obu:1.1.2', // google googlezxing : "com.google.zxing:core:3.3.3", diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt index e530ef6e2c..c887f5020f 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt @@ -382,7 +382,12 @@ internal class SOPSettingView @JvmOverloads constructor( } //自车光圈 - scCarAperture.isChecked = FunctionBuildConfig.isDisplayAnimEnable + if(FunctionBuildConfig.isDrawPointCloudData){ + //如果点云效果是打开的,则自车光圈也跟随打开 + scCarAperture.isChecked = true + }else{ + scCarAperture.isChecked = FunctionBuildConfig.isDisplayAnimEnable + } scCarAperture.setOnCheckedChangeListener { compoundButton, isChecked -> CallerMapUIServiceManager.getMapUIController()?.setDisplayAnimEnable(isChecked) hmiAction("SOP 是否展示自车光圈,",isChecked) diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/MogoRouteOverlayManager.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/MogoRouteOverlayManager.java index b255d37baf..30fc741d45 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/MogoRouteOverlayManager.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/MogoRouteOverlayManager.java @@ -30,14 +30,10 @@ import system_master.SystemStatusInfo; public class MogoRouteOverlayManager implements IMoGoPlanningTrajectoryListener, - IMoGoAutopilotStatusListener, IMoGoChassisLocationGCJ02Listener { private static volatile MogoRouteOverlayManager sInstance; private static final String TAG = "Route"; - private final AtomicBoolean isArriveAtStation = new AtomicBoolean(false); - private final AtomicInteger autopilotMode = new AtomicInteger(0); - private final LinkedList> queue = new LinkedList<>(); private MogoRouteOverlayManager() { @@ -46,7 +42,6 @@ public class MogoRouteOverlayManager implements public void init() { CallerPlanningTrajectoryListenerManager.INSTANCE.addListener(TAG, this); - CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, this); CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, 20,this); } @@ -75,14 +70,16 @@ 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) { + int autoPilotState = CallerAutoPilotStatusListenerManager.INSTANCE.getState(); + boolean isArriveAtStation = CallerAutoPilotStatusListenerManager.INSTANCE.isArriveAtStation(); +// Log.d(TAG, "-- onChassisLocationGCJ02 -- 1 ---" + ":auto-mode:" + autoPilotState + ", isArriveAtStation: " + isArriveAtStation); + if (isArriveAtStation && autoPilotState != 2) { RouteOverlayDrawer.getInstance().clearMogoRouteOverlay(); return; } -// Log.d(TAG, "-- onChassisLocationGCJ02 -- 2 ---" + "auto-mode:" + autopilotMode.get() + ", isDemoMode:" + FunctionBuildConfig.isDemoMode + ", force:" + FunctionBuildConfig.isForceDrawAutopilotTrajectoryByDebugSettingView); +// Log.d(TAG, "-- onChassisLocationGCJ02 -- 2 ---" + "auto-mode:" + autoPilotState + ", isDemoMode:" + FunctionBuildConfig.isDemoMode + ", force:" + FunctionBuildConfig.isForceDrawAutopilotTrajectoryByDebugSettingView); boolean force = FunctionBuildConfig.isForceDrawAutopilotTrajectoryByDebugSettingView || FunctionBuildConfig.isDemoMode && FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData; - if (!force && autopilotMode.get() != 2) { + if (!force && autoPilotState != 2) { RouteOverlayDrawer.getInstance().clearMogoRouteOverlay(); return; } @@ -96,66 +93,4 @@ public class MogoRouteOverlayManager implements } } } - - @Override - public void onAutopilotStatusResponse(int state) { - if (state == 2) { - isArriveAtStation.set(false); - } - Log.d(TAG, "-- onAutopilotStatusResponse ---: state:" + state); - this.autopilotMode.set(state); - } - - @Override - public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autoPilotStatusInfo) { - } - - @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); - } - } - - - @Override - public void onAutopilotSNRequest() { - - } - - @Override - public void onAutopilotGuardian(MogoReportMsg.MogoReportMessage guardianInfo) { - - } - - @Override - public void onAutopilotIpcConnectStatusChanged(int status, @androidx.annotation.Nullable String reason) { - } - - @Override - public void onAutopilotStatusRespByQuery(@NonNull SystemStatusInfo.StatusInfo status) { - } - - @Override - public void onSystemStatus(@NonNull SsmInfo.SsmStatusInf statusInf) { - } - - @Override - public void onAutopilotRouteLineId(long lineId) { - - } - - @Override - public void onAutopilotDockerInfo(@NonNull String dockerVersion) { - } - } diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutopilotStatusInfo.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutopilotStatusInfo.kt index 030332407f..afe5bf3a52 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutopilotStatusInfo.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutopilotStatusInfo.kt @@ -70,6 +70,12 @@ open class AutopilotStatusInfo : Serializable, Cloneable { @Volatile var autopilotControlParameters: AutopilotControlParameters? = null + /** + * 是否到站 + */ + @Volatile + var isArriveAtStation: Boolean = false + override fun toString(): String { return "connectIP=$connectIP, connectPort=$connectPort, " + "connectStatus=$connectStatus, connectDescribe=$connectStatusDescribe, version=$version, dockVersion=$dockVersion," + diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt index 70ef154e84..9f614cc914 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt @@ -34,6 +34,7 @@ object CallerAutoPilotStatusListenerManager : CallerBase if (oldValue != newValue) { + fixAtStationState(newValue) M_LISTENERS.forEach { val listener = it.value listener.onAutopilotStatusResponse(newValue) @@ -41,6 +42,19 @@ object CallerAutoPilotStatusListenerManager : CallerBase if (!oldValue.contentEquals(newValue)) { M_LISTENERS.forEach { @@ -105,6 +119,8 @@ object CallerAutoPilotStatusListenerManager : CallerBase