From 3603487d85978452024c6dae3252afeb9ec5004d Mon Sep 17 00:00:00 2001 From: wangmingjun Date: Mon, 27 Feb 2023 17:40:28 +0800 Subject: [PATCH] =?UTF-8?q?[M1]=20=E8=87=AA=E9=A9=BE=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo/och/charter/model/DriverM1Model.kt | 40 +++++++------------ .../charter/presenter/DriverM1Presenter.kt | 8 +--- .../och/charter/base/CharterBaseFragment.kt | 5 ++- 3 files changed, 21 insertions(+), 32 deletions(-) diff --git a/OCH/mogo-och-charter/src/driverm1/java/com/magic/mogo/och/charter/model/DriverM1Model.kt b/OCH/mogo-och-charter/src/driverm1/java/com/magic/mogo/och/charter/model/DriverM1Model.kt index dd048a79db..462b847534 100644 --- a/OCH/mogo-och-charter/src/driverm1/java/com/magic/mogo/och/charter/model/DriverM1Model.kt +++ b/OCH/mogo-och-charter/src/driverm1/java/com/magic/mogo/och/charter/model/DriverM1Model.kt @@ -31,7 +31,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager -import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager.sendMsgToAllClients import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant @@ -78,6 +77,9 @@ class DriverM1Model { private val MSG_QUERY_BUS_STATION: Int = 1001 private val QUERY_BUS_STATION_DELAY: Long = 5000 + // 运营类型 + private val VEHICLE_TYPE = 10 + private var mControllerStatusCallback //Model->Presenter:VR mode等 : IDriverM1ControllerStatusCallback? = null @@ -493,33 +495,21 @@ class DriverM1Model { } fun initAutopilotControlParameters(): AutopilotControlParameters? { -// var currentStation: BusStationBean? = null -// var nextStation: BusStationBean? = null -// if (leaveIndex < 0) { -// if (backgroundCurrentStationIndex + 1 > stationList!!.size - 1 || !isGoingToNextStation) { -// e(SceneConstant.M_BUS + TAG, "行程日志-mismatch condition1.") -// return null -// } -// currentStation = stationList[backgroundCurrentStationIndex] -// nextStation = stationList[backgroundCurrentStationIndex + 1] -// } else { -// if (leaveIndex + 1 > stationList!!.size - 1 || !isGoingToNextStation) { -// e(SceneConstant.M_BUS + TAG, "行程日志-mismatch condition2.") -// return null -// } -// currentStation = stationList[leaveIndex] -// nextStation = stationList[leaveIndex + 1] -// } + if ( mCurrentOrder == null) return null var parameters = AutopilotControlParameters() -// parameters.routeID = busRoutesResult.getLineId() -// parameters.routeName = busRoutesResult.getName() + parameters.routeID = mCurrentOrder?.lineId!! + parameters.routeName = mCurrentOrder?.lineName!! // parameters.startName = PinYinUtil.getPinYinHeadChar(currentStation.getName()) -// parameters.endName = PinYinUtil.getPinYinHeadChar(nextStation.getName()) -// parameters.startLatLon = AutoPilotLonLat(currentStation.getLat(), currentStation.getLon()) -// parameters.endLatLon = AutoPilotLonLat(nextStation.getLat(), nextStation.getLon()) -// parameters.vehicleType = VEHICLE_TYPE + parameters.endName = PinYinUtil.getPinYinHeadChar(mCurrentOrder?.siteName) + parameters.startLatLon = AutopilotControlParameters.AutoPilotLonLat( + mLatitude, + mLongitude + ) + parameters.endLatLon = + AutopilotControlParameters.AutoPilotLonLat(mCurrentOrder?.wgs84Lat!!, mCurrentOrder?.wgs84Lon!!) + parameters.vehicleType = VEHICLE_TYPE // if (parameters.autoPilotLine == null) { -// parameters.autoPilotLine = AutoPilotLine( +// parameters.autoPilotLine = AutopilotControlParameters.AutoPilotLine( // busRoutesResult.getLineId(), // busRoutesResult.csvFileUrl, busRoutesResult.csvFileMd5, // busRoutesResult.txtFileUrl, busRoutesResult.txtFileMd5, diff --git a/OCH/mogo-och-charter/src/driverm1/java/com/magic/mogo/och/charter/presenter/DriverM1Presenter.kt b/OCH/mogo-och-charter/src/driverm1/java/com/magic/mogo/och/charter/presenter/DriverM1Presenter.kt index 57ee0946ec..84f35c4a7c 100644 --- a/OCH/mogo-och-charter/src/driverm1/java/com/magic/mogo/och/charter/presenter/DriverM1Presenter.kt +++ b/OCH/mogo-och-charter/src/driverm1/java/com/magic/mogo/och/charter/presenter/DriverM1Presenter.kt @@ -109,12 +109,8 @@ class DriverM1Presenter(view: DriverM1Fragment?) : val status = autoPilotStatusInfo.state if (mCurrentAutopilotStatus == status) return - if (FunctionBuildConfig.isDemoMode){ //todo 此处要加上判断订单状态 美化模式生效 - mView?.onAutopilotStatusChanged(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) - }else{ - mView?.onAutopilotStatusChanged(status) - } - + mView?.onAutopilotStatusChanged(status) + mCurrentAutopilotStatus = status // when(status){ // // IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE -> { // diff --git a/OCH/mogo-och-charter/src/main/java/com/magic/mogo/och/charter/base/CharterBaseFragment.kt b/OCH/mogo-och-charter/src/main/java/com/magic/mogo/och/charter/base/CharterBaseFragment.kt index a14e3c85bc..02cc66f32c 100644 --- a/OCH/mogo-och-charter/src/main/java/com/magic/mogo/och/charter/base/CharterBaseFragment.kt +++ b/OCH/mogo-och-charter/src/main/java/com/magic/mogo/och/charter/base/CharterBaseFragment.kt @@ -313,7 +313,10 @@ abstract class CharterBaseFragment?>() : ctvAutopilotStatusIv!!.setImageResource(R.drawable.bus_disable_autopilot_icon) ctvAutopilotStatus!!.isSelected = false ctvAutopilotStatus!!.isClickable = true - } else { + } else if (IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING + == autopilotStatus){ + //todo 处理平行驾驶 + }else{ ctvAutopilotStatusTv!!.setTextColor(resources.getColor(R.color.bus_autopilot_text_color_normal)) ctvAutopilotStatusTv!!.text = resources.getString(R.string.bus_loading_autopilot_runnig_tv)