[2.14.0]BadCase三期-录包管理

This commit is contained in:
xuxinchao
2023-02-03 18:06:08 +08:00
parent 5f48fd6c5a
commit 0469bf2d48
37 changed files with 1155 additions and 6 deletions

View File

@@ -4,12 +4,14 @@ import android.Manifest.permission
import android.content.Context
import android.util.Log
import androidx.annotation.RequiresPermission
import bag_manager.BagManagerOuterClass
import chassis.SpecialVehicleTaskCmdOuterClass
import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
import com.mogo.eagle.core.data.autopilot.toAutoPilotLine
import com.mogo.eagle.core.data.autopilot.toRouteInfo
import com.mogo.eagle.core.data.badcase.BagManagerEntity
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.constants.MoGoConfig
import com.mogo.eagle.core.data.constants.MogoServicePaths
@@ -54,6 +56,7 @@ import com.zhidao.support.adas.high.common.Constants
import com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS
import com.zhidao.support.adas.high.common.CupidLogUtils
import com.zhidao.support.adas.high.common.MogoReport
import com.zhidao.support.adas.high.msg.BagManagerMessage
import com.zhjt.service.chain.ChainLog
import com.zhjt.service.chain.TracingConstants
import io.netty.channel.Channel
@@ -544,6 +547,98 @@ class MoGoAutopilotProvider :
return AdasManager.getInstance().sendRecordDataConfigReq(reqType, recordType, topicsNeedToCache)
}
/**
* 获取Bag包管理信息
* @param bagManagerEntity 包管理请求实体类
*/
override fun sendBagManagerCmd(bagManagerEntity: BagManagerEntity): Boolean {
val bagManager = BagManagerOuterClass.BagManager
.newBuilder()
.setReqType(bagManagerEntity.reqType)
.setKeyReq(bagManagerEntity.keyReq)
// 更新包附加信息,发送请求且reqType=5时有效
val descReq = BagManagerOuterClass.BagDescription
.newBuilder()
.setDescription(bagManagerEntity.descReq.description)
.setHasAudio(bagManagerEntity.descReq.hasAudio)
.setAudioUrl(bagManagerEntity.descReq.audioUrl)
.setReportBI(bagManagerEntity.descReq.reportBI)
.build()
bagManager.descReq = descReq
// 空间使用信息,获取响应且reqType=1时有效
for(diskSpaceInfoEntity in bagManagerEntity.spaceInfoResp){
val spaceInfoResp = BagManagerOuterClass.BagSpaceInfo
.newBuilder()
val diskSpaceInfo = BagManagerOuterClass.SpaceInfo
.newBuilder()
.setDirectory(diskSpaceInfoEntity.diskSpaceInfo.directory)
.setTotal(diskSpaceInfoEntity.diskSpaceInfo.total)
.setFree(diskSpaceInfoEntity.diskSpaceInfo.free)
.setUsed(diskSpaceInfoEntity.diskSpaceInfo.used)
.build()
spaceInfoResp
.setHost(diskSpaceInfoEntity.host).diskSpaceInfo = diskSpaceInfo
for(entity in diskSpaceInfoEntity.BagDirsSpaceInfo){
val bagDirsSpaceInfo = BagManagerOuterClass.SpaceInfo
.newBuilder()
.setDirectory(entity.directory)
.setTotal(entity.total)
.setFree(entity.free)
.setUsed(entity.used)
.build()
spaceInfoResp.addBagDirsSpaceInfo(bagDirsSpaceInfo)
}
bagManager.addSpaceInfoResp(spaceInfoResp.build())
}
// 包信息列表,获取响应且reqType=2时有效
for(bagsInfoRespEntity in bagManagerEntity.bagsInfoResp){
// 包描述信息
val bagDescription = BagManagerOuterClass.BagDescription
.newBuilder()
.setDescription(bagsInfoRespEntity.description.description)
.setHasAudio(bagsInfoRespEntity.description.hasAudio)
.setAudioUrl(bagsInfoRespEntity.description.audioUrl)
.setReportBI(bagsInfoRespEntity.description.reportBI)
.build()
val bagsInfoResp = BagManagerOuterClass.BagInfo
.newBuilder()
.setKey(bagsInfoRespEntity.key)
.setTotalSize(bagsInfoRespEntity.totalSize)
.setTimestamp(bagsInfoRespEntity.timestamp)
.setBagPath(bagsInfoRespEntity.bagPath)
.setMergeStat(bagsInfoRespEntity.mergeStat)
.setUploadStat(bagsInfoRespEntity.uploadStat)
.setDescription(bagDescription)
// 子包信息
for(subBagEntity in bagsInfoRespEntity.subBags){
val subBag = BagManagerOuterClass.SubBag
.newBuilder()
.setKey(subBagEntity.key)
.setHost(subBagEntity.host)
.setSize(subBagEntity.size)
.build()
bagsInfoResp.addSubBags(subBag)
}
bagManager.addBagsInfoResp(bagsInfoResp)
}
//反馈上传cos桶结果,获取响应且reqType=3时有效
val uploadCosResp = BagManagerOuterClass.UploadCosStat
.newBuilder()
.setKey(bagManagerEntity.uploadCosResp.key)
.setStat(bagManagerEntity.uploadCosResp.stat)
.setMessage(bagManagerEntity.uploadCosResp.message)
.build()
bagManager.uploadCosResp = uploadCosResp
return AdasManager.getInstance().sendBagManagerCmd(bagManager.build())
}
/**
* 向左变道
*/

View File

@@ -461,6 +461,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
* @param bagManager 数据
*/
override fun onBagManagerCmd(header: MessagePad.Header?, bagManager: BagManagerOuterClass.BagManager?) {
}
/**

View File

@@ -107,6 +107,10 @@ class DevaToolsProvider : IDevaToolsProvider {
BadCaseManager.showBadCaseConfigWindow(ctx)
}
override fun showBadCaseManagerView(context: Context) {
BadCaseManager.showBadCaseManagerWindow(context)
}
override fun getUpgradeVersionUrls(versionName: String) {
upgradeManager.getPackageUrls(versionName)
}

View File

@@ -98,6 +98,22 @@ internal object BadCaseManager : LifecycleEventObserver {
}
}
/**
* 展示BadCase录包管理页面
*/
fun showBadCaseManagerWindow(context: Context){
val badCaseManagerView = BadCaseManagerView(context)
badCaseManagerView.setOnClickListener(object: BadCaseManagerView.ClickListener{
override fun onClose() {
hideFloat?.invoke()
hideFloat = null
}
})
context.enqueuePop(badCaseManagerView,AutoSizeUtils.dp2px(context,960f), WindowManager.LayoutParams.MATCH_PARENT, key = "BadCaseConfigView").also {
hideFloat = it
}
}
/**
* 主动采集BadCase
*/

View File

@@ -0,0 +1,60 @@
package com.zhjt.mogo_core_function_devatools.badcase.biz
import android.content.Context
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import com.zhidao.loglib.download.DownloadManager
import com.zhjt.mogo_core_function_devatools.R
import com.zhjt.mogo_core_function_devatools.badcase.record.Audition
import kotlinx.android.synthetic.main.layout_badcase_manager.view.*
/**
* @author XuXinChao
* @description BadCase录包管理页面
* @since: 2022/12/15
*/
internal class BadCaseManagerView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr){
companion object {
const val TAG = "BadCaseManagerView"
}
private var clickListener: ClickListener? = null
init {
LayoutInflater.from(context).inflate(R.layout.layout_badcase_manager, this, true)
initView()
}
private fun initView(){
background = ColorDrawable(Color.parseColor("#F0151D41"))
//关闭BadCase管理窗口
ivManagerClose.setOnClickListener {
clickListener?.onClose()
}
//音频文件播放
// 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()
}
}

View File

@@ -0,0 +1,67 @@
package com.zhjt.mogo_core_function_devatools.badcase.biz;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.WindowManager;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.zhjt.mogo_core_function_devatools.R;
/**
* @author XuXinChao
* @description Bag包上传进度展示弹窗
* @since: 2022/2/1
*/
public class BagUploadDialog extends Dialog {
private TextView tvCancelUpload;//取消上传
private TextView tvCancel;//取消
private TextView tvUploadDetail;//上传详情
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);
}
private void initEvent(){
//取消上传
tvCancelUpload.setOnClickListener(v -> {
});
//取消
tvCancel.setOnClickListener(v -> {
dismiss();
});
}
@Override
public void onAttachedToWindow() {
super.onAttachedToWindow();
}
@Override
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
}
}

View File

@@ -0,0 +1,70 @@
package com.zhjt.mogo_core_function_devatools.badcase.biz;
import android.app.Dialog;
import android.content.Context;
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;//取消
public SpaceWarningDialog(@NonNull Context context) {
super(context, R.style.bad_case_dialog);
}
@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 -> {
//跳转录包管理页面
CallerDevaToolsManager.INSTANCE.showBadCaseManagerView(getContext());
dismiss();
});
//取消
tvCancel.setOnClickListener(v -> {
//取消弹窗
dismiss();
});
}
@Override
public void onAttachedToWindow() {
super.onAttachedToWindow();
}
@Override
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
}
}

View File

@@ -0,0 +1,45 @@
package com.zhjt.mogo_core_function_devatools.badcase.biz.adapter
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.zhjt.mogo_core_function_devatools.R
import kotlinx.coroutines.NonDisposableHandle
import kotlinx.coroutines.NonDisposableHandle.parent
/**
* @author XuXinChao
* @description Bag包管理列表适配器
* @since: 2022/12/19
*/
class BagManagerListAdapter: RecyclerView.Adapter<BagManagerListAdapter.BagManagerListHolder>() {
private var data:List<String> ?= null
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BagManagerListHolder {
val view = LayoutInflater.from(parent.context)
.inflate(R.layout.item_bag_manager, parent, false)
return BagManagerListHolder(view)
}
override fun onBindViewHolder(holder: BagManagerListHolder, position: Int) {
}
override fun getItemCount() = data?.size ?: 0
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)
}
}

View File

@@ -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();
}
}
}

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -0,0 +1,94 @@
<?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"
/>
<View
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="275px"
android:background="#FFFFFFFF"
/>
<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="378px"
android:textColor="#FF06D1ED"
android:textSize="43px"
android:gravity="center"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,93 @@
<?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"
/>
<View
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"
android:background="#FFFFFFFF"
/>
<TextView
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:layout_marginTop="378px"
android:text="100G"
android:textColor="#FFFF6200"
android:textSize="43px"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,71 @@
<?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">
<CheckBox
android:id="@+id/cbBagSelect"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
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="256dp"
android:layout_height="wrap_content"
android:drawableEnd="@drawable/shape_size_check_false"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/cbBagSelect"
/>
<TextView
android:id="@+id/tvBagReportStatus"
android:layout_width="162dp"
android:layout_height="68dp"
android:background="@drawable/bag_report_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="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toLeftOf="@id/tvBagReportStatus"
android:src="@drawable/shape_size_check_false"
/>
<TextView
android:id="@+id/tvBagTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFFFF"
android:textSize="26dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintRight_toLeftOf="@id/ivBagAudio"
/>
<TextView
android:id="@+id/tvBagSize"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFFFF"
android:textSize="26dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toLeftOf="@id/ivBagAudio"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,179 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:layout_width="960dp"
tools:layout_height="match_parent"
android:background="#F0151D41"
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
<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"
/>
<ProgressBar
android:id="@+id/pbSpacePercent"
app:layout_constraintLeft_toLeftOf="@id/viewManagerTitleLine"
app:layout_constraintTop_toBottomOf="@id/viewManagerTitleLine"
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="30"
/>
<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/tvUnusedSpaceContent"
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/viewUnusedSpace"
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/tvUnusedSpaceContent"
android:layout_marginEnd="10dp"
/>
<TextView
android:id="@+id/tvSelectAll"
android:layout_width="200dp"
android:layout_height="80dp"
app:layout_constraintLeft_toLeftOf="@id/viewManagerTitleLine"
app:layout_constraintTop_toBottomOf="@id/viewUsedSpace"
android:layout_marginTop="30dp"
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="20dp"
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="50dp"
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"
/>
</merge>

View File

@@ -517,6 +517,11 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
override fun showSOPSettingView() {
toggleSOPView()
}
override fun showBadCaseManagerView() {
dismissToolsFloatView()
CallerDevaToolsManager.showBadCaseManagerView(it)
}
})
}
toolsViewFloat = WarningFloat.with(it)

View File

@@ -7,7 +7,6 @@ import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.os.Process
import android.util.AttributeSet
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.widget.FrameLayout
@@ -22,7 +21,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showTurnLight
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.ui.utils.KeyBoardUtil
import com.mogo.eagle.core.function.msgbox.MsgBoxConfig
@@ -100,14 +98,15 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
sopLayout.setOnClickListener {
clickListener?.showSOPSettingView()
}
managerLayout.setOnClickListener {
//录包管理页面
clickListener?.showBadCaseManagerView()
}
viewCheckStatus.setOnClickListener {
clickListener?.go2CheckPage()
}
ivDebugPanel.setOnClickListener {
clickListener?.showDebugPanelView()
}
ivDebugFeedback.onClick {
clickListener?.showFeedbackView()
@@ -225,6 +224,7 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
fun showDebugPanelView()
fun showFeedbackView()
fun showSOPSettingView()
fun showBadCaseManagerView()
}
override fun onAutopilotCarConfig(carConfigResp: MessagePad.CarConfigResp) {

View File

@@ -171,6 +171,34 @@
</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_sop" />
<TextView
android:layout_width="wrap_content"
android:layout_height="42dp"
android:text="录包管理"
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"

View File

@@ -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状态
)

View File

@@ -0,0 +1,16 @@
package com.mogo.eagle.core.data.badcase
/**
* @author XuXinChao
* @description 单个key值对应的包信息
* @since: 2023/2/1
*/
data class BagInfoEntity(var key: Long,// bag key值
var totalSize: Long,// 所有子包或合并后的包的总大小
var timestamp: String,// 时间戳
var bagPath: String,// bag所在路径
var mergeStat: Boolean,// 合并状态
var uploadStat: Boolean,// 上传cos桶状态
var description: BagDescriptionEntity,// 包描述信息
var subBags: List<SubBagEntity> // 子包信息
)

View File

@@ -0,0 +1,14 @@
package com.mogo.eagle.core.data.badcase
/**
* @author XuXinChao
* @description 包管理请求
* @since: 2023/2/1
*/
data class BagManagerEntity(var reqType: Int,// 请求类型:0-invalid 1-获取空间使用信息 2-遍历所有bag 3-上传cos 4-删除bag 5-为bag添加附加信息
var keyReq: Long,// 要操作的包的key值,发送请求且reqType=(3,4,5)时有效
var descReq: BagDescriptionEntity,// 更新包附加信息,发送请求且reqType=5时有效
var spaceInfoResp: List<BagSpaceInfoEntity>,// 空间使用信息,获取响应且reqType=1时有效
var bagsInfoResp: List<BagInfoEntity>,// 包信息列表,获取响应且reqType=2时有效
var uploadCosResp: UploadCosStatEntity //反馈上传cos桶结果,获取响应且reqType=3时有效
)

View File

@@ -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下各子空间信息
)

View File

@@ -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 // 已用空间
)

View File

@@ -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 //此子包的大小
)

View File

@@ -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// 失败时的具体描述
)

View File

@@ -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 IMoGoAutopilotProvider : IMoGoFunctionServerProvider {
*/
fun getBadCaseConfig(reqType: Int,recordType: Int,topicsNeedToCache: List<String>): Boolean
/**
* 获取Bag包管理信息
* @param bagManagerEntity 包管理请求实体类
*/
fun sendBagManagerCmd(bagManagerEntity: BagManagerEntity): Boolean
/**
* 发送工控机所有节点重启命令
*/

View File

@@ -100,6 +100,11 @@ interface IDevaToolsProvider : IProvider {
*/
fun showFeedbackWindow(ctx: Context)
/**
* 展示录包管理页面
*/
fun showBadCaseManagerView(context: Context)
/**
* 获取升级版本Urls
*/

View File

@@ -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
@@ -269,6 +270,19 @@ object CallerAutoPilotManager {
}
}
/**
* 获取Bag包管理信息
* @param bagManagerEntity 包管理请求实体类
*/
fun sendBagManagerCmd(bagManagerEntity: BagManagerEntity): Boolean?{
// 司机屏才能查询数据采集的配置
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
return providerApi?.sendBagManagerCmd(bagManagerEntity)
}else{
return false
}
}
/**
* 向左变道
*/

View File

@@ -134,6 +134,13 @@ object CallerDevaToolsManager {
devaToolsProviderApi?.showFeedbackWindow(ctx)
}
/**
* 展示录包管理页面
*/
fun showBadCaseManagerView(context: Context){
devaToolsProviderApi?.showBadCaseManagerView(context)
}
/**
* 获取升级版本Urls
*/

View File

@@ -63,7 +63,7 @@ BIZCONFIG_VERSION=1.3.2
SERVICE_BIZ_VERSION=1.2.4
################ 外部依赖引用 ################
# loglib
LOGLIB_VERSION=1.5.9
LOGLIB_VERSION=1.5.11
######## MogoAiCloudSDK Version ########
# 网络请求LOGLIB_VERSION
MOGO_NETWORK_VERSION=1.4.3.32