Merge branch 'dev_robotaxi-d_230809_6.0.0' of gitlab.zhidaoauto.com:SCA/L4HA/AndroidApp/MoGoEagleEye into dev_robotaxi-d_230809_6.0.0

# Conflicts:
#	OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/task/TaxiTaskModel.kt
This commit is contained in:
wangmingjun
2023-08-31 14:17:28 +08:00
22 changed files with 383 additions and 204 deletions

View File

@@ -964,7 +964,7 @@ object CharterPassengerModel {
// 清理轨迹
cleanRoutePoints()
// 到站结束自驾
CallerAutoPilotControlManager.cancelAutoPilot()
CallerAutoPilotControlManager.cancelAutoPilot4Passenger()
// 结束路距计算 到达目的站点
endCalculateDistanceLoop()
// 到站置距离位0

View File

@@ -59,8 +59,11 @@ public class OCHAdasAbilityManager implements IMoGoAutopilotActionsListener, IMo
return "未知异常";
}else {
StringBuilder stringBuilder = new StringBuilder();
for (UnableAutopilotReason unableAutopilotReason : unableAutopilotReasons) {
stringBuilder.append(unableAutopilotReason.toString()).append("\n");
for (int i = 0; i < unableAutopilotReasons.size(); i++) {
stringBuilder.append(unableAutopilotReasons.get(i));
if(i<unableAutopilotReasons.size()-1){
stringBuilder.append("\n");
}
}
return stringBuilder.toString();
}

View File

@@ -4,13 +4,20 @@ import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.text.SpannableString
import android.text.Spanned
import android.text.method.ScrollingMovementMethod
import android.text.style.ForegroundColorSpan
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import android.widget.LinearLayout
import android.widget.TextView
import androidx.localbroadcastmanager.content.LocalBroadcastManager
import com.mogo.eagle.core.function.main.MainMoGoApplication
import com.mogo.eagle.core.network.utils.GsonUtil
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.common.module.utils.DateTimeUtil
import com.mogo.och.taxi.R
import com.mogo.och.taxi.bean.QueryCurrentTaskRespBean
@@ -28,6 +35,7 @@ import kotlinx.android.synthetic.main.taxi_debug_order.view.currentOrderStopInfo
import kotlinx.android.synthetic.main.taxi_debug_order.view.currentOrderTrajectoryInfo
import kotlinx.android.synthetic.main.taxi_debug_order.view.currentStatus
import kotlinx.android.synthetic.main.taxi_debug_order.view.currentTaskType
import kotlinx.android.synthetic.main.taxi_debug_order.view.debugLogHistoryTextView
import kotlinx.android.synthetic.main.taxi_debug_order.view.orderEndSiteInfo
import kotlinx.android.synthetic.main.taxi_debug_order.view.orderNo
import kotlinx.android.synthetic.main.taxi_debug_order.view.orderPreLoadLines
@@ -36,16 +44,55 @@ import kotlinx.android.synthetic.main.taxi_debug_order.view.orderStatus
import kotlinx.android.synthetic.main.taxi_debug_order.view.taskEndSite
import kotlinx.android.synthetic.main.taxi_debug_order.view.taskStartSite
public class DebugView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0,
defStyleRes: Int = 0
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0, defStyleRes: Int = 0
) : LinearLayout(context, attrs, defStyleAttr, defStyleRes), ITaxiTaskWithOrderCallback {
companion object {
const val TAG = "DebugView"
const val BROADCAST_ACTION = "com.mogo.och.driver.debugview.show"
const val BROADCAST_DATA_SHOW = "isShow"
private var logHistoryTextView: TextView? = null
fun printInfoMsg(msg: String) {
printMsg("Info $msg", MainMoGoApplication.getApp().getColor(R.color.background_info))
}
fun printWarnMsg(msg: String) {
printMsg("Warn $msg", MainMoGoApplication.getApp().getColor(R.color.background_warn))
}
fun printErrorMsg(msg: String) {
printMsg("Error $msg", MainMoGoApplication.getApp().getColor(R.color.background_error))
}
private fun printMsg(msg: String, textColor: Int) {
logHistoryTextView?.also {
val msg = "${currentDateTimeString()} $msg"
val spannableMsg = SpannableString(msg)
spannableMsg.setSpan(
ForegroundColorSpan(textColor), 0, msg.length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
UiThreadHandler.post({
it.append("\n")
it.append(spannableMsg.toString())
val offset: Int = it.lineCount * it.lineHeight
if (offset > it.height) {
it.scrollTo(0, offset - it.height)
}
}, UiThreadHandler.MODE.QUEUE)
}
}
private fun currentDateTimeString(): String {
return DateTimeUtil.formatCalendarToString(
DateTimeUtil.formatLongToCalendar(System.currentTimeMillis()),
DateTimeUtil.yyyy_MM_dd_HH_mm_ss
)
}
}
private val broadcastReceiver = object : BroadcastReceiver() {
@@ -59,9 +106,10 @@ public class DebugView @JvmOverloads constructor(
init {
initBroadcastReceiver()
LayoutInflater.from(context)
.inflate(R.layout.taxi_debug_order, this, true)
LayoutInflater.from(context).inflate(R.layout.taxi_debug_order, this, true)
debugLogHistoryTextView.setMovementMethod(ScrollingMovementMethod.getInstance())
visibility = GONE
logHistoryTextView = debugLogHistoryTextView
}
private fun initBroadcastReceiver() {
@@ -71,11 +119,8 @@ public class DebugView @JvmOverloads constructor(
}
fun toggleOrderDebugView() {
visibility =
if (visibility == View.VISIBLE)
View.GONE
else
View.VISIBLE
visibility = if (visibility == View.VISIBLE) View.GONE
else View.VISIBLE
val data = TaxiTaskModel.getCurrentTaskWithOrder()
initViewByData(data)
}
@@ -100,17 +145,13 @@ public class DebugView @JvmOverloads constructor(
private fun initViewByData(data: QueryCurrentTaskRespBean.Result?) {
val curContrail = TaxiTaskModel.getCurrentTaskTrajectory()
currentDataTimestamps.text = "【当前数据返回时间】${
DateTimeUtil.formatCalendarToString(
DateTimeUtil.formatLongToCalendar(System.currentTimeMillis()),
DateTimeUtil.yyyy_MM_dd_HH_mm_ss
)
}"
currentDataTimestamps.text = "【当前数据返回时间】${currentDateTimeString()}"
currentCarStatus.text =
"【当前车辆状态】${data?.servingStatus} / ${if (data?.servingStatus == 1) "开始接单" else "暂停接单"}"
currentTaskType.text = "【当前任务类型】${data?.taskType} / ${TaskTypeEnum.valueOf(data?.taskType ?: -1)?.name}"
"【当前车辆状态】${data?.servingStatus} --> ${if (data?.servingStatus == 1) "开始接单" else "暂停接单"}"
currentTaskType.text =
"【当前任务类型】${data?.taskType} --> ${TaskTypeEnum.valueOf(data?.taskType ?: -1)?.name}"
currentStatus.text =
"【当前任务状态】${data?.currentStatus} / ${TaskStatusEnum.valueOf(data?.currentStatus ?: -1)?.name}"
"【当前任务状态】${data?.currentStatus} --> ${TaskStatusEnum.valueOf(data?.currentStatus ?: -1)?.name}"
currentLineId.text = "【当前任务lineId】 ${data?.lineId}"
taskStartSite.text =
"【当前任务起点】${data?.startSite?.siteName} siteId=${data?.startSite?.siteId}"
@@ -119,7 +160,7 @@ public class DebugView @JvmOverloads constructor(
currentOrder.text = "【订单信息】${if (data?.order == null) "null" else "不为空"}"
orderNo.text = "【订单编号】${data?.order?.orderNo}"
orderStatus.text =
"【订单状态】${data?.order?.orderStatus} / ${TaxiOrderStatusEnum.valueOf(data?.order?.orderStatus ?: -1)?.name}"
"【订单状态】${data?.order?.orderStatus} --> ${TaxiOrderStatusEnum.valueOf(data?.order?.orderStatus ?: -1)?.name}"
orderStartSiteInfo.text =
"【订单起点】${data?.order?.orderStartSite?.siteName} siteId=${data?.order?.orderStartSite?.siteId}"
orderEndSiteInfo.text =

View File

@@ -25,6 +25,7 @@ import com.mogo.och.taxi.constant.TaxiOrderStatusEnum
import com.mogo.och.taxi.constant.TaxiUnmannedConst
import com.mogo.och.taxi.network.TaxiTaskWithOrderServiceManager
import com.mogo.och.taxi.network.TaxiTaskWithOrderServiceManager.cancelOrder
import com.mogo.och.taxi.ui.debug.DebugView
import com.mogo.och.taxi.ui.unmanned.TaskWithOrderUIState
import com.mogo.och.taxi.ui.unmanned.UnmannedState
import com.mogo.och.taxi.utils.TaxiTrajectoryManager
@@ -82,8 +83,10 @@ class TaxiCurrentTaskViewModel : BaseViewModel<UnmannedState, TaskUiIntent>(),
fun startOrStopCurrentTaskWithOrderLoop(start: Boolean) {
d(TAG, "startOrStopCurrentTaskWithOrderLoop(): isStart=$start")
if (start) {
DebugView.printInfoMsg("[查询TaskWithOrder信息] start loop")
TaxiTaskModel.startQueryCurrentTaskWithOrderLoop()
} else {
DebugView.printInfoMsg("[查询TaskWithOrder信息] stop loop")
TaxiTaskModel.stopQueryCurrentTaskWithOrderLoop()
}
}
@@ -91,21 +94,24 @@ class TaxiCurrentTaskViewModel : BaseViewModel<UnmannedState, TaskUiIntent>(),
private fun cancelOrder(cancelType: Int) {
val currentTaskWithOrder = TaxiTaskModel.getCurrentTaskWithOrder()
currentTaskWithOrder?.order?.also {
TaxiTaskModel.cancelOrder(it.orderNo,cancelType)
TaxiTaskModel.cancelOrder(it.orderNo, cancelType)
}
}
private fun jumpPassengerCheck() {
DebugView.printInfoMsg("[开始服务] 准备发送请求")
val currentTaskWithOrder = TaxiTaskModel.getCurrentTaskWithOrder()
currentTaskWithOrder?.order?.also {
TaxiTaskWithOrderServiceManager.jumpPassengerCheck(AbsMogoApplication.getApp().applicationContext,
it.orderNo,
object : OchCommonServiceCallback<BaseData> {
override fun onSuccess(data: BaseData?) {
DebugView.printInfoMsg("[开始服务] 请求success")
d(TAG, "jumpPassengerCheck onSuccess:")
}
override fun onFail(code: Int, msg: String?) {
DebugView.printInfoMsg("[开始服务] 请求fail, code=$code, msg=$msg")
d(TAG, "jumpPassengerCheck onFail: code=$code, msg=$msg")
}
})
@@ -113,16 +119,19 @@ class TaxiCurrentTaskViewModel : BaseViewModel<UnmannedState, TaskUiIntent>(),
}
private fun journeyCompleted() {
DebugView.printInfoMsg("[服务完成] 准备发送请求")
val currentTaskWithOrder = TaxiTaskModel.getCurrentTaskWithOrder()
currentTaskWithOrder?.order?.also {
TaxiTaskWithOrderServiceManager.orderCompleted(AbsMogoApplication.getApp().applicationContext,
it.orderNo,
object : OchCommonServiceCallback<BaseData> {
override fun onSuccess(data: BaseData?) {
DebugView.printInfoMsg("[服务完成] 请求success")
d(TAG, "journeyCompleted onSuccess")
}
override fun onFail(code: Int, msg: String?) {
DebugView.printInfoMsg("[服务完成] 请求fail, code=$code, msg=$msg")
d(TAG, "journeyCompleted onFail: code=$code, msg=$msg")
}
})
@@ -191,6 +200,7 @@ class TaxiCurrentTaskViewModel : BaseViewModel<UnmannedState, TaskUiIntent>(),
override fun onTaskWithOrderDataChanged(result: QueryCurrentTaskRespBean.Result?) {
d(TAG, "onTaskWithOrderChanged = result = " + GsonUtil.jsonFromObject(result))
DebugView.printInfoMsg("[查询TaskWithOrder信息] 更新数据, 刷新UI")
updateTaskAndOrderUi(result)
}
@@ -242,14 +252,16 @@ class TaxiCurrentTaskViewModel : BaseViewModel<UnmannedState, TaskUiIntent>(),
currentTaskWithOrder: QueryCurrentTaskRespBean.Result?
) {
if (currentTaskWithOrder?.endSite != null && currentTaskWithOrder.startSite != null
&& currentTaskWithOrder.currentStatus < TaskStatusEnum.CompleteTask.code) {
&& currentTaskWithOrder.currentStatus < TaskStatusEnum.CompleteTask.code
) {
VoiceNotice.showNotice("暂停接单啦!要完成当前订单哦")
} else {
VoiceNotice.showNotice("暂停接单啦")
}
// TODO 如果当前有订单就不要刷新
if (currentTaskWithOrder?.startSite != null &&
currentTaskWithOrder.endSite != null){
currentTaskWithOrder.endSite != null
) {
return
}
updateDriveToNearestStationTaskUI(driveToNearestStationTask)

View File

@@ -72,6 +72,7 @@ import com.mogo.och.taxi.constant.TaxiOrderStatusEnum
import com.mogo.och.taxi.constant.TaxiUnmannedConst
import com.mogo.och.taxi.constant.TaxiUnmannedConst.Companion.BUSINESSTYPE
import com.mogo.och.taxi.network.TaxiTaskWithOrderServiceManager
import com.mogo.och.taxi.ui.debug.DebugView
import com.mogo.och.taxi.utils.RxJavaUtils
import com.mogo.och.taxi.utils.TaxiAnalyticsManager
import com.mogo.och.taxi.utils.TaxiTrajectoryManager
@@ -326,6 +327,7 @@ object TaxiTaskModel {
override fun onAutopilotSNRequest() {}
override fun onAutopilotArriveAtStation(arrivalNotification: ArrivalNotification?) {
i(TAG, "onAutopilotArriveAtStation = ${arrivalNotification.toString()}")
DebugView.printInfoMsg("[MAP到站通知] 上报到站location=${arrivalNotification?.endLocation}")
if (arrivalNotification == null || !checkCurrentTaskCondition() ||
mCurrentTaskWithOrder?.currentStatus == TaskStatusEnum.CompleteTask.code
) {
@@ -388,6 +390,7 @@ object TaxiTaskModel {
d(
TAG, "getWayPointsList.Size = ${globalPathResp.wayPointsList.size}"
)
DebugView.printInfoMsg("[MAP全局规划回调] 回调getWayPointsList.Size=${globalPathResp.wayPointsList.size}")
if (it.size > 0) {
// 本地计算全路径长度(实时更新剩余距离,剩余时间,预计到达时间)
if (checkCurrentTaskCondition()) {
@@ -417,6 +420,7 @@ object TaxiTaskModel {
startFailedCode: String,
startFailedMessage: String
) {
DebugView.printInfoMsg("[启自驾回调] 执行失败code=$startFailedCode, msg=$startFailedMessage")
TaxiAnalyticsManager.getInstance()
.triggerStartAutopilotFailureEventByAdas(startFailedCode, startFailedMessage)
if (mADASStatusCallback != null && !FunctionBuildConfig.isDemoMode) {
@@ -524,6 +528,7 @@ object TaxiTaskModel {
"judgeDriveToNearestStationTaskStation() ${virtualTask.siteName} distance = $distance"
)
if (distance <= TaxiUnmannedConst.ARRIVE_AT_START_STATION_DISTANCE) { // 15米内到站
DebugView.printInfoMsg("[高德定位围栏] 触发围栏任务类型DriveToNearestStationTask围栏范围${TaxiUnmannedConst.ARRIVE_AT_START_STATION_DISTANCE}")
submitArriveSite(virtualTask.siteId, true, isArrivedNearestStation = true)
}
}
@@ -563,6 +568,7 @@ object TaxiTaskModel {
*/
fun submitArriveSite(siteId: Long, isArriveAtEndSite: Boolean,
isArrivedNearestStation : Boolean = false) {
DebugView.printInfoMsg("[上报ArriveSite] siteId=$siteId, isArriveAtEndSite=$isArriveAtEndSite")
i(TAG, message = "submitArriveSite: siteId=$siteId isArriveAtEndSite=$isArriveAtEndSite")
TaxiTaskWithOrderServiceManager.arriveSite(
mContext,
@@ -570,6 +576,7 @@ object TaxiTaskModel {
object : OchCommonServiceCallback<BaseData> {
override fun onSuccess(data: BaseData?) {
if (data == null || data.code != 0) return
DebugView.printInfoMsg("[上报ArriveSite] success siteId=$siteId, isArriveAtEndSite=$isArriveAtEndSite")
d(TAG, "submitArriveSite-onSuccess data=" + GsonUtil.jsonFromObject(data))
mDriveToNearestStationTask = null
if (isArrivedNearestStation){// 播报提醒
@@ -584,6 +591,7 @@ object TaxiTaskModel {
}
override fun onFail(code: Int, msg: String?) {
DebugView.printErrorMsg("[上报ArriveSite] failed, code=$code, msg=$msg")
d(TAG, "code=$code msg=$msg")
}
})
@@ -639,10 +647,11 @@ object TaxiTaskModel {
AbsMogoApplication.getApp().applicationContext,
object : OchCommonServiceCallback<QueryCurrentTaskRespBean> {
override fun onSuccess(data: QueryCurrentTaskRespBean?) {
//DebugView.printInfoMsg("[查询TaskWithOrder信息] success")
if (data?.data == null) {
d(
TAG,
"queryCurrentTaskOnce onSuccess: data.code != 0 || data === null || data.data === null"
"queryCurrentTaskOnce onSuccess: data == null || data.data == null"
)
return
}
@@ -696,7 +705,8 @@ object TaxiTaskModel {
// 主要是解决A-B演练任务同时接到A-B订单状态流转的问题
//注意: 需要去除到达乘客上车点的节点, 这个节点不拉取任务
if (result?.currentStatus == TaskStatusEnum.CompleteTask.code
&& !QueryCurrentTaskRespBean.isOrderArriveAtStart(result)) {
&& !QueryCurrentTaskRespBean.isOrderArriveAtStart(result)
) {
mTaxiTaskWithOrderCallbackMap.forEach {
val listener = it.value
listener.onTaskCompleted(
@@ -754,6 +764,7 @@ object TaxiTaskModel {
override fun onFail(code: Int, msg: String?) {
d(TAG, "queryCurrentTaskOnce onFail: code=$code, msg=$msg")
DebugView.printErrorMsg("[查询TaskWithOrder信息] fail, code=$code, msg=$msg")
}
})
}
@@ -761,15 +772,18 @@ object TaxiTaskModel {
/**
* 取消订单 进行中/待服务
*/
fun cancelOrder(orderNo: String,cancelType: Int){
fun cancelOrder(orderNo: String, cancelType: Int) {
DebugView.printInfoMsg("[取消订单] 准备发送请求")
TaxiTaskWithOrderServiceManager.cancelOrder(AbsMogoApplication.getApp().applicationContext,
orderNo, cancelType,
object : OchCommonServiceCallback<BaseData> {
override fun onSuccess(data: BaseData?) {
DebugView.printInfoMsg("[取消订单] 请求success")
d(TAG, "handleCancelOrder() = onSuccess")
}
override fun onFail(code: Int, msg: String?) {
DebugView.printErrorMsg("[取消订单] 请求fail, code=$code, msg=$msg")
d(TAG, "handleCancelOrder() $code $msg")
}
})
@@ -842,22 +856,26 @@ object TaxiTaskModel {
}
fun startTask(lineId: Long) {
DebugView.printInfoMsg("[开始任务] 准备发送请求")
TaxiTaskWithOrderServiceManager.startTask(
mContext,
lineId,
object : OchCommonServiceCallback<BaseData> {
override fun onSuccess(data: BaseData?) {
DebugView.printInfoMsg("[开始任务] 请求success")
startAutoPilot() //自驾开启
d(TAG, "startTask onSuccess: data=${GsonUtil.jsonFromObject(data)}")
}
override fun onFail(code: Int, msg: String?) {
DebugView.printErrorMsg("[开始任务] 请求fail, code=$code, msg=$msg")
d(TAG, "startTask onFail: code=$code, msg=$msg")
}
})
}
fun prepareNextTask(siteId: Long) {
DebugView.printInfoMsg("[PrepareNextTask] 准备发送请求")
TaxiTaskWithOrderServiceManager.prepareTask(
mContext,
siteId,
@@ -868,6 +886,7 @@ object TaxiTaskModel {
"prepareNextTask onSuccess:${GsonUtil.jsonFromObject(data)}, " +
"isCarServingStatus = ${TaxiCarServingStatusManager.isCarServingStatus()}"
)
DebugView.printInfoMsg("[PrepareNextTask] 请求success")
if (data?.data == null) return
//去下载轨迹, 下发给工控机下载
// queryTaskTrajectoryByLineIds(
@@ -877,6 +896,7 @@ object TaxiTaskModel {
}
override fun onFail(code: Int, msg: String?) {
DebugView.printErrorMsg("[PrepareNextTask] 请求fail, code=$code ,msg=$msg")
d(TAG, "prepareNextTask onFail: code=$code ,msg=$msg")
if (LoginStatusManager.isLogin() && TaxiCarServingStatusManager.isCarServingStatus()) {
startPrepareTaskDelay120S(siteId)
@@ -886,6 +906,7 @@ object TaxiTaskModel {
}
fun startPrepareTaskDelay120S(siteId: Long) {
DebugView.printInfoMsg("[PrepareNextTask] 倒计时${TaxiUnmannedConst.TIMER_PREPARE_TASK_INTERVAL_120S/1000}秒后prepareNextTask")
UiThreadHandler.postDelayed({
prepareNextTask(siteId)
}, TaxiUnmannedConst.TIMER_PREPARE_TASK_INTERVAL_120S)
@@ -895,6 +916,7 @@ object TaxiTaskModel {
* 查询当前任务的轨迹
*/
fun queryTaskTrajectoryByLineIds(planningLineIds: Array<Long>, currentTaskLineId: Long) {
DebugView.printInfoMsg("[查询轨迹信息] 准备发送请求")
TaxiTaskWithOrderServiceManager.queryTrajectoryByLindIds(
mContext,
planningLineIds,
@@ -904,6 +926,7 @@ object TaxiTaskModel {
TAG,
"queryTaskTrajectoryByLineIds onSuccess: ${GsonUtil.jsonFromObject(data?.data)}"
)
DebugView.printInfoMsg("[查询轨迹信息] 请求success")
data?.data?.also {
mTaskTrajectoryList.addAll(it)
mCurrentTaskTrajectory = it.first { currentTaskLineId == it.lineId }
@@ -915,6 +938,7 @@ object TaxiTaskModel {
}
override fun onFail(code: Int, msg: String?) {
DebugView.printErrorMsg("[查询轨迹信息] 请求fail, code=$code, msg=$msg")
d(TAG, "queryTaskTrajectoryByLineIds onFail: code=$code, msg=$msg")
}
})
@@ -926,10 +950,12 @@ object TaxiTaskModel {
return
}
if (TaxiCarServingStatusManager.isCarServingStatus()) {//接单状态下,去结束
DebugView.printInfoMsg("[暂停接单] 准备发送请求")
TaxiTaskWithOrderServiceManager.endService(
mContext,
object : OchCommonServiceCallback<BaseData> {
override fun onSuccess(data: BaseData?) {
DebugView.printInfoMsg("[暂停接单] 请求success")
loginService?.queryLoginStatusByNet()
//需要将虚拟任务停掉, 虚拟任务会再开始接单后获取新的
mDriveToNearestStationTask = null
@@ -941,20 +967,24 @@ object TaxiTaskModel {
override fun onError() {
mTaxiCarServiceCallback?.onCarEndServiceError()
DebugView.printErrorMsg("[暂停接单] 请求error")
}
override fun onFail(code: Int, msg: String) {
DebugView.printErrorMsg("[暂停接单] 请求fail, code=$code, msg=$msg")
mTaxiCarServiceCallback?.onCarEndServiceFailed(code, msg)
}
})
} else {
//暂停接单状态下,去接单
DebugView.printInfoMsg("[开始接单] 准备发送请求")
TaxiTaskWithOrderServiceManager.startService(mContext,
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02().latitude,
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02().longitude,
object : OchCommonServiceCallback<StartServiceRespBean> {
override fun onSuccess(data: StartServiceRespBean?) {
if (data == null) return
DebugView.printInfoMsg("[开始接单] 请求success")
d(TAG, "data.data=" + GsonUtil.jsonFromObject(data.data))
loginService?.queryLoginStatusByNet()
mDriveToNearestStationTask = data.data
@@ -965,10 +995,12 @@ object TaxiTaskModel {
}
override fun onFail(code: Int, msg: String) {
DebugView.printErrorMsg("[开始接单] 请求fail, code=$code, msg=$msg")
mTaxiCarServiceCallback?.onCarStartServiceFailed(code, msg)
}
override fun onError() {
DebugView.printErrorMsg("[开始接单] 请求error")
mTaxiCarServiceCallback?.onCarStartServiceError()
}
})
@@ -987,12 +1019,14 @@ object TaxiTaskModel {
fun startAutoPilot() {
if (!checkCurrentTaskCondition()) {
e(TAG, "no order or order is empty.")
DebugView.printErrorMsg("[启自驾] 当前订单不存在或异常!")
ToastUtils.showShort("当前订单不存在或异常!")
return
}
if (mCurrentTaskTrajectory == null) {
e(TAG, "no order or order is empty.")
DebugView.printErrorMsg("[启自驾] 轨迹信息不存在!")
ToastUtils.showShort("轨迹信息不存在!")
}
@@ -1003,6 +1037,7 @@ object TaxiTaskModel {
&& TextUtils.isEmpty(mCurrentTaskTrajectory!!.csvFileUrlDPQP)
) {
ToastUtils.showLong("无发布轨迹, 请发布后重试")
DebugView.printErrorMsg("[启自驾] 无发布轨迹, 请发布后重试")
e(
TAG, "isPassStartAutopilotCommand = " +
FunctionBuildConfig.isPassStartAutopilotCommand
@@ -1020,6 +1055,7 @@ object TaxiTaskModel {
OCHAdasAbilityManager.getInstance().autopilotUnAbilityReason +
", 请稍候重试"
)
DebugView.printErrorMsg("[启自驾] ${OCHAdasAbilityManager.getInstance().autopilotUnAbilityReason}")
TaxiAnalyticsManager.getInstance().triggerUnableStartAPReasonEvent(
mCurrentTaskWithOrder!!.startSite!!.siteName,
mCurrentTaskWithOrder!!.endSite!!.siteName,
@@ -1038,6 +1074,7 @@ object TaxiTaskModel {
return
}
CallerAutoPilotControlManager.startAutoPilot(parameters)
DebugView.printInfoMsg("[启自驾] 调用成功")
d(
TAG, "start autopilot with parameter: %s",
GsonUtil.jsonFromObject(parameters)
@@ -1105,6 +1142,7 @@ object TaxiTaskModel {
fun cancelAutopilot() {
try {
CallerAutoPilotControlManager.cancelAutoPilot()
DebugView.printInfoMsg("[取消自驾] 调用成功")
d(TAG, "结束自动驾驶")
} catch (e: Exception) {
e.printStackTrace()
@@ -1147,11 +1185,25 @@ object TaxiTaskModel {
//3、刚过站且过站距离在15m内 提交到站
if (stationAngle > 90) {
i(TAG, "judgeEndStation() = 刚过站且在15m内")
DebugView.printInfoMsg(
"[高德定位围栏] 触发围栏,任务类型:${
TaskTypeEnum.valueOf(
mCurrentTaskWithOrder?.taskType ?: 0
)?.name
}围栏范围${TaxiUnmannedConst.ARRIVE_AT_START_STATION_DISTANCE} 刚过站且在15m内"
)
submitArriveSite(endSite.siteId, true)
}else{
} else {
// 4、 没有过站距离小于15m 速度小于0.5(根据M1来的模数 可能要调)
if (currentLocation.gnssSpeed < 0.5) {
i(TAG, "judgeEndStation() = 没有过站、速度基本为零且在15m内")
DebugView.printInfoMsg(
"[高德定位围栏] 触发围栏,任务类型:${
TaskTypeEnum.valueOf(
mCurrentTaskWithOrder?.taskType ?: 0
)?.name
}围栏范围${TaxiUnmannedConst.ARRIVE_AT_START_STATION_DISTANCE} 没有过站速度基本为零且在15m内"
)
submitArriveSite(endSite.siteId, true)
}
}
@@ -1215,6 +1267,7 @@ object TaxiTaskModel {
)
mCurrentTaskWithOrder = null
mDriveToNearestStationTask = null
DebugView.printInfoMsg("[登出] 退出登陆")
}
//导航去订单终点目的地
@@ -1288,11 +1341,13 @@ object TaxiTaskModel {
return
}
d(TAG, "AutopilotControlParameters is update.")
DebugView.printInfoMsg("[启自驾] updateAutopilotControlParameters调用成功")
updateAutopilotControlParameters(parameters)
}
private fun clearAutopilotControlParameters() {
d(TAG, "AutopilotControlParameters is clear.")
DebugView.printInfoMsg("[启自驾] clearAutopilotControlParameters调用成功")
updateAutopilotControlParameters(null)
}
@@ -1309,7 +1364,6 @@ object TaxiTaskModel {
ToastUtils.showShort("无任务!")
return
}
// arriveSite(mCurrentTaskAndOrder?.endSite!!.siteId, true)
autopilotArriveAtStation()
}

View File

@@ -13,6 +13,7 @@ import com.mogo.och.taxi.bean.QueryCurrentTaskRespBean;
import com.mogo.och.taxi.bean.TrajectoryListRespBean;
import com.mogo.och.taxi.constant.TaskStatusEnum;
import com.mogo.och.taxi.constant.TaxiUnmannedConst;
import com.mogo.och.taxi.ui.debug.DebugView;
import com.mogo.och.taxi.ui.task.TaxiTaskModel;
import java.util.ArrayList;
@@ -163,7 +164,6 @@ public class TaxiTrajectoryManager {
final List<TrajectoryListRespBean.Result> orderContrails = TaxiTaskModel.INSTANCE.getCurrentOrderTrajectoryList();
if (orderDetail != null && orderContrails != null && orderContrails.size() != 0 ){
List<Long> lineIds = new ArrayList<>();
lineIds.addAll(Arrays.asList(orderDetail.getPlanningLines())); // 接驾
lineIds.add(orderDetail.getOrderLine());//送驾
@@ -249,6 +249,7 @@ public class TaxiTrajectoryManager {
if (mSendReqDisposable != null && !mSendReqDisposable.isDisposed()) {
return;
}
DebugView.Companion.printInfoMsg("[启自驾] startTrajectoryReqLoop");
CallerLogger.d(M_TAXI + TAG, "startTrajReqLoop()");
setupAutoPilotLine();
mSendReqDisposable = Observable.interval(TaxiUnmannedConst.LOOP_DELAY,
@@ -268,6 +269,7 @@ public class TaxiTrajectoryManager {
}
private void stopTrajReqLoop() {
DebugView.Companion.printInfoMsg("[启自驾] stopTrajectoryReqLoop");
if (mSendReqDisposable != null) {
CallerLogger.d(M_TAXI + TAG, "stopTrajReqLoop()");
mSendReqDisposable.dispose();
@@ -278,13 +280,15 @@ public class TaxiTrajectoryManager {
private void sendTrajectoryReq() {
if (mAutoPilotLine != null) {
DebugView.Companion.printInfoMsg("[启自驾] sendTrajectoryDownloadReq, lindId=" + mAutoPilotLine.getLineId() + ", lineName=" + mAutoPilotLine.getLineName());
CallerAutoPilotControlManager.INSTANCE.sendTrajectoryDownloadReq(mAutoPilotLine,COMMON_LOADING);
}else {
CallerLogger.e(M_TAXI + TAG, "sendTrajectoryReq(): mAutoPilotLine is null!!!");
}
if (mPreAutoPilotLine != null){
CallerAutoPilotControlManager.INSTANCE.sendTrajectoryDownloadReq(mPreAutoPilotLine,PRE_LOADING);
DebugView.Companion.printInfoMsg("[启自驾] sendTrajectoryDownloadReq, lindId=" + mPreAutoPilotLine.getLineId() + ", lineName=" + mPreAutoPilotLine.getLineName());
CallerAutoPilotControlManager.INSTANCE.sendTrajectoryDownloadReq(mPreAutoPilotLine, PRE_LOADING);
}else {
CallerLogger.e(M_TAXI + TAG, "sendTrajectoryReq(): mPreAutoPilotLine is null!!!");

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="8dp" />
<stroke
android:width="@dimen/dp_2"
android:color="@color/background_verbose" />
</shape>

View File

@@ -5,157 +5,192 @@
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/currentDataTimestamps"
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/btnContainer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:gravity="right"
android:orientation="vertical">
<Button
android:id="@+id/test_bar_to_virtual"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Mock到达标定站点"
android:textSize="@dimen/dp_24" />
<Button
android:id="@+id/test_bar_start_service_confirm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Mock开启服务"
android:textSize="@dimen/dp_24" />
<Button
android:id="@+id/test_bar_on_the_way_to_end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Mock开启自动驾驶"
android:textSize="@dimen/dp_24" />
<Button
android:id="@+id/test_bar_to_end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Mock到达站点"
android:textSize="@dimen/dp_24" />
<Button
android:id="@+id/test_bar_route"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Mock模拟轨迹"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_toLeftOf="@id/btnContainer"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:text="车辆当前任务&amp;订单信息"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
<TextView
android:id="@+id/currentDataTimestamps"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
<TextView
android:id="@+id/currentCarStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
<TextView
android:id="@+id/currentTaskType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
<TextView
android:id="@+id/currentStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
<TextView
android:id="@+id/currentLineId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
<TextView
android:id="@+id/taskStartSite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
<TextView
android:id="@+id/taskEndSite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
<TextView
android:id="@+id/currentOrder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
<TextView
android:id="@+id/orderNo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
<TextView
android:id="@+id/orderStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
<TextView
android:id="@+id/orderStartSiteInfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
<TextView
android:id="@+id/orderEndSiteInfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
<TextView
android:id="@+id/orderPreLoadLines"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
<TextView
android:id="@+id/currentOrderTrajectoryInfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
<TextView
android:id="@+id/currentOrderStopInfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
</LinearLayout>
</RelativeLayout>
<TextView
android:id="@+id/currentCarStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
<TextView
android:id="@+id/currentTaskType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
<TextView
android:id="@+id/currentStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
<TextView
android:id="@+id/currentLineId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
<TextView
android:id="@+id/taskStartSite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
<TextView
android:id="@+id/taskEndSite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
<TextView
android:id="@+id/currentOrder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
<TextView
android:id="@+id/orderNo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
<TextView
android:id="@+id/orderStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
<TextView
android:id="@+id/orderStartSiteInfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
<TextView
android:id="@+id/orderEndSiteInfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
<TextView
android:id="@+id/orderPreLoadLines"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
<TextView
android:id="@+id/currentOrderTrajectoryInfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
<TextView
android:id="@+id/currentOrderStopInfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:orientation="horizontal">
android:text="无人化运营流程关键节点日志(司机端)"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
<Button
android:id="@+id/test_bar_to_virtual"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Mock到达标定站点"
android:textSize="@dimen/dp_24" />
<Button
android:id="@+id/test_bar_start_service_confirm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Mock开启服务"
android:textSize="@dimen/dp_24" />
<Button
android:id="@+id/test_bar_on_the_way_to_end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Mock开启自动驾驶"
android:textSize="@dimen/dp_24" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
<TextView
android:id="@+id/debugLogHistoryTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:orientation="horizontal">
<Button
android:id="@+id/test_bar_to_end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Mock到达站点"
android:textSize="@dimen/dp_24" />
<Button
android:id="@+id/test_bar_route"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Mock模拟轨迹"
android:textSize="12sp" />
</LinearLayout>
android:background="@drawable/taxi_debug_view_log_history_bg"
android:fadeScrollbars="false"
android:maxLines="15"
android:scrollbars="vertical"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_24" />
</LinearLayout>

View File

@@ -25,4 +25,16 @@
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/no_order_data_iv"
android:text="暂无服务订单"/>
<TextView
android:id="@+id/getTaskCountdownTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#91A1EA"
android:textSize="@dimen/dp_30"
android:layout_marginTop="50dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/noOrderDataTv"
android:text="距离任务获取还有"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -17,7 +17,7 @@
<com.mogo.och.taxi.ui.debug.DebugView
android:id="@+id/orderDebugView"
android:layout_width="wrap_content"
android:layout_width="@dimen/taxi_debug_view_width"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" />

View File

@@ -119,4 +119,6 @@
<dimen name="taxi_traffic_light_time_size">60dp</dimen>
<dimen name="taxi_passenger_txt_size">34dp</dimen>
<dimen name="taxi_debug_view_width">1000dp</dimen>
</resources>

View File

@@ -19,7 +19,6 @@ import kotlinx.coroutines.flow.*
import mogo.telematics.pad.MessagePad.Header
import mogo.telematics.pad.MessagePad.SetParamReq
import java.util.concurrent.atomic.AtomicInteger
import kotlin.concurrent.*
internal class MoGoLookAroundProviderImpl: IMoGoLookAroundProvider, IMoGoBackCameraVideoListener, IMoGoRoboBusJinlvM1StitchedVideoListener, IMoGoGetParamResponseListener {
@@ -69,7 +68,9 @@ internal class MoGoLookAroundProviderImpl: IMoGoLookAroundProvider, IMoGoBackCam
private fun sendReqForParamPeriod() {
scope.launch {
while (targetX.get() == 0 || targetY.get() == 0) {
CallerAutoPilotControlManager.sendGetParamReq(AdasConstants.MapSystemParamType.M1_STITCHED_VIDEO_SELF_VEHICLE_PARAM)
if(CallerAutoPilotStatusListenerManager.isConnect()){
CallerAutoPilotControlManager.sendGetParamReq(AdasConstants.MapSystemParamType.M1_STITCHED_VIDEO_SELF_VEHICLE_PARAM)
}
delay(2000)
}
}.also {

View File

@@ -40,7 +40,7 @@ internal class CanImpl(ctx: Context) :
private val state: AtomicInteger by lazy { AtomicInteger(Int.MIN_VALUE) }
override fun onCreate() {
send(CanStatus(CallerAutoPilotControlManager.isConnected()))
send(CanStatus(CallerAutoPilotStatusListenerManager.isConnect()))
CallerChassisAccStateListenerManager.addListener(TAG, this)
CallerChassisBrakeStateListenerManager.addListener(TAG, this)
@@ -58,7 +58,7 @@ internal class CanImpl(ctx: Context) :
private fun isCanEnabled(): Boolean {
val code = CallerAutoPilotStatusListenerManager.getAutoPilotReportMessageCode()
return CallerAutoPilotControlManager.isConnected() && code != "EHW_CAN" && (state.get() == Int.MIN_VALUE || state.get() == 0)
return CallerAutoPilotStatusListenerManager.isConnect() && code != "EHW_CAN" && (state.get() == Int.MIN_VALUE || state.get() == 0)
}

View File

@@ -28,7 +28,7 @@ internal class IpcImpl(ctx: Context): IFlow<IpcStatus>(ctx), IMoGoAutopilotStatu
}
private fun checkAndSend() {
send(IpcStatus(CallerAutoPilotControlManager.isConnected()))
send(IpcStatus(CallerAutoPilotStatusListenerManager.isConnect()))
}
override fun onDestroy() {

View File

@@ -43,7 +43,7 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
CallerLogger.d("$M_DEVA$TAG", "-- onCreate --")
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
CallerChassisLocationWGS84ListenerManager.addListener(TAG, this)
if (CallerAutoPilotControlManager.isConnected()) {
if (CallerAutoPilotStatusListenerManager.isConnect()) {
check()
}
}
@@ -86,13 +86,13 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
override fun onAutopilotIpcConnectStatusChanged(status: Int, reason: String?) {
super.onAutopilotIpcConnectStatusChanged(status, reason)
if (!CallerAutoPilotControlManager.isConnected()) {
if (!CallerAutoPilotStatusListenerManager.isConnect()) {
CallerLogger.d("$M_DEVA$TAG", "工控机断开了....")
healthInfo.set(null)
send(RTKStatus("", -1))
}
if (CallerAutoPilotControlManager.isConnected() && check == null && !isOldVersion.get()) {
if (CallerAutoPilotStatusListenerManager.isConnect() && check == null && !isOldVersion.get()) {
check()
}
}
@@ -114,7 +114,7 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
private fun isRTKEnabled(): Boolean {
val code = CallerAutoPilotStatusListenerManager.getAutoPilotReportMessageCode()
val gnssInfo = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
return CallerAutoPilotControlManager.isConnected() && (
return CallerAutoPilotStatusListenerManager.isConnect() && (
code != "EHW_RTK" &&
code != "EHW_GNSS" &&
code != "ESYS_RTK_STATUS_FAULT" &&

View File

@@ -58,7 +58,7 @@ internal class TracingImpl(ctx: Context): IFlow<TracingStatus>(ctx), IMoGoAutopi
super.onAutopilotIpcConnectStatusChanged(status, reason)
try {
if (ipcConnectStatus.get() != status) {
if (!CallerAutoPilotControlManager.isConnected()) {
if (!CallerAutoPilotStatusListenerManager.isConnect()) {
old = UNKNOWN
send(TracingStatus(UNKNOWN))
}

View File

@@ -15,7 +15,7 @@ internal class StatusModel : ViewModel() {
const val TAG = "StatusModel"
val DEFAULTS = Pair(null, ArrayList<Status>().also {
it += OverViewStatus()
it += IpcStatus(CallerAutoPilotControlManager.isConnected())
it += IpcStatus(CallerAutoPilotStatusListenerManager.isConnect())
it += CanStatus(false)
// it += TracingStatus(UNKNOWN)
it += RTKStatus("", -1)

View File

@@ -186,7 +186,7 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor(
svLayout.post {
svLayout.fullScroll(View.FOCUS_DOWN)
}
if (!CallerAutoPilotStatusListenerManager.getConnectStates()) {
if (!CallerAutoPilotStatusListenerManager.isConnect()) {
ToastUtils.showShort("设置车速失败,请启动域控制器")
keyBoardUtil?.hideKeyboard()
return@setOnTouchListener true

View File

@@ -68,7 +68,7 @@ open class BlueToothView: LinearLayout, IMoGoMoFangProvider.OnMoFangStatusListen
it.setTextColor(Color.RED)
ivMoFangStatus?.drawable?.setTint(Color.RED)
postDelayed({
ToastUtils.showShort("当前蘑方处低电状态, 请及时充电")
ToastUtils.showShort("蘑方处低电状态, 请及时充电")
}, 5000)
}
} else {

View File

@@ -122,12 +122,25 @@ object CallerAutoPilotControlManager {
fun cancelAutoPilot() {
// 司机屏才能取消自动驾驶
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
providerApi?.cancelAutoPilot()
// 更新记录在全局的控制参数
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(null)
cancelAutoPilotInner()
}
}
/**
* 包车乘客屏 取消自驾(包车 乘客屏为中心)
*/
fun cancelAutoPilot4Passenger(){
if (AppIdentityModeUtils.isCharterPassenger(FunctionBuildConfig.appIdentityMode)) {
cancelAutoPilotInner()
}
}
private fun cancelAutoPilotInner() {
providerApi?.cancelAutoPilot()
// 更新记录在全局的控制参数
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(null)
}
/**
* 开启域控制器录制bag包
*/
@@ -479,13 +492,6 @@ object CallerAutoPilotControlManager {
providerApi?.setControlAutopilotCarAuto(isEnable)
}
/**
* 车机与工控机是否连上了
*/
fun isConnected(): Boolean {
return providerApi?.isConnected() ?: false
}
/**
* 查询工控机基础配置信息
*/

View File

@@ -83,7 +83,7 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
return mAutopilotStatusInfo.dockVersion
}
fun getConnectStates():Boolean{
fun isConnect():Boolean{
return mAutopilotStatusInfo.connectStatus
}

View File

@@ -139,6 +139,7 @@ public class AMapWrapper implements IMogoMap {
}
long time = markerOptionsArrayList.get(0).getTime();
batchMarkerOptions.list = markerOptionsArrayList;
// batchMarkerOptions.averageFlag = 0;
batchMarkerOptions.delayStrategy = false;
batchMarkerOptions.ruleAngle = 8.0f;
batchMarkerOptions.controlIcon = 1;