From 5afaa79ea79ee8d745ff4681d16600c93a4394d0 Mon Sep 17 00:00:00 2001 From: yangyakun Date: Wed, 18 Dec 2024 14:44:00 +0800 Subject: [PATCH] =?UTF-8?q?[6.8.4]=20[fix]=20[=E6=9C=89=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=20=E5=B0=B1=E8=A6=81=E8=AE=BE=E7=BD=AE=E4=B8=8A=E8=87=AA?= =?UTF-8?q?=E9=A9=BE=E4=BF=A1=E6=81=AF]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/manager/scnner/ScannerManager.kt | 1 - .../weaknet/passenger/model/CommonModel.kt | 76 +++++++++---------- 2 files changed, 38 insertions(+), 39 deletions(-) diff --git a/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/scnner/ScannerManager.kt b/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/scnner/ScannerManager.kt index bbc1de9de4..3eb351e1a6 100644 --- a/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/scnner/ScannerManager.kt +++ b/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/scnner/ScannerManager.kt @@ -230,7 +230,6 @@ object ScannerManager : IOchLanPassengerStatusListener { } override fun onDriverConnectChangeListener(isConnect: Boolean) { - super.onDriverConnectChangeListener(isConnect) if (isConnect) { sendScannerState() } diff --git a/OCH/shuttle/passenger_weaknet/src/main/java/com/mogo/och/shuttle/weaknet/passenger/model/CommonModel.kt b/OCH/shuttle/passenger_weaknet/src/main/java/com/mogo/och/shuttle/weaknet/passenger/model/CommonModel.kt index 17695f2988..ea68602ad5 100644 --- a/OCH/shuttle/passenger_weaknet/src/main/java/com/mogo/och/shuttle/weaknet/passenger/model/CommonModel.kt +++ b/OCH/shuttle/passenger_weaknet/src/main/java/com/mogo/och/shuttle/weaknet/passenger/model/CommonModel.kt @@ -49,7 +49,7 @@ import kotlin.math.abs @SuppressLint("StaticFieldLeak") object CommonModel { - private val TAG: String = CommonModel::class.java.simpleName + private val TAG: String = SceneConstant.M_BUS_P+CommonModel::class.java.simpleName var mContext: Context? = null @@ -106,24 +106,22 @@ object CommonModel { } - val connectDriverListener = object : IOchLanPassengerStatusListener { + private val connectDriverListener = object : IOchLanPassengerStatusListener { // 和司机屏连接发生变化后 override fun onDriverConnectChangeListener(isConnect: Boolean) { - super.onDriverConnectChangeListener(isConnect) if(isConnect){ queryDriverByLocalDriver() } } // 司机屏sn 发生变化后 override fun onDriverSnChagneListner(sn: String?) { - super.onDriverSnChagneListner(sn) sn?.let { querySiteIntroduce() } } } - val mMapLocationListener: IMoGoChassisLocationGCJ02Listener = + private val mMapLocationListener: IMoGoChassisLocationGCJ02Listener = object : IMoGoChassisLocationGCJ02Listener { override fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) { if (null == mogoLocation) return @@ -131,11 +129,11 @@ object CommonModel { } } - val mAutoPilotStatusListener: IOchAutopilotStatusListener = + private val mAutoPilotStatusListener: IOchAutopilotStatusListener = object : IOchAutopilotStatusListener { override fun onAutopilotStatusResponse(state: Int) { - d(SceneConstant.M_BUS_P, "onAutopilotStatusResponse ===== $state") + d(TAG, "onAutopilotStatusResponse ===== $state") if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING != state){ //美化模式下且行程中 if (FunctionBuildConfig.isDemoMode && @@ -152,10 +150,10 @@ object CommonModel { } } - val trajectoryListener: IDistanceListener = object : IDistanceListener { + private val trajectoryListener: IDistanceListener = object : IDistanceListener { override fun distanceCallback(distance: Float) { val lastTime = distance / BusPassengerConst.BUS_AVERAGE_SPEED * 3.6 //秒 - d(SceneConstant.M_BUS_P, "轨迹排查==lastSumLength = $distance") + d(TAG, "轨迹排查==lastSumLength = $distance") if (routesResult != null) { for (site in routesResult!!.sites) { if (site.drivingStatus == BusPassengerConst.STATION_STATUS_STOPPED && !site.isLeaving) { @@ -180,7 +178,7 @@ object CommonModel { } } - val typeTaskDetails = object : ILanMessageListener { + private val typeTaskDetails = object : ILanMessageListener { override fun targetLan(): Class { return TaskDetailsMsg::class.java } @@ -189,11 +187,13 @@ object CommonModel { first?.let { if (first.msg?.isEmpty() == true) { + clearAutopilotControlParameters() clearLocalRouteResult() return } val result = GsonUtils.fromJson(first.msg, BusTransferData::class.java) if (result != null && result.routesResult == null) { + clearAutopilotControlParameters() clearLocalRouteResult() } @@ -236,11 +236,11 @@ object CommonModel { } if (routesResult != null && routesResult!!.lineId != result.lineId) { - d(SceneConstant.M_BUS_P + TAG, "lineId change= clearCustomPolyline") + d(TAG, "lineId change= clearCustomPolyline") mCommonCallback?.clearCustomPolyline() } - d(SceneConstant.M_BUS_P + TAG, "queryDriverSiteByCoordinate = update") + d(TAG, "queryDriverSiteByCoordinate = update") routesResult = result if (result.sites != null) { @@ -253,27 +253,27 @@ object CommonModel { mCommonCallback?.updateLineStations(mStations) for (i in stations.indices) { val station = stations[i] - if (station.drivingStatus == BusPassengerConst.STATION_STATUS_STOPPED - && station.isLeaving && i + 1 < stations.size - ) { - isGoingToNextStation = true - mCommonCallback?.updateStationsInfo(stations, i + 1, false) - mNextStationIndex = i + 1 - val startStation = mStations[i] - val endStation = mStations[i + 1] - startStationVideo(endStation) - setTrajectoryStation(startStation, endStation, result.lineId) + if(station.drivingStatus == BusPassengerConst.STATION_STATUS_STOPPED){ updateAutopilotControlParameters(result, i) - return - } else if (station.drivingStatus == BusPassengerConst.STATION_STATUS_STOPPED && !station.isLeaving) { - if (i == stations.size - 1) { - cleanStation("updatePassengerRouteInfo最后一个站点") + if (station.isLeaving && i + 1 < stations.size + ) { + isGoingToNextStation = true + mCommonCallback?.updateStationsInfo(stations, i + 1, false) + mNextStationIndex = i + 1 + val startStation = mStations[i] + val endStation = mStations[i + 1] + startStationVideo(endStation) + setTrajectoryStation(startStation, endStation, result.lineId) + return + } else if (!station.isLeaving) { + if (i == stations.size - 1) { + cleanStation("updatePassengerRouteInfo最后一个站点") + } + isGoingToNextStation = false + Logger.d(TAG, "order = station= arrive") + mCommonCallback?.updateStationsInfo(stations, i, true) + return } - isGoingToNextStation = false - Logger.d(SceneConstant.M_BUS_P + TAG, "order = station= arrive") - mCommonCallback?.updateStationsInfo(stations, i, true) - clearAutopilotControlParameters() - return } } } @@ -315,16 +315,16 @@ object CommonModel { } } - fun updateAutopilotControlParameters( + private fun updateAutopilotControlParameters( busRoutesResult: BusRoutesResult, leaveIndex: Int ) { val parameters = initAutopilotControlParameters(busRoutesResult, leaveIndex) if (null == parameters) { - CallerLogger.e(SceneConstant.M_BUS_P, "AutopilotControlParameters is empty.") + CallerLogger.e(TAG, "AutopilotControlParameters is empty.") return } - CallerLogger.d(SceneConstant.M_BUS_P, "AutopilotControlParameters is update.") + d(TAG, "AutopilotControlParameters is update.") CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(parameters) } @@ -338,7 +338,7 @@ object CommonModel { } val stations = busRoutesResult.sites if (leaveIndex + 1 > stations.size - 1) { - CallerLogger.e(SceneConstant.M_BUS_P, "行程日志-mismatch condition1.") + CallerLogger.e(TAG, "行程日志-mismatch condition1.") return null } val currentStation = stations[leaveIndex] @@ -368,7 +368,7 @@ object CommonModel { } fun clearAutopilotControlParameters() { - CallerLogger.d(SceneConstant.M_BUS_P, "AutopilotControlParameters is clear.") + d(TAG, "AutopilotControlParameters is clear.") CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(null) } @@ -400,8 +400,8 @@ object CommonModel { TrajectoryAndDistanceManager.setStationPoint(startStation, endStation, lineId.toLong()) } - fun cleanStation(type: String) { - d(SceneConstant.M_BUS_P, "清理站点:$type") + private fun cleanStation(type: String) { + d(TAG, "清理站点:$type") TrajectoryAndDistanceManager.setStationPoint(null, null, -1L) }