Merge branch 'dev_robotaxi-d_240801_6.5.2' into dev_robotaxi-d_240807_6.6.0

This commit is contained in:
xuxinchao
2024-08-07 15:48:39 +08:00
52 changed files with 1990 additions and 16 deletions

View File

@@ -13,9 +13,13 @@ import com.mogo.commons.mvp.IView
import com.mogo.commons.mvp.MvpFragment
import com.mogo.commons.mvp.Presenter
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.setting.ISeatPressureEventListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.isCanStartAutopilot
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.sendPlanningCmd
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.sendPlanningLineChangeCmd
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getState
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager.attachAutopilotBeforeLaunchView
import com.mogo.eagle.core.function.call.setting.CallerSeatPressureManager
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
@@ -32,8 +36,13 @@ import kotlinx.android.synthetic.main.bus_base_fragment.fl_speed
import kotlinx.android.synthetic.main.bus_base_fragment.mapBizView
import kotlinx.android.synthetic.main.bus_base_fragment.module_mogo_och_arrived_tv
import kotlinx.android.synthetic.main.bus_base_fragment.module_mogo_och_autopilot_status
import kotlinx.android.synthetic.main.bus_base_fragment.module_mogo_och_over_take
import kotlinx.android.synthetic.main.bus_base_fragment.module_mogo_och_slide_panel
import kotlinx.android.synthetic.main.bus_base_fragment.module_mogo_och_start
import kotlinx.android.synthetic.main.bus_base_fragment.module_mogo_och_station_panel_container
import kotlinx.android.synthetic.main.bus_base_fragment.module_mogo_och_stop
import kotlinx.android.synthetic.main.bus_base_fragment.module_och_bus_seat_pressure
import kotlinx.android.synthetic.main.bus_base_fragment.seatPressureSettingView
import kotlinx.android.synthetic.main.bus_base_fragment.smallMapView
import kotlinx.android.synthetic.main.bus_base_fragment.viewDriverMsgBoxBubble
import kotlinx.android.synthetic.main.bus_base_fragment.viewDriverMsgBoxButton
@@ -48,7 +57,8 @@ import org.greenrobot.eventbus.EventBus
*
* @author tongchenfei
*/
abstract class BaseBusTabFragment<V : IView?, P : Presenter<V>?> : MvpFragment<V, P>() {
abstract class BaseBusTabFragment<V : IView?, P : Presenter<V>?> : MvpFragment<V, P>(),
ISeatPressureEventListener {
//启动自驾动画
private var autopilotLoadingAnimator: ObjectAnimator? = null
@@ -100,6 +110,25 @@ abstract class BaseBusTabFragment<V : IView?, P : Presenter<V>?> : MvpFragment<V
}
})
module_mogo_och_stop.setOnClickListener {
sendPlanningCmd(1)
}
module_mogo_och_start.setOnClickListener {
sendPlanningCmd(2)
}
module_mogo_och_over_take.setOnClickListener {
sendPlanningLineChangeCmd(3)
}
//座椅压力
module_och_bus_seat_pressure.setOnClickListener {
if (seatPressureSettingView.visibility == View.VISIBLE) {
seatPressureSettingView.visibility = View.GONE
} else {
seatPressureSettingView.visibility = View.VISIBLE
}
}
CallerSeatPressureManager.addListener(TAG, this)
}
override fun initViews(savedInstanceState: Bundle?) {
@@ -145,6 +174,7 @@ abstract class BaseBusTabFragment<V : IView?, P : Presenter<V>?> : MvpFragment<V
smallMapView!!.onDestroy()
}
EventBus.getDefault().unregister(this)
CallerSeatPressureManager.removeListener(TAG)
super.onDestroyView()
}
@@ -437,4 +467,17 @@ abstract class BaseBusTabFragment<V : IView?, P : Presenter<V>?> : MvpFragment<V
"SMd5DPQP:" + if (routesResult == null) "" else routesResult.txtFileMd5DPQP
}
}
/**
* 设置座椅是否有人状态
* @param isPress 是否有人
*/
override fun onUpdateBgEvent(isPress: Boolean) {
if (isPress) {
module_och_bus_seat_pressure.setBackgroundResource(R.drawable.bus_operation_status_select_bg)
} else {
module_och_bus_seat_pressure.setBackgroundResource(R.drawable.bus_operation_status_bg)
}
}
}

View File

@@ -287,6 +287,7 @@
app:roma_open_bg="@drawable/common_driver_roma_press" />
<com.mogo.och.common.module.wigets.map.drawline.LineView
android:id="@+id/lineView"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/rtv_switch"
android:layout_marginStart="-11dp"
@@ -294,6 +295,99 @@
android:layout_width="@dimen/dp_142"
android:layout_height="@dimen/dp_142"/>
<RelativeLayout
android:id="@+id/module_mogo_och_stop"
android:layout_width="@dimen/dp_172"
android:layout_height="@dimen/dp_172"
android:background="@drawable/bus_operation_status_bg_selector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/lineView">
<TextView
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:text="停车"
android:gravity="center"
android:textStyle="bold"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_32"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/module_mogo_och_start"
android:layout_width="@dimen/dp_172"
android:layout_height="@dimen/dp_172"
android:background="@drawable/bus_operation_status_bg_selector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_stop">
<TextView
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:text="出发"
android:gravity="center"
android:textStyle="bold"
android:maxLines="1"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_32"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/module_mogo_och_over_take"
android:layout_width="@dimen/dp_172"
android:layout_height="@dimen/dp_172"
android:background="@drawable/bus_operation_status_bg_selector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_start">
<TextView
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:text="超车"
android:gravity="center"
android:textStyle="bold"
android:maxLines="1"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_32"/>
</RelativeLayout>
<LinearLayout
android:id="@+id/module_och_bus_seat_pressure"
android:layout_width="@dimen/dp_172"
android:layout_height="@dimen/dp_172"
android:elevation="@dimen/dp_10"
android:gravity="center"
android:background="@drawable/bus_operation_status_bg"
app:layout_constraintBottom_toBottomOf="@id/module_mogo_och_over_take"
app:layout_constraintTop_toTopOf="@id/module_mogo_och_over_take"
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_over_take">
<ImageView
android:layout_width="@dimen/dp_64"
android:layout_height="@dimen/dp_64"
android:layout_gravity="center"
android:src="@drawable/icon_seat_pressure"
/>
</LinearLayout>
<!--座椅压力设置-->
<com.mogo.eagle.core.function.hmi.ui.setting.SeatPressureSettingView
android:id="@+id/seatPressureSettingView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/module_och_bus_seat_pressure"
app:layout_constraintBottom_toBottomOf="@id/module_och_bus_seat_pressure"
app:layout_constraintStart_toEndOf="@id/module_och_bus_seat_pressure"
android:layout_marginStart="@dimen/dp_40"
android:visibility="gone"
/>
<com.mogo.eagle.core.function.hmi.ui.widget.RomaDistanceView
android:layout_width="wrap_content"
android:layout_height="wrap_content"

View File

@@ -15,8 +15,12 @@ import com.mogo.commons.mvp.IView
import com.mogo.commons.mvp.MvpFragment
import com.mogo.commons.mvp.Presenter
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.setting.ISeatPressureEventListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.sendPlanningCmd
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.sendPlanningLineChangeCmd
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager.attachAutopilotBeforeLaunchView
import com.mogo.eagle.core.function.call.setting.CallerSeatPressureManager
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView.ClickListener
@@ -27,6 +31,11 @@ import com.mogo.eagle.core.utilcode.kotlin.onClick
import com.mogo.och.common.module.utils.ResourcesUtils
import com.mogo.och.common.module.utils.SoundPoolHelper
import kotlinx.android.synthetic.main.charter_base_fragment.module_mogo_och_arrived_tv
import kotlinx.android.synthetic.main.charter_base_fragment.module_mogo_och_over_take
import kotlinx.android.synthetic.main.charter_base_fragment.module_mogo_och_start
import kotlinx.android.synthetic.main.charter_base_fragment.module_mogo_och_stop
import kotlinx.android.synthetic.main.charter_base_fragment.module_och_bus_seat_pressure
import kotlinx.android.synthetic.main.charter_base_fragment.seatPressureSettingView
import org.greenrobot.eventbus.EventBus
/**
@@ -38,7 +47,7 @@ import org.greenrobot.eventbus.EventBus
* @author tongchenfei
*/
abstract class CharterBaseFragment<V : IView?, P : Presenter<V>?>() :
MvpFragment<V, P>() {
MvpFragment<V, P>() , ISeatPressureEventListener {
private val TAG = "BaseBusTabFragment"
@@ -114,6 +123,25 @@ abstract class CharterBaseFragment<V : IView?, P : Presenter<V>?>() :
onArriveStation()
}
module_mogo_och_stop.setOnClickListener {
sendPlanningCmd(1)
}
module_mogo_och_start.setOnClickListener {
sendPlanningCmd(2)
}
module_mogo_och_over_take.setOnClickListener {
sendPlanningLineChangeCmd(3)
}
//座椅压力
module_och_bus_seat_pressure.setOnClickListener {
if (seatPressureSettingView.visibility == View.VISIBLE) {
seatPressureSettingView.visibility = View.GONE
} else {
seatPressureSettingView.visibility = View.VISIBLE
}
}
CallerSeatPressureManager.addListener(TAG, this)
//消息盒子
viewDriverMsgBoxButton = findViewById(R.id.viewDriverMsgBoxButton)
viewDriverMsgBoxList = findViewById(R.id.viewDriverMsgBoxList)
@@ -227,6 +255,7 @@ abstract class CharterBaseFragment<V : IView?, P : Presenter<V>?>() :
smallMapView?.onDestroy()
super.onDestroyView()
CallerAutopilotRecordListenerManager.removeListener(TAG)
CallerSeatPressureManager.removeListener(TAG)
EventBus.getDefault().unregister(this)
}
@@ -267,6 +296,18 @@ abstract class CharterBaseFragment<V : IView?, P : Presenter<V>?>() :
super.onDestroy()
}
/**
* 设置座椅是否有人状态
* @param isPress 是否有人
*/
override fun onUpdateBgEvent(isPress: Boolean) {
if (isPress) {
module_och_bus_seat_pressure.setBackgroundResource(R.drawable.bus_operation_status_select_bg)
} else {
module_och_bus_seat_pressure.setBackgroundResource(R.drawable.bus_operation_status_bg)
}
}
/**
* bus调试面板打开关闭
*/

View File

@@ -251,6 +251,7 @@
android:layout_height="@dimen/dp_142"/>
<com.mogo.och.common.module.wigets.map.drawline.LineView
android:id="@+id/lineView"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/reportworkorderview"
android:layout_marginStart="-11dp"
@@ -370,4 +371,96 @@
app:layout_constraintStart_toStartOf="parent"
/>
<RelativeLayout
android:id="@+id/module_mogo_och_stop"
android:layout_width="@dimen/dp_172"
android:layout_height="@dimen/dp_172"
android:background="@drawable/bus_operation_status_bg_selector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/lineView">
<TextView
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:text="停车"
android:gravity="center"
android:textStyle="bold"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_32"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/module_mogo_och_start"
android:layout_width="@dimen/dp_172"
android:layout_height="@dimen/dp_172"
android:background="@drawable/bus_operation_status_bg_selector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_stop">
<TextView
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:text="出发"
android:gravity="center"
android:textStyle="bold"
android:maxLines="1"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_32"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/module_mogo_och_over_take"
android:layout_width="@dimen/dp_172"
android:layout_height="@dimen/dp_172"
android:background="@drawable/bus_operation_status_bg_selector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_start">
<TextView
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:text="超车"
android:gravity="center"
android:textStyle="bold"
android:maxLines="1"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_32"/>
</RelativeLayout>
<LinearLayout
android:id="@+id/module_och_bus_seat_pressure"
android:layout_width="@dimen/dp_172"
android:layout_height="@dimen/dp_172"
android:elevation="@dimen/dp_10"
android:gravity="center"
android:background="@drawable/bus_operation_status_bg"
app:layout_constraintBottom_toBottomOf="@id/module_mogo_och_over_take"
app:layout_constraintTop_toTopOf="@id/module_mogo_och_over_take"
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_over_take">
<ImageView
android:layout_width="@dimen/dp_64"
android:layout_height="@dimen/dp_64"
android:layout_gravity="center"
android:src="@drawable/icon_seat_pressure"
/>
</LinearLayout>
<!--座椅压力设置-->
<com.mogo.eagle.core.function.hmi.ui.setting.SeatPressureSettingView
android:id="@+id/seatPressureSettingView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/module_och_bus_seat_pressure"
app:layout_constraintBottom_toBottomOf="@id/module_och_bus_seat_pressure"
app:layout_constraintStart_toEndOf="@id/module_och_bus_seat_pressure"
android:layout_marginStart="@dimen/dp_40"
android:visibility="gone"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -10,6 +10,7 @@ import android.view.ViewGroup;
import android.view.animation.LinearInterpolator;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
@@ -25,14 +26,17 @@ import com.mogo.commons.mvp.Presenter;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.config.HdMapBuildConfig;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.api.setting.ISeatPressureEventListener;
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.CallerAutopilotRecordListenerManager;
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
import com.mogo.eagle.core.function.call.setting.CallerSeatPressureManager;
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView;
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView;
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView;
import com.mogo.eagle.core.function.hmi.ui.setting.SeatPressureSettingView;
import com.mogo.eagle.core.function.smp.view.SmallMapView;
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
@@ -55,7 +59,7 @@ import org.greenrobot.eventbus.EventBus;
*
* @author tongchenfei
*/
public abstract class BaseShuttleTabFragment<V extends IView, P extends Presenter<V>> extends MvpFragment<V, P> {
public abstract class BaseShuttleTabFragment<V extends IView, P extends Presenter<V>> extends MvpFragment<V, P> implements ISeatPressureEventListener {
private static final String TAG = "BaseBusTabFragment";
@@ -79,6 +83,12 @@ public abstract class BaseShuttleTabFragment<V extends IView, P extends Presente
public boolean isAnimateRunning = false;
private RelativeLayout moduleMogoOchStop;
private RelativeLayout moduleMogoOchStart;
private RelativeLayout moduleMogoOchOverTake;
private LinearLayout moduleOchBusSeatPressure;
private SeatPressureSettingView mSeatPressureSettingView;
/**
* 滑动按钮触发的事件
*/
@@ -103,9 +113,33 @@ public abstract class BaseShuttleTabFragment<V extends IView, P extends Presente
ctvAutopilotStatusIv = findViewById(R.id.bus_autopilot_btn_iv);
ctvAutopilotStatusTv = findViewById(R.id.bus_autopolot_btn_tv);
flStationPanelContainer = findViewById(R.id.module_mogo_och_station_panel_container);
moduleMogoOchStop = findViewById(R.id.module_mogo_och_stop);
moduleMogoOchStart = findViewById(R.id.module_mogo_och_start);
moduleMogoOchOverTake = findViewById(R.id.module_mogo_och_over_take);
moduleOchBusSeatPressure = findViewById(R.id.module_och_bus_seat_pressure);
mSeatPressureSettingView = findViewById(R.id.seatPressureSettingView);
tvArrived = findViewById(R.id.module_mogo_och_arrived_tv);
moduleMogoOchStop.setOnClickListener(v -> {
CallerAutoPilotControlManager.INSTANCE.sendPlanningCmd(1);
});
moduleMogoOchStart.setOnClickListener(v -> {
CallerAutoPilotControlManager.INSTANCE.sendPlanningCmd(2);
});
moduleMogoOchOverTake.setOnClickListener(v -> {
CallerAutoPilotControlManager.INSTANCE.sendPlanningLineChangeCmd(3);
});
//座椅压力
moduleOchBusSeatPressure.setOnClickListener(v -> {
if(mSeatPressureSettingView.getVisibility() == View.VISIBLE){
mSeatPressureSettingView.setVisibility(View.GONE);
}else{
mSeatPressureSettingView.setVisibility(View.VISIBLE);
}
});
CallerSeatPressureManager.INSTANCE.addListener(TAG, this);
FrameLayout flSpeed = findViewById(R.id.fl_speed);
if (flSpeed != null) {
CallerDevaToolsManager.INSTANCE.attachAutopilotBeforeLaunchView(flSpeed.getContext(), flSpeed);
@@ -240,6 +274,7 @@ public abstract class BaseShuttleTabFragment<V extends IView, P extends Presente
}
super.onDestroyView();
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
CallerSeatPressureManager.INSTANCE.removeListener(TAG);
EventBus.getDefault().unregister(this);
}
@@ -503,6 +538,15 @@ public abstract class BaseShuttleTabFragment<V extends IView, P extends Presente
}
}
@Override
public void onUpdateBgEvent(boolean isPress) {
if (isPress) {
moduleOchBusSeatPressure.setBackgroundResource(R.drawable.bus_operation_status_select_bg);
} else {
moduleOchBusSeatPressure.setBackgroundResource(R.drawable.bus_operation_status_bg);
}
}
/**
* Bus调试信息线路、轨迹等信息
* <p>

View File

@@ -269,6 +269,7 @@
android:layout_height="@dimen/dp_142"/>
<com.mogo.och.common.module.wigets.map.drawline.LineView
android:id="@+id/lineView"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/reportworkorderview"
android:layout_marginStart="-11dp"
@@ -276,6 +277,98 @@
android:layout_width="@dimen/dp_142"
android:layout_height="@dimen/dp_142"/>
<RelativeLayout
android:id="@+id/module_mogo_och_stop"
android:layout_width="@dimen/dp_172"
android:layout_height="@dimen/dp_172"
android:background="@drawable/bus_operation_status_bg_selector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/lineView">
<TextView
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:text="停车"
android:gravity="center"
android:textStyle="bold"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_32"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/module_mogo_och_start"
android:layout_width="@dimen/dp_172"
android:layout_height="@dimen/dp_172"
android:background="@drawable/bus_operation_status_bg_selector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_stop">
<TextView
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:text="出发"
android:gravity="center"
android:textStyle="bold"
android:maxLines="1"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_32"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/module_mogo_och_over_take"
android:layout_width="@dimen/dp_172"
android:layout_height="@dimen/dp_172"
android:background="@drawable/bus_operation_status_bg_selector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_start">
<TextView
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:text="超车"
android:gravity="center"
android:textStyle="bold"
android:maxLines="1"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_32"/>
</RelativeLayout>
<LinearLayout
android:id="@+id/module_och_bus_seat_pressure"
android:layout_width="@dimen/dp_172"
android:layout_height="@dimen/dp_172"
android:elevation="@dimen/dp_10"
android:gravity="center"
android:background="@drawable/bus_operation_status_bg"
app:layout_constraintBottom_toBottomOf="@id/module_mogo_och_over_take"
app:layout_constraintTop_toTopOf="@id/module_mogo_och_over_take"
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_over_take">
<ImageView
android:layout_width="@dimen/dp_64"
android:layout_height="@dimen/dp_64"
android:layout_gravity="center"
android:src="@drawable/icon_seat_pressure"
/>
</LinearLayout>
<!--座椅压力设置-->
<com.mogo.eagle.core.function.hmi.ui.setting.SeatPressureSettingView
android:id="@+id/seatPressureSettingView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/module_och_bus_seat_pressure"
app:layout_constraintBottom_toBottomOf="@id/module_och_bus_seat_pressure"
app:layout_constraintStart_toEndOf="@id/module_och_bus_seat_pressure"
android:layout_marginStart="@dimen/dp_40"
android:visibility="gone"
/>
<com.mogo.och.shuttle.view.SlidePanelView
android:id="@+id/module_mogo_och_slide_panel"
android:layout_width="wrap_content"

View File

@@ -12,6 +12,7 @@ import android.view.ViewGroup;
import android.view.animation.LinearInterpolator;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
@@ -25,13 +26,17 @@ import com.mogo.commons.mvp.IView;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.commons.mvp.Presenter;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.api.setting.ISeatPressureEventListener;
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.CallerAutopilotRecordListenerManager;
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
import com.mogo.eagle.core.function.call.setting.CallerSeatPressureManager;
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView;
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView;
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView;
import com.mogo.eagle.core.function.hmi.ui.setting.SeatPressureSettingView;
import com.mogo.eagle.core.function.hmi.ui.vehicle.TakeOverAutopilotView;
import com.mogo.eagle.core.function.view.MapBizView;
import com.mogo.eagle.core.function.smp.view.SmallMapView;
import com.mogo.eagle.core.function.view.MapRoamView;
@@ -56,7 +61,7 @@ import me.jessyan.autosize.utils.AutoSizeUtils;
*
* @author tongchenfei
*/
public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V>> extends MvpFragment<V, P> implements IMogoMapListener {
public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V>> extends MvpFragment<V, P> implements IMogoMapListener , ISeatPressureEventListener {
private static final String TAG = "BaseOchFragment";
private RelativeLayout ctvAutopilotStatusRL;
@@ -85,6 +90,10 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
private OverMapDialog overMapDialog;
protected LinearLayout mSeatPressureBtn;//座椅压力
protected TakeOverAutopilotView takeOverAutopilotView;
protected SeatPressureSettingView seatPressureSettingView;
private final Handler mHandler = new Handler(Looper.getMainLooper());
@Override
@@ -205,6 +214,21 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
overMapDialog.showDialog();
}
});
//座椅压力
mSeatPressureBtn = findViewById(R.id.module_och_taxi_seat_pressure);
seatPressureSettingView = findViewById(R.id.seatPressureSettingView);
assert mSeatPressureBtn != null;
mSeatPressureBtn.setOnClickListener(view -> {
if(seatPressureSettingView.getVisibility() == View.VISIBLE){
seatPressureSettingView.setVisibility(View.GONE);
}else{
seatPressureSettingView.setVisibility(View.VISIBLE);
}
});
CallerSeatPressureManager.INSTANCE.addListener(TAG,this);
TakeOverAutopilotView takeOverAutopilotView = new TakeOverAutopilotView(getActivity());
takeOverAutopilotView.showFloatWindow();
}
@Override
@@ -227,6 +251,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
super.onPause();
mapBizView.onPause();
smallMapView.onPause();
takeOverAutopilotView.hideFloatWindow();
}
protected void onChangeOperationStatus() {
@@ -279,6 +304,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
taxiRottingNaviFragment = null;
smallMapView = null;
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
CallerSeatPressureManager.INSTANCE.removeListener(TAG);
}
@Override
@@ -570,4 +596,17 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
public void setGuidHide(){
acivShowGuid.setVisibility(View.GONE);
}
/**
* 设置座椅是否有人状态
* @param isPress 是否有人
*/
@Override
public void onUpdateBgEvent(boolean isPress) {
if(isPress){
mSeatPressureBtn.setBackgroundResource(R.drawable.taxi_operation_status_select_bg);
}else{
mSeatPressureBtn.setBackgroundResource(R.drawable.taxi_operation_status_bg);
}
}
}

View File

@@ -337,6 +337,7 @@
app:roma_open_bg="@drawable/common_driver_roma_press" />
<com.mogo.och.common.module.wigets.map.drawline.LineView
android:id="@+id/lineView"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/rtv_switch"
android:layout_marginStart="-11dp"
@@ -352,6 +353,37 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<!--考试-座椅压力-->
<LinearLayout
android:id="@+id/module_och_taxi_seat_pressure"
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"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/lineView">
<ImageView
android:layout_width="@dimen/dp_64"
android:layout_height="@dimen/dp_64"
android:layout_gravity="center"
android:src="@drawable/icon_seat_pressure"
/>
</LinearLayout>
<!--座椅压力设置-->
<com.mogo.eagle.core.function.hmi.ui.setting.SeatPressureSettingView
android:id="@+id/seatPressureSettingView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/module_och_taxi_seat_pressure"
app:layout_constraintBottom_toBottomOf="@id/module_och_taxi_seat_pressure"
app:layout_constraintStart_toEndOf="@id/module_och_taxi_seat_pressure"
android:layout_marginStart="@dimen/dp_40"
android:visibility="gone"
/>
<Button
android:id="@+id/btnAutopilotDisable"

View File

@@ -16,11 +16,13 @@ import com.mogo.commons.mvp.MvpFragment
import com.mogo.commons.mvp.Presenter
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.setting.ISeatPressureEventListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getState
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.setting.CallerSeatPressureManager
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView
import com.mogo.eagle.core.function.hmi.ui.widget.ParallelDriveView
import com.mogo.eagle.core.utilcode.kotlin.onClick
@@ -47,7 +49,9 @@ import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.module_mogo_oc
import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.module_mogo_och_station_panel_container
import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.module_och_autopilot_iv
import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.module_och_autopilot_tv
import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.module_och_taxi_seat_pressure
import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.parallelDriveView
import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.seatPressureSettingView
import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.smallMapView
import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.startAutopilotAnimationView
import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.taxi_close_navi_icon
@@ -55,12 +59,13 @@ import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.viewDriverMsgB
import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.viewDriverMsgBoxButton
import kotlinx.android.synthetic.main.unmanned_taxi_base_fragment.viewDriverMsgBoxList
/**
* @author: wangmingjun
* @date: 2023/7/24
*/
abstract class BaseTaxiTabFragment<V : IView, P : Presenter<V>> : MvpFragment<V, P>(),
IMogoMapListener, IMoGoAutopilotRecordListener {
IMogoMapListener, IMoGoAutopilotRecordListener, ISeatPressureEventListener {
companion object {
const val TAG = "BaseTaxiTabFragment"
}
@@ -204,6 +209,16 @@ abstract class BaseTaxiTabFragment<V : IView, P : Presenter<V>> : MvpFragment<V,
overMapDialog?.showDialog()
}
}
//座椅压力
module_och_taxi_seat_pressure.setOnClickListener {
if (seatPressureSettingView!!.visibility == View.VISIBLE) {
seatPressureSettingView!!.visibility = View.GONE
} else {
seatPressureSettingView!!.visibility = View.VISIBLE
}
}
CallerSeatPressureManager.addListener(TAG,this);
}
abstract fun stopAutoStartAutopilot()
@@ -243,6 +258,7 @@ abstract class BaseTaxiTabFragment<V : IView, P : Presenter<V>> : MvpFragment<V,
smallMapView?.onDestroy()
startAutopilotAnimationView.cancelCountdown()
CallerAutopilotRecordListenerManager.removeListener(TAG)
CallerSeatPressureManager.removeListener(TAG)
super.onDestroyView()
}
@@ -541,4 +557,16 @@ abstract class BaseTaxiTabFragment<V : IView, P : Presenter<V>> : MvpFragment<V,
fun setGuidHide() {
aciv_show_guid.visibility = View.GONE
}
/**
* 设置座椅是否有人状态
* @param isPress 是否有人
*/
override fun onUpdateBgEvent(isPress: Boolean) {
if (isPress) {
module_och_taxi_seat_pressure.setBackgroundResource(R.drawable.taxi_operation_status_select_bg)
} else {
module_och_taxi_seat_pressure.setBackgroundResource(R.drawable.taxi_operation_status_bg)
}
}
}

View File

@@ -342,6 +342,7 @@
app:roma_open_bg="@drawable/common_driver_roma_press" />
<com.mogo.och.common.module.wigets.map.drawline.LineView
android:id="@+id/lineView"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/rtv_switch"
android:layout_marginStart="-11dp"
@@ -349,6 +350,38 @@
android:layout_width="@dimen/dp_142"
android:layout_height="@dimen/dp_142"/>
<!--考试-座椅压力-->
<LinearLayout
android:id="@+id/module_och_taxi_seat_pressure"
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"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/lineView">
<ImageView
android:layout_width="@dimen/dp_64"
android:layout_height="@dimen/dp_64"
android:layout_gravity="center"
android:src="@drawable/icon_seat_pressure"
/>
</LinearLayout>
<!--座椅压力设置-->
<com.mogo.eagle.core.function.hmi.ui.setting.SeatPressureSettingView
android:id="@+id/seatPressureSettingView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/module_och_taxi_seat_pressure"
app:layout_constraintBottom_toBottomOf="@id/module_och_taxi_seat_pressure"
app:layout_constraintStart_toEndOf="@id/module_och_taxi_seat_pressure"
android:layout_marginStart="@dimen/dp_40"
android:visibility="gone"
/>
<com.mogo.eagle.core.function.hmi.ui.widget.RomaDistanceView
android:layout_width="wrap_content"
android:layout_height="wrap_content"

View File

@@ -222,7 +222,7 @@ ext {
weak_network : "com.mogo.weak:network:1.0.1",
btrace : "com.bytedance.btrace:rhea-core:2.0.0",
mofang_runtime : "com.mogo.eagle.core.mofang:runtime:2.0.11",
mofang_runtime : "com.mogo.eagle.core.mofang:runtime:2.0.12",
log_runtime : "com.mogo.eagle.core.log.record:runtime:2.0.50",
// 安全证书

View File

@@ -636,6 +636,76 @@ class MoGoAutopilotControlProvider :
return AdasManager.getInstance().sendDetouringSpeed(speed) > -1
}
/**
* AEB开关
* isEnable = true 开启
* isEnable = false 关闭
* @return boolean
*/
override fun sendAebCmd(isEnable: Boolean): Boolean {
return if(isEnable){
AdasManager.getInstance().sendAebCmd(1) > -1
}else{
AdasManager.getInstance().sendAebCmd(0) > -1
}
}
/**
* 限制绕障开关
* isEnable = true 限制绕障
* isEnable = false 正常绕障
* @return boolean
*/
override fun sendLaneChangeRestrainValid(isEnable: Boolean): Boolean {
return if(isEnable){
AdasManager.getInstance().sendLaneChangeRestrainValid(1) > -1
}else{
AdasManager.getInstance().sendLaneChangeRestrainValid(0) > -1
}
}
/**
* 停车让行线前避让等待开关
* isEnable = true 停车让行线前需要避让等待
* isEnable = false 停车让行线前无需避让等待
* @return boolean
*/
override fun sendStopYieldValid(isEnable: Boolean): Boolean {
return if(isEnable){
AdasManager.getInstance().sendStopYieldValid(1) > -1
}else{
AdasManager.getInstance().sendStopYieldValid(0) > -1
}
}
/**
* 地图限速功能开关
* isEnable = true 使用地图限速功能
* isEnable = false 不使用地图限速功能
* @return boolean
*/
override fun sendHadmapSpeedLimitValid(isEnable: Boolean): Boolean {
return if(isEnable){
AdasManager.getInstance().sendHadmapSpeedLimitValid(1) > -1
}else{
AdasManager.getInstance().sendHadmapSpeedLimitValid(0) > -1
}
}
/**
* 环岛模式开关
* isEnable = true 环岛模式
* isEnable = false 普通模式
* @return boolean
*/
override fun sendRampThetaValid(isEnable: Boolean): Boolean {
return if(isEnable){
AdasManager.getInstance().sendRampThetaValid(1) > -1
}else{
AdasManager.getInstance().sendRampThetaValid(0) > -1
}
}
/**
* 弱网减速停车策略开关
* isEnable = true 使用弱网减速停车策略
@@ -1243,7 +1313,38 @@ class MoGoAutopilotControlProvider :
return AdasManager.getInstance().sendRoboBusJinlvM1TaskCmd(roboBusJinlvM1Cmd) > -1
}
@ChainLog(
linkChainLog = AdasChain.CHAIN_TYPE_SOCKET_AUTOPILOT,
linkCode = AdasChain.CHAIN_SOURCE_ADAS,
nodeAliasCode = AdasChain.CHAIN_CODE_ADAS_SEND_PLANNING_CMD,
paramIndexes = [0]
)
override fun sendPlanningCmd(cmd: Int): Boolean {
return AdasManager.getInstance().sendPlanningCmd(cmd) > -1
}
@ChainLog(
linkChainLog = AdasChain.CHAIN_TYPE_SOCKET_AUTOPILOT,
linkCode = AdasChain.CHAIN_SOURCE_ADAS,
nodeAliasCode = AdasChain.CHAIN_CODE_ADAS_SEND_PLANNING_CMD,
paramIndexes = [0]
)
override fun sendPlanningLineChangeCmd(cmd: Int): Boolean {
return AdasManager.getInstance().sendPlanningLaneChangeCmd(cmd) > -1
}
override fun sendPlanningPullOverCmd(pullOverCmd: Int): Boolean {
return AdasManager.getInstance().sendPlanningPullOverCmd(pullOverCmd) > -1
}
/**
* 设置座椅压力接口
* @param driver 主驾是否有人
* @param copilot 副驾是否有人
* @param backRow 后排是否有人
*/
override fun sendSeatPressure(driver: Boolean, copilot: Boolean, backRow: Boolean): Boolean {
return AdasManager.getInstance().sendSeatPressure(driver, copilot, backRow) > -1
}
}

View File

@@ -22,6 +22,7 @@ import com.mogo.eagle.core.data.deva.report.WorkOrderReportInfo
import com.mogo.eagle.core.data.deva.scene.SceneModule
import com.mogo.eagle.core.data.deva.scene.SceneTAG
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.takeover.TakeOverAnnotation
import com.mogo.eagle.core.function.api.devatools.IDevaToolsProvider
import com.mogo.eagle.core.function.api.devatools.block.IMoGoBlockProvider
import com.mogo.eagle.core.function.api.devatools.download.DownloadType
@@ -73,6 +74,7 @@ import com.zhjt.mogo_core_function_devatools.status.entity.RouteDownloadStatus
import com.zhjt.mogo_core_function_devatools.status.entity.Status
import com.zhjt.mogo_core_function_devatools.status.ui.AutoPilotLaunchBeforeView
import com.zhjt.mogo_core_function_devatools.strict.StrictModeProviderImpl
import com.zhjt.mogo_core_function_devatools.takeover.TakeOverManager
import com.zhjt.mogo_core_function_devatools.trace.TraceManager.Companion.traceManager
import com.zhjt.mogo_core_function_devatools.tts.TtsManager.Companion.ttsManager
import com.zhjt.mogo_core_function_devatools.upgrade.UpgradeManager.Companion.upgradeManager
@@ -647,4 +649,8 @@ class DevaToolsProvider : IDevaToolsProvider, IAppStateListener {
override fun setRouteDynamicColorEnable(enable: Boolean) {
mapRouteProvider?.setRouteDynamicColorEnable(enable)
}
override fun takeOver(@TakeOverAnnotation takeOverAnnotation: Int) {
TakeOverManager.takeOverManager.takeOver(takeOverAnnotation)
}
}

View File

@@ -0,0 +1,19 @@
package com.zhjt.mogo_core_function_devatools.takeover
import com.mogo.eagle.core.data.takeover.TakeOverAnnotation
import com.zhjt.mogo_core_function_devatools.takeover.network.TakeOverNetWorkModel
class TakeOverManager {
companion object {
val takeOverManager: TakeOverManager by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
TakeOverManager()
}
}
private val takeOverNetWorkModel = TakeOverNetWorkModel()
fun takeOver(@TakeOverAnnotation takeOverAnnotation: Int) {
}
}

View File

@@ -0,0 +1,13 @@
package com.zhjt.mogo_core_function_devatools.takeover.network
import com.mogo.eagle.core.data.BaseResponse
import retrofit2.http.*
interface TakeOverApiService {
//云端接管
@Headers("Content-Type:application/json;charset=UTF-8")
@POST("/paralleldriving-service/autocars")
suspend fun takeOver(@Body map: MutableMap<String, Any>): BaseResponse<Any>
}

View File

@@ -0,0 +1,22 @@
package com.zhjt.mogo_core_function_devatools.takeover.network
import com.mogo.commons.debug.DebugConfig
class TakeOverHost {
companion object{
private const val HOST_DEV = "http://dzt-test.zhidaozhixing.com/"
private const val HOST_RELEASE = "http://dzt.zhidaozhixing.com/"
fun get(): String{
return when (DebugConfig.getNetMode()) {
DebugConfig.NET_MODE_DEV -> HOST_DEV
DebugConfig.NET_MODE_QA -> HOST_DEV
DebugConfig.NET_MODE_DEMO -> HOST_RELEASE
DebugConfig.NET_MODE_RELEASE -> HOST_RELEASE
else -> HOST_RELEASE
}
}
}
}

View File

@@ -0,0 +1,288 @@
package com.zhjt.mogo_core_function_devatools.takeover.network
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.BaseResponse
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.takeover.*
import com.mogo.eagle.core.network.MoGoRetrofitFactory
import com.mogo.eagle.core.network.apiCall
import com.mogo.eagle.core.network.request
import java.util.concurrent.ConcurrentHashMap
class TakeOverNetWorkModel {
private fun getNetWorkApi(baseUrl: String = TakeOverHost.get()): TakeOverApiService {
return MoGoRetrofitFactory.getInstanceNoCallAdapter(baseUrl)
.create(TakeOverApiService::class.java)
}
private val retryMap: ConcurrentHashMap<Int, Int> = ConcurrentHashMap<Int, Int>()
fun manualControl(onSuccess: (() -> Unit), onError: ((String) -> Unit)) {
request<BaseResponse<Any>> {
start {
retryMap[MANUAL_CONTROL] = retryMap[MANUAL_CONTROL] ?: 0 + 1
}
loader {
apiCall {
val map = mutableMapOf<String, Any>()
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
map["type"] = MANUAL_CONTROL
map["plateNumber"] = AppConfigInfo.plateNumber ?: ""
getNetWorkApi().takeOver(map)
}
}
onSuccess {
if (it.result != null) {
retryMap.remove(MANUAL_CONTROL)
onSuccess.invoke()
} else {
if (retryMap[MANUAL_CONTROL]!! <= 3) {
retryMap[MANUAL_CONTROL] = retryMap[MANUAL_CONTROL]!! + 1
manualControl(onSuccess, onError)
} else {
onError.invoke("manualControl result is null")
}
}
}
onError {
if (retryMap[MANUAL_CONTROL]!! <= 3) {
retryMap[MANUAL_CONTROL] = retryMap[MANUAL_CONTROL]!! + 1
manualControl(onSuccess, onError)
} else if (it.message != null) {
onError.invoke(it.message!!)
}
}
}
}
fun overTake(onSuccess: (() -> Unit), onError: ((String) -> Unit)) {
request<BaseResponse<Any>> {
start {
retryMap[OVER_TAKE] = retryMap[OVER_TAKE] ?: 0 + 1
}
loader {
apiCall {
val map = mutableMapOf<String, Any>()
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
map["type"] = OVER_TAKE
map["plateNumber"] = AppConfigInfo.plateNumber ?: ""
getNetWorkApi().takeOver(map)
}
}
onSuccess {
if (it.result != null) {
retryMap.remove(OVER_TAKE)
onSuccess.invoke()
} else {
if (retryMap[OVER_TAKE]!! <= 3) {
retryMap[OVER_TAKE] = retryMap[OVER_TAKE]!! + 1
manualControl(onSuccess, onError)
} else {
onError.invoke("overTake result is null")
}
}
}
onError {
if (retryMap[OVER_TAKE]!! <= 3) {
retryMap[OVER_TAKE] = retryMap[OVER_TAKE]!! + 1
manualControl(onSuccess, onError)
} else if (it.message != null) {
onError.invoke(it.message!!)
}
}
}
}
fun lineToLeft(onSuccess: (() -> Unit), onError: ((String) -> Unit)) {
request<BaseResponse<Any>> {
start {
retryMap[LINE_TO_LEFT] = retryMap[LINE_TO_LEFT] ?: 0 + 1
}
loader {
apiCall {
val map = mutableMapOf<String, Any>()
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
map["type"] = LINE_TO_LEFT
map["plateNumber"] = AppConfigInfo.plateNumber ?: ""
getNetWorkApi().takeOver(map)
}
}
onSuccess {
if (it.result != null) {
retryMap.remove(LINE_TO_LEFT)
onSuccess.invoke()
} else {
if (retryMap[LINE_TO_LEFT]!! <= 3) {
retryMap[LINE_TO_LEFT] = retryMap[LINE_TO_LEFT]!! + 1
manualControl(onSuccess, onError)
} else {
onError.invoke("lineToLeft result is null")
}
}
}
onError {
if (retryMap[LINE_TO_LEFT]!! <= 3) {
retryMap[LINE_TO_LEFT] = retryMap[LINE_TO_LEFT]!! + 1
manualControl(onSuccess, onError)
} else if (it.message != null) {
onError.invoke(it.message!!)
}
}
}
}
fun lineToRight(onSuccess: (() -> Unit), onError: ((String) -> Unit)) {
request<BaseResponse<Any>> {
start {
retryMap[LINE_TO_RIGHT] = retryMap[LINE_TO_RIGHT] ?: 0 + 1
}
loader {
apiCall {
val map = mutableMapOf<String, Any>()
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
map["type"] = LINE_TO_RIGHT
map["plateNumber"] = AppConfigInfo.plateNumber ?: ""
getNetWorkApi().takeOver(map)
}
}
onSuccess {
if (it.result != null) {
retryMap.remove(LINE_TO_RIGHT)
onSuccess.invoke()
} else {
if (retryMap[LINE_TO_RIGHT]!! <= 3) {
retryMap[LINE_TO_RIGHT] = retryMap[LINE_TO_RIGHT]!! + 1
manualControl(onSuccess, onError)
} else {
onError.invoke("lineToRight result is null")
}
}
}
onError {
if (retryMap[LINE_TO_RIGHT]!! <= 3) {
retryMap[LINE_TO_RIGHT] = retryMap[LINE_TO_RIGHT]!! + 1
manualControl(onSuccess, onError)
} else if (it.message != null) {
onError.invoke(it.message!!)
}
}
}
}
fun pullOver(onSuccess: (() -> Unit), onError: ((String) -> Unit)) {
request<BaseResponse<Any>> {
start {
retryMap[PULL_OVER] = retryMap[PULL_OVER] ?: 0 + 1
}
loader {
apiCall {
val map = mutableMapOf<String, Any>()
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
map["type"] = PULL_OVER
map["plateNumber"] = AppConfigInfo.plateNumber ?: ""
getNetWorkApi().takeOver(map)
}
}
onSuccess {
if (it.result != null) {
retryMap.remove(PULL_OVER)
onSuccess.invoke()
} else {
if (retryMap[PULL_OVER]!! <= 3) {
retryMap[PULL_OVER] = retryMap[PULL_OVER]!! + 1
manualControl(onSuccess, onError)
} else {
onError.invoke("pullOver result is null")
}
}
}
onError {
if (retryMap[PULL_OVER]!! <= 3) {
retryMap[PULL_OVER] = retryMap[PULL_OVER]!! + 1
manualControl(onSuccess, onError)
} else if (it.message != null) {
onError.invoke(it.message!!)
}
}
}
}
fun emergencyStop(onSuccess: (() -> Unit), onError: ((String) -> Unit)) {
request<BaseResponse<Any>> {
start {
retryMap[EMERGENCY_STOP] = retryMap[EMERGENCY_STOP] ?: 0 + 1
}
loader {
apiCall {
val map = mutableMapOf<String, Any>()
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
map["type"] = EMERGENCY_STOP
map["plateNumber"] = AppConfigInfo.plateNumber ?: ""
getNetWorkApi().takeOver(map)
}
}
onSuccess {
if (it.result != null) {
retryMap.remove(EMERGENCY_STOP)
onSuccess.invoke()
} else {
if (retryMap[EMERGENCY_STOP]!! <= 3) {
retryMap[EMERGENCY_STOP] = retryMap[EMERGENCY_STOP]!! + 1
manualControl(onSuccess, onError)
} else {
onError.invoke("emergencyStop result is null")
}
}
}
onError {
if (retryMap[EMERGENCY_STOP]!! <= 3) {
retryMap[EMERGENCY_STOP] = retryMap[EMERGENCY_STOP]!! + 1
manualControl(onSuccess, onError)
} else if (it.message != null) {
onError.invoke(it.message!!)
}
}
}
}
fun takeOverRequest(onSuccess: (() -> Unit), onError: ((String) -> Unit)) {
request<BaseResponse<Any>> {
start {
retryMap[TAKE_OVER_REQUEST] = retryMap[TAKE_OVER_REQUEST] ?: 0 + 1
}
loader {
apiCall {
val map = mutableMapOf<String, Any>()
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
map["type"] = TAKE_OVER_REQUEST
map["plateNumber"] = AppConfigInfo.plateNumber ?: ""
getNetWorkApi().takeOver(map)
}
}
onSuccess {
if (it.result != null) {
retryMap.remove(TAKE_OVER_REQUEST)
onSuccess.invoke()
} else {
if (retryMap[TAKE_OVER_REQUEST]!! <= 3) {
retryMap[TAKE_OVER_REQUEST] = retryMap[TAKE_OVER_REQUEST]!! + 1
manualControl(onSuccess, onError)
} else {
onError.invoke("takeOverRequest result is null")
}
}
}
onError {
if (retryMap[TAKE_OVER_REQUEST]!! <= 3) {
retryMap[TAKE_OVER_REQUEST] = retryMap[TAKE_OVER_REQUEST]!! + 1
manualControl(onSuccess, onError)
} else if (it.message != null) {
onError.invoke(it.message!!)
}
}
}
}
}

View File

@@ -17,7 +17,6 @@ class StartUpTraceNetWorkModel {
.create(TraceStartUpApiService::class.java)
}
private var retryTime = 0
private var success: ((String) -> Unit)? = null
private var error: ((String) -> Unit)? = null
@Volatile
@@ -29,7 +28,8 @@ class StartUpTraceNetWorkModel {
onError: ((String) -> Unit)? = null
) {
request<BaseResponse<String>> {
var map: MutableMap<String, Any> = mutableMapOf()
var retryTime = 0
var map: MutableMap<String, Any>
start {
if (success == null) {
success = onSuccess
@@ -54,11 +54,13 @@ class StartUpTraceNetWorkModel {
onSuccess {
if (it.result != null) {
onSuccess?.invoke(it.result)
traceId = ""
} else {
if (retryTime < 3) {
retryTime += 1
report()
report(id)
} else {
traceId = ""
error?.invoke("startUp report error msg is null")
}
}
@@ -66,13 +68,13 @@ class StartUpTraceNetWorkModel {
onError {
if (retryTime < 3) {
retryTime += 1
report()
report(id)
} else if (it.message != null) {
traceId = ""
error?.invoke(it.message ?: "startUp report error msg is null")
}
}
}
}
}

View File

@@ -0,0 +1,79 @@
package com.mogo.eagle.core.function.hmi.ui.setting
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.setting.CallerSeatPressureManager
import com.mogo.eagle.core.function.hmi.R
import kotlinx.android.synthetic.main.view_seat_pressure_setting.view.tb_co_driver
import kotlinx.android.synthetic.main.view_seat_pressure_setting.view.tb_main_driver
import kotlinx.android.synthetic.main.view_seat_pressure_setting.view.tb_rear_row
/**
* 座椅压力设置页面(设座位是否有人)
*/
class SeatPressureSettingView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr) {
companion object {
const val TAG = "SeatPressureSettingView"
}
private var mainDriverStatus = false //主驾是否有人,默认没人
private var coDriverStatus = false //副驾是否有人,默认没人
private var rearRowStatus = false //后排是否有人,默认没人
init {
LayoutInflater.from(context).inflate(R.layout.view_seat_pressure_setting, this, true)
initView()
}
private fun initView(){
//主驾
tb_main_driver.isChecked = mainDriverStatus
tb_main_driver.setOnCheckedChangeListener{compoundButton, isChecked ->
if(!compoundButton.isPressed){
return@setOnCheckedChangeListener
}
mainDriverStatus = isChecked
CallerAutoPilotControlManager.sendSeatPressure(mainDriverStatus,coDriverStatus,rearRowStatus)
updateBtnBg(mainDriverStatus,coDriverStatus,rearRowStatus)
}
//副驾
tb_co_driver.isChecked = coDriverStatus
tb_co_driver.setOnCheckedChangeListener{compoundButton, isChecked ->
if(!compoundButton.isPressed){
return@setOnCheckedChangeListener
}
coDriverStatus = isChecked
CallerAutoPilotControlManager.sendSeatPressure(mainDriverStatus,coDriverStatus,rearRowStatus)
updateBtnBg(mainDriverStatus,coDriverStatus,rearRowStatus)
}
//后排
tb_rear_row.isChecked = rearRowStatus
tb_rear_row.setOnCheckedChangeListener{compoundButton, isChecked ->
if(!compoundButton.isPressed){
return@setOnCheckedChangeListener
}
rearRowStatus = isChecked
CallerAutoPilotControlManager.sendSeatPressure(mainDriverStatus,coDriverStatus,rearRowStatus)
updateBtnBg(mainDriverStatus,coDriverStatus,rearRowStatus)
}
}
private fun updateBtnBg(driver: Boolean,copilot: Boolean,backRow: Boolean){
if(driver || copilot || backRow){
//主驾、副驾、后排只要有一个位置有人则开关按钮就显示有人状态
CallerSeatPressureManager.invokeUpdateBgEvent(true)
}else{
//所有座位都没有人则显示无人状态
CallerSeatPressureManager.invokeUpdateBgEvent(false)
}
}
}

View File

@@ -1,6 +1,7 @@
package com.mogo.eagle.core.function.hmi.ui.vehicle
import android.content.Context
import android.os.CountDownTimer
import android.util.AttributeSet
import android.util.TypedValue.COMPLEX_UNIT_PX
import android.view.LayoutInflater
@@ -21,6 +22,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningActionsListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.util.SoundPoolUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.zhjt.service_biz.BizConfig
import kotlinx.android.synthetic.main.view_pnc_actions.view.*
@@ -122,6 +124,24 @@ class PncActionsView @JvmOverloads constructor(
AppCompatResources.getDrawable(context, bgResources)
tvHmiPncActions.text = actions
}
//voice tip
if(actions == "已超出ODD"){
val countDownTimer = object : CountDownTimer(3000, 1000){
override fun onTick(p0: Long) {
try {
SoundPoolUtils.getSoundPool().playSoundWithRedId(context,R.raw.weak_net_tips)
}catch (e: Exception){
e.printStackTrace()
}
}
override fun onFinish() {
}
}
countDownTimer.start()
}
} else {
tvHmiPncActions.background = null
tvHmiPncActions.text = ""

View File

@@ -0,0 +1,259 @@
package com.mogo.eagle.core.function.hmi.ui.vehicle
import android.annotation.SuppressLint
import android.app.Activity
import android.graphics.PixelFormat
import android.util.DisplayMetrics
import android.view.Gravity
import android.view.LayoutInflater
import android.view.MotionEvent
import android.view.View
import android.view.WindowManager
import android.widget.Button
import android.widget.ToggleButton
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.msgbox.AutopilotMsg
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.takeover.TAKE_OVER_REQUEST
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.function.call.setting.CallerTakeOverManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.util.BarUtils
import com.mogo.eagle.core.utilcode.util.SPUtils
import com.mogo.eagle.core.utilcode.util.SoundUtils
import kotlinx.android.synthetic.main.view_remote_take_over_autopilot.view.*
import kotlinx.android.synthetic.main.view_sop_setting.view.*
class TakeOverAutopilotView constructor(activity: Activity):View.OnTouchListener {
private var takeOverRequest: Boolean = false
private var mActivity: Activity = activity
private lateinit var mFloatLayout: View
private var mWindowParams: WindowManager.LayoutParams? = null
private var mWindowManager: WindowManager? = null
private var mInViewX = 0f
private var mInViewY = 0f
private var mInScreenX = 0f
private var mInScreenY = 0f
private lateinit var btnManualControl: Button
private lateinit var btnOverTake: Button
private lateinit var btnLineToLeft: Button
private lateinit var btnLineToRight: Button
private lateinit var btnPullOver: Button
private lateinit var btnEmergencyStop: Button
private lateinit var btnTakeOverRequest: Button
private lateinit var btnTakeOverRecover: Button
private lateinit var tbLaneChange: ToggleButton
private lateinit var tbAeb: ToggleButton
private lateinit var tbStopYield: ToggleButton
private lateinit var tbMapSpeed: ToggleButton
private lateinit var tbRamp: ToggleButton
init {
initView()
}
private fun initView() {
mFloatLayout = LayoutInflater.from(mActivity).inflate(R.layout.view_remote_take_over_autopilot, null) as View
mFloatLayout.setOnTouchListener(this)
btnManualControl = mFloatLayout.findViewById(R.id.btn_manual_control)
btnOverTake = mFloatLayout.findViewById(R.id.btn_over_take)
btnLineToLeft = mFloatLayout.findViewById(R.id.btn_line_to_left)
btnLineToRight = mFloatLayout.findViewById(R.id.btn_line_to_right)
btnPullOver = mFloatLayout.findViewById(R.id.btn_pull_over)
btnEmergencyStop = mFloatLayout.findViewById(R.id.btn_emergency_stop)
btnTakeOverRequest = mFloatLayout.findViewById(R.id.btn_take_over_request)
btnTakeOverRecover = mFloatLayout.findViewById(R.id.btn_take_over_recover)
tbLaneChange = mFloatLayout.findViewById(R.id.tb_lane_change)
tbAeb = mFloatLayout.findViewById(R.id.tb_aeb)
tbStopYield = mFloatLayout.findViewById(R.id.tb_stop_yield)
tbMapSpeed = mFloatLayout.findViewById(R.id.tb_map_speed)
tbRamp = mFloatLayout.findViewById(R.id.tb_ramp)
//人工接管
btnManualControl.setOnClickListener {
// 退出自驾
CallerAutoPilotControlManager.cancelAutoPilot()
// CallerDevaToolsManager.takeOver(MANUAL_CONTROL)
}
//超车
btnOverTake.setOnClickListener {
// 超车
CallerAutoPilotControlManager.sendPlanningLineChangeCmd(3)
// CallerDevaToolsManager.takeOver(OVER_TAKE)
}
btnLineToLeft.setOnClickListener {
// 向左变道
CallerAutoPilotControlManager.sendPlanningLineChangeCmd(1)
// CallerDevaToolsManager.takeOver(LINE_TO_LEFT)
}
btnLineToRight.setOnClickListener {
// 向右变道
CallerAutoPilotControlManager.sendPlanningLineChangeCmd(2)
// CallerDevaToolsManager.takeOver(LINE_TO_RIGHT)
}
btnPullOver.setOnClickListener {
// 靠边停车
CallerAutoPilotControlManager.sendPlanningPullOverCmd(1)
// CallerDevaToolsManager.takeOver(PULL_OVER)
}
btnEmergencyStop.setOnClickListener {
// 紧急停车
CallerAutoPilotControlManager.sendPlanningPullOverCmd(3)
// CallerDevaToolsManager.takeOver(EMERGENCY_STOP)
}
//接管请求
btnTakeOverRequest.setOnClickListener {
// takeOverRequest 执行时,避免多次提示
if (takeOverRequest) {
return@setOnClickListener
}
// 接管请求提示
CallerDevaToolsManager.takeOver(TAKE_OVER_REQUEST)
CallerHmiManager.warningV2X(
EventTypeEnumNew.TAKE_OVER_EVENT.poiType,
EventTypeEnumNew.TAKE_OVER_EVENT.content,
EventTypeEnumNew.TAKE_OVER_EVENT.tts,
object : IMoGoWarningStatusListener {
override fun onShow() {
takeOverRequest = true
CallerTakeOverManager.invokeTakeOverEvent(true)
//加入消息盒子
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.AUTOPILOT, AutopilotMsg(
EventTypeEnumNew.TAKE_OVER_EVENT.poiType.toInt(),
EventTypeEnumNew.TAKE_OVER_EVENT.content,
EventTypeEnumNew.TAKE_OVER_EVENT.tts,
System.currentTimeMillis()
)
)
)
}
override fun onDismiss() {
takeOverRequest = false
CallerTakeOverManager.invokeTakeOverEvent(false)
}
},expireTime =3000L, isFromObu = false
)
SoundUtils.playRing(mActivity)
}
//恢复自动决策
btnTakeOverRecover.setOnClickListener {
CallerAutoPilotControlManager.sendPlanningLineChangeCmd(4)
return@setOnClickListener
}
//AEB开关
tbAeb.isChecked = SPUtils.getInstance().getBoolean("aeb",false)
tbAeb.setOnCheckedChangeListener{ compoundButton, isChecked ->
if(!compoundButton.isPressed){
return@setOnCheckedChangeListener
}
CallerAutoPilotControlManager.sendAebCmd(isChecked)
SPUtils.getInstance().put("aeb",isChecked)
}
//绕障开关
tbLaneChange.isChecked = SPUtils.getInstance().getBoolean("lane_change",false)
tbLaneChange.setOnCheckedChangeListener{ compoundButton, isChecked ->
if(!compoundButton.isPressed){
return@setOnCheckedChangeListener
}
CallerAutoPilotControlManager.sendLaneChangeRestrainValid(isChecked)
SPUtils.getInstance().put("lane_change",isChecked)
}
//停车让行开关
tbStopYield.isChecked = SPUtils.getInstance().getBoolean("stop_yield",false)
tbStopYield.setOnCheckedChangeListener{ compoundButton, isChecked ->
if(!compoundButton.isPressed){
return@setOnCheckedChangeListener
}
CallerAutoPilotControlManager.sendStopYieldValid(isChecked)
SPUtils.getInstance().put("stop_yield",isChecked)
}
//地图限速开关
tbMapSpeed.isChecked = SPUtils.getInstance().getBoolean("map_speed",false)
tbMapSpeed.setOnCheckedChangeListener { compoundButton, isChecked ->
if(!compoundButton.isPressed){
return@setOnCheckedChangeListener
}
CallerAutoPilotControlManager.sendHadmapSpeedLimitValid(isChecked)
SPUtils.getInstance().put("map_speed",isChecked)
}
//环岛模式
tbRamp.isChecked = SPUtils.getInstance().getBoolean("ramp",false)
tbRamp.setOnCheckedChangeListener { compoundButton, isChecked ->
if(!compoundButton.isPressed){
return@setOnCheckedChangeListener
}
CallerAutoPilotControlManager.sendRampThetaValid(isChecked)
SPUtils.getInstance().put("ramp",isChecked)
}
mWindowParams = WindowManager.LayoutParams()
mWindowManager = mActivity.windowManager
mWindowParams?.let {
it.format = PixelFormat.RGBA_8888
it.flags = WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
it.gravity = Gravity.START or Gravity.TOP
it.width = 700
it.height = 900
it.alpha = 1.0f
}
}
@SuppressLint("ClickableViewAccessibility")
override fun onTouch(v: View?, motionEvent: MotionEvent?): Boolean {
when (motionEvent?.action) {
MotionEvent.ACTION_DOWN -> {
// 获取相对View的坐标即以此View左上角为原点
mInViewX = motionEvent.x
mInViewY = motionEvent.y
// 获取相对屏幕的坐标,即以屏幕左上角为原点
mInScreenX = motionEvent.rawX
mInScreenY = motionEvent.rawY
}
MotionEvent.ACTION_MOVE -> {
// 更新浮动窗口位置参数
mInScreenX = motionEvent.rawX
mInScreenY = motionEvent.rawY
// if(((mInScreenX - mInViewX)-mWindowParams!!.x).absoluteValue>150 || ((mInScreenY - mInViewY)-mWindowParams!!.y).absoluteValue>150){
// return true
// }
mWindowParams!!.x = (mInScreenX - mInViewX).toInt()
mWindowParams!!.y = (mInScreenY - mInViewY).toInt()
// 手指移动的时候更新小悬浮窗的位置
mWindowManager!!.updateViewLayout(mFloatLayout, mWindowParams)
}
}
return true
}
fun showFloatWindow() {
if (mFloatLayout.parent == null) {
val metrics = DisplayMetrics()
// 默认固定位置,靠屏幕右边缘的中间
mWindowManager!!.defaultDisplay.getMetrics(metrics)
mWindowParams!!.x = metrics.widthPixels
mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight()-1140
mWindowManager!!.addView(mFloatLayout, mWindowParams)
}
}
fun hideFloatWindow() {
if (mFloatLayout.parent != null){
mWindowManager!!.removeView(mFloatLayout)
}
}
}

View File

@@ -14,10 +14,12 @@ import com.mogo.eagle.core.data.msgbox.V2XMsg
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoParallelDrivingStatusListener
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
import com.mogo.eagle.core.function.api.setting.ITakeOverEventListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerParallelDrivingListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager.saveMsgBox
import com.mogo.eagle.core.function.call.setting.CallerTakeOverManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
@@ -33,7 +35,7 @@ class TakeOverView @JvmOverloads constructor(
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoAutopilotStatusListener,
IMoGoParallelDrivingStatusListener {
IMoGoParallelDrivingStatusListener,ITakeOverEventListener {
companion object {
const val TAG = "TakeOverView"
@@ -54,6 +56,7 @@ class TakeOverView @JvmOverloads constructor(
super.onAttachedToWindow()
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
CallerParallelDrivingListenerManager.addListener(TAG,this)
CallerTakeOverManager.addListener(TAG,this)
}
override fun onAutopilotStatusResponse(state: Int) {
@@ -169,6 +172,7 @@ class TakeOverView @JvmOverloads constructor(
super.onDetachedFromWindow()
CallerAutoPilotStatusListenerManager.removeListener(TAG)
CallerParallelDrivingListenerManager.removeListener(TAG)
CallerTakeOverManager.removeListener(TAG)
}
/**
@@ -300,4 +304,14 @@ class TakeOverView @JvmOverloads constructor(
}
}
override fun onTakeOverEvent(isShow: Boolean) {
ThreadUtils.runOnUiThread {
if(isShow){
this@TakeOverView.visibility = View.VISIBLE
}else{
this@TakeOverView.visibility = View.GONE
}
}
}
}

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="@dimen/dp_20" />
<gradient
android:startColor="#323C6F"
android:endColor="#323C6F"
android:angle="315"
/>
</shape>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#A7D3F6"
android:endColor="#8C9AFF"
/>
<corners android:radius="20px" />
</shape>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/color_80FFFFFF"/>
<corners android:radius="20px" />
</shape>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#FFFFFF"/>
<corners android:radius="20px" />
</shape>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#80FFFFFF"/>
<corners android:radius="@dimen/dp_20" />
</shape>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#029DFF"
android:endColor="#0056FF"
/>
<corners android:radius="@dimen/dp_20" />
</shape>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/seat_pressure_item_press_bg" android:state_pressed="true"/>
<item android:drawable="@drawable/seat_pressure_item_press_bg" android:state_checked="true"/>
<item android:drawable="@drawable/seat_pressure_item_normal_bg" android:state_pressed="false"/>
<item android:drawable="@drawable/seat_pressure_item_normal_bg" />
</selector>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/remote_take_over_item_press_bg" android:state_pressed="true"/>
<item android:drawable="@drawable/remote_take_over_item_press_bg" android:state_checked="true"/>
<item android:drawable="@drawable/remote_take_over_item_bg" android:state_pressed="false"/>
<item android:drawable="@drawable/remote_take_over_item_bg" />
</selector>

View File

@@ -0,0 +1,199 @@
<?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_700"
android:layout_height="@dimen/dp_900"
android:background="@drawable/bg_remote_take"
>
<Button
android:id="@+id/btn_manual_control"
style="?android:attr/borderlessButtonStyle"
android:layout_width="@dimen/dp_502"
android:layout_height="@dimen/dp_90"
android:layout_marginTop="@dimen/dp_20"
android:background="@drawable/remote_take_over_autopilot_bg"
android:gravity="center"
android:text="@string/hmi_take_over"
android:textColor="#FF181D6D"
android:textSize="@dimen/sp_34"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/btn_over_take"
android:layout_width="@dimen/dp_147"
android:layout_height="@dimen/dp_90"
android:layout_marginTop="@dimen/dp_30"
android:background="@drawable/selector_take_over_item"
android:gravity="center"
android:text="@string/hmi_over_take"
android:textColor="#FF181D6D"
android:textSize="@dimen/sp_30"
app:layout_constraintStart_toStartOf="@+id/btn_manual_control"
app:layout_constraintTop_toBottomOf="@+id/btn_manual_control" />
<Button
android:id="@+id/btn_line_to_left"
android:layout_width="@dimen/dp_147"
android:layout_height="@dimen/dp_90"
android:layout_marginTop="@dimen/dp_30"
android:gravity="center"
android:background="@drawable/selector_take_over_item"
android:text="@string/hmi_line_to_left"
android:textColor="#FF181D6D"
android:textSize="@dimen/sp_30"
app:layout_constraintEnd_toStartOf="@+id/btn_line_to_right"
app:layout_constraintStart_toEndOf="@+id/btn_over_take"
app:layout_constraintTop_toBottomOf="@+id/btn_manual_control" />
<Button
android:id="@+id/btn_line_to_right"
android:layout_width="@dimen/dp_147"
android:layout_height="@dimen/dp_90"
android:layout_marginTop="@dimen/dp_30"
android:gravity="center"
android:background="@drawable/selector_take_over_item"
android:text="@string/hmi_line_to_right"
android:textColor="#FF181D6D"
android:textSize="@dimen/sp_30"
app:layout_constraintEnd_toEndOf="@+id/btn_manual_control"
app:layout_constraintTop_toBottomOf="@+id/btn_manual_control" />
<Button
android:id="@+id/btn_pull_over"
android:layout_width="@dimen/dp_147"
android:layout_height="@dimen/dp_90"
android:layout_marginTop="@dimen/dp_30"
android:gravity="center"
android:background="@drawable/selector_take_over_item"
android:text="@string/hmi_pull_over"
android:textColor="#FF181D6D"
android:textSize="@dimen/sp_30"
app:layout_constraintStart_toStartOf="@+id/btn_manual_control"
app:layout_constraintTop_toBottomOf="@+id/btn_over_take" />
<Button
android:id="@+id/btn_emergency_stop"
android:layout_width="@dimen/dp_147"
android:layout_height="@dimen/dp_90"
android:layout_marginTop="@dimen/dp_30"
android:gravity="center"
android:background="@drawable/selector_take_over_item"
android:text="@string/hmi_emergency_stop"
android:textColor="#FF181D6D"
android:textSize="@dimen/sp_30"
app:layout_constraintEnd_toStartOf="@+id/btn_line_to_right"
app:layout_constraintStart_toEndOf="@+id/btn_over_take"
app:layout_constraintTop_toBottomOf="@+id/btn_line_to_left" />
<Button
android:id="@+id/btn_take_over_request"
android:layout_width="@dimen/dp_147"
android:layout_height="@dimen/dp_90"
android:layout_marginTop="@dimen/dp_30"
android:gravity="center"
android:background="@drawable/selector_take_over_item"
android:text="@string/hmi_take_over_request"
android:textColor="#FF181D6D"
android:textSize="@dimen/sp_30"
app:layout_constraintEnd_toEndOf="@+id/btn_manual_control"
app:layout_constraintTop_toBottomOf="@+id/btn_line_to_right" />
<Button
android:id="@+id/btn_take_over_recover"
android:layout_width="@dimen/dp_230"
android:layout_height="@dimen/dp_90"
android:layout_marginTop="@dimen/dp_30"
android:gravity="center"
android:background="@drawable/selector_take_over_item"
android:text="@string/hmi_take_over_recover"
android:textColor="#FF181D6D"
android:textSize="@dimen/sp_30"
app:layout_constraintTop_toBottomOf="@+id/btn_emergency_stop"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/tb_lane_change"
/>
<ToggleButton
android:id="@+id/tb_lane_change"
android:layout_width="@dimen/dp_230"
android:layout_height="@dimen/dp_90"
android:layout_marginTop="@dimen/dp_30"
app:layout_constraintTop_toBottomOf="@id/btn_emergency_stop"
app:layout_constraintLeft_toRightOf="@id/btn_take_over_recover"
app:layout_constraintRight_toRightOf="parent"
android:background="@drawable/selector_take_over_item"
android:textOff="@string/hmi_open_lane_change"
android:textOn="@string/hmi_close_lane_change"
android:textColor="#FF181D6D"
android:textSize="@dimen/sp_30"
android:gravity="center"
/>
<ToggleButton
android:id="@+id/tb_aeb"
android:layout_width="@dimen/dp_230"
android:layout_height="@dimen/dp_90"
android:layout_marginTop="@dimen/dp_30"
app:layout_constraintTop_toBottomOf="@id/tb_lane_change"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/tb_stop_yield"
android:background="@drawable/selector_take_over_item"
android:textOff="@string/hmi_open_aeb"
android:textOn="@string/hmi_close_aeb"
android:textColor="#FF181D6D"
android:textSize="@dimen/sp_30"
android:gravity="center"
/>
<ToggleButton
android:id="@+id/tb_stop_yield"
android:layout_width="@dimen/dp_230"
android:layout_height="@dimen/dp_90"
android:layout_marginTop="@dimen/dp_30"
app:layout_constraintTop_toBottomOf="@id/tb_lane_change"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toRightOf="@id/tb_aeb"
android:background="@drawable/selector_take_over_item"
android:textOff="@string/hmi_open_stop_yield"
android:textOn="@string/hmi_close_stop_yield"
android:textColor="#FF181D6D"
android:textSize="@dimen/sp_30"
android:gravity="center"
/>
<ToggleButton
android:id="@+id/tb_map_speed"
android:layout_width="@dimen/dp_230"
android:layout_height="@dimen/dp_90"
android:layout_marginTop="@dimen/dp_30"
app:layout_constraintTop_toBottomOf="@id/tb_aeb"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/tb_ramp"
android:background="@drawable/selector_take_over_item"
android:textOff="@string/hmi_open_map_speed"
android:textOn="@string/hmi_close_map_speed"
android:textColor="#FF181D6D"
android:textSize="@dimen/sp_30"
android:gravity="center"
/>
<ToggleButton
android:id="@+id/tb_ramp"
android:layout_width="@dimen/dp_230"
android:layout_height="@dimen/dp_90"
android:layout_marginTop="@dimen/dp_30"
app:layout_constraintTop_toBottomOf="@id/tb_aeb"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toRightOf="@id/tb_map_speed"
android:background="@drawable/selector_take_over_item"
android:textOff="@string/hmi_open_ramp"
android:textOn="@string/hmi_close_ramp"
android:textColor="#FF181D6D"
android:textSize="@dimen/sp_30"
android:gravity="center"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@drawable/bg_seat_pressure_setting"
>
<ToggleButton
android:id="@+id/tb_main_driver"
android:layout_width="@dimen/dp_180"
android:layout_height="@dimen/dp_80"
android:textOff="@string/hmi_main_driver"
android:textOn="@string/hmi_main_driver"
android:textColor="@color/white"
android:textSize="@dimen/sp_30"
android:gravity="center"
android:background="@drawable/selector_seat_pressure_item"
android:layout_margin="@dimen/dp_20"
/>
<ToggleButton
android:id="@+id/tb_co_driver"
android:layout_width="@dimen/dp_180"
android:layout_height="@dimen/dp_80"
android:textOff="@string/hmi_co_driver"
android:textOn="@string/hmi_co_driver"
android:textColor="@color/white"
android:textSize="@dimen/sp_30"
android:gravity="center"
android:background="@drawable/selector_seat_pressure_item"
android:layout_margin="@dimen/dp_20"
/>
<ToggleButton
android:id="@+id/tb_rear_row"
android:layout_width="@dimen/dp_180"
android:layout_height="@dimen/dp_80"
android:textOff="@string/hmi_rear_row"
android:textOn="@string/hmi_rear_row"
android:textColor="@color/white"
android:textSize="@dimen/sp_30"
android:gravity="center"
android:background="@drawable/selector_seat_pressure_item"
android:layout_margin="@dimen/dp_20"
/>
</LinearLayout>

View File

@@ -46,7 +46,7 @@
<color name="foreground_debug">#FF333333</color>
<color name="foreground_info">#FF333333</color>
<color name="foreground_warn">#FFCCCCCC</color>
<color name="color_80FFFFFF">#80FFFFFF</color>

View File

@@ -130,4 +130,27 @@
<string name="road_cross_live_tip">蘑菇为您实时护航中,请放心驾驶!</string>
<string name="hmi_take_over">人工接管</string>
<string name="hmi_over_take">超车</string>
<string name="hmi_line_to_left">向左变道</string>
<string name="hmi_line_to_right">向右变道</string>
<string name="hmi_pull_over">靠边停车</string>
<string name="hmi_emergency_stop">应急停车</string>
<string name="hmi_take_over_request">接管请求</string>
<string name="hmi_take_over_recover">恢复自动决策</string>
<string name="hmi_open_lane_change">障碍物模式</string>
<string name="hmi_close_lane_change">障碍物模式</string>
<string name="hmi_open_aeb">制动模式</string>
<string name="hmi_close_aeb">制动模式</string>
<string name="hmi_open_stop_yield">停车</string>
<string name="hmi_close_stop_yield">停车</string>
<string name="hmi_open_map_speed">限速模式</string>
<string name="hmi_close_map_speed">限速模式</string>
<string name="hmi_open_ramp">环岛模式</string>
<string name="hmi_close_ramp">环岛模式</string>
<string name="hmi_main_driver">主驾</string>
<string name="hmi_co_driver">副驾</string>
<string name="hmi_rear_row">后排</string>
</resources>

View File

@@ -94,6 +94,10 @@ class PncActionsHelper {
YIELD_TO_VEHICLE_COMING_FROM_BEHIND_VALUE -> {
if (driveAction == 1) "正在避让后方来车" else ""
}
// 考试项
OUT_OF_ODD_VALUE -> {
if (driveAction == 1 || driveAction == 2 || driveAction == 3) "已超出ODD" else ""
}
else -> ""
}
}

View File

@@ -0,0 +1,26 @@
package com.mogo.eagle.core.data.takeover
import androidx.annotation.IntDef
const val MANUAL_CONTROL = 0
const val OVER_TAKE = 1
const val LINE_TO_LEFT = 2
const val LINE_TO_RIGHT = 3
const val PULL_OVER = 4
const val EMERGENCY_STOP = 5
const val TAKE_OVER_REQUEST = 6
@IntDef(
MANUAL_CONTROL,
OVER_TAKE,
LINE_TO_LEFT,
LINE_TO_RIGHT,
PULL_OVER,
EMERGENCY_STOP,
TAKE_OVER_REQUEST
)
@Retention(AnnotationRetention.SOURCE)
annotation class TakeOverAnnotation(vararg val type: Int) {
}

View File

@@ -194,6 +194,46 @@ interface IMoGoAutopilotControlProvider : IMoGoFunctionServerProvider {
*/
fun sendDetouringSpeed(speed: Double): Boolean
/**
* AEB开关
* isEnable = true 开启
* isEnable = false 关闭
* @return boolean
*/
fun sendAebCmd(isEnable: Boolean): Boolean
/**
* 限制绕障开关
* isEnable = true 限制绕障
* isEnable = false 正常绕障
* @return boolean
*/
fun sendLaneChangeRestrainValid(isEnable: Boolean): Boolean
/**
* 停车让行线前避让等待开关
* isEnable = true 停车让行线前需要避让等待
* isEnable = false 停车让行线前无需避让等待
* @return boolean
*/
fun sendStopYieldValid(isEnable: Boolean): Boolean
/**
* 地图限速功能开关
* isEnable = true 使用地图限速功能
* isEnable = false 不使用地图限速功能
* @return boolean
*/
fun sendHadmapSpeedLimitValid(isEnable: Boolean): Boolean
/**
* 环岛模式开关
* isEnable = true 环岛模式
* isEnable = false 普通模式
* @return boolean
*/
fun sendRampThetaValid(isEnable: Boolean): Boolean
/**
* 弱网减速停车策略开关
* isEnable = true 使用弱网减速停车策略
@@ -536,4 +576,16 @@ interface IMoGoAutopilotControlProvider : IMoGoFunctionServerProvider {
fun sendRoboBusJinlvM1TaskCmd(roboBusJinlvM1Cmd: SpecialVehicleTaskCmdOuterClass.RoboBusJinlvM1Cmd): Boolean
fun sendPlanningCmd(cmd: Int): Boolean
fun sendPlanningLineChangeCmd(cmd: Int): Boolean
fun sendPlanningPullOverCmd(pullOverCmd: Int): Boolean
/**
* 设置座椅压力接口
* @param driver 主驾是否有人
* @param copilot 副驾是否有人
* @param backRow 后排是否有人
*/
fun sendSeatPressure(driver: Boolean,copilot: Boolean,backRow: Boolean): Boolean
}

View File

@@ -12,6 +12,7 @@ import com.mogo.eagle.core.data.deva.report.WorkOrderReportInfo
import com.mogo.eagle.core.data.deva.scene.SceneModule
import com.mogo.eagle.core.data.deva.scene.SceneTAG
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.takeover.TakeOverAnnotation
import com.mogo.eagle.core.function.api.devatools.apm.*
import com.mogo.eagle.core.function.api.devatools.block.*
import com.mogo.eagle.core.function.api.devatools.strict.*
@@ -321,4 +322,9 @@ interface IDevaToolsProvider : IProvider {
* 是否开启引导线动效
*/
fun setRouteDynamicColorEnable(enable: Boolean)
/**
* 接管
*/
fun takeOver(@TakeOverAnnotation takeOverAnnotation: Int)
}

View File

@@ -0,0 +1,10 @@
package com.mogo.eagle.core.function.api.setting
/**
* 座椅压力事件监听回调接口
*/
interface ISeatPressureEventListener {
fun onUpdateBgEvent(isPress: Boolean){}
}

View File

@@ -0,0 +1,10 @@
package com.mogo.eagle.core.function.api.setting
/**
* 座椅压力事件监听回调接口
*/
interface ITakeOverEventListener {
fun onTakeOverEvent(isShow: Boolean){}
}

View File

@@ -382,6 +382,56 @@ object CallerAutoPilotControlManager {
return providerApi?.sendDetouringSpeed(speed)
}
/**
* AEB开关
* isEnable = true 开启
* isEnable = false 关闭
* @return boolean
*/
fun sendAebCmd(isEnable: Boolean): Boolean?{
return providerApi?.sendAebCmd(isEnable)
}
/**
* 限制绕障开关
* isEnable = true 限制绕障
* isEnable = false 正常绕障
* @return boolean
*/
fun sendLaneChangeRestrainValid(isEnable: Boolean): Boolean?{
return providerApi?.sendLaneChangeRestrainValid(isEnable)
}
/**
* 停车让行线前避让等待开关
* isEnable = true 停车让行线前需要避让等待
* isEnable = false 停车让行线前无需避让等待
* @return boolean
*/
fun sendStopYieldValid(isEnable: Boolean): Boolean?{
return providerApi?.sendStopYieldValid(isEnable)
}
/**
* 地图限速功能开关
* isEnable = true 使用地图限速功能
* isEnable = false 不使用地图限速功能
* @return boolean
*/
fun sendHadmapSpeedLimitValid(isEnable: Boolean): Boolean?{
return providerApi?.sendHadmapSpeedLimitValid(isEnable)
}
/**
* 环岛模式开关
* isEnable = true 环岛模式
* isEnable = false 普通模式
* @return boolean
*/
fun sendRampThetaValid(isEnable: Boolean): Boolean?{
return providerApi?.sendRampThetaValid(isEnable)
}
/**
* 弱网减速停车策略开关
* isEnable = true 使用弱网减速停车策略
@@ -841,4 +891,22 @@ object CallerAutoPilotControlManager {
fun sendPlanningCmd(cmd: Int): Boolean {
return providerApi?.sendPlanningCmd(cmd) ?: false
}
fun sendPlanningLineChangeCmd(cmd: Int): Boolean {
return providerApi?.sendPlanningLineChangeCmd(cmd) ?: false
}
fun sendPlanningPullOverCmd(pullOverCmd: Int): Boolean{
return providerApi?.sendPlanningPullOverCmd(pullOverCmd)?: false
}
/**
* 设置座椅压力接口
* @param driver 主驾是否有人
* @param copilot 副驾是否有人
* @param backRow 后排是否有人
*/
fun sendSeatPressure(driver: Boolean,copilot: Boolean,backRow: Boolean): Boolean?{
return providerApi?.sendSeatPressure(driver, copilot, backRow)
}
}

View File

@@ -13,6 +13,7 @@ import com.mogo.eagle.core.data.deva.report.WorkOrderReportInfo
import com.mogo.eagle.core.data.deva.scene.SceneModule
import com.mogo.eagle.core.data.deva.scene.SceneTAG
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.takeover.TakeOverAnnotation
import com.mogo.eagle.core.function.api.devatools.IDevaToolsProvider
import com.mogo.eagle.core.function.api.devatools.block.*
import com.mogo.eagle.core.function.api.devatools.download.*
@@ -400,4 +401,11 @@ object CallerDevaToolsManager {
fun setRouteDynamicColorEnable(enable: Boolean) {
devaToolsProviderApi?.setRouteDynamicColorEnable(enable)
}
/**
* 接管
*/
fun takeOver(@TakeOverAnnotation takeOverAnnotation: Int) {
devaToolsProviderApi?.takeOver(takeOverAnnotation)
}
}

View File

@@ -0,0 +1,20 @@
package com.mogo.eagle.core.function.call.setting
import com.mogo.eagle.core.function.api.setting.ISeatPressureEventListener
import com.mogo.eagle.core.function.call.base.CallerBase
import java.util.concurrent.ConcurrentHashMap
/**
* 座椅压力事件监听管理
*/
object CallerSeatPressureManager: CallerBase<ISeatPressureEventListener>() {
fun invokeUpdateBgEvent(isPress: Boolean){
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
listener.onUpdateBgEvent(isPress)
}
}
}

View File

@@ -0,0 +1,19 @@
package com.mogo.eagle.core.function.call.setting
import com.mogo.eagle.core.function.api.setting.ITakeOverEventListener
import com.mogo.eagle.core.function.call.base.CallerBase
/**
* 接管请求事件监听管理
*/
object CallerTakeOverManager: CallerBase<ITakeOverEventListener>() {
fun invokeTakeOverEvent(isShow: Boolean){
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
listener.onTakeOverEvent(isShow)
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 KiB

View File

@@ -1035,6 +1035,7 @@
<dimen name="dp_1125">1125dp</dimen>
<dimen name="dp_1170">1170dp</dimen>
<dimen name="dp_1200">1200dp</dimen>
<dimen name="dp_1250">1250dp</dimen>
<dimen name="dp_1261">1261dp</dimen>
<dimen name="dp_1300">1300dp</dimen>
<dimen name="dp_1373">1373dp</dimen>

View File

@@ -90,8 +90,8 @@ WEBSOCKET_VERSION=1.1.7
applicationId=com.mogo.launcer
applicationName=IntelligentPilot
# RoboBus司机端2.5.1RoboTaxi司机端2.5.1RoboTaxi乘客端1.0.0
versionCode=6005000
versionName=6.5.0
versionCode=6005002
versionName=6.5.2
################# 新架构模块Maven版本管理 #################
MOGO_CORE_FUNCTION_HMI_VERSION=0.0.58.10
@@ -149,7 +149,7 @@ MATRIX_VERSION=2.0.8
# 公交模式司机端版本号
DRIVER_VERSION=6.5.0
DRIVER_VERSION=6.5.2
# 公交模式乘客端端版本号
PASSENGER_VERSION=5.5.0

View File

@@ -14,6 +14,7 @@ import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_TYPE_SOCKET_AUT
import android.content.Context;
import android.os.SystemClock;
import android.text.TextUtils;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -2397,6 +2398,40 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
return sendSetParamReq(AdasConstants.MapSystemParamType.RAMP_THETA_VALID_VALUE, String.valueOf(enable));
}
/**
* 座椅压力
* TODO 目前仅襄阳牌照考试支持
*
* @param driver 主驾是否有人
* @param copilot 副驾是否有人
* @param backRow 后排是否有人
* @return boolean
*/
@Override
public long sendSeatPressure(boolean driver, boolean copilot, boolean backRow) {
Log.i(TAG, "主驾是否有人=" + driver + " 副驾是否有人=" + copilot + " 后排是否有人=" + backRow);
int value = 255;
if (driver && !copilot && !backRow) {
value = 0;
} else if (!driver && copilot && !backRow) {
value = 1;
} else if (driver && copilot && !backRow) {
value = 2;
} else if (!driver && !copilot && backRow) {
value = 3;
} else if (driver && !copilot && backRow) {
value = 4;
} else if (!driver && copilot && backRow) {
value = 5;
} else if (driver && copilot && backRow) {
value = 6;
} else if (!driver && !copilot && !backRow) {
value = 7;
}
Log.i(TAG, "\n0:表示仅主驾位有人\n1:表示仅副驾位有人\n2:表示主驾和副驾同时有人\n3:表示仅后排有人\n4:表示主驾有人+后排有人\n5:表示副驾有人+后排有人\n6:表示主驾和副驾同时有人+后排有人\n7: 所有座位都无人\n255:缺省\n下发数据=" + value);
return sendSetParamReq(15, String.valueOf(value));
}
/**
* 弱网减速停车策略开关
* 此方法存在域控回执,监听{@link OnAdasListener#onReceiveReceivedAck(ReceivedAck)}回调.使用方法:将此方法的返回值与{@link ReceivedAck#getMsgId()}进行比较,如果相同判断{@link ReceivedAck#getStatus()}是否等于{@link ReceivedAck.Status#NORMAL}详情参见CheckSystemView中的onReceiveReceivedAck

View File

@@ -935,6 +935,20 @@ public class AdasManager implements IAdasNetCommApi {
return mChannel == null ? -1L : mChannel.sendPlanningLaneChangeCmd(laneChangeCmd);
}
/**
* 座椅压力
* TODO 目前仅襄阳牌照考试支持
*
* @param driver 主驾是否有人
* @param copilot 副驾是否有人
* @param backRow 后排是否有人
* @return boolean
*/
@Override
public long sendSeatPressure(boolean driver, boolean copilot, boolean backRow) {
return mChannel == null ? -1L : mChannel.sendSeatPressure(driver, copilot, backRow);
}
/**
* 给Planning发送指令
* 此方法存在域控回执,监听{@link OnAdasListener#onReceiveReceivedAck(ReceivedAck)}回调.使用方法:将此方法的返回值与{@link ReceivedAck#getMsgId()}进行比较,如果相同判断{@link ReceivedAck#getStatus()}是否等于{@link ReceivedAck.Status#NORMAL}详情参见CheckSystemView中的onReceiveReceivedAck

View File

@@ -892,6 +892,17 @@ public interface IAdasNetCommApi {
*/
long sendRampThetaValid(int enable);
/**
* 座椅压力
* TODO 目前仅襄阳牌照考试支持
*
* @param driver 主驾是否有人
* @param copilot 副驾是否有人
* @param backRow 后排是否有人
* @return boolean
*/
long sendSeatPressure(boolean driver, boolean copilot, boolean backRow);
/**
* 弱网减速停车策略开关
* 此方法存在域控回执,监听{@link OnAdasListener#onReceiveReceivedAck(ReceivedAck)}回调.使用方法:将此方法的返回值与{@link ReceivedAck#getMsgId()}进行比较,如果相同判断{@link ReceivedAck#getStatus()}是否等于{@link ReceivedAck.Status#NORMAL}详情参见CheckSystemView中的onReceiveReceivedAck

View File

@@ -16,6 +16,7 @@ public class AdasChain {
//operation by user
public static final String CHAIN_CODE_ADAS_START_AUTOPILOT = "CHAIN_CODE_ADAS_START_AUTOPILOT";
public static final String CHAIN_CODE_ADAS_SEND_PLANNING_CMD = "CHAIN_CODE_ADAS_SEND_PLANNING_CMD";
public static final String CHAIN_CODE_ADAS_SEND_GLOBAL_PATH = "CHAIN_CODE_ADAS_SEND_GLOBAL_PATH";
public static final String CHAIN_CODE_ADAS_SEND_SYSTEM_CMD = "CHAIN_CODE_ADAS_SEND_SYSTEM_CMD";
public static final String CHAIN_CODE_ADAS_SEND_TRAJECTORY_DOWNLOAD = "CHAIN_CODE_ADAS_SEND_TRAJECTORY_DOWNLOAD";