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

This commit is contained in:
xuxinchao
2023-02-15 01:40:12 +08:00
3 changed files with 52 additions and 86 deletions

View File

@@ -6,6 +6,7 @@ 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
@@ -73,6 +74,8 @@ internal class BadCaseManagerView @JvmOverloads constructor(
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
@@ -213,79 +216,6 @@ internal class BadCaseManagerView @JvmOverloads constructor(
// DownloadManager.getInstance().download("CarPad/mogopadlog/X20202111230C01YYW/2023-01-30/Audio_1675049657187_BadCase.wav",
// "/mnt/sdcard/mogo/","test13.wav")
// val descriptionEntityOne = BagDescriptionEntity("包信息描述1",false,
// "CarPad/mogopadlog/X20202111230C01YYW/2023-01-30/Audio_1675049657187_BadCase.wav",false)
// val bagInfoEntityOne = BagInfoEntity()
// bagInfoEntityOne.key = 12341
// bagInfoEntityOne.totalSize = 1*1024*1024*1000
// bagInfoEntityOne.timestamp = "20230208125414"
// bagInfoEntityOne.bagPath = ""
// bagInfoEntityOne.mergeStat = false
// bagInfoEntityOne.uploadStat = false
// bagInfoEntityOne.description = descriptionEntityOne
//
// val descriptionEntityTwo = BagDescriptionEntity("包信息描述2",true,
// "CarPad/mogopadlog/X20202111230C01YYW/2023-01-30/Audio_1675049657187_BadCase.wav",true)
// val bagInfoEntityTwo = BagInfoEntity()
// bagInfoEntityTwo.key = 12342
// bagInfoEntityTwo.totalSize = 2*1024*1024*1000
// bagInfoEntityTwo.timestamp = "20230208125414"
// bagInfoEntityTwo.bagPath = ""
// bagInfoEntityTwo.mergeStat = false
// bagInfoEntityTwo.uploadStat = false
// bagInfoEntityTwo.description = descriptionEntityTwo
//
// val descriptionEntityThree = BagDescriptionEntity("包信息描述3",true,
// "CarPad/mogopadlog/X20202111230C01YYW/2023-01-30/Audio_1675049657187_BadCase.wav",true)
// val bagInfoEntityThree = BagInfoEntity()
// bagInfoEntityThree.key = 12343
// bagInfoEntityThree.totalSize = 1*1027*1000
// bagInfoEntityThree.timestamp = "20230208125414"
// bagInfoEntityThree.bagPath = ""
// bagInfoEntityThree.mergeStat = false
// bagInfoEntityThree.uploadStat = false
// bagInfoEntityThree.description = descriptionEntityThree
//
// val descriptionEntityFour = BagDescriptionEntity("包信息描述4",true,
// "CarPad/mogopadlog/X20202111230C01YYW/2023-01-30/Audio_1675049657187_BadCase.wav",true)
// val bagInfoEntityFour = BagInfoEntity()
// bagInfoEntityFour.key = 12344
// bagInfoEntityFour.totalSize = 10*1024*1024*1000L
// bagInfoEntityFour.timestamp = "20230208125414"
// bagInfoEntityFour.bagPath = ""
// bagInfoEntityFour.mergeStat = false
// bagInfoEntityFour.uploadStat = false
// bagInfoEntityFour.description = descriptionEntityFour
//
// val list: MutableList<BagInfoEntity> = ArrayList()
// list.add(bagInfoEntityOne)
// list.add(bagInfoEntityTwo)
// list.add(bagInfoEntityThree)
// list.add(bagInfoEntityFour)
// for(entity in list){
// entity.timestamp?.let {
// val month = it.substring(4,6)
// val day = it.substring(6,8)
// val time = "${month}月${day}日"
// var containTime = false
// for(bag in bagManagerEntity.bagsInfoResp){
// if(bag.timeStr == time){
// containTime = true
// }
// }
// if(!containTime || bagManagerEntity.bagsInfoResp.size ==0){
// //增加时间的
// val bagInfoEntity = BagInfoEntity()
// bagInfoEntity.itemType = 1
// bagInfoEntity.timeStr = time
// bagManagerEntity.bagsInfoResp.add(bagInfoEntity)
// }
// bagManagerEntity.bagsInfoResp.add(entity)
// }
// }
//
// bagManagerListAdapter?.setData(bagManagerEntity.bagsInfoResp)
}
fun setOnClickListener(clickListener: ClickListener) {
@@ -299,10 +229,31 @@ internal class BadCaseManagerView @JvmOverloads constructor(
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,"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
@@ -388,6 +339,12 @@ internal class BadCaseManagerView @JvmOverloads constructor(
}
}
}
//上传Cos执行完成
if(bagManagerList.size == 0 && selectedBagNum != 0){
ToastUtils.showShort("上传命令完成")
bagUploadDialog?.uploadCompleted()
tvCancelSelect.performClick()
}
}
//删除Bag
else if(bagManager.reqType == 4){

View File

@@ -109,6 +109,10 @@ public class BagUploadDialog extends Dialog {
viewUploadProgress.setProgress((totalNum-remainNum)*100/totalNum);
}
public void uploadCompleted(){
dismiss();
}
interface BagUploadListener{
//取消上传
void cancelUpload();

View File

@@ -60,31 +60,36 @@ class BagManagerListAdapter: RecyclerView.Adapter<RecyclerView.ViewHolder>() {
bagClickListener?.onClick(bagInfoEntity,isChecked)
}
holder.etBagNameEdit.addTextChangedListener(object:TextWatcher{
val textWatcher: TextWatcher = object : TextWatcher {
override fun beforeTextChanged(
s: CharSequence?,
start: Int,
count: Int,
after: Int
charSequence: CharSequence,
i: Int,
i1: Int,
i2: Int
) {
}
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
}
override fun afterTextChanged(s: Editable?) {
override fun onTextChanged(charSequence: CharSequence, i: Int, i1: Int, i2: Int) {}
override fun afterTextChanged(editable: Editable) {
bagInfoEntity.description?.let { desc->
val descriptionStr = s.toString()
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){