2.13.0 fixed conflict

This commit is contained in:
lixiaopeng
2022-11-28 19:30:28 +08:00
parent f070106fe0
commit 1a973e1b63
7 changed files with 651 additions and 585 deletions

View File

@@ -21,12 +21,9 @@ class MoGoObuProvider : IMoGoObuProvider {
private val TAG = "MoGoObuProvider"
private var mContext: Context? = null
private val busObuIp = "192.168.8.199"
private val taxiObuIp = "192.168.1.199"
// private val taxiObuIp = "192.168.1.186"
override val functionName: String
get() = TAG
@@ -35,7 +32,7 @@ class MoGoObuProvider : IMoGoObuProvider {
}
override fun init(context: Context) {
CallerLogger.d("$M_OBU$TAG", "初始化蘑菇自研OBU…… localIp = " + CommonUtils.getLocalIPAddress())
CallerLogger.d("$M_OBU$TAG", "初始化蘑菇自研OBU…… localIp = " + CommonUtils.getLocalIPAddress() + "--")
//bus乘客版本obu功能去掉
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger(
FunctionBuildConfig.appIdentityMode
@@ -46,30 +43,33 @@ class MoGoObuProvider : IMoGoObuProvider {
mContext = context
mContext?.let {
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) { //bus 司机端
//mogo obu
MogoPrivateObuNewManager.INSTANCE.connectObu(
it,
busObuIp,
CommonUtils.getIpAddressString()
)
//old obu
val ipAddress =
SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, busObuIp)
MogoPrivateObuManager.INSTANCE.init(context, ipAddress)
} else if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) { //taxi 司机端和乘客端
//mogo obu
MogoPrivateObuNewManager.INSTANCE.connectObu(
it,
taxiObuIp,
ipAddress,
CommonUtils.getIpAddressString()
)
//old obu
MogoPrivateObuManager.INSTANCE.init(context, ipAddress)
CallerLogger.d("$M_OBU$TAG", "bus 司机 ipAddress = $ipAddress ---localIp = ${CommonUtils.getIpAddressString()}")
} else if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) { //taxi 司机端和乘客端
val ipAddress =
SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, taxiObuIp)
//mogo obu
MogoPrivateObuNewManager.INSTANCE.connectObu(
it,
ipAddress,
CommonUtils.getIpAddressString()
)
//old obu
MogoPrivateObuManager.INSTANCE.init(context, ipAddress)
CallerLogger.d("$M_OBU$TAG", "taxi 司机端和乘客端 ipAddress = $ipAddress ---localIp = ${CommonUtils.getIpAddressString()}")
}
}
}

View File

@@ -94,14 +94,22 @@ object TrafficDataConvertUtilsNew {
trafficData.heading = info.participant.heading
trafficData.speed = info.participant.speed
/**
* 交通参与者类型
* 0未知
* 1机动车
* 2非机动车
* 3行人
* 4OBU自身
*/
when (info.participant.ptcType) {
// 未知
0 -> {
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI
}
//机动车 //TODO
//机动车
1 -> {
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_TA_CHE
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_MOTO
}
// 非机动车
2 -> {
@@ -113,16 +121,6 @@ object TrafficDataConvertUtilsNew {
}
}
/**
* 交通参与者类型
* 0未知
* 1机动车
* 2非机动车
* 3行人
* 4OBU自身
*/
val ptcType = 0
// 判断车辆V2X预警级别调整车辆颜色
if (info.warningMsg != null && info.warningMsg.warningData != null) {
trafficData.threatLevel = info.warningMsg.warningData[0].warningLevel