[6.10.0]接管问题上报工具优化修改

This commit is contained in:
xuxinchao
2025-01-27 18:42:54 +08:00
parent b12c487174
commit ecf2821f7a
4 changed files with 30 additions and 19 deletions

View File

@@ -156,6 +156,10 @@ internal object BadCaseManager : LifecycleEventObserver, IMoGoAutopilotRecordLis
BadCaseConfig.setStartTime(currentDay)
//删除前一天的接管记录
CallerTakeOverManager.deleteAllRecord(context)
//遍历是否有非当日的文件并删除
RecordBitmapUtils.deleteExpiredFile(currentDay,"FrontCamera")
RecordBitmapUtils.deleteExpiredFile(currentDay,"RearCamera")
RecordBitmapUtils.deleteExpiredFile(currentDay,"MapScreen")
}
}

View File

@@ -36,9 +36,11 @@ object RecordBitmapUtils {
/**
* 删除过期文件夹
* @param currentDay 要删除的文件日期
* @param deleteFile 要删除的文件目录
*/
fun deleteExpiredFile(currentDay: String){
val checkFileName = Environment.getExternalStorageDirectory().absolutePath + File.separator+ "MapScreen"
fun deleteExpiredFile(currentDay: String,deleteFile: String){
val checkFileName = Environment.getExternalStorageDirectory().absolutePath + File.separator+ deleteFile
val checkFileFolder = File(checkFileName)
if(checkFileFolder.exists()){
checkFileFolder.listFiles()?.forEach {dir->

View File

@@ -454,28 +454,22 @@ class TakeOverReasonWindow constructor(activity: Activity) : View.OnTouchListene
//展示前向摄像头
val frontCameraPath: String = ((Environment.getExternalStorageDirectory()
.absolutePath + File.separator) +
"FrontCamera" + File.separator + millis2String(
System.currentTimeMillis(),
getMdFormat()
) + File.separator + mTakeOverRecordInfo.bagId) + ".png"
"FrontCamera" + File.separator + millis2String(System.currentTimeMillis(), getMdFormat())
+ File.separator + mTakeOverRecordInfo.bagId) + ".png"
val frontCameraUri = Uri.parse(frontCameraPath)
ivFrontCamera.setImageURI(frontCameraUri)
//展示后向摄像头
val rearCameraPath: String = ((Environment.getExternalStorageDirectory()
.absolutePath + File.separator) +
"RearCamera" + File.separator + millis2String(
System.currentTimeMillis(),
getMdFormat()
) + File.separator + mTakeOverRecordInfo.bagId) + ".png"
"RearCamera" + File.separator + millis2String(System.currentTimeMillis(), getMdFormat())
+ File.separator + mTakeOverRecordInfo.bagId) + ".png"
val rearCameraUri = Uri.parse(rearCameraPath)
ivRearCamera.setImageURI(rearCameraUri)
//展示高精地图截图
val mapScreenPath: String = ((Environment.getExternalStorageDirectory()
.absolutePath + File.separator) +
"MapScreen" + File.separator + millis2String(
System.currentTimeMillis(),
getMdFormat()
) + File.separator + mTakeOverRecordInfo.bagId) + ".png"
"MapScreen" + File.separator + millis2String(System.currentTimeMillis(), getMdFormat())
+ File.separator + mTakeOverRecordInfo.bagId) + ".png"
val mapScreenUri = Uri.parse(mapScreenPath)
ivMapScreen.setImageURI(mapScreenUri)

View File

@@ -12,6 +12,7 @@ import android.view.WindowManager
import android.widget.ImageView
import androidx.viewpager.widget.ViewPager
import com.mogo.eagle.core.utilcode.util.BarUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.zhjt.mogo_core_function_devatools.R
import com.zhjt.mogo_core_function_devatools.workorder.adapter.TakeOverSceneAdapter
@@ -33,6 +34,7 @@ class TakeOverSceneWindow constructor(activity: Activity) {
private lateinit var ivScenePrevious: ImageView
private lateinit var ivSceneNext: ImageView
private val takeOverSceneAdapter = TakeOverSceneAdapter()
private var currentIndex = 0
init {
initFloatWindow()
@@ -62,7 +64,6 @@ class TakeOverSceneWindow constructor(activity: Activity) {
}
private fun initEvent(){
var currentIndex = 0
vpSceneImage.adapter =takeOverSceneAdapter
//关闭弹窗
ivSceneClose.setOnClickListener {
@@ -70,13 +71,21 @@ class TakeOverSceneWindow constructor(activity: Activity) {
}
//前一个场景
ivScenePrevious.setOnClickListener {
currentIndex = (currentIndex-1).coerceAtLeast(0)
vpSceneImage.currentItem = currentIndex
if(currentIndex == 0){
ToastUtils.showShort("没有上一个场景了")
}else{
currentIndex = (currentIndex-1).coerceAtLeast(0)
vpSceneImage.currentItem = currentIndex
}
}
//后一个场景
ivSceneNext.setOnClickListener {
currentIndex = (currentIndex + 1).coerceAtMost(2)
vpSceneImage.currentItem = currentIndex
if(currentIndex < 2){
currentIndex = (currentIndex + 1).coerceAtMost(2)
vpSceneImage.currentItem = currentIndex
}else{
ToastUtils.showShort("没有下一个场景了")
}
}
}
@@ -90,6 +99,8 @@ class TakeOverSceneWindow constructor(activity: Activity) {
mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight()
mWindowManager!!.addView(mFloatLayout, mWindowParams)
takeOverSceneAdapter.setSceneUri(frontCameraUri, rearCameraUri, mapScreenUri)
currentIndex = currentItem
vpSceneImage.currentItem = currentItem
}
}