[M1] 自驾相关添加
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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 -> { //
|
||||
|
||||
@@ -313,7 +313,10 @@ abstract class CharterBaseFragment<V : IView?, P : Presenter<V>?>() :
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user