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 new file mode 100644 index 0000000000..68309d846d --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/ConnectionProcessView.kt @@ -0,0 +1,95 @@ +package com.mogo.eagle.core.function.hmi.ui.widget + +import android.content.Context +import android.util.AttributeSet +import android.view.LayoutInflater +import android.view.View +import androidx.constraintlayout.widget.ConstraintLayout +import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager +import com.mogo.eagle.core.function.hmi.R +import com.mogo.eagle.core.utilcode.util.ThreadUtils +import com.zhjt.mogo.adas.data.AdasConstants +import system_master.SsmInfo +import system_master.SystemStatusInfo + +/** + * 显示连接过程及系统冷启动结果View + * 域控连接成功后显示该View,连接SSM的超时时间为5分钟,冷启动的超时时间为10分钟 + * 首次连接成功域控后立即展示该View,首次连接成功后断连1分钟后,并且再次连接域控成功后展示该View + */ +class ConnectionProcessView @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0 +) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoAutopilotStatusListener{ + + companion object { + const val TAG = "ConnectionProcessView" + } + + private var isFirstTimeConnect = true //是否是第一次连接域控,默认是首次连接 + private var ipcConnectStatus = false //连接域控状态,默认是未连接 + private var ssmConnectStatus = false //SSM连接状态,默认是未连接 + private var autopilotReadyStatus = false //冷启动状态,默认是未冷启动成功 + + init { + LayoutInflater.from(context).inflate(R.layout.view_connection_process, this, true) + initView() + } + + private fun initView(){ + + } + + override fun onAttachedToWindow() { + super.onAttachedToWindow() + CallerAutoPilotStatusListenerManager.addListener(TAG, this) + } + + override fun onDetachedFromWindow() { + super.onDetachedFromWindow() + CallerAutoPilotStatusListenerManager.removeListener(TAG) + } + + override fun onAutopilotIpcConnectStatusChanged( + status: AdasConstants.IpcConnectionStatus, + reason: String? + ) { + ipcConnectStatus = status == AdasConstants.IpcConnectionStatus.CONNECTED + if(ipcConnectStatus){ + isFirstTimeConnect = false + } + } + + /** + * 状态查询应答 + * @param status 数据 + * HQ、M1 MAP350开始弃用,其他车型MAP360开始弃用 + */ + override fun onAutopilotStatusRespByQuery(status: SystemStatusInfo.StatusInfo) { + ssmConnectStatus = true + autopilotReadyStatus = status.autoPilotReady + } + + /** + * 定频SSM接口 + * 1hz hq m1 MAP350开始支持,其他车型MAP360开始支持 + * 定频SSM接入后 onStatusQueryResp 状态查询应答接口将弃用 + * @param statusInf 数据 + */ + override fun onSystemStatus(statusInf: SsmInfo.SsmStatusInf) { + ssmConnectStatus = true + autopilotReadyStatus = statusInf.autoPilotReady + } + + /** + * 展示冷启动成功视图 + */ + private fun showConnectionSuccessView(){ + + } + + + +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/bg_connection_progress.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/bg_connection_progress.png new file mode 100644 index 0000000000..dcf46d013c Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/bg_connection_progress.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/bg_connection_tip.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/bg_connection_tip.png new file mode 100644 index 0000000000..1074a0ad4a Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/bg_connection_tip.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_connection_tip.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_connection_tip.png new file mode 100644 index 0000000000..79ea3da688 Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_connection_tip.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/connection_error_style.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/connection_error_style.xml new file mode 100644 index 0000000000..a59ca7789c --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/connection_error_style.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/connection_progress_style.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/connection_progress_style.xml new file mode 100644 index 0000000000..31733610a2 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/connection_progress_style.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/connection_success_style.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/connection_success_style.xml new file mode 100644 index 0000000000..cdc0fa44c8 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/connection_success_style.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_connection_process.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_connection_process.xml new file mode 100644 index 0000000000..d9d926fa9b --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_connection_process.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/mogo-core-res/src/main/res/values/dimens.xml b/core/mogo-core-res/src/main/res/values/dimens.xml index 14db571916..5b489432c5 100644 --- a/core/mogo-core-res/src/main/res/values/dimens.xml +++ b/core/mogo-core-res/src/main/res/values/dimens.xml @@ -1026,6 +1026,7 @@ 998dp 999dp 1000dp + 1003dp 1100dp 1125dp 1200dp