[6.2.4]补交被动录包截图填写信息

This commit is contained in:
xuxinchao
2023-12-06 16:56:59 +08:00
parent 50613f6502
commit 6d3989f47d

View File

@@ -33,6 +33,7 @@ import com.mogo.eagle.core.data.msgbox.RecordBagMsg
import com.mogo.eagle.core.function.api.devatools.badcase.BadCaseNetListener
import com.mogo.eagle.core.function.api.map.deva.IMoGoMapScreenListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsNetManager
import com.mogo.eagle.core.function.call.map.CallerMapScreenListenerManager
@@ -613,6 +614,22 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
* 高精地图截图回调
*/
override fun onMapScreen(bitmap: Bitmap) {
//在截图上保存即时信息
val time = "时间:${millis2String(System.currentTimeMillis(), TimeUtils.getHourMinSecondFormat())}"
val lineId = "路线ID:${CallerAutoPilotStatusListenerManager.getLineId()}"
val state = when(CallerAutoPilotStatusListenerManager.getState()){
0->"自驾状态:不可自驾"
1->"自驾状态:可自驾"
2->"自驾状态:自驾中"
7->"自驾状态:平行驾驶中"
else->"自驾状态:未知"
}
val speed = "当前车速:${BadCaseConfig.currentSpeed}"
val outBitmap = RecordBitmapUtils.drawTextOnBitmap(bitmap,time,lineId,state,speed,
BadCaseConfig.gpsStatus,BadCaseConfig.tracingStatus,BadCaseConfig.socketStatus
,BadCaseConfig.newFMInfoMsg,BadCaseConfig.newReportEntity)
//图片保存本地
val currentDay = millis2String(System.currentTimeMillis(), TimeUtils.getMdFormat())
val fileDir: String = Environment.getExternalStorageDirectory().absolutePath + File.separator+
@@ -622,7 +639,11 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
if (!File(fileDir).exists()) {
File(fileDir).mkdirs()
}
RecordBitmapUtils.bitmap2Path(bitmap,path)
if(outBitmap != null){
RecordBitmapUtils.bitmap2Path(outBitmap,path)
}else{
RecordBitmapUtils.bitmap2Path(bitmap,path)
}
//遍历是否有非当日的文件并删除
RecordBitmapUtils.deleteExpiredFile(currentDay)
}