[M1] 司机端增加运营消息盒子
This commit is contained in:
@@ -13,6 +13,8 @@ data class QueryCurrentOrderResponse(var data: Result):BaseData(){ //线路id ,
|
||||
var orderNo: String,
|
||||
var lineId: Int,
|
||||
var lineName: String,
|
||||
var startSiteId: String,
|
||||
var startSiteName: String,
|
||||
var siteId: Int,
|
||||
var siteName: String,
|
||||
var wgs84Lon: Double,
|
||||
|
||||
@@ -4,4 +4,4 @@ package com.magic.mogo.och.charter.bean
|
||||
* @author: wangmingjun
|
||||
* @date: 2023/2/24
|
||||
*/
|
||||
data class RequestChangeDest(var sn: String,var lineId: Int,var siteId: Int)
|
||||
data class RequestChangeDest(var sn: String,var lineId: Int,var startSiteId: Int,var siteId: Int)
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
package com.magic.mogo.och.charter.callback
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
|
||||
/**
|
||||
* Created on 2021/9/10
|
||||
*
|
||||
* Model->Presenter回调:状态控制器监听(accOn、adas ui show、voice ui show、push ui show、v2x ui show等等)
|
||||
*/
|
||||
interface IDriverM1ControllerStatusCallback {
|
||||
// 自车定位
|
||||
fun onCarLocationChanged(location: MogoLocation?)
|
||||
|
||||
//开始开启自动驾驶
|
||||
fun startOpenAutopilot()
|
||||
|
||||
//启动自驾失败
|
||||
fun onStartAdasFailure()
|
||||
}
|
||||
@@ -61,7 +61,7 @@ class DriverM1Fragment : CharterBaseFragment<DriverM1Fragment?, DriverM1Presente
|
||||
fun updateOrderUI(orderStatus: QueryCurrentOrderResponse.Result){
|
||||
requireActivity().runOnUiThread {
|
||||
driverm1_line_name.text = orderStatus.lineName
|
||||
driverm1StationName1Tv.text = "" //todo 更新
|
||||
driverm1StationName1Tv.text = orderStatus.startSiteName
|
||||
driverm1StationName2Tv.text = orderStatus.siteName
|
||||
passenger_phone.text = orderStatus.passengerPhone
|
||||
during_time.text = String.format(resources.getString(R.string.during_time_tv),
|
||||
|
||||
@@ -6,12 +6,12 @@ import android.os.Handler
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.alibaba.android.arouter.utils.TextUtils
|
||||
import com.elegant.network.utils.GsonUtil
|
||||
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.callback.ChangeDestCallback
|
||||
import com.magic.mogo.och.charter.callback.DriverM1OrderCallback
|
||||
import com.magic.mogo.och.charter.callback.IADASStatusCallback
|
||||
import com.magic.mogo.och.charter.callback.IDriverM1ControllerStatusCallback
|
||||
import com.magic.mogo.och.charter.net.DriverM1ServiceManager
|
||||
import com.mogo.aicloud.services.socket.IMogoOnMessageListener
|
||||
@@ -83,8 +83,6 @@ class DriverM1Model {
|
||||
private var mControllerStatusCallback //Model->Presenter:VR mode等
|
||||
: IDriverM1ControllerStatusCallback? = null
|
||||
|
||||
private var mADASStatusCallback: IADASStatusCallback? = null
|
||||
|
||||
private var mOrderCallback: DriverM1OrderCallback? = null
|
||||
|
||||
private var mChangeDestCallback: ChangeDestCallback? = null
|
||||
@@ -121,6 +119,7 @@ class DriverM1Model {
|
||||
mContext = AbsMogoApplication.getApp()
|
||||
// 定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, mMapLocationListener)
|
||||
CallerChassisLocationGCJ02ListenerManager.setListenerHz(TAG,2)
|
||||
|
||||
//开启自驾后 异常信息返回
|
||||
OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(mAdasStartFailureListener)
|
||||
@@ -181,99 +180,19 @@ class DriverM1Model {
|
||||
}
|
||||
if (e is IllegalStateException) {
|
||||
// that's a bug in RxJava or in a custom operator
|
||||
d(SceneConstant.M_BUS + TAG, "IllegalStateException")
|
||||
d(SceneConstant.M_CHARTER_D + TAG, "IllegalStateException")
|
||||
Thread.currentThread().uncaughtExceptionHandler.uncaughtException(
|
||||
Thread.currentThread(),
|
||||
e
|
||||
)
|
||||
return
|
||||
}
|
||||
d(SceneConstant.M_BUS + TAG, "Undeliverable exception")
|
||||
d(SceneConstant.M_CHARTER_D + TAG, "Undeliverable exception")
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 接收乘客屏发来确认信息
|
||||
*/
|
||||
private val mReceivedMsgListener: IReceivedMsgListener =
|
||||
object : IReceivedMsgListener {
|
||||
override fun onReceivedMsg(type: Int, byteArray: ByteArray) {
|
||||
if (TelematicConstant.BUSINESS_STRING == type){
|
||||
try {
|
||||
val msg = GsonUtils.fromJson(String(byteArray),
|
||||
BaseDPMsg::class.java) as BaseDPMsg
|
||||
if (msg.type == DPMsgType.TYPE_CHANGE_DEST.type){
|
||||
val changeDestMsg = GsonUtils.fromJson(String(byteArray),
|
||||
ChangeDestMsg::class.java) as ChangeDestMsg
|
||||
currentChangeDestMsg = changeDestMsg
|
||||
showChangerDestCommitDialog(changeDestMsg)
|
||||
}
|
||||
d(SceneConstant.M_CHARTER_D,"onReceivedMsg = "+ GsonUtils.toJson(msg))
|
||||
}catch (e: Exception){
|
||||
d(SceneConstant.M_CHARTER_D,"onReceivedMsg = "+"消息解析错误")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun showChangerDestCommitDialog(changeDestMsg: ChangeDestMsg) {
|
||||
if (changeDestMsg.destSiteName !== ""){
|
||||
UiThreadHandler.post{
|
||||
mChangeDestCallback?.showCommitDialog("确认站点",
|
||||
"请确认是否前往"+ changeDestMsg.destSiteName + "站点")
|
||||
}
|
||||
}else if (changeDestMsg.lineName !== ""){
|
||||
UiThreadHandler.post{
|
||||
mChangeDestCallback?.showCommitDialog("确认路线",
|
||||
"请确认是否切换"+ changeDestMsg.lineName + "路线")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val mMogoOnMessageListener =
|
||||
object : IMogoOnMessageListener<DataBaseMsg> {
|
||||
override fun onMsgReceived(obj: DataBaseMsg) {
|
||||
if (obj == null) {
|
||||
d(SceneConstant.M_CHARTER_D + TAG, "onMsgReceived = null")
|
||||
return
|
||||
}
|
||||
d(SceneConstant.M_CHARTER_D + TAG, "onMsgReceived = " + obj.msgType)
|
||||
|
||||
when(obj.msgType){
|
||||
OCHSocketMessageManager.msgMonitorType ->{
|
||||
val msg = obj as SystemMsg
|
||||
pushAppOperationalMsgBox(obj.pushTimeStamp, msg.context)
|
||||
|
||||
val list = msg.screenList
|
||||
if (list.size > 1){ //发送乘客屏
|
||||
}
|
||||
}
|
||||
OCHSocketMessageManager.msgOperateDoorType ->{
|
||||
val msg = obj as OperateDoorMsg
|
||||
// pushAppOperationalMsgBox(obj.pushTimeStamp, msg.)
|
||||
sendMsgToClient(DPOperateDoorMsg(true))
|
||||
}
|
||||
OCHSocketMessageManager.msgOrderClosedType ->{
|
||||
val msg = obj as OrderCloseMsg
|
||||
pushAppOperationalMsgBox(obj.pushTimeStamp, msg.message)
|
||||
sendMsgToClient(DPOrderClosedMsg())
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun target(): Class<DataBaseMsg> {
|
||||
return DataBaseMsg::class.java
|
||||
}
|
||||
}
|
||||
|
||||
fun setAdasStatusCallback(callback: IADASStatusCallback?) {
|
||||
mADASStatusCallback = callback
|
||||
}
|
||||
|
||||
fun setChangeDestCallback(callback: ChangeDestCallback?){
|
||||
mChangeDestCallback = callback
|
||||
}
|
||||
@@ -300,7 +219,89 @@ class DriverM1Model {
|
||||
)
|
||||
stopLoopAbnormalFactors()
|
||||
}
|
||||
/**
|
||||
* 接收乘客屏发来确认信息
|
||||
*/
|
||||
private val mReceivedMsgListener: IReceivedMsgListener =
|
||||
object : IReceivedMsgListener {
|
||||
override fun onReceivedMsg(type: Int, byteArray: ByteArray) {
|
||||
if (TelematicConstant.BUSINESS_STRING == type){
|
||||
try {
|
||||
val msg = GsonUtils.fromJson(String(byteArray),
|
||||
BaseDPMsg::class.java) as BaseDPMsg
|
||||
if (msg.type == DPMsgType.TYPE_CHANGE_DEST.type){
|
||||
val changeDestMsg = GsonUtils.fromJson(String(byteArray),
|
||||
ChangeDestMsg::class.java) as ChangeDestMsg
|
||||
currentChangeDestMsg = changeDestMsg
|
||||
showChangerDestCommitDialog(changeDestMsg)
|
||||
}
|
||||
d(SceneConstant.M_CHARTER_D,"onReceivedMsg = "+ GsonUtils.toJson(msg))
|
||||
}catch (e: Exception){
|
||||
d(SceneConstant.M_CHARTER_D,"onReceivedMsg = "+"消息解析错误")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun showChangerDestCommitDialog(changeDestMsg: ChangeDestMsg) {
|
||||
if (!TextUtils.isEmpty(changeDestMsg.destSiteName)){
|
||||
UiThreadHandler.post{
|
||||
mChangeDestCallback?.showCommitDialog("确认站点",
|
||||
"请确认是否前往"+ changeDestMsg.destSiteName + "站点")
|
||||
}
|
||||
}else if (!TextUtils.isEmpty(changeDestMsg.lineName)){
|
||||
UiThreadHandler.post{
|
||||
mChangeDestCallback?.showCommitDialog("确认路线",
|
||||
"请确认是否切换"+ changeDestMsg.lineName + "路线")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val mMogoOnMessageListener =
|
||||
object : IMogoOnMessageListener<DataBaseMsg> {
|
||||
override fun onMsgReceived(obj: DataBaseMsg) {
|
||||
if (obj == null) {
|
||||
d(SceneConstant.M_CHARTER_D + TAG, "onMsgReceived = null")
|
||||
return
|
||||
}
|
||||
d(SceneConstant.M_CHARTER_D + TAG, "onMsgReceived = " + obj.msgType)
|
||||
|
||||
when(obj.msgType){
|
||||
OCHSocketMessageManager.msgMonitorType ->{ //运营消息
|
||||
val msg = obj as SystemMsg
|
||||
pushOperationalToMsgBox(obj.pushTimeStamp, msg.context)
|
||||
val list = msg.screenList
|
||||
if (list.size > 1){ //发送乘客屏
|
||||
sendMsgToClient(DPCommonOperationMsg(msg.context))
|
||||
}
|
||||
}
|
||||
OCHSocketMessageManager.msgOperateDoorType ->{
|
||||
sendMsgToClient(DPOperateDoorMsg(true))
|
||||
}
|
||||
OCHSocketMessageManager.msgOrderClosedType ->{ //订单结束
|
||||
val msg = obj as OrderCloseMsg
|
||||
pushOperationalToMsgBox(obj.pushTimeStamp, msg.message
|
||||
,OCHSocketMessageManager.OPERATION_ORDER_TYPE)
|
||||
sendMsgToClient(DPOrderClosedMsg())
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun target(): Class<DataBaseMsg> {
|
||||
return DataBaseMsg::class.java
|
||||
}
|
||||
}
|
||||
|
||||
fun pushOperationalToMsgBox(time : Long,content : String,type: Int = -1){
|
||||
playDI()
|
||||
pushAppOperationalMsgBox(time, content,type)
|
||||
}
|
||||
|
||||
private fun playDI(){
|
||||
SoundPoolHelper.getSoundPoolHelper().playSoundWithRedId(mContext, R.raw.m1_voice_di)
|
||||
}
|
||||
private val mAdasStartFailureListener: OchAdasStartFailureCallback =
|
||||
object : OchAdasStartFailureCallback {
|
||||
override fun onStartAutopilotFailure(
|
||||
@@ -311,10 +312,10 @@ class DriverM1Model {
|
||||
// .triggerStartAutopilotFailureEventByAdas(startFailedCode, startFailedMessage)
|
||||
// if (mADASStatusCallback != null && !FunctionBuildConfig.isDemoMode) {
|
||||
// e(
|
||||
// SceneConstant.M_BUS + TAG,
|
||||
// SceneConstant.M_CHARTER_D + TAG,
|
||||
// "mAdasStartFailureListener = $startFailedMessage"
|
||||
// )
|
||||
// mADASStatusCallback?.onStartAdasFailure()
|
||||
mControllerStatusCallback?.onStartAdasFailure()
|
||||
// }
|
||||
}
|
||||
}
|
||||
@@ -337,9 +338,6 @@ class DriverM1Model {
|
||||
if (null == gnssInfo) return
|
||||
mLongitude = gnssInfo.longitude
|
||||
mLatitude = gnssInfo.latitude
|
||||
if (mControllerStatusCallback != null) {
|
||||
mControllerStatusCallback?.onCarLocationChanged(gnssInfo)
|
||||
}
|
||||
|
||||
//是否到站的围栏判断 离站状态并且自动驾驶还未触发到站
|
||||
// if (isGoingToNextStation && !isArrivedStation) {
|
||||
@@ -351,7 +349,7 @@ class DriverM1Model {
|
||||
//根据围栏判断,是否到达站点
|
||||
private fun judgeArrivedStation(location: MogoLocation) {
|
||||
// if (backgroundCurrentStationIndex + 1 > stationList!!.size - 1) {
|
||||
// e(SceneConstant.M_BUS + TAG, "到站数组越界")
|
||||
// e(SceneConstant.M_CHARTER_D + TAG, "到站数组越界")
|
||||
// return
|
||||
// }
|
||||
// val upcomingStation: BusStationBean = stationList[backgroundCurrentStationIndex + 1]
|
||||
@@ -363,7 +361,7 @@ class DriverM1Model {
|
||||
// ).toDouble()
|
||||
// if (distance <= CharterConst.ARRIVE_AT_END_STATION_DISTANCE) {
|
||||
// d(
|
||||
// SceneConstant.M_BUS + TAG, "行程日志-judgeArrivedStation() distance = " + distance
|
||||
// SceneConstant.M_CHARTER_D + TAG, "行程日志-judgeArrivedStation() distance = " + distance
|
||||
// + " to " + upcomingStation.getName()
|
||||
// )
|
||||
// onArriveAt(null) //无自动驾驶到站信息传null
|
||||
@@ -388,12 +386,12 @@ class DriverM1Model {
|
||||
triggerStartServiceEvent(true, false)
|
||||
val parameters = initAutopilotControlParameters()
|
||||
if (null == parameters) {
|
||||
d(SceneConstant.M_BUS + TAG, "行程日志-AutopilotControlParameters is empty.")
|
||||
d(SceneConstant.M_CHARTER_D + TAG, "行程日志-AutopilotControlParameters is empty.")
|
||||
return
|
||||
}
|
||||
startAutoPilot(parameters)
|
||||
d(
|
||||
SceneConstant.M_BUS + TAG, "行程日志-开启自动驾驶====" + GsonUtil.jsonFromObject(parameters)
|
||||
SceneConstant.M_CHARTER_D + TAG, "行程日志-开启自动驾驶====" + GsonUtil.jsonFromObject(parameters)
|
||||
+ " startLatLon=" + parameters.startName + ",endLatLon=" + parameters.endName
|
||||
)
|
||||
if (mControllerStatusCallback != null) {
|
||||
@@ -411,7 +409,7 @@ class DriverM1Model {
|
||||
false //是否强制绘制引导线
|
||||
setIgnoreConditionDraw(false) // 同步给乘客屏
|
||||
setIPCDemoMode(false) //是否自动启动自驾
|
||||
d(SceneConstant.M_BUS + TAG, "美化模式-ignore:置为false")
|
||||
d(SceneConstant.M_CHARTER_D + TAG, "美化模式-ignore:置为false")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -433,7 +431,7 @@ class DriverM1Model {
|
||||
* 在踩刹车、控制方向盘等操作后,会停止自动驾驶,重启自动驾驶的话相当于重新设置自动驾驶目的地
|
||||
*/
|
||||
fun restartAutopilot() {
|
||||
d(SceneConstant.M_BUS + TAG, "司机端-启动自动驾驶===$isGoingToNextStation")
|
||||
d(SceneConstant.M_CHARTER_D + TAG, "司机端-启动自动驾驶===$isGoingToNextStation")
|
||||
//只去启动自动驾驶
|
||||
startAutopilot()
|
||||
}
|
||||
@@ -635,11 +633,18 @@ class DriverM1Model {
|
||||
|
||||
fun changeDest(){
|
||||
if (currentChangeDestMsg == null) return
|
||||
if (TextUtils.isEmpty(currentChangeDestMsg?.destSiteName)){//确认路线
|
||||
d(SceneConstant.M_CHARTER_D + TAG, "confirm line .")
|
||||
sendCommitMsgToClient(true)
|
||||
return
|
||||
}
|
||||
DriverM1ServiceManager.changeDest(mContext,currentChangeDestMsg!!.lineId,
|
||||
currentChangeDestMsg!!.startSiteId,
|
||||
currentChangeDestMsg!!.destSiteId,
|
||||
object : OchCommonServiceCallback<BaseData>{
|
||||
override fun onSuccess(data: BaseData?) {
|
||||
if (data != null && data.code == 0){
|
||||
d(SceneConstant.M_CHARTER_D + TAG, "confirmed station .")
|
||||
sendCommitMsgToClient(true)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,11 +69,11 @@ object DriverM1ServiceManager {
|
||||
?.subscribe(OchCommonSubscribeImpl(context!!, callback, "checkOrderCountDown"))
|
||||
}
|
||||
|
||||
fun changeDest(context: Context?,lineId: Int,siteId: Int,
|
||||
fun changeDest(context: Context?,lineId: Int,startSiteId: Int,siteId: Int,
|
||||
callback: OchCommonServiceCallback<BaseData>?){
|
||||
mDriverM1ServiceApi.changeDest(MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
RequestChangeDest(MoGoAiCloudClientConfig.getInstance().sn,lineId,siteId)
|
||||
RequestChangeDest(MoGoAiCloudClientConfig.getInstance().sn,lineId,startSiteId,siteId)
|
||||
)?.transformTry()
|
||||
?.subscribe(OchCommonSubscribeImpl(context!!, callback, "changeDest"))
|
||||
}
|
||||
|
||||
@@ -4,18 +4,22 @@ import androidx.lifecycle.LifecycleOwner
|
||||
import com.magic.mogo.och.charter.bean.QueryCurrentOrderResponse
|
||||
import com.magic.mogo.och.charter.callback.ChangeDestCallback
|
||||
import com.magic.mogo.och.charter.callback.DriverM1OrderCallback
|
||||
import com.magic.mogo.och.charter.callback.IDriverM1ControllerStatusCallback
|
||||
import com.magic.mogo.och.charter.fragment.DriverM1Fragment
|
||||
import com.magic.mogo.och.charter.model.DriverM1Model
|
||||
import com.mogo.commons.mvp.Presenter
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.och.common.module.biz.bean.DriverStatusQueryRespBean
|
||||
import com.mogo.och.common.module.biz.callback.ILoginCallback
|
||||
import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager.OPERATION_ROAD_SIDE_TYPE
|
||||
import com.mogo.och.common.module.biz.constant.LoginStatusManager.isLogin
|
||||
import com.mogo.och.common.module.manager.OCHPlanningStopSideStatusManager
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
@@ -23,7 +27,8 @@ import com.mogo.och.common.module.biz.constant.LoginStatusManager.isLogin
|
||||
*/
|
||||
class DriverM1Presenter(view: DriverM1Fragment?) :
|
||||
Presenter<DriverM1Fragment?>(view),ILoginCallback, DriverM1OrderCallback, ChangeDestCallback,
|
||||
IMoGoAutopilotStatusListener {
|
||||
IMoGoAutopilotStatusListener, OCHPlanningStopSideStatusManager.OCHPlanningActionsCallback,
|
||||
IDriverM1ControllerStatusCallback {
|
||||
|
||||
private val TAG = DriverM1Presenter::class.java.name
|
||||
private var mCurrentAutopilotStatus : Int = -1
|
||||
@@ -36,13 +41,18 @@ class DriverM1Presenter(view: DriverM1Fragment?) :
|
||||
private fun registerListener() {
|
||||
//2021.11.1 鹰眼架构整合,由IMoGoAutopilotStatusListener逐步替代IMogoAdasOCHCallback接口
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
OCHPlanningStopSideStatusManager.addListener(TAG,this)
|
||||
DriverM1Model.get().setDriverM1OrderCallback(this)
|
||||
DriverM1Model.get().setChangeDestCallback(this)
|
||||
DriverM1Model.get().setControllerStatusCallback(this)
|
||||
}
|
||||
|
||||
private fun releaseListener() {
|
||||
OCHPlanningStopSideStatusManager.removeListener(TAG)
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
DriverM1Model.get().setDriverM1OrderCallback(null)
|
||||
DriverM1Model.get().setChangeDestCallback(null)
|
||||
DriverM1Model.get().setControllerStatusCallback(null)
|
||||
}
|
||||
|
||||
override fun onDestroy(owner: LifecycleOwner) {
|
||||
@@ -127,4 +137,32 @@ class DriverM1Presenter(view: DriverM1Fragment?) :
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
override fun onStartAutopilotFailure(
|
||||
actionStatus: OCHPlanningStopSideStatusManager.Status,
|
||||
stopSideStatus: Boolean?,
|
||||
errorInfo: String?
|
||||
) {
|
||||
when (actionStatus) {
|
||||
OCHPlanningStopSideStatusManager.Status.START -> { // 靠边停车 to 消息盒子
|
||||
DriverM1Model.get().pushOperationalToMsgBox(
|
||||
DateTimeUtil.getCurrentTimeStamp(),
|
||||
"",
|
||||
OPERATION_ROAD_SIDE_TYPE
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun startOpenAutopilot() {
|
||||
ThreadUtils.runOnUiThread {
|
||||
mView?.startAutopilotAnimation()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onStartAdasFailure() {
|
||||
ThreadUtils.runOnUiThread {
|
||||
mView?.stopAnimAndUpdateBtnStatus()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
BIN
OCH/mogo-och-charter/src/driverm1/res/raw/m1_voice_di.mp3
Normal file
BIN
OCH/mogo-och-charter/src/driverm1/res/raw/m1_voice_di.mp3
Normal file
Binary file not shown.
@@ -1,11 +0,0 @@
|
||||
package com.magic.mogo.och.charter.callback;
|
||||
|
||||
/**
|
||||
* Created on 2021/9/8
|
||||
*
|
||||
* Model->Presenter回调:ADAS相关(自动驾驶状态回调,到达终点等等)
|
||||
*/
|
||||
public interface IADASStatusCallback {
|
||||
//自驾返回失败
|
||||
void onStartAdasFailure();
|
||||
}
|
||||
@@ -7,9 +7,9 @@ package com.mogo.och.common.module.bean.dpmsg
|
||||
data class ChangeDestMsg(
|
||||
var lineId: Int, //线路id
|
||||
var lineName: String = "", //线路名称
|
||||
var startSiteId: Int=0, //当前站点
|
||||
var startSiteId: Int= 0, //当前站点
|
||||
var startSiteName: String = "",
|
||||
var destSiteId: Int=0, //目的地
|
||||
var destSiteId: Int= 0, //目的地
|
||||
var destSiteName: String = "",
|
||||
var isConfirmed: Boolean = false //司机端是否同意
|
||||
): BaseDPMsg(DPMsgType.TYPE_CHANGE_DEST.type)
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.mogo.och.common.module.bean.dpmsg
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2023/2/24
|
||||
*/
|
||||
data class DPCommonOperationMsg(
|
||||
var msg: String
|
||||
): BaseDPMsg(DPMsgType.TYPE_COMMON.type)
|
||||
@@ -6,4 +6,4 @@ package com.mogo.och.common.module.bean.dpmsg
|
||||
*/
|
||||
data class DPOperateDoorMsg(
|
||||
var open: Boolean = false // true: 开门, false: 关门
|
||||
): BaseDPMsg(DPMsgType.TYPE_CHANGE_DEST.type)
|
||||
): BaseDPMsg(DPMsgType.TYPE_OPEN_CLOSE_DOOR.type)
|
||||
|
||||
@@ -6,4 +6,4 @@ package com.mogo.och.common.module.bean.dpmsg
|
||||
*/
|
||||
data class DPOrderClosedMsg(
|
||||
var closed: Boolean = true // true: 开门, false: 关门
|
||||
): BaseDPMsg(DPMsgType.TYPE_CHANGE_DEST.type)
|
||||
): BaseDPMsg(DPMsgType.TYPE_ORDER_CLOSED.type)
|
||||
|
||||
@@ -12,10 +12,14 @@ import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
* 统一管理业务长链消息推送
|
||||
*/
|
||||
object OCHSocketMessageManager {
|
||||
public const val msgMonitorType:Int = 6295553 //后台运营消息
|
||||
public const val msgWriteOffPassengerType:Int = 6295554 //核销消息
|
||||
public const val msgOperateDoorType = 6295554 // 开/关门消息
|
||||
public const val msgOrderClosedType = 6295555 //订单结束消息
|
||||
const val msgMonitorType:Int = 6295553 //后台运营消息
|
||||
const val msgWriteOffPassengerType:Int = 6295554 //核销消息
|
||||
const val msgOperateDoorType = 6295554 // 开/关门消息
|
||||
const val msgOrderClosedType = 6295555 //订单结束消息
|
||||
|
||||
const val OPERATION_SYSTEM: Int = -1 // 运营消息 默认是次消息类型
|
||||
const val OPERATION_ORDER_TYPE: Int = 0 // 还车通知
|
||||
const val OPERATION_ROAD_SIDE_TYPE: Int = 1 //靠边停车通知
|
||||
|
||||
fun <T> registerSocketMessageListener(msgType:Int,
|
||||
mogoOnMessageListener :IMogoOnMessageListener<T>){
|
||||
@@ -28,8 +32,9 @@ object OCHSocketMessageManager {
|
||||
.unregisterLifecycleListener(msgType)
|
||||
}
|
||||
|
||||
fun pushAppOperationalMsgBox(time : Long,content : String){
|
||||
fun pushAppOperationalMsgBox(time : Long,content : String,type: Int = -1){
|
||||
|
||||
CallerMsgBoxManager.saveMsgBox(MsgBoxBean(MsgBoxType.OPERATION,
|
||||
OperationMsg(time,content)));
|
||||
OperationMsg(time,content,type)))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user