[routing]
[fea] [bus、接驳、班车 验路模式]
This commit is contained in:
@@ -22,6 +22,7 @@ import com.mogo.och.weaknet.model.LineModel
|
||||
import com.mogo.och.weaknet.repository.RepositoryManager
|
||||
import com.mogo.och.weaknet.repository.db.repository.WriteOffDb
|
||||
import com.mogo.och.weaknet.ui.bizswitch.SwitchBizView
|
||||
import com.mogo.och.weaknet.ui.modeswitch.TopSwitchBizView
|
||||
import com.mogo.och.weaknet.ui.qr.QrOpenView
|
||||
import com.mogo.och.weaknet.util.BusAnalyticsManager
|
||||
import com.mogo.och.weaknet.util.BusTrajectoryManager
|
||||
@@ -73,7 +74,7 @@ class ShuttleDriverProvider : CommonServiceImpl() {
|
||||
override fun createOchBusinessView(context: Context?): View? {
|
||||
d(TAG, "createOchBusinessView")
|
||||
return context?.let {
|
||||
SwitchBizView(it)
|
||||
TopSwitchBizView(it)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.och.weaknet.model
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
@@ -189,9 +190,11 @@ object OrderModel {
|
||||
|
||||
override fun onNext(data: Boolean) {
|
||||
if(data){
|
||||
MogoStatusManager.getInstance().setShuttleDriverPerformTask(TAG, true)
|
||||
LineModel.haveRunningTask()
|
||||
updateBusStatus()
|
||||
}else{
|
||||
MogoStatusManager.getInstance().setShuttleDriverPerformTask(TAG, false)
|
||||
LineModel.haveNoRunningTask()
|
||||
d(TAG, "queryBusRoutes 获取到小巴路线数据:空 ")
|
||||
LineManager.setLineInfo(null)
|
||||
@@ -517,6 +520,7 @@ object OrderModel {
|
||||
}catch (e:Exception){
|
||||
OchChainLogManager.writeChainLog("错误","${e.message}")
|
||||
}
|
||||
MogoStatusManager.getInstance().setShuttleDriverPerformTask(TAG, false)
|
||||
MapMakerManager.removeAllMapMarkerByOwner(TAG)
|
||||
BusTrajectoryManager.stopTrajReqLoop()
|
||||
LoginStatusManager.loginOut()
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.och.weaknet.ui.bizswitch
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.findViewTreeViewModelStoreOwner
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
@@ -20,16 +21,16 @@ import kotlinx.android.synthetic.main.shuttle_weak_switch_biz.view.swtichLine
|
||||
import kotlinx.android.synthetic.main.shuttle_weak_switch_biz.view.swtichTask
|
||||
import kotlinx.android.synthetic.main.shuttle_weak_switch_biz.view.taskRunning
|
||||
|
||||
class SwitchBizView: WindowRelativeLayout, SwtichBizModel.SwtichLineViewCallback {
|
||||
class SwitchBizView: ConstraintLayout, SwtichBizModel.SwtichLineViewCallback {
|
||||
|
||||
|
||||
constructor(context: Context?) : super(context)
|
||||
constructor(context: Context) : super(context)
|
||||
|
||||
constructor(context: Context?, attributeSet: AttributeSet) : super(context, attributeSet)
|
||||
constructor(context: Context, attributeSet: AttributeSet) : super(context, attributeSet)
|
||||
|
||||
constructor(context: Context?, attributeSet: AttributeSet, defStyleAttr: Int) : super(context, attributeSet, defStyleAttr)
|
||||
constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int) : super(context, attributeSet, defStyleAttr)
|
||||
|
||||
constructor(context: Context?, attributeSet: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attributeSet, defStyleAttr, defStyleRes)
|
||||
constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attributeSet, defStyleAttr, defStyleRes)
|
||||
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.mogo.och.weaknet.ui.modeswitch
|
||||
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.commons.module.status.StatusDescriptor
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description BadCase录包管理页面
|
||||
* @since: 2022/12/15
|
||||
*/
|
||||
class SwtichBizeModel : ViewModel() {
|
||||
|
||||
private val TAG = SwtichBizeModel::class.java.simpleName
|
||||
|
||||
private var viewCallback: SwtichLineViewCallback? = null
|
||||
|
||||
|
||||
override fun onCleared() {
|
||||
|
||||
}
|
||||
|
||||
fun setDistanceCallback(viewCallback: SwtichLineViewCallback) {
|
||||
this.viewCallback = viewCallback
|
||||
this.viewCallback?.showTaskView()
|
||||
MogoStatusManager.getInstance()
|
||||
.registerStatusChangedListener(
|
||||
TAG, StatusDescriptor.TAXI_UNMANED_DRIVER_LINE_ROUTING_VERIFY_MODE, moFanglistener
|
||||
)
|
||||
}
|
||||
|
||||
private var moFanglistener: IMogoStatusChangedListener? = object : IMogoStatusChangedListener {
|
||||
override fun onStatusChanged(descriptor: StatusDescriptor?, isTrue: Boolean) {
|
||||
if (StatusDescriptor.TAXI_UNMANED_DRIVER_LINE_ROUTING_VERIFY_MODE == descriptor) {
|
||||
UiThreadHandler.post {
|
||||
if (isTrue) {// 展示算路
|
||||
viewCallback?.showRoutingView()
|
||||
} else {// 展示任务
|
||||
viewCallback?.showTaskView()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
interface SwtichLineViewCallback {
|
||||
fun showTaskView()
|
||||
fun showRoutingView()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.mogo.och.weaknet.ui.modeswitch
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.findViewTreeViewModelStoreOwner
|
||||
import com.mogo.och.common.module.biz.routing.RoutingManager
|
||||
import com.mogo.och.common.module.wigets.WindowRelativeLayout
|
||||
import com.mogo.och.shuttle.weaknet.R
|
||||
import kotlinx.android.synthetic.main.shuttle_weak_biz.view.routingSwitchView
|
||||
import kotlinx.android.synthetic.main.shuttle_weak_biz.view.switchOchBiz
|
||||
|
||||
class TopSwitchBizView: WindowRelativeLayout, SwtichBizeModel.SwtichLineViewCallback {
|
||||
|
||||
|
||||
constructor(context: Context?) : super(context)
|
||||
|
||||
constructor(context: Context?, attributeSet: AttributeSet) : super(context, attributeSet)
|
||||
|
||||
constructor(context: Context?, attributeSet: AttributeSet, defStyleAttr: Int) : super(context, attributeSet, defStyleAttr)
|
||||
|
||||
constructor(context: Context?, attributeSet: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attributeSet, defStyleAttr, defStyleRes)
|
||||
|
||||
|
||||
companion object {
|
||||
const val TAG = "SwitchBizView"
|
||||
}
|
||||
|
||||
private var viewModel: SwtichBizeModel?=null
|
||||
|
||||
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.shuttle_weak_biz, this, true)
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
viewModel = findViewTreeViewModelStoreOwner()?.let {
|
||||
ViewModelProvider(it).get(SwtichBizeModel::class.java)
|
||||
}
|
||||
viewModel?.setDistanceCallback(this)
|
||||
}
|
||||
|
||||
override fun showTaskView() {
|
||||
switchOchBiz.visibility = VISIBLE
|
||||
routingSwitchView.visibility = GONE
|
||||
RoutingManager.getRoutingView()?.let {
|
||||
routingSwitchView.removeView(it)
|
||||
}
|
||||
}
|
||||
|
||||
override fun showRoutingView() {
|
||||
switchOchBiz.visibility = GONE
|
||||
routingSwitchView.visibility = VISIBLE
|
||||
RoutingManager.getRoutingView()?.let {
|
||||
routingSwitchView.addView(it)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="@dimen/dp_962"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/aciv_bg"
|
||||
android:src="@drawable/bus_biz_bg"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginBottom="@dimen/dp_167"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_width="@dimen/dp_962"
|
||||
android:layout_height="@dimen/dp_0"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:src="@drawable/bus_biz_bg_header"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_marginEnd="@dimen/dp_42"
|
||||
android:layout_width="@dimen/dp_856"
|
||||
android:layout_height="@dimen/dp_100"/>
|
||||
|
||||
|
||||
<com.mogo.och.weaknet.ui.bizswitch.SwitchBizView
|
||||
android:id="@+id/switchOchBiz"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/aciv_bg"
|
||||
android:layout_marginBottom="@dimen/dp_60"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_width="@dimen/dp_926"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/routingSwitchView"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/aciv_bg"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginBottom="@dimen/dp_60"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_width="@dimen/dp_880"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,37 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="@dimen/dp_962"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="@dimen/dp_844"
|
||||
android:layout_height="@dimen/dp_967"
|
||||
android:background="@color/light_prompt_red"
|
||||
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/aciv_bg"
|
||||
android:src="@drawable/bus_biz_bg"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginBottom="@dimen/dp_167"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_width="@dimen/dp_962"
|
||||
android:layout_height="@dimen/dp_0"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:src="@drawable/bus_biz_bg_header"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_marginEnd="@dimen/dp_42"
|
||||
android:layout_width="@dimen/dp_856"
|
||||
android:layout_height="@dimen/dp_100"/>
|
||||
|
||||
<com.mogo.och.common.module.wigets.loading.LoadingViewBig
|
||||
android:id="@+id/loading_biz"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/aciv_bg"
|
||||
android:layout_marginBottom="@dimen/dp_60"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -40,37 +21,33 @@
|
||||
<com.mogo.och.weaknet.ui.switchline.SwitchLineView
|
||||
android:id="@+id/swtichLine"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:visibility="gone"
|
||||
tools:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/aciv_bg"
|
||||
android:layout_marginBottom="@dimen/dp_60"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
<com.mogo.och.weaknet.ui.switchtask.SwitchTaskView
|
||||
android:id="@+id/swtichTask"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/aciv_bg"
|
||||
android:layout_marginBottom="@dimen/dp_60"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
<com.mogo.och.weaknet.ui.taskrunning.TaskRunningView
|
||||
android:id="@+id/taskRunning"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/aciv_bg"
|
||||
android:layout_marginBottom="@dimen/dp_60"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</merge>
|
||||
@@ -37,7 +37,6 @@ import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.api.hmi.xiaozhi.event.Event
|
||||
import com.mogo.eagle.core.function.api.hmi.xiaozhi.listener.OnXiaoZhiStateChangeListener
|
||||
import com.mogo.eagle.core.function.api.hmi.xiaozhi.state.State
|
||||
import com.mogo.eagle.core.function.api.map.angle.Scene
|
||||
import com.mogo.eagle.core.function.api.och.toolkit.IToolKitItemClickListener
|
||||
import com.mogo.eagle.core.function.api.och.toolkit.ToolKitCustomItemAddParam
|
||||
import com.mogo.eagle.core.function.api.och.toolkit.ToolKitDefaultItemAddParam
|
||||
@@ -429,6 +428,10 @@ class MoGoHmiProvider : IMoGoHmiProvider {
|
||||
CallerTurnLightListenerManager.invokeHideTurnLightView()
|
||||
}
|
||||
|
||||
override fun isShuttleDriverPerformTask(): Boolean {
|
||||
return MogoStatusManager.getInstance().isShuttleDriverPerformTask
|
||||
}
|
||||
|
||||
override fun isTaxiUnmanedDriverPerformTask(): Boolean {
|
||||
return MogoStatusManager.getInstance().isTaxiUnmanedDriverPerformTask
|
||||
}
|
||||
|
||||
@@ -752,6 +752,9 @@ class OperatePanelLayout : LinearLayout {
|
||||
return when (pref.key) {
|
||||
KEY_SELF_ROUTING_VERIFY_MODE -> {
|
||||
AppIdentityModeUtils.isTaxiDriver(FunctionBuildConfig.appIdentityMode)
|
||||
||AppIdentityModeUtils.isBusDriver(FunctionBuildConfig.appIdentityMode)
|
||||
||AppIdentityModeUtils.isShuttleDriver(FunctionBuildConfig.appIdentityMode)
|
||||
||AppIdentityModeUtils.isScheduled(FunctionBuildConfig.appIdentityMode)
|
||||
}
|
||||
KEY_LOOK_AROUND_360 -> {
|
||||
AppIdentityModeUtils.isM1(FunctionBuildConfig.appIdentityMode)
|
||||
@@ -864,7 +867,9 @@ class OperatePanelLayout : LinearLayout {
|
||||
KEY_SELF_ROUTING_VERIFY_MODE -> {
|
||||
val isChecked = newValue as? Boolean ?: false
|
||||
if (isChecked) {
|
||||
if (CallerHmiManager.isTaxiUnmanedDriverPerformTask()) {
|
||||
if (CallerHmiManager.isTaxiUnmanedDriverPerformTask()||
|
||||
CallerHmiManager.isShuttleDriverPerformTask()
|
||||
) {
|
||||
ToastUtils.showLong("请先结束当前任务")
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -196,6 +196,12 @@ interface IMoGoHmiProvider :IProvider{
|
||||
*/
|
||||
fun hideTurnLightView()
|
||||
|
||||
/**
|
||||
* 小巴、接驳、包车 是否在执行任务中
|
||||
*/
|
||||
fun isShuttleDriverPerformTask(): Boolean
|
||||
|
||||
|
||||
/**
|
||||
* taxi无人化 是否在执行任务中(无人化模式和算路验证模式 都复用此变量)
|
||||
*/
|
||||
|
||||
@@ -299,6 +299,13 @@ object CallerHmiManager {
|
||||
hmiProviderApi?.hideTurnLightView()
|
||||
}
|
||||
|
||||
/**
|
||||
* taxi无人化司机端 是否在执行任务中(无人化模式和算路验证模式 都复用此变量)
|
||||
*/
|
||||
fun isShuttleDriverPerformTask(): Boolean {
|
||||
return hmiProviderApi?.isShuttleDriverPerformTask() ?: false
|
||||
}
|
||||
|
||||
/**
|
||||
* taxi无人化司机端 是否在执行任务中(无人化模式和算路验证模式 都复用此变量)
|
||||
*/
|
||||
|
||||
@@ -110,6 +110,16 @@ public interface IMogoStatusManager extends IProvider {
|
||||
*/
|
||||
void setSeekHelping( String tag, boolean seekHelping );
|
||||
|
||||
/**
|
||||
* 小巴、接驳、包车 是否在执行任务中
|
||||
*
|
||||
* @param tag
|
||||
* @param isPerformingTask
|
||||
*/
|
||||
void setShuttleDriverPerformTask( String tag, boolean isPerformingTask );
|
||||
|
||||
boolean isShuttleDriverPerformTask();
|
||||
|
||||
/**
|
||||
* taxi无人化司机端 是否在执行任务中
|
||||
*
|
||||
|
||||
@@ -117,6 +117,16 @@ public class MogoStatusManager implements IMogoStatusManager {
|
||||
doSetStatus(tag, StatusDescriptor.SEEK_HELPING, seekHelping);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setShuttleDriverPerformTask(String tag, boolean isPerformingTask) {
|
||||
doSetStatus(tag, StatusDescriptor.Shuttle_DRIVER_PERFORM_TASK, isPerformingTask);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isShuttleDriverPerformTask() {
|
||||
return get_bool_val(StatusDescriptor.Shuttle_DRIVER_PERFORM_TASK);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTaxiUnmanedDriverPerformTask(String tag, boolean isPerformingTask) {
|
||||
doSetStatus(tag, StatusDescriptor.TAXI_UNMANED_DRIVER_PERFORM_TASK, isPerformingTask);
|
||||
|
||||
@@ -48,6 +48,12 @@ public enum StatusDescriptor {
|
||||
*/
|
||||
SCREEN_COVER,
|
||||
|
||||
/**
|
||||
* 小巴、接驳、班车 是否执行任务中
|
||||
*/
|
||||
Shuttle_DRIVER_PERFORM_TASK,
|
||||
|
||||
|
||||
/**
|
||||
* taxi无人化 是否执行任务中
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user