Merge branch 'dev_robotaxi-d-app-module_240_230131_2.14.0' into test_robotaxi-d-app-module_240_230131_2.14.0.1

This commit is contained in:
xuxinchao
2023-02-19 23:49:06 +08:00
19 changed files with 342 additions and 1420 deletions

View File

@@ -97,9 +97,7 @@ ext {
// obu sdk
obusdk : "com.zhidao.enterprise.smartv2x:smartv2x:1.0.0.3",
mogoobuold : 'com.zhidao.support.obu:mogoobu:1.0.0.33',
mogoobu : 'com.mogo.support.obu:mogo-obu:1.0.6',
mogoami : 'com.zhidao.support.obu.ami:mogoami:1.0.0.24',
// google
googlezxing : "com.google.zxing:core:3.3.3",

View File

@@ -51,7 +51,6 @@ dependencies {
kapt rootProject.ext.dependencies.aroutercompiler
implementation rootProject.ext.dependencies.mogoami
implementation rootProject.ext.dependencies.mogoaicloudtelematic
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {

View File

@@ -281,30 +281,40 @@ class BadCaseManagerView @JvmOverloads constructor(
clBagNoDataLayout.visibility = View.GONE
if(bagManager.bagsInfoRespCount>0){
bagManagerEntity.bagsInfoResp.clear()
val originBagInfoList = ArrayList<BagInfoEntity>()
for(bagInfo in bagManager.bagsInfoRespList){
bagInfo?.let {
it.timestamp?.let { time ->
val descriptionEntity = BagDescriptionEntity(it.description.description,it.description.hasAudio,it.description.audioUrl,it.description.reportBI)
val bagInfoEntity = BagInfoEntity()
bagInfoEntity.key = it.key
bagInfoEntity.totalSize = it.totalSize
bagInfoEntity.timestamp = it.timestamp
bagInfoEntity.bagPath = it.bagPath
bagInfoEntity.mergeStat = it.mergeStat
bagInfoEntity.uploadStat = it.uploadStat
bagInfoEntity.itemType = 0
bagInfoEntity.description = descriptionEntity
for(subBag in it.subBagsList){
val subBagEntity = SubBagEntity(subBag.key,subBag.host,subBag.size)
bagInfoEntity.subBags.add(subBagEntity)
}
val descriptionEntity = BagDescriptionEntity(it.description.description,it.description.hasAudio,it.description.audioUrl,it.description.reportBI)
val bagInfoEntity = BagInfoEntity()
bagInfoEntity.key = it.key
bagInfoEntity.totalSize = it.totalSize
bagInfoEntity.timestamp = it.timestamp
bagInfoEntity.bagPath = it.bagPath
bagInfoEntity.mergeStat = it.mergeStat
bagInfoEntity.uploadStat = it.uploadStat
bagInfoEntity.itemType = 0
bagInfoEntity.description = descriptionEntity
for(subBag in it.subBagsList){
val subBagEntity = SubBagEntity(subBag.key,subBag.host,subBag.size)
bagInfoEntity.subBags.add(subBagEntity)
}
originBagInfoList.add(bagInfoEntity)
//对数组按照时间顺序进行倒序排序
originBagInfoList.sortWith(Comparator { o1, o2 ->
o2.timestamp.compareTo(o1.timestamp)
})
}
}
for(originBagInfo in originBagInfoList){
originBagInfo.let {
it.timestamp.let { time ->
val month = time.substring(4,6)
val day = time.substring(6,8)
val timeStr = "${month}${day}"
var containTime = false
for(bag in bagManagerEntity.bagsInfoResp){
if(bag.timeStr == time){
if(bag.timeStr == timeStr){
containTime = true
}
}
@@ -318,16 +328,17 @@ class BadCaseManagerView @JvmOverloads constructor(
}
var containKey = false
for(bagInfoContain in bagManagerEntity.bagsInfoResp){
if(bagInfoContain.key == bagInfoEntity.key){
if(bagInfoContain.key == it.key){
containKey = true
}
}
if(!containKey){
bagManagerEntity.bagsInfoResp.add(bagInfoEntity)
bagManagerEntity.bagsInfoResp.add(it)
}
}
}
}
//更新List
bagManagerListAdapter?.setData(bagManagerEntity.bagsInfoResp)
}
@@ -362,6 +373,22 @@ class BadCaseManagerView @JvmOverloads constructor(
bagUploadDialog?.uploadCompleted()
tvCancelSelect.performClick()
}
when (bagManager.uploadCosResp.stat) {
0 -> {
ToastUtils.showShort("${bagManager.uploadCosResp.key} 上传cos桶成功")
}
2 -> {
ToastUtils.showShort("${bagManager.uploadCosResp.key} 上传cos桶copy过程失败,原因:${bagManager.uploadCosResp.message}")
}
3 -> {
ToastUtils.showShort("${bagManager.uploadCosResp.key} 上传cos桶合并过程失败,原因:${bagManager.uploadCosResp.message}")
}
4 -> {
ToastUtils.showShort("${bagManager.uploadCosResp.key} 上传cos桶上传过程失败,原因:${bagManager.uploadCosResp.message}")
}
}
}
//删除Bag
else if(bagManager.reqType == 4){

View File

@@ -29,11 +29,11 @@
android:layout_marginEnd="30dp"
android:background="@null"
android:drawableEnd="@drawable/icon_bag_edit"
android:drawablePadding="@dimen/dp_10"
android:textColor="#FFFFFFFF"
android:textSize="32dp"
android:maxLines="1"
android:singleLine="true"
android:ellipsize="end"
android:maxLength="9"
/>
<TextView

View File

@@ -71,8 +71,6 @@ dependencies {
implementation rootProject.ext.dependencies.arouter
kapt rootProject.ext.dependencies.aroutercompiler
implementation rootProject.ext.dependencies.mogoami
implementation rootProject.ext.dependencies.android_start_up
implementation rootProject.ext.dependencies.cicle_indicator
implementation rootProject.ext.dependencies.koomnative

View File

@@ -80,7 +80,6 @@ import com.mogo.map.uicontroller.VisualAngleMode.*
import com.mogo.eagle.core.function.business.routeoverlay.*
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
import com.mogo.eagle.core.utilcode.kotlin.lifecycleOwner
import com.zhidao.easysocket.utils.L
import com.zhidao.support.adas.high.other.permission.BackgrounderPermission
import com.zhjt.mogo_core_function_devatools.env.*
import kotlinx.android.synthetic.main.view_debug_setting.view.*
@@ -1317,7 +1316,7 @@ class DebugSettingView @JvmOverloads constructor(
* 设置是否输出OBU日志 true-打印日志false-不打印日志
*/
tbObuLog.setOnCheckedChangeListener { _, isChecked ->
L.setEnableLog(isChecked)
CallerOBUManager.setObuLog(isChecked)
}
/**

View File

@@ -103,28 +103,24 @@ class SOPSettingView @JvmOverloads constructor(
* 限速数据来源开关
*/
tbRoadLimitSpeedSop.setOnCheckedChangeListener { _, isChecked ->
//默认开启
//默认关闭
HmiBuildConfig.isShowObuLimitSpeedView = isChecked
}
/**
* obu V2V开关
*/
tbObuV2vView.isChecked = HmiBuildConfig.isShowObuV2vView
tbObuV2vView.setOnCheckedChangeListener { _, isChecked ->
//默认开启
//默认关闭
HmiBuildConfig.isShowObuV2vView = isChecked
// Log.e("liyz", "---2222-- v2v = ${HmiBuildConfig.isShowObuV2vView}")
}
/**
* obu V2i开关
*/
tbObuV2iView.isChecked = HmiBuildConfig.isShowObuV2iView
tbObuV2iView.setOnCheckedChangeListener { _, isChecked ->
//默认关闭
HmiBuildConfig.isShowObuV2iView = isChecked
// Log.d("liyz", "---2--- v2i = ${HmiBuildConfig.isShowObuV2iView}")
}
/**
@@ -161,7 +157,10 @@ class SOPSettingView @JvmOverloads constructor(
// 演示模式,上一次勾选的数据
tbDemoMode.isChecked = FunctionBuildConfig.isDemoMode
// 演示模式
tbDemoMode.setOnCheckedChangeListener { _, _ ->
tbDemoMode.setOnCheckedChangeListener { compoundButton, _ ->
if(!compoundButton.isPressed){
return@setOnCheckedChangeListener
}
FunctionBuildConfig.isDemoMode = !FunctionBuildConfig.isDemoMode
CallerHmiManager.updateStatusBarLeftView(FunctionBuildConfig.isDemoMode, "demoMode", DemoModeView(context))
CallerAutoPilotManager.setDemoMode(FunctionBuildConfig.isDemoMode)
@@ -179,7 +178,10 @@ class SOPSettingView @JvmOverloads constructor(
// 雨天模式,上一次勾选的数据
tbRainMode.isChecked = FunctionBuildConfig.isRainMode
//雨天模式
tbRainMode.setOnCheckedChangeListener { _, isChecked ->
tbRainMode.setOnCheckedChangeListener { compoundButton, isChecked ->
if(!compoundButton.isPressed){
return@setOnCheckedChangeListener
}
CallerAutoPilotManager.setRainMode(isChecked)
FunctionBuildConfig.isRainMode = isChecked
}
@@ -191,8 +193,12 @@ class SOPSettingView @JvmOverloads constructor(
//OBU控制总开关
tbObu.isChecked = CallerOBUManager.isConnected()
tbObu.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) {
CallerOBUManager.resetObuIpAddress("192.168.1.199")
if (!isChecked) {
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) {
CallerOBUManager.resetObuIpAddress("192.168.1.199")
} else if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
CallerOBUManager.resetObuIpAddress("192.168.1.199")
}
} else {
//断开链接
CallerOBUManager.disConnectObu()
@@ -268,11 +274,8 @@ class SOPSettingView @JvmOverloads constructor(
private val timerTaskRefresh = object : TimerTask(){
override fun run() {
UiThreadHandler.post{
if(FunctionBuildConfig.isDemoMode){
tbDemoMode.text = "关闭美化模式"
}else{
tbDemoMode.text = "开启美化模式"
}
tbDemoMode.isChecked = FunctionBuildConfig.isDemoMode
tbRainMode.isChecked = FunctionBuildConfig.isRainMode
}
}
@@ -282,39 +285,27 @@ class SOPSettingView @JvmOverloads constructor(
when (type) {
FuncBizConfig.BIZ_BEAUTY_MODE -> {
tbDemoMode.isClickable = !lock
val (left,top,right,bottom) = tbDemoMode.currentPadding()
if (lock) {
tbDemoMode.background =
resources.getDrawable(R.drawable.radio_button_lock_background)
} else {
tbDemoMode.background =
resources.getDrawable(R.drawable.radio_button_normal_background_right)
if(lock){
tbDemoMode.visibility = View.INVISIBLE
}else{
tbDemoMode.visibility = View.VISIBLE
}
tbDemoMode.setPadding(left,top,right,bottom)
}
FuncBizConfig.BIZ_RAIN_MODE -> {
tbRainMode.isClickable = !lock
val (left,top,right,bottom) = tbRainMode.currentPadding()
if (lock) {
tbRainMode.background =
resources.getDrawable(R.drawable.radio_button_lock_background)
tbRainMode.visibility = View.INVISIBLE
} else {
tbRainMode.background =
resources.getDrawable(R.drawable.radio_button_normal_background_right)
tbRainMode.visibility = View.VISIBLE
}
tbRainMode.setPadding(left,top,right,bottom)
}
FuncBizConfig.BIZ_PNC_WARNING -> {
tbMarkingObstacles.isClickable = !lock
val (left,top,right,bottom) = tbMarkingObstacles.currentPadding()
if (lock) {
tbMarkingObstacles.background =
resources.getDrawable(R.drawable.radio_button_lock_background)
tbMarkingObstacles.visibility = View.INVISIBLE
} else {
tbMarkingObstacles.background =
resources.getDrawable(R.drawable.radio_button_normal_background_right)
tbMarkingObstacles.visibility = View.VISIBLE
}
tbMarkingObstacles.setPadding(left,top,right,bottom)
}
}
}

View File

@@ -37,7 +37,6 @@ import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
import com.mogo.eagle.core.utilcode.util.ProcessUtils;
import com.mogo.eagle.core.utilcode.util.SPUtils;
import com.mogo.map.MapApiPath;
import com.zhidao.support.obu.ami.AmiClientManager;
import java.io.File;
import java.lang.reflect.Field;
@@ -60,7 +59,6 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
return;
}
start = System.currentTimeMillis();
connectAmiIp();
// Crash 日志收集
initCrashConfig();
initLogConfig();
@@ -202,14 +200,6 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
OverviewDb.Companion.getDb(this);
}
/**
* 连接ami
*/
private void connectAmiIp() {
String ipAddress = SharedPrefsMgr.getInstance(AbsMogoApplication.getApp().getBaseContext()).getString(MoGoConfig.OBU_IP, "192.168.1.199");
AmiClientManager.getInstance().setObuIp(ipAddress);
}
private void initModules() {
CallerLogger.INSTANCE.d(M_HMI + TAG, "initModules");
//och模块

View File

@@ -16,205 +16,231 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/verticalGuideLine"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.5"
/>
<!--绕障类功能-->
<ToggleButton
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/tbObstacleAvoidance"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:padding="@dimen/dp_20"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="开启绕障类功能"
android:textOn="关闭绕障类功能"
android:textSize="@dimen/dp_24"
android:text="绕障类功能"
android:paddingTop="40dp"
android:paddingBottom="25dp"
android:scaleY="1.2"
android:scaleX="1.2"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/verticalGuideLine"
/>
<!--危险障碍物颜色标记-->
<ToggleButton
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/tbMarkingObstacles"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:padding="@dimen/dp_20"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="开启「危险障碍物颜色标记」"
android:textOn="关闭「危险障碍物颜色标记」"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbObstacleAvoidance"
android:text="危险障碍物颜色标记"
android:paddingTop="40dp"
android:paddingBottom="25dp"
android:scaleY="1.2"
android:scaleX="1.2"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toRightOf="@id/verticalGuideLine"
app:layout_constraintRight_toRightOf="parent"
/>
<!--引导线动态效果-->
<ToggleButton
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/tbRouteDynamicEffect"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:padding="@dimen/dp_20"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="开启「引导线动态效果」"
android:textOn="关闭「引导线动态效果」"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbMarkingObstacles"
android:text="引导线动态效果"
android:paddingTop="25dp"
android:paddingBottom="25dp"
android:scaleY="1.2"
android:scaleX="1.2"
app:layout_constraintTop_toBottomOf="@id/tbObstacleAvoidance"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/verticalGuideLine"
/>
<!--红绿灯标识-->
<ToggleButton
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/tbTrafficLight"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:padding="@dimen/dp_20"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="隐藏红绿灯标识"
android:textOn="展示红绿灯标识"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbRouteDynamicEffect"
android:text="红绿灯标识"
android:paddingTop="25dp"
android:paddingBottom="25dp"
android:scaleY="1.2"
android:scaleX="1.2"
app:layout_constraintTop_toBottomOf="@id/tbObstacleAvoidance"
app:layout_constraintLeft_toRightOf="@id/verticalGuideLine"
app:layout_constraintRight_toRightOf="parent"
/>
<!--限速标识-->
<ToggleButton
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/tbSpeedLimit"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:padding="@dimen/dp_20"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="展示限速标识"
android:textOn="隐藏限速标识"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbTrafficLight"
android:text="限速标识"
android:paddingTop="25dp"
android:paddingBottom="25dp"
android:scaleY="1.2"
android:scaleX="1.2"
app:layout_constraintTop_toBottomOf="@id/tbRouteDynamicEffect"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/verticalGuideLine"
/>
<ToggleButton
<!--美化模式-->
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/tbDemoMode"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:padding="@dimen/dp_20"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="开启美化模式"
android:textOn="关闭美化模式"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbSpeedLimit"
android:text="美化模式"
android:paddingTop="25dp"
android:paddingBottom="25dp"
android:scaleY="1.2"
android:scaleX="1.2"
app:layout_constraintTop_toBottomOf="@id/tbRouteDynamicEffect"
app:layout_constraintLeft_toRightOf="@id/verticalGuideLine"
app:layout_constraintRight_toRightOf="parent"
/>
<ToggleButton
<!--雨天模式-->
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/tbRainMode"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:padding="@dimen/dp_20"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="开启雨天模式"
android:textOn="关闭雨天模式"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbDemoMode"
android:text="雨天模式"
android:paddingTop="25dp"
android:paddingBottom="25dp"
android:scaleY="1.2"
android:scaleX="1.2"
app:layout_constraintTop_toBottomOf="@id/tbSpeedLimit"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/verticalGuideLine"
/>
<ToggleButton
<!--OBU-->
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/tbObu"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:padding="@dimen/dp_20"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="开启OBU"
android:textOn="关闭OBU"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbRainMode"
android:text="OBU"
android:paddingTop="25dp"
android:paddingBottom="25dp"
android:scaleY="1.2"
android:scaleX="1.2"
app:layout_constraintTop_toBottomOf="@id/tbSpeedLimit"
app:layout_constraintLeft_toRightOf="@id/verticalGuideLine"
app:layout_constraintRight_toRightOf="parent"
/>
<ToggleButton
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/tbObuV2vView"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/dp_20"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="展示v2v事件"
android:textOn="不展示v2v事件"
app:layout_constraintTop_toBottomOf="@id/tbObu"
android:textSize="@dimen/dp_24" />
<ToggleButton
android:id="@+id/tbObuV2iView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/dp_20"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="展示v2i事件"
android:textOn="不展示v2i事件"
app:layout_constraintTop_toBottomOf="@id/tbObuV2vView"
android:textSize="@dimen/dp_24" />
<ToggleButton
android:id="@+id/tbObuToDcView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:padding="@dimen/dp_20"
android:background="@drawable/radio_button_normal_background_right"
app:layout_constraintTop_toBottomOf="@id/tbObuV2iView"
android:textOff="关闭OBU到工控机V2I显示"
android:textOn="打开OBU到工控机V2I显示"
android:textSize="@dimen/dp_24" />
<ToggleButton
android:id="@+id/tbObuWeaknessTrafficSop"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:padding="@dimen/dp_20"
android:background="@drawable/radio_button_normal_background_right"
app:layout_constraintTop_toBottomOf="@id/tbObuToDcView"
android:textOff="关闭路侧弱势群体预警"
android:textOn="打开路侧弱势群体预警"
android:textSize="@dimen/dp_24" />
<ToggleButton
android:id="@+id/tbCloudWeaknessTrafficSop"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:padding="@dimen/dp_20"
android:background="@drawable/radio_button_normal_background_right"
app:layout_constraintTop_toBottomOf="@id/tbObuWeaknessTrafficSop"
android:textOff="开启云端弱势群体预警"
android:textOn="关闭云端弱势群体预警"
android:textSize="@dimen/dp_24" />
<ToggleButton
android:id="@+id/tbIPCReport"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:padding="@dimen/dp_20"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="开启异常上报提示"
android:textOn="关闭异常上报提示"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbCloudWeaknessTrafficSop"
android:text="V2V事件"
android:paddingTop="25dp"
android:paddingBottom="25dp"
android:scaleY="1.2"
android:scaleX="1.2"
app:layout_constraintTop_toBottomOf="@id/tbRainMode"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/verticalGuideLine"
/>
<ToggleButton
android:id="@+id/tbRoadLimitSpeedSop"
android:layout_width="match_parent"
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/tbObuV2iView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/dp_20"
android:visibility="gone"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="获取路侧限速提醒"
android:textOn="关闭路侧限速提醒"
app:layout_constraintTop_toBottomOf="@id/tbIPCReport"
android:textSize="@dimen/dp_24" />
android:text="V2I事件"
android:paddingTop="25dp"
android:paddingBottom="25dp"
android:scaleY="1.2"
android:scaleX="1.2"
app:layout_constraintTop_toBottomOf="@id/tbRainMode"
app:layout_constraintLeft_toRightOf="@id/verticalGuideLine"
app:layout_constraintRight_toRightOf="parent"
/>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/tbObuToDcView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="OBU到工控机V2I显示"
android:paddingTop="25dp"
android:paddingBottom="25dp"
android:scaleY="1.2"
android:scaleX="1.2"
app:layout_constraintTop_toBottomOf="@id/tbObuV2vView"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/verticalGuideLine"
/>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/tbObuWeaknessTrafficSop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="路侧弱势群体预警"
android:paddingTop="25dp"
android:paddingBottom="25dp"
android:scaleY="1.2"
android:scaleX="1.2"
app:layout_constraintTop_toBottomOf="@id/tbObuV2vView"
app:layout_constraintLeft_toRightOf="@id/verticalGuideLine"
app:layout_constraintRight_toRightOf="parent"
/>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/tbCloudWeaknessTrafficSop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="云端弱势群体预警"
android:paddingTop="25dp"
android:paddingBottom="25dp"
android:scaleY="1.2"
android:scaleX="1.2"
app:layout_constraintTop_toBottomOf="@id/tbObuToDcView"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/verticalGuideLine"
/>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/tbIPCReport"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="异常上报提示"
android:paddingTop="25dp"
android:paddingBottom="25dp"
android:scaleY="1.2"
android:scaleX="1.2"
app:layout_constraintTop_toBottomOf="@id/tbObuToDcView"
app:layout_constraintLeft_toRightOf="@id/verticalGuideLine"
app:layout_constraintRight_toRightOf="parent"
/>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/tbRoadLimitSpeedSop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="路侧限速提醒"
android:paddingTop="25dp"
android:paddingBottom="25dp"
android:scaleY="1.2"
android:scaleX="1.2"
app:layout_constraintTop_toBottomOf="@id/tbCloudWeaknessTrafficSop"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/verticalGuideLine"
/>
<TextView
android:id="@+id/tvSpeedThresholdTitle"
@@ -225,7 +251,7 @@
android:text="变道速度阈值:"
android:textSize="@dimen/dp_36"
android:textColor="#1A1A1A"
android:layout_margin="10dp"
android:layout_margin="20dp"
/>
<ImageView
@@ -249,8 +275,8 @@
android:textSize="@dimen/dp_36"
android:gravity="center"
android:background="@drawable/debug_setting_edit_bg"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:paddingStart="15dp"
android:paddingEnd="15dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
/>
@@ -278,16 +304,6 @@
android:layout_marginStart="10dp"
/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="10dp"
android:background="#F0F0F0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnSpeedSet"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -66,7 +66,6 @@ dependencies {
implementation project(':core:mogo-core-function-call')
}
implementation rootProject.ext.dependencies.mogoobuold
implementation rootProject.ext.dependencies.mogoobu
}

View File

@@ -22,6 +22,7 @@ class MoGoObuProvider : IMoGoObuProvider {
private var mContext: Context? = null
private val taxiObuIp = "192.168.1.199" //taxi和bus网段统一
// private val taxiObuIp = "192.168.0.53" //室内测试环境
override val functionName: String
get() = TAG
@@ -75,19 +76,19 @@ class MoGoObuProvider : IMoGoObuProvider {
ipAddress,
CommonUtils.getIpAddressString()
)
//连接old obu
MogoPrivateObuManager.INSTANCE.connectObu(it, ipAddress)
}
}
}
override fun disConnect() {
MogoPrivateObuManager.INSTANCE.disConnectObu()
MogoPrivateObuNewManager.INSTANCE.disConnectObu()
}
override fun isConnected(): Boolean {
return MogoPrivateObuManager.INSTANCE.isConnected()
return MogoPrivateObuNewManager.INSTANCE.isConnected()
}
override fun setObuLibLog(isSet: Boolean) {
MogoPrivateObuNewManager.INSTANCE.setObuLog(isSet)
}
}

View File

@@ -30,10 +30,12 @@ import com.mogo.support.obu.MogoObuManager
import com.mogo.support.obu.OnMogoObuListener
import com.mogo.support.obu.constants.MogoObuComType
import com.mogo.support.obu.constants.MogoObuConstants
import com.mogo.support.obu.constants.MogoObuLogLevel
import com.mogo.support.obu.constants.MogoObuTopicId
import com.mogo.support.obu.model.*
import com.mogo.support.obu.model.advance.SpatLight
import com.mogo.support.obu.option.MogoObuCom
import com.mogo.support.obu.option.MogoObuLog
import com.mogo.support.obu.option.MogoObuOptions
import org.json.JSONObject
@@ -75,7 +77,7 @@ class MogoPrivateObuNewManager private constructor() {
.build()
//每次连接的时候如果连接连接了,先断开
if (MogoObuManager.getInstance().connectStatus == 1) {
if (MogoObuManager.getInstance().connectStatus == MogoObuConstants.CONNECT_STATUS.CONNECTED) {
try {
MogoObuManager.getInstance().disconnect()
} catch (e: Exception) {
@@ -86,6 +88,35 @@ class MogoPrivateObuNewManager private constructor() {
MogoObuManager.getInstance().connect(options)
}
/**
* 断开新obu
*/
fun disConnectObu() {
try {
MogoObuManager.getInstance().disconnect()
} catch (e: Exception) {
e.printStackTrace()
}
}
/**
* 新obu是否连接
*/
fun isConnected(): Boolean {
return MogoObuManager.getInstance().connectStatus == MogoObuConstants.CONNECT_STATUS.CONNECTED
}
fun setObuLog(isChecked: Boolean) {
MogoObuManager.getInstance().setEnableLog(isChecked)
val builder: com.mogo.support.obu.option.MogoObuLog.Builder =
MogoObuLog.newBuilder().setEnableStdio(isChecked)
if (isChecked) {
builder.setStdioLevel(MogoObuLogLevel.DBG)
}
MogoObuManager.getInstance().logConfig(builder.build())
}
fun getMogoObuListener(): OnMogoObuListener {
return mogoObuListener
}
@@ -167,7 +198,7 @@ class MogoPrivateObuNewManager private constructor() {
if (HmiBuildConfig.isShowObuV2vView) {
mObuStatusInfo.obuRvStatus = true
CallerObuListenerManager.invokeListener(mObuStatusInfo)
if (!data.warningMsg.warningData.isNullOrEmpty()) {
if (data.warningMsg != null) {
// 更新数据远车数据之前要匹配uuid
TrafficDataConvertUtilsNew.cvxRvInfoIndInfo2TrafficData(data)?.let {
CallerMapUIServiceManager.getMarkerService()?.updateITrafficLocationInfo(it)
@@ -183,29 +214,26 @@ class MogoPrivateObuNewManager private constructor() {
var appId = ""
var level = -1
var status = -1
data.warningMsg?.let {
if (data.warningMsg.warningData != null && data.warningMsg.warningData.size > 0) {
level = data.warningMsg.warningData[0].warningLevel
appId = data.warningMsg.warningData[0].warningType.toString()
status = data.warningMsg.warningData[0].status
//30秒内同一个事件只出现一次
if (rvMap.containsKey(appId)) {
var oldTime = rvMap[appId]
var timeDiff = (System.currentTimeMillis() - oldTime!!) / 1000
if (timeDiff < 30) {
return
}
rvMap.remove(appId)
rvMap[appId] = System.currentTimeMillis()
} else {
rvMap[appId] = System.currentTimeMillis()
if (data.warningMsg.warningData != null && data.warningMsg.warningData.size > 0) {
level = data.warningMsg.warningData[0].warningLevel
appId = data.warningMsg.warningData[0].warningType.toString()
status = data.warningMsg.warningData[0].status
//30秒内同一个事件只出现一次
if (rvMap.containsKey(appId)) {
var oldTime = rvMap[appId]
var timeDiff = (System.currentTimeMillis() - oldTime!!) / 1000
if (timeDiff < 30) {
return
}
rvMap.remove(appId)
rvMap[appId] = System.currentTimeMillis()
} else {
rvMap[appId] = System.currentTimeMillis()
}
//拼凑数据
if (appId != null) {
handleSdkObu(appId, direction, status, level, data)
}
//拼凑数据
if (appId != null) {
handleSdkObu(appId, direction, status, level, data)
}
}

View File

@@ -1,133 +0,0 @@
package com.mogo.eagle.core.function.obu.mogo.utils
import com.mogo.eagle.core.data.traffic.TrafficData
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
import com.zhidao.support.obu.constants.ObuConstants
import com.zhidao.support.obu.model.CvxPtcThreatIndInfo
import com.zhidao.support.obu.model.CvxRtiThreatIndInfo
import com.zhidao.support.obu.model.CvxRvInfoIndInfo
import com.zhidao.support.obu.model.CvxV2vThreatIndInfo
/**
* @author xiaoyuzhou
* @date 2021/8/18 2:30 下午
*/
object TrafficDataConvertUtils {
val TAG = "TrafficDataConvertUtils"
/**
* OBU 远车 转换交通元素数据
*/
fun cvxRvInfoIndInfo2TrafficData(info: CvxRvInfoIndInfo): TrafficData? {
if (info.basic_info == null || info.basic_info.position == null) {
CallerLogger.e("$M_OBU$TAG", "cvxRvInfoIndInfo2TrafficData 数据转换异常,请检查参数是否齐全")
return null
}
val trafficData = TrafficData()
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_TA_CHE
trafficData.uuid = info.vehicle_id
trafficData.lat = info.basic_info.position.latitude
trafficData.lon = info.basic_info.position.longitude
trafficData.heading = info.basic_info.heading
trafficData.speed = info.basic_info.speed
return trafficData
}
/**
* OBU RSU道路事件预警信息 转换交通元素数据
*/
fun cvxRtiThreatIndInfo2TrafficData(info: CvxRtiThreatIndInfo): TrafficData? {
// 这里只处理道路施工
if(info.ext_info.rti_type != 0x7){
return null
}
if (info.rti_id == null || info.ext_info == null
|| info.zones_info == null || info.zones_info.first() == null
|| info.zones_info.first().path_points.first() == null
|| info.threat_info == null
) {
CallerLogger.e("$M_OBU$TAG", "数据转换异常,请检查参数是否齐全")
return null
}
val trafficData = TrafficData()
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_DAO_LU_SHI_GONG
trafficData.uuid = info.rti_id
trafficData.lat = info.zones_info.first().path_points.first().latitude
trafficData.lon = info.zones_info.first().path_points.first().longitude
trafficData.threatLevel = info.threat_info.threat_level
return trafficData
}
/**
* OBU 预警事件 转换交通元素数据
*/
fun cvxV2vThreatIndInfo2TrafficData(info: CvxV2vThreatIndInfo): TrafficData? {
if (info.basic_info == null || info.basic_info.position == null || info.threat_info == null) {
CallerLogger.e("$M_OBU$TAG", "数据转换异常,请检查参数是否齐全")
return null
}
val trafficData = TrafficData()
trafficData.uuid = info.vehicle_id
trafficData.lat = info.basic_info.position.latitude
trafficData.lon = info.basic_info.position.longitude
trafficData.heading = info.basic_info.heading
trafficData.speed = info.basic_info.speed
// 判断车辆V2X预警级别调整车辆颜色
trafficData.threatLevel = info.threat_info.threat_level
if (info.threat_info.app_id == ObuConstants.USE_CASE_ID.EVW) {
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_SPECIAL_VEHICLE
} else {
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_TA_CHE
}
return trafficData
}
/**
* OBU 弱势交通参与者信息 转换交通元素数据 TODO
*/
fun cvxPtcThreatIndInfo2TrafficData(info: CvxPtcThreatIndInfo): TrafficData? {
if (info.ptc_pos == null || info.threat_info == null) {
CallerLogger.e("$M_OBU$TAG", "数据转换异常,请检查参数是否齐全")
return null
}
val trafficData = TrafficData()
trafficData.uuid = info.ptc_id
trafficData.lat = info.ptc_pos.latitude
trafficData.lon = info.ptc_pos.longitude
// trafficData.heading = info.ptc_pos.heading
// trafficData.speed = info.ptc_pos.speed
when (info.ptc_type) {
// 未知
0x0 -> {
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI
}
// 非机动车
0x1 -> {
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_MOTO
}
// 行人
0x2 -> {
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_PEOPLE
}
}
// 判断车辆V2X预警级别调整车辆颜色
if (info.threat_info != null) {
trafficData.threatLevel = info.threat_info.threat_level
}
return trafficData
}
}

View File

@@ -61,6 +61,8 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
* @param trafficLights 感知红绿灯
*/
override fun onAutopilotPerceptionTrafficLight(trafficLights: TrafficLightOuterClass.TrafficLights?) {
Log.i(TAG,"hasObuLightStatus="+hasObuLightStatus + " hasAiLightStatus="+hasAiLightStatus)
Log.i(TAG,"时间:"+com.mogo.eagle.core.utilcode.util.TimeUtils.millis2String(System.currentTimeMillis()))
if (!hasObuLightStatus) {
if (!hasAiLightStatus) {
trafficLights?.let { it ->
@@ -75,30 +77,39 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
light = it.uTurn
}
if (light == null) {
Log.i(TAG,"light为空")
//隐藏红绿灯显示
TrafficLightHMIManager.INSTANCE.hideTrafficLight()
} else {
Log.i(TAG,"light.state="+light.state)
when (light.state) {
TrafficLightOuterClass.LightState.STATE_RED -> {
Log.i(TAG,"显示红灯")
//红灯
CallerHmiManager.showWarningTrafficLight(1, 2)
CallerHmiManager.changeCountdownGreen(0)
}
TrafficLightOuterClass.LightState.STATE_YELLOW -> {
Log.i(TAG,"显示黄灯")
//黄灯
CallerHmiManager.showWarningTrafficLight(2, 2)
CallerHmiManager.changeCountdownGreen(0)
}
TrafficLightOuterClass.LightState.STATE_GREEN -> {
Log.i(TAG,"显示绿灯")
//绿灯
CallerHmiManager.showWarningTrafficLight(3, 2)
CallerHmiManager.changeCountdownGreen(0)
}
TrafficLightOuterClass.LightState.STATE_OFF -> {
Log.i(TAG,"隐藏显示")
//黑灯,隐藏红绿灯显示
TrafficLightHMIManager.INSTANCE.hideTrafficLight()
}
else -> {}
else -> {
Log.i(TAG,"直接其他情况")
TrafficLightHMIManager.INSTANCE.hideTrafficLight()
}
}
}

View File

@@ -8,7 +8,7 @@ package com.mogo.eagle.core.data.badcase
class BagInfoEntity(){
var key: Long = 0// bag key值
var totalSize: Long = 0// 所有子包或合并后的包的总大小
var timestamp: String ?= null// 时间戳
var timestamp: String = ""// 时间戳
var bagPath: String ?= null// bag所在路径
var mergeStat: Boolean = false// 合并状态
var uploadStat: Boolean = false// 上传cos桶状态

View File

@@ -6,8 +6,6 @@ package com.mogo.eagle.core.data.obu
* OBU 相关的状态信息数据
*/
class ObuStatusInfo {
// 当前链接的IP地址, 默认地址 192.168.1.199
var connectIP: String = "192.168.1.199"
var obuSdkVersion = ""

View File

@@ -14,4 +14,6 @@ interface IMoGoObuProvider : IMoGoFunctionServerProvider {
fun disConnect()
fun isConnected(): Boolean
fun setObuLibLog(isSet: Boolean)
}

View File

@@ -41,4 +41,11 @@ object CallerOBUManager {
return providerApi.isConnected()
}
/**
* 设置obu sdk的 日志
*/
fun setObuLog(isSet: Boolean) {
providerApi.setObuLibLog(isSet)
}
}