[M2]增加自动驾驶参数
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package com.magic.mogo.och.charter.bean
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2023/2/28
|
||||
*/
|
||||
data class QueryRoutesResponse(var data: Result) : BaseData(){
|
||||
|
||||
data class Result(
|
||||
var csvFileUrl : String = "" ,
|
||||
|
||||
var csvFileMd5 : String = "" ,//轨迹文件md5,默认“”
|
||||
|
||||
var txtFileUrl : String = "" ,//打点文件下载的cos url,默认“”
|
||||
|
||||
var txtFileMd5 : String = "", //轨迹文件md5,默认“”
|
||||
|
||||
var contrailSaveTime : Long = 0,//上传轨迹完成时间戳ms:用于MEC本地手动导入轨迹验证时不会被云端轨迹覆盖
|
||||
|
||||
var carModel : String = "" ,//[optional] 车型号(如红旗H9),默认“”,暂不加入校验逻辑、用于人工排查问题
|
||||
|
||||
var csvFileUrlDPQP : String = "", //轨迹文件下载的cos url,默认“”
|
||||
|
||||
var csvFileMd5DPQP : String = "", //轨迹文件md5,默认“”
|
||||
|
||||
var txtFileUrlDPQP : String = "" ,//打点文件下载的cos url,默认“”
|
||||
|
||||
var txtFileMd5DPQP : String = "" ,//轨迹文件md5,默认“”
|
||||
|
||||
var contrailSaveTimeDPQP : Long = 0//上传轨迹完成时间戳ms:用于MEC本地手动导入轨迹验证时不会被云端轨迹覆盖
|
||||
)
|
||||
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import com.magic.mogo.och.charter.R
|
||||
import com.magic.mogo.och.charter.bean.CheckOrderCountDownResponse
|
||||
import com.magic.mogo.och.charter.bean.QueryBusinessStatusResponse
|
||||
import com.magic.mogo.och.charter.bean.QueryCurrentOrderResponse
|
||||
import com.magic.mogo.och.charter.bean.QueryRoutesResponse
|
||||
import com.magic.mogo.och.charter.callback.ChangeDestCallback
|
||||
import com.magic.mogo.och.charter.callback.DriverM1OrderCallback
|
||||
import com.magic.mogo.och.charter.callback.IDriverM1ControllerStatusCallback
|
||||
@@ -25,8 +26,6 @@ import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.data.telematic.TelematicConstant
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.setIPCDemoMode
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.setIgnoreConditionDraw
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.startAutoPilot
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
@@ -91,6 +90,8 @@ class DriverM1Model {
|
||||
|
||||
private var currentChangeDestMsg: ChangeDestMsg? = null
|
||||
|
||||
private var mCurrentResult: QueryRoutesResponse.Result? = null
|
||||
|
||||
//0: 代表没有启动过 1代表是启动第一次,当>=1 代表是重试 每次到站/路线结束清空置为0
|
||||
|
||||
private var loginService: LoginService? = null
|
||||
@@ -472,8 +473,8 @@ class DriverM1Model {
|
||||
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(null)
|
||||
}
|
||||
|
||||
fun initAutopilotControlParameters(): AutopilotControlParameters? {
|
||||
if ( mCurrentOrder == null) return null
|
||||
private fun initAutopilotControlParameters(): AutopilotControlParameters? {
|
||||
if ( mCurrentOrder == null || mCurrentResult == null) return null
|
||||
var parameters = AutopilotControlParameters()
|
||||
parameters.routeID = mCurrentOrder?.lineId!!
|
||||
parameters.routeName = mCurrentOrder?.lineName!!
|
||||
@@ -486,17 +487,17 @@ class DriverM1Model {
|
||||
parameters.endLatLon =
|
||||
AutopilotControlParameters.AutoPilotLonLat(mCurrentOrder?.wgs84Lat!!, mCurrentOrder?.wgs84Lon!!)
|
||||
parameters.vehicleType = VEHICLE_TYPE
|
||||
// if (parameters.autoPilotLine == null) {
|
||||
// parameters.autoPilotLine = AutopilotControlParameters.AutoPilotLine(
|
||||
// busRoutesResult.getLineId(),
|
||||
// busRoutesResult.csvFileUrl, busRoutesResult.csvFileMd5,
|
||||
// busRoutesResult.txtFileUrl, busRoutesResult.txtFileMd5,
|
||||
// busRoutesResult.contrailSaveTime, busRoutesResult.carModel,
|
||||
// busRoutesResult.csvFileUrlDPQP, busRoutesResult.csvFileMd5DPQP,
|
||||
// busRoutesResult.txtFileUrlDPQP, busRoutesResult.txtFileMd5DPQP,
|
||||
// busRoutesResult.contrailSaveTimeDPQP
|
||||
// )
|
||||
// }
|
||||
if (parameters.autoPilotLine == null) {
|
||||
parameters.autoPilotLine = AutopilotControlParameters.AutoPilotLine(
|
||||
mCurrentOrder!!.lineId.toLong(),
|
||||
mCurrentResult!!.csvFileUrl, mCurrentResult!!.csvFileMd5,
|
||||
mCurrentResult!!.txtFileUrl, mCurrentResult!!.txtFileMd5,
|
||||
mCurrentResult!!.contrailSaveTime, mCurrentResult!!.carModel,
|
||||
mCurrentResult!!.csvFileUrlDPQP, mCurrentResult!!.csvFileMd5DPQP,
|
||||
mCurrentResult!!.txtFileUrlDPQP, mCurrentResult!!.txtFileMd5DPQP,
|
||||
mCurrentResult!!.contrailSaveTimeDPQP!!
|
||||
)
|
||||
}
|
||||
return parameters
|
||||
}
|
||||
|
||||
@@ -579,6 +580,7 @@ class DriverM1Model {
|
||||
mCurrentOrder = data.data
|
||||
mOrderCallback?.updateOrderUI(data.data)
|
||||
// 倒计时校验开始
|
||||
checkoutContrail()
|
||||
checkOrderCountDown()
|
||||
}
|
||||
|
||||
@@ -641,4 +643,22 @@ class DriverM1Model {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun checkoutContrail(){
|
||||
if (mCurrentOrder == null) return
|
||||
DriverM1ServiceManager.checkoutContrail(mContext,mCurrentOrder!!.lineId,
|
||||
object : OchCommonServiceCallback<QueryRoutesResponse>{
|
||||
override fun onSuccess(data: QueryRoutesResponse?) {
|
||||
if (data == null || data.code != 0) return
|
||||
d(SceneConstant.M_CHARTER_D + TAG, "checkoutContrail-=="
|
||||
+ GsonUtils.toJson(data.data))
|
||||
mCurrentResult = data.data
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String?) {
|
||||
d(SceneConstant.M_CHARTER_D + TAG, "checkoutContrail-onFail== $msg .")
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,7 @@
|
||||
package com.magic.mogo.och.charter.net
|
||||
|
||||
import android.content.Context
|
||||
import com.magic.mogo.och.charter.bean.CheckOrderCountDownResponse
|
||||
import com.magic.mogo.och.charter.bean.QueryBusinessStatusResponse
|
||||
import com.magic.mogo.och.charter.bean.QueryCurrentOrderResponse
|
||||
import com.magic.mogo.och.charter.bean.RequestChangeDest
|
||||
import com.magic.mogo.och.charter.bean.*
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
@@ -78,4 +75,16 @@ object DriverM1ServiceManager {
|
||||
?.subscribe(OchCommonSubscribeImpl(context!!, callback, "changeDest"))
|
||||
}
|
||||
|
||||
fun checkoutContrail(context: Context?,lineId: Int,
|
||||
callback: OchCommonServiceCallback<QueryRoutesResponse>?){
|
||||
mDriverM1ServiceApi.checkoutContrail(MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
MoGoAiCloudClientConfig.getInstance().sn,
|
||||
lineId
|
||||
)?.transformTry()
|
||||
?.subscribe(OchCommonSubscribeImpl(context!!, callback, "checkOrderCountDown"))
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,9 +1,6 @@
|
||||
package com.magic.mogo.och.charter.net
|
||||
|
||||
import com.magic.mogo.och.charter.bean.CheckOrderCountDownResponse
|
||||
import com.magic.mogo.och.charter.bean.QueryBusinessStatusResponse
|
||||
import com.magic.mogo.och.charter.bean.QueryCurrentOrderResponse
|
||||
import com.magic.mogo.och.charter.bean.RequestChangeDest
|
||||
import com.magic.mogo.och.charter.bean.*
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import io.reactivex.Observable
|
||||
import retrofit2.http.*
|
||||
@@ -52,4 +49,11 @@ interface IDriverM1Service {
|
||||
@GET("/och-rental-cabin/api/business/v1/driver/queryBusinessTime")
|
||||
fun checkOrderCountDown(@Header("appId") appId: String?, @Header("ticket") ticket: String?,
|
||||
@Query("sn") sn: String?): Observable<CheckOrderCountDownResponse>?
|
||||
|
||||
@Headers("Content-type:application/json;charset=UTF-8")
|
||||
@GET("/och-rental-cabin/api/business/v1/driver/contrail")
|
||||
fun checkoutContrail(@Header("appId") appId: String?, @Header("ticket") ticket: String?,
|
||||
@Query("sn") sn: String?
|
||||
,@Query("lineId") lineId:Int): Observable<QueryRoutesResponse>?
|
||||
|
||||
}
|
||||
@@ -14,7 +14,7 @@ import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
object OCHSocketMessageManager {
|
||||
const val msgMonitorType:Int = 6295553 //后台运营消息
|
||||
const val msgWriteOffPassengerType:Int = 6295554 //核销消息
|
||||
const val msgOperateDoorType = 6295554 // 开/关门消息
|
||||
const val msgOperateDoorType = 6295556 // 开/关门消息
|
||||
const val msgOrderClosedType = 6295555 //订单结束消息
|
||||
|
||||
const val OPERATION_SYSTEM: Int = -1 // 运营消息 默认是次消息类型
|
||||
|
||||
Reference in New Issue
Block a user