Merge branch 'dev_robobus-m1-p-app-module_1.0.0_230112_1.0.0' of gitlab.zhidaoauto.com:zhjt/AndroidApp/MoGoEagleEye into dev_robobus-m1-p-app-module_1.0.0_230112_1.0.0
This commit is contained in:
@@ -27,24 +27,40 @@ object V2xObuEventManager : IMoGoObuSaveMessageListener {
|
||||
CallerObuSaveMessageListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
private val obuDataMap = mutableMapOf<String, Long>()
|
||||
|
||||
/**
|
||||
* @param type 事件id,类似与uuid
|
||||
* @param content 事件内容
|
||||
* @param tts 事件语音播报
|
||||
* @param tts 事件语音播报 //30秒内同一个事件只出现一次 TODO 临时添加,后面宏宇统一在数据中心处理
|
||||
*/
|
||||
override fun onMoGoObuSaveMessage(type: String, content: String, tts: String, source: DataSourceType) {
|
||||
CallerMsgBoxManager.saveMsgBox(
|
||||
MsgBoxBean(
|
||||
MsgBoxType.V2X,
|
||||
V2XMsg(
|
||||
type,
|
||||
content,
|
||||
tts
|
||||
)
|
||||
).apply {
|
||||
sourceType = source
|
||||
if (content.isNotEmpty()) {
|
||||
if (obuDataMap.containsKey(type)) {
|
||||
var oldTime = obuDataMap[type]
|
||||
var timeDiff = (System.currentTimeMillis() - oldTime!!) / 1000
|
||||
if (timeDiff < 30) {
|
||||
return
|
||||
}
|
||||
obuDataMap.remove(type)
|
||||
obuDataMap[type] = System.currentTimeMillis()
|
||||
} else {
|
||||
obuDataMap[type] = System.currentTimeMillis()
|
||||
}
|
||||
)
|
||||
|
||||
CallerMsgBoxManager.saveMsgBox(
|
||||
MsgBoxBean(
|
||||
MsgBoxType.V2X,
|
||||
V2XMsg(
|
||||
type,
|
||||
content,
|
||||
tts
|
||||
)
|
||||
).apply {
|
||||
sourceType = source
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fun release() {
|
||||
|
||||
@@ -44,7 +44,7 @@ MogoObuManager.getInstance().init(Context context);
|
||||
```
|
||||
## 连接
|
||||
```java
|
||||
//默认192.168.1.199
|
||||
//默认
|
||||
MogoObuManager.getInstance().connect();
|
||||
//自定义 IP
|
||||
MogoObuManager.getInstance().connect(String ip);
|
||||
|
||||
@@ -45,28 +45,30 @@ android {
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation rootProject.ext.dependencies.androidxccorektx
|
||||
implementation rootProject.ext.dependencies.androidxappcompat
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
implementation rootProject.ext.dependencies.rxandroid
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
implementation rootProject.ext.dependencies.androidxroomruntime
|
||||
kapt rootProject.ext.dependencies.androidxroomcompiler
|
||||
implementation rootProject.ext.dependencies.androidxroomktx
|
||||
|
||||
implementation rootProject.ext.dependencies.mogoaicloudtelematic
|
||||
implementation project(':libraries:mogo-obu')
|
||||
implementation project(':libraries:mogo-adas')
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogo_core_utils
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_call
|
||||
implementation rootProject.ext.dependencies.mogocommons
|
||||
implementation rootProject.ext.dependencies.androidxccorektx
|
||||
implementation rootProject.ext.dependencies.androidxappcompat
|
||||
implementation project(':libraries:mogo-obu')
|
||||
implementation project(':libraries:mogo-adas')
|
||||
implementation project(":foudations:mogo-aicloud-services-sdk")
|
||||
implementation project(':core:mogo-core-data')
|
||||
} else {
|
||||
implementation project(':core:mogo-core-utils')
|
||||
implementation rootProject.ext.dependencies.androidxccorektx
|
||||
implementation rootProject.ext.dependencies.androidxappcompat
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
implementation rootProject.ext.dependencies.rxandroid
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
implementation rootProject.ext.dependencies.androidxroomruntime
|
||||
kapt rootProject.ext.dependencies.androidxroomcompiler
|
||||
implementation rootProject.ext.dependencies.androidxroomktx
|
||||
|
||||
implementation project(':libraries:mogo-obu')
|
||||
implementation project(':libraries:mogo-adas')
|
||||
implementation rootProject.ext.dependencies.mogoaicloudtelematic
|
||||
implementation project(':core:mogo-core-function-call')
|
||||
implementation project(':foudations:mogo-commons')
|
||||
implementation project(":foudations:mogo-commons")
|
||||
}
|
||||
}
|
||||
|
||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||
//apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.mogo.eagle.core.function.datacenter.aicloud
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.cloud.socket.SocketManager
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider
|
||||
|
||||
@@ -13,13 +12,15 @@ class AiCloudSocketBizProvider : IMoGoFunctionServerProvider {
|
||||
get() = "AiCloudSocketBizProvider"
|
||||
|
||||
override fun init(context: Context?) {
|
||||
SocketManager.getInstance().init(AbsMogoApplication.getApp(), 0.0, 0.0)
|
||||
SocketManager.getInstance().registerOnMessageListener(401012, V2XMessageListener401012())
|
||||
SocketManager.getInstance().registerOnMessageListener(401018, V2XMessageListener401018())
|
||||
SocketManager.getInstance().registerOnMessageListener(402000, V2XMessageListener402000())
|
||||
SocketManager.getInstance().registerOnMessageListener(404000, V2XMessageListener404000())
|
||||
//SocketManager.getInstance().registerOnMessageListener(503000, V2XMessageListener503000())
|
||||
SocketManager.getInstance().registerOnMessageListener(70001, V2XMessageListener70001())
|
||||
context?.let {
|
||||
SocketManager.getInstance().init(it, 0.0, 0.0)
|
||||
SocketManager.getInstance().registerOnMessageListener(401012, V2XMessageListener401012())
|
||||
SocketManager.getInstance().registerOnMessageListener(401018, V2XMessageListener401018())
|
||||
SocketManager.getInstance().registerOnMessageListener(402000, V2XMessageListener402000())
|
||||
SocketManager.getInstance().registerOnMessageListener(404000, V2XMessageListener404000())
|
||||
//SocketManager.getInstance().registerOnMessageListener(503000, V2XMessageListener503000())
|
||||
SocketManager.getInstance().registerOnMessageListener(70001, V2XMessageListener70001())
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
|
||||
@@ -3,12 +3,14 @@ package com.mogo.eagle.core.function.datacenter.autopilot
|
||||
import android.Manifest.permission
|
||||
import android.content.Context
|
||||
import androidx.annotation.RequiresPermission
|
||||
import bag_manager.BagManagerOuterClass
|
||||
import chassis.SpecialVehicleTaskCmdOuterClass
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.autopilot.toAutoPilotLine
|
||||
import com.mogo.eagle.core.data.autopilot.toRouteInfo
|
||||
import com.mogo.eagle.core.data.badcase.BagManagerEntity
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.constants.MoGoConfig
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
@@ -52,7 +54,7 @@ import com.zhidao.support.adas.high.common.Constants
|
||||
import com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils
|
||||
import com.zhidao.support.adas.high.common.MessageType
|
||||
import com.zhidao.support.adas.high.common.MogoReport
|
||||
import com.zhjt.mogo.adas.data.bean.MogoReport
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import com.zhjt.service.chain.TracingConstants
|
||||
import io.netty.channel.Channel
|
||||
@@ -546,6 +548,108 @@ class MoGoAutopilotControlProvider :
|
||||
return AdasManager.getInstance().sendRecordDataConfigReq(reqType, recordType, topicsNeedToCache)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据采集录制模式配置列表
|
||||
* @param reqType 0: all, 1:获取当前所有topic列表, 2:配置需要预加载的topic组合
|
||||
* @param recordType 0:不需要修改内置类型的topic组合, 1:需要修改内置类型的topic组合
|
||||
* @param topicsNeedToCache
|
||||
* @return boolean
|
||||
*/
|
||||
override fun sendBagManagerCmd(bagManagerEntity: BagManagerEntity): Boolean {
|
||||
val bagManager = BagManagerOuterClass.BagManager
|
||||
.newBuilder()
|
||||
.setReqType(bagManagerEntity.reqType)
|
||||
.setKeyReq(bagManagerEntity.keyReq)
|
||||
|
||||
// 更新包附加信息,发送请求且reqType=5时有效
|
||||
val descReq = BagManagerOuterClass.BagDescription
|
||||
.newBuilder()
|
||||
bagManagerEntity.descReq?.let {
|
||||
descReq.description = it.description
|
||||
descReq.hasAudio = it.hasAudio
|
||||
descReq.audioUrl = it.audioUrl
|
||||
descReq.setReportBI(it.reportBI)
|
||||
}
|
||||
bagManager.descReq = descReq.build()
|
||||
|
||||
// 空间使用信息,获取响应且reqType=1时有效
|
||||
for(diskSpaceInfoEntity in bagManagerEntity.spaceInfoResp){
|
||||
val spaceInfoResp = BagManagerOuterClass.BagSpaceInfo
|
||||
.newBuilder()
|
||||
val diskSpaceInfo = BagManagerOuterClass.SpaceInfo
|
||||
.newBuilder()
|
||||
.setDirectory(diskSpaceInfoEntity.diskSpaceInfo.directory)
|
||||
.setTotal(diskSpaceInfoEntity.diskSpaceInfo.total)
|
||||
.setFree(diskSpaceInfoEntity.diskSpaceInfo.free)
|
||||
.setUsed(diskSpaceInfoEntity.diskSpaceInfo.used)
|
||||
.build()
|
||||
spaceInfoResp
|
||||
.setHost(diskSpaceInfoEntity.host).diskSpaceInfo = diskSpaceInfo
|
||||
for(entity in diskSpaceInfoEntity.BagDirsSpaceInfo){
|
||||
val bagDirsSpaceInfo = BagManagerOuterClass.SpaceInfo
|
||||
.newBuilder()
|
||||
.setDirectory(entity.directory)
|
||||
.setTotal(entity.total)
|
||||
.setFree(entity.free)
|
||||
.setUsed(entity.used)
|
||||
.build()
|
||||
spaceInfoResp.addBagDirsSpaceInfo(bagDirsSpaceInfo)
|
||||
}
|
||||
bagManager.addSpaceInfoResp(spaceInfoResp.build())
|
||||
}
|
||||
|
||||
// 包信息列表,获取响应且reqType=2时有效
|
||||
for(bagsInfoRespEntity in bagManagerEntity.bagsInfoResp){
|
||||
if(bagsInfoRespEntity.itemType == 0){
|
||||
// 包描述信息
|
||||
val bagDescription = BagManagerOuterClass.BagDescription
|
||||
.newBuilder()
|
||||
bagsInfoRespEntity.description?.let {
|
||||
bagDescription.description = it.description
|
||||
bagDescription.hasAudio = it.hasAudio
|
||||
bagDescription.audioUrl = it.audioUrl
|
||||
bagDescription.setReportBI(it.reportBI)
|
||||
}
|
||||
|
||||
val bagsInfoResp = BagManagerOuterClass.BagInfo
|
||||
.newBuilder()
|
||||
.setKey(bagsInfoRespEntity.key)
|
||||
.setTotalSize(bagsInfoRespEntity.totalSize)
|
||||
.setTimestamp(bagsInfoRespEntity.timestamp)
|
||||
.setBagPath(bagsInfoRespEntity.bagPath)
|
||||
.setMergeStat(bagsInfoRespEntity.mergeStat)
|
||||
.setUploadStat(bagsInfoRespEntity.uploadStat)
|
||||
.setDescription(bagDescription.build())
|
||||
|
||||
// 子包信息
|
||||
for(subBagEntity in bagsInfoRespEntity.subBags){
|
||||
val subBag = BagManagerOuterClass.SubBag
|
||||
.newBuilder()
|
||||
.setKey(subBagEntity.key)
|
||||
.setHost(subBagEntity.host)
|
||||
.setSize(subBagEntity.size)
|
||||
.build()
|
||||
bagsInfoResp.addSubBags(subBag)
|
||||
}
|
||||
bagManager.addBagsInfoResp(bagsInfoResp)
|
||||
}
|
||||
}
|
||||
|
||||
//反馈上传cos桶结果,获取响应且reqType=3时有效
|
||||
val uploadCosResp = BagManagerOuterClass.UploadCosStat
|
||||
.newBuilder()
|
||||
|
||||
bagManagerEntity.uploadCosResp?.let {
|
||||
uploadCosResp.key = it.key
|
||||
uploadCosResp.stat = it.stat
|
||||
uploadCosResp.message = it.message
|
||||
bagManager.uploadCosResp = uploadCosResp.build()
|
||||
}
|
||||
|
||||
|
||||
return AdasManager.getInstance().sendBagManagerCmd(bagManager.build())
|
||||
}
|
||||
|
||||
/**
|
||||
* 向左变道
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.mogo.eagle.core.function.datacenter.autopilot.adapter
|
||||
|
||||
import android.content.Context
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.commons.debug.DebugConfig.*
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.mogo.eagle.core.function.datacenter.location
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.constants.SharedPrefsConstants
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
@@ -13,7 +11,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02Lis
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerGaoDeMapLocationListenerManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.util.MultiDisplayUtils
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import mogo.telematics.pad.MessagePad
|
||||
@@ -119,25 +116,6 @@ object MoGoLocationDispatcher :
|
||||
}
|
||||
}
|
||||
|
||||
// 本地SP缓存城市Code
|
||||
val cityCode = mogoLocation.cityCode
|
||||
if (cityCode != null && cityCode.isNotEmpty()) {
|
||||
mCityCode = mogoLocation.cityCode
|
||||
SharedPrefsMgr.getInstance(AbsMogoApplication.getApp())
|
||||
.putString(SharedPrefsConstants.LOCATION_CITY_CODE, cityCode)
|
||||
|
||||
SharedPrefsMgr.getInstance(AbsMogoApplication.getApp())
|
||||
.putString(
|
||||
SharedPrefsConstants.LOCATION_LATITUDE,
|
||||
mogoLocation.latitude.toString()
|
||||
)
|
||||
SharedPrefsMgr.getInstance(AbsMogoApplication.getApp())
|
||||
.putString(
|
||||
SharedPrefsConstants.LOCATION_LONGITUDE,
|
||||
mogoLocation.longitude.toString()
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.eagle.core.data.constants.MoGoConfig
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.data.obu.MogoObuConst
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuProvider
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
|
||||
@@ -18,7 +19,6 @@ import com.mogo.eagle.core.utilcode.util.CommonUtils
|
||||
class MoGoObuProvider : IMoGoObuProvider {
|
||||
private val TAG = "MoGoObuProvider"
|
||||
private var mContext: Context? = null
|
||||
private val taxiObuIp = "192.168.1.199" //obu的taxi和bus的ip已经全部统一成1网段ip
|
||||
|
||||
override val functionName: String
|
||||
get() = TAG
|
||||
@@ -36,7 +36,7 @@ class MoGoObuProvider : IMoGoObuProvider {
|
||||
mContext = context
|
||||
mContext?.let {
|
||||
val ipAddress =
|
||||
SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, taxiObuIp)
|
||||
SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, MogoObuConst.OBU_DEFAULT_IP)
|
||||
//mogo obu
|
||||
MogoPrivateObuNewManager.INSTANCE.connectObu(
|
||||
it,
|
||||
@@ -44,6 +44,9 @@ class MoGoObuProvider : IMoGoObuProvider {
|
||||
CommonUtils.getIpAddressString()
|
||||
)
|
||||
}
|
||||
|
||||
//监听obu版本数据
|
||||
MogoPrivateObuNewManager.INSTANCE.readSystemConfig()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,4 +77,12 @@ class MoGoObuProvider : IMoGoObuProvider {
|
||||
override fun setObuLog(isChecked: Boolean) {
|
||||
MogoPrivateObuNewManager.INSTANCE.setObuLog(isChecked)
|
||||
}
|
||||
|
||||
override fun uploadObuPack(filePathArray: Array<String>) {
|
||||
MogoPrivateObuNewManager.INSTANCE.uploadObuPack(filePathArray)
|
||||
}
|
||||
|
||||
override fun deleteObuFile() {
|
||||
MogoPrivateObuNewManager.INSTANCE.deleteObuFile()
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package com.mogo.eagle.core.function.datacenter.obu;
|
||||
|
||||
/**
|
||||
* author : lxiiaopeng
|
||||
* date : 2021-08-4
|
||||
* desc : 常量
|
||||
*/
|
||||
public class MogoObuConst {
|
||||
|
||||
/**
|
||||
* 自研obu的tag
|
||||
*/
|
||||
public static final String TAG_MOGO_OBU = "MogoObu";
|
||||
|
||||
public static final String TAG_MOGO_NEW_OBU = "MogoNewObu";
|
||||
|
||||
// OBU 场景测试
|
||||
// 场景类型
|
||||
public static String BROADCAST_OBU_TYPE_EXTRA_KEY = "obuType";
|
||||
// 场景操作状态,ObuConstants.STATUS
|
||||
public static String BROADCAST_OBU_STATES_EXTRA_KEY = "obuStates";
|
||||
// 场景预警等级,2-弹窗,3-弹窗+tts+地图绘制
|
||||
public static String BROADCAST_OBU_LEVEL_EXTRA_KEY = "obuLevel";
|
||||
//红绿灯标识 0:不可用,1:红灯,2:绿灯,3:黄灯
|
||||
public static String BROADCAST_LIGHT_LEVEL_EXTRA_KEY = "lightLevel";
|
||||
//弱势交通 0:未知,1:非机动车,2:行人
|
||||
public static String BROADCAST_PTC_INFO_EXTRA_KEY = "ptcInfo";
|
||||
//道路交通信息类型 0x0--0x17
|
||||
public static String BROADCAST_RTI_TYPE_EXTRA_KEY = "rtiType";
|
||||
//道路交通信息触发方向 0x11--0x47
|
||||
public static String BROADCAST_OBU_EVENT_DIRECTION_EXTRA_KEY = "obuEventDirection";
|
||||
|
||||
}
|
||||
@@ -229,6 +229,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
|
||||
|
||||
//限速预警, ADD处理一次
|
||||
MogoObuConstants.RSI_SCENE_TYPE.SLW.toString() -> {
|
||||
appId = EventTypeEnumNew.TYPE_USECASE_ID_ROAD_SPEED_LIMIT.poiType
|
||||
alertContent = EventTypeEnumNew.getWarningContent(appId)
|
||||
ttsContent = EventTypeEnumNew.getWarningTts(appId)
|
||||
}
|
||||
|
||||
@@ -4,10 +4,12 @@ import android.content.Context
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.data.enums.*
|
||||
import com.mogo.eagle.core.data.obu.MogoObuConst
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.api.map.angle.Default
|
||||
import com.mogo.eagle.core.function.api.map.angle.TooClose
|
||||
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.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
|
||||
@@ -18,8 +20,10 @@ import com.mogo.eagle.core.function.call.obu.CallerObuWarningListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.function.datacenter.obu.utils.TrafficDataConvertUtilsNew
|
||||
import com.mogo.eagle.core.utilcode.breakpoint.Config
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
|
||||
import com.mogo.eagle.core.utilcode.util.FileUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.support.obu.ObuBase
|
||||
import com.mogo.support.obu.ObuScene
|
||||
@@ -31,6 +35,8 @@ import com.mogo.support.obu.model.*
|
||||
import com.mogo.support.obu.option.MogoObuCom
|
||||
import com.mogo.support.obu.option.MogoObuLog
|
||||
import com.mogo.support.obu.option.MogoObuOptions
|
||||
import com.mogo.support.obu.upgrade.ObuSoftwareUpgradeStatus
|
||||
import com.mogo.support.obu.upgrade.OnUpgradeListener
|
||||
import com.zhidao.support.obu.ObuManager
|
||||
import com.zhidao.support.obu.OnObuListener
|
||||
import mogo.telematics.pad.MessagePad
|
||||
@@ -42,7 +48,7 @@ import kotlin.math.roundToInt
|
||||
* @since 2021/8/23
|
||||
* @description 自研OBU 管理
|
||||
*/
|
||||
class MogoPrivateObuNewManager private constructor() {
|
||||
class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
|
||||
companion object {
|
||||
val INSTANCE: MogoPrivateObuNewManager by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
MogoPrivateObuNewManager()
|
||||
@@ -50,9 +56,12 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
}
|
||||
|
||||
private var mObuStatusInfo = CallerObuConnectListenerManager.getObuStatusInfo()
|
||||
private var mContext: Context? = null
|
||||
var mVersionName: String? = null
|
||||
|
||||
fun connectObu(context: Context, obuIpAddress: String, padIpAddress: String) {
|
||||
ObuManager.getInstance().registerObuListener(mogoObuListener)
|
||||
mContext = context
|
||||
val com = MogoObuCom.newBuilder()
|
||||
.setLocalIp(padIpAddress)
|
||||
.setComType(MogoObuComType.UDP)
|
||||
@@ -82,6 +91,65 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
ObuManager.getInstance().connect(options)
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传obu文件的状态, 升级成功,需要删除obu的文件和解压文件夹
|
||||
*/
|
||||
override fun onUpgradeStatus(status: ObuSoftwareUpgradeStatus?, t: Throwable?) {
|
||||
CallerLogger.d("$M_OBU${MogoObuConst.TAG_UPGRADE_OBU}", "onUpgradeStatus status = $status ")
|
||||
//上传完成就相当于成功了,立即升级,比上电升级,只是多了一个重启
|
||||
if (status == ObuSoftwareUpgradeStatus.UPLOAD_FINISH|| status == ObuSoftwareUpgradeStatus.EXEC_UPGRADE_PROGRAM_FINISH
|
||||
|| status == ObuSoftwareUpgradeStatus.CONNECTION_FAILED|| status == ObuSoftwareUpgradeStatus.AUTHENTICATION_FAILED
|
||||
|| status == ObuSoftwareUpgradeStatus.CHANNEL_ABNORMITY|| status == ObuSoftwareUpgradeStatus.UPGRADE_PACKAGE_ERROR
|
||||
|| status == ObuSoftwareUpgradeStatus.UPGRADE_PACKAGE_CHECK_FAILED || status == ObuSoftwareUpgradeStatus.PACKAGE_UPLOAD_FAILED
|
||||
|| status == ObuSoftwareUpgradeStatus.EXEC_UPGRADE_PROGRAM_FAILED || status == ObuSoftwareUpgradeStatus.UNKNOWN) {
|
||||
|
||||
deleteObuFile()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前的obu版本
|
||||
*/
|
||||
override fun onCurrentVersion(version: MogoObuSystemBConfigData) {
|
||||
CallerLogger.d("$M_OBU${MogoObuConst.TAG_UPGRADE_OBU}", "onCurrentVersion version = ${version.version}")
|
||||
if (!version.version.isNullOrEmpty()) {
|
||||
mVersionName = version.version
|
||||
CallerDevaToolsManager.queryObuUpgrade(version.version)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除obu相关的文件夹
|
||||
*/
|
||||
fun deleteObuFile(){
|
||||
UiThreadHandler.post {
|
||||
var isDeleteSuccess = FileUtils.delete(Config.downLoadObuPath)
|
||||
var isDeleteUnzipSuccess = FileUtils.delete(Config.downLoadUnzipObuPath)
|
||||
CallerLogger.d("$M_OBU${MogoObuConst.TAG_UPGRADE_OBU}", "deleteObuFile isDeleteSuccess = $isDeleteSuccess ----isDeleteUnzipSuccess = $isDeleteUnzipSuccess")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 监听obu
|
||||
*/
|
||||
fun readSystemConfig() {
|
||||
ObuManager.getInstance().readSystemBConfig(mContext, MogoObuConst.OBU_DEFAULT_IP, this)
|
||||
}
|
||||
|
||||
/**
|
||||
* 传递obu升级包给硬件
|
||||
* @param upgradePackage 升级包文件绝对路径 只能包含 升级包MD5文件和升级包文件
|
||||
* @param isUpgradeNow 是否立即升级
|
||||
* false:OBU设备下次上电时执行升级程序
|
||||
* ture: OBU设备立即执行升级程序 TODO 警告:执行立即升级时请确保车辆是静止状态。车辆在运行过程中升级设备可能会影响驾驶,严重时可能造成安全隐患!!!
|
||||
* @param listener 升级回调
|
||||
* @return 是否调用成功
|
||||
*/
|
||||
fun uploadObuPack(filePathArray: Array<String>) {
|
||||
CallerLogger.d("$M_OBU${MogoObuConst.TAG_UPGRADE_OBU}", " uploadObuPack filePathArray = $filePathArray")
|
||||
ObuManager.getInstance().uploadUpgradePackage(MogoObuConst.OBU_DEFAULT_IP, filePathArray,true,this)
|
||||
}
|
||||
|
||||
/**
|
||||
* 断开新obu
|
||||
*/
|
||||
@@ -100,6 +168,9 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
return ObuManager.getInstance().connectStatus == MogoObuConstants.CONNECT_STATUS.CONNECTED
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置obu sdk日志的输出
|
||||
*/
|
||||
fun setObuLog(isChecked: Boolean) {
|
||||
ObuManager.getInstance().setEnableLog(isChecked)
|
||||
val builder: MogoObuLog.Builder =
|
||||
@@ -110,6 +181,9 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
ObuManager.getInstance().logConfig(builder.build())
|
||||
}
|
||||
|
||||
/**
|
||||
* obu 回调监听
|
||||
*/
|
||||
private val mogoObuListener: OnObuListener = object : OnObuListener {
|
||||
/**
|
||||
* 连接状态的改变
|
||||
@@ -154,11 +228,14 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
if (HmiBuildConfig.isShowObuV2vView) {
|
||||
if (data.warningMsg != null) {
|
||||
// 更新数据,远车数据,之前要匹配uuid
|
||||
TrafficDataConvertUtilsNew.cvxRvInfoIndInfo2TrafficData(data.vehBasicsMsg)
|
||||
?.let {
|
||||
CallerMapUIServiceManager.getMarkerService()
|
||||
?.updateITrafficLocationInfo(it)
|
||||
}
|
||||
data.vehBasicsMsg?.let {
|
||||
TrafficDataConvertUtilsNew.cvxRvInfoIndInfo2TrafficData(it)
|
||||
?.let { data ->
|
||||
CallerMapUIServiceManager.getMarkerService()?.updateITrafficLocationInfo(data)
|
||||
}
|
||||
}.also {
|
||||
CallerLogger.e("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "cvxRvInfoIndInfo2TrafficData 数据转换异常,请检查参数是否齐全")
|
||||
}
|
||||
|
||||
CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", data.toString())
|
||||
//预警信息,预警类型 threat_level 2、3
|
||||
@@ -952,9 +1029,16 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
* 保存obu直连数据到消息盒子
|
||||
*/
|
||||
private fun saveObuData(type: String, content: String, tts: String) {
|
||||
CallerObuSaveMessageListenerManager.invokeObuSaveMessage(type, content, tts, DataSourceType.OBU)
|
||||
CallerObuSaveMessageListenerManager.invokeObuSaveMessage(
|
||||
type,
|
||||
content,
|
||||
tts,
|
||||
DataSourceType.OBU
|
||||
)
|
||||
}
|
||||
|
||||
private val ttsMap = mutableMapOf<String, Long>()
|
||||
|
||||
/**
|
||||
* 消息盒子对应消息的语音播报
|
||||
*/
|
||||
@@ -964,6 +1048,19 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
tts: String,
|
||||
direction: WarningDirectionEnum
|
||||
) {
|
||||
//30秒内同一个事件只出现一次 TODO 临时添加,后面宏宇统一在数据中心处理
|
||||
if (ttsMap.containsKey(type)) {
|
||||
var oldTime = ttsMap[type]
|
||||
var timeDiff = (System.currentTimeMillis() - oldTime!!) / 1000
|
||||
if (timeDiff < 30) {
|
||||
return
|
||||
}
|
||||
ttsMap.remove(type)
|
||||
ttsMap[type] = System.currentTimeMillis()
|
||||
} else {
|
||||
ttsMap[type] = System.currentTimeMillis()
|
||||
}
|
||||
|
||||
CallerHmiManager.warningV2X(
|
||||
type,
|
||||
content,
|
||||
|
||||
@@ -6,9 +6,6 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
|
||||
import com.mogo.support.obu.ObuBase
|
||||
import com.mogo.support.obu.ObuScene
|
||||
import com.mogo.support.obu.model.MogoObuRsiWarningData
|
||||
import com.mogo.support.obu.model.MogoObuRsmWarningData
|
||||
import com.mogo.support.obu.model.MogoObuRvWarningData
|
||||
|
||||
/**
|
||||
* @description 自研obu数据转换
|
||||
@@ -23,10 +20,6 @@ object TrafficDataConvertUtilsNew {
|
||||
* OBU 远车 转换交通元素数据,是否需要
|
||||
*/
|
||||
fun cvxRvInfoIndInfo2TrafficData(info: ObuBase.VehicleBasics): TrafficData? {
|
||||
if (info == null) {
|
||||
CallerLogger.e("$M_OBU$TAG", "cvxRvInfoIndInfo2TrafficData 数据转换异常,请检查参数是否齐全")
|
||||
return null
|
||||
}
|
||||
val trafficData = TrafficData()
|
||||
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_TA_CHE
|
||||
trafficData.uuid = info.id
|
||||
@@ -59,7 +52,7 @@ object TrafficDataConvertUtilsNew {
|
||||
* OBU 预警事件 转换交通元素数据 他车预警
|
||||
*/
|
||||
fun cvxV2vThreatIndInfo2TrafficData(info: ObuScene.RvWarningData): TrafficData? {
|
||||
if (info?.vehBasicsMsg == null || info.warningMsg == null) {
|
||||
if (info.vehBasicsMsg == null || info.warningMsg == null) {
|
||||
CallerLogger.e("$M_OBU$TAG", "数据转换异常,请检查参数是否齐全")
|
||||
return null
|
||||
}
|
||||
@@ -70,7 +63,7 @@ object TrafficDataConvertUtilsNew {
|
||||
trafficData.heading = info.vehBasicsMsg.heading
|
||||
trafficData.speed = info.vehBasicsMsg.speed
|
||||
// 判断车辆V2X预警级别,调整车辆颜色
|
||||
if (info.warningMsg.warningDataList != null) {
|
||||
if (info.warningMsg.warningDataList != null && info.warningMsg.warningDataList.size > 0) {
|
||||
trafficData.threatLevel = info.warningMsg.warningDataList[0].warningLevel
|
||||
} else {
|
||||
trafficData.threatLevel = 1
|
||||
@@ -123,7 +116,7 @@ object TrafficDataConvertUtilsNew {
|
||||
}
|
||||
|
||||
// 判断车辆V2X预警级别,调整车辆颜色
|
||||
if (info.warningMsg != null && info.warningMsg.warningDataList != null) {
|
||||
if (info.warningMsg != null && info.warningMsg.warningDataList != null && info.warningMsg.warningDataList.size > 0) {
|
||||
trafficData.threatLevel = info.warningMsg.warningDataList[0].warningLevel
|
||||
} else {
|
||||
trafficData.threatLevel = 1
|
||||
|
||||
@@ -15,7 +15,9 @@ import com.mogo.eagle.core.data.deva.scene.SceneModule
|
||||
import com.mogo.eagle.core.data.deva.scene.SceneTAG
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.function.api.devatools.IDevaToolsProvider
|
||||
import com.mogo.eagle.core.function.api.devatools.apm.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.zhjt.mogo_core_function_devatools.apm.*
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.BadCaseManager
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
||||
import com.zhjt.mogo_core_function_devatools.binding.BindingCarManager.Companion.bindingCarManager
|
||||
@@ -44,6 +46,11 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
|
||||
private var mContext: Context? = null
|
||||
|
||||
private val apmEnvProvider by lazy { ApmEnvProviderImpl }
|
||||
|
||||
@Volatile
|
||||
private var mDockerVersion: String? = null
|
||||
|
||||
override fun init(context: Context) {
|
||||
mContext = context
|
||||
}
|
||||
@@ -63,6 +70,7 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
iPCReportManager.initServer()
|
||||
moFangManager.init(mContext!!)
|
||||
bindingCarManager.init(mContext!!)
|
||||
apmEnvProvider.init(if(DebugConfig.isDebug()) "0" else "1", "${ DebugConfig.getNetMode() }", mDockerVersion ?: "")
|
||||
}
|
||||
|
||||
override fun checkMonitorDb() {
|
||||
@@ -200,10 +208,13 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
}
|
||||
|
||||
override fun envConfigChange(cityCode: String, netMode: Int) {
|
||||
apmEnvProvider.onEnvChanged(if(DebugConfig.isDebug()) "0" else "1", "${ DebugConfig.getNetMode() }", mDockerVersion ?: "")
|
||||
EnvChangeManager.changeTo(cityCode, netMode)
|
||||
}
|
||||
|
||||
override fun dockerVersion(dockerVersion: String?) {
|
||||
mDockerVersion = dockerVersion
|
||||
apmEnvProvider.onEnvChanged(if(DebugConfig.isDebug()) "0" else "1","${ DebugConfig.getNetMode() }", dockerVersion ?: "")
|
||||
BadCaseConfig.dockerVersion = dockerVersion
|
||||
}
|
||||
|
||||
@@ -227,4 +238,9 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
bindingCarManager.queryAppUpgrade()
|
||||
}
|
||||
|
||||
override fun apmEnvProvider(): IApmEnvProvider = apmEnvProvider
|
||||
|
||||
override fun queryObuUpgrade(obuVersionName: String) {
|
||||
bindingCarManager.queryObuUpgrade(obuVersionName)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
package com.zhjt.mogo_core_function_devatools.apm
|
||||
|
||||
import android.os.Process
|
||||
import android.text.TextUtils
|
||||
import android.widget.Toast
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_INIT_ENV_RESTART
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_INIT
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CONNECT_STATUS
|
||||
import com.mogo.eagle.core.function.api.devatools.apm.*
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.zhjt.mogo_core_function_devatools.apm.config.*
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import com.zhjt.service.chain.TracingConstants.Endpoint.Companion.PAD
|
||||
import kotlinx.coroutines.*
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
import java.util.concurrent.atomic.AtomicReference
|
||||
import kotlin.coroutines.*
|
||||
|
||||
object ApmEnvProviderImpl: IApmEnvProvider, CoroutineScope {
|
||||
|
||||
private const val TAG = "ApmEnvProvider"
|
||||
|
||||
private val scope by lazy { CoroutineScope(Dispatchers.IO + SupervisorJob()) }
|
||||
|
||||
private val hasInit by lazy { AtomicBoolean(false) }
|
||||
|
||||
private val mBuildType by lazy { AtomicReference<String>() }
|
||||
private val mNetType by lazy { AtomicReference<String>() }
|
||||
private val mDockerVersion by lazy { AtomicReference<String>() }
|
||||
|
||||
override val coroutineContext: CoroutineContext
|
||||
get() = scope.coroutineContext
|
||||
|
||||
override fun init(buildType: String, netType: String, dockerVersion: String) {
|
||||
launch {
|
||||
if (ApmEnvConfig.isFirstEnter()) {
|
||||
if (!TextUtils.isEmpty(buildType)) {
|
||||
ApmEnvConfig.setBuildType(buildType)
|
||||
}
|
||||
if (!TextUtils.isEmpty(netType)) {
|
||||
ApmEnvConfig.setNetType(netType)
|
||||
}
|
||||
if (!TextUtils.isEmpty(dockerVersion)) {
|
||||
ApmEnvConfig.setDockerVersion(dockerVersion)
|
||||
}
|
||||
}
|
||||
hasInit.set(true)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onEnvChanged(buildType: String, netType: String, dockerVersion: String) {
|
||||
if (!hasInit.get()) {
|
||||
return
|
||||
}
|
||||
if (mBuildType.get() == buildType && mNetType.get() == netType && mDockerVersion.get() == dockerVersion) {
|
||||
return
|
||||
}
|
||||
launch {
|
||||
var buildTypeChanged = false
|
||||
if (ApmEnvConfig.getBuildType() != buildType) {
|
||||
buildTypeChanged = true
|
||||
ApmEnvConfig.setBuildType(buildType)
|
||||
}
|
||||
var netTypeChanged = false
|
||||
if (ApmEnvConfig.getNetType() != netType) {
|
||||
netTypeChanged = true
|
||||
ApmEnvConfig.setNetType(netType)
|
||||
}
|
||||
var dockerVersionChanged = false
|
||||
val version = ApmEnvConfig.getDockerVersion()
|
||||
if (!TextUtils.isEmpty(version) && !TextUtils.isEmpty(dockerVersion) && version != dockerVersion) {
|
||||
dockerVersionChanged = true
|
||||
ApmEnvConfig.setDockerVersion(dockerVersion)
|
||||
}
|
||||
var isFirstDockerVersionSet = false
|
||||
if (TextUtils.isEmpty(version) && !TextUtils.isEmpty(dockerVersion)) {
|
||||
isFirstDockerVersionSet = true
|
||||
ApmEnvConfig.setDockerVersion(dockerVersion)
|
||||
}
|
||||
var isEnvValid = true
|
||||
if (dockerVersionChanged || isFirstDockerVersionSet) {
|
||||
isEnvValid = buildType == "0" || (buildType == "1" && netType == DebugConfig.NET_MODE_RELEASE.toString() && dockerVersion.endsWith("release", true))
|
||||
}
|
||||
val appRelaunched = ApmEnvConfig.isAppRelaunched()
|
||||
if ((!isEnvValid || (buildTypeChanged || netTypeChanged || dockerVersionChanged)) && !appRelaunched) {
|
||||
ApmEnvConfig.setAppRelaunched(true)
|
||||
restartApp("buildType:$buildType,netType:$netType,dockerVersion:$dockerVersion")
|
||||
return@launch
|
||||
}
|
||||
if (isFirstDockerVersionSet) {
|
||||
return@launch
|
||||
}
|
||||
|
||||
if (appRelaunched) {
|
||||
ApmEnvConfig.setAppRelaunched(false)
|
||||
}
|
||||
|
||||
if (!TextUtils.isEmpty(buildType)) {
|
||||
mBuildType.set(buildType)
|
||||
}
|
||||
|
||||
if (!TextUtils.isEmpty(netType)) {
|
||||
mNetType.set(netType)
|
||||
}
|
||||
|
||||
if (!TextUtils.isEmpty(dockerVersion)) {
|
||||
mDockerVersion.set(dockerVersion)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_LINK_LOG_CONNECT_STATUS,
|
||||
linkCode = CHAIN_LINK_INIT,
|
||||
endpoint = PAD,
|
||||
nodeAliasCode = CHAIN_ALIAS_CODE_INIT_ENV_RESTART,
|
||||
paramIndexes = [0],
|
||||
clientPkFileName = "sn"
|
||||
)
|
||||
private fun restartApp(envStr:String) {
|
||||
launch(Dispatchers.Main) {
|
||||
Toast.makeText(Utils.getApp(), "发现系统环境不一致,正在重启...", Toast.LENGTH_SHORT).show()
|
||||
delay(50)
|
||||
Utils.getApp().startActivity(Utils.getApp().packageManager.getLaunchIntentForPackage(Utils.getApp().packageName))
|
||||
Process.killProcess(Process.myPid())
|
||||
}
|
||||
}
|
||||
|
||||
override fun isDebugEnabled(): Boolean? {
|
||||
return runBlocking {
|
||||
val oldBuildType = ApmEnvConfig.getBuildType()
|
||||
val oldNetType = ApmEnvConfig.getNetType()
|
||||
val oldDockerVersion = ApmEnvConfig.getDockerVersion()
|
||||
if (TextUtils.isEmpty(oldBuildType) || TextUtils.isEmpty(oldNetType) || TextUtils.isEmpty(oldDockerVersion)) {
|
||||
null
|
||||
} else {
|
||||
DebugConfig.isDebug() || (oldBuildType != "1" || oldNetType != DebugConfig.NET_MODE_RELEASE.toString() || !(oldDockerVersion?.endsWith("release", true) ?: false))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.zhjt.mogo_core_function_devatools.apm.config
|
||||
|
||||
import androidx.datastore.core.*
|
||||
import com.mogo.eagle.core.utilcode.util.Utils
|
||||
import com.zhjt.mogo_core_function_devatools.apm.generated.ApmEnv
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.flow.*
|
||||
import java.io.*
|
||||
|
||||
object ApmEnvConfig {
|
||||
|
||||
private val serializer = object : Serializer<ApmEnv> {
|
||||
|
||||
override val defaultValue: ApmEnv
|
||||
get() = ApmEnv.getDefaultInstance()
|
||||
|
||||
override suspend fun readFrom(input: InputStream): ApmEnv {
|
||||
return withContext(Dispatchers.IO) {
|
||||
ApmEnv.parseFrom(input)
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun writeTo(t: ApmEnv, output: OutputStream) {
|
||||
withContext(Dispatchers.IO) {
|
||||
t.writeTo(output)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val store: DataStore<ApmEnv> by lazy {
|
||||
DataStoreFactory.create(serializer) { File(Utils.getApp().filesDir, "apm_env.pb")}
|
||||
}
|
||||
|
||||
suspend fun isFirstEnter() = store.data.firstOrNull()?.let { it.buildType.isNullOrEmpty() || it.netType.isNullOrEmpty() || it.dockerVersion.isNullOrEmpty() } ?: true
|
||||
|
||||
suspend fun setBuildType(type: String) = store.updateData { it.toBuilder().setBuildType(type).build() }
|
||||
|
||||
suspend fun setDockerVersion(version: String) = store.updateData { it.toBuilder().setDockerVersion(version).build() }
|
||||
|
||||
suspend fun setNetType(type: String) = store.updateData { it.toBuilder().setNetType(type).build() }
|
||||
|
||||
suspend fun getBuildType(): String? = store.data.catch { if (it is IOException) emit(ApmEnv.getDefaultInstance()) }.map { it.buildType }.firstOrNull()
|
||||
|
||||
suspend fun getDockerVersion(): String? = store.data.catch { if (it is IOException) emit(ApmEnv.getDefaultInstance()) }.map { it.dockerVersion }.firstOrNull()
|
||||
|
||||
suspend fun getNetType(): String? = store.data.catch { if (it is IOException) emit(ApmEnv.getDefaultInstance()) }.map { it.netType }.firstOrNull()
|
||||
|
||||
suspend fun setAppRelaunched(isReLaunched: Boolean) = store.updateData { it.toBuilder().setIsRelaunchApp(isReLaunched).build() }
|
||||
|
||||
suspend fun isAppRelaunched(): Boolean = store.data.catch { if (it is IOException) emit(ApmEnv.getDefaultInstance()) }.map { it.isRelaunchApp }.firstOrNull() ?: false
|
||||
}
|
||||
@@ -20,7 +20,6 @@ import com.zhjt.mogo_core_function_devatools.badcase.biz.adapter.RecordTemplateA
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
||||
import kotlinx.android.synthetic.main.layout_badcase_config.view.*
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import java.lang.Exception
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,521 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.biz
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.os.Handler
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import bag_manager.BagManagerOuterClass
|
||||
import com.mogo.eagle.core.data.badcase.BagDescriptionEntity
|
||||
import com.mogo.eagle.core.data.badcase.BagInfoEntity
|
||||
import com.mogo.eagle.core.data.badcase.BagManagerEntity
|
||||
import com.mogo.eagle.core.data.badcase.SubBagEntity
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.zhidao.loglib.download.DownloadManager
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.biz.adapter.BagManagerListAdapter
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig.bagManagerList
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.record.Audition
|
||||
import kotlinx.android.synthetic.main.layout_badcase_manager.view.*
|
||||
import java.util.*
|
||||
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description BadCase录包管理页面
|
||||
* @since: 2022/12/15
|
||||
*/
|
||||
class BadCaseManagerView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoAutopilotRecordListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "BadCaseManagerView"
|
||||
}
|
||||
|
||||
private var bagManagerListAdapter: BagManagerListAdapter ?= null
|
||||
private var bagManagerEntity: BagManagerEntity = BagManagerEntity()
|
||||
private var clickListener: ClickListener? = null
|
||||
private var bagUploadDialog: BagUploadDialog ?= null
|
||||
|
||||
private var spaceTotal: Long = 0 //总空间
|
||||
private var spaceUsed: Long = 0 //已用空间
|
||||
private var spaceFree: Long = 0 //可用空间
|
||||
|
||||
private var selectedBagNum = 0 //选中Bag包的数量
|
||||
private var selectedBagSize: Long = 0 //选中Bag包的大小
|
||||
|
||||
private val audioSavePath = "/mnt/sdcard/mogo/"
|
||||
|
||||
private var isNameModify = false
|
||||
|
||||
private val deleteDataList: ArrayList<BagInfoEntity> = ArrayList()
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.layout_badcase_manager, this, true)
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView(){
|
||||
background = ColorDrawable(Color.parseColor("#F0151D41"))
|
||||
clLayout.setOnClickListener {
|
||||
}
|
||||
//关闭BadCase管理窗口
|
||||
ivManagerClose.setOnClickListener {
|
||||
clickListener?.onClose()
|
||||
}
|
||||
//一键全选
|
||||
tvSelectAll.setOnClickListener {
|
||||
if(bagManagerEntity.bagsInfoResp.size>0){
|
||||
selectedBagSize = 0
|
||||
selectedBagNum = 0
|
||||
bagManagerList.clear()
|
||||
for(selectBagInfo in bagManagerEntity.bagsInfoResp){
|
||||
if(selectBagInfo.itemType == 0){
|
||||
selectBagInfo.selectStatus = true
|
||||
selectedBagSize += selectBagInfo.totalSize
|
||||
bagManagerList.add(selectBagInfo)
|
||||
selectedBagNum++
|
||||
}
|
||||
}
|
||||
//显示选择包的个数和大小
|
||||
tvSelectedBagSize.text = "已选${selectedBagNum}个包,共${selectedBagSize/(1000*1024*1024)}G"
|
||||
tvSelectedBagSize.visibility = View.VISIBLE
|
||||
bagManagerListAdapter?.setData(bagManagerEntity.bagsInfoResp)
|
||||
}
|
||||
}
|
||||
//取消选中
|
||||
tvCancelSelect.setOnClickListener {
|
||||
if(bagManagerEntity.bagsInfoResp.size>0){
|
||||
for(cancelBagInfo in bagManagerEntity.bagsInfoResp){
|
||||
cancelBagInfo.selectStatus = false
|
||||
bagManagerList.remove(cancelBagInfo)
|
||||
}
|
||||
selectedBagNum = 0
|
||||
selectedBagSize = 0
|
||||
tvSelectedBagSize.visibility = View.GONE
|
||||
bagManagerListAdapter?.setData(bagManagerEntity.bagsInfoResp)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//上传Cos桶
|
||||
tvUploadCloud.setOnClickListener {
|
||||
if(bagManagerList.size>0){
|
||||
bagManagerEntity.reqType = 3
|
||||
bagManagerEntity.keyReq = bagManagerList[0].key
|
||||
Log.i("sendBagManagerCmd","bagManagerEntity.keyReq="+bagManagerEntity.keyReq)
|
||||
CallerAutoPilotControlManager.sendBagManagerCmd(bagManagerEntity)
|
||||
|
||||
bagUploadDialog = BagUploadDialog(context)
|
||||
bagUploadDialog?.setListener { //删除选择,取消上传
|
||||
bagManagerList.clear()
|
||||
if (bagManagerEntity.bagsInfoResp.size > 0) {
|
||||
for (cancelBagInfo in bagManagerEntity.bagsInfoResp) {
|
||||
if(cancelBagInfo.itemType == 0){
|
||||
cancelBagInfo.selectStatus = false
|
||||
bagManagerList.remove(cancelBagInfo)
|
||||
}
|
||||
}
|
||||
selectedBagNum = 0
|
||||
selectedBagSize = 0
|
||||
tvSelectedBagSize.visibility = View.GONE
|
||||
bagManagerListAdapter?.setData(bagManagerEntity.bagsInfoResp)
|
||||
}
|
||||
}
|
||||
bagUploadDialog?.show()
|
||||
bagUploadDialog?.setAllUpload(selectedBagNum,selectedBagSize)
|
||||
}else{
|
||||
ToastUtils.showShort("请先选择要上传的Bag包")
|
||||
}
|
||||
|
||||
}
|
||||
//删除Bag包
|
||||
tvDeleteSelect.setOnClickListener {
|
||||
if(bagManagerList.size>0){
|
||||
bagManagerEntity.reqType = 4
|
||||
bagManagerEntity.keyReq = bagManagerList[0].key
|
||||
CallerAutoPilotControlManager.sendBagManagerCmd(bagManagerEntity)
|
||||
}else{
|
||||
ToastUtils.showShort("请先选择要删除的Bag包")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bagManagerListAdapter = BagManagerListAdapter()
|
||||
bagManagerListAdapter?.setListener(object :BagManagerListAdapter.BagClickListener{
|
||||
override fun onClick(bagInfoEntity: BagInfoEntity, isChecked: Boolean) {
|
||||
if(isChecked){
|
||||
bagInfoEntity.selectStatus = true
|
||||
bagManagerList.add(bagInfoEntity)
|
||||
selectedBagNum++
|
||||
selectedBagSize += bagInfoEntity.totalSize
|
||||
tvSelectedBagSize.text = "已选${selectedBagNum}个包,共${selectedBagSize/(1000*1024*1024)}G"
|
||||
tvSelectedBagSize.visibility = View.VISIBLE
|
||||
}else{
|
||||
bagInfoEntity.selectStatus = false
|
||||
bagManagerList.remove(bagInfoEntity)
|
||||
selectedBagNum--
|
||||
selectedBagSize -= bagInfoEntity.totalSize
|
||||
if(selectedBagNum == 0){
|
||||
tvSelectedBagSize.visibility = View.GONE
|
||||
}else{
|
||||
tvSelectedBagSize.text = "已选${selectedBagNum}个包,共${selectedBagSize/(1000*1024*1024)}G"
|
||||
tvSelectedBagSize.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun uploadBI(bagInfoEntity: BagInfoEntity) {
|
||||
//展示上报弹窗
|
||||
val initiativeBadCaseWindow = InitiativeBadCaseWindow(context as Activity)
|
||||
initiativeBadCaseWindow.setClickListener(object: InitiativeBadCaseWindow.ClickListener{
|
||||
override fun closeWindow() {
|
||||
initiativeBadCaseWindow.hideFloatWindow()
|
||||
}
|
||||
})
|
||||
initiativeBadCaseWindow.showReportBIWindow(bagInfoEntity)
|
||||
}
|
||||
|
||||
override fun editDescription(key: Long, description: BagDescriptionEntity) {
|
||||
//编辑Bag包描述信息
|
||||
isNameModify = true
|
||||
bagManagerEntity.reqType = 5
|
||||
bagManagerEntity.keyReq = key
|
||||
bagManagerEntity.descReq = description
|
||||
CallerAutoPilotControlManager.sendBagManagerCmd(bagManagerEntity)
|
||||
}
|
||||
|
||||
override fun bagAudio(key: Long, audioUrl: String) {
|
||||
DownloadManager.getInstance().init(context)
|
||||
val downUrl = audioUrl.replace("http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/","")
|
||||
DownloadManager.getInstance().download(downUrl,
|
||||
audioSavePath,"${key}.wav")
|
||||
//延迟播放
|
||||
Handler().postDelayed({
|
||||
//音频文件播放
|
||||
Audition.getInstance().playOrStop("${audioSavePath}${key}.wav")
|
||||
}, 1500)
|
||||
}
|
||||
|
||||
})
|
||||
val linearLayoutManager = LinearLayoutManager(context)
|
||||
rvBagList.layoutManager = linearLayoutManager
|
||||
rvBagList.adapter = bagManagerListAdapter
|
||||
|
||||
//音频文件播放
|
||||
// Audition.getInstance().playOrStop("/mnt/sdcard/mogo/test.wav")
|
||||
//
|
||||
// 音频下载
|
||||
// DownloadManager.getInstance().init(context)
|
||||
// DownloadManager.getInstance().download("CarPad/mogopadlog/X20202111230C01YYW/2023-01-30/Audio_1675049657187_BadCase.wav",
|
||||
// "/mnt/sdcard/mogo/","test13.wav")
|
||||
|
||||
}
|
||||
|
||||
fun setOnClickListener(clickListener: ClickListener) {
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
|
||||
interface ClickListener {
|
||||
fun onClose()
|
||||
}
|
||||
|
||||
override fun onBagManagerResult(bagManager: BagManagerOuterClass.BagManager) {
|
||||
super.onBagManagerResult(bagManager)
|
||||
UiThreadHandler.post {
|
||||
Log.i(TAG,"onBagManagerResult Start")
|
||||
Log.i(TAG,"keyReq="+bagManager.keyReq)
|
||||
Log.i(TAG,"reqType="+bagManager.reqType)
|
||||
Log.i(TAG,"uploadCosResp stat="+bagManager.uploadCosResp.stat)
|
||||
Log.i(TAG,"descReq description="+bagManager.descReq.description
|
||||
+" audioUrl="+bagManager.descReq.audioUrl
|
||||
+" reportBI="+bagManager.descReq.reportBI
|
||||
+" hasAudio="+bagManager.descReq.hasAudio)
|
||||
for(logBag in bagManager.bagsInfoRespList){
|
||||
Log.i(TAG,"bagPath="+logBag.bagPath)
|
||||
Log.i(TAG,"timestamp="+logBag.timestamp)
|
||||
Log.i(TAG,"description="+logBag.description)
|
||||
Log.i(TAG,"key="+logBag.key)
|
||||
Log.i(TAG,"mergeStat="+logBag.mergeStat)
|
||||
Log.i(TAG,"totalSize="+logBag.totalSize)
|
||||
Log.i(TAG,"uploadStat="+logBag.uploadStat)
|
||||
}
|
||||
Log.i(TAG,"onBagManagerResult End")
|
||||
|
||||
//获取空间使用信息
|
||||
if(bagManager.reqType == 1){
|
||||
//遍历各个主机的硬盘空间信息
|
||||
if(bagManager.spaceInfoRespCount>0){
|
||||
spaceTotal = 0
|
||||
spaceUsed = 0
|
||||
spaceFree = 0
|
||||
for(spaceInfo in bagManager.spaceInfoRespList){
|
||||
spaceInfo.diskSpaceInfo?.let {
|
||||
spaceTotal += it.total
|
||||
spaceUsed += it.used
|
||||
spaceFree += it.free
|
||||
}
|
||||
}
|
||||
//展示空间使用情况
|
||||
//已使用空间
|
||||
tvUsedSpaceContent.text = "${(spaceUsed/(1000*1024*1024L))}G"
|
||||
//可使用空间
|
||||
tvFreeSpaceContent.text = "${(spaceFree/(1000*1024*1024L))}G"
|
||||
//进度条展示空间
|
||||
pbSpacePercent.progress = (spaceUsed*100/spaceTotal).toInt()
|
||||
}
|
||||
}
|
||||
//遍历所有bag
|
||||
else if(bagManager.reqType == 2){
|
||||
clBagHaveDataLayout.visibility = View.VISIBLE
|
||||
clBagNoDataLayout.visibility = View.GONE
|
||||
if(bagManager.bagsInfoRespCount>0){
|
||||
bagManagerEntity.bagsInfoResp.clear()
|
||||
val originBagInfoList = ArrayList<BagInfoEntity>()
|
||||
for(bagInfo in bagManager.bagsInfoRespList){
|
||||
bagInfo?.let {
|
||||
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 == timeStr){
|
||||
containTime = true
|
||||
}
|
||||
}
|
||||
if(!containTime || bagManagerEntity.bagsInfoResp.size ==0){
|
||||
//增加时间的
|
||||
val bagInfoTimeEntity = BagInfoEntity()
|
||||
bagInfoTimeEntity.itemType = 1
|
||||
bagInfoTimeEntity.timeStr = timeStr
|
||||
bagInfoTimeEntity.timestamp = time.substring(0,8)
|
||||
bagManagerEntity.bagsInfoResp.add(bagInfoTimeEntity)
|
||||
}
|
||||
var containKey = false
|
||||
for(bagInfoContain in bagManagerEntity.bagsInfoResp){
|
||||
if(bagInfoContain.key == it.key){
|
||||
containKey = true
|
||||
}
|
||||
}
|
||||
if(!containKey){
|
||||
bagManagerEntity.bagsInfoResp.add(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//更新List
|
||||
bagManagerListAdapter?.setData(bagManagerEntity.bagsInfoResp)
|
||||
}
|
||||
|
||||
// 开启定时查询速度
|
||||
Timer().schedule(timerTaskRefresh, Date(), 60*1000)
|
||||
}
|
||||
//上传Cos
|
||||
else if(bagManager.reqType == 3){
|
||||
//此处应循环上传Cos
|
||||
val uploadIterator = bagManagerEntity.bagsInfoResp.iterator()
|
||||
while(uploadIterator.hasNext()){
|
||||
val uploadBagInfo = uploadIterator.next()
|
||||
if(uploadBagInfo.key == bagManager.uploadCosResp.key && bagManager.uploadCosResp.stat!=1){
|
||||
bagManagerList.remove(uploadBagInfo)
|
||||
if(bagManagerList.size>0){
|
||||
var remainSize = 0L
|
||||
for(bagInfo in bagManagerList){
|
||||
remainSize += bagInfo.totalSize
|
||||
}
|
||||
bagUploadDialog?.updateRemainUpload(bagManagerList.size,remainSize)
|
||||
//执行下一个上传Bag命令
|
||||
bagManagerEntity.reqType = 3
|
||||
bagManagerEntity.keyReq = bagManagerList[0].key
|
||||
Log.i("sendBagManagerCmd","bagManagerEntity.keyReq="+bagManagerEntity.keyReq)
|
||||
CallerAutoPilotControlManager.sendBagManagerCmd(bagManagerEntity)
|
||||
}
|
||||
}
|
||||
}
|
||||
//上传Cos执行完成
|
||||
if(bagManagerList.size == 0 && selectedBagNum != 0){
|
||||
ToastUtils.showShort("上传命令完成")
|
||||
bagUploadDialog?.uploadCompleted()
|
||||
tvCancelSelect.performClick()
|
||||
}
|
||||
|
||||
when (bagManager.uploadCosResp.stat) {
|
||||
0 -> {
|
||||
ToastUtils.showShort("${bagManager.uploadCosResp.key} 上传cos桶成功")
|
||||
}
|
||||
1 -> {
|
||||
//执行中
|
||||
}
|
||||
2 -> {
|
||||
ToastUtils.showShort("${bagManager.uploadCosResp.key} 上传cos桶执行python失败")
|
||||
}
|
||||
3 -> {
|
||||
ToastUtils.showShort("${bagManager.uploadCosResp.key} 上传cos桶拷贝过程失败")
|
||||
}
|
||||
4 -> {
|
||||
ToastUtils.showShort("${bagManager.uploadCosResp.key} 上传cos桶合并过程失败")
|
||||
}
|
||||
5 -> {
|
||||
ToastUtils.showShort("${bagManager.uploadCosResp.key} 上传cos桶上传过程失败")
|
||||
}
|
||||
else -> {
|
||||
ToastUtils.showShort("${bagManager.uploadCosResp.key} 上传cos桶 ${bagManager.uploadCosResp.message}")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//删除Bag
|
||||
else if(bagManager.reqType == 4){
|
||||
//收到此回调就删除对应key的Bag
|
||||
val iterator = bagManagerEntity.bagsInfoResp.iterator()
|
||||
while(iterator.hasNext()){
|
||||
val deleteBagInfo = iterator.next()
|
||||
if(deleteBagInfo.key == bagManager.keyReq){
|
||||
iterator.remove()
|
||||
bagManagerList.remove(deleteBagInfo)
|
||||
//更新列表
|
||||
// bagManagerListAdapter?.setData(bagManagerEntity.bagsInfoResp)
|
||||
}
|
||||
}
|
||||
//遍历列表,如当天Bag全部删除,同时把日期标题也删除更新列表
|
||||
deleteDataList.clear()
|
||||
val titleIterator = bagManagerEntity.bagsInfoResp.iterator()
|
||||
while(titleIterator.hasNext()){
|
||||
val titleBagInfo = titleIterator.next()
|
||||
if(titleBagInfo.itemType == 1){
|
||||
val bagIterator = bagManagerEntity.bagsInfoResp.iterator()
|
||||
var hasBag = false
|
||||
var bagBagInfo: BagInfoEntity ?= null
|
||||
while(bagIterator.hasNext()){
|
||||
bagBagInfo = bagIterator.next()
|
||||
if(bagBagInfo.itemType == 0){
|
||||
bagBagInfo.timestamp.let {
|
||||
if(it.contains(titleBagInfo.timestamp)){
|
||||
hasBag = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!hasBag){
|
||||
// bagIterator.remove()
|
||||
titleBagInfo.let { deleteDataList.add(it) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(deleteDataList.isNotEmpty()){
|
||||
val deleteIterator = bagManagerEntity.bagsInfoResp.iterator()
|
||||
while(deleteIterator.hasNext()){
|
||||
val deleteInfo = deleteIterator.next()
|
||||
if(deleteDataList.contains(deleteInfo)){
|
||||
deleteIterator.remove()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(bagManagerList.size == 0){
|
||||
tvCancelSelect.performClick()
|
||||
}
|
||||
|
||||
if(bagManagerList.size>0){
|
||||
//继续执行删除命令
|
||||
bagManagerEntity.reqType = 4
|
||||
bagManagerEntity.keyReq = bagManagerList[0].key
|
||||
CallerAutoPilotControlManager.sendBagManagerCmd(bagManagerEntity)
|
||||
}
|
||||
|
||||
//更新列表
|
||||
bagManagerListAdapter?.setData(bagManagerEntity.bagsInfoResp)
|
||||
}
|
||||
//修改bag附加信息
|
||||
else if(bagManager.reqType == 5){
|
||||
//更新Bag包上报状态
|
||||
for(bagInfo in bagManagerEntity.bagsInfoResp){
|
||||
if(bagInfo.key == bagManager.keyReq){
|
||||
bagInfo.description?.let {
|
||||
it.reportBI = bagManager.descReq.reportBI
|
||||
it.description = bagManager.descReq.description
|
||||
it.hasAudio = bagManager.descReq.hasAudio
|
||||
it.audioUrl = bagManager.descReq.audioUrl
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!isNameModify){
|
||||
//更新List
|
||||
bagManagerListAdapter?.setData(bagManagerEntity.bagsInfoResp)
|
||||
}
|
||||
isNameModify = false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerAutopilotRecordListenerManager.addListener(TAG, this)
|
||||
bagManagerEntity.reqType = 2
|
||||
//遍历所有bag
|
||||
CallerAutoPilotControlManager.sendBagManagerCmd(bagManagerEntity)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerAutopilotRecordListenerManager.removeListener(TAG)
|
||||
try {
|
||||
timerTaskRefresh.cancel()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
private val timerTaskRefresh = object : TimerTask() {
|
||||
override fun run() {
|
||||
UiThreadHandler.post {
|
||||
//获取空间使用信息,每隔1分钟获取一次
|
||||
bagManagerEntity.reqType = 1
|
||||
CallerAutoPilotControlManager.sendBagManagerCmd(bagManagerEntity)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.biz;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.zhjt.mogo_core_function_devatools.R;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description Bag包上传进度展示弹窗
|
||||
* @since: 2022/2/1
|
||||
*/
|
||||
public class BagUploadDialog extends Dialog {
|
||||
|
||||
private TextView tvCancelUpload;//取消上传
|
||||
private TextView tvCancel;//取消
|
||||
private TextView tvUploadDetail;//上传详情
|
||||
private ProgressBar viewUploadProgress;//上传进度条
|
||||
|
||||
private int totalNum = 0;
|
||||
private Long totalSize = 0L;
|
||||
private int remainNum = 0;
|
||||
private Long remainSize = 0L;
|
||||
|
||||
private BagUploadListener uploadListener;
|
||||
private DecimalFormat format = new DecimalFormat("0.0");
|
||||
|
||||
public BagUploadDialog(@NonNull Context context) {
|
||||
super(context, R.style.bad_case_dialog);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.dialog_bag_upload);
|
||||
WindowManager.LayoutParams params = getWindow().getAttributes();
|
||||
params.height = 688;
|
||||
params.width = 1110;
|
||||
getWindow().setAttributes(params);//向WindowManager设置属性
|
||||
setCanceledOnTouchOutside(false);
|
||||
init();
|
||||
initEvent();
|
||||
}
|
||||
|
||||
private void init(){
|
||||
tvCancelUpload = findViewById(R.id.tvCancelUpload);
|
||||
tvCancel = findViewById(R.id.tvCancel);
|
||||
tvUploadDetail = findViewById(R.id.tvUploadDetail);
|
||||
viewUploadProgress = findViewById(R.id.viewUploadProgress);
|
||||
}
|
||||
|
||||
private void initEvent(){
|
||||
//取消上传
|
||||
tvCancelUpload.setOnClickListener(v -> {
|
||||
if(uploadListener!=null){
|
||||
uploadListener.cancelUpload();
|
||||
}
|
||||
dismiss();
|
||||
});
|
||||
//取消
|
||||
tvCancel.setOnClickListener(v -> {
|
||||
dismiss();
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttachedToWindow() {
|
||||
super.onAttachedToWindow();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
}
|
||||
|
||||
public void setListener(BagUploadListener listener){
|
||||
uploadListener = listener;
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
public void setAllUpload(int totalNum, Long totalSize){
|
||||
this.totalNum = totalNum;
|
||||
this.totalSize = totalSize;
|
||||
//更新进度条和进度文字
|
||||
String totalStr = format.format((totalSize/(1000*1024*1024.0)));
|
||||
tvUploadDetail.setText("共计"+totalNum+"个包 ("+totalStr+"G) 已上传"+(0)+"个包 ("
|
||||
+0+"G) 剩余"+totalNum+"个包 ("+ totalStr+"G)");
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
public void updateRemainUpload(int remainNum, Long remainSize){
|
||||
this.remainNum = remainNum;
|
||||
this.remainSize = remainSize;
|
||||
//更新进度条和进度文字
|
||||
String updateTotalStr = format.format((totalSize/(1000*1024*1024.0)));
|
||||
String updateUploadStr = format.format(((totalSize-remainSize)/(1000*1024*1024.0)));
|
||||
String updateRemainStr = format.format((remainSize/(1000*1024*1024.0)));
|
||||
tvUploadDetail.setText("共计"+totalNum+"个包 ("+updateTotalStr+"G) 已上传"+(totalNum-remainNum)+"个包 ("
|
||||
+updateUploadStr+"G) 剩余"+remainNum+"个包 ("+ updateRemainStr +"G)");
|
||||
viewUploadProgress.setProgress((totalNum-remainNum)*100/totalNum);
|
||||
}
|
||||
|
||||
public void uploadCompleted(){
|
||||
dismiss();
|
||||
}
|
||||
|
||||
interface BagUploadListener{
|
||||
//取消上传
|
||||
void cancelUpload();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,6 +20,7 @@ import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import bag_manager.BagManagerOuterClass;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import record_cache.RecordPanelOuterClass;
|
||||
|
||||
@@ -116,4 +117,8 @@ public class CaseListDialog extends Dialog implements IMoGoAutopilotRecordListen
|
||||
caseListAdapter.notifyDataSetChanged();
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBagManagerResult(@NonNull BagManagerOuterClass.BagManager bagManager) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import bag_manager.BagManagerOuterClass;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import record_cache.RecordPanelOuterClass;
|
||||
|
||||
@@ -203,4 +204,8 @@ public class CaseTopicListDialog extends Dialog implements IMoGoAutopilotRecordL
|
||||
@Override
|
||||
public void onAutopilotRecordResult(@NonNull RecordPanelOuterClass.RecordPanel recordPanel) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBagManagerResult(@NonNull BagManagerOuterClass.BagManager bagManager) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,9 @@ import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.badcase.BagDescriptionEntity
|
||||
import com.mogo.eagle.core.data.badcase.BagInfoEntity
|
||||
import com.mogo.eagle.core.data.badcase.BagManagerEntity
|
||||
import com.mogo.eagle.core.data.badcase.RecordCaseEntity
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
|
||||
@@ -36,8 +39,10 @@ import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.record.RecordManager
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import record_cache.RecordPanelOuterClass
|
||||
import java.io.File
|
||||
import java.lang.StringBuilder
|
||||
import java.util.*
|
||||
|
||||
|
||||
@@ -77,17 +82,17 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
private lateinit var tvInitiativeCancel: TextView
|
||||
|
||||
private var audioStatus = false
|
||||
private var audioFileName: String? = null //录音文件名称
|
||||
private var audioFileName:String?=null //录音文件名称
|
||||
|
||||
private var uploadReason: StringBuilder = StringBuilder() //上报原因,标签
|
||||
|
||||
@Volatile
|
||||
private var recordKey: String? = null //录制bag包key
|
||||
|
||||
private var recordKey: String?=null //录制bag包key
|
||||
@Volatile
|
||||
private var recordFileName: String? = null //录制文件包名
|
||||
private var longitude: Double? = null
|
||||
private var latitude: Double? = null
|
||||
private var recordFileName: String?=null //录制文件包名
|
||||
private var longitude: Double?=null
|
||||
private var latitude: Double?=null
|
||||
|
||||
private var bagManagerEntity: BagManagerEntity = BagManagerEntity()
|
||||
|
||||
private var mInViewX = 0f
|
||||
private var mInViewY = 0f
|
||||
@@ -107,9 +112,8 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun initFloatWindow() {
|
||||
mFloatLayout =
|
||||
LayoutInflater.from(mActivity).inflate(R.layout.view_initiative_bad_case, null) as View
|
||||
private fun initFloatWindow(){
|
||||
mFloatLayout = LayoutInflater.from(mActivity).inflate(R.layout.view_initiative_bad_case, null) as View
|
||||
mFloatLayout.setOnTouchListener(this)
|
||||
|
||||
tvInitiativeNum = mFloatLayout.findViewById(R.id.tvInitiativeNum)
|
||||
@@ -128,17 +132,16 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
|
||||
tvInitiativeReport = mFloatLayout.findViewById(R.id.tvInitiativeReport)
|
||||
tvInitiativeCancel = mFloatLayout.findViewById(R.id.tvInitiativeCancel)
|
||||
if (BadCaseConfig.windowNum < 1) {
|
||||
if(BadCaseConfig.windowNum<1){
|
||||
BadCaseConfig.windowNum = 1
|
||||
}
|
||||
tvInitiativeNum.text = BadCaseConfig.windowNum.toString()
|
||||
BadCaseConfig.windowNum++
|
||||
tvInitiativeTime.text =
|
||||
"时间:${millis2String(System.currentTimeMillis(), TimeUtils.getHourMinSecondFormat())}"
|
||||
tvInitiativeTime.text = "时间:${millis2String(System.currentTimeMillis(),TimeUtils.getHourMinSecondFormat())}"
|
||||
tvInitiativeIdentity.text = "身份:${BadCaseConfig.identity}"
|
||||
|
||||
//采集结果回调监听
|
||||
CallerAutopilotRecordListenerManager.addListener(this.hashCode().toString(), this)
|
||||
CallerAutopilotRecordListenerManager.addListener(this.hashCode().toString(),this)
|
||||
// 添加 ADAS车辆状态&定位 监听
|
||||
CallerChassisLocationWGS84ListenerManager.addListener(this.hashCode().toString(), this)
|
||||
viewAudioButton.setOnClickListener {
|
||||
@@ -147,37 +150,37 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
}
|
||||
|
||||
tvInitiativeReport.setOnClickListener {
|
||||
if (!rbOne.isChecked && !rbTwo.isChecked && !rbThree.isChecked &&
|
||||
!rbFour.isChecked && !rbFive.isChecked && !rbSix.isChecked
|
||||
) {
|
||||
if(!rbOne.isChecked && !rbTwo.isChecked && !rbThree.isChecked &&
|
||||
!rbFour.isChecked && !rbFive.isChecked && !rbSix.isChecked){
|
||||
TipToast.shortTip("请选择至少一个Case")
|
||||
return@setOnClickListener
|
||||
}
|
||||
if (rbOne.isChecked) {
|
||||
uploadReason.clear()
|
||||
if(rbOne.isChecked){
|
||||
uploadReason.append("严重画龙 ")
|
||||
}
|
||||
if (rbTwo.isChecked) {
|
||||
if(rbTwo.isChecked){
|
||||
uploadReason.append("速度过慢 ")
|
||||
}
|
||||
if (rbThree.isChecked) {
|
||||
if(rbThree.isChecked){
|
||||
uploadReason.append("感知、定位、地图等其他 ")
|
||||
}
|
||||
if (rbFour.isChecked) {
|
||||
if(rbFour.isChecked){
|
||||
uploadReason.append("速度过快 ")
|
||||
}
|
||||
if (rbFive.isChecked) {
|
||||
if(rbFive.isChecked){
|
||||
uploadReason.append("存在碰撞风险 ")
|
||||
}
|
||||
if (rbSix.isChecked) {
|
||||
if(rbSix.isChecked){
|
||||
uploadReason.append("点刹、顿挫")
|
||||
}
|
||||
if (audioStatus) {
|
||||
if(audioStatus){
|
||||
audioStatus = !audioStatus
|
||||
setAudio(audioStatus)
|
||||
Handler().postDelayed({
|
||||
uploadAudio()
|
||||
}, 1000)
|
||||
} else {
|
||||
uploadAudio()
|
||||
},1000)
|
||||
}else{
|
||||
uploadAudio()
|
||||
}
|
||||
}
|
||||
@@ -200,10 +203,10 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
}
|
||||
}
|
||||
|
||||
var countDownTimer: CountDownTimer? = null
|
||||
var countDownTimer: CountDownTimer?=null
|
||||
|
||||
private fun setAudio(status: Boolean) {
|
||||
if (status) {
|
||||
private fun setAudio(status: Boolean){
|
||||
if(status){
|
||||
//开始录音
|
||||
audioFileName = "Audio_${System.currentTimeMillis()}_BadCase"
|
||||
RecordManager.getInstance().start(audioFileName)
|
||||
@@ -211,11 +214,11 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
viewAudioButton.setImageResource(R.drawable.icon_bad_case_audio_select)
|
||||
tvAudioCountDown.visibility = View.VISIBLE
|
||||
//开始倒计时
|
||||
if (countDownTimer == null) {
|
||||
if(countDownTimer==null){
|
||||
countDownTimer = object : CountDownTimer(60000, 1000) {
|
||||
|
||||
override fun onTick(millisUntilFinished: Long) {
|
||||
tvAudioCountDown.text = "${millisUntilFinished / 1000}S"
|
||||
tvAudioCountDown.text = "${millisUntilFinished/1000}S"
|
||||
}
|
||||
|
||||
override fun onFinish() {
|
||||
@@ -228,7 +231,7 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
}
|
||||
countDownTimer?.start()
|
||||
}
|
||||
} else {
|
||||
}else{
|
||||
//结束倒计时
|
||||
countDownTimer?.cancel()
|
||||
countDownTimer?.onFinish()
|
||||
@@ -238,13 +241,11 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
|
||||
}
|
||||
|
||||
private fun uploadAudio() {
|
||||
private fun uploadAudio(){
|
||||
val singlePath = "/mnt/sdcard/mogo/DataCollection/${audioFileName}.wav"
|
||||
val file = File(singlePath)
|
||||
if (file.exists()) {
|
||||
LogInfoManagerFactory.createAudioUpload(mActivity.applicationContext,
|
||||
"Audio",
|
||||
singlePath,
|
||||
if(file.exists()){
|
||||
LogInfoManagerFactory.createAudioUpload(mActivity.applicationContext,"Audio",singlePath,
|
||||
object : OnUploadListener {
|
||||
override fun onUploadSuccess(filePath: String, downloadUrl: String) {
|
||||
CallerLogger.d("$M_DEVA$TAG", "语音文件上传成功:downloadUrl=$downloadUrl")
|
||||
@@ -260,7 +261,7 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
removeUploadListener(singlePath)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
}else{
|
||||
//上传到服务器
|
||||
upload(null)
|
||||
}
|
||||
@@ -270,7 +271,7 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
* 将语音文件上传Cos监听移除
|
||||
* @param filePath 文件路径
|
||||
*/
|
||||
private fun removeUploadListener(filePath: String) {
|
||||
private fun removeUploadListener(filePath: String){
|
||||
val pkgInfo: List<String> = filePath.substring(
|
||||
filePath.lastIndexOf("/") + 1,
|
||||
filePath.lastIndexOf(".")
|
||||
@@ -283,21 +284,21 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
* 将记录上传到服务器
|
||||
* @param downloadUrl 语音文件下载地址
|
||||
*/
|
||||
private fun upload(downloadUrl: String?) {
|
||||
GlobalScope.launch {
|
||||
private fun upload(downloadUrl: String?){
|
||||
GlobalScope.launch{
|
||||
val uploadResult = presenter.upload(mutableMapOf<String, String>().also { itx ->
|
||||
itx["carLicense"] = AppConfigInfo.plateNumber ?: "" //车牌号
|
||||
itx["filename"] = recordFileName ?: "" //bag包文件地址
|
||||
itx["carLicense"] = AppConfigInfo.plateNumber?:"" //车牌号
|
||||
itx["filename"] = recordFileName?:"" //bag包文件地址
|
||||
itx["filesize"] = "0" //bag包文件大小
|
||||
itx["key"] = recordKey ?: "" //key
|
||||
itx["reason"] = uploadReason.toString() ?: "" //采集原因
|
||||
itx["key"] = recordKey?:"" //key
|
||||
itx["reason"] = uploadReason.toString() //采集原因
|
||||
itx["duration"] = BadCaseConfig.totalDuration.toString() //采集时长,固定为20S
|
||||
itx["startTime"] = System.currentTimeMillis().toString() //上报时间(时间戳格式)
|
||||
itx["channel"] = "1" //渠道
|
||||
itx["carSn"] = MoGoAiCloudClientConfig.getInstance().sn //SN
|
||||
itx["userRole"] = BadCaseConfig.identity //采集者角色
|
||||
itx["audioUrl"] = downloadUrl ?: "" //音频COS地址
|
||||
itx["mapVersion"] = BadCaseConfig.dockerVersion ?: "" //工控机版本
|
||||
itx["audioUrl"] = downloadUrl?:"" //音频COS地址
|
||||
itx["mapVersion"] = BadCaseConfig.dockerVersion ?:"" //工控机版本
|
||||
itx["eyeVersion"] = AppUtils.getAppVersionName() //鹰眼版本
|
||||
itx["coordinate"] = "latitude:${latitude};longitude:${longitude}" //坐标
|
||||
|
||||
@@ -306,6 +307,15 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
TipToast.shortTip("上报失败")
|
||||
} else {
|
||||
TipToast.shortTip("上报成功")
|
||||
//将上报BI的结果同步给工控机记录保存
|
||||
recordKey?.let {
|
||||
val hasAudio = downloadUrl != null
|
||||
val descReqEntity = BagDescriptionEntity(uploadReason.toString(),hasAudio,downloadUrl.toString(),true)
|
||||
bagManagerEntity.reqType = 5
|
||||
bagManagerEntity.keyReq = it.toLong()
|
||||
bagManagerEntity.descReq = descReqEntity
|
||||
CallerAutoPilotControlManager.sendBagManagerCmd(bagManagerEntity)
|
||||
}
|
||||
BadCaseConfig.windowNum--
|
||||
clickListener?.closeWindow()
|
||||
}
|
||||
@@ -346,19 +356,28 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight()-950
|
||||
mWindowManager!!.addView(mFloatLayout, mWindowParams)
|
||||
//开启录包
|
||||
if (recordCaseEntity != null) {
|
||||
CallerAutoPilotControlManager.recordPackage(
|
||||
recordCaseEntity.caseId,
|
||||
Random(SystemClock.elapsedRealtime()).nextInt(),
|
||||
BadCaseConfig.totalDuration,
|
||||
BadCaseConfig.previousDuration,
|
||||
recordCaseEntity.topicList
|
||||
)
|
||||
} else {
|
||||
CallerAutoPilotControlManager.recordPackage(
|
||||
BadCaseConfig.type, Random(SystemClock.elapsedRealtime()).nextInt(),
|
||||
BadCaseConfig.totalDuration, BadCaseConfig.previousDuration
|
||||
)
|
||||
if(recordCaseEntity!=null){
|
||||
CallerAutoPilotControlManager.recordPackage(recordCaseEntity.caseId,Random(SystemClock.elapsedRealtime()).nextInt(),
|
||||
BadCaseConfig.totalDuration, BadCaseConfig.previousDuration,recordCaseEntity.topicList)
|
||||
}else{
|
||||
CallerAutoPilotControlManager.recordPackage(BadCaseConfig.type,Random(SystemClock.elapsedRealtime()).nextInt(),
|
||||
BadCaseConfig.totalDuration, BadCaseConfig.previousDuration)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun showReportBIWindow(bagInfoEntity: BagInfoEntity){
|
||||
if (mFloatLayout.parent == null) {
|
||||
val metrics = DisplayMetrics()
|
||||
// 默认固定位置,靠屏幕右边缘的中间
|
||||
mWindowManager!!.defaultDisplay.getMetrics(metrics)
|
||||
mWindowParams!!.x = metrics.widthPixels
|
||||
mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight()-950
|
||||
mWindowManager!!.addView(mFloatLayout, mWindowParams)
|
||||
//已经录包无需再次启动录包,只要将录包信息同步到弹窗
|
||||
bagInfoEntity.let {
|
||||
recordKey = it.key.toString()
|
||||
recordFileName = it.bagPath
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -373,13 +392,12 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
|
||||
override fun onAutopilotRecordResult(recordPanel: RecordPanelOuterClass.RecordPanel) {
|
||||
CallerLogger.d("${M_DEVA}${TAG}", "-- 收到工控机录制任务回调 -- $recordPanel")
|
||||
|
||||
ThreadUtils.runOnUiThread {
|
||||
if (recordKey == null) {
|
||||
if(recordKey==null){
|
||||
recordKey = recordPanel.key.toString()
|
||||
BadCaseConfig.recordKeyList.add(recordPanel.key)
|
||||
}
|
||||
if (recordFileName == null) {
|
||||
if(recordFileName==null){
|
||||
recordFileName = recordPanel.filename
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import android.graphics.Color
|
||||
import android.graphics.PixelFormat
|
||||
import android.os.CountDownTimer
|
||||
import android.os.Handler
|
||||
import android.os.Parcel
|
||||
import android.os.Parcelable
|
||||
import android.util.DisplayMetrics
|
||||
import android.view.*
|
||||
import android.widget.CheckBox
|
||||
@@ -15,10 +17,13 @@ import android.widget.TextView
|
||||
import com.google.android.flexbox.FlexboxLayout
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.badcase.BagDescriptionEntity
|
||||
import com.mogo.eagle.core.data.badcase.BagManagerEntity
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.RecordBagMsg
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
@@ -28,12 +33,13 @@ import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils.millis2String
|
||||
import com.zhidao.loglib.call.LogInfoManagerFactory
|
||||
import com.zhidao.loglib.upload.OnUploadListener
|
||||
import com.zhidao.loglib.upload.UploadManager
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.record.RecordManager
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import com.zhidao.loglib.upload.UploadManager
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import java.io.File
|
||||
@@ -56,14 +62,16 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
private lateinit var mFloatLayout: View
|
||||
|
||||
private var audioStatus = false
|
||||
private var audioFileName: String? = null //录音文件名称
|
||||
private var audioFileName:String?=null //录音文件名称
|
||||
|
||||
private var bagManagerEntity: BagManagerEntity = BagManagerEntity()
|
||||
|
||||
private var uploadReason: String = String() //上报原因,标签
|
||||
private var recordKey: String? = null //录制bag包key
|
||||
private var recordFileName: String? = null //录制文件包名
|
||||
private var boxBean: MsgBoxBean? = null
|
||||
private var longitude: Double? = null
|
||||
private var latitude: Double? = null
|
||||
private var recordKey: String?=null //录制bag包key
|
||||
private var recordFileName: String?=null //录制文件包名
|
||||
private var boxBean: MsgBoxBean ?= null
|
||||
private var longitude: Double?=null
|
||||
private var latitude: Double?=null
|
||||
|
||||
private var mInViewX = 0f
|
||||
private var mInViewY = 0f
|
||||
@@ -73,7 +81,7 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
private var mInScreenY = 0f
|
||||
|
||||
private var clickListener: ClickListener? = null
|
||||
var countDownTimer: CountDownTimer? = null
|
||||
var countDownTimer: CountDownTimer?=null
|
||||
|
||||
private lateinit var tvPassiveNum: TextView
|
||||
private lateinit var tvPassiveTime: TextView
|
||||
@@ -96,9 +104,8 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun initFloatWindow() {
|
||||
mFloatLayout =
|
||||
LayoutInflater.from(mActivity).inflate(R.layout.view_passive_bad_case, null) as View
|
||||
private fun initFloatWindow(){
|
||||
mFloatLayout = LayoutInflater.from(mActivity).inflate(R.layout.view_passive_bad_case, null) as View
|
||||
mFloatLayout.setOnTouchListener(this)
|
||||
tvPassiveNum = mFloatLayout.findViewById(R.id.tvPassiveNum)
|
||||
tvPassiveTime = mFloatLayout.findViewById(R.id.tvPassiveTime)
|
||||
@@ -108,13 +115,12 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
tvPassiveReport = mFloatLayout.findViewById(R.id.tvPassiveReport)
|
||||
tvPassiveCancel = mFloatLayout.findViewById(R.id.tvPassiveCancel)
|
||||
flReasonLayout = mFloatLayout.findViewById(R.id.flReasonLayout)
|
||||
if (BadCaseConfig.windowNum < 1) {
|
||||
if(BadCaseConfig.windowNum<1){
|
||||
BadCaseConfig.windowNum = 1
|
||||
}
|
||||
tvPassiveNum.text = BadCaseConfig.windowNum.toString()
|
||||
BadCaseConfig.windowNum++
|
||||
tvPassiveTime.text =
|
||||
"时间:${millis2String(System.currentTimeMillis(), TimeUtils.getHourMinSecondFormat())}"
|
||||
tvPassiveTime.text = "时间:${millis2String(System.currentTimeMillis(),TimeUtils.getHourMinSecondFormat())}"
|
||||
tvPassiveIdentity.text = "身份:${BadCaseConfig.identity}"
|
||||
// 添加 ADAS车辆状态&定位 监听
|
||||
CallerChassisLocationWGS84ListenerManager.addListener(TAG, this)
|
||||
@@ -124,17 +130,17 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
}
|
||||
|
||||
tvPassiveReport.setOnClickListener {
|
||||
if (uploadReason.isEmpty()) {
|
||||
if(uploadReason.isEmpty()){
|
||||
TipToast.shortTip("请选择至少一个Case")
|
||||
return@setOnClickListener
|
||||
}
|
||||
if (audioStatus) {
|
||||
if(audioStatus){
|
||||
audioStatus = !audioStatus
|
||||
setAudio(audioStatus)
|
||||
Handler().postDelayed({
|
||||
uploadAudio()
|
||||
}, 1000)
|
||||
} else {
|
||||
},1000)
|
||||
}else{
|
||||
uploadAudio()
|
||||
}
|
||||
//删除记录
|
||||
@@ -162,8 +168,8 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
}
|
||||
}
|
||||
|
||||
private fun setAudio(status: Boolean) {
|
||||
if (status) {
|
||||
private fun setAudio(status: Boolean){
|
||||
if(status){
|
||||
//开始录音
|
||||
audioFileName = "Audio_${System.currentTimeMillis()}_BadCase"
|
||||
RecordManager.getInstance().start(audioFileName)
|
||||
@@ -171,11 +177,11 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
viewAudioButton.setImageResource(R.drawable.icon_bad_case_audio_select)
|
||||
tvAudioCountDown.visibility = View.VISIBLE
|
||||
//开始倒计时
|
||||
if (countDownTimer == null) {
|
||||
if(countDownTimer==null){
|
||||
countDownTimer = object : CountDownTimer(60000, 1000) {
|
||||
|
||||
override fun onTick(millisUntilFinished: Long) {
|
||||
tvAudioCountDown.text = "${millisUntilFinished / 1000}S"
|
||||
tvAudioCountDown.text = "${millisUntilFinished/1000}S"
|
||||
}
|
||||
|
||||
override fun onFinish() {
|
||||
@@ -188,7 +194,7 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
}
|
||||
countDownTimer?.start()
|
||||
}
|
||||
} else {
|
||||
}else{
|
||||
//结束倒计时
|
||||
countDownTimer?.cancel()
|
||||
countDownTimer?.onFinish()
|
||||
@@ -198,13 +204,11 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
|
||||
}
|
||||
|
||||
private fun uploadAudio() {
|
||||
private fun uploadAudio(){
|
||||
val singlePath = "/mnt/sdcard/mogo/DataCollection/${audioFileName}.wav"
|
||||
val file = File(singlePath)
|
||||
if (file.exists()) {
|
||||
LogInfoManagerFactory.createAudioUpload(mActivity.applicationContext,
|
||||
"Audio",
|
||||
singlePath,
|
||||
if(file.exists()){
|
||||
LogInfoManagerFactory.createAudioUpload(mActivity.applicationContext,"Audio",singlePath,
|
||||
object : OnUploadListener {
|
||||
override fun onUploadSuccess(filePath: String, downloadUrl: String) {
|
||||
CallerLogger.d("$M_DEVA$TAG", "语音文件上传成功:downloadUrl=$downloadUrl")
|
||||
@@ -220,7 +224,7 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
removeUploadListener(singlePath)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
}else{
|
||||
//上传到服务器
|
||||
upload(null)
|
||||
}
|
||||
@@ -230,7 +234,7 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
* 将语音文件上传Cos监听移除
|
||||
* @param filePath 文件路径
|
||||
*/
|
||||
private fun removeUploadListener(filePath: String) {
|
||||
private fun removeUploadListener(filePath: String){
|
||||
val pkgInfo: List<String> = filePath.substring(
|
||||
filePath.lastIndexOf("/") + 1,
|
||||
filePath.lastIndexOf(".")
|
||||
@@ -243,21 +247,21 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
* 将记录上传到服务器
|
||||
* @param downloadUrl 语音文件下载地址
|
||||
*/
|
||||
private fun upload(downloadUrl: String?) {
|
||||
GlobalScope.launch {
|
||||
private fun upload(downloadUrl: String?){
|
||||
GlobalScope.launch{
|
||||
val uploadResult = presenter.upload(mutableMapOf<String, String>().also { itx ->
|
||||
itx["carLicense"] = AppConfigInfo.plateNumber ?: "" //车牌号
|
||||
itx["filename"] = recordFileName ?: "" //bag包文件地址
|
||||
itx["carLicense"] = AppConfigInfo.plateNumber?:"" //车牌号
|
||||
itx["filename"] = recordFileName?:"" //bag包文件地址
|
||||
itx["filesize"] = "0" //bag包文件大小
|
||||
itx["key"] = recordKey ?: "" //key
|
||||
itx["key"] = recordKey?:"" //key
|
||||
itx["reason"] = uploadReason //采集原因
|
||||
itx["duration"] = BadCaseConfig.totalDuration.toString() //采集时长,固定为20S
|
||||
itx["startTime"] = System.currentTimeMillis().toString() //上报时间(时间戳格式)
|
||||
itx["channel"] = "0" //渠道
|
||||
itx["carSn"] = MoGoAiCloudClientConfig.getInstance().sn //SN
|
||||
itx["userRole"] = BadCaseConfig.identity //采集者角色
|
||||
itx["audioUrl"] = downloadUrl ?: "" //音频COS地址
|
||||
itx["mapVersion"] = BadCaseConfig.dockerVersion ?: "" //工控机版本
|
||||
itx["audioUrl"] = downloadUrl?:"" //音频COS地址
|
||||
itx["mapVersion"] = BadCaseConfig.dockerVersion ?:"" //工控机版本
|
||||
itx["eyeVersion"] = AppUtils.getAppVersionName() //鹰眼版本
|
||||
itx["coordinate"] = "latitude:${latitude};longitude:${longitude}" //坐标
|
||||
|
||||
@@ -266,6 +270,15 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
TipToast.shortTip("上报失败")
|
||||
} else {
|
||||
TipToast.shortTip("上报成功")
|
||||
//将上报BI的结果同步给工控机记录保存
|
||||
recordKey?.let {
|
||||
val hasAudio = downloadUrl != null
|
||||
val descReqEntity = BagDescriptionEntity(uploadReason,hasAudio,downloadUrl.toString(),true)
|
||||
bagManagerEntity.reqType = 5
|
||||
bagManagerEntity.keyReq = it.toLong()
|
||||
bagManagerEntity.descReq = descReqEntity
|
||||
CallerAutoPilotControlManager.sendBagManagerCmd(bagManagerEntity)
|
||||
}
|
||||
BadCaseConfig.windowNum--
|
||||
clickListener?.closeWindow()
|
||||
}
|
||||
@@ -309,33 +322,28 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
// 默认固定位置,靠屏幕右边缘的中间
|
||||
mWindowManager!!.defaultDisplay.getMetrics(metrics)
|
||||
mWindowParams!!.x = metrics.widthPixels
|
||||
mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight() - 950
|
||||
mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight()-950
|
||||
mWindowManager!!.addView(mFloatLayout, mWindowParams)
|
||||
}
|
||||
|
||||
GlobalScope.launch {
|
||||
GlobalScope.launch{
|
||||
presenter.loadBadCases(true).also {
|
||||
ThreadUtils.runOnUiThread {
|
||||
it.iterator().forEach {
|
||||
val checkBox = CheckBox(mActivity)
|
||||
checkBox.setTextColor(Color.WHITE)
|
||||
val lp = FlexboxLayout.LayoutParams(
|
||||
FlexboxLayout.LayoutParams.WRAP_CONTENT,
|
||||
FlexboxLayout.LayoutParams.WRAP_CONTENT
|
||||
)
|
||||
checkBox.buttonDrawable =
|
||||
mActivity.resources.getDrawable(R.drawable.badcase_radio_button_style)
|
||||
checkBox.setPadding(
|
||||
val lp = FlexboxLayout.LayoutParams(FlexboxLayout.LayoutParams.WRAP_CONTENT,
|
||||
FlexboxLayout.LayoutParams.WRAP_CONTENT)
|
||||
checkBox.buttonDrawable = mActivity.resources.getDrawable(R.drawable.badcase_radio_button_style)
|
||||
checkBox.setPadding(SizeUtils.dp2px(10f),
|
||||
SizeUtils.dp2px(10f),
|
||||
SizeUtils.dp2px(10f),
|
||||
SizeUtils.dp2px(10f),
|
||||
SizeUtils.dp2px(10f)
|
||||
)
|
||||
checkBox.textSize = AutoSizeUtils.dp2px(mActivity, 18f).toFloat()
|
||||
SizeUtils.dp2px(10f))
|
||||
checkBox.textSize = AutoSizeUtils.dp2px(mActivity,18f).toFloat()
|
||||
checkBox.text = it.reason
|
||||
checkBox.isChecked = it.isChecked
|
||||
checkBox.setOnCheckedChangeListener(this@PassiveBadCaseWindow)
|
||||
flReasonLayout.addView(checkBox, lp)
|
||||
flReasonLayout.addView(checkBox,lp)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -345,13 +353,13 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
|
||||
override fun onCheckedChanged(buttonView: CompoundButton?, isChecked: Boolean) {
|
||||
buttonView?.text?.let {
|
||||
if (isChecked) {
|
||||
if (!uploadReason.contains(it)) {
|
||||
if(isChecked){
|
||||
if(!uploadReason.contains(it)){
|
||||
uploadReason += it
|
||||
}
|
||||
} else {
|
||||
if (uploadReason.contains(it)) {
|
||||
uploadReason = uploadReason.replace(it.toString(), "")
|
||||
}else{
|
||||
if(uploadReason.contains(it)){
|
||||
uploadReason = uploadReason.replace(it.toString(),"")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -365,7 +373,7 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
if (mFloatLayout.parent != null) mWindowManager!!.removeView(mFloatLayout)
|
||||
}
|
||||
|
||||
fun setRecord(msgBoxBean: MsgBoxBean) {
|
||||
fun setRecord(msgBoxBean: MsgBoxBean){
|
||||
boxBean = msgBoxBean
|
||||
val recordBagMsg = (msgBoxBean.bean as RecordBagMsg)
|
||||
recordKey = recordBagMsg.key.toString()
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.biz;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.os.Bundle;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.zhjt.mogo_core_function_devatools.R;
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description BadCase车端磁盘空间已满预警弹窗
|
||||
* @since: 2022/2/1
|
||||
*/
|
||||
public class SpaceWarningDialog extends Dialog {
|
||||
|
||||
private TextView tvCleanDisk;//清理磁盘
|
||||
private TextView tvCancel;//取消
|
||||
private Activity mActivity;
|
||||
|
||||
private ClickListener clickListener;
|
||||
|
||||
public SpaceWarningDialog(@NonNull Activity activity) {
|
||||
super(activity, R.style.bad_case_dialog);
|
||||
mActivity = activity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.dialog_space_warning);
|
||||
WindowManager.LayoutParams params = getWindow().getAttributes();
|
||||
params.height = 688;
|
||||
params.width = 1110;
|
||||
getWindow().setAttributes(params);//向WindowManager设置属性
|
||||
setCanceledOnTouchOutside(false);
|
||||
init();
|
||||
initEvent();
|
||||
}
|
||||
|
||||
private void init(){
|
||||
tvCleanDisk = findViewById(R.id.tvCleanDisk);
|
||||
tvCancel = findViewById(R.id.tvCancel);
|
||||
}
|
||||
|
||||
private void initEvent(){
|
||||
//清理磁盘
|
||||
tvCleanDisk.setOnClickListener(v -> {
|
||||
//跳转录包管理页面
|
||||
// if(mActivity!=null){
|
||||
// CallerDevaToolsManager.INSTANCE.showBadCaseManagerView(mActivity);
|
||||
// }
|
||||
if(clickListener!=null){
|
||||
clickListener.showBadCaseManagerView();
|
||||
}
|
||||
dismiss();
|
||||
});
|
||||
//取消
|
||||
tvCancel.setOnClickListener(v -> {
|
||||
//取消弹窗
|
||||
dismiss();
|
||||
});
|
||||
}
|
||||
|
||||
public void setClickListener(ClickListener clickListener){
|
||||
this.clickListener = clickListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttachedToWindow() {
|
||||
super.onAttachedToWindow();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
}
|
||||
|
||||
public interface ClickListener{
|
||||
void showBadCaseManagerView();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.biz.adapter
|
||||
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.CheckBox
|
||||
import android.widget.EditText
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.badcase.BagDescriptionEntity
|
||||
import com.mogo.eagle.core.data.badcase.BagInfoEntity
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
import java.text.DecimalFormat
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description Bag包管理列表适配器
|
||||
* @since: 2022/12/19
|
||||
*/
|
||||
class BagManagerListAdapter: RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
||||
|
||||
private var data:List<BagInfoEntity> ?= null
|
||||
private var bagClickListener: BagClickListener ?= null
|
||||
private val format = DecimalFormat("0.00")
|
||||
|
||||
fun setData(data: List<BagInfoEntity>?){
|
||||
this.data = data
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
|
||||
if(viewType == 1){
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_bag_time_title,parent,false)
|
||||
return BagTimeTitleHolder(view)
|
||||
}else{
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_bag_manager, parent, false)
|
||||
return BagManagerListHolder(view)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
|
||||
when(holder){
|
||||
is BagTimeTitleHolder ->{
|
||||
data?.let {
|
||||
holder.tvBagTimeTitle.text = it[position].timeStr
|
||||
}
|
||||
}
|
||||
is BagManagerListHolder->{
|
||||
data?.let {
|
||||
val bagInfoEntity = it[position]
|
||||
holder.cbBagSelect.setOnCheckedChangeListener(null)
|
||||
holder.cbBagSelect.isChecked = bagInfoEntity.selectStatus
|
||||
holder.cbBagSelect.tag = bagInfoEntity
|
||||
holder.cbBagSelect.setOnCheckedChangeListener { _, isChecked ->
|
||||
bagClickListener?.onClick(bagInfoEntity,isChecked)
|
||||
}
|
||||
|
||||
val textWatcher: TextWatcher = object : TextWatcher {
|
||||
override fun beforeTextChanged(
|
||||
charSequence: CharSequence,
|
||||
i: Int,
|
||||
i1: Int,
|
||||
i2: Int
|
||||
) {
|
||||
}
|
||||
|
||||
override fun onTextChanged(charSequence: CharSequence, i: Int, i1: Int, i2: Int) {}
|
||||
override fun afterTextChanged(editable: Editable) {
|
||||
bagInfoEntity.description?.let { desc->
|
||||
val descriptionStr = editable.toString()
|
||||
if(desc.description != descriptionStr){
|
||||
desc.description = descriptionStr
|
||||
bagClickListener?.editDescription(bagInfoEntity.key,desc)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
holder.etBagNameEdit.onFocusChangeListener =
|
||||
View.OnFocusChangeListener { p0, hasFocus ->
|
||||
val edit = p0 as EditText
|
||||
if(hasFocus){
|
||||
edit.addTextChangedListener(textWatcher)
|
||||
}else{
|
||||
edit.removeTextChangedListener(textWatcher)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bagInfoEntity.description?.let { des->
|
||||
if(des.reportBI){
|
||||
//已上报
|
||||
holder.tvBagReportStatus.text = "已上报"
|
||||
holder.tvBagReportStatus.setBackgroundResource(R.drawable.bag_reported_button_bg)
|
||||
}else{
|
||||
//未上报
|
||||
holder.tvBagReportStatus.text = "上报"
|
||||
holder.tvBagReportStatus.setBackgroundResource(R.drawable.bag_report_button_bg)
|
||||
holder.tvBagReportStatus.setOnClickListener {
|
||||
bagClickListener?.uploadBI(bagInfoEntity)
|
||||
}
|
||||
}
|
||||
if(des.description.isEmpty()){
|
||||
holder.etBagNameEdit.setText(bagInfoEntity.key.toString())
|
||||
}else{
|
||||
holder.etBagNameEdit.setText(des.description)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(bagInfoEntity.description?.hasAudio == true){
|
||||
holder.ivBagAudio.visibility = View.VISIBLE
|
||||
holder.ivBagAudio.setOnClickListener {
|
||||
bagInfoEntity.description?.let { description->
|
||||
bagClickListener?.bagAudio(bagInfoEntity.key,description.audioUrl)
|
||||
}
|
||||
}
|
||||
}else{
|
||||
holder.ivBagAudio.visibility = View.INVISIBLE
|
||||
}
|
||||
//大小
|
||||
val bagSize = format.format(bagInfoEntity.totalSize/(1000*1024*1024.0))
|
||||
holder.tvBagSize.text = "${bagSize}G"
|
||||
|
||||
//时间
|
||||
bagInfoEntity.timestamp?.let { time->
|
||||
val hour = time.substring(8,10)
|
||||
val min = time.substring(10,12)
|
||||
val second = time.substring(12,14)
|
||||
holder.tvBagTime.text = "${hour}:${min}:${second}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount() = data?.size ?: 0
|
||||
|
||||
override fun getItemViewType(position: Int): Int {
|
||||
return data!![position].itemType
|
||||
}
|
||||
|
||||
class BagTimeTitleHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var tvBagTimeTitle: TextView = itemView.findViewById(R.id.tvBagTimeTitle)
|
||||
}
|
||||
|
||||
class BagManagerListHolder(itemView: View) : RecyclerView.ViewHolder(itemView){
|
||||
var cbBagSelect: CheckBox = itemView.findViewById(R.id.cbBagSelect)
|
||||
var etBagNameEdit: EditText = itemView.findViewById(R.id.etBagNameEdit)
|
||||
var tvBagReportStatus: TextView = itemView.findViewById(R.id.tvBagReportStatus)
|
||||
var ivBagAudio: ImageView = itemView.findViewById(R.id.ivBagAudio)
|
||||
var tvBagTime: TextView = itemView.findViewById(R.id.tvBagTime)
|
||||
var tvBagSize: TextView = itemView.findViewById(R.id.tvBagSize)
|
||||
}
|
||||
|
||||
fun setListener(listener: BagClickListener){
|
||||
bagClickListener = listener
|
||||
}
|
||||
|
||||
interface BagClickListener{
|
||||
//选择Bag包
|
||||
fun onClick(bagInfoEntity: BagInfoEntity,isChecked: Boolean)
|
||||
//上报BI平台
|
||||
fun uploadBI(bagInfoEntity: BagInfoEntity)
|
||||
//编辑Bag包描述信息
|
||||
fun editDescription(key: Long,description: BagDescriptionEntity)
|
||||
//听录音
|
||||
fun bagAudio(key: Long,audioUrl: String)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.consts
|
||||
|
||||
import com.mogo.eagle.core.data.badcase.BagInfoEntity
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 录包配置参数
|
||||
@@ -32,5 +34,8 @@ object BadCaseConfig {
|
||||
//自定义Topic清单列表
|
||||
@JvmField
|
||||
var customTopicList: ArrayList<String> = ArrayList()
|
||||
//Bag包管理列表
|
||||
@JvmField
|
||||
var bagManagerList: ArrayList<BagInfoEntity> = ArrayList()
|
||||
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.record;
|
||||
|
||||
import android.media.AudioManager;
|
||||
import android.media.MediaPlayer;
|
||||
import android.text.TextUtils;
|
||||
|
||||
//播放试听
|
||||
public class Audition implements MediaPlayer.OnPreparedListener, MediaPlayer.OnCompletionListener{
|
||||
private static volatile Audition INSTANCE;
|
||||
public MediaPlayer mediaPlayer;
|
||||
private String oldPath;
|
||||
private OnAuditionListener listener;
|
||||
|
||||
public interface OnAuditionListener {
|
||||
void onAuditionCompletion();
|
||||
|
||||
}
|
||||
|
||||
public void registerOnAuditionListener(OnAuditionListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
public void unregisterOnAuditionListener() {
|
||||
this.listener = null;
|
||||
}
|
||||
|
||||
private Audition() {
|
||||
}
|
||||
|
||||
public static Audition getInstance() {
|
||||
if (INSTANCE == null) {
|
||||
synchronized (Audition.class) {
|
||||
if (INSTANCE == null) {
|
||||
INSTANCE = new Audition();
|
||||
}
|
||||
}
|
||||
}
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
|
||||
public boolean isPlaying() {
|
||||
return mediaPlayer != null && mediaPlayer.isPlaying();
|
||||
}
|
||||
|
||||
private void play(String path) {
|
||||
oldPath = path;
|
||||
if (mediaPlayer != null) {
|
||||
mediaPlayer.release();
|
||||
mediaPlayer = null;
|
||||
}
|
||||
if (mediaPlayer == null) {
|
||||
mediaPlayer = new MediaPlayer();
|
||||
mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
|
||||
mediaPlayer.setOnPreparedListener(this);
|
||||
mediaPlayer.setOnCompletionListener(this);
|
||||
}
|
||||
try {
|
||||
mediaPlayer.setDataSource(path);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
mediaPlayer.prepareAsync();
|
||||
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
oldPath = null;
|
||||
if (mediaPlayer != null) {
|
||||
mediaPlayer.stop();
|
||||
mediaPlayer.reset();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public boolean playOrStop(String path) {
|
||||
if (!TextUtils.equals(oldPath, path)) {
|
||||
play(path);
|
||||
return true;
|
||||
} else {
|
||||
stop();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void onDestroy() {
|
||||
stop();
|
||||
mediaPlayer = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPrepared(MediaPlayer mp) {
|
||||
mp.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCompletion(MediaPlayer mp) {
|
||||
oldPath = null;
|
||||
if (listener != null) {
|
||||
listener.onAuditionCompletion();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,11 +9,14 @@ import com.mogo.eagle.core.data.app.AppConfigInfo.role
|
||||
import com.mogo.eagle.core.data.bindingcar.ModifyBindingcarInfo
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.data.obu.MogoObuConst
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuApiManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils.isDriver
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils.isPassenger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.zhjt.mogo_core_function_devatools.upgrade.IPCUpgradeManager.Companion.ipcUpgradeManager
|
||||
@@ -59,9 +62,6 @@ class BindingCarManager : IMoGoAutopilotCarConfigListener {
|
||||
if (carConfigResp != null && !TextUtils.isEmpty(carConfigResp.macAddress)) {
|
||||
Log.d("Upgrade", "MoGoHandAdasMsgManager address = " + carConfigResp.macAddress)
|
||||
getBindingCarInfo(carConfigResp.macAddress, MoGoAiCloudClientConfig.getInstance().sn)
|
||||
|
||||
//obu的升级,只需要司机屏连接
|
||||
queryObuUpgrade(carConfigResp.macAddress)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,14 +164,16 @@ class BindingCarManager : IMoGoAutopilotCarConfigListener {
|
||||
fun queryAppUpgrade() {
|
||||
UpgradeAppNetWorkManager.getInstance()
|
||||
.getAppUpgradeInfo(mContext, mAddress, role.toString() + "")
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 司机屏 处理obu升级即可,乘客屏不需要处理
|
||||
*
|
||||
* obu的升级,只需要司机屏连接
|
||||
*/
|
||||
private fun queryObuUpgrade(macAddress: String) {
|
||||
ObuUpgradeAppNetWorkManager.getInstance().getObuUpgradeInfo(mContext, macAddress)
|
||||
fun queryObuUpgrade(obuVersionName: String) {
|
||||
CallerLogger.d("${SceneConstant.M_OBU}${MogoObuConst.TAG_UPGRADE_OBU}","queryObuUpgrade isConnected = ${CallerObuApiManager.isConnected()} --- mAddress = $mAddress")
|
||||
ObuUpgradeAppNetWorkManager.getInstance().getObuUpgradeInfo(mContext, mAddress, obuVersionName)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ class SceneManager {
|
||||
sceneModuleTAG.map[TAXI] = SceneModule(true, M_TAXI)
|
||||
sceneModuleTAG.map[TAXI_P] = SceneModule(true, M_TAXI_P)
|
||||
sceneModuleTAG.map[SWEEPER] = SceneModule(true, M_SWEEPER)
|
||||
sceneModuleTAG.map[OTHER] = SceneModule(false, M_OTHER)
|
||||
sceneModuleTAG.map[OTHER] = SceneModule(true, M_OTHER)
|
||||
|
||||
sceneLogTAG.map[TAXI] = SceneTAG(false)
|
||||
sceneLogTAG.map[BUS] = SceneTAG(false)
|
||||
|
||||
@@ -3,17 +3,17 @@ package com.zhjt.mogo_core_function_devatools.upgrade;
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BINDING;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.constants.HostConst;
|
||||
import com.mogo.eagle.core.data.bindingcar.UpgradeAppInfo;
|
||||
import com.mogo.eagle.core.data.obu.MogoObuConst;
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory;
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.AppUtils;
|
||||
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.annotations.NonNull;
|
||||
@@ -50,15 +50,15 @@ public class ObuUpgradeAppNetWorkManager {
|
||||
|
||||
/**
|
||||
* 获取obu升级信息,obu升级服务端使用app升级接口,根据screenType区分类型
|
||||
* mac :工控机mac地址
|
||||
* mac :工控机mac地址,
|
||||
* screenType : 类型
|
||||
*/
|
||||
public void getObuUpgradeInfo(Context context, String mac) {
|
||||
public void getObuUpgradeInfo(Context context, String mac, String versionName) {
|
||||
// String sn = "X20202203105S688HZ";
|
||||
// String mac = "48:b0:2d:3a:bc:78";
|
||||
// String mac1 = "48:b0:2d:4d:33:40";
|
||||
|
||||
String sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||
String obuVersionName = String.valueOf(AppUtils.getAppVersionCode()); // TODO 获取obu的版本号, string和int 服务端处理
|
||||
CallerLogger.INSTANCE.d(M_BINDING + TAG, "getObuUpgradeInfo mac = " + mac + "---sn = " + sn + "---obuVersionName =" + obuVersionName);
|
||||
CallerLogger.INSTANCE.d(M_BINDING + TAG, "getObuUpgradeInfo mac = " + mac + " ---sn = " + sn + " ---versionName = " + versionName);
|
||||
UpgradeAppRequest request = new UpgradeAppRequest(sn, mac, "7");
|
||||
RequestBody requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), GsonUtil.jsonFromObject(request));
|
||||
mUpgradeApiService.getUpgradeInfo(requestBody)
|
||||
@@ -72,10 +72,9 @@ public class ObuUpgradeAppNetWorkManager {
|
||||
@Override
|
||||
public void onNext(@NonNull UpgradeAppInfo info) {
|
||||
if (info != null && info.result != null) {
|
||||
CallerLogger.INSTANCE.d(M_BINDING + TAG, "getObuUpgradeInfo url = " + info.result.getAppUrl() + "----name = " + info.result.getVersionName() + "--obuVersionName =" + obuVersionName + "--info.result = " + info.result);
|
||||
if (!String.valueOf(info.result.getVersionName()).equals(obuVersionName)) {
|
||||
//下载 TAG和文件名 TODO
|
||||
CallerDevaToolsManager.INSTANCE.downLoadPackage("OBU", info.result.getAppUrl());
|
||||
CallerLogger.INSTANCE.d(M_BINDING + TAG, "getObuUpgradeInfo appFileName = " + info.result.getAppFileName() + " ----url = " + info.result.getAppUrl() + " ----name = " + info.result.getVersionName() + " --obuVersionName =" + versionName + " ---info.result = " + info.result);
|
||||
if (!String.valueOf(info.result.getVersionName()).equals(versionName)) { //判断是否下载,当文件名称不一致的时候,就下载
|
||||
CallerDevaToolsManager.INSTANCE.downLoadPackage(info.result.getAppFileName(), info.result.getAppUrl());
|
||||
}
|
||||
} else {
|
||||
CallerLogger.INSTANCE.d(M_BINDING + TAG, "getObuUpgradeInfo onNext info == null");
|
||||
@@ -84,7 +83,7 @@ public class ObuUpgradeAppNetWorkManager {
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
|
||||
CallerLogger.INSTANCE.e(M_BINDING + TAG, "getObuUpgradeInfo e = " + e);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -4,14 +4,17 @@ import android.app.NotificationManager
|
||||
import android.content.Context
|
||||
import androidx.core.app.NotificationCompat
|
||||
import com.elegant.utils.UiThreadHandler
|
||||
import com.mogo.eagle.core.data.obu.MogoObuConst
|
||||
import com.mogo.eagle.core.function.api.devatools.IMogoDevaToolsUpgradeListener
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsUpgradeListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.updateStatusBarDownloadView
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuApiManager
|
||||
import com.mogo.eagle.core.utilcode.breakpoint.Config
|
||||
import com.mogo.eagle.core.utilcode.breakpoint.bean.ThreadBean
|
||||
import com.mogo.eagle.core.utilcode.breakpoint.callback.IDownload
|
||||
import com.mogo.eagle.core.utilcode.breakpoint.utils.DownloadUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||
import com.mogo.eagle.core.utilcode.util.AppUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ZipUtils
|
||||
@@ -29,12 +32,18 @@ class UpgradeManager : IDownload {
|
||||
}
|
||||
|
||||
private var map: Map<String, String>? = null
|
||||
private var mDownloadFileName: String? = null
|
||||
|
||||
fun downLoadPackage(context: Context, downloadKey: String,downloadUrl: String) {
|
||||
CallerLogger.d("${SceneConstant.M_OBU}${MogoObuConst.TAG_UPGRADE_OBU}", "UpgradeManager downLoadPackage = " + downloadUrl?.contains(".zip") + "----downloadKey = $downloadKey ---downloadUrl = $downloadUrl")
|
||||
if (downloadUrl?.contains(".zip")) {
|
||||
mDownloadFileName = downloadKey
|
||||
}
|
||||
|
||||
DownloadUtils.downLoad(
|
||||
context,
|
||||
downloadUrl,
|
||||
Config.downLoadPath,
|
||||
if (downloadUrl?.contains(".zip")) Config.downLoadObuPath else Config.downLoadPath,
|
||||
downloadKey,
|
||||
5,
|
||||
this
|
||||
@@ -81,7 +90,7 @@ class UpgradeManager : IDownload {
|
||||
}
|
||||
|
||||
override fun onFinished(downloadUrl: String?, threadBean: ThreadBean?) {
|
||||
if (downloadUrl != null) {
|
||||
if (downloadUrl != null) { //TODO 需要判断是否是apk文件
|
||||
AppUtils.installApp(Config.downLoadPath + downloadUrl.substring(downloadUrl.lastIndexOf("/") + 1))
|
||||
}
|
||||
if (downloadUrl != null) {
|
||||
@@ -119,7 +128,7 @@ class UpgradeManager : IDownload {
|
||||
}
|
||||
|
||||
/**
|
||||
* 鹰眼app下载监听
|
||||
* 鹰眼app下载监听 liyz
|
||||
*/
|
||||
fun updateUpgradeProgress(context: Context) {
|
||||
val builder = NotificationCompat.Builder(context)
|
||||
@@ -148,7 +157,8 @@ class UpgradeManager : IDownload {
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
override fun onError(url: String?, errorMsg: String?) {}
|
||||
override fun onError(url: String?, errorMsg: String?) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -162,23 +172,37 @@ class UpgradeManager : IDownload {
|
||||
override fun onStart(url: String?) {}
|
||||
override fun onPause(url: String?) {}
|
||||
override fun onProgress(url: String?, length: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun onFinished(url: String?) {
|
||||
//下载完成,解压文件 TODO
|
||||
//下载完成,解压文件
|
||||
try {
|
||||
val files = ZipUtils.unzipFile("", "")
|
||||
//传给obu升级
|
||||
|
||||
val files = ZipUtils.unzipFile(Config.downLoadObuPath + mDownloadFileName, Config.downLoadUnzipObuPath)
|
||||
CallerLogger.d("${SceneConstant.M_OBU}${MogoObuConst.TAG_UPGRADE_OBU}", " onFinished file = ${Config.downLoadObuPath + mDownloadFileName} -----files = $files ")
|
||||
//1传给obu升级,升级成功,2需要删除相应文件夹
|
||||
var md5Path = ""
|
||||
var tarPath = ""
|
||||
for (f in files) {
|
||||
if (f.path.contains(".md5")) {
|
||||
md5Path = f.path
|
||||
}
|
||||
if (f.path.contains(".gz")) {
|
||||
tarPath = f.path
|
||||
}
|
||||
}
|
||||
CallerLogger.d("${SceneConstant.M_OBU}${MogoObuConst.TAG_UPGRADE_OBU}", "updateObuUpgradeStatus ---md5Path = $md5Path -----tarPath = $tarPath ")
|
||||
CallerObuApiManager.uploadObuPack(arrayOf(md5Path, tarPath))
|
||||
} catch (e: IOException) {
|
||||
//解压失败
|
||||
|
||||
//解压失败,删除文件夹
|
||||
CallerObuApiManager.deleteObuFile()
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onError(url: String?, errorMsg: String?) {}
|
||||
override fun onError(url: String?, errorMsg: String?) {
|
||||
//下载失败,删除文件夹
|
||||
CallerObuApiManager.deleteObuFile()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
syntax = "proto3";
|
||||
|
||||
option java_multiple_files = true;
|
||||
option java_package = "com.zhjt.mogo_core_function_devatools.apm.generated";
|
||||
|
||||
|
||||
message ApmEnv {
|
||||
|
||||
/**
|
||||
* 构建类型: release:1; debug:0
|
||||
*/
|
||||
string buildType = 1;
|
||||
|
||||
/**
|
||||
* 网络类型: 1:dev; 2: qa; 3: online; 4: demo
|
||||
*/
|
||||
string netType = 2;
|
||||
/**
|
||||
* docker版本
|
||||
*/
|
||||
string dockerVersion = 3;
|
||||
|
||||
/**
|
||||
* 是否重启了应用
|
||||
*/
|
||||
bool isRelaunchApp = 4;
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:startColor="#BB791C"
|
||||
android:endColor="#BB791C"
|
||||
android:angle="0"
|
||||
/>
|
||||
<corners android:radius="13px" />
|
||||
</shape>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:startColor="#566195"
|
||||
android:endColor="#566195"
|
||||
android:angle="0"
|
||||
/>
|
||||
<corners android:radius="13px" />
|
||||
</shape>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:startColor="#3B4577"
|
||||
android:endColor="#3B4577"
|
||||
android:angle="0"
|
||||
/>
|
||||
<corners android:radius="13px" />
|
||||
</shape>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:startColor="#3B4577"
|
||||
android:endColor="#3B4577"
|
||||
android:angle="0"
|
||||
/>
|
||||
<corners android:radius="16px" />
|
||||
</shape>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 926 B |
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<!-- solid指定形状的填充色,只有android:color一个属性 -->
|
||||
<gradient
|
||||
android:startColor="#3B4577"
|
||||
android:endColor="#7CF6FF"
|
||||
/>
|
||||
<!-- padding设置内容区域离边界的间距 -->
|
||||
<!-- corners设置圆角,只适用于rectangle -->
|
||||
<!-- <corners android:bottomRightRadius="20dp"-->
|
||||
<!-- android:topRightRadius="20dp"/>-->
|
||||
|
||||
<corners android:radius="30px"
|
||||
/>
|
||||
|
||||
</shape>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<corners
|
||||
android:radius="30px"
|
||||
/>
|
||||
<solid android:color="#3B4577"/>
|
||||
|
||||
<stroke
|
||||
android:color="#7CF6FF"
|
||||
android:width="1.5px"
|
||||
/>
|
||||
|
||||
</shape>
|
||||
</item>
|
||||
<item android:id="@android:id/secondaryProgress">
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape>
|
||||
<corners android:topRightRadius="30px"
|
||||
android:bottomRightRadius="30px"/>
|
||||
<solid android:color="#7CF6FF"/>
|
||||
</shape>
|
||||
</scale>
|
||||
</item>
|
||||
|
||||
<item android:id="@android:id/progress">
|
||||
<scale android:scaleWidth="100%"
|
||||
android:drawable="@drawable/progress_bar_ct" />
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:startColor="#029DFF"
|
||||
android:endColor="#0056FF"
|
||||
android:angle="0"
|
||||
/>
|
||||
<corners android:radius="13px" />
|
||||
</shape>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 设置背景色 -->
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<corners android:radius="0dp" />
|
||||
<gradient
|
||||
android:startColor="#33A682"
|
||||
android:endColor="#4ADD80"
|
||||
/>
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!-- 设置进度条颜色 -->
|
||||
<item android:id="@android:id/progress">
|
||||
<clip>
|
||||
<shape>
|
||||
<corners android:radius="0dp" />
|
||||
<gradient
|
||||
android:startColor="#FFD900"
|
||||
android:endColor="#FFAB00"
|
||||
/>
|
||||
</shape>
|
||||
</clip>
|
||||
</item>
|
||||
|
||||
</layer-list>
|
||||
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 设置背景色 -->
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<corners android:radius="21px" />
|
||||
|
||||
<gradient
|
||||
android:startColor="#3B4577"
|
||||
android:endColor="#D71B0E"
|
||||
/>
|
||||
<stroke
|
||||
android:color="#FF807C"
|
||||
android:width="1.5px"
|
||||
/>
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!-- 设置进度条颜色 -->
|
||||
<item android:id="@android:id/progress">
|
||||
<clip>
|
||||
<shape>
|
||||
<corners
|
||||
android:bottomLeftRadius="21px"
|
||||
android:bottomRightRadius="21px"
|
||||
android:topLeftRadius="21px"
|
||||
android:topRightRadius="21px"
|
||||
/>
|
||||
<gradient
|
||||
android:startColor="#06D1ED"
|
||||
android:endColor="#06D1ED"
|
||||
android:type="radial"
|
||||
/>
|
||||
</shape>
|
||||
</clip>
|
||||
</item>
|
||||
|
||||
</layer-list>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:angle="0"
|
||||
android:startColor="#33A682"
|
||||
android:endColor="#4ADD80"
|
||||
android:type="linear" />
|
||||
</shape>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:startColor="#029DFF"
|
||||
android:endColor="#0056FF"
|
||||
android:angle="0"
|
||||
/>
|
||||
<corners android:radius="16px" />
|
||||
</shape>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:angle="0"
|
||||
android:startColor="#FFD900"
|
||||
android:endColor="#FFAB00"
|
||||
android:type="linear" />
|
||||
</shape>
|
||||
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="1110px"
|
||||
android:layout_height="688px">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvUploadTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:text="cos桶上传中"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="56px"
|
||||
android:layout_marginTop="95px"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/viewVerticalLine"
|
||||
android:layout_width="2px"
|
||||
android:layout_height="160px"
|
||||
android:background="#66B8BFE8"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/viewHorizontalLine"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2px"
|
||||
android:background="#66B8BFE8"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/viewVerticalLine"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCancelUpload"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/viewHorizontalLine"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="@id/viewVerticalLine"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:text="取消上传"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="52px"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCancel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/viewHorizontalLine"
|
||||
app:layout_constraintLeft_toRightOf="@id/viewVerticalLine"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:text="取消"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="52px"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/viewUploadProgress"
|
||||
android:layout_width="791px"
|
||||
android:layout_height="42px"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="270px"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:max="100"
|
||||
android:progress="0"
|
||||
android:progressDrawable="@drawable/progress_bar_drawable"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvUploadDetail"
|
||||
android:layout_width="814px"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="370px"
|
||||
android:textColor="#FF06D1ED"
|
||||
android:textSize="43px"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="1110px"
|
||||
android:layout_height="688px">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvWarningTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:text="当前工控机磁盘空间已满"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="56px"
|
||||
android:layout_marginTop="95px"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/viewVerticalLine"
|
||||
android:layout_width="2px"
|
||||
android:layout_height="160px"
|
||||
android:background="#66B8BFE8"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/viewHorizontalLine"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2px"
|
||||
android:background="#66B8BFE8"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/viewVerticalLine"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCleanDisk"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/viewHorizontalLine"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="@id/viewVerticalLine"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:text="清理磁盘"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="52px"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCancel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/viewHorizontalLine"
|
||||
app:layout_constraintLeft_toRightOf="@id/viewVerticalLine"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:text="取消"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="52px"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/viewProgress"
|
||||
android:layout_width="791px"
|
||||
android:layout_height="42px"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="275px"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:max="100"
|
||||
android:progress="0"
|
||||
android:progressDrawable="@drawable/space_warning_progress_bg"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_marginTop="18dp"
|
||||
android:layout_marginBottom="18dp"
|
||||
>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbBagSelect"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:button="@drawable/badcase_radio_button_style"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etBagNameEdit"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/cbBagSelect"
|
||||
app:layout_constraintRight_toLeftOf="@id/tvBagTime"
|
||||
android:layout_marginStart="15dp"
|
||||
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:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBagReportStatus"
|
||||
android:layout_width="162dp"
|
||||
android:layout_height="68dp"
|
||||
android:background="@drawable/bag_reported_button_bg"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:text="已上报"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="28dp"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivBagAudio"
|
||||
android:layout_width="44dp"
|
||||
android:layout_height="44dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/tvBagReportStatus"
|
||||
android:src="@drawable/icon_bag_audio"
|
||||
android:visibility="invisible"
|
||||
android:layout_marginEnd="30dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBagTime"
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="26dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/ivBagAudio"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:gravity="start"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBagSize"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#75FFFFFF"
|
||||
android:textSize="26dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvBagTime"
|
||||
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBagTimeTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="38px"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,228 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="960dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#F0151D41"
|
||||
android:id="@+id/clLayout"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivManagerClose"
|
||||
android:layout_width="107dp"
|
||||
android:layout_height="107dp"
|
||||
android:layout_marginTop="66dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:src="@drawable/icon_close_nor"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/viewManagerTitleLine"
|
||||
android:layout_width="14dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginStart="80dp"
|
||||
android:layout_marginTop="92dp"
|
||||
android:background="#2966EC"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvManagerTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="任务管理"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="42dp"
|
||||
app:layout_constraintTop_toTopOf="@id/viewManagerTitleLine"
|
||||
app:layout_constraintBottom_toBottomOf="@id/viewManagerTitleLine"
|
||||
app:layout_constraintLeft_toLeftOf="@id/viewManagerTitleLine"
|
||||
android:layout_marginStart="50dp"
|
||||
/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/clBagHaveDataLayout"
|
||||
android:layout_width="785dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/viewManagerTitleLine"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="@id/viewManagerTitleLine"
|
||||
android:visibility="gone"
|
||||
>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/pbSpacePercent"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="785dp"
|
||||
android:layout_height="26dp"
|
||||
android:layout_marginTop="100dp"
|
||||
android:progressDrawable="@drawable/space_percent_bg"
|
||||
android:max="100"
|
||||
android:progress="10"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/viewUsedSpace"
|
||||
android:layout_width="23dp"
|
||||
android:layout_height="23dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/pbSpacePercent"
|
||||
app:layout_constraintLeft_toLeftOf="@id/pbSpacePercent"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@drawable/used_space_bg"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvUsedSpaceContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="32dp"
|
||||
app:layout_constraintTop_toTopOf="@id/viewUsedSpace"
|
||||
app:layout_constraintBottom_toBottomOf="@id/viewUsedSpace"
|
||||
app:layout_constraintLeft_toRightOf="@id/viewUsedSpace"
|
||||
android:layout_marginStart="10dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvFreeSpaceContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="32dp"
|
||||
app:layout_constraintRight_toRightOf="@id/pbSpacePercent"
|
||||
app:layout_constraintTop_toTopOf="@id/viewUsedSpace"
|
||||
app:layout_constraintBottom_toBottomOf="@id/viewUsedSpace"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/viewFreeSpace"
|
||||
android:layout_width="23dp"
|
||||
android:layout_height="23dp"
|
||||
android:background="@drawable/unused_space_bg"
|
||||
app:layout_constraintTop_toTopOf="@id/viewUsedSpace"
|
||||
app:layout_constraintBottom_toBottomOf="@id/viewUsedSpace"
|
||||
app:layout_constraintRight_toLeftOf="@id/tvFreeSpaceContent"
|
||||
android:layout_marginEnd="10dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSelectAll"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="80dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/viewUsedSpace"
|
||||
android:layout_marginTop="50dp"
|
||||
android:background="@drawable/select_all_button_bg"
|
||||
android:text="一键全选"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="36dp"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCancelSelect"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="80dp"
|
||||
app:layout_constraintTop_toTopOf="@id/tvSelectAll"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvSelectAll"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvSelectAll"
|
||||
android:layout_marginStart="30dp"
|
||||
android:background="@drawable/cancel_select_button_bg"
|
||||
android:text="取消"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="36dp"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSelectedBagSize"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/tvSelectAll"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvSelectAll"
|
||||
app:layout_constraintRight_toRightOf="@id/pbSpacePercent"
|
||||
android:textColor="#FF00AFFF"
|
||||
android:textSize="34dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvUploadCloud"
|
||||
android:layout_width="330dp"
|
||||
android:layout_height="120dp"
|
||||
app:layout_constraintLeft_toLeftOf="@id/pbSpacePercent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginBottom="120dp"
|
||||
android:background="@drawable/upload_cloud_button_bg"
|
||||
android:text="上云"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="42dp"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDeleteSelect"
|
||||
android:layout_width="330dp"
|
||||
android:layout_height="120dp"
|
||||
app:layout_constraintTop_toTopOf="@id/tvUploadCloud"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvUploadCloud"
|
||||
app:layout_constraintRight_toRightOf="@id/pbSpacePercent"
|
||||
android:background="@drawable/delete_button_bg"
|
||||
android:text="删除"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="42dp"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvBagList"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintLeft_toLeftOf="@id/pbSpacePercent"
|
||||
app:layout_constraintRight_toRightOf="@id/pbSpacePercent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvSelectAll"
|
||||
app:layout_constraintBottom_toTopOf="@id/tvUploadCloud"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginBottom="30dp"
|
||||
/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/clBagNoDataLayout"
|
||||
android:layout_width="785dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/viewManagerTitleLine"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="@id/viewManagerTitleLine"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivBagNoData"
|
||||
android:layout_width="@dimen/dp_317"
|
||||
android:layout_height="@dimen/dp_290"
|
||||
android:src="@drawable/icon_bag_no_data"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_400"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="暂无数据"
|
||||
android:textColor="#FFCAD6FF"
|
||||
android:textSize="@dimen/dp_44"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/ivBagNoData"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -82,7 +82,6 @@ dependencies {
|
||||
compileOnly rootProject.ext.dependencies.mogo_core_utils
|
||||
compileOnly rootProject.ext.dependencies.mogo_core_function_datacenter
|
||||
compileOnly rootProject.ext.dependencies.mogo_core_function_call
|
||||
compileOnly project(':libraries:mogo-adas')
|
||||
} else {
|
||||
api project(':test:crashreport-apmbyte')
|
||||
|
||||
@@ -91,7 +90,6 @@ dependencies {
|
||||
api project(':core:mogo-core-res')
|
||||
compileOnly project(':core:mogo-core-utils')
|
||||
compileOnly project(':core:mogo-core-function-call')
|
||||
compileOnly project(':libraries:mogo-adas')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ import android.graphics.Color
|
||||
import android.os.Build
|
||||
import android.text.Html
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.annotation.RequiresApi
|
||||
@@ -40,6 +39,7 @@ import com.mogo.eagle.core.data.deva.scene.SceneModule
|
||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
|
||||
import com.mogo.eagle.core.data.gnss.AccelerationEntity
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.data.obu.MogoObuConst
|
||||
import com.mogo.eagle.core.data.obu.ObuStatusInfo
|
||||
import com.mogo.eagle.core.data.report.ReportEntity
|
||||
import com.mogo.eagle.core.function.api.autopilot.*
|
||||
@@ -569,7 +569,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
|
||||
// 初始化OBU IP信息
|
||||
val ipAddress =
|
||||
SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, "192.168.1.199")
|
||||
SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, MogoObuConst.OBU_DEFAULT_IP)
|
||||
|
||||
etObuIP.setText(ipAddress)
|
||||
etObuIP.text?.let { etObuIP.setSelection(it.length) }
|
||||
|
||||
@@ -8,6 +8,7 @@ import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig
|
||||
import com.mogo.eagle.core.data.obu.MogoObuConst
|
||||
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsFuncConfigListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
@@ -45,6 +46,7 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
sopLayout.setOnClickListener { }
|
||||
//绕障类功能开关
|
||||
tbObstacleAvoidance.isChecked = FunctionBuildConfig.isDetouring
|
||||
tbObstacleAvoidance.setOnCheckedChangeListener { _, isChecked ->
|
||||
@@ -144,7 +146,10 @@ internal 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))
|
||||
CallerAutoPilotControlManager.setDemoMode(FunctionBuildConfig.isDemoMode)
|
||||
@@ -162,7 +167,10 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
// 雨天模式,上一次勾选的数据
|
||||
tbRainMode.isChecked = FunctionBuildConfig.isRainMode
|
||||
//雨天模式
|
||||
tbRainMode.setOnCheckedChangeListener { _, isChecked ->
|
||||
tbRainMode.setOnCheckedChangeListener { compoundButton, isChecked ->
|
||||
if(!compoundButton.isPressed){
|
||||
return@setOnCheckedChangeListener
|
||||
}
|
||||
CallerAutoPilotControlManager.setRainMode(isChecked)
|
||||
FunctionBuildConfig.isRainMode = isChecked
|
||||
}
|
||||
@@ -175,7 +183,7 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
tbObu.isChecked = CallerObuApiManager.isConnected()
|
||||
tbObu.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (isChecked) {
|
||||
CallerObuApiManager.resetObuIpAddress("192.168.1.199")
|
||||
CallerObuApiManager.resetObuIpAddress(MogoObuConst.OBU_DEFAULT_IP)
|
||||
} else {
|
||||
//断开链接
|
||||
CallerObuApiManager.disConnectObu()
|
||||
@@ -251,11 +259,8 @@ internal 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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,39 +270,27 @@ internal 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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,6 +53,10 @@ class ToolsView private constructor() {
|
||||
override fun showSOPSettingView() {
|
||||
sopView.toggle(it)
|
||||
}
|
||||
|
||||
override fun showBadCaseManagerView() {
|
||||
ToastUtils.showShort("代码合并中")
|
||||
}
|
||||
})
|
||||
}
|
||||
toolsViewFloat = WarningFloat.with(it)
|
||||
|
||||
@@ -100,6 +100,10 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
sopLayout.setOnClickListener {
|
||||
clickListener?.showSOPSettingView()
|
||||
}
|
||||
managerLayout.setOnClickListener {
|
||||
//录包管理页面
|
||||
clickListener?.showBadCaseManagerView()
|
||||
}
|
||||
ivDebugPanel.setOnClickListener {
|
||||
clickListener?.showDebugPanelView()
|
||||
|
||||
@@ -212,6 +216,7 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
fun showDebugPanelView()
|
||||
fun showFeedbackView()
|
||||
fun showSOPSettingView()
|
||||
fun showBadCaseManagerView()
|
||||
}
|
||||
|
||||
override fun onAutopilotCarConfig(carConfigResp: MessagePad.CarConfigResp) {
|
||||
|
||||
@@ -13,7 +13,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.zhidao.support.adas.high.common.MogoReport
|
||||
import com.zhjt.mogo.adas.data.bean.MogoReport
|
||||
import mogo_msg.MogoReportMsg
|
||||
|
||||
class TakeOverView @JvmOverloads constructor(
|
||||
|
||||
@@ -2,9 +2,7 @@ package com.mogo.eagle.core.function.hmi.ui.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Color;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -15,6 +15,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningActionsListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisBrakeStateListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGearStateListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisSteeringStateListener;
|
||||
@@ -32,6 +33,7 @@ import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import chassis.Chassis;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
/**
|
||||
* @author Jing
|
||||
@@ -42,7 +44,8 @@ public class TrafficDataView extends ConstraintLayout implements
|
||||
IMoGoChassisSteeringStateListener,
|
||||
IMoGoChassisGearStateListener ,
|
||||
IMoGoChassisBrakeStateListener,
|
||||
IMoGoChassisThrottleStateListener {
|
||||
IMoGoChassisThrottleStateListener,
|
||||
IMoGoAutopilotPlanningActionsListener {
|
||||
private static final String TAG = "TrafficDataView";
|
||||
private TapPositionView tapPositionView;
|
||||
private TextView speedTextView;
|
||||
@@ -114,7 +117,7 @@ public class TrafficDataView extends ConstraintLayout implements
|
||||
CallerChassisGearStateListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerChassisBrakeStateListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerChassisThrottleStateListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerPlanningActionsListenerManager.INSTANCE.addListener(TAG, planningActionMsg -> acceleration = planningActionMsg.getDestinationAcc());
|
||||
CallerPlanningActionsListenerManager.INSTANCE.addListener(TAG, this);
|
||||
}
|
||||
|
||||
private void initView(@NonNull Context context) {
|
||||
@@ -136,6 +139,10 @@ public class TrafficDataView extends ConstraintLayout implements
|
||||
CallerPlanningActionsListenerManager.INSTANCE.removeListener(TAG);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pncActions(@NonNull MessagePad.PlanningActionMsg planningActionMsg) {
|
||||
acceleration = planningActionMsg.getDestinationAcc();
|
||||
}
|
||||
|
||||
/**
|
||||
* 方向盘转向角 左+右-
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
@@ -148,6 +148,35 @@
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/managerLayout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_216"
|
||||
app:layout_constraintTop_toTopOf="@id/sopLayout"
|
||||
app:layout_constraintBottom_toBottomOf="@id/sopLayout"
|
||||
app:layout_constraintLeft_toRightOf="@id/sopLayout"
|
||||
android:layout_marginStart="142dp"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/debug_icon_bag_manager"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="42dp"
|
||||
android:text="@string/debug_bad_case_manager"
|
||||
android:textColor="@color/color_FFA7B6F0"
|
||||
android:textSize="32dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_check_title"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -1,297 +1,298 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/sopLayout"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="@dimen/dp_800"
|
||||
android:layout_height="@dimen/dp_1100"
|
||||
android:background="#FFFFFF"
|
||||
android:orientation="vertical">
|
||||
android:background="#FFFFFF">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:ignore="UselessParent">
|
||||
<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"
|
||||
/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<!--绕障类功能-->
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/tbObstacleAvoidance"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
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
|
||||
android:id="@+id/tbObstacleAvoidance"
|
||||
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_toTopOf="parent"
|
||||
/>
|
||||
<!--危险障碍物颜色标记-->
|
||||
<ToggleButton
|
||||
android:id="@+id/tbMarkingObstacles"
|
||||
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/tbObstacleAvoidance"
|
||||
/>
|
||||
<!--引导线动态效果-->
|
||||
<ToggleButton
|
||||
android:id="@+id/tbRouteDynamicEffect"
|
||||
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/tbMarkingObstacles"
|
||||
/>
|
||||
<!--红绿灯标识-->
|
||||
<ToggleButton
|
||||
android:id="@+id/tbTrafficLight"
|
||||
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/tbRouteDynamicEffect"
|
||||
/>
|
||||
<!--限速标识-->
|
||||
<ToggleButton
|
||||
android:id="@+id/tbSpeedLimit"
|
||||
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/tbTrafficLight"
|
||||
/>
|
||||
<!--危险障碍物颜色标记-->
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/tbMarkingObstacles"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
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
|
||||
android:id="@+id/tbDemoMode"
|
||||
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/tbSpeedLimit"
|
||||
/>
|
||||
<!--引导线动态效果-->
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/tbRouteDynamicEffect"
|
||||
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/tbObstacleAvoidance"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/verticalGuideLine"
|
||||
/>
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbRainMode"
|
||||
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/tbDemoMode"
|
||||
/>
|
||||
<!--红绿灯标识-->
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/tbTrafficLight"
|
||||
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/tbObstacleAvoidance"
|
||||
app:layout_constraintLeft_toRightOf="@id/verticalGuideLine"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
/>
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbObu"
|
||||
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="开启OBU"
|
||||
android:textOn="关闭OBU"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbRainMode"
|
||||
/>
|
||||
<!--限速标识-->
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/tbSpeedLimit"
|
||||
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/tbRouteDynamicEffect"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/verticalGuideLine"
|
||||
/>
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbObuV2vView"
|
||||
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="展示v2v事件"
|
||||
android:textOn="不展示v2v事件"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbObu"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
<!--美化模式-->
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/tbDemoMode"
|
||||
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/tbRouteDynamicEffect"
|
||||
app:layout_constraintLeft_toRightOf="@id/verticalGuideLine"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
/>
|
||||
|
||||
<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" />
|
||||
<!--雨天模式-->
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/tbRainMode"
|
||||
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/tbSpeedLimit"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/verticalGuideLine"
|
||||
/>
|
||||
|
||||
<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" />
|
||||
<!--OBU-->
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/tbObu"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
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
|
||||
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" />
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/tbObuV2vView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
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/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" />
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/tbObuV2iView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
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"
|
||||
/>
|
||||
|
||||
<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"
|
||||
/>
|
||||
<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"
|
||||
/>
|
||||
|
||||
<!--已经有策略,开关去掉-->
|
||||
<ToggleButton
|
||||
android:id="@+id/tbRoadLimitSpeedSop"
|
||||
android:layout_width="match_parent"
|
||||
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" />
|
||||
<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"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSpeedThresholdTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbRoadLimitSpeedSop"
|
||||
android:text="变道速度阈值:"
|
||||
android:textSize="@dimen/dp_36"
|
||||
android:textColor="#1A1A1A"
|
||||
android:layout_margin="10dp"
|
||||
/>
|
||||
<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"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivSpeedReduce"
|
||||
android:layout_width="@dimen/dp_64"
|
||||
android:layout_height="@dimen/dp_64"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvSpeedThresholdTitle"
|
||||
app:layout_constraintTop_toTopOf="@id/tvSpeedThresholdTitle"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvSpeedThresholdTitle"
|
||||
android:src="@drawable/icon_reduce"
|
||||
android:padding="10dp"
|
||||
/>
|
||||
<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"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSpeed"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toTopOf="@id/ivSpeedReduce"
|
||||
app:layout_constraintBottom_toBottomOf="@id/ivSpeedReduce"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivSpeedReduce"
|
||||
android:textSize="@dimen/dp_36"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/debug_setting_edit_bg"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
/>
|
||||
<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"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivSpeedAdd"
|
||||
android:layout_width="@dimen/dp_64"
|
||||
android:layout_height="@dimen/dp_64"
|
||||
app:layout_constraintTop_toTopOf="@id/tvSpeed"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvSpeed"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvSpeed"
|
||||
android:src="@drawable/icon_add"
|
||||
android:padding="10dp"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/tvSpeedThresholdTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbRoadLimitSpeedSop"
|
||||
android:text="变道速度阈值:"
|
||||
android:textSize="@dimen/dp_36"
|
||||
android:textColor="#1A1A1A"
|
||||
android:layout_margin="20dp"
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnSpeedSet"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="@dimen/dp_20"
|
||||
app:layout_constraintTop_toTopOf="@id/ivSpeedAdd"
|
||||
app:layout_constraintBottom_toBottomOf="@id/ivSpeedAdd"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivSpeedAdd"
|
||||
android:text="设置阈值"
|
||||
android:layout_marginStart="10dp"
|
||||
/>
|
||||
<ImageView
|
||||
android:id="@+id/ivSpeedReduce"
|
||||
android:layout_width="@dimen/dp_64"
|
||||
android:layout_height="@dimen/dp_64"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvSpeedThresholdTitle"
|
||||
app:layout_constraintTop_toTopOf="@id/tvSpeedThresholdTitle"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvSpeedThresholdTitle"
|
||||
android:src="@drawable/icon_reduce"
|
||||
android:padding="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"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/tvSpeed"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toTopOf="@id/ivSpeedReduce"
|
||||
app:layout_constraintBottom_toBottomOf="@id/ivSpeedReduce"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivSpeedReduce"
|
||||
android:textSize="@dimen/dp_36"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/debug_setting_edit_bg"
|
||||
android:paddingStart="15dp"
|
||||
android:paddingEnd="15dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivSpeedAdd"
|
||||
android:layout_width="@dimen/dp_64"
|
||||
android:layout_height="@dimen/dp_64"
|
||||
app:layout_constraintTop_toTopOf="@id/tvSpeed"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvSpeed"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvSpeed"
|
||||
android:src="@drawable/icon_add"
|
||||
android:padding="10dp"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<Button
|
||||
android:id="@+id/btnSpeedSet"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="@dimen/dp_20"
|
||||
app:layout_constraintTop_toTopOf="@id/ivSpeedAdd"
|
||||
app:layout_constraintBottom_toBottomOf="@id/ivSpeedAdd"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivSpeedAdd"
|
||||
android:text="设置阈值"
|
||||
android:layout_marginStart="10dp"
|
||||
/>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -23,6 +23,7 @@
|
||||
<string name="debug_panel">调试面板</string>
|
||||
<string name="debug_panel_fb">录包设置</string>
|
||||
<string name="debug_sop">运营面板</string>
|
||||
<string name="debug_bad_case_manager">录包管理</string>
|
||||
<string name="check_vehicle_speed_setting">车速设置</string>
|
||||
<string name="bus_operation_title">账户信息</string>
|
||||
<string name="check_system_operation">系统运行</string>
|
||||
|
||||
@@ -46,9 +46,9 @@ object TrackerSourceColorHelper {
|
||||
return ""
|
||||
}
|
||||
|
||||
if (isV2I(data).second) {
|
||||
color = "#00AEFFFF"
|
||||
}
|
||||
// if (isV2I(data).second) {
|
||||
// color = "#00AEFFFF"
|
||||
// }
|
||||
|
||||
//level : 2
|
||||
if (isObu(data).second) {
|
||||
@@ -62,14 +62,9 @@ object TrackerSourceColorHelper {
|
||||
}
|
||||
}
|
||||
|
||||
//融合结果 level : 1
|
||||
if (isFusion(data)) {
|
||||
color = "#9900ffFF"
|
||||
}
|
||||
|
||||
//僵尸车
|
||||
if(data.addAttribute == AdditionalAttribute.ATTR_ZOMBIE){
|
||||
color = "#D1E5FDFF"
|
||||
color = "#8F9AADFF"
|
||||
}
|
||||
|
||||
// pnc预警
|
||||
|
||||
@@ -135,12 +135,7 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
|
||||
HttpDnsSimpleLocation(envConfig.cityCode, envConfig.lat, envConfig.lon)
|
||||
return httpDnsSimpleLocation
|
||||
}
|
||||
var mogoLocation: MogoLocation? = null
|
||||
val locationClient =
|
||||
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
if (locationClient != null) {
|
||||
mogoLocation = locationClient
|
||||
}
|
||||
val mogoLocation: MogoLocation? = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
if (mogoLocation != null && mogoLocation.latitude != 0.0 && mogoLocation.longitude != 0.0) {
|
||||
// 更新
|
||||
httpDnsSimpleLocation = if (
|
||||
|
||||
Reference in New Issue
Block a user