[6.7.2]考试面板增加故障告警模拟
This commit is contained in:
@@ -1461,4 +1461,20 @@ class MoGoAutopilotControlProvider :
|
||||
return AdasManager.getInstance().getNodeStateInfo(name)
|
||||
}
|
||||
|
||||
override fun sendFrontCamera30Cmd(isStart: Boolean): Boolean {
|
||||
return AdasManager.getInstance().sendFrontCamera30Cmd(isStart)>-1
|
||||
}
|
||||
|
||||
override fun sendLidarCmd(isStart: Boolean): Boolean {
|
||||
return AdasManager.getInstance().sendLidarCmd(isStart)> -1
|
||||
}
|
||||
|
||||
override fun sendLeftFrontRadarCmd(isStart: Boolean): Boolean {
|
||||
return AdasManager.getInstance().sendLeftFrontRadarCmd(isStart)>-1
|
||||
}
|
||||
|
||||
override fun sendSimulationWireFailure(isTrigger: Boolean): Boolean {
|
||||
return AdasManager.getInstance().sendSimulationWireFailure(isTrigger)>-1
|
||||
}
|
||||
|
||||
}
|
||||
@@ -63,6 +63,14 @@ class ExamControlWindow constructor(activity: Activity): View.OnTouchListener{
|
||||
private lateinit var tvRamp: TextView //环岛文字
|
||||
private lateinit var tbStopYield: ToggleButton //停车图标
|
||||
private lateinit var tvStopYield: TextView //停车文字
|
||||
private lateinit var ivCameraFault: ImageView //摄像头故障
|
||||
private lateinit var ivCameraReset: ImageView //摄像头恢复
|
||||
private lateinit var ivLidarFault: ImageView //激光雷达故障
|
||||
private lateinit var ivLidarReset: ImageView //激光雷达恢复
|
||||
private lateinit var ivRadarFault: ImageView //毫米波雷达故障
|
||||
private lateinit var ivRadarReset: ImageView //毫米波雷达恢复
|
||||
private lateinit var ivWireFault: ImageView //线控故障
|
||||
private lateinit var ivWireReset: ImageView //线控恢复
|
||||
private lateinit var tbSeatMainDriver: ToggleButton //主驾
|
||||
private lateinit var tbSeatPassenger: ToggleButton //副驾
|
||||
private lateinit var tbSeatRear: ToggleButton //乘客
|
||||
@@ -89,8 +97,8 @@ class ExamControlWindow constructor(activity: Activity): View.OnTouchListener{
|
||||
it.format = PixelFormat.RGBA_8888
|
||||
it.flags = WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
|
||||
it.gravity = Gravity.START or Gravity.TOP
|
||||
it.width = 906
|
||||
it.height = 1176
|
||||
it.width = 933
|
||||
it.height = 1489
|
||||
it.alpha = 1.0f
|
||||
}
|
||||
}
|
||||
@@ -107,6 +115,14 @@ class ExamControlWindow constructor(activity: Activity): View.OnTouchListener{
|
||||
tvRamp = mFloatLayout.findViewById(R.id.tvRamp)
|
||||
tbStopYield = mFloatLayout.findViewById(R.id.tbStopYield)
|
||||
tvStopYield = mFloatLayout.findViewById(R.id.tvStopYield)
|
||||
ivCameraFault = mFloatLayout.findViewById(R.id.ivCameraFault)
|
||||
ivCameraReset = mFloatLayout.findViewById(R.id.ivCameraReset)
|
||||
ivLidarFault = mFloatLayout.findViewById(R.id.ivLidarFault)
|
||||
ivLidarReset = mFloatLayout.findViewById(R.id.ivLidarReset)
|
||||
ivRadarFault = mFloatLayout.findViewById(R.id.ivRadarFault)
|
||||
ivRadarReset = mFloatLayout.findViewById(R.id.ivRadarReset)
|
||||
ivWireFault = mFloatLayout.findViewById(R.id.ivWireFault)
|
||||
ivWireReset = mFloatLayout.findViewById(R.id.ivWireReset)
|
||||
tbSeatMainDriver = mFloatLayout.findViewById(R.id.tbSeatMainDriver)
|
||||
tbSeatPassenger = mFloatLayout.findViewById(R.id.tbSeatPassenger)
|
||||
tbSeatRear = mFloatLayout.findViewById(R.id.tbSeatRear)
|
||||
@@ -166,6 +182,38 @@ class ExamControlWindow constructor(activity: Activity): View.OnTouchListener{
|
||||
tvStopYield.setOnClickListener {
|
||||
tbStopYield.performClick()
|
||||
}
|
||||
//摄像头故障
|
||||
ivCameraFault.setOnClickListener {
|
||||
CallerAutoPilotControlManager.sendFrontCamera30Cmd(false)
|
||||
}
|
||||
//摄像头恢复
|
||||
ivCameraReset.setOnClickListener {
|
||||
CallerAutoPilotControlManager.sendFrontCamera30Cmd(true)
|
||||
}
|
||||
//激光雷达故障
|
||||
ivLidarFault.setOnClickListener {
|
||||
CallerAutoPilotControlManager.sendLidarCmd(false)
|
||||
}
|
||||
//激光雷达恢复
|
||||
ivLidarReset.setOnClickListener {
|
||||
CallerAutoPilotControlManager.sendLidarCmd(true)
|
||||
}
|
||||
//毫米波雷达故障
|
||||
ivRadarFault.setOnClickListener {
|
||||
CallerAutoPilotControlManager.sendLeftFrontRadarCmd(false)
|
||||
}
|
||||
//毫米波雷达恢复
|
||||
ivRadarReset.setOnClickListener {
|
||||
CallerAutoPilotControlManager.sendLeftFrontRadarCmd(true)
|
||||
}
|
||||
//线控故障
|
||||
ivWireFault.setOnClickListener {
|
||||
CallerAutoPilotControlManager.sendSimulationWireFailure(true)
|
||||
}
|
||||
//线控恢复
|
||||
ivWireReset.setOnClickListener {
|
||||
CallerAutoPilotControlManager.sendSimulationWireFailure(false)
|
||||
}
|
||||
//向左变道
|
||||
ivLineToLeft.setOnClickListener{
|
||||
CallerAutoPilotControlManager.sendPlanningLineChangeCmd(1)
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 5.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 928 KiB After Width: | Height: | Size: 1.1 MiB |
@@ -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_exam_fault_reset_normal" android:state_pressed="false"/>
|
||||
<item android:drawable="@drawable/icon_exam_fault_reset_pressed" android:state_pressed="true"/>
|
||||
</selector>
|
||||
@@ -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_exam_fault_normal" android:state_pressed="false"/>
|
||||
<item android:drawable="@drawable/icon_exam_fault_pressed" android:state_pressed="true"/>
|
||||
</selector>
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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_906"
|
||||
android:layout_height="@dimen/dp_1176"
|
||||
android:layout_width="@dimen/dp_933"
|
||||
android:layout_height="@dimen/dp_1489"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@drawable/bg_exam_control">
|
||||
|
||||
@@ -180,14 +180,181 @@
|
||||
android:textColor="@color/exam_text_color"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/viewFaultBg"
|
||||
android:layout_width="@dimen/dp_750"
|
||||
android:layout_height="@dimen/dp_292"
|
||||
android:background="@drawable/bg_exam_vehicle_mode"
|
||||
app:layout_constraintTop_toBottomOf="@id/viewVehicleModeBg"
|
||||
app:layout_constraintLeft_toLeftOf="@id/viewVehicleModeBg"
|
||||
app:layout_constraintRight_toRightOf="@id/viewVehicleModeBg"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="@id/viewFaultBg"
|
||||
app:layout_constraintRight_toRightOf="@id/viewFaultBg"
|
||||
app:layout_constraintTop_toTopOf="@id/viewFaultBg"
|
||||
android:text="@string/exam_fault_alarm"
|
||||
android:textColor="@color/exam_text_color"
|
||||
android:textSize="@dimen/sp_30"
|
||||
android:layout_marginTop="@dimen/dp_22"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivCameraFault"
|
||||
android:layout_width="@dimen/dp_146"
|
||||
android:layout_height="@dimen/dp_64"
|
||||
app:layout_constraintTop_toTopOf="@id/viewFaultBg"
|
||||
app:layout_constraintLeft_toLeftOf="@id/viewFaultBg"
|
||||
android:layout_marginTop="@dimen/dp_81"
|
||||
android:layout_marginLeft="@dimen/dp_40"
|
||||
android:src="@drawable/exam_fault_trigger"
|
||||
android:contentDescription="@string/exam_fault_camera"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivCameraReset"
|
||||
android:layout_width="@dimen/dp_146"
|
||||
android:layout_height="@dimen/dp_64"
|
||||
app:layout_constraintLeft_toLeftOf="@id/ivCameraFault"
|
||||
app:layout_constraintRight_toRightOf="@id/ivCameraFault"
|
||||
app:layout_constraintTop_toBottomOf="@id/ivCameraFault"
|
||||
android:src="@drawable/exam_fault_reset"
|
||||
android:contentDescription="@string/exam_fault_camera"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="@id/ivCameraFault"
|
||||
app:layout_constraintRight_toRightOf="@id/ivCameraFault"
|
||||
app:layout_constraintTop_toBottomOf="@id/ivCameraReset"
|
||||
android:text="@string/exam_fault_camera"
|
||||
android:textColor="@color/exam_text_color"
|
||||
android:textSize="@dimen/sp_26"
|
||||
android:layout_marginTop="@dimen/dp_17"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivLidarFault"
|
||||
android:layout_width="@dimen/dp_146"
|
||||
android:layout_height="@dimen/dp_64"
|
||||
app:layout_constraintTop_toTopOf="@id/viewFaultBg"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivCameraFault"
|
||||
android:layout_marginTop="@dimen/dp_81"
|
||||
android:layout_marginLeft="@dimen/dp_28"
|
||||
android:src="@drawable/exam_fault_trigger"
|
||||
android:contentDescription="@string/exam_fault_lidar"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivLidarReset"
|
||||
android:layout_width="@dimen/dp_146"
|
||||
android:layout_height="@dimen/dp_64"
|
||||
app:layout_constraintLeft_toLeftOf="@id/ivLidarFault"
|
||||
app:layout_constraintRight_toRightOf="@id/ivLidarFault"
|
||||
app:layout_constraintTop_toBottomOf="@id/ivLidarFault"
|
||||
android:src="@drawable/exam_fault_reset"
|
||||
android:contentDescription="@string/exam_fault_lidar"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/ivLidarReset"
|
||||
app:layout_constraintLeft_toLeftOf="@id/ivLidarReset"
|
||||
app:layout_constraintRight_toRightOf="@id/ivLidarReset"
|
||||
android:text="@string/exam_fault_lidar"
|
||||
android:textColor="@color/exam_text_color"
|
||||
android:textSize="@dimen/sp_26"
|
||||
android:layout_marginTop="@dimen/dp_17"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivRadarFault"
|
||||
android:layout_width="@dimen/dp_146"
|
||||
android:layout_height="@dimen/dp_64"
|
||||
app:layout_constraintTop_toTopOf="@id/viewFaultBg"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivLidarFault"
|
||||
android:layout_marginTop="@dimen/dp_81"
|
||||
android:layout_marginLeft="@dimen/dp_28"
|
||||
android:src="@drawable/exam_fault_trigger"
|
||||
android:contentDescription="@string/exam_fault_radar"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivRadarReset"
|
||||
android:layout_width="@dimen/dp_146"
|
||||
android:layout_height="@dimen/dp_64"
|
||||
app:layout_constraintLeft_toLeftOf="@id/ivRadarFault"
|
||||
app:layout_constraintRight_toRightOf="@id/ivRadarFault"
|
||||
app:layout_constraintTop_toBottomOf="@id/ivRadarFault"
|
||||
android:src="@drawable/exam_fault_reset"
|
||||
android:contentDescription="@string/exam_fault_radar"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/ivRadarReset"
|
||||
app:layout_constraintLeft_toLeftOf="@id/ivRadarReset"
|
||||
app:layout_constraintRight_toRightOf="@id/ivRadarReset"
|
||||
android:text="@string/exam_fault_radar"
|
||||
android:textColor="@color/exam_text_color"
|
||||
android:textSize="@dimen/sp_26"
|
||||
android:layout_marginTop="@dimen/dp_17"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivWireFault"
|
||||
android:layout_width="@dimen/dp_146"
|
||||
android:layout_height="@dimen/dp_64"
|
||||
app:layout_constraintTop_toTopOf="@id/viewFaultBg"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivRadarFault"
|
||||
android:layout_marginTop="@dimen/dp_81"
|
||||
android:layout_marginLeft="@dimen/dp_28"
|
||||
android:src="@drawable/exam_fault_trigger"
|
||||
android:contentDescription="@string/exam_fault_wire"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivWireReset"
|
||||
android:layout_width="@dimen/dp_146"
|
||||
android:layout_height="@dimen/dp_64"
|
||||
app:layout_constraintLeft_toLeftOf="@id/ivWireFault"
|
||||
app:layout_constraintRight_toRightOf="@id/ivWireFault"
|
||||
app:layout_constraintTop_toBottomOf="@id/ivWireFault"
|
||||
android:src="@drawable/exam_fault_reset"
|
||||
android:contentDescription="@string/exam_fault_wire"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/ivWireReset"
|
||||
app:layout_constraintLeft_toLeftOf="@id/ivWireReset"
|
||||
app:layout_constraintRight_toRightOf="@id/ivWireReset"
|
||||
android:text="@string/exam_fault_wire"
|
||||
android:textColor="@color/exam_text_color"
|
||||
android:textSize="@dimen/sp_26"
|
||||
android:layout_marginTop="@dimen/dp_17"
|
||||
/>
|
||||
|
||||
<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_constraintTop_toBottomOf="@id/viewFaultBg"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:layout_marginLeft="@dimen/dp_78"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:layout_marginLeft="@dimen/dp_92"
|
||||
android:background="@drawable/bg_exam_seat_status"
|
||||
/>
|
||||
|
||||
@@ -255,11 +422,11 @@
|
||||
android:id="@+id/ivLineToRight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/viewVehicleModeBg"
|
||||
app:layout_constraintTop_toBottomOf="@id/viewFaultBg"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:src="@drawable/exam_line_to_right_selector"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:layout_marginRight="@dimen/dp_78"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:layout_marginRight="@dimen/dp_92"
|
||||
android:contentDescription="@string/exam_line_to_right"
|
||||
/>
|
||||
|
||||
|
||||
@@ -23,6 +23,11 @@
|
||||
<string name="exam_map_speed">限速</string>
|
||||
<string name="exam_ramp">环岛</string>
|
||||
<string name="exam_stop_yield">停车</string>
|
||||
<string name="exam_fault_alarm">故障告警</string>
|
||||
<string name="exam_fault_camera">摄像头</string>
|
||||
<string name="exam_fault_lidar">激光雷达</string>
|
||||
<string name="exam_fault_radar">毫米波雷达</string>
|
||||
<string name="exam_fault_wire">线控</string>
|
||||
<string name="exam_seat_status">乘坐状态</string>
|
||||
<string name="exam_line_to_left">左变道</string>
|
||||
<string name="exam_line_to_right">右变道</string>
|
||||
|
||||
@@ -679,4 +679,28 @@ interface IMoGoAutopilotControlProvider : IMoGoFunctionServerProvider {
|
||||
*/
|
||||
fun getNodeStateInfo(name: AdasConstants.NodeName): NodeStateInfo
|
||||
|
||||
/**
|
||||
* 摄像头故障模拟
|
||||
* @param isStart false故障 true恢复
|
||||
*/
|
||||
fun sendFrontCamera30Cmd(isStart: Boolean): Boolean
|
||||
|
||||
/**
|
||||
* 激光雷达故障模拟
|
||||
* @param isStart false故障 true恢复
|
||||
*/
|
||||
fun sendLidarCmd(isStart: Boolean): Boolean
|
||||
|
||||
/**
|
||||
* 毫米波雷达故障模拟
|
||||
* @param isStart false故障 true恢复
|
||||
*/
|
||||
fun sendLeftFrontRadarCmd(isStart: Boolean): Boolean
|
||||
|
||||
/**
|
||||
* 线控失效故障模拟
|
||||
* @param isTrigger false故障 true恢复
|
||||
*/
|
||||
fun sendSimulationWireFailure(isTrigger: Boolean): Boolean
|
||||
|
||||
}
|
||||
@@ -1029,4 +1029,37 @@ object CallerAutoPilotControlManager {
|
||||
fun getNodeStateInfo(name: AdasConstants.NodeName): NodeStateInfo? {
|
||||
return providerApi?.getNodeStateInfo(name)
|
||||
}
|
||||
|
||||
/**
|
||||
* 摄像头故障模拟
|
||||
* @param isStart false故障 true恢复
|
||||
*/
|
||||
fun sendFrontCamera30Cmd(isStart: Boolean): Boolean{
|
||||
return providerApi?.sendFrontCamera30Cmd(isStart)?: false
|
||||
}
|
||||
|
||||
/**
|
||||
* 激光雷达故障模拟
|
||||
* @param isStart false故障 true恢复
|
||||
*/
|
||||
fun sendLidarCmd(isStart: Boolean): Boolean{
|
||||
return providerApi?.sendLidarCmd(isStart)?:false
|
||||
}
|
||||
|
||||
/**
|
||||
* 毫米波雷达故障模拟
|
||||
* @param isStart false故障 true恢复
|
||||
*/
|
||||
fun sendLeftFrontRadarCmd(isStart: Boolean): Boolean{
|
||||
return providerApi?.sendLeftFrontRadarCmd(isStart)?:false
|
||||
}
|
||||
|
||||
/**
|
||||
* 线控失效故障模拟
|
||||
* @param isTrigger false故障 true恢复
|
||||
*/
|
||||
fun sendSimulationWireFailure(isTrigger: Boolean): Boolean{
|
||||
return providerApi?.sendSimulationWireFailure(isTrigger)?:false
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1061,6 +1061,7 @@
|
||||
<dimen name="dp_1306">1306dp</dimen>
|
||||
<dimen name="dp_1373">1373dp</dimen>
|
||||
<dimen name="dp_1386">1386dp</dimen>
|
||||
<dimen name="dp_1489">1489dp</dimen>
|
||||
<dimen name="dp_1528">1550dp</dimen>
|
||||
<dimen name="dp_1600">1600dp</dimen>
|
||||
<dimen name="dp_1860">1860dp</dimen>
|
||||
|
||||
Reference in New Issue
Block a user