[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

@@ -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
}
}
}
}
}