[6.1.0]运营面板修改
This commit is contained in:
@@ -4,6 +4,7 @@ import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
@@ -28,6 +29,7 @@ import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
|
||||
import com.mogo.eagle.core.function.hmi.ui.utils.HmiActionLog.Companion.hmiAction
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.zhjt.mogo.adas.data.AdasConstants
|
||||
import com.zhjt.mogo.adas.data.bean.AdasParam
|
||||
import kotlinx.android.synthetic.main.view_sop_setting.view.*
|
||||
@@ -338,6 +340,91 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
hmiAction("SOP 是否展示被动触发的录包弹窗, ",isChecked)
|
||||
}
|
||||
|
||||
//变道绕障的目标障碍物速度阈值
|
||||
tvSpeed.text = "${FunctionBuildConfig.detouringSpeed} m/s"
|
||||
ivSpeedReduce.setOnClickListener {
|
||||
if (FunctionBuildConfig.detouringSpeed <= 3) {
|
||||
ToastUtils.showShort("阈值最小可为3 m/s")
|
||||
} else {
|
||||
FunctionBuildConfig.detouringSpeed--
|
||||
tvSpeed.text = "${FunctionBuildConfig.detouringSpeed} m/s"
|
||||
}
|
||||
hmiAction("SOP 变道绕障的目标障碍物速度阈值",FunctionBuildConfig.detouringSpeed)
|
||||
}
|
||||
ivSpeedAdd.setOnClickListener {
|
||||
if (FunctionBuildConfig.detouringSpeed >= 7) {
|
||||
ToastUtils.showShort("阈值最大可为7 m/s")
|
||||
} else {
|
||||
FunctionBuildConfig.detouringSpeed++
|
||||
tvSpeed.text = "${FunctionBuildConfig.detouringSpeed} m/s"
|
||||
}
|
||||
hmiAction("SOP 变道绕障的目标障碍物速度阈值",FunctionBuildConfig.detouringSpeed)
|
||||
}
|
||||
btnSpeedSet.setOnClickListener {
|
||||
val isSuccess =
|
||||
CallerAutoPilotControlManager.sendDetouringSpeed(FunctionBuildConfig.detouringSpeed.toDouble())
|
||||
if (isSuccess == true) {
|
||||
ToastUtils.showShort("变道绕障的目标障碍物速度阈值设置成功")
|
||||
hmiAction("SOP 变道绕障的目标障碍物速度阈值设置","成功")
|
||||
} else {
|
||||
ToastUtils.showShort("变道绕障的目标障碍物速度阈值设置失败")
|
||||
hmiAction("SOP 变道绕障的目标障碍物速度阈值设置","失败")
|
||||
}
|
||||
}
|
||||
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
tvSpeedThresholdTitle.visibility = View.GONE
|
||||
ivSpeedReduce.visibility = View.GONE
|
||||
tvSpeed.visibility = View.GONE
|
||||
ivSpeedAdd.visibility = View.GONE
|
||||
btnSpeedSet.visibility = View.GONE
|
||||
}
|
||||
|
||||
/**
|
||||
* 魔方sop运营相关配置
|
||||
*/
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
val mf = CallerDevaToolsManager.mofang()
|
||||
if (mf != null) {
|
||||
mfStatusLayout.setClickEnabled(true)
|
||||
mfStatusLayout.setClickedTextAndTag(if (mf.isConnected()) "断开魔方连接" else "开始连接魔方", if (mf.isConnected()) 0 else 1)
|
||||
mf.registerMoFangStatusListener(TAG, this)
|
||||
mfStatusLayout.setOnClickCallback {
|
||||
val tag = it.tag as? Int
|
||||
if (tag == 0) {
|
||||
//断开魔方连接
|
||||
if (!mf.isConnected()) {
|
||||
Toast.makeText(context, "尚未建立连接", Toast.LENGTH_SHORT).show()
|
||||
return@setOnClickCallback
|
||||
}
|
||||
mfStatusLayout.showLoadingView()
|
||||
mfStatusLayout.setLoadingViewText("正在断开魔方连接, 请稍候...")
|
||||
mf.disconnect()
|
||||
}
|
||||
if (tag == 1) {
|
||||
//建立魔方连接
|
||||
if (mf.isConnected()) {
|
||||
Toast.makeText(context, "已连接,不要重复连接", Toast.LENGTH_SHORT).show()
|
||||
return@setOnClickCallback
|
||||
}
|
||||
mf.connect()
|
||||
mfStatusLayout.showLoadingView()
|
||||
mfStatusLayout.setLoadingViewText("正在连接魔方, 请稍候")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mfTest.isEnabled = mf?.isConnected() ?: false
|
||||
mfTest.isChecked = mf?.isEnableTest() ?: false
|
||||
mfTest.setOnCheckedChangeListener { _, isChecked ->
|
||||
mf?.enableTest(isChecked)
|
||||
}
|
||||
} else {
|
||||
mfStatusLayout.setClickEnabled(false)
|
||||
mfTest.isEnabled = false
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -393,34 +480,34 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
scRainMode.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
// FuncBizConfig.BIZ_PNC_WARNING -> {
|
||||
// tbMarkingObstacles.isClickable = !lock
|
||||
// if (lock) {
|
||||
// tbMarkingObstacles.visibility = View.INVISIBLE
|
||||
// } else {
|
||||
// tbMarkingObstacles.visibility = View.VISIBLE
|
||||
// }
|
||||
// }
|
||||
//危险障碍物颜色标记
|
||||
FuncBizConfig.BIZ_PNC_WARNING -> {
|
||||
scMarkingObstacles.isClickable = !lock
|
||||
if (lock) {
|
||||
scMarkingObstacles.visibility = View.INVISIBLE
|
||||
} else {
|
||||
scMarkingObstacles.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onMoFangConnected() {
|
||||
// mfStatusLayout?.also {
|
||||
// it.hideLoadingView()
|
||||
// it.setClickedTextAndTag("断开魔方连接", 0)
|
||||
// mfTest?.isEnabled = true
|
||||
// mfTest?.isChecked = CallerDevaToolsManager.mofang()?.isEnableTest() ?: false
|
||||
// }
|
||||
mfStatusLayout?.also {
|
||||
it.hideLoadingView()
|
||||
it.setClickedTextAndTag("断开魔方连接", 0)
|
||||
mfTest?.isEnabled = true
|
||||
mfTest?.isChecked = CallerDevaToolsManager.mofang()?.isEnableTest() ?: false
|
||||
}
|
||||
}
|
||||
|
||||
override fun onMoFangDisconnected() {
|
||||
// mfStatusLayout?.also {
|
||||
// it.hideLoadingView()
|
||||
// it.setClickedTextAndTag("开始连接魔方", 1)
|
||||
// mfTest?.isEnabled = false
|
||||
// }
|
||||
mfStatusLayout?.also {
|
||||
it.hideLoadingView()
|
||||
it.setClickedTextAndTag("开始连接魔方", 1)
|
||||
mfTest?.isEnabled = false
|
||||
}
|
||||
}
|
||||
|
||||
override fun onMoFangBatteryChanged(battery: Int) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="@dimen/dp_800"
|
||||
android:layout_height="@dimen/dp_1100"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
@@ -592,6 +592,119 @@
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="@dimen/dp_780"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_gravity="center_horizontal"
|
||||
app:cardBackgroundColor="@color/color_FFFFFF"
|
||||
app:cardCornerRadius="@dimen/dp_10"
|
||||
app:cardElevation="@dimen/dp_5"
|
||||
app:cardPreventCornerOverlap="true"
|
||||
app:cardUseCompatPadding="true"
|
||||
app:contentPadding="@dimen/dp_10">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSpeedThresholdTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:text="变道速度阈值:"
|
||||
android:textSize="@dimen/dp_36"
|
||||
android:textColor="#1A1A1A"
|
||||
android:layout_margin="20dp"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivSpeedReduce"
|
||||
android:layout_width="@dimen/dp_64"
|
||||
android:layout_height="@dimen/dp_64"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvSpeedThresholdTitle"
|
||||
app:layout_constraintTop_toTopOf="@id/tvSpeedThresholdTitle"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvSpeedThresholdTitle"
|
||||
android:src="@drawable/icon_reduce"
|
||||
android:padding="10dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSpeed"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toTopOf="@id/ivSpeedReduce"
|
||||
app:layout_constraintBottom_toBottomOf="@id/ivSpeedReduce"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivSpeedReduce"
|
||||
android:textSize="@dimen/dp_36"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/debug_setting_edit_bg"
|
||||
android:paddingStart="15dp"
|
||||
android:paddingEnd="15dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivSpeedAdd"
|
||||
android:layout_width="@dimen/dp_64"
|
||||
android:layout_height="@dimen/dp_64"
|
||||
app:layout_constraintTop_toTopOf="@id/tvSpeed"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvSpeed"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvSpeed"
|
||||
android:src="@drawable/icon_add"
|
||||
android:padding="10dp"
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnSpeedSet"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="@dimen/dp_20"
|
||||
app:layout_constraintTop_toTopOf="@id/ivSpeedAdd"
|
||||
app:layout_constraintBottom_toBottomOf="@id/ivSpeedAdd"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivSpeedAdd"
|
||||
android:text="设置阈值"
|
||||
android:layout_marginStart="10dp"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/llMFLayout"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvSpeedThresholdTitle"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:padding="5dip"
|
||||
android:background="@drawable/bg_mf_sop_operator"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="15dp" >
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.setting.StateViewLayout
|
||||
android:id="@+id/mfStatusLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/mfTest"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="魔方指令测试"
|
||||
android:paddingTop="25dp"
|
||||
android:layout_marginTop="5dip"
|
||||
android:paddingBottom="25dp" />
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
Reference in New Issue
Block a user