From ea7baa99a3a1e3b166b46b9adadb5980f6d439cb Mon Sep 17 00:00:00 2001 From: xuxinchao Date: Thu, 6 Jun 2024 18:32:49 +0800 Subject: [PATCH] =?UTF-8?q?[6.4.4]=E8=BF=90=E8=90=A5=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=86=B7=E5=90=AF=E5=8A=A8=E8=BF=9B=E5=BA=A6?= =?UTF-8?q?=E8=A7=86=E5=9B=BE=E6=98=AF=E5=90=A6=E5=B1=95=E7=A4=BA=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../function/hmi/ui/setting/SOPSettingView.kt | 9 ++ .../hmi/ui/widget/ConnectionProcessView.kt | 92 ++++++++++++------- .../src/main/res/layout/view_sop_setting.xml | 16 +++- .../eagle/core/data/config/HmiBuildConfig.kt | 7 ++ .../api/hmi/view/IViewControlListener.kt | 5 + .../CallerHmiViewControlListenerManager.kt | 7 ++ 6 files changed, 100 insertions(+), 36 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt index 785d0132e3..368e2d6a61 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt @@ -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 -> diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/ConnectionProcessView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/ConnectionProcessView.kt index 194423bc35..cdfd0cc32d 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/ConnectionProcessView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/ConnectionProcessView.kt @@ -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() + } } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_sop_setting.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_sop_setting.xml index 527b115698..c41a080f15 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_sop_setting.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_sop_setting.xml @@ -785,6 +785,20 @@ app:layout_constraintRight_toRightOf="@id/scIPCReport" app:layout_constraintTop_toBottomOf="@id/scIPCReport" /> + + + app:layout_constraintTop_toBottomOf="@+id/scConnectionSwitch"> () M_LISTENERS[tag]?.updateStatusBarDownloadView(insert, tag, progress) } + fun updateConnectionProgressView(visible: Boolean){ + M_LISTENERS.forEach { + val listener = it.value + listener.updateConnectionProgressView(visible) + } + } + } \ No newline at end of file