[dev_arch_opt_3.0]录包工具三期
This commit is contained in:
@@ -56,6 +56,7 @@ import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import bag_manager.BagManagerOuterClass;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import record_cache.RecordPanelOuterClass;
|
||||
|
||||
@@ -320,6 +321,10 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
public void onAutopilotRecordConfig(@NonNull MessagePad.RecordDataConfig config) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBagManagerResult(@NonNull BagManagerOuterClass.BagManager bagManager) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试到站
|
||||
*/
|
||||
|
||||
@@ -50,6 +50,7 @@ import com.mogo.och.sweeper.util.BDRouteDataTestUtils;
|
||||
import com.mogo.och.sweeper.view.SlidePanelView;
|
||||
import com.mogo.och.sweeper.view.SweeperTrafficDataView;
|
||||
|
||||
import bag_manager.BagManagerOuterClass;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import record_cache.RecordPanelOuterClass;
|
||||
|
||||
@@ -298,6 +299,9 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
public void onAutopilotRecordConfig(@NonNull MessagePad.RecordDataConfig config) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBagManagerResult(@NonNull BagManagerOuterClass.BagManager bagManager) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试到站
|
||||
|
||||
@@ -53,6 +53,7 @@ import com.mogo.och.taxi.R;
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
import bag_manager.BagManagerOuterClass;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import record_cache.RecordPanelOuterClass;
|
||||
|
||||
@@ -386,6 +387,10 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
public void onAutopilotRecordConfig(@NonNull MessagePad.RecordDataConfig config) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBagManagerResult(@NonNull BagManagerOuterClass.BagManager bagManager) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 改变自动驾驶状态
|
||||
*
|
||||
|
||||
@@ -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
|
||||
@@ -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())
|
||||
}
|
||||
|
||||
/**
|
||||
* 向左变道
|
||||
*/
|
||||
|
||||
@@ -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,494 @@
|
||||
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
|
||||
|
||||
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桶成功")
|
||||
}
|
||||
2 -> {
|
||||
ToastUtils.showShort("${bagManager.uploadCosResp.key} 上传cos桶copy过程失败,原因:${bagManager.uploadCosResp.message}")
|
||||
}
|
||||
3 -> {
|
||||
ToastUtils.showShort("${bagManager.uploadCosResp.key} 上传cos桶合并过程失败,原因:${bagManager.uploadCosResp.message}")
|
||||
}
|
||||
4 -> {
|
||||
ToastUtils.showShort("${bagManager.uploadCosResp.key} 上传cos桶上传过程失败,原因:${bagManager.uploadCosResp.message}")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//删除Bag
|
||||
else if(bagManager.reqType == 4){
|
||||
//收到此回调就删除对应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)
|
||||
if(bagManagerList.size>0){
|
||||
//继续执行删除命令
|
||||
bagManagerEntity.reqType = 4
|
||||
bagManagerEntity.keyReq = bagManagerList[0].key
|
||||
CallerAutoPilotControlManager.sendBagManagerCmd(bagManagerEntity)
|
||||
}
|
||||
}
|
||||
}
|
||||
//遍历列表,如当天Bag全部删除,同时把日期标题也删除更新列表
|
||||
val titleIterator = bagManagerEntity.bagsInfoResp.iterator()
|
||||
while(titleIterator.hasNext()){
|
||||
val titleBagInfo = titleIterator.next()
|
||||
if(titleBagInfo.itemType == 1){
|
||||
val bagIterator = bagManagerEntity.bagsInfoResp.iterator()
|
||||
var hasBag = false
|
||||
while(bagIterator.hasNext()){
|
||||
val bagBagInfo = bagIterator.next()
|
||||
if(bagBagInfo.itemType == 0){
|
||||
bagBagInfo.timestamp?.let {
|
||||
if(it.contains(titleBagInfo.timestamp.toString())){
|
||||
hasBag = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!hasBag){
|
||||
bagIterator.remove()
|
||||
}
|
||||
}
|
||||
}
|
||||
if(bagManagerList.size == 0){
|
||||
tvCancelSelect.performClick()
|
||||
}
|
||||
//更新列表
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
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>
|
||||
@@ -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()
|
||||
|
||||
@@ -225,6 +229,7 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
fun showDebugPanelView()
|
||||
fun showFeedbackView()
|
||||
fun showSOPSettingView()
|
||||
fun showBadCaseManagerView()
|
||||
}
|
||||
|
||||
override fun onAutopilotCarConfig(carConfigResp: MessagePad.CarConfigResp) {
|
||||
|
||||
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"
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.mogo.eagle.core.data.badcase
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description bag附加信息(录音,备注,接管信息)
|
||||
* @since: 2023/2/2
|
||||
*/
|
||||
data class BagDescriptionEntity(var description: String,// bag接管描述或重命名信息
|
||||
var hasAudio: Boolean,// 此bag是否具有录音文件
|
||||
var audioUrl: String,// bag附加录音文件的文件名
|
||||
var reportBI: Boolean //上报BI状态
|
||||
)
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.mogo.eagle.core.data.badcase
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 单个key值对应的包信息
|
||||
* @since: 2023/2/1
|
||||
*/
|
||||
class BagInfoEntity(){
|
||||
var key: Long = 0// bag key值
|
||||
var totalSize: Long = 0// 所有子包或合并后的包的总大小
|
||||
var timestamp: String = ""// 时间戳
|
||||
var bagPath: String ?= null// bag所在路径
|
||||
var mergeStat: Boolean = false// 合并状态
|
||||
var uploadStat: Boolean = false// 上传cos桶状态
|
||||
var description: BagDescriptionEntity ?= null// 包描述信息
|
||||
var subBags: ArrayList<SubBagEntity> =ArrayList()// 子包信息
|
||||
var selectStatus: Boolean = false //Bag包勾选状态,默认为未勾选
|
||||
var itemType: Int = 0 //0是正常Bag包,1为时间Title
|
||||
var timeStr: String = ""
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.mogo.eagle.core.data.badcase
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 包管理请求
|
||||
* @since: 2023/2/1
|
||||
*/
|
||||
class BagManagerEntity(){
|
||||
var reqType: Int = 1// 请求类型:0-invalid 1-获取空间使用信息 2-遍历所有bag 3-上传cos 4-删除bag 5-为bag添加附加信息
|
||||
var keyReq: Long =0// 要操作的包的key值,发送请求且reqType=(3,4,5)时有效
|
||||
var descReq: BagDescriptionEntity ?= null// 更新包附加信息,发送请求且reqType=5时有效
|
||||
var spaceInfoResp: List<BagSpaceInfoEntity> = ArrayList()// 空间使用信息,获取响应且reqType=1时有效
|
||||
val bagsInfoResp: MutableList<BagInfoEntity> = ArrayList()// 包信息列表,获取响应且reqType=2时有效
|
||||
var uploadCosResp: UploadCosStatEntity ?=null//反馈上传cos桶结果,获取响应且reqType=3时有效
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.mogo.eagle.core.data.badcase
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description bag目录空间使用情况
|
||||
* @since: 2023/2/1
|
||||
*/
|
||||
data class BagSpaceInfoEntity(var host: String,// 主机名
|
||||
var diskSpaceInfo: SpaceInfoEntity,// 硬盘空间信息
|
||||
var BagDirsSpaceInfo: List<SpaceInfoEntity>// /home/mogo/data/bags下各子空间信息
|
||||
)
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.mogo.eagle.core.data.badcase
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 车端BadCase存储空间使用情况
|
||||
* @since: 2023/2/1
|
||||
*/
|
||||
data class SpaceInfoEntity(
|
||||
var directory: String,// 路径名,为空表示总空间,否则表示对应的/home/mogo/data/bags下的子目录
|
||||
var total: Long,// 总空间
|
||||
var free: Long,// 可用空间
|
||||
var used: Long // 已用空间
|
||||
)
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.mogo.eagle.core.data.badcase
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 各主机上报的包信息
|
||||
* @since: 2023/2/1
|
||||
*/
|
||||
data class SubBagEntity(var key: Long,//bag key值
|
||||
var host: String,//主机名
|
||||
var size: Long //此子包的大小
|
||||
)
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.mogo.eagle.core.data.badcase
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 上传cos桶状态
|
||||
* @since: 2023/2/1
|
||||
*/
|
||||
data class UploadCosStatEntity(var key: Long,
|
||||
var stat: Int,// 0-成功 1-执行中 2-copy过程失败 3-合并过程失败 4-上传过程失败
|
||||
var message: String// 失败时的具体描述
|
||||
)
|
||||
@@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.api.autopilot
|
||||
|
||||
import chassis.SpecialVehicleTaskCmdOuterClass
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.badcase.BagManagerEntity
|
||||
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider
|
||||
|
||||
@@ -187,6 +188,12 @@ interface IMoGoAutopilotControlProvider : IMoGoFunctionServerProvider {
|
||||
*/
|
||||
fun getBadCaseConfig(reqType: Int,recordType: Int,topicsNeedToCache: List<String>): Boolean
|
||||
|
||||
/**
|
||||
* 获取Bag包管理信息
|
||||
* @param bagManagerEntity 包管理请求实体类
|
||||
*/
|
||||
fun sendBagManagerCmd(bagManagerEntity: BagManagerEntity): Boolean
|
||||
|
||||
/**
|
||||
* 发送工控机所有节点重启命令
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.eagle.core.function.api.autopilot
|
||||
|
||||
import bag_manager.BagManagerOuterClass
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import record_cache.RecordPanelOuterClass
|
||||
|
||||
@@ -20,4 +21,9 @@ interface IMoGoAutopilotRecordListener {
|
||||
*/
|
||||
fun onAutopilotRecordConfig(config: MessagePad.RecordDataConfig){}
|
||||
|
||||
/**
|
||||
* 录包任务管理应答
|
||||
*/
|
||||
fun onBagManagerResult(bagManager: BagManagerOuterClass.BagManager){}
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.mogo.eagle.core.function.call.autopilot
|
||||
import android.os.SystemClock
|
||||
import chassis.SpecialVehicleTaskCmdOuterClass
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.badcase.BagManagerEntity
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig
|
||||
@@ -268,6 +269,19 @@ object CallerAutoPilotControlManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取Bag包管理信息
|
||||
* @param bagManagerEntity 包管理请求实体类
|
||||
*/
|
||||
fun sendBagManagerCmd(bagManagerEntity: BagManagerEntity): Boolean?{
|
||||
// 司机屏才能查询数据采集的配置
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
return providerApi?.sendBagManagerCmd(bagManagerEntity)
|
||||
}else{
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 向左变道
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.eagle.core.function.call.autopilot
|
||||
|
||||
import bag_manager.BagManagerOuterClass
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import mogo.telematics.pad.MessagePad
|
||||
@@ -34,4 +35,15 @@ object CallerAutopilotRecordListenerManager : CallerBase<IMoGoAutopilotRecordLis
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 录包任务管理应答
|
||||
*/
|
||||
fun invokeBagManagerResult(bagManager: BagManagerOuterClass.BagManager){
|
||||
M_LISTENERS.forEach{
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
listener.onBagManagerResult(bagManager)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -63,7 +63,7 @@ BIZCONFIG_VERSION=1.3.2
|
||||
SERVICE_BIZ_VERSION=1.2.4
|
||||
################ 外部依赖引用 ################
|
||||
# loglib
|
||||
LOGLIB_VERSION=1.5.10
|
||||
LOGLIB_VERSION=1.5.11
|
||||
######## MogoAiCloudSDK Version ########
|
||||
# 网络请求LOGLIB_VERSION
|
||||
MOGO_NETWORK_VERSION=1.4.4.8
|
||||
|
||||
Reference in New Issue
Block a user