[6.6.0]运营面板-与车相关类增加考试功能面板开关
This commit is contained in:
@@ -422,8 +422,8 @@ class DevaToolsProvider : IDevaToolsProvider, IAppStateListener {
|
||||
/**
|
||||
* 展示考试车辆控制窗口
|
||||
*/
|
||||
override fun showExamControlWindow(view: View) {
|
||||
ExamControlManager.showExamControlWindow(view)
|
||||
override fun showExamControlWindow(view: View,isShow: Boolean) {
|
||||
ExamControlManager.showExamControlWindow(view,isShow)
|
||||
}
|
||||
|
||||
override fun onReceiveBadCaseRecord(
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.zhjt.mogo_core_function_devatools.exam
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.view.View
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSopSettingManager
|
||||
import com.mogo.eagle.core.utilcode.util.ClickUtils
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
@@ -12,43 +14,31 @@ import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
||||
*/
|
||||
internal object ExamControlManager {
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
var examControlWindow: ExamControlWindow ?= null
|
||||
|
||||
/**
|
||||
* 开启考试车辆控制窗口
|
||||
*/
|
||||
fun showExamControlWindow(view: View){
|
||||
fun showExamControlWindow(view: View,isShow: Boolean){
|
||||
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("网络异常,请检查网络")
|
||||
if(examControlWindow == null){
|
||||
examControlWindow = ExamControlWindow(activity)
|
||||
}
|
||||
if(isShow){
|
||||
examControlWindow?.setClickListener(object: ExamControlWindow.ClickListener{
|
||||
override fun closeWindow() {
|
||||
examControlWindow?.hideWindow()
|
||||
examControlWindow = null
|
||||
//通知运营面板关闭按钮
|
||||
CallerSopSettingManager.invokeExamControlListener(false)
|
||||
}
|
||||
}else{
|
||||
ToastUtils.showShort("请勿连续点击,稍后再试")
|
||||
}
|
||||
})
|
||||
examControlWindow?.showWindow()
|
||||
}else{
|
||||
examControlWindow?.hideWindow()
|
||||
examControlWindow = null
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ class ExamControlWindow constructor(activity: Activity): View.OnTouchListener{
|
||||
ivEmergencyStop = mFloatLayout.findViewById(R.id.ivEmergencyStop)
|
||||
//关闭按钮
|
||||
ivCloseExam.setOnClickListener {
|
||||
hideWindow()
|
||||
clickListener?.closeWindow()
|
||||
}
|
||||
//绕障开关
|
||||
tbLaneChange.isChecked = SPUtils.getInstance().getBoolean("lane_change",false)
|
||||
|
||||
@@ -61,6 +61,7 @@ import kotlinx.android.synthetic.main.view_sop_setting.view.scCarUnionTrafficLig
|
||||
import kotlinx.android.synthetic.main.view_sop_setting.view.scConnectionSwitch
|
||||
import kotlinx.android.synthetic.main.view_sop_setting.view.scDemoMode
|
||||
import kotlinx.android.synthetic.main.view_sop_setting.view.scDrawPointCloudData
|
||||
import kotlinx.android.synthetic.main.view_sop_setting.view.scExamControl
|
||||
import kotlinx.android.synthetic.main.view_sop_setting.view.scFaultSlowDown
|
||||
import kotlinx.android.synthetic.main.view_sop_setting.view.scGreenWaveSop
|
||||
import kotlinx.android.synthetic.main.view_sop_setting.view.scIPCReport
|
||||
@@ -593,6 +594,15 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
hmiAction("SOP 故障减速停车, ", isChecked)
|
||||
clickEventAnalytics("故障减速停车",isChecked)
|
||||
}
|
||||
//考试功能面板
|
||||
scExamControl.isChecked = FunctionBuildConfig.isShowExamWindow
|
||||
scExamControl.setOnCheckedChangeListener { _, isChecked ->
|
||||
FunctionBuildConfig.isShowExamWindow = isChecked
|
||||
CallerDevaToolsManager.showExamControlWindow(this,isChecked)
|
||||
hmiAction("SOP 考试功能面板, ", isChecked)
|
||||
clickEventAnalytics("考试功能面板",isChecked)
|
||||
}
|
||||
|
||||
//融合模式
|
||||
rgFusionMode.setOnCheckedChangeListener { _, p1 ->
|
||||
when (p1) {
|
||||
@@ -1082,6 +1092,13 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
scRainMode.isChecked = status
|
||||
}
|
||||
|
||||
/**
|
||||
* 考试功能面板
|
||||
*/
|
||||
override fun onExamControlClickEvent(status: Boolean) {
|
||||
scExamControl.isChecked = status
|
||||
}
|
||||
|
||||
/**
|
||||
* 点云模式
|
||||
*/
|
||||
|
||||
@@ -493,6 +493,22 @@
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="@id/vehicleGuideLine"
|
||||
app:layout_constraintTop_toBottomOf="@id/scRainMode" />
|
||||
|
||||
<!--考试功能面板-->
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/scExamControl"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_25"
|
||||
android:scaleX="1.2"
|
||||
android:scaleY="1.2"
|
||||
android:text="考试功能面板"
|
||||
android:textSize="@dimen/sp_28"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="@id/vehicleGuideLine"
|
||||
app:layout_constraintTop_toBottomOf="@id/scFaultSlowDown"
|
||||
/>
|
||||
|
||||
<!--融合模式切换器-->
|
||||
<RadioGroup
|
||||
android:id="@+id/rgFusionMode"
|
||||
@@ -503,7 +519,7 @@
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/scFaultSlowDown">
|
||||
app:layout_constraintTop_toBottomOf="@id/scExamControl">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbFullIntegration"
|
||||
|
||||
Reference in New Issue
Block a user