[8.4.0] 无人化 增加B4相关模型视频等,增加无人化自动登录功能

This commit is contained in:
xinfengkun
2026-01-21 10:19:17 +08:00
parent 59a83071d1
commit 3a1f8d5ecf
22 changed files with 227 additions and 22 deletions

View File

@@ -46,9 +46,14 @@ class ColdStartAgainWindow constructor(activity: Activity){
val videoUrl:String = if (AppIdentityModeUtils.isT1T2(FunctionBuildConfig.appIdentityMode)) {
svpColdStart.setBackgroundResource(R.drawable.biz_login_bg_taxi_start)
SkinResources.getInstance().getRawMp4FilePath(R.raw.video_biz_login_taxi_bg)
}else{
svpColdStart.setBackgroundResource(R.drawable.biz_login_bg_bus_start)
SkinResources.getInstance().getRawMp4FilePath(R.raw.video_biz_login_bus_bg)
} else {
if (AppIdentityModeUtils.isB4(FunctionBuildConfig.appIdentityMode)) {
svpColdStart.setBackgroundResource(R.drawable.biz_login_bg_bus_b4_start)
SkinResources.getInstance().getRawMp4FilePath(R.raw.video_biz_login_bus_b4_bg)
} else {
svpColdStart.setBackgroundResource(R.drawable.biz_login_bg_bus_start)
SkinResources.getInstance().getRawMp4FilePath(R.raw.video_biz_login_bus_bg)
}
}
svpColdStart.setIsTouchWiget(false)
svpColdStart.setIsTouchWigetFull(false)
@@ -67,7 +72,11 @@ class ColdStartAgainWindow constructor(activity: Activity){
if (AppIdentityModeUtils.isT1T2(FunctionBuildConfig.appIdentityMode)) {
svpColdStart.setBackgroundResource(R.drawable.biz_login_bg_taxi_end)
}else{
svpColdStart.setBackgroundResource(R.drawable.biz_login_bg_bus_end)
if (AppIdentityModeUtils.isB4(FunctionBuildConfig.appIdentityMode)) {
svpColdStart.setBackgroundResource(R.drawable.biz_login_bg_bus_b4_end)
} else {
svpColdStart.setBackgroundResource(R.drawable.biz_login_bg_bus_end)
}
}
this@ColdStartAgainWindow.hideFloatWindow()
}

View File

@@ -24,6 +24,8 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerColdStartStateListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.CockpitType
import com.mogo.eagle.core.utilcode.util.ResourceUtils
import com.mogo.eagle.core.utilcode.util.StringUtils
import com.mogo.eagle.core.utilcode.util.ThreadUtils
@@ -35,6 +37,7 @@ import com.zhjt.mogo_core_function_devatools.coldstart.ColdStartFaultAdapter
import com.zhjt.mogo_core_function_devatools.coldstart.ColdStartNodeAdapter
import com.zhjt.mogo_core_function_devatools.ota.OTAUpgradeConfig
import kotlinx.android.synthetic.main.view_cold_start.view.ivColdStartNow
import kotlinx.android.synthetic.main.view_cold_start.view.tvColdStartTip
import kotlinx.android.synthetic.main.view_cold_start.view.ivColdStartStatus
import kotlinx.android.synthetic.main.view_cold_start.view.ivFaultIcon
import kotlinx.android.synthetic.main.view_cold_start.view.ivIpcConnectStatus
@@ -140,6 +143,30 @@ class ColdStartView @JvmOverloads constructor(
//保存点击时间
ColdStartConfig.setColdStartNowState(System.currentTimeMillis())
}
initUseNowBtnView()
}
private fun initUseNowBtnView() {
val cockpitType = AppIdentityModeUtils.getCockpitType()
if (cockpitType != CockpitType.NONE) {
ThreadUtils.runOnUiThread {
if (cockpitType == CockpitType.UNMANNED) {
tvColdStartTip.setText(R.string.cold_start_now_tip_unmanned)
tvColdStartNow.visibility = View.GONE
ivColdStartNow.visibility = View.GONE
tvColdStartTip.visibility = View.GONE
} else {
tvColdStartTip.setText(R.string.cold_start_now_tip)
tvColdStartNow.visibility = View.VISIBLE
ivColdStartNow.visibility = View.VISIBLE
tvColdStartTip.visibility = View.VISIBLE
}
}
}
}
override fun onCockpitTypeChange() {
super.onCockpitTypeChange()
initUseNowBtnView()
}
override fun onAttachedToWindow() {
@@ -879,6 +906,11 @@ class ColdStartView @JvmOverloads constructor(
tvColdStartContent.text = resources.getString(R.string.cold_start_fail_content)
tvColdStartContent.setTextColor(ContextCompat.getColor(context, R.color.cold_start_fail))
coldStartResultListener?.coldStartFail()
ThreadUtils.runOnUiThread {
tvColdStartNow.visibility = View.VISIBLE
ivColdStartNow.visibility = View.VISIBLE
tvColdStartTip.visibility = View.VISIBLE
}
}
/**

View File

@@ -215,6 +215,7 @@
android:textSize="@dimen/sp_28"
android:textColor="#82FFFFFF"
android:layout_marginBottom="@dimen/dp_124"
android:visibility="gone"
/>
<TextView
@@ -228,6 +229,7 @@
android:textColor="@color/white"
android:gravity="center"
android:layout_marginBottom="@dimen/dp_16"
android:visibility="gone"
/>
<ImageView
@@ -241,6 +243,7 @@
android:layout_marginStart="@dimen/dp_15"
android:contentDescription="@string/cold_start_now"
android:layout_marginTop="@dimen/dp_4"
android:visibility="gone"
/>

View File

@@ -256,6 +256,7 @@
<string name="cold_start_fault_icon">Cold Start HW Fault Icon</string>
<string name="cold_start_now">Use Now</string>
<string name="cold_start_now_tip">Skipping may disable autonomous mode</string>
<string name="cold_start_now_tip_unmanned">Startup failed. Features like Automated Driving will be unavailable.</string>
<string name="cold_start_process">Cold Start Progress</string>

View File

@@ -257,6 +257,7 @@
<string name="cold_start_fault_icon">冷启动软件硬件故障图标</string>
<string name="cold_start_now">立即用车</string>
<string name="cold_start_now_tip">跳过流程或启动失败,均可能会导致自动驾驶等功能无法使用</string>
<string name="cold_start_now_tip_unmanned">启动失败,会导致自动驾驶等功能无法使用</string>
<string name="cold_start_process">冷启动进度条</string>

View File

@@ -10,6 +10,7 @@ enum class Carmodel(val serverName:String,@RawRes val rawValue: Int, val resId:
CommonB2("B2", R.raw.m2, R.drawable.icon_car_b2),
DeQingB2("B2", R.raw.deqing_m2, R.drawable.icon_car_b2),
YiXinB2("B2", R.raw.yixin_m2, R.drawable.icon_car_b2),
B4("B4", R.raw.b4, R.drawable.icon_car_b2),
M1("M1", R.raw.m1, R.drawable.icon_car_m1),
C1("C1", R.raw.huanwei, R.drawable.icon_car_c1),;
@@ -46,6 +47,9 @@ enum class Carmodel(val serverName:String,@RawRes val rawValue: Int, val resId:
}
}
}
"B4" -> {
B4
}
"M1" -> {
M1
}

View File

@@ -93,6 +93,12 @@ interface IMoGoAutopilotStatusListener {
*/
fun onSystemStatus(statusInf: SsmInfo.SsmStatusInf) {}
/**
* 驾舱类型变更 只接入了定频SSM接口
*
*/
fun onCockpitTypeChange() {}
/**
* 自动驾驶路线ID回调
*/

View File

@@ -7,7 +7,10 @@ import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.function.call.trace.CallerTrace
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.util.GsonUtils
import com.mogo.eagle.core.utilcode.util.ParseVersionUtils
import com.zhjt.mogo.adas.data.AdasConstants
import mogo.telematics.pad.MessagePad
import mogo_msg.MogoReportMsg
@@ -62,6 +65,17 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
}
}
private var _ssmVersion: String by Delegates.observable("0") { _, oldValue, newValue ->
if (!oldValue.contentEquals(newValue)) {
CallerLogger.i("CallerAutoPilotStatusListenerManager", "_ssmVersion=$_ssmVersion")
AppIdentityModeUtils.setCockpitType(ParseVersionUtils.parseVersion(false, newValue))
M_LISTENERS.forEach {
val listener = it.value
listener.onCockpitTypeChange()
}
}
}
@Volatile
private var autoPilotMessageCode: String = ""
@@ -331,6 +345,7 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
fun invokeSystemStatus(statusInf: SsmInfo.SsmStatusInf?) {
statusInf?.also {
this.statusInf = statusInf
_ssmVersion = it.getMasterVersion()
if (statusInf.hdMapVer != null && statusInf.hdMapVer.isNotEmpty()) {
//对地图版本进行截取
val city = statusInf.hdMapVer.substringAfter(".sqlite|").substringBefore("|")

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 476 KiB

Binary file not shown.

View File

@@ -1,5 +1,8 @@
package com.mogo.eagle.core.utilcode.mogo
import com.mogo.eagle.core.utilcode.util.SPUtils
/**
* 取值要与mis后台配置对应上
* https://mogogo.zhidaozhixing.com/eagleEye-mis/appInfo/query/all?keyWord=&pageNum=1&pageSize=20
@@ -18,6 +21,7 @@ fun AppIdentityModeUtils.getMisChannelCode(appIdentityMode: String): Int {
* @see com.mogo.eagle.core.data.config.FunctionBuildConfig.appIdentityMode 判断身份
*/
object AppIdentityModeUtils {
private const val COCKPIT_TYPE = "cockpit_type"
// 身份
private const val DRIVER = "Driver"
private const val PASSENGER = "Passenger"
@@ -36,7 +40,7 @@ object AppIdentityModeUtils {
private const val B1 = "B1"
private const val T1T2 = "T1T2"
private const val C1 = "C1"
private const val B4 = "B4"
fun getInfo(appIdentityMode: String): Array<String> {
val split = appIdentityMode.split("_")
@@ -281,6 +285,14 @@ object AppIdentityModeUtils {
return false
}
@JvmStatic
fun isB4(appIdentityMode: String): Boolean {
val (_, _, model) = getInfo(appIdentityMode)
if (model.isNotEmpty()) {
return model == B4
}
return false
}
@JvmStatic
fun isM1(appIdentityMode: String): Boolean {
val (_, _, model) = getInfo(appIdentityMode)
@@ -325,6 +337,7 @@ object AppIdentityModeUtils {
return when (carType) {
B1 -> CarType.B1
B2 -> CarType.B2
B4 -> CarType.B4
C1 -> CarType.C1
M1 -> CarType.M1
T1T2 -> CarType.T1T2
@@ -337,9 +350,24 @@ object AppIdentityModeUtils {
}
enum class CarType {
NONE, B1, B2, C1, M1, T1T2,
NONE, B1, B2, C1, M1, T1T2, B4,
}
@JvmStatic
fun setCockpitType(ssmVersion: Int) {
val code = if (ssmVersion >= 6) {
CockpitType.UNMANNED.code
} else {
CockpitType.LEGACY.code
}
SPUtils.getInstance().put(COCKPIT_TYPE, code)
}
//获取驾舱类型
@JvmStatic
fun getCockpitType(): CockpitType {
return CockpitType.getCockpitType(SPUtils.getInstance().getString(COCKPIT_TYPE, CockpitType.NONE.code))
}
}
enum class Product(val code: Int) {
@@ -396,6 +424,7 @@ enum class Vehicle(val code: String) {
B1("B1"),
B2("B2"),
C1("C1"),
B4("B4"),
M1("M1");
companion object {
@@ -425,6 +454,9 @@ enum class Vehicle(val code: String) {
M1
}
B4.code -> {
B4
}
else -> {
NONE
}
@@ -466,6 +498,10 @@ enum class Vehicle(val code: String) {
C1
}
"B4" -> {
B4
}
else -> {
T1T2
}
@@ -474,3 +510,24 @@ enum class Vehicle(val code: String) {
}
}
//驾舱类型 连接成功后会保存
enum class CockpitType(val code: String) {
NONE("UNKNOWN"),// 未知,从未连接过域控
LEGACY("LEGACY"),// 老版本:主驾必须有人
UNMANNED("UNMANNED");// 无人版本,并非完全无人,需要主驾有人操作线路任务流转
// PURE_UNMANNED("PURE_UNMANNED");// 纯无人版本,可能用不到
companion object {
fun getCockpitType(code: String): CockpitType {
return when (code) {
LEGACY.code -> LEGACY
UNMANNED.code -> UNMANNED
// PURE_UNMANNED.code -> PURE_UNMANNED
else -> {
NONE
}
}
}
}
}