[6.2.4]录包增加高精地图截图

This commit is contained in:
xuxinchao
2023-12-04 14:45:33 +08:00
parent 7d040d2ae0
commit f1313600d9
6 changed files with 91 additions and 4 deletions

View File

@@ -2,6 +2,7 @@ package com.zhjt.mogo_core_function_devatools.badcase.biz
import android.annotation.SuppressLint
import android.app.Activity
import android.graphics.Bitmap
import android.graphics.PixelFormat
import android.os.Bundle
import android.os.CountDownTimer
@@ -32,10 +33,13 @@ import com.mogo.eagle.core.data.deva.badcase.RecordCaseEntity
import com.mogo.eagle.core.data.deva.badcase.RecordOptionEntity
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
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.CallerAutopilotRecordListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsNetManager
import com.mogo.eagle.core.function.call.map.CallerMapScreenListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
@@ -74,7 +78,7 @@ import java.util.*
* @since: 2022/7/13
*/
class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchListener,
IMoGoAutopilotRecordListener, BadCaseNetListener {
IMoGoAutopilotRecordListener, BadCaseNetListener, IMoGoMapScreenListener {
companion object {
const val TAG = "InitiativeBadCaseWindow"
@@ -192,7 +196,8 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
*/
BadCaseNetManager.badCaseNetManager.getRecordOption(1,AppConfigInfo.iPCMacAddress)
// BadCaseNetManager.badCaseNetManager.getRecordOption(1,"48:b0:2d:3a:9c:8f")
//高精地图屏幕截图
CallerMapScreenListenerManager.addListener(this.hashCode().toString(),this)
//采集结果回调监听
CallerAutopilotRecordListenerManager.addListener(this.hashCode().toString(),this)
//主动录包采集原因回调监听
@@ -530,6 +535,8 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
mWindowManager!!.addView(mFloatLayout, mWindowParams)
//开启录包
recordKey = Random(SystemClock.elapsedRealtime()).nextInt().toLong()
//开启高精地图截图
CallerMapUIServiceManager.getMapUIController()?.getMapScreenShot()
if(recordCaseEntity!=null){
CallerAutoPilotControlManager.recordPackage(recordCaseEntity.caseId,recordKey.toInt(),
BadCaseConfig.totalDuration, BadCaseConfig.previousDuration,recordCaseEntity.topicList)
@@ -563,6 +570,8 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
CallerAutopilotRecordListenerManager.removeListener(this.hashCode().toString())
//注销采集原因回调监听
CallerDevaToolsNetManager.removeListener(this.hashCode().toString())
//注销高精地图截图监听回调
CallerMapScreenListenerManager.removeListener(this.hashCode().toString())
if (mFloatLayout.parent != null){
mWindowManager!!.removeView(mFloatLayout)
@@ -644,4 +653,11 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
}
}
/**
* 高精地图截图回调
*/
override fun onMapScreen(bitmap: Bitmap) {
}
}

View File

@@ -2,6 +2,7 @@ package com.zhjt.mogo_core_function_devatools.badcase.biz
import android.annotation.SuppressLint
import android.app.Activity
import android.graphics.Bitmap
import android.graphics.Color
import android.graphics.PixelFormat
import android.os.Bundle
@@ -34,9 +35,12 @@ import com.mogo.eagle.core.data.deva.badcase.RecordOptionEntity
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
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.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsNetManager
import com.mogo.eagle.core.function.call.map.CallerMapScreenListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
@@ -72,7 +76,7 @@ import java.lang.StringBuilder
* @since: 2022/7/17
*/
class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListener,
BadCaseNetListener {
BadCaseNetListener , IMoGoMapScreenListener {
companion object {
const val TAG = "PassiveBadCaseWindow"
@@ -183,6 +187,8 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
*/
BadCaseNetManager.badCaseNetManager.getRecordOption(2,AppConfigInfo.iPCMacAddress)
// BadCaseNetManager.badCaseNetManager.getRecordOption(2,"48:b0:2d:3a:9c:8f")
//高精地图屏幕截图
CallerMapScreenListenerManager.addListener(this.hashCode().toString(),this)
CallerDevaToolsNetManager.addListener(this.hashCode().toString(),this)
if(BadCaseConfig.windowNum<1){
BadCaseConfig.windowNum = 1
@@ -537,6 +543,8 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
fun hideFloatWindow() {
//注销高精地图截图监听回调
CallerMapScreenListenerManager.removeListener(this.hashCode().toString())
//注销采集原因回调监听
CallerDevaToolsNetManager.removeListener(this.hashCode().toString())
// 移除 ADAS车辆状态&定位 监听
@@ -557,6 +565,8 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
recordFileName = recordBagMsg.fileName
receiveTime = msgBoxBean.timestamp.toString()
stat = recordBagMsg.stat.toString()
//获取高精地图截图
CallerMapUIServiceManager.getMapUIController()?.getMapScreenShot()
}
fun setClickListener(clickListener: ClickListener) {
@@ -619,4 +629,11 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
}
}
/**
* 高精地图截图回调
*/
override fun onMapScreen(bitmap: Bitmap) {
super.onMapScreen(bitmap)
}
}