【Taxi无人化】refactor: 优化任务调试面板;
This commit is contained in:
@@ -19,6 +19,7 @@ public class DateTimeUtil {
|
||||
public static final String yyyyMMdd = "yyyy-MM-dd";
|
||||
public static final String yy_MM_dd = "yy.MM.dd";
|
||||
public static final String yyyy_MM_dd_HH_mm = "yyyy-MM-dd HH:mm";
|
||||
public static final String yyyy_MM_dd_HH_mm_ss = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
public static String formatCalendarToString(Calendar calendar, String format){
|
||||
if (calendar == null) return "";
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.och.taxi.ui.base
|
||||
|
||||
import android.animation.ObjectAnimator
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
@@ -10,6 +11,7 @@ import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.animation.LinearInterpolator
|
||||
import androidx.fragment.app.FragmentTransaction
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
||||
import com.mogo.commons.mvp.IView
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.commons.mvp.Presenter
|
||||
@@ -21,11 +23,9 @@ import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager.initBa
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showToolsView
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getMapUIController
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView
|
||||
|
||||
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.mogo.view.OnPreventFastClickListener
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.map.listener.IMogoMapListener
|
||||
import com.mogo.map.uicontroller.VisualAngleMode
|
||||
@@ -34,6 +34,7 @@ import com.mogo.och.common.module.wigets.StartAutopilotAnimationView
|
||||
import com.mogo.och.taxi.R
|
||||
import com.mogo.och.taxi.constant.TaxiUnmannedConst
|
||||
import com.mogo.och.taxi.constant.TaxiUnmannedConst.Companion.START_AUTOPILOT_ANIMATION_INTERVAL
|
||||
import com.mogo.och.taxi.ui.debug.DebugView
|
||||
import com.mogo.och.taxi.ui.navi.amap.TaxiAmapNaviFragment
|
||||
import com.mogo.och.taxi.ui.navi.auto.TaxiRoutingNaviFragment
|
||||
import kotlinx.android.synthetic.main.taxi_base_fragment.anim_flow_iv
|
||||
@@ -224,31 +225,22 @@ abstract class BaseTaxiTabFragment<V : IView, P : Presenter<V>> : MvpFragment<V,
|
||||
// }
|
||||
onAutopilotStatusChanged(getState())
|
||||
|
||||
// 模拟 不可自动驾驶,目前场景是刚开机,adas还未和工控机连接
|
||||
findViewById<View>(R.id.btnAutopilotDisable)?.setOnClickListener {
|
||||
onAutopilotStatusChanged(
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE
|
||||
)
|
||||
// 打开任务调试面板
|
||||
findViewById<View>(R.id.btnOpenDebugView)?.setOnClickListener {
|
||||
val intent = Intent()
|
||||
intent.action = DebugView.BROADCAST_ACTION
|
||||
intent.putExtra(DebugView.BROADCAST_DATA_SHOW, true)
|
||||
LocalBroadcastManager.getInstance(requireContext()).sendBroadcast(intent)
|
||||
}
|
||||
|
||||
// 模拟 可自动驾驶,工控机连接正常,且处于人工干预状态
|
||||
findViewById<View>(R.id.btnAutopilotEnable)?.setOnClickListener {
|
||||
onAutopilotStatusChanged(
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE
|
||||
)
|
||||
// 关闭任务调试面板
|
||||
findViewById<View>(R.id.btnCloseDebugView)?.setOnClickListener {
|
||||
val intent = Intent()
|
||||
intent.action = DebugView.BROADCAST_ACTION
|
||||
intent.putExtra(DebugView.BROADCAST_DATA_SHOW, false)
|
||||
LocalBroadcastManager.getInstance(requireContext()).sendBroadcast(intent)
|
||||
}
|
||||
|
||||
// 模拟 自动驾驶能力,自动驾驶中,可能是停车,可能是行进,但是是机器在处理车的前进后退,不是人
|
||||
findViewById<View>(R.id.btnAutopilotRunning)?.setOnClickListener {
|
||||
onAutopilotStatusChanged(
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
|
||||
)
|
||||
}
|
||||
findViewById<View>(R.id.btnAutopilotmanco)?.setOnClickListener {
|
||||
onAutopilotStatusChanged(
|
||||
IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING
|
||||
)
|
||||
}
|
||||
module_mogo_och_operation_status.setOnClickListener { onChangeOperationStatus() }
|
||||
taxi_close_navi_icon.setOnClickListener {
|
||||
showAmapNaviToStationFragment(false)
|
||||
|
||||
@@ -254,7 +254,9 @@ class TaxiFragment : BaseTaxiTabFragment<TaxiFragment, TaxiPresenter>(),
|
||||
TaxiTaskModel.mockOnTheWayToEndStation()
|
||||
}
|
||||
|
||||
findViewById<View>(R.id.test_bar_route)?.setOnClickListener { testRouteInfoUpload() }
|
||||
findViewById<View>(R.id.test_bar_route)?.setOnClickListener {
|
||||
testRouteInfoUpload()
|
||||
}
|
||||
}
|
||||
|
||||
fun onCurrentOrderDistToEndChanged(meters: Long, timeInSecond: Long) {
|
||||
|
||||
@@ -1,70 +1,160 @@
|
||||
package com.mogo.och.taxi.ui.debug
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.LinearLayout
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil
|
||||
import com.mogo.och.taxi.R
|
||||
import com.mogo.och.taxi.bean.QueryCurrentTaskRespBean
|
||||
import com.mogo.och.taxi.bean.TrajectoryListRespBean
|
||||
import com.mogo.och.taxi.callback.ITaxiTaskWithOrderCallback
|
||||
import com.mogo.och.taxi.constant.TaskStatusEnum
|
||||
import com.mogo.och.taxi.constant.TaskTypeEnum
|
||||
import com.mogo.och.taxi.constant.TaxiOrderStatusEnum
|
||||
import com.mogo.och.taxi.ui.task.TaxiTaskModel
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.orderInfo
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.orderToStartLines
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.currentCarStatus
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.currentDataTimestamps
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.currentLineId
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.currentOrder
|
||||
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.orderEndSiteInfo
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.orderNo
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.orderPreLoadLines
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.orderStartSiteInfo
|
||||
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
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.taskStatus2
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.taskType2
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.test_bar_current_line_id
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.test_bar_current_line_name
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.test_bar_current_order_id
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.test_bar_current_stop_md5
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.test_bar_current_stop_md5_dpqp
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.test_bar_current_traj_md5
|
||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.test_bar_current_traj_md5_dpqp
|
||||
|
||||
class DebugView @JvmOverloads constructor(
|
||||
public class DebugView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0,
|
||||
defStyleRes: Int = 0
|
||||
) : LinearLayout(context, attrs, defStyleAttr, defStyleRes) {
|
||||
) : 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 val broadcastReceiver = object : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
if (BROADCAST_ACTION == intent.action) {
|
||||
val isShow = intent.getBooleanExtra(BROADCAST_DATA_SHOW, false)
|
||||
visibility = if (isShow) VISIBLE else GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
initBroadcastReceiver()
|
||||
LayoutInflater.from(context)
|
||||
.inflate(R.layout.taxi_debug_order, this, true)
|
||||
visibility = GONE
|
||||
}
|
||||
|
||||
fun toggleOrderDebugView() {
|
||||
val data = TaxiTaskModel.getCurrentTaskWithOrder()
|
||||
val curContrail = TaxiTaskModel.getCurrentTaskTrajectory()
|
||||
private fun initBroadcastReceiver() {
|
||||
val intentFilter = IntentFilter()
|
||||
intentFilter.addAction(BROADCAST_ACTION)
|
||||
LocalBroadcastManager.getInstance(context).registerReceiver(broadcastReceiver, intentFilter)
|
||||
}
|
||||
|
||||
fun toggleOrderDebugView() {
|
||||
visibility =
|
||||
if (visibility == View.VISIBLE)
|
||||
View.GONE
|
||||
else
|
||||
View.VISIBLE
|
||||
test_bar_current_order_id.text = "orderNo: ${data?.order?.orderNo}"
|
||||
test_bar_current_line_id!!.text = "当前任务lineId: ${data?.lineId}"
|
||||
test_bar_current_line_name!!.text = "当前任务lineName: ${curContrail?.lineName}"
|
||||
taskType2.text = "当前任务类型: ${data?.taskType}"
|
||||
taskStatus2.text = "任务状态: ${data?.currentStatus}"
|
||||
taskStartSite.text =
|
||||
"任务开始站点: ${data?.startSite?.siteName} , siteId: ${data?.startSite?.siteId}"
|
||||
taskEndSite.text =
|
||||
"任务结束站点: ${data?.endSite?.siteName}, siteId: ${data?.endSite?.siteId}"
|
||||
orderInfo.text =
|
||||
"订单信息: 开始: ${data?.order?.orderStartSite?.siteName}, 结束: ${data?.order?.orderEndSite?.siteName}, " +
|
||||
"orderStatus: ${data?.order?.orderStatus}"
|
||||
orderToStartLines.text =
|
||||
"接驾任务的lineId集合: " + GsonUtil.jsonFromObject(data?.order?.planningLines)
|
||||
val data = TaxiTaskModel.getCurrentTaskWithOrder()
|
||||
initViewByData(data)
|
||||
}
|
||||
|
||||
test_bar_current_traj_md5.text = "TrajMd5: ${curContrail?.csvFileMd5}"
|
||||
test_bar_current_stop_md5.text = "StopMd5: ${curContrail?.txtFileMd5}"
|
||||
test_bar_current_traj_md5_dpqp.text = "TrajMd5DPQP: ${curContrail?.csvFileMd5DPQP}"
|
||||
test_bar_current_stop_md5_dpqp.text = "StopMd5DPQP: ${curContrail?.txtFileMd5DPQP}"
|
||||
private fun initTaskWithOrderDataListener() {
|
||||
TaxiTaskModel.addTaskWithOrderListener(TAG, this)
|
||||
}
|
||||
|
||||
private fun removeTaskWithOrderDataListener() {
|
||||
TaxiTaskModel.removeTaskWithOrderListener(TAG)
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
initTaskWithOrderDataListener()
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
removeTaskWithOrderDataListener()
|
||||
}
|
||||
|
||||
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
|
||||
)
|
||||
}"
|
||||
currentCarStatus.text =
|
||||
"【当前车辆状态】${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}"
|
||||
currentLineId.text = "【当前任务lineId】 ${data?.lineId}"
|
||||
taskStartSite.text =
|
||||
"【当前任务起点】${data?.startSite?.siteName} siteId=${data?.startSite?.siteId}"
|
||||
taskEndSite.text =
|
||||
"【当前任务终点】${data?.endSite?.siteName} siteId=${data?.endSite?.siteId}"
|
||||
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}"
|
||||
orderStartSiteInfo.text =
|
||||
"【订单起点】${data?.order?.orderStartSite?.siteName}"
|
||||
orderEndSiteInfo.text =
|
||||
"【订单终点】${data?.order?.orderEndSite?.siteName}"
|
||||
orderPreLoadLines.text =
|
||||
"【接驾任务预加载lineIds】${GsonUtil.jsonFromObject(data?.order?.planningLines)}"
|
||||
currentOrderTrajectoryInfo.text =
|
||||
"【当前任务Traj信息】TrajMd5=${curContrail?.csvFileMd5} , TrajDPQPMd5=${curContrail?.csvFileMd5DPQP}"
|
||||
currentOrderStopInfo.text =
|
||||
"【当前任务Stop信息】StopMd5=${curContrail?.txtFileMd5}, StopDPQPMd5=${curContrail?.txtFileMd5DPQP}"
|
||||
}
|
||||
|
||||
override fun onTaskWithOrderDataChanged(taskWithOrder: QueryCurrentTaskRespBean.Result?) {
|
||||
d(TAG, "onTaskWithOrderDataChanged")
|
||||
initViewByData(taskWithOrder)
|
||||
}
|
||||
|
||||
override fun onTaskCompleted(isOrderArrivedAtStart: Boolean, siteId: Long) {
|
||||
}
|
||||
|
||||
override fun onTaskTrajectoryDataChanged(data: TrajectoryListRespBean?) {
|
||||
}
|
||||
|
||||
override fun onOrderCancel() {
|
||||
}
|
||||
|
||||
override fun onOrderArriveAtEnd(orderNo: String) {
|
||||
}
|
||||
|
||||
override fun onOrderTotalMileAndDurationChanged(mileage: Float, duration: Int) {
|
||||
}
|
||||
|
||||
override fun onOrderJourneyCompleted() {
|
||||
}
|
||||
|
||||
override fun onStartAutopilot() {
|
||||
}
|
||||
}
|
||||
@@ -167,6 +167,7 @@ class TaxiCurrentTaskFragment : BaseFragment(),
|
||||
if (currentTaskWithOrder == null) {
|
||||
initContainerView(false)
|
||||
removeAllMapMarker()
|
||||
updateNextTaskFragment(currentTaskWithOrder)
|
||||
return@collect
|
||||
}
|
||||
updateNextTaskFragment(currentTaskWithOrder)
|
||||
|
||||
@@ -39,7 +39,7 @@ class TaxiCurrentTaskViewModel : BaseViewModel<UnmannedState, TaskUiIntent>(),
|
||||
private val TAG = SceneConstant.M_TAXI + "TaxiUnmannedViewModel"
|
||||
|
||||
init {
|
||||
TaxiTaskModel.setTaskWithOrderCallback(this)
|
||||
TaxiTaskModel.addTaskWithOrderListener(TAG, this)
|
||||
TaxiTaskModel.setCarServiceCallback(this)
|
||||
}
|
||||
|
||||
@@ -200,7 +200,6 @@ class TaxiCurrentTaskViewModel : BaseViewModel<UnmannedState, TaskUiIntent>(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onTaskWithOrderDataChanged(result: QueryCurrentTaskRespBean.Result?) {
|
||||
d(TAG, "onTaskWithOrderChanged = result = " + GsonUtil.jsonFromObject(result))
|
||||
updateTaskAndOrderUi(result)
|
||||
|
||||
@@ -84,6 +84,7 @@ import mogo.telematics.pad.MessagePad.GlobalPathResp
|
||||
import mogo_msg.MogoReportMsg.MogoReportMessage
|
||||
import system_master.SsmInfo
|
||||
import system_master.SystemStatusInfo
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
/**
|
||||
@@ -111,7 +112,8 @@ object TaxiTaskModel {
|
||||
|
||||
private var mAutopilotPlanningCallback: IOCHTaxiAutopilotPlanningCallback? = null
|
||||
|
||||
private var mTaxiTaskWithOrderCallback: ITaxiTaskWithOrderCallback? = null
|
||||
private val mTaxiTaskWithOrderCallbackMap: ConcurrentHashMap<String, ITaxiTaskWithOrderCallback> =
|
||||
ConcurrentHashMap()
|
||||
|
||||
private var mTaxiCarServiceCallback: ITaxiCarServiceCallback? = null
|
||||
|
||||
@@ -132,6 +134,20 @@ object TaxiTaskModel {
|
||||
|
||||
private val mCurrentTaskRoutePointsGcj: MutableList<MogoLocation> = ArrayList()
|
||||
|
||||
fun addTaskWithOrderListener(tag: String, listener: ITaxiTaskWithOrderCallback) {
|
||||
if (mTaxiTaskWithOrderCallbackMap.containsKey(tag)) {
|
||||
return
|
||||
}
|
||||
mTaxiTaskWithOrderCallbackMap[tag] = listener
|
||||
}
|
||||
|
||||
fun removeTaskWithOrderListener(tag: String) {
|
||||
if (!mTaxiTaskWithOrderCallbackMap.containsKey(tag)) {
|
||||
return
|
||||
}
|
||||
mTaxiTaskWithOrderCallbackMap.remove(tag)
|
||||
}
|
||||
|
||||
fun setMoGoAutopilotPlanningListener(moGoAutopilotPlanningCallback: IOCHTaxiAutopilotPlanningCallback?) {
|
||||
mAutopilotPlanningCallback = moGoAutopilotPlanningCallback
|
||||
}
|
||||
@@ -148,10 +164,6 @@ object TaxiTaskModel {
|
||||
mOrderStatusCallback = callback
|
||||
}
|
||||
|
||||
fun setTaskWithOrderCallback(callback: ITaxiTaskWithOrderCallback) {
|
||||
mTaxiTaskWithOrderCallback = callback
|
||||
}
|
||||
|
||||
fun setCarServiceCallback(callback: ITaxiCarServiceCallback) {
|
||||
mTaxiCarServiceCallback = callback
|
||||
}
|
||||
@@ -664,18 +676,25 @@ object TaxiTaskModel {
|
||||
if (result.endSite == null && result.order == null) {
|
||||
d(TAG, "queryCurrentTaskOnce: 任务为空")
|
||||
mCurrentTaskWithOrder = null
|
||||
mTaxiTaskWithOrderCallback?.onTaskWithOrderDataChanged(null)
|
||||
|
||||
mTaxiTaskWithOrderCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onTaskWithOrderDataChanged(null)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
//当前任务完成且订单状态到达乘客上车点, 则立马去拉取任务 不再等30s,否则送驾任务要等30s后才能去执行
|
||||
if (result?.currentStatus == TaskStatusEnum.CompleteTask.code) {
|
||||
mTaxiTaskWithOrderCallback?.onTaskCompleted(
|
||||
QueryCurrentTaskRespBean.isOrderArriveAtStart(
|
||||
result
|
||||
),
|
||||
result.endSite!!.siteId
|
||||
)
|
||||
mTaxiTaskWithOrderCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onTaskCompleted(
|
||||
QueryCurrentTaskRespBean.isOrderArriveAtStart(
|
||||
result
|
||||
),
|
||||
result.endSite!!.siteId
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
updateLocalCalculateStation()
|
||||
@@ -683,7 +702,10 @@ object TaxiTaskModel {
|
||||
//达到终点后查询全程里程和用时
|
||||
if (QueryCurrentTaskRespBean.isOrderArriveAtEnd(result)) {
|
||||
d(TAG, "queryCurrentTaskOnce ArriveAtEnd")
|
||||
mTaxiTaskWithOrderCallback?.onOrderArriveAtEnd(result.order!!.orderNo)
|
||||
mTaxiTaskWithOrderCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onOrderArriveAtEnd(result.order!!.orderNo)
|
||||
}
|
||||
}
|
||||
|
||||
//根据lineId集合去查轨迹集合, 返回的只是接驾任务的line集合, 没有送驾任务
|
||||
@@ -703,12 +725,18 @@ object TaxiTaskModel {
|
||||
d(TAG, "queryCurrentTaskOnce autoStartDriving")
|
||||
//启动动画+文字
|
||||
mControllerStatusCallback?.startOpenAutopilotNonManual()
|
||||
mTaxiTaskWithOrderCallback?.onStartAutopilot()
|
||||
mTaxiTaskWithOrderCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onStartAutopilot()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mDriveToNearestStationTask == null) {
|
||||
mTaxiTaskWithOrderCallback?.onTaskWithOrderDataChanged(mCurrentTaskWithOrder)
|
||||
mTaxiTaskWithOrderCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onTaskWithOrderDataChanged(mCurrentTaskWithOrder)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -749,20 +777,29 @@ object TaxiTaskModel {
|
||||
TaxiOrderStatusEnum.Cancel.code -> {
|
||||
//更新本地标志位
|
||||
mCurrentTaskWithOrder?.order = null
|
||||
mTaxiTaskWithOrderCallback?.onOrderCancel()
|
||||
mTaxiTaskWithOrderCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onOrderCancel()
|
||||
}
|
||||
}
|
||||
|
||||
TaxiOrderStatusEnum.ArriveAtEnd.code -> {
|
||||
mTaxiTaskWithOrderCallback?.onOrderTotalMileAndDurationChanged(
|
||||
data.data.mileage,
|
||||
data.data.duration.toInt()
|
||||
)
|
||||
mTaxiTaskWithOrderCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onOrderTotalMileAndDurationChanged(
|
||||
data.data.mileage,
|
||||
data.data.duration.toInt()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
TaxiOrderStatusEnum.JourneyCompleted.code -> {
|
||||
//更新本地标志位
|
||||
mCurrentTaskWithOrder?.order = null
|
||||
mTaxiTaskWithOrderCallback?.onOrderJourneyCompleted()
|
||||
mTaxiTaskWithOrderCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onOrderJourneyCompleted()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -842,7 +879,10 @@ object TaxiTaskModel {
|
||||
mTaskTrajectoryList.addAll(it)
|
||||
mCurrentTaskTrajectory = it.first { currentTaskLineId == it.lineId }
|
||||
}
|
||||
mTaxiTaskWithOrderCallback?.onTaskTrajectoryDataChanged(data)
|
||||
mTaxiTaskWithOrderCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onTaskTrajectoryDataChanged(data)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String?) {
|
||||
|
||||
@@ -336,52 +336,34 @@
|
||||
<!-- </LinearLayout>-->
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAutopilotDisable"
|
||||
android:id="@+id/btnOpenDebugView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="模拟 自动驾驶Disable"
|
||||
android:text="打开任务调试面板"
|
||||
android:background="#0f0"
|
||||
android:textSize="@dimen/dp_40"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAutopilotEnable"
|
||||
android:id="@+id/btnCloseDebugView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="模拟 自动驾驶Enable"
|
||||
android:background="#f00"
|
||||
android:text="关闭任务调试面板"
|
||||
android:textSize="@dimen/dp_40"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable"
|
||||
app:layout_constraintTop_toBottomOf="@id/btnAutopilotDisable" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAutopilotRunning"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="模拟 自动驾驶Running"
|
||||
android:textSize="@dimen/dp_40"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable"
|
||||
app:layout_constraintTop_toBottomOf="@id/btnAutopilotEnable" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAutopilotmanco"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="模拟 人机共驾"
|
||||
android:textSize="@dimen/dp_40"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable"
|
||||
app:layout_constraintTop_toBottomOf="@id/btnAutopilotRunning" />
|
||||
app:layout_constraintRight_toRightOf="@id/btnOpenDebugView"
|
||||
app:layout_constraintTop_toBottomOf="@id/btnOpenDebugView" />
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/groupTestPanel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:constraint_referenced_ids="btnAutopilotDisable,btnAutopilotEnable,btnAutopilotRunning,btnAutopilotmanco"
|
||||
tools:visibility="gone" />
|
||||
app:constraint_referenced_ids="btnOpenDebugView,btnCloseDebugView"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/module_mogo_och_navi_panel_container"
|
||||
|
||||
@@ -6,35 +6,35 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/test_bar_current_order_id"
|
||||
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/test_bar_current_line_id"
|
||||
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/test_bar_current_line_name"
|
||||
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/taskType2"
|
||||
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/taskStatus2"
|
||||
android:id="@+id/currentLineId"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/white"
|
||||
@@ -55,80 +55,107 @@
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/orderInfo"
|
||||
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/orderToStartLines"
|
||||
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/test_bar_current_traj_md5"
|
||||
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/test_bar_current_stop_md5"
|
||||
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/test_bar_current_traj_md5_dpqp"
|
||||
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/test_bar_current_stop_md5_dpqp"
|
||||
android:id="@+id/orderPreLoadLines"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/test_bar_to_virtual"
|
||||
<TextView
|
||||
android:id="@+id/currentOrderTrajectoryInfo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="到达标定站点"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/test_bar_start_service_confirm"
|
||||
<TextView
|
||||
android:id="@+id/currentOrderStopInfo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="开启服务"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/test_bar_on_the_way_to_end"
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="开启自动驾驶"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/test_bar_to_end"
|
||||
<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"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="到达站点"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/test_bar_route"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="模拟轨迹"
|
||||
android:textSize="12sp" />
|
||||
<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>
|
||||
Reference in New Issue
Block a user