[6.4.4]运营面板增加冷启动进度视图是否展示控制开关
This commit is contained in:
@@ -57,6 +57,7 @@ import kotlinx.android.synthetic.main.view_sop_setting.view.rgFusionMode
|
||||
import kotlinx.android.synthetic.main.view_sop_setting.view.rgPullTime
|
||||
import kotlinx.android.synthetic.main.view_sop_setting.view.scCarAperture
|
||||
import kotlinx.android.synthetic.main.view_sop_setting.view.scCarUnionTrafficLight
|
||||
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.scFaultSlowDown
|
||||
@@ -681,6 +682,14 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
HmiBuildConfig.isShowCarSourceTrafficLightView = isChecked
|
||||
}
|
||||
|
||||
//系统启动状态展示
|
||||
scConnectionSwitch.isChecked = HmiBuildConfig.isShowConnectionProgressView
|
||||
scConnectionSwitch.setOnCheckedChangeListener { _, isChecked ->
|
||||
hmiAction("SOP 系统启动状态展示, ", isChecked)
|
||||
HmiBuildConfig.isShowConnectionProgressView = isChecked
|
||||
CallerHmiViewControlListenerManager.updateConnectionProgressView(isChecked)
|
||||
}
|
||||
|
||||
//限速标识
|
||||
scSpeedLimit.isChecked = HmiBuildConfig.isShowLimitingVelocityView
|
||||
scSpeedLimit.setOnCheckedChangeListener { _, isChecked ->
|
||||
|
||||
@@ -8,8 +8,11 @@ import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.isVisible
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.zhjt.mogo.adas.data.AdasConstants
|
||||
@@ -30,7 +33,8 @@ class ConnectionProcessView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoAutopilotStatusListener{
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoAutopilotStatusListener,
|
||||
IViewControlListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "ConnectionProcessView"
|
||||
@@ -64,43 +68,57 @@ class ConnectionProcessView @JvmOverloads constructor(
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
CallerHmiViewControlListenerManager.addListener(TAG,this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
CallerHmiViewControlListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
override fun updateConnectionProgressView(visible: Boolean) {
|
||||
if(visible){
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
}else{
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
//隐藏视图
|
||||
dismissConnectionView()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotIpcConnectStatusChanged(
|
||||
status: AdasConstants.IpcConnectionStatus,
|
||||
reason: String?
|
||||
) {
|
||||
if(status == AdasConstants.IpcConnectionStatus.CONNECTED){
|
||||
//域控连接成功
|
||||
if(CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().ssmAutoPilotReady){
|
||||
dismissConnectionView()
|
||||
}else{
|
||||
if(isFirstTimeConnect || isDisconnectTimeout){
|
||||
connectIPCSuccess()
|
||||
ssmConnectStatus = false
|
||||
autopilotReadyStatus = false
|
||||
if(HmiBuildConfig.isShowConnectionProgressView){
|
||||
if(status == AdasConstants.IpcConnectionStatus.CONNECTED){
|
||||
//域控连接成功
|
||||
if(CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().ssmAutoPilotReady){
|
||||
dismissConnectionView()
|
||||
}else{
|
||||
if(isFirstTimeConnect || isDisconnectTimeout){
|
||||
connectIPCSuccess()
|
||||
ssmConnectStatus = false
|
||||
autopilotReadyStatus = false
|
||||
}
|
||||
}
|
||||
isDisconnectTimeout = false
|
||||
disconnectTimer?.cancel()
|
||||
disconnectTimer = null
|
||||
}else{
|
||||
if(ipcConnectStatus && disconnectTimer == null && !isDisconnectTimeout){
|
||||
//域控断连1分钟超时倒计时
|
||||
disconnectCountDown()
|
||||
//如果SSM或者冷启动倒计时已经启动则取消
|
||||
connectSSMTimer?.cancel()
|
||||
autopilotReadyTimer?.cancel()
|
||||
}
|
||||
if(ipcConnectStatus && this.isVisible){
|
||||
showIPCConnectFailView()
|
||||
}
|
||||
ipcConnectStatus = false
|
||||
}
|
||||
isDisconnectTimeout = false
|
||||
disconnectTimer?.cancel()
|
||||
disconnectTimer = null
|
||||
}else{
|
||||
if(ipcConnectStatus && disconnectTimer == null && !isDisconnectTimeout){
|
||||
//域控断连1分钟超时倒计时
|
||||
disconnectCountDown()
|
||||
//如果SSM或者冷启动倒计时已经启动则取消
|
||||
connectSSMTimer?.cancel()
|
||||
autopilotReadyTimer?.cancel()
|
||||
}
|
||||
if(ipcConnectStatus && this.isVisible){
|
||||
showIPCConnectFailView()
|
||||
}
|
||||
ipcConnectStatus = false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,11 +128,13 @@ class ConnectionProcessView @JvmOverloads constructor(
|
||||
* HQ、M1 MAP350开始弃用,其他车型MAP360开始弃用
|
||||
*/
|
||||
override fun onAutopilotStatusRespByQuery(status: SystemStatusInfo.StatusInfo) {
|
||||
//SSM连接成功
|
||||
connectSSMSuccess()
|
||||
//冷启动成功
|
||||
if(status.autoPilotReady){
|
||||
autopilotReady()
|
||||
if(HmiBuildConfig.isShowConnectionProgressView){
|
||||
//SSM连接成功
|
||||
connectSSMSuccess()
|
||||
//冷启动成功
|
||||
if(status.autoPilotReady){
|
||||
autopilotReady()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,11 +145,13 @@ class ConnectionProcessView @JvmOverloads constructor(
|
||||
* @param statusInf 数据
|
||||
*/
|
||||
override fun onSystemStatus(statusInf: SsmInfo.SsmStatusInf) {
|
||||
//SSM连接成功
|
||||
connectSSMSuccess()
|
||||
//冷启动成功
|
||||
if(statusInf.autoPilotReady){
|
||||
autopilotReady()
|
||||
if(HmiBuildConfig.isShowConnectionProgressView){
|
||||
//SSM连接成功
|
||||
connectSSMSuccess()
|
||||
//冷启动成功
|
||||
if(statusInf.autoPilotReady){
|
||||
autopilotReady()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -785,6 +785,20 @@
|
||||
app:layout_constraintRight_toRightOf="@id/scIPCReport"
|
||||
app:layout_constraintTop_toBottomOf="@id/scIPCReport" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/scConnectionSwitch"
|
||||
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:checked="true"
|
||||
android:text="系统启动状态展示"
|
||||
app:layout_constraintLeft_toLeftOf="@id/scWeatherSwitch"
|
||||
app:layout_constraintRight_toRightOf="@id/scWeatherSwitch"
|
||||
app:layout_constraintTop_toBottomOf="@id/scWeatherSwitch"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/llMFLayout"
|
||||
android:layout_width="0dip"
|
||||
@@ -797,7 +811,7 @@
|
||||
android:padding="5dip"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/scWeatherSwitch">
|
||||
app:layout_constraintTop_toBottomOf="@+id/scConnectionSwitch">
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.setting.StateViewLayout
|
||||
android:id="@+id/mfStatusLayout"
|
||||
|
||||
@@ -30,6 +30,13 @@ object HmiBuildConfig {
|
||||
@Volatile
|
||||
var isShowCarSourceTrafficLightView = false
|
||||
|
||||
/**
|
||||
* 是否展示系统启动状态展示视图,默认展示 true展示 false不展示
|
||||
*/
|
||||
@JvmField
|
||||
@Volatile
|
||||
var isShowConnectionProgressView = true
|
||||
|
||||
/**
|
||||
* 是否展示 sn绑定的弹框
|
||||
*/
|
||||
|
||||
@@ -33,6 +33,11 @@ interface IViewControlListener {
|
||||
*/
|
||||
fun updateStatusBarLeftView(insert: Boolean, tag: String, viewGroup: ViewGroup){}
|
||||
|
||||
/**
|
||||
* 是否展示系统启动状态视图
|
||||
*/
|
||||
fun updateConnectionProgressView(visible: Boolean){}
|
||||
|
||||
/**
|
||||
* 更新(添加/删除)下载进度
|
||||
*/
|
||||
|
||||
@@ -53,4 +53,11 @@ object CallerHmiViewControlListenerManager : CallerBase<IViewControlListener>()
|
||||
M_LISTENERS[tag]?.updateStatusBarDownloadView(insert, tag, progress)
|
||||
}
|
||||
|
||||
fun updateConnectionProgressView(visible: Boolean){
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.updateConnectionProgressView(visible)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user