[2.14.0]BadCase三期-录包管理
This commit is contained in:
@@ -4,12 +4,14 @@ import android.Manifest.permission
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
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
|
||||
@@ -54,6 +56,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.MogoReport
|
||||
import com.zhidao.support.adas.high.msg.BagManagerMessage
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import com.zhjt.service.chain.TracingConstants
|
||||
import io.netty.channel.Channel
|
||||
@@ -544,6 +547,98 @@ class MoGoAutopilotProvider :
|
||||
return AdasManager.getInstance().sendRecordDataConfigReq(reqType, recordType, topicsNeedToCache)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取Bag包管理信息
|
||||
* @param bagManagerEntity 包管理请求实体类
|
||||
*/
|
||||
override fun sendBagManagerCmd(bagManagerEntity: BagManagerEntity): Boolean {
|
||||
val bagManager = BagManagerOuterClass.BagManager
|
||||
.newBuilder()
|
||||
.setReqType(bagManagerEntity.reqType)
|
||||
.setKeyReq(bagManagerEntity.keyReq)
|
||||
|
||||
// 更新包附加信息,发送请求且reqType=5时有效
|
||||
val descReq = BagManagerOuterClass.BagDescription
|
||||
.newBuilder()
|
||||
.setDescription(bagManagerEntity.descReq.description)
|
||||
.setHasAudio(bagManagerEntity.descReq.hasAudio)
|
||||
.setAudioUrl(bagManagerEntity.descReq.audioUrl)
|
||||
.setReportBI(bagManagerEntity.descReq.reportBI)
|
||||
.build()
|
||||
bagManager.descReq = descReq
|
||||
|
||||
// 空间使用信息,获取响应且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){
|
||||
// 包描述信息
|
||||
val bagDescription = BagManagerOuterClass.BagDescription
|
||||
.newBuilder()
|
||||
.setDescription(bagsInfoRespEntity.description.description)
|
||||
.setHasAudio(bagsInfoRespEntity.description.hasAudio)
|
||||
.setAudioUrl(bagsInfoRespEntity.description.audioUrl)
|
||||
.setReportBI(bagsInfoRespEntity.description.reportBI)
|
||||
.build()
|
||||
|
||||
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)
|
||||
|
||||
// 子包信息
|
||||
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()
|
||||
.setKey(bagManagerEntity.uploadCosResp.key)
|
||||
.setStat(bagManagerEntity.uploadCosResp.stat)
|
||||
.setMessage(bagManagerEntity.uploadCosResp.message)
|
||||
.build()
|
||||
bagManager.uploadCosResp = uploadCosResp
|
||||
|
||||
return AdasManager.getInstance().sendBagManagerCmd(bagManager.build())
|
||||
}
|
||||
|
||||
/**
|
||||
* 向左变道
|
||||
*/
|
||||
|
||||
@@ -461,6 +461,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
* @param bagManager 数据
|
||||
*/
|
||||
override fun onBagManagerCmd(header: MessagePad.Header?, bagManager: BagManagerOuterClass.BagManager?) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user