Merge branch 'dev_robotaxi-d_240523_6.4.4' into dev_robo_240612_6.5.0_tmp

This commit is contained in:
yakunyang
2024-06-17 11:01:01 +08:00
15 changed files with 204 additions and 110 deletions

View File

@@ -106,6 +106,10 @@ class ConnectionProcessView @JvmOverloads constructor(
isDisconnectTimeout = false
disconnectTimer?.cancel()
disconnectTimer = null
//如果之前IPC连接状态为未连接且当前显示异常状态则改为显示域控连接成功状态
if(!ipcConnectStatus && clConnectionTip.visibility == View.VISIBLE){
connectIPCSuccess()
}
}else{
//域控连接失败
if(ipcConnectStatus && disconnectTimer == null && !isDisconnectTimeout){
@@ -132,7 +136,7 @@ class ConnectionProcessView @JvmOverloads constructor(
*/
override fun onAutopilotStatusRespByQuery(status: SystemStatusInfo.StatusInfo) {
if(HmiBuildConfig.isShowConnectionProgressView){
if(status.autoPilotReady){
if(status.hasAutoPilotReady() && status.autoPilotReady){
//冷启动成功
autopilotReady()
}else{
@@ -150,7 +154,7 @@ class ConnectionProcessView @JvmOverloads constructor(
*/
override fun onSystemStatus(statusInf: SsmInfo.SsmStatusInf) {
if(HmiBuildConfig.isShowConnectionProgressView){
if(statusInf.autoPilotReady){
if(statusInf.hasAutoPilotReady() && statusInf.autoPilotReady){
//冷启动成功
autopilotReady()
}else{
@@ -167,6 +171,7 @@ class ConnectionProcessView @JvmOverloads constructor(
if(!ipcConnectStatus){
showIPCConnectSuccessView()
//开始连接SSM超时等待倒计时
currentProcess = 25
connectSSMProcess()
}
ipcConnectStatus = true
@@ -182,10 +187,11 @@ class ConnectionProcessView @JvmOverloads constructor(
//取消连接SSM超时等待倒计时
connectSSMTimer?.cancel()
//开始启动冷启动等待倒计时
currentProcess = 50
autopilotReadyProcess()
}
ssmConnectStatus = true
autopilotReadyStatus = false
}
/**
@@ -302,8 +308,12 @@ class ConnectionProcessView @JvmOverloads constructor(
* 更新进度条进度
*/
private fun updateProcess(){
currentProcess++
pbConnectionProgress.progress = currentProcess
if(currentProcess < 100){
currentProcess++
if(pbConnectionProgress.progress < currentProcess){
pbConnectionProgress.progress = currentProcess
}
}
}
/**
@@ -353,6 +363,8 @@ class ConnectionProcessView @JvmOverloads constructor(
}
override fun onFinish() {
//将SSM连接状态置为false
ssmConnectStatus = false
//展示连接SSM失败视图
showSSMConnectFailView()
}
@@ -373,9 +385,11 @@ class ConnectionProcessView @JvmOverloads constructor(
}
override fun onFinish() {
//将冷启动状态置为false
autopilotReadyStatus = false
if(CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().ssmAutoPilotReady){
//冷启动成功
showAutopilotReadySuccessView()
autopilotReady()
}else{
//展示冷启动失败视图
showAutopilotReadyFailView()

View File

@@ -9,16 +9,19 @@ import android.view.ViewGroup
import android.widget.LinearLayout
import androidx.core.content.ContextCompat
import com.mogo.eagle.core.data.config.FunctionBuildConfig
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.api.hmi.view.IViewControlListener.Companion.FUNC_MODE_DEMO
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.FUNC_MODE_RAIN
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.kotlin.scope
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.util.BarUtils
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
@@ -27,12 +30,13 @@ import kotlinx.coroutines.Runnable
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import java.util.concurrent.CopyOnWriteArrayList
import java.util.concurrent.atomic.AtomicLong
class StatusBarView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : LinearLayout(context, attrs, defStyleAttr), IMoGoSkinModeChangeListener, IViewControlListener {
) : LinearLayout(context, attrs, defStyleAttr), IMoGoSkinModeChangeListener, IViewControlListener, IMoGoAutopilotStatusListener {
companion object {
const val TAG = "StatusBarView"
@@ -46,6 +50,8 @@ class StatusBarView @JvmOverloads constructor(
private val rightViewList = CopyOnWriteArrayList<String>()
private val leftViewList = CopyOnWriteArrayList<String>()
private val lineId = AtomicLong(Long.MIN_VALUE)
override fun onAttachedToWindow() {
super.onAttachedToWindow()
post {
@@ -60,8 +66,8 @@ class StatusBarView @JvmOverloads constructor(
CallerSkinModeListenerManager.addListener(TAG, this)
//将状态窗口中的状态移到状态栏上
CallerDevaToolsManager.showStatusBar(context, status_container)
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
updateStatusBarLeftView(true, FUNC_MODE_DEMO, DemoModeView(this.context))
updateStatusBarLeftView(true, FUNC_MODE_RAIN, RainModeView(this.context))
routeDownloadStatusRoot?.visibility = View.GONE
@@ -101,6 +107,20 @@ class StatusBarView @JvmOverloads constructor(
}
}
override fun onAutopilotRouteLineId(lineId: Long) {
super.onAutopilotRouteLineId(lineId)
if (lineId != this.lineId.get()) {
this.lineId.set(lineId)
Logger.d(TAG, "--- onAutopilotRouteLineId ---: $lineId")
routeDownloadStatusRoot?.scope?.launch {
Logger.d(TAG, "--- onAutopilotRouteLineId 1 ---: $lineId")
if ((routeDownloadStatusRoot?.visibility == View.VISIBLE) && AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
routeDownloadStatusRoot?.visibility = View.GONE
}
}
}
}
override fun setStatusBarDarkOrLight(light: Boolean) = if (light) {
setTextColor(resources.getColor(R.color.color_2C2E30))
} else {
@@ -158,6 +178,9 @@ class StatusBarView @JvmOverloads constructor(
CallerSkinModeListenerManager.removeListener(TAG)
CallerDevaToolsManager.hideStatusBar()
CallerDevaToolsManager.unRegisterRouteDownloadListener(TAG)
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
CallerAutoPilotStatusListenerManager.removeListener(TAG)
}
}
}