diff --git a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/OrderModel.kt b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/OrderModel.kt index d3af694c21..7f1bd5f27a 100644 --- a/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/OrderModel.kt +++ b/OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/model/OrderModel.kt @@ -134,7 +134,7 @@ object OrderModel { } // 在站点15m内且启动自动驾驶成功后播报,每次启动仅播报1次 private fun calculateDistanceAndAutoStatus() { - val (start, end) = LineManager.getStations() + val (start, _) = LineManager.getStations() if(start==null){ BizLoopManager.removeLoopFunction(TAG) }else{ @@ -280,7 +280,7 @@ object OrderModel { override fun onError(e: Throwable) { d(TAG, "onError${e.printStackTrace()}") if (e is DataException) { - + e.printStackTrace() } LineModel.leaveStationSuccess() isArrivedStation = false @@ -430,6 +430,9 @@ object OrderModel { OchChainLogManager.writeChainLog("shuttle弱网","$type 行程日志-到站异常,取消后续操作结束") return } + if(data!=null) { + d(TAG,"地盘到站${data}") + } //MAP 280 每隔100ms左右返回一次到站, 导致在到达中间站后再次滑动出发后会有时间差,收到一次到站,出现问题 //此处比对 自驾告诉的到站站点坐标和本地应到站站点坐标, 一致时才能到站 @@ -440,62 +443,57 @@ object OrderModel { OchChainLogManager.writeChainLog("触发进站", type) isArrivedStation = true isGoingToNextStation = false + start.drivingStatus = TaskSiteDataBean.drivingStatusPassed + start.isLeaving = false + end.drivingStatus = TaskSiteDataBean.drivingStatusCurrent + RepositoryManager.arriveStation(end.seq,end.siteId.toLong(), LineModel.currentTask?.taskId?:0L) + ?.subscribeOn(Schedulers.io()) + ?.observeOn(AndroidSchedulers.mainThread()) + ?.subscribe(object : Observer { + override fun onSubscribe(d: Disposable) { + d(TAG, "onSubscribe") + } - LineManager.getStations { start, end -> - start.drivingStatus = TaskSiteDataBean.drivingStatusPassed - start.isLeaving = false - end.drivingStatus = TaskSiteDataBean.drivingStatusCurrent - RepositoryManager.arriveStation(end.seq,end.siteId.toLong(), LineModel.currentTask?.taskId?:0L) - ?.subscribeOn(Schedulers.io()) - ?.observeOn(AndroidSchedulers.mainThread()) - ?.subscribe(object : Observer { - override fun onSubscribe(d: Disposable) { - d(TAG, "onSubscribe") + override fun onError(e: Throwable) { + d(TAG, "onError${e.printStackTrace()}") + if (e is DataException) { + e.printStackTrace() } - - override fun onError(e: Throwable) { - d(TAG, "onError${e.printStackTrace()}") - if (e is DataException) { - - } - ThirdDeviceData.arriveStation() - d(TAG, "arrivedStation onComplete") - LineModel.stationList?.let { - LineModel.startStationIndex +=1 - val startStation = LineManager.getStations().second - if(LineModel.startStationIndex +1< it.size){ - val endStation = it[LineModel.startStationIndex +1] - LineManager.setStartAndEndStation(startStation,endStation) - LineModel.callEyeMap(5) - } - } - LineModel.arrivedStationSuccess() - updateBusStatus() - } - - override fun onComplete() { - ThirdDeviceData.arriveStation() - d(TAG, "arrivedStation onComplete") - LineModel.stationList?.let { - LineModel.startStationIndex +=1 - val startStation = LineManager.getStations().second - if(LineModel.startStationIndex +1< it.size){ - val endStation = it[LineModel.startStationIndex +1] - LineManager.setStartAndEndStation(startStation,endStation) - LineModel.callEyeMap(6) - } - } - LineModel.arrivedStationSuccess() - updateBusStatus() - } - - override fun onNext(data: Boolean) { - if (data) { - + ThirdDeviceData.arriveStation() + d(TAG, "arrivedStation onComplete") + LineModel.stationList?.let { + LineModel.startStationIndex +=1 + val startStation = LineManager.getStations().second + if(LineModel.startStationIndex +1< it.size){ + val endStation = it[LineModel.startStationIndex +1] + LineManager.setStartAndEndStation(startStation,endStation) + LineModel.callEyeMap(5) } } - }) - } + LineModel.arrivedStationSuccess() + updateBusStatus() + } + + override fun onComplete() { + ThirdDeviceData.arriveStation() + d(TAG, "arrivedStation onComplete") + LineModel.stationList?.let { + LineModel.startStationIndex +=1 + val startStation = LineManager.getStations().second + if(LineModel.startStationIndex +1< it.size){ + val endStation = it[LineModel.startStationIndex +1] + LineManager.setStartAndEndStation(startStation,endStation) + LineModel.callEyeMap(6) + } + } + LineModel.arrivedStationSuccess() + updateBusStatus() + } + + override fun onNext(data: Boolean) { + + } + }) } @@ -518,7 +516,7 @@ object OrderModel { OchChainLogManager.writeChainLog("错误","${e.message}") } MapMakerManager.removeAllMapMarkerByOwner(TAG) - BusTrajectoryManager.stopTrajReqLoop(); + BusTrajectoryManager.stopTrajReqLoop() LoginStatusManager.loginOut() } }