Merge branch 'release_robotaxi-d_231024_6.1.2.1' into 'master'
Release robotaxi d 231024 6.1.2.1 See merge request SCA/L4HA/AndroidApp/MoGoEagleEye!829
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
package com.mogo.och.common.module.wigets;
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.os.CountDownTimer
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
@@ -28,7 +26,7 @@ class StartAutopilotAnimationView @JvmOverloads constructor(
|
||||
) : RelativeLayout(context, attrs, defStyleAttr){
|
||||
|
||||
companion object {
|
||||
private const val ALL_CLOSE_TIMER = 10000L
|
||||
private const val ALL_CLOSE_TIMER = 5000L
|
||||
private const val TAG = "StartAutopilotAnimationView"
|
||||
}
|
||||
|
||||
@@ -38,7 +36,6 @@ class StartAutopilotAnimationView @JvmOverloads constructor(
|
||||
|
||||
private val closeWarningTask: Runnable = Runnable {
|
||||
//开始倒计时
|
||||
countDownTimer()
|
||||
showWarning(DirectionEnum.ALERT_WARNING_NON)
|
||||
}
|
||||
|
||||
@@ -185,24 +182,24 @@ class StartAutopilotAnimationView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
private fun countDownTimer() {
|
||||
|
||||
startAutopilotTip.visibility = VISIBLE
|
||||
|
||||
startTimer = object : CountDownTimerExt(ALL_CLOSE_TIMER, 1000L) {// 5倒计时后开启自驾
|
||||
startTimer = object : CountDownTimerExt(ALL_CLOSE_TIMER, 1000L) {// 5s倒计时后开启自驾
|
||||
|
||||
override fun onTimerTick(value: Long) {
|
||||
// 倒计时
|
||||
UiThreadHandler.post {
|
||||
startAutopilotTip.text = "${(value/1000).toInt()} 车辆即将自动开启自动驾驶"
|
||||
startAutopilotTip.text = "${Math.ceil(value.toDouble()/1000).toInt()} 车辆即将自动开启自动驾驶"
|
||||
}
|
||||
playDI()
|
||||
}
|
||||
|
||||
override fun onTimerFinish() {
|
||||
cancelCountdown()
|
||||
//倒计时结束了...
|
||||
UiThreadHandler.post {
|
||||
SoundPoolHelper.getSoundPoolHelper().releaseSoundPool()
|
||||
startAutopilotTip.text = "车辆正在自动开启自动驾驶"
|
||||
dismiss(DirectionEnum.ALERT_WARNING_TOP)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -343,20 +343,15 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment
|
||||
}
|
||||
|
||||
private void startNaviToStation(boolean isVoicePlay, double stationLat, double stationLng) {
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
AmapNaviToDestinationModel.getInstance(getContext()).destroyAmaNavi();
|
||||
AmapNaviToDestinationModel.getInstance(getContext()).destroyAmaNavi();
|
||||
double mCurLatitude = CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02().getLatitude();
|
||||
double mCurLongitude =CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02().getLongitude();
|
||||
|
||||
double mCurLatitude = CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02().getLatitude();
|
||||
double mCurLongitude =CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02().getLongitude();
|
||||
CallerLogger.d(M_TAXI + TAG, "currentLatLng=" + mCurLatitude + " " +mCurLongitude);
|
||||
|
||||
CallerLogger.d(M_TAXI + TAG, "currentLatLng=" + mCurLatitude + " " +mCurLongitude);
|
||||
NaviLatLng startNaviLatLng = new NaviLatLng(mCurLatitude, mCurLongitude);
|
||||
NaviLatLng endNaviLatLng = new NaviLatLng(stationLat, stationLng);
|
||||
AmapNaviToDestinationModel.getInstance(getContext()).initAMapNavi(startNaviLatLng, endNaviLatLng);
|
||||
}
|
||||
});
|
||||
NaviLatLng startNaviLatLng = new NaviLatLng(mCurLatitude, mCurLongitude);
|
||||
NaviLatLng endNaviLatLng = new NaviLatLng(stationLat, stationLng);
|
||||
AmapNaviToDestinationModel.getInstance(getContext()).initAMapNavi(startNaviLatLng, endNaviLatLng);
|
||||
AmapNaviToDestinationModel.getInstance(getContext()).setVoiceIsMute(isVoicePlay);
|
||||
AmapNaviToDestinationModel.getInstance(getContext()).setTaxiNaviChangedCallback(this);
|
||||
}
|
||||
|
||||
@@ -9,16 +9,17 @@
|
||||
<com.mogo.eagle.core.function.view.MapBizView
|
||||
android:id="@+id/mapBizView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
android:layout_height="match_parent"
|
||||
app:isWeatherEnable="false" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugViewTrigger
|
||||
android:layout_width="@dimen/dp_400"
|
||||
android:layout_height="@dimen/dp_100"
|
||||
android:longClickable="true"
|
||||
app:locationIcon3DRes="@raw/chuzuche"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:locationIcon3DRes="@raw/chuzuche" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/module_mogo_och_speed_layout"
|
||||
@@ -305,7 +306,7 @@
|
||||
android:layout_width="@dimen/dp_70"
|
||||
android:layout_height="@dimen/dp_70"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/bad_case_selector_och"/>
|
||||
android:background="@drawable/bad_case_selector_och" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.RomaTaxiView
|
||||
@@ -314,35 +315,34 @@
|
||||
app:layout_constraintBottom_toBottomOf="@id/module_och_taxi_badcase_ll"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_och_taxi_badcase_ll"
|
||||
app:layout_constraintTop_toTopOf="@id/module_och_taxi_badcase_ll"
|
||||
app:roma_open_bg="@drawable/taxi_operation_status_select_bg"
|
||||
app:roma_close_bg="@drawable/taxi_operation_status_bg"
|
||||
/>
|
||||
app:roma_open_bg="@drawable/taxi_operation_status_select_bg" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.RomaDistanceView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
app:layout_constraintRight_toRightOf="parent" />
|
||||
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:id="@+id/module_och_taxi_ai_collect_ll"-->
|
||||
<!-- android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"-->
|
||||
<!-- android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"-->
|
||||
<!-- android:layout_marginLeft="40dp"-->
|
||||
<!-- android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"-->
|
||||
<!-- android:elevation="@dimen/dp_10"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:background="@drawable/taxi_operation_status_bg_selector"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintLeft_toRightOf="@id/module_och_taxi_badcase_ll">-->
|
||||
<!-- <ImageView-->
|
||||
<!-- android:layout_width="@dimen/dp_70"-->
|
||||
<!-- android:layout_height="@dimen/dp_70"-->
|
||||
<!-- android:layout_gravity="center"-->
|
||||
<!-- android:background="@drawable/ai_collect_selector_och"/>-->
|
||||
<!-- </LinearLayout>-->
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:id="@+id/module_och_taxi_ai_collect_ll"-->
|
||||
<!-- android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"-->
|
||||
<!-- android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"-->
|
||||
<!-- android:layout_marginLeft="40dp"-->
|
||||
<!-- android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"-->
|
||||
<!-- android:elevation="@dimen/dp_10"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- android:background="@drawable/taxi_operation_status_bg_selector"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintLeft_toRightOf="@id/module_och_taxi_badcase_ll">-->
|
||||
<!-- <ImageView-->
|
||||
<!-- android:layout_width="@dimen/dp_70"-->
|
||||
<!-- android:layout_height="@dimen/dp_70"-->
|
||||
<!-- android:layout_gravity="center"-->
|
||||
<!-- android:background="@drawable/ai_collect_selector_och"/>-->
|
||||
<!-- </LinearLayout>-->
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAutopilotDisable"
|
||||
|
||||
@@ -131,6 +131,15 @@ data class QueryCurrentTaskRespBean(var data: Result?) : BaseData() {
|
||||
return data.order!!.orderStatus == TaxiOrderStatusEnum.ArriveAtEnd.code
|
||||
}
|
||||
|
||||
fun isOrderOnTheWayToStart(data: Result?): Boolean {
|
||||
if (data == null) {
|
||||
return false
|
||||
}
|
||||
if (data.order == null) {
|
||||
return false
|
||||
}
|
||||
return data.order!!.orderStatus == TaxiOrderStatusEnum.OnTheWayToStart.code
|
||||
}
|
||||
/**
|
||||
* with order.orderStatus == ArriveAtStart
|
||||
*/
|
||||
@@ -144,7 +153,7 @@ data class QueryCurrentTaskRespBean(var data: Result?) : BaseData() {
|
||||
return data.order!!.orderStatus == TaxiOrderStatusEnum.ArriveAtStart.code
|
||||
}
|
||||
|
||||
fun isUserArriveAtStart(data: Result?): Boolean {
|
||||
fun isOrderUserArriveAtStart(data: Result?): Boolean {
|
||||
if (data == null) {
|
||||
return false
|
||||
}
|
||||
@@ -157,7 +166,7 @@ data class QueryCurrentTaskRespBean(var data: Result?) : BaseData() {
|
||||
/**
|
||||
* with task.currentStatus == StartTask
|
||||
*/
|
||||
fun isStartTaskType(data: Result?): Boolean {
|
||||
fun isTaskStartTaskType(data: Result?): Boolean {
|
||||
if (data == null) {
|
||||
return false
|
||||
}
|
||||
@@ -167,7 +176,7 @@ data class QueryCurrentTaskRespBean(var data: Result?) : BaseData() {
|
||||
/**
|
||||
* with task.currentStatus == CompleteTask
|
||||
*/
|
||||
fun isCompleteTaskType(data: Result?): Boolean {
|
||||
fun isTaskCompleteTaskType(data: Result?): Boolean {
|
||||
if (data == null) {
|
||||
return false
|
||||
}
|
||||
@@ -177,7 +186,7 @@ data class QueryCurrentTaskRespBean(var data: Result?) : BaseData() {
|
||||
/**
|
||||
* with task.currentStatus == GetTask
|
||||
*/
|
||||
fun isGetTaskType(data: Result?): Boolean {
|
||||
fun isTaskGetTaskType(data: Result?): Boolean {
|
||||
if (data == null) {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -5,7 +5,8 @@ import com.mogo.och.taxi.bean.TrajectoryListRespBean
|
||||
|
||||
interface ITaxiTaskWithOrderCallback {
|
||||
fun onTaskWithOrderDataChanged(taskWithOrder: QueryCurrentTaskRespBean.Result?)
|
||||
fun onTaskCompleted(result: QueryCurrentTaskRespBean.Result)
|
||||
fun onTaskCompleted(result: QueryCurrentTaskRespBean.Result?)
|
||||
fun onTaskStarted(result: QueryCurrentTaskRespBean.Result?)
|
||||
fun onTaskTrajectoryDataChanged(data: TrajectoryListRespBean?)
|
||||
fun onOrderCancel()
|
||||
fun onOrderArriveAtEnd(orderNo: String)
|
||||
|
||||
@@ -80,11 +80,15 @@ class TaxiUnmannedConst {
|
||||
|
||||
const val TIMER_START_AUTOPILOT_INTERVAL = 20 * 1000L
|
||||
|
||||
const val TIMER_PREPARE_TASK_INTERVAL_120S = 120 * 1000L //120s再次获取任务
|
||||
const val TIMER_PREPARE_VIRTUAL_TASK_INTERVAL = 45 * 1000L //45s再次获取任务
|
||||
|
||||
const val START_AUTOPILOT_COUNTDOWN_INTERVAL = 10 * 1000L // 自动启动自驾倒数计时
|
||||
const val START_PREPARE_TO_START_TASK_INTERVAL = 0L // 直接拉取接驾任务
|
||||
|
||||
const val START_AUTOPILOT_ANIMATION_INTERVAL = 12 * 1000L // 12s 开启自驾闪烁动画
|
||||
const val START_PREPARE_TASK_RETRY_INTERVAL = 5 * 1000L // 拉取任务失败重试 5s
|
||||
|
||||
const val START_AUTOPILOT_COUNTDOWN_INTERVAL = 5 * 1000L // 自动启动自驾倒数计时
|
||||
|
||||
const val START_AUTOPILOT_ANIMATION_INTERVAL = 7 * 1000L // 开启自驾闪烁动画
|
||||
|
||||
}
|
||||
}
|
||||
@@ -57,7 +57,7 @@ class TaxiFragment : BaseTaxiTabFragment<TaxiFragment, TaxiPresenter>(),
|
||||
fun changeOverview(eventLogout: EventLogout) {
|
||||
if (eventLogout.messgae == EventLogout.LOGOUT_TYPE) {
|
||||
d(SceneConstant.M_TAXI + TAG, "changeOverview Event消息去登出")
|
||||
mPresenter.logout()
|
||||
mPresenter?.logout()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,12 +107,12 @@ class TaxiFragment : BaseTaxiTabFragment<TaxiFragment, TaxiPresenter>(),
|
||||
// 在自动驾驶中,或者自己确认车辆环境可开启自动驾驶 则可点击
|
||||
if (!isStarting) {
|
||||
d(SceneConstant.M_TAXI + TAG, "startAutopilot")
|
||||
mPresenter.startAutoPilot()
|
||||
mPresenter?.startAutoPilot()
|
||||
}
|
||||
}
|
||||
|
||||
override fun pauseStartAutopilot() {
|
||||
mPresenter.pauseStartAutopilot()
|
||||
mPresenter?.pauseStartAutopilot()
|
||||
}
|
||||
|
||||
override fun resumeStartAutopilot(remainingTime: Long) {
|
||||
@@ -120,7 +120,7 @@ class TaxiFragment : BaseTaxiTabFragment<TaxiFragment, TaxiPresenter>(),
|
||||
}
|
||||
|
||||
override fun startNaviToEndStation(isShow: Boolean) {
|
||||
mPresenter.startNaviToEndStation(isShow)
|
||||
mPresenter?.startNaviToEndStation(isShow)
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
@@ -134,7 +134,7 @@ class TaxiFragment : BaseTaxiTabFragment<TaxiFragment, TaxiPresenter>(),
|
||||
}
|
||||
|
||||
override fun stopAutoStartAutopilot() {
|
||||
mPresenter.stopAutoStartAutopilot()
|
||||
mPresenter?.stopAutoStartAutopilot()
|
||||
}
|
||||
|
||||
private fun initFlowEvent() {
|
||||
@@ -275,7 +275,7 @@ class TaxiFragment : BaseTaxiTabFragment<TaxiFragment, TaxiPresenter>(),
|
||||
|
||||
findViewById<View>(R.id.test_bar_on_the_way_to_end)?.setOnClickListener {
|
||||
if (!isStarting) {
|
||||
mPresenter.startAutoPilot()
|
||||
mPresenter?.startAutoPilot()
|
||||
}
|
||||
TaxiTaskModel.mockOnTheWayToEndStation()
|
||||
}
|
||||
|
||||
@@ -199,7 +199,10 @@ public class DebugView @JvmOverloads constructor(
|
||||
initViewByData(taskWithOrder)
|
||||
}
|
||||
|
||||
override fun onTaskCompleted(result: QueryCurrentTaskRespBean.Result) {
|
||||
override fun onTaskCompleted(result: QueryCurrentTaskRespBean.Result?) {
|
||||
}
|
||||
|
||||
override fun onTaskStarted(result: QueryCurrentTaskRespBean.Result?) {
|
||||
}
|
||||
|
||||
override fun onTaskTrajectoryDataChanged(data: TrajectoryListRespBean?) {
|
||||
|
||||
@@ -206,20 +206,25 @@ class TaxiCurrentTaskFragment : BaseFragment(),
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新120s倒计时
|
||||
* 更新拉取任务倒计时
|
||||
*/
|
||||
private fun updatePrepareTaskDelayUI(millisInFuture: Long, isStart: Boolean) {
|
||||
|
||||
if (!isStart) {
|
||||
prepareTaskCountdownTv.visibility = View.GONE
|
||||
prepareTaskCountdownTv.visibility = View.INVISIBLE
|
||||
mPrepareTasCountDownTimer?.cancel()
|
||||
mPrepareTasCountDownTimer = null
|
||||
return
|
||||
}
|
||||
|
||||
if (mPrepareTasCountDownTimer != null){
|
||||
mPrepareTasCountDownTimer?.cancel()
|
||||
mPrepareTasCountDownTimer = null
|
||||
}
|
||||
|
||||
prepareTaskCountdownTv.visibility = View.VISIBLE
|
||||
mPrepareTasCountDownTimer =
|
||||
object : CountDownTimer(millisInFuture, 1000L) {// 5倒计时后开启自驾
|
||||
object : CountDownTimer(millisInFuture, 1000L) {// 倒计时后开启自驾
|
||||
|
||||
override fun onTick(millisUntilFinished: Long) {
|
||||
// 倒计时
|
||||
@@ -232,7 +237,7 @@ class TaxiCurrentTaskFragment : BaseFragment(),
|
||||
override fun onFinish() {
|
||||
//倒计时结束了...
|
||||
UiThreadHandler.post {
|
||||
prepareTaskCountdownTv.visibility = View.GONE
|
||||
prepareTaskCountdownTv.visibility = View.INVISIBLE
|
||||
}
|
||||
mPrepareTasCountDownTimer?.cancel()
|
||||
}
|
||||
@@ -594,20 +599,18 @@ class TaxiCurrentTaskFragment : BaseFragment(),
|
||||
}
|
||||
|
||||
private fun startNaviToStation(isVoicePlay: Boolean, stationLat: Double, stationLng: Double) {
|
||||
UiThreadHandler.post{
|
||||
AmapNaviToDestinationModel.getInstance(context).destroyAmaNavi()
|
||||
val mCurLatitude = getChassisLocationGCJ02().latitude
|
||||
val mCurLongitude = getChassisLocationGCJ02().longitude
|
||||
d(
|
||||
TAG,
|
||||
"currentLatLng=$mCurLatitude $mCurLongitude"
|
||||
)
|
||||
val startNaviLatLng = NaviLatLng(mCurLatitude, mCurLongitude)
|
||||
val endNaviLatLng = NaviLatLng(stationLat, stationLng)
|
||||
AmapNaviToDestinationModel.getInstance(context).initAMapNavi(startNaviLatLng, endNaviLatLng)
|
||||
AmapNaviToDestinationModel.getInstance(context).setVoiceIsMute(isVoicePlay)
|
||||
AmapNaviToDestinationModel.getInstance(context).setTaxiNaviChangedCallback(this)
|
||||
}
|
||||
AmapNaviToDestinationModel.getInstance(context).destroyAmaNavi()
|
||||
val mCurLatitude = getChassisLocationGCJ02().latitude
|
||||
val mCurLongitude = getChassisLocationGCJ02().longitude
|
||||
d(
|
||||
TAG,
|
||||
"currentLatLng=$mCurLatitude $mCurLongitude"
|
||||
)
|
||||
val startNaviLatLng = NaviLatLng(mCurLatitude, mCurLongitude)
|
||||
val endNaviLatLng = NaviLatLng(stationLat, stationLng)
|
||||
AmapNaviToDestinationModel.getInstance(context).initAMapNavi(startNaviLatLng, endNaviLatLng)
|
||||
AmapNaviToDestinationModel.getInstance(context).setVoiceIsMute(isVoicePlay)
|
||||
AmapNaviToDestinationModel.getInstance(context).setTaxiNaviChangedCallback(this)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,17 +2,22 @@ package com.mogo.och.taxi.ui.task
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
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.NetworkUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.manager.distancemamager.TrajectoryAndDistanceManager
|
||||
import com.mogo.och.common.module.utils.ToastUtilsOch
|
||||
import com.mogo.och.common.module.voice.VoiceNotice
|
||||
import com.mogo.och.common.module.wigets.StartAutopilotAnimationView
|
||||
import com.mogo.och.taxi.R
|
||||
import com.mogo.och.taxi.base.BaseViewModel
|
||||
import com.mogo.och.taxi.base.IUiIntent
|
||||
@@ -98,19 +103,19 @@ class TaxiCurrentTaskViewModel : BaseViewModel<UnmannedState, TaskUiIntent>(),
|
||||
}
|
||||
|
||||
private fun jumpPassengerCheck() {
|
||||
DebugView.printInfoMsg("[开始服务] 准备发送请求")
|
||||
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")
|
||||
DebugView.printInfoMsg("[跳过乘客验证] 请求success")
|
||||
d(TAG, "jumpPassengerCheck onSuccess:")
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String?) {
|
||||
DebugView.printInfoMsg("[开始服务] 请求fail, code=$code, msg=$msg")
|
||||
DebugView.printInfoMsg("[跳过乘客验证] 请求fail, code=$code, msg=$msg")
|
||||
d(TAG, "jumpPassengerCheck onFail: code=$code, msg=$msg")
|
||||
}
|
||||
})
|
||||
@@ -225,15 +230,48 @@ class TaxiCurrentTaskViewModel : BaseViewModel<UnmannedState, TaskUiIntent>(),
|
||||
updateTaskAndOrderUi(result)
|
||||
}
|
||||
|
||||
override fun onTaskStarted(result: QueryCurrentTaskRespBean.Result?) {
|
||||
updateLocalCalculateStation(result)
|
||||
if (result?.endSite != null){
|
||||
TaxiTaskModel.setBeautificationMode(true)
|
||||
updateAutopilotControlParameters()
|
||||
}else{
|
||||
clearDemoModeAndACParameters()
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateLocalCalculateStation(result: QueryCurrentTaskRespBean.Result?) {
|
||||
if (result?.startSite != null && result.endSite != null
|
||||
) {
|
||||
d(TAG, "updateLocalCalculateStation start")
|
||||
val curTaskAndOrder = TaxiTaskModel.getCurrentTaskWithOrder() ?: return
|
||||
if (curTaskAndOrder.startSite != null && curTaskAndOrder.endSite != null) {
|
||||
val startStation = MogoLocation()
|
||||
startStation.longitude = curTaskAndOrder.startSite!!.gcjLon
|
||||
startStation.latitude = curTaskAndOrder.startSite!!.gcjLat
|
||||
val endStation = MogoLocation()
|
||||
endStation.longitude = curTaskAndOrder.endSite!!.gcjLon
|
||||
endStation.latitude = curTaskAndOrder.endSite!!.gcjLat
|
||||
TrajectoryAndDistanceManager.setStationPoint(
|
||||
startStation,
|
||||
endStation,
|
||||
curTaskAndOrder.lineId
|
||||
)
|
||||
}
|
||||
} else {
|
||||
TaxiTaskModel.clearLocalCalculateStation()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始倒计时120s或者10s拉取任务
|
||||
* 演练任务120s拉取
|
||||
* 接驾任务10s拉取
|
||||
*/
|
||||
override fun onTaskCompleted(result: QueryCurrentTaskRespBean.Result) {
|
||||
override fun onTaskCompleted(result: QueryCurrentTaskRespBean.Result?) {
|
||||
d(TAG, "onTaskCompleted: ${result?.currentStatus}, siteId=${result?.endSite?.siteId}")
|
||||
|
||||
if (result.order != null && result.servingStatus == 1){
|
||||
if (result?.order != null && result.servingStatus == 1){
|
||||
if (result.taskType <= TaskTypeEnum.VirtualTask.code
|
||||
&& result.order!!.orderStatus < TaxiOrderStatusEnum.ArriveAtStart.code) {
|
||||
VoiceNotice.showNotice("已为您接到订单")
|
||||
@@ -243,17 +281,35 @@ class TaxiCurrentTaskViewModel : BaseViewModel<UnmannedState, TaskUiIntent>(),
|
||||
}
|
||||
}
|
||||
|
||||
if (QueryCurrentTaskRespBean.isUserArriveAtStart(result)) {
|
||||
TaxiTaskModel.removePrepareTaskDelay()
|
||||
TaxiTaskModel.prepareNextTask(0,result.endSite!!.siteId)
|
||||
}else if (!QueryCurrentTaskRespBean.isOrderArriveAtStart(result)
|
||||
|| !QueryCurrentTaskRespBean.isOrderArriveAtEnd(result)){
|
||||
TaxiTaskModel.startPrepareTaskDelay(
|
||||
if (TaskTypeEnum.isToOrderStartTask(result))
|
||||
TaxiUnmannedConst.START_AUTOPILOT_COUNTDOWN_INTERVAL
|
||||
else TaxiUnmannedConst.TIMER_PREPARE_TASK_INTERVAL_120S,
|
||||
result.endSite!!.siteId)
|
||||
/**
|
||||
* 1、有订单下(表示当前有订单或者未来有要执行的订单):
|
||||
* 接驾任务需要立即拉取, 拉取时机在车辆前往上车点状态
|
||||
* 送驾任务需要立即拉取, 拉取时机在乘客已上车状态
|
||||
* 2、在没有订单情况下
|
||||
* 若当前到站的是前往标定站点, 则45s去拉取任务
|
||||
* 若当前是演练任务到站, 45s去拉取任务
|
||||
* 若当前是接驾任务到站, 此情况肯定是有订单的, 则走1
|
||||
* 若当前到站的是送驾任务, 不去拉取, 需等待司机点击服务完成按钮后拉取
|
||||
*/
|
||||
|
||||
if (result?.order != null){
|
||||
if (QueryCurrentTaskRespBean.isOrderOnTheWayToStart(result)){
|
||||
TaxiTaskModel.startPrepareTaskDelay(TaxiUnmannedConst.START_PREPARE_TO_START_TASK_INTERVAL,
|
||||
result?.endSite!!.siteId)
|
||||
}else if (QueryCurrentTaskRespBean.isOrderUserArriveAtStart(result)) {
|
||||
TaxiTaskModel.startPrepareTaskDelay(0, result?.endSite!!.siteId)
|
||||
}
|
||||
}else{
|
||||
if (result?.taskType == TaskTypeEnum.None.code){
|
||||
TaxiTaskModel.startPrepareTaskDelay(
|
||||
TaxiUnmannedConst.TIMER_PREPARE_VIRTUAL_TASK_INTERVAL, result?.endSite!!.siteId)
|
||||
}else{
|
||||
TaxiTaskModel.startPrepareTaskDelay(
|
||||
TaxiUnmannedConst.TIMER_PREPARE_VIRTUAL_TASK_INTERVAL, result?.endSite!!.siteId)
|
||||
}
|
||||
}
|
||||
|
||||
clearDemoModeAndACParameters()
|
||||
}
|
||||
|
||||
override fun onTaskTrajectoryDataChanged(data: TrajectoryListRespBean?) {
|
||||
@@ -283,13 +339,13 @@ class TaxiCurrentTaskViewModel : BaseViewModel<UnmannedState, TaskUiIntent>(),
|
||||
//获取新的任务
|
||||
val currentTaskWithOrder = TaxiTaskModel.getCurrentTaskWithOrder()
|
||||
currentTaskWithOrder?.endSite?.also {
|
||||
TaxiTaskModel.startPrepareTaskDelay(TaxiUnmannedConst.TIMER_PREPARE_TASK_INTERVAL_120S,
|
||||
TaxiTaskModel.startPrepareTaskDelay(TaxiUnmannedConst.TIMER_PREPARE_VIRTUAL_TASK_INTERVAL,
|
||||
it.siteId)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onStartAutopilot(postDelayTime: Long) {
|
||||
UiThreadHandler.postDelayed(startTaskRunnable, postDelayTime) // 10s后或者倒计时继续开启自驾, 状态流转
|
||||
UiThreadHandler.postDelayed(startTaskRunnable, postDelayTime) // 5s后或者倒计时结束开启自驾, 状态流转
|
||||
}
|
||||
|
||||
private val startTaskRunnable: Runnable = Runnable {
|
||||
@@ -382,4 +438,26 @@ class TaxiCurrentTaskViewModel : BaseViewModel<UnmannedState, TaskUiIntent>(),
|
||||
ToastUtils.showShort(context.getString(R.string.request_error_tip))
|
||||
}
|
||||
}
|
||||
|
||||
private fun clearDemoModeAndACParameters(){
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
d(TAG, "setIPCDemoMode:false")
|
||||
CallerAutoPilotControlManager.setIPCDemoMode(false)
|
||||
}
|
||||
TaxiTaskModel.clearAutopilotControlParameters()
|
||||
}
|
||||
|
||||
/**
|
||||
* 将业务订单信息保存,鹰眼可取用
|
||||
*/
|
||||
private fun updateAutopilotControlParameters() {
|
||||
val parameters = TaxiTaskModel.initAutopilotControlParameters()
|
||||
if (null == parameters) {
|
||||
CallerLogger.e(TAG, "AutopilotControlParameters is empty.")
|
||||
return
|
||||
}
|
||||
d(TAG, "AutopilotControlParameters is update.")
|
||||
DebugView.printInfoMsg("[启自驾] updateAutopilotControlParameters调用成功")
|
||||
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(parameters)
|
||||
}
|
||||
}
|
||||
@@ -118,7 +118,11 @@ object TaxiTaskModel {
|
||||
|
||||
private var mPrepareTaskDelayRunnable: Runnable? = null
|
||||
|
||||
private var mIsArrivedSiteStartTag = false //到站接口请求标志位,防止围栏触发多次调用到站接口, true 接口请求, false : 接口请求完成
|
||||
private var mLastArrivedSiteId = -1L //上一次成功提交到站的siteId
|
||||
|
||||
private var mIsSubmitArrivedSiteRequesting = false //到站接口请求标志位, true 接口请求中, false : 当前接口没有请求
|
||||
|
||||
private var isPrepareingNextTask = false // 拉取任务接口标志位
|
||||
|
||||
fun addTaskWithOrderListener(tag: String, listener: ITaxiTaskWithOrderCallback) {
|
||||
if (mTaxiTaskWithOrderCallbackMap.containsKey(tag)) {
|
||||
@@ -259,7 +263,7 @@ object TaxiTaskModel {
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
DebugView.printInfoMsg("[自驾状态变化] afterValue=STATUS_AUTOPILOT_RUNNING,meaning=自动驾驶中")
|
||||
mADASStatusCallback?.onAutopilotRunning()
|
||||
if ((QueryCurrentTaskRespBean.isStartTaskType(mCurrentTaskWithOrder))) {
|
||||
if ((QueryCurrentTaskRespBean.isTaskStartTaskType(mCurrentTaskWithOrder))) {
|
||||
TaxiAnalyticsManager.getInstance().triggerStartAutopilotEvent(
|
||||
isRestartAutopilot,
|
||||
true,
|
||||
@@ -268,22 +272,13 @@ object TaxiTaskModel {
|
||||
mCurrentTaskWithOrder!!.lineId,
|
||||
mCurrentTaskWithOrder!!.order!!.orderNo
|
||||
)
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
// 当美化模式(演示模式)开启时: 订单对应自动驾驶开启后,置true
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true
|
||||
CallerAutoPilotControlManager.setIgnoreConditionDraw(true)
|
||||
CallerAutoPilotControlManager.setIPCDemoMode(true)
|
||||
d(
|
||||
TAG,
|
||||
"美化模式-ignore:置为true(到达出发点且已开启自动驾驶)"
|
||||
)
|
||||
}
|
||||
setBeautificationMode(true)
|
||||
}
|
||||
} else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE) {
|
||||
DebugView.printInfoMsg("[自驾状态变化] afterValue=STATUS_AUTOPILOT_ENABLE,meaning=可自动驾驶,人工干预状态")
|
||||
if ((FunctionBuildConfig.isDemoMode
|
||||
&& checkCurrentTaskCondition()
|
||||
&& QueryCurrentTaskRespBean.isStartTaskType(mCurrentTaskWithOrder)
|
||||
&& QueryCurrentTaskRespBean.isTaskStartTaskType(mCurrentTaskWithOrder)
|
||||
)
|
||||
) {
|
||||
// 当美化模式(演示模式)开启时:且有订单、且为去往目的地状态,维持自动驾驶icon开启状态
|
||||
@@ -294,7 +289,7 @@ object TaxiTaskModel {
|
||||
DebugView.printInfoMsg("[自驾状态变化] afterValue=STATUS_AUTOPILOT_DISABLE,meaning=不可自动驾驶")
|
||||
if ((FunctionBuildConfig.isDemoMode
|
||||
&& checkCurrentTaskCondition()
|
||||
&& QueryCurrentTaskRespBean.isStartTaskType(mCurrentTaskWithOrder)
|
||||
&& QueryCurrentTaskRespBean.isTaskStartTaskType(mCurrentTaskWithOrder)
|
||||
)
|
||||
) {
|
||||
// 当美化模式(演示模式)开启时:且有订单、且为去往目的地状态,维持自动驾驶icon开启状态
|
||||
@@ -305,7 +300,7 @@ object TaxiTaskModel {
|
||||
DebugView.printInfoMsg("[自驾状态变化] afterValue=STATUS_PARALLEL_DRIVING,meaning=平行驾驶中")
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
if ((checkCurrentTaskCondition()
|
||||
&& QueryCurrentTaskRespBean.isStartTaskType(
|
||||
&& QueryCurrentTaskRespBean.isTaskStartTaskType(
|
||||
mCurrentTaskWithOrder
|
||||
)
|
||||
)
|
||||
@@ -332,7 +327,34 @@ object TaxiTaskModel {
|
||||
)
|
||||
return
|
||||
}
|
||||
autopilotArriveAtStation()
|
||||
|
||||
//围栏已经到站, 拉取到下一个任务, 此时自驾的到站才传递过来, 导致直接上报了当前任务的终点站到站, 造成任务一开始立马到站的问题
|
||||
//解决方案: 根据自驾到站的经纬度和当前任务终点站的坐标比对, 如果距离在15米内, 则任务到站正确, 否则不请求到站
|
||||
if (!checkCurrentTaskCondition()) return
|
||||
val endSiteLat: Double? = mCurrentTaskWithOrder?.endSite?.gcjLat
|
||||
val endSiteLon: Double? = mCurrentTaskWithOrder?.endSite?.gcjLon
|
||||
val mapEndSiteLatWgs: Double? = arrivalNotification?.endLocation?.latitude
|
||||
val mapEndSiteLonWgs: Double? = arrivalNotification?.endLocation?.longitude
|
||||
if (endSiteLon != null && endSiteLat != null && mapEndSiteLonWgs != null && mapEndSiteLatWgs != null){
|
||||
|
||||
var latLngs = CoordinateUtils.transformWgsToGcj(mapEndSiteLatWgs,mapEndSiteLonWgs)
|
||||
|
||||
val distance = CoordinateUtils.calculateLineDistance(
|
||||
endSiteLon, endSiteLat,
|
||||
latLngs[0], latLngs[1]
|
||||
).toDouble()
|
||||
if (distance <= TaxiUnmannedConst.ARRIVE_AT_START_STATION_DISTANCE){// 两坐标小于15米
|
||||
DebugView.printInfoMsg("[MAP到站通知] 到站坐标和任务终点15米内, 请求到站")
|
||||
autopilotArriveAtStation()
|
||||
}else{
|
||||
DebugView.printInfoMsg("[MAP到站通知] 到站坐标和任务终点不一致, 不请求到站")
|
||||
}
|
||||
}else{
|
||||
DebugView.printInfoMsg("[MAP到站通知] endSiteLat = $endSiteLat, endSiteLon = $endSiteLon, " +
|
||||
"mapEndSiteLat = $mapEndSiteLatWgs, mapEndSiteLon = $mapEndSiteLonWgs")
|
||||
}
|
||||
|
||||
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
// 当美化模式(演示模式)开启时: 到达目的地,置false
|
||||
// 2022.10.08 到达目的地时候取消自动起自驾, 服务完成取消引导线和自动驾驶按钮状态
|
||||
@@ -366,7 +388,7 @@ object TaxiTaskModel {
|
||||
}
|
||||
|
||||
if (checkCurrentTaskCondition()
|
||||
&& QueryCurrentTaskRespBean.isStartTaskType(mCurrentTaskWithOrder)
|
||||
&& QueryCurrentTaskRespBean.isTaskStartTaskType(mCurrentTaskWithOrder)
|
||||
) {
|
||||
judgeTaskEndSiteStation(mogoLocation)
|
||||
}
|
||||
@@ -556,12 +578,22 @@ object TaxiTaskModel {
|
||||
siteId: Long, isArriveAtEndSite: Boolean,
|
||||
isArrivedNearestStation: Boolean = false
|
||||
) {
|
||||
if (mIsArrivedSiteStartTag) {
|
||||
DebugView.printInfoMsg("arriveSite接口正在调用中")
|
||||
i(TAG, message = "arriveSite接口正在调用中 mIsArrivedSite = $mIsArrivedSiteStartTag")
|
||||
if (mLastArrivedSiteId == siteId) {
|
||||
DebugView.printWarnMsg("[上报ArriveSite] 此站点已成功上报到站, 跳过本次请求, isArrivedNearestStation=$isArrivedNearestStation" +
|
||||
", siteId=$siteId, isArriveAtEndSite=$isArriveAtEndSite")
|
||||
i(TAG, message = "此站点已成功上报到站, 跳过本次请求 isArrivedNearestStation=$isArrivedNearestStation" +
|
||||
", siteId=$siteId, isArriveAtEndSite=$isArriveAtEndSite")
|
||||
return
|
||||
}
|
||||
mIsArrivedSiteStartTag = true
|
||||
|
||||
if (mIsSubmitArrivedSiteRequesting) {
|
||||
DebugView.printWarnMsg("[上报ArriveSite] arriveSite接口正在调用中, 跳过本次请求" +
|
||||
", siteId=$siteId, isArriveAtEndSite=$isArriveAtEndSite")
|
||||
i(TAG, message = "arriveSite接口正在调用中, 跳过本次请求 isArrivedNearestStation = $isArrivedNearestStation" +
|
||||
", siteId=$siteId, isArriveAtEndSite=$isArriveAtEndSite")
|
||||
return
|
||||
}
|
||||
mIsSubmitArrivedSiteRequesting = true
|
||||
DebugView.printInfoMsg("[上报ArriveSite] siteId=$siteId, isArriveAtEndSite=$isArriveAtEndSite")
|
||||
i(TAG, message = "submitArriveSite: siteId=$siteId isArriveAtEndSite=$isArriveAtEndSite")
|
||||
TaxiTaskWithOrderServiceManager.arriveSite(
|
||||
@@ -569,10 +601,6 @@ object TaxiTaskModel {
|
||||
siteId,
|
||||
object : OchCommonServiceCallback<BaseData> {
|
||||
override fun onSuccess(data: BaseData?) {
|
||||
if (data == null || data.code != 0) {
|
||||
mIsArrivedSiteStartTag = false
|
||||
return
|
||||
}
|
||||
DebugView.printInfoMsg("[上报ArriveSite] success siteId=$siteId, isArriveAtEndSite=$isArriveAtEndSite")
|
||||
d(TAG, "submitArriveSite-onSuccess data=" + GsonUtil.jsonFromObject(data))
|
||||
mDriveToNearestStationTask = null
|
||||
@@ -584,11 +612,13 @@ object TaxiTaskModel {
|
||||
//取消自驾,D档位会溜车 map3.6.0 修改
|
||||
cancelAutopilot()
|
||||
}
|
||||
mLastArrivedSiteId = siteId
|
||||
mIsSubmitArrivedSiteRequesting = false
|
||||
}
|
||||
|
||||
override fun onError() {
|
||||
super.onError()
|
||||
mIsArrivedSiteStartTag = false
|
||||
mIsSubmitArrivedSiteRequesting = false
|
||||
if (!NetworkUtils.isConnected(mContext)) { // 网络异常,接口重试
|
||||
ToastUtils.showShort("网络出现异常,请稍后重试")
|
||||
DebugView.printErrorMsg("[上报ArriveSite] 网络出现异常,请稍后重试")
|
||||
@@ -599,7 +629,7 @@ object TaxiTaskModel {
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String?) {
|
||||
mIsArrivedSiteStartTag = false
|
||||
mIsSubmitArrivedSiteRequesting = false
|
||||
DebugView.printErrorMsg("[上报ArriveSite] failed, code=$code, msg=$msg")
|
||||
d(TAG, "code=$code msg=$msg")
|
||||
ToastUtils.showShort("到站接口请求出现异常,请稍后重试,code=$code msg=$msg")
|
||||
@@ -698,8 +728,6 @@ object TaxiTaskModel {
|
||||
|
||||
mCurrentTaskWithOrder = result
|
||||
|
||||
updateLocalCalculateStation()
|
||||
|
||||
// 任务为空
|
||||
if (result?.endSite == null && result?.order == null) {
|
||||
d(TAG, "queryCurrentTaskOnce: 任务为空")
|
||||
@@ -710,16 +738,24 @@ object TaxiTaskModel {
|
||||
}
|
||||
}
|
||||
clearCurrentOCHOrder()
|
||||
clearLocalCalculateStation()
|
||||
return
|
||||
}
|
||||
|
||||
//开始任务处理
|
||||
if (QueryCurrentTaskRespBean.isTaskStartTaskType(result)){
|
||||
mLastArrivedSiteId = -1L // 司机或者乘客屏startTask后需要重置标志位
|
||||
mTaxiTaskWithOrderCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onTaskStarted(result)
|
||||
}
|
||||
}
|
||||
|
||||
//当前任务完成且订单状态到达乘客上车点, 则立马去拉取任务 不再等120s,否则送驾任务要等120s后才能去执行(8.29废)
|
||||
//8.29更新: 当前任务完成且订单状态为乘客已上车, 则立马去拉取任务 不再等120s,否则送驾任务要等120s后才能去执行
|
||||
// 主要是解决A-B演练任务同时接到A-B订单状态流转的问题
|
||||
//注意: 需要去除到达乘客上车点的节点, 这个节点不拉取任务
|
||||
if (result.currentStatus == TaskStatusEnum.CompleteTask.code
|
||||
) {
|
||||
mIsArrivedSiteStartTag = false //任务完成说明到站, 更新到站标识位, 不再到站接口请求成功更新
|
||||
if (QueryCurrentTaskRespBean.isTaskCompleteTaskType(result)) {
|
||||
mADASStatusCallback?.updateAutopilotStatus()
|
||||
mTaxiTaskWithOrderCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
@@ -730,7 +766,11 @@ object TaxiTaskModel {
|
||||
//达到终点后查询全程里程和用时
|
||||
if (QueryCurrentTaskRespBean.isOrderArriveAtEnd(result)) {
|
||||
d(TAG, "queryCurrentTaskOnce ArriveAtEnd")
|
||||
mIsArrivedSiteStartTag = false
|
||||
|
||||
//订单到站结束轨迹剩余里程就算和高德计算, 防止到站查询订单全程的显示被覆盖
|
||||
setStationPoint(null, null, -1L)
|
||||
AmapNaviToDestinationModel.getInstance(mContext).destroyAmaNavi()
|
||||
|
||||
mTaxiTaskWithOrderCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onOrderArriveAtEnd(result.order!!.orderNo)
|
||||
@@ -746,8 +786,8 @@ object TaxiTaskModel {
|
||||
}
|
||||
queryTaskTrajectoryByLineIds(linesIds.toTypedArray(), result.lineId)
|
||||
|
||||
//自动去启动自驾
|
||||
if (result.currentStatus == TaskStatusEnum.GetTask.code &&
|
||||
//自动去启动自驾, 拿到任务并且任务类型是演练和接驾任务
|
||||
if (QueryCurrentTaskRespBean.isTaskGetTaskType(result) &&
|
||||
result.taskType <= TaskTypeEnum.ToOrderStartTask.code
|
||||
) {
|
||||
if (result.order == null || result.order!!.orderStatus < TaxiOrderStatusEnum.ArriveAtStart.code) {
|
||||
@@ -767,7 +807,6 @@ object TaxiTaskModel {
|
||||
listener.onTaskWithOrderDataChanged(mCurrentTaskWithOrder)
|
||||
}
|
||||
}
|
||||
updateDemoModeAndAutopilotParameters(result)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -798,29 +837,12 @@ object TaxiTaskModel {
|
||||
})
|
||||
}
|
||||
|
||||
fun updateLocalCalculateStation() {
|
||||
if (mCurrentTaskWithOrder != null &&
|
||||
mCurrentTaskWithOrder?.startSite != null && mCurrentTaskWithOrder?.endSite != null
|
||||
&& mCurrentTaskWithOrder?.currentStatus == TaskStatusEnum.StartTask.code
|
||||
) {
|
||||
d(TAG, "updateLocalCalculateStation start")
|
||||
val curTaskAndOrder = getCurrentTaskWithOrder() ?: return
|
||||
if (curTaskAndOrder.startSite != null && curTaskAndOrder.endSite != null) {
|
||||
val startStation = MogoLocation()
|
||||
startStation.longitude = curTaskAndOrder.startSite!!.gcjLon
|
||||
startStation.latitude = curTaskAndOrder.startSite!!.gcjLat
|
||||
val endStation = MogoLocation()
|
||||
endStation.longitude = curTaskAndOrder.endSite!!.gcjLon
|
||||
endStation.latitude = curTaskAndOrder.endSite!!.gcjLat
|
||||
setStationPoint(startStation, endStation, curTaskAndOrder.lineId)
|
||||
}
|
||||
} else {
|
||||
d(TAG, "updateLocalCalculateStation stop")
|
||||
if (mDriveToNearestStationTask == null){
|
||||
AmapNaviToDestinationModel.getInstance(mContext).destroyAmaNavi()
|
||||
}
|
||||
setStationPoint(null, null, -1L)
|
||||
fun clearLocalCalculateStation(){
|
||||
d(TAG, "updateLocalCalculateStation stop")
|
||||
if (mDriveToNearestStationTask == null){
|
||||
AmapNaviToDestinationModel.getInstance(mContext).destroyAmaNavi()
|
||||
}
|
||||
setStationPoint(null, null, -1L)
|
||||
}
|
||||
|
||||
fun queryOrderByOrderNo(orderNo: String) {
|
||||
@@ -871,6 +893,7 @@ object TaxiTaskModel {
|
||||
|
||||
fun startTask(lineId: Long, isStartAutopilot: Boolean) {
|
||||
DebugView.printInfoMsg("[开始任务] 准备发送请求,lindId=$lineId")
|
||||
mLastArrivedSiteId = -1L
|
||||
TaxiTaskWithOrderServiceManager.startTask(
|
||||
mContext,
|
||||
lineId,
|
||||
@@ -881,6 +904,8 @@ object TaxiTaskModel {
|
||||
startAutoPilot() //自驾开启
|
||||
}
|
||||
d(TAG, "startTask onSuccess: data=${GsonUtil.jsonFromObject(data)}")
|
||||
//开始服务成功后, 如果还有正在拉取的任务请求(可能发生在一直报错重试时候), 需停止掉
|
||||
// TaxiTaskWithOrderServiceManager.cancelPrepareTask()
|
||||
}
|
||||
|
||||
override fun onError() {
|
||||
@@ -902,7 +927,14 @@ object TaxiTaskModel {
|
||||
})
|
||||
}
|
||||
|
||||
fun prepareNextTask(delayTime: Long, siteId: Long) {
|
||||
private fun prepareNextTask(siteId: Long) {
|
||||
|
||||
if (isPrepareingNextTask){
|
||||
DebugView.printInfoMsg("[PrepareNextTask] 请求调用中, 直接return")
|
||||
d(TAG, "[PrepareNextTask] 请求调用中, 直接return")
|
||||
return
|
||||
}
|
||||
isPrepareingNextTask = false
|
||||
DebugView.printInfoMsg("[PrepareNextTask] 准备发送请求, siteId=$siteId")
|
||||
TaxiTaskWithOrderServiceManager.prepareTask(
|
||||
mContext,
|
||||
@@ -915,13 +947,32 @@ object TaxiTaskModel {
|
||||
"isCarServingStatus = ${TaxiCarServingStatusManager.isCarServingStatus()}"
|
||||
)
|
||||
DebugView.printInfoMsg("[PrepareNextTask] 请求success")
|
||||
isPrepareingNextTask = false
|
||||
}
|
||||
|
||||
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()) {
|
||||
startPrepareTaskDelay(delayTime, siteId)
|
||||
isPrepareingNextTask = false
|
||||
if (LoginStatusManager.isLogin() && TaxiCarServingStatusManager.isCarServingStatus()
|
||||
&& QueryCurrentTaskRespBean.isTaskCompleteTaskType(mCurrentTaskWithOrder)) {
|
||||
mCurrentTaskWithOrder?.endSite?.siteId?.also {
|
||||
startPrepareTaskDelay(TaxiUnmannedConst.START_PREPARE_TASK_RETRY_INTERVAL,it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onError() {
|
||||
super.onError()
|
||||
DebugView.printErrorMsg("[PrepareNextTask] 请求onError, " +
|
||||
"net = ${NetworkUtils.isConnected(mContext)}")
|
||||
d(TAG, "prepareNextTask onError, , net = ${NetworkUtils.isConnected(mContext)}")
|
||||
isPrepareingNextTask = false
|
||||
if (LoginStatusManager.isLogin() && TaxiCarServingStatusManager.isCarServingStatus()
|
||||
&& QueryCurrentTaskRespBean.isTaskCompleteTaskType(mCurrentTaskWithOrder)) {
|
||||
mCurrentTaskWithOrder?.endSite?.siteId?.also {
|
||||
startPrepareTaskDelay(TaxiUnmannedConst.START_PREPARE_TASK_RETRY_INTERVAL,it)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -931,7 +982,7 @@ object TaxiTaskModel {
|
||||
removePrepareTaskDelay()
|
||||
|
||||
mPrepareTaskDelayRunnable = Runnable {
|
||||
prepareNextTask(delayTime, siteId)
|
||||
prepareNextTask(siteId)
|
||||
}
|
||||
|
||||
mTaxiTaskWithOrderCallbackMap.forEach {
|
||||
@@ -945,7 +996,7 @@ object TaxiTaskModel {
|
||||
)
|
||||
}
|
||||
|
||||
fun removePrepareTaskDelay() {
|
||||
private fun removePrepareTaskDelay() {
|
||||
if (mPrepareTaskDelayRunnable != null) {
|
||||
DebugView.printInfoMsg("[PrepareNextTask] removeCallbacks, 取消prepareNextTask倒计时")
|
||||
UiThreadHandler.removeCallbacks(mPrepareTaskDelayRunnable)
|
||||
@@ -1057,6 +1108,7 @@ object TaxiTaskModel {
|
||||
}
|
||||
}
|
||||
mDriveToNearestStationTask = data.data
|
||||
mLastArrivedSiteId = -1L //开始标定站点任务时, 到达站点标志位需复位
|
||||
mTaxiCarServiceCallback?.onCarStartServiceSuccess(
|
||||
mDriveToNearestStationTask,
|
||||
mCurrentTaskWithOrder
|
||||
@@ -1088,9 +1140,9 @@ object TaxiTaskModel {
|
||||
|
||||
fun startAutopilotByClick() {
|
||||
//订单状态流转成功, 点击了开启自驾按钮, 启动自驾
|
||||
if (QueryCurrentTaskRespBean.isStartTaskType(mCurrentTaskWithOrder)) {
|
||||
if (QueryCurrentTaskRespBean.isTaskStartTaskType(mCurrentTaskWithOrder)) {
|
||||
startAutoPilot()
|
||||
} else if (QueryCurrentTaskRespBean.isGetTaskType(mCurrentTaskWithOrder)) {
|
||||
} else if (QueryCurrentTaskRespBean.isTaskGetTaskType(mCurrentTaskWithOrder)) {
|
||||
startTask(mCurrentTaskWithOrder!!.lineId, true)
|
||||
} else {
|
||||
e(TAG, "task currentStatus is not StartTask.")
|
||||
@@ -1178,7 +1230,7 @@ object TaxiTaskModel {
|
||||
mControllerStatusCallback?.startOpenAutopilot()
|
||||
}
|
||||
|
||||
private fun initAutopilotControlParameters(): AutopilotControlParameters? {
|
||||
fun initAutopilotControlParameters(): AutopilotControlParameters? {
|
||||
if (!checkCurrentTaskCondition()) {
|
||||
e(TAG, "no order or order is empty.")
|
||||
return null
|
||||
@@ -1233,7 +1285,7 @@ object TaxiTaskModel {
|
||||
}
|
||||
|
||||
private fun judgeTaskEndSiteStation(currentLocation: MogoLocation) {
|
||||
if (!checkCurrentTaskCondition()) {
|
||||
if (!checkCurrentTaskCondition() || !QueryCurrentTaskRespBean.isTaskStartTaskType(mCurrentTaskWithOrder)) {
|
||||
return
|
||||
}
|
||||
val endSite = mCurrentTaskWithOrder!!.endSite ?: return
|
||||
@@ -1260,7 +1312,7 @@ object TaxiTaskModel {
|
||||
)
|
||||
|
||||
if (!checkCurrentTaskCondition()
|
||||
|| getCurTaskStatus() != TaskStatusEnum.StartTask.code
|
||||
|| !QueryCurrentTaskRespBean.isTaskStartTaskType(mCurrentTaskWithOrder)
|
||||
) {
|
||||
i(TAG, "task null or TaskStatus = ${getCurTaskStatus()}")
|
||||
return
|
||||
@@ -1324,14 +1376,23 @@ object TaxiTaskModel {
|
||||
*/
|
||||
fun clearCurrentOCHOrder() {
|
||||
clearAutopilotControlParameters()
|
||||
mIsArrivedSiteStartTag = false
|
||||
mLastArrivedSiteId = -1L
|
||||
mIsSubmitArrivedSiteRequesting = false
|
||||
isPrepareingNextTask = false
|
||||
isRestartAutopilot = false
|
||||
setBeautificationMode(false)
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置美化模式相关项开/关
|
||||
*/
|
||||
fun setBeautificationMode(isOpen: Boolean){
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
// 当美化模式(演示模式)开启时: 取消或订单已完成时,置false
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false
|
||||
CallerAutoPilotControlManager.setIgnoreConditionDraw(false)
|
||||
CallerAutoPilotControlManager.setIPCDemoMode(false)
|
||||
d(TAG, "美化模式-ignore:置为false(已完成or清除当前任务)")
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = isOpen
|
||||
CallerAutoPilotControlManager.setIgnoreConditionDraw(isOpen)
|
||||
CallerAutoPilotControlManager.setIPCDemoMode(isOpen)
|
||||
d(TAG, "美化模式-ignore:置为$isOpen, true表示:到达出发点且已开启自动驾驶; false表示:已完成or清除当前任务")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1362,57 +1423,7 @@ object TaxiTaskModel {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//运营模式(美化模式), 鹰眼数据同步
|
||||
private fun updateDemoModeAndAutopilotParameters(data: QueryCurrentTaskRespBean.Result?) {
|
||||
if (data == null) {
|
||||
return
|
||||
}
|
||||
|
||||
val endSite = data.endSite
|
||||
|
||||
if (endSite != null) {
|
||||
if (QueryCurrentTaskRespBean.isStartTaskType(data)) {
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
// 当美化模式(演示模式)开启时: 订单对应自动驾驶开启后,置true
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true
|
||||
CallerAutoPilotControlManager.setIgnoreConditionDraw(true)
|
||||
CallerAutoPilotControlManager.setIPCDemoMode(true)
|
||||
d(TAG, "美化模式-ignore:置为true(更新本地order信息)")
|
||||
}
|
||||
updateAutopilotControlParameters()
|
||||
}
|
||||
if (QueryCurrentTaskRespBean.isCompleteTaskType(data)) {
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
d(TAG, "setIPCDemoMode:false")
|
||||
CallerAutoPilotControlManager.setIPCDemoMode(false)
|
||||
}
|
||||
clearAutopilotControlParameters()
|
||||
}
|
||||
} else {
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
d(TAG, "setIPCDemoMode:false")
|
||||
CallerAutoPilotControlManager.setIPCDemoMode(false)
|
||||
}
|
||||
clearAutopilotControlParameters()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将业务订单信息保存,鹰眼可取用
|
||||
*/
|
||||
private fun updateAutopilotControlParameters() {
|
||||
val parameters = initAutopilotControlParameters()
|
||||
if (null == parameters) {
|
||||
e(TAG, "AutopilotControlParameters is empty.")
|
||||
return
|
||||
}
|
||||
d(TAG, "AutopilotControlParameters is update.")
|
||||
DebugView.printInfoMsg("[启自驾] updateAutopilotControlParameters调用成功")
|
||||
updateAutopilotControlParameters(parameters)
|
||||
}
|
||||
|
||||
private fun clearAutopilotControlParameters() {
|
||||
fun clearAutopilotControlParameters() {
|
||||
d(TAG, "AutopilotControlParameters is clear.")
|
||||
DebugView.printInfoMsg("[启自驾] clearAutopilotControlParameters调用成功")
|
||||
updateAutopilotControlParameters(null)
|
||||
@@ -1448,7 +1459,7 @@ object TaxiTaskModel {
|
||||
d(
|
||||
TAG, "stopAutoStartAutopilot = ${mCurrentTaskWithOrder?.currentStatus}"
|
||||
)
|
||||
if (QueryCurrentTaskRespBean.isGetTaskType(mCurrentTaskWithOrder)) {
|
||||
if (QueryCurrentTaskRespBean.isTaskGetTaskType(mCurrentTaskWithOrder)) {
|
||||
mControllerStatusCallback?.stopOpenAutopilotNonManual()
|
||||
mTaxiTaskWithOrderCallbackMap.forEach {
|
||||
val listener = it.value
|
||||
|
||||
@@ -209,8 +209,8 @@
|
||||
android:id="@+id/noTaskData"
|
||||
layout="@layout/taxi_no_data_common_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="240dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="160dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
android:layout_width="@dimen/dp_386"
|
||||
android:layout_height="@dimen/dp_350"
|
||||
android:src="@drawable/no_order_data"
|
||||
android:layout_marginTop="@dimen/dp_100"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"/>
|
||||
@@ -35,6 +36,6 @@
|
||||
android:layout_marginTop="50dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:visibility="gone"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintTop_toBottomOf="@+id/noOrderDataTv" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -90,7 +90,7 @@ applicationId=com.mogo.launcer
|
||||
applicationName=IntelligentPilot
|
||||
# RoboBus司机端:2.5.1;RoboTaxi司机端:2.5.1;RoboTaxi乘客端:1.0.0
|
||||
versionCode=6001000
|
||||
versionName=6.1.0
|
||||
versionName=6.1.2
|
||||
|
||||
################# 新架构模块Maven版本管理 #################
|
||||
MOGO_CORE_FUNCTION_HMI_VERSION=0.0.58.10
|
||||
@@ -151,25 +151,25 @@ MATRIX_VERSION=2.0.8
|
||||
# 测试模式司机端版本号
|
||||
NOOP_DRIVER_VERSION=3.2.0
|
||||
# 公交模式司机端版本号
|
||||
BUS_DRIVER_VERSION=6.1.0
|
||||
BUS_DRIVER_VERSION=6.1.2
|
||||
# 公交模式乘客端端版本号
|
||||
BUS_PASSENGER_VERSION=5.1.0
|
||||
# 接驳模式司机端版本号
|
||||
SHUTTLE_DRIVER_VERSION=6.1.0
|
||||
SHUTTLE_DRIVER_VERSION=6.1.2
|
||||
# 接驳模式乘客端端版本号
|
||||
SHUTTLE_PASSENGER_VERSION=5.1.0
|
||||
# 出租车模式司机端版本号
|
||||
TAXI_DRIVER_VERSION=6.1.0
|
||||
TAXI_DRIVER_VERSION=6.1.2
|
||||
# 出租车模式乘客端端版本号
|
||||
TAXI_PASSENGER_VERSION=5.1.0
|
||||
|
||||
# 出租车模式司机端版本号
|
||||
TAXIUNMANNED_DRIVER_VERSION=6.1.0
|
||||
TAXIUNMANNED_DRIVER_VERSION=6.1.2
|
||||
# 出租车模式乘客端端版本号
|
||||
TAXIUNMANNED_PASSENGER_VERSION=5.1.0
|
||||
|
||||
# 包车模式司机端版本号
|
||||
CHARTER_DRIVER_VERSION=6.1.0
|
||||
CHARTER_DRIVER_VERSION=6.1.2
|
||||
# 包车模式乘客端端版本号
|
||||
CHARTER_PASSENGER_VERSION=5.1.0
|
||||
# 支持云控清扫车模式司机端版本号
|
||||
|
||||
Reference in New Issue
Block a user