[taxi 乘客屏启动自驾不需要司机端先开启服务]
This commit is contained in:
yangyakun
2023-08-10 20:02:47 +08:00
committed by zhongchao
parent a65d887391
commit 6b33ab9f9f
13 changed files with 8 additions and 103 deletions

View File

@@ -62,7 +62,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.mogo.och.taxi.passenger.ui.TaxiPSettingView
<com.mogo.och.taxi.passenger.ui.systemsetting.TaxiPSettingView
android:id="@+id/clSettingView"
android:layout_width="@dimen/dp_824"
android:layout_height="@dimen/dp_517"

View File

@@ -14,8 +14,5 @@ interface IOCHTaxiPassengerOrderStatusCallback {
// 当前位置距离上车点的距离(米)、预估时间(秒)
fun onCurrentOrderDistToEndChanged(meters: Long, timeInSecond: Long,stationDistance:Int){}
// 司机已确认开启自动驾驶环境
fun onDriverHasCheckedPilotCondition(isBoarded: Boolean){}
fun onMessageGo2OverMapview(){}
}

View File

@@ -295,7 +295,6 @@ object TaxiPassengerModel {
CallerFuncBizManager.bizProvider.queryV2XEvents() //全览模式的V2X事件轮询开始
//startOrStopQueryOrderRemaining(true)
AutopilotManager.updateAutopilotControlParameters()
startOrStopReadyToAutopilotLoop(false)
setStation()
CallerOrderListenerManager.invokeOrderStatus(true)
}
@@ -313,52 +312,12 @@ object TaxiPassengerModel {
TaxiPassengerOrderStatusEnum.Cancel -> {
AutopilotManager.clearAutopilotControlParameters()
//startOrStopQueryOrderRemaining(false)
startOrStopReadyToAutopilotLoop(false)
cleanStation()
}
TaxiPassengerOrderStatusEnum.None -> TODO()
}
}
/**
* 查询司机是否已确认可开启自动驾驶
*/
private fun loopQueryPilotStatus() {
if (currentOCHOrder == null) return
TaxiPassengerServiceManager.queryPilotStatus(
currentOCHOrder!!.orderNo,
object : OchCommonServiceCallback<TaxiPassengerBaseRespBean> {
override fun onSuccess(data: TaxiPassengerBaseRespBean) {
if (data.code == 0 && data.data == true) {
updateAutopilotStatus(true)
startOrStopReadyToAutopilotLoop(false)
}
}
override fun onFail(code: Int, msg: String) {
updateAutopilotStatus(false)
}
})
}
fun updateAutopilotStatus(isBoarded: Boolean) {
if (mOrderStatusCallbackMap.isNotEmpty()) {
for (callback in mOrderStatusCallbackMap.values) {
callback.onDriverHasCheckedPilotCondition(isBoarded)
}
}
}
fun startOrStopReadyToAutopilotLoop(isStart: Boolean) {
if (isStart) {
BizLoopManager.setLoopFunction(STARTREADYTOAUTOPILOT, LoopInfo(1, TaxiPassengerModel::loopQueryPilotStatus))
CallerLogger.i(M_TAXI_P + TAG, "startReadyToAutopilot()")
} else {
BizLoopManager.removeLoopFunction(STARTREADYTOAUTOPILOT)
CallerLogger.i(M_TAXI_P + TAG, "stopReadyToAutopilot()")
}
}
fun setStation() {
if (currentOCHOrder != null) {
val startStation = MogoLocation()

View File

@@ -60,21 +60,6 @@ internal interface TaxiPassengerServiceApi {
@Body data: TaxiPassengerCheckPhoneUpdateOrderReqBean?
): Observable<TaxiPassengerBaseRespBean>
/**
* 查询司机是否已确认可开启自动驾驶
* @param appId
* @param ticket
* @param orderNo
* @return
*/
@Headers("Content-type:application/json;charset=UTF-8")
@GET("/autopilot-car-hailing/cab/flow/v1/driver/taxi/pilot/status")
fun queryPilotStatus(
@Header("appId") appId: String = MoGoAiCloudClientConfig.getInstance().serviceAppId,
@Header("ticket") ticket: String=MoGoAiCloudClientConfig.getInstance().token,
@Query("orderNo") orderNo: String
): Observable<TaxiPassengerBaseRespBean>
/**
* 乘客屏启动自动驾驶成功
* @param appId

View File

@@ -80,15 +80,6 @@ object TaxiPassengerServiceManager {
.subscribe(OchCommonSubscribeImpl(context, callback, "checkPhoneAndUpdateOrderStatus"))
}
@JvmStatic
fun queryPilotStatus(
orderNo: String,
callback: OchCommonServiceCallback<TaxiPassengerBaseRespBean>?
) {
mOCHTaxiServiceApi.queryPilotStatus(orderNo = orderNo)
.transformTry()
.subscribe(OchCommonSubscribeImpl(context, callback, "queryPilotStatus"))
}
@JvmStatic
fun startServicePilotDone(
orderNo: String?, loc: TaxiPassengerStartReqBean.Result?,

View File

@@ -16,7 +16,6 @@ import com.mogo.map.uicontroller.VisualAngleMode
import com.mogo.och.common.module.utils.RxUtils
import com.mogo.och.common.module.voice.VoiceNotice
import com.mogo.och.taxi.passenger.R
import com.mogo.och.taxi.passenger.callback.ITaxiPassengerCommonValueCallback
import com.mogo.och.taxi.passenger.presenter.BaseTaxiPassengerPresenter
import com.mogo.och.taxi.passenger.ui.arrived.ArrivedView
import com.mogo.och.taxi.passenger.ui.bottom.BottomBar
@@ -246,7 +245,6 @@ class TaxiPassengerBaseFragment() :
}
mStartAutopilotView?.get()?.let {
OverlayViewUtils.showOverlayView(activity, it)
it.handleStartAutopilotBtnStatus(false)
}
} else {
mStartAutopilotView?.get()?.closeAllAnimsAndView()

View File

@@ -29,7 +29,7 @@ import kotlinx.android.synthetic.main.taxi_p_arrived_end_panel.view.v_video_righ
* 评价View
* Created on 2022/5/16
*/
class mViewModelArrivedView : WindowRelativeLayout, ArrivedViewModel.ArrivedViewCallback {
class ArrivedView : WindowRelativeLayout, ArrivedViewModel.ArrivedViewCallback {
constructor(context: Context?) : super(context)

View File

@@ -1,16 +1,9 @@
package com.mogo.och.taxi.passenger.ui.check
import androidx.lifecycle.ViewModel
import chassis.Chassis.DoorNumber
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisDoorStateListener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisDoorStateListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.taxi.passenger.bean.TaxiPassengerOrderQueryRespBean
import com.mogo.och.taxi.passenger.callback.IOCHTaxiPassengerOrderStatusCallback
import com.mogo.och.taxi.passenger.constant.TaxiPassengerOrderStatusEnum
import com.mogo.och.taxi.passenger.model.AutopilotManager
import com.mogo.och.taxi.passenger.model.TaxiPassengerModel
class ChekViewModel : ViewModel(), IOCHTaxiPassengerOrderStatusCallback {
@@ -25,7 +18,6 @@ class ChekViewModel : ViewModel(), IOCHTaxiPassengerOrderStatusCallback {
fun setStartAutopilotCallback(viewCallback: CheckCallback) {
this.viewCallback = viewCallback
TaxiPassengerModel.startOrStopReadyToAutopilotLoop(true)
setOrderInfo()
}
fun checkAndUpdateStatus(phone: String) {

View File

@@ -77,25 +77,13 @@ class StartAutopilotView : WindowRelativeLayout, StartAutopilotViewModel.StartAu
CallerLogger.d(SceneConstant.M_TAXI_P + TAG, "动画暂停")
}
})
}
fun startAutopilotBgAnimatorDrawable(isStart: Boolean) {
if (isStart) {
taxiPStartAutopilot?.start()
} else {
taxiPStartAutopilot?.stop()
}
handleStartAutopilotBtnStatus(true)
}
@SuppressLint("UseCompatLoadingForDrawables")
override fun handleStartAutopilotBtnStatus(isBoarded: Boolean) {
taxi_p_autopilot_starting?.setImageResource(R.drawable.light_00003)
fun handleStartAutopilotBtnStatus(isBoarded: Boolean) {
updateStartAutopilotBtnStatus(isBoarded)
if (isBoarded) { //高亮可点击状态下动画一直进行
startAutopilotBgAnimatorDrawable(true)
} else { // 置灰色可点击状态下动画停止
startAutopilotBgAnimatorDrawable(false)
}
taxiPStartAutopilot?.start()
}
override fun setOrderInfo(show: String) {

View File

@@ -25,7 +25,6 @@ class StartAutopilotViewModel : ViewModel(), IOCHTaxiPassengerOrderStatusCallbac
fun setStartAutopilotCallback(viewCallback: StartAutopilotCallback) {
this.viewCallback = viewCallback
TaxiPassengerModel.startOrStopReadyToAutopilotLoop(true)
setOrderInfo()
setDoorInfo()
}
@@ -63,10 +62,6 @@ class StartAutopilotViewModel : ViewModel(), IOCHTaxiPassengerOrderStatusCallbac
CallerChassisDoorStateListenerManager.removeListener(TAG)
}
override fun onDriverHasCheckedPilotCondition(isBoarded: Boolean) {
viewCallback?.handleStartAutopilotBtnStatus(isBoarded)
}
/**
* 开启自动驾驶
*/
@@ -114,7 +109,6 @@ class StartAutopilotViewModel : ViewModel(), IOCHTaxiPassengerOrderStatusCallbac
interface StartAutopilotCallback {
fun handleStartAutopilotBtnStatus(isBoarded: Boolean)
fun setOrderInfo(show: String)
fun setDoorStatus(doorPosition: DoorPosition,isOpen:Boolean)
}

View File

@@ -1,4 +1,4 @@
package com.mogo.och.taxi.passenger.ui
package com.mogo.och.taxi.passenger.ui.systemsetting
import android.annotation.SuppressLint
import android.content.Context

View File

@@ -59,7 +59,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.mogo.och.taxi.passenger.ui.TaxiPSettingView
<com.mogo.och.taxi.passenger.ui.systemsetting.TaxiPSettingView
android:id="@+id/clSettingView"
android:layout_width="@dimen/dp_824"
android:layout_height="@dimen/dp_517"

View File

@@ -13,6 +13,7 @@
android:layout_height="1200dp"
android:layout_marginTop="@dimen/dp_150"
android:layout_gravity="center_horizontal"
android:src="@drawable/light_00003"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"