[6.6.0]考试功能面板

This commit is contained in:
xuxinchao
2024-08-09 17:32:09 +08:00
parent b7a0bfd6de
commit 19fbdc917f
57 changed files with 813 additions and 0 deletions

View File

@@ -55,6 +55,8 @@ import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
import com.zhjt.mogo_core_function_devatools.binding.BindingCarManager
import com.zhjt.mogo_core_function_devatools.block.MoGoBlockProviderImpl
import com.zhjt.mogo_core_function_devatools.env.EnvChangeManager
import com.zhjt.mogo_core_function_devatools.exam.ExamControlManager
import com.zhjt.mogo_core_function_devatools.exam.ExamControlWindow
import com.zhjt.mogo_core_function_devatools.funcconfig.FuncConfigCenter.Companion.bizConfigCenter
import com.zhjt.mogo_core_function_devatools.funcconfig.FuncConfigImpl
import com.zhjt.mogo_core_function_devatools.logcat.CrashLogAnalyticsManager
@@ -417,6 +419,13 @@ class DevaToolsProvider : IDevaToolsProvider, IAppStateListener {
BadCaseManager.initAiCollect(view)
}
/**
* 展示考试车辆控制窗口
*/
override fun showExamControlWindow(view: View) {
ExamControlManager.showExamControlWindow(view)
}
override fun onReceiveBadCaseRecord(
msgBoxBean: MsgBoxBean,
activity: Activity,

View File

@@ -0,0 +1,55 @@
package com.zhjt.mogo_core_function_devatools.exam
import android.view.View
import androidx.fragment.app.FragmentActivity
import com.mogo.eagle.core.utilcode.util.ClickUtils
import com.mogo.eagle.core.utilcode.util.NetworkUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
/**
* 考试控制管理
*/
internal object ExamControlManager {
/**
* 开启考试车辆控制窗口
*/
fun showExamControlWindow(view: View){
val activity = view.context as? FragmentActivity
?: throw IllegalStateException("please ensure context is FragmentActivity.")
view.setOnClickListener{
if (ClickUtils.isFastClick()){
if (NetworkUtils.isConnected()){
//TODO
val examControlWindow = ExamControlWindow(activity)
examControlWindow.setClickListener(object: ExamControlWindow.ClickListener{
override fun closeWindow() {
examControlWindow.hideWindow()
}
})
examControlWindow.showWindow()
if (BadCaseConfig.dockerVersion != null){
val examControlWindow = ExamControlWindow(activity)
examControlWindow.setClickListener(object: ExamControlWindow.ClickListener{
override fun closeWindow() {
examControlWindow.hideWindow()
}
})
examControlWindow.showWindow()
}else{
ToastUtils.showShort("工控机连接状态异常")
}
}else{
ToastUtils.showShort("网络异常,请检查网络")
}
}else{
ToastUtils.showShort("请勿连续点击,稍后再试")
}
}
}
}

View File

@@ -0,0 +1,280 @@
package com.zhjt.mogo_core_function_devatools.exam
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.ImageView
import android.widget.TextView
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.utilcode.util.BarUtils
import com.mogo.eagle.core.utilcode.util.SPUtils
import com.mogo.eagle.core.utilcode.util.SoundUtils
import com.zhjt.mogo_core_function_devatools.R
import kotlin.math.absoluteValue
class ExamControlWindow constructor(activity: Activity): View.OnTouchListener{
companion object{
const val TAG = "ExamControlWindow"
}
private var mActivity: Activity = activity
private var mWindowParams: WindowManager.LayoutParams? = null
private var mWindowManager: WindowManager? = null
private lateinit var mFloatLayout: View
private var clickListener: ClickListener? = null
private var mInViewX = 0f
private var mInViewY = 0f
private var mInScreenX = 0f
private var mInScreenY = 0f
private var takeOverRequest: Boolean = false
private lateinit var ivCloseExam: ImageView //关闭按钮
private lateinit var tbLaneChange: ToggleButton //障碍物图标
private lateinit var tvLineChange: TextView //障碍物文字
private lateinit var tbAeb: ToggleButton //制动图标
private lateinit var tvAeb: TextView //制动文字
private lateinit var tbMapSpeed: ToggleButton //限速图标
private lateinit var tvMapSpeed: TextView //限速文字
private lateinit var tbRamp: ToggleButton //环岛图标
private lateinit var tvRamp: TextView //环岛文字
private lateinit var tbStopYield: ToggleButton //停车图标
private lateinit var tvStopYield: TextView //停车文字
private lateinit var tbSeatMainDriver: ToggleButton //主驾
private lateinit var tbSeatPassenger: ToggleButton //副驾
private lateinit var tbSeatRear: ToggleButton //乘客
private lateinit var ivLineToRight: ImageView //右变道
private lateinit var ivLineToLeft: ImageView //左变道
private lateinit var ivOverTake: ImageView //超车
private lateinit var ivPullOver: ImageView //路边停车
private lateinit var ivTakeOverRecover: ImageView //恢复自驾
private lateinit var ivTakeOverRequest: ImageView //接管请求
private lateinit var ivEmergencyStop: ImageView //应急停车
init {
initFloatWindow()
}
@SuppressLint("InflateParams")
private fun initFloatWindow(){
mFloatLayout = LayoutInflater.from(mActivity).inflate(R.layout.view_exam_control, null) as View
mFloatLayout.setOnTouchListener(this)
initEvent()
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 = 844
it.height = 1114
it.alpha = 1.0f
}
}
private fun initEvent(){
ivCloseExam = mFloatLayout.findViewById(R.id.ivCloseExam)
tbLaneChange = mFloatLayout.findViewById(R.id.tbLaneChange)
tvLineChange = mFloatLayout.findViewById(R.id.tvLineChange)
tbAeb = mFloatLayout.findViewById(R.id.tbAeb)
tvAeb = mFloatLayout.findViewById(R.id.tvAeb)
tbMapSpeed = mFloatLayout.findViewById(R.id.tbMapSpeed)
tvMapSpeed = mFloatLayout.findViewById(R.id.tvMapSpeed)
tbRamp = mFloatLayout.findViewById(R.id.tbRamp)
tvRamp = mFloatLayout.findViewById(R.id.tvRamp)
tbStopYield = mFloatLayout.findViewById(R.id.tbStopYield)
tvStopYield = mFloatLayout.findViewById(R.id.tvStopYield)
tbSeatMainDriver = mFloatLayout.findViewById(R.id.tbSeatMainDriver)
tbSeatPassenger = mFloatLayout.findViewById(R.id.tbSeatPassenger)
tbSeatRear = mFloatLayout.findViewById(R.id.tbSeatRear)
ivLineToRight = mFloatLayout.findViewById(R.id.ivLineToRight)
ivLineToLeft = mFloatLayout.findViewById(R.id.ivLineToLeft)
ivOverTake = mFloatLayout.findViewById(R.id.ivOverTake)
ivPullOver = mFloatLayout.findViewById(R.id.ivPullOver)
ivTakeOverRecover = mFloatLayout.findViewById(R.id.ivTakeOverRecover)
ivTakeOverRequest = mFloatLayout.findViewById(R.id.ivTakeOverRequest)
ivEmergencyStop = mFloatLayout.findViewById(R.id.ivEmergencyStop)
//关闭按钮
ivCloseExam.setOnClickListener {
hideWindow()
}
//绕障开关
tbLaneChange.isChecked = SPUtils.getInstance().getBoolean("lane_change",false)
tbLaneChange.setOnCheckedChangeListener{ _, isChecked ->
CallerAutoPilotControlManager.sendLaneChangeRestrainValid(isChecked)
SPUtils.getInstance().put("lane_change",isChecked)
}
tvLineChange.setOnClickListener {
tbLaneChange.performClick()
}
//AEB开关
tbAeb.isChecked = SPUtils.getInstance().getBoolean("aeb",false)
tbAeb.setOnCheckedChangeListener{ _, isChecked ->
CallerAutoPilotControlManager.sendAebCmd(isChecked)
SPUtils.getInstance().put("aeb",isChecked)
}
tvAeb.setOnClickListener {
tbAeb.performClick()
}
//地图限速开关
tbMapSpeed.isChecked = SPUtils.getInstance().getBoolean("map_speed",false)
tbMapSpeed.setOnCheckedChangeListener { _, isChecked ->
CallerAutoPilotControlManager.sendHadmapSpeedLimitValid(isChecked)
SPUtils.getInstance().put("map_speed",isChecked)
}
tvMapSpeed.setOnClickListener {
tbMapSpeed.performClick()
}
//环岛模式
tbRamp.isChecked = SPUtils.getInstance().getBoolean("ramp",false)
tbRamp.setOnCheckedChangeListener { _, isChecked ->
CallerAutoPilotControlManager.sendRampThetaValid(isChecked)
SPUtils.getInstance().put("ramp",isChecked)
}
tvRamp.setOnClickListener {
tbRamp.performClick()
}
//停车让行开关
tbStopYield.isChecked = SPUtils.getInstance().getBoolean("stop_yield",false)
tbStopYield.setOnCheckedChangeListener{ _, isChecked ->
CallerAutoPilotControlManager.sendStopYieldValid(isChecked)
SPUtils.getInstance().put("stop_yield",isChecked)
}
tvStopYield.setOnClickListener {
tbStopYield.performClick()
}
//向左变道
ivLineToLeft.setOnClickListener{
CallerAutoPilotControlManager.sendPlanningLineChangeCmd(1)
}
//向右变道
ivLineToRight.setOnClickListener{
CallerAutoPilotControlManager.sendPlanningLineChangeCmd(2)
}
//路边停车
ivPullOver.setOnClickListener{
CallerAutoPilotControlManager.sendPlanningPullOverCmd(1)
}
//超车
ivOverTake.setOnClickListener{
CallerAutoPilotControlManager.sendPlanningLineChangeCmd(3)
}
//接管请求
ivTakeOverRequest.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)
}
//恢复自驾
ivTakeOverRecover.setOnClickListener{
CallerAutoPilotControlManager.sendPlanningLineChangeCmd(4)
}
//应急停车
ivEmergencyStop.setOnClickListener {
CallerAutoPilotControlManager.sendPlanningPullOverCmd(3)
}
}
@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 showWindow() {
if (mFloatLayout.parent == null) {
val metrics = DisplayMetrics()
// 默认固定位置,靠屏幕右边缘的中间
mWindowManager!!.defaultDisplay.getMetrics(metrics)
mWindowParams!!.x = metrics.widthPixels-890
mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight()-1140
mWindowManager!!.addView(mFloatLayout, mWindowParams)
}
}
fun hideWindow(){
if (mFloatLayout.parent != null){
mWindowManager!!.removeView(mFloatLayout)
}
}
fun setClickListener(clickListener: ClickListener) {
this.clickListener = clickListener
}
interface ClickListener {
fun closeWindow()
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

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="#1AFFFFFF" />
<corners android:radius="@dimen/dp_30" />
</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="#1AFFFFFF" />
<corners android:radius="@dimen/dp_30" />
</shape>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

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/icon_aeb_pressed" android:state_pressed="true"/>
<item android:drawable="@drawable/icon_aeb_pressed" android:state_checked="true"/>
<item android:drawable="@drawable/icon_aeb_normal" android:state_pressed="false"/>
<item android:drawable="@drawable/icon_aeb_normal" />
</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/icon_lane_change_pressed" android:state_pressed="true"/>
<item android:drawable="@drawable/icon_lane_change_pressed" android:state_checked="true"/>
<item android:drawable="@drawable/icon_lane_change_normal" android:state_pressed="false"/>
<item android:drawable="@drawable/icon_lane_change_normal" />
</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/icon_map_speed_pressed" android:state_pressed="true"/>
<item android:drawable="@drawable/icon_map_speed_pressed" android:state_checked="true"/>
<item android:drawable="@drawable/icon_map_speed_normal" android:state_pressed="false"/>
<item android:drawable="@drawable/icon_map_speed_normal" />
</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/icon_ramp_pressed" android:state_pressed="true"/>
<item android:drawable="@drawable/icon_ramp_pressed" android:state_checked="true"/>
<item android:drawable="@drawable/icon_ramp_normal" android:state_pressed="false"/>
<item android:drawable="@drawable/icon_ramp_normal" />
</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/seat_driver_press_bg" android:state_pressed="true"/>
<item android:drawable="@drawable/seat_driver_press_bg" android:state_checked="true"/>
<item android:drawable="@drawable/seat_driver_normal_bg" android:state_pressed="false"/>
<item android:drawable="@drawable/seat_driver_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/seat_rear_press_bg" android:state_pressed="true"/>
<item android:drawable="@drawable/seat_rear_press_bg" android:state_checked="true"/>
<item android:drawable="@drawable/seat_rear_normal_bg" android:state_pressed="false"/>
<item android:drawable="@drawable/seat_rear_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/icon_stop_yield_pressed" android:state_pressed="true"/>
<item android:drawable="@drawable/icon_stop_yield_pressed" android:state_checked="true"/>
<item android:drawable="@drawable/icon_stop_yield_normal" android:state_pressed="false"/>
<item android:drawable="@drawable/icon_stop_yield_normal" />
</selector>

View File

@@ -0,0 +1,338 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="@dimen/dp_844"
android:layout_height="@dimen/dp_1114"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@drawable/bg_exam_control">
<View
android:id="@+id/viewTitleBg"
android:layout_width="@dimen/dp_844"
android:layout_height="@dimen/dp_102"
android:background="@drawable/bg_exam_control_title"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/viewTitleBg"
app:layout_constraintBottom_toBottomOf="@id/viewTitleBg"
app:layout_constraintLeft_toLeftOf="@id/viewTitleBg"
android:text="@string/exam_vehicle_control"
android:textSize="@dimen/sp_34"
android:textColor="@color/white"
android:layout_marginStart="@dimen/dp_63"
/>
<ImageView
android:id="@+id/ivCloseExam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/viewTitleBg"
app:layout_constraintBottom_toBottomOf="@id/viewTitleBg"
app:layout_constraintRight_toRightOf="parent"
android:src="@drawable/icon_exam_close"
android:contentDescription="@string/exam_close"
android:paddingEnd="@dimen/dp_56"
android:paddingTop="@dimen/dp_30"
android:paddingBottom="@dimen/dp_30"
android:paddingStart="@dimen/dp_56"
/>
<View
android:id="@+id/viewVehicleModeBg"
android:layout_width="@dimen/dp_750"
android:layout_height="@dimen/dp_278"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginTop="@dimen/dp_142"
android:background="@drawable/bg_exam_vehicle_mode"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="@id/viewVehicleModeBg"
app:layout_constraintRight_toRightOf="@id/viewVehicleModeBg"
app:layout_constraintTop_toTopOf="@id/viewVehicleModeBg"
android:text="@string/exam_vehicle_mode"
android:textColor="@color/exam_text_color"
android:textSize="@dimen/sp_30"
android:layout_marginTop="@dimen/dp_21"
/>
<ToggleButton
android:id="@+id/tbLaneChange"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="@id/viewVehicleModeBg"
app:layout_constraintTop_toTopOf="@id/viewVehicleModeBg"
android:background="@drawable/selector_lane_change"
android:textOff=""
android:textOn=""
android:layout_marginTop="@dimen/dp_91"
android:layout_marginLeft="@dimen/dp_40"
/>
<TextView
android:id="@+id/tvLineChange"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="@id/tbLaneChange"
app:layout_constraintRight_toRightOf="@id/tbLaneChange"
app:layout_constraintTop_toBottomOf="@id/tbLaneChange"
android:text="@string/exam_line_change"
android:textSize="@dimen/sp_27"
android:textColor="@color/exam_text_color"
/>
<ToggleButton
android:id="@+id/tbAeb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="@id/viewVehicleModeBg"
app:layout_constraintTop_toTopOf="@id/viewVehicleModeBg"
android:background="@drawable/selector_aeb"
android:textOff=""
android:textOn=""
android:layout_marginTop="@dimen/dp_91"
android:layout_marginLeft="@dimen/dp_183"
/>
<TextView
android:id="@+id/tvAeb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="@id/tbAeb"
app:layout_constraintRight_toRightOf="@id/tbAeb"
app:layout_constraintTop_toBottomOf="@id/tbAeb"
android:text="@string/exam_aeb"
android:textSize="@dimen/sp_27"
android:textColor="@color/exam_text_color"
/>
<ToggleButton
android:id="@+id/tbMapSpeed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="@id/viewVehicleModeBg"
app:layout_constraintTop_toTopOf="@id/viewVehicleModeBg"
android:background="@drawable/selector_map_speed"
android:textOff=""
android:textOn=""
android:layout_marginTop="@dimen/dp_91"
android:layout_marginLeft="@dimen/dp_325"
/>
<TextView
android:id="@+id/tvMapSpeed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="@id/tbMapSpeed"
app:layout_constraintRight_toRightOf="@id/tbMapSpeed"
app:layout_constraintTop_toBottomOf="@id/tbMapSpeed"
android:text="@string/exam_map_speed"
android:textSize="@dimen/sp_27"
android:textColor="@color/exam_text_color"
/>
<ToggleButton
android:id="@+id/tbRamp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="@id/viewVehicleModeBg"
app:layout_constraintTop_toTopOf="@id/viewVehicleModeBg"
android:background="@drawable/selector_ramp"
android:textOff=""
android:textOn=""
android:layout_marginTop="@dimen/dp_91"
android:layout_marginLeft="@dimen/dp_468"
/>
<TextView
android:id="@+id/tvRamp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="@id/tbRamp"
app:layout_constraintRight_toRightOf="@id/tbRamp"
app:layout_constraintTop_toBottomOf="@id/tbRamp"
android:text="@string/exam_ramp"
android:textSize="@dimen/sp_27"
android:textColor="@color/exam_text_color"
/>
<ToggleButton
android:id="@+id/tbStopYield"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="@id/viewVehicleModeBg"
app:layout_constraintTop_toTopOf="@id/viewVehicleModeBg"
android:background="@drawable/selector_stop_yield"
android:textOff=""
android:textOn=""
android:layout_marginTop="@dimen/dp_91"
android:layout_marginLeft="@dimen/dp_610"
/>
<TextView
android:id="@+id/tvStopYield"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="@id/tbStopYield"
app:layout_constraintRight_toRightOf="@id/tbStopYield"
app:layout_constraintTop_toBottomOf="@id/tbStopYield"
android:text="@string/exam_stop_yield"
android:textSize="@dimen/sp_27"
android:textColor="@color/exam_text_color"
/>
<View
android:id="@+id/viewSeatStatusBg"
android:layout_width="@dimen/dp_355"
android:layout_height="@dimen/dp_487"
app:layout_constraintTop_toBottomOf="@id/viewVehicleModeBg"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginTop="@dimen/dp_40"
android:layout_marginLeft="@dimen/dp_47"
android:background="@drawable/bg_exam_seat_status"
/>
<TextView
android:id="@+id/tvSeatStatusTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/viewSeatStatusBg"
app:layout_constraintLeft_toLeftOf="@id/viewSeatStatusBg"
app:layout_constraintRight_toRightOf="@id/viewSeatStatusBg"
android:text="@string/exam_seat_status"
android:textSize="@dimen/sp_30"
android:textColor="@color/exam_text_color"
android:layout_marginTop="@dimen/dp_28"
/>
<ToggleButton
android:id="@+id/tbSeatMainDriver"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/selector_seat_driver"
app:layout_constraintTop_toBottomOf="@id/tvSeatStatusTitle"
app:layout_constraintLeft_toLeftOf="@id/viewSeatStatusBg"
android:textOff=""
android:textOn=""
/>
<ToggleButton
android:id="@+id/tbSeatPassenger"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/selector_seat_driver"
app:layout_constraintTop_toBottomOf="@id/tvSeatStatusTitle"
app:layout_constraintRight_toRightOf="@id/viewSeatStatusBg"
android:textOff=""
android:textOn=""
/>
<ToggleButton
android:id="@+id/tbSeatRear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/selector_seat_rear"
app:layout_constraintLeft_toLeftOf="@id/viewSeatStatusBg"
app:layout_constraintRight_toRightOf="@id/viewSeatStatusBg"
app:layout_constraintBottom_toBottomOf="@id/viewSeatStatusBg"
android:textOff=""
android:textOn=""
/>
<View
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_118"
app:layout_constraintTop_toTopOf="@id/viewSeatStatusBg"
app:layout_constraintLeft_toLeftOf="@id/viewSeatStatusBg"
app:layout_constraintRight_toRightOf="@id/viewSeatStatusBg"
android:layout_marginTop="@dimen/dp_105"
android:background="@drawable/icon_central_control"
/>
<ImageView
android:id="@+id/ivLineToRight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/viewVehicleModeBg"
app:layout_constraintRight_toRightOf="parent"
android:src="@drawable/exam_line_to_right_selector"
android:layout_marginTop="@dimen/dp_40"
android:layout_marginRight="@dimen/dp_47"
android:contentDescription="@string/exam_line_to_right"
/>
<ImageView
android:id="@+id/ivLineToLeft"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/ivLineToRight"
app:layout_constraintBottom_toBottomOf="@id/ivLineToRight"
app:layout_constraintRight_toLeftOf="@id/ivLineToRight"
android:src="@drawable/exam_line_to_left_selector"
android:contentDescription="@string/exam_line_to_left"
/>
<ImageView
android:id="@+id/ivOverTake"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintRight_toRightOf="@id/ivLineToRight"
app:layout_constraintTop_toBottomOf="@id/ivLineToRight"
android:src="@drawable/exam_over_take_selector"
android:contentDescription="@string/exam_over_take"
/>
<ImageView
android:id="@+id/ivPullOver"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/ivOverTake"
app:layout_constraintBottom_toBottomOf="@id/ivOverTake"
app:layout_constraintRight_toLeftOf="@id/ivOverTake"
android:src="@drawable/exam_pull_over_selector"
android:contentDescription="@string/exam_pull_over"
/>
<ImageView
android:id="@+id/ivTakeOverRecover"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintRight_toRightOf="@id/ivOverTake"
app:layout_constraintTop_toBottomOf="@id/ivOverTake"
android:src="@drawable/exam_take_over_recover_selector"
android:contentDescription="@string/exam_take_over_recover"
/>
<ImageView
android:id="@+id/ivTakeOverRequest"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/ivTakeOverRecover"
app:layout_constraintBottom_toBottomOf="@id/ivTakeOverRecover"
app:layout_constraintRight_toLeftOf="@id/ivTakeOverRecover"
android:src="@drawable/exam_take_over_request_selector"
android:contentDescription="@string/exam_take_over_request"
/>
<ImageView
android:id="@+id/ivEmergencyStop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:src="@drawable/exam_emergency_stop_selector"
android:contentDescription="@string/exam_emergency_stop"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingDefaultResource">
<color name="exam_text_color" >#D5D5D5</color>
</resources>

View File

@@ -16,4 +16,21 @@
<string name="work_order_type_environment">环境</string>
<string name="work_order_type_other">其他</string>
<string name="exam_vehicle_control">车辆控制</string>
<string name="exam_vehicle_mode">车辆模式</string>
<string name="exam_line_change">障碍物</string>
<string name="exam_aeb">制动</string>
<string name="exam_map_speed">限速</string>
<string name="exam_ramp">环岛</string>
<string name="exam_stop_yield">停车</string>
<string name="exam_seat_status">乘坐状态</string>
<string name="exam_line_to_left">左变道</string>
<string name="exam_line_to_right">右变道</string>
<string name="exam_pull_over">路边停车</string>
<string name="exam_over_take">超车</string>
<string name="exam_take_over_request">接管请求</string>
<string name="exam_take_over_recover">恢复自驾</string>
<string name="exam_emergency_stop">应急停车</string>
<string name="exam_close">关闭考试车辆控制</string>
</resources>

View File

@@ -117,6 +117,11 @@ interface IDevaToolsProvider : IProvider {
*/
fun initAiCollect(view: View)
/**
* 展示考试车辆控制窗口
*/
fun showExamControlWindow(view: View)
/**
* 当工控机回调时调用
*/

View File

@@ -157,6 +157,13 @@ object CallerDevaToolsManager {
devaToolsProviderApi?.initAiCollect(view)
}
/**
* 展示考试车辆控制窗口
*/
fun showExamControlWindow(view: View){
devaToolsProviderApi?.showExamControlWindow(view)
}
/**
* 收到工控机回调时触发
*/

View File

@@ -1032,6 +1032,7 @@
<dimen name="dp_1090">1090dp</dimen>
<dimen name="dp_1092">1092dp</dimen>
<dimen name="dp_1100">1100dp</dimen>
<dimen name="dp_1114">1114dp</dimen>
<dimen name="dp_1125">1125dp</dimen>
<dimen name="dp_1170">1170dp</dimen>
<dimen name="dp_1200">1200dp</dimen>