[code_opt_3.3.0] remove unuse log and fix bug of trace link
This commit is contained in:
@@ -20,6 +20,7 @@ import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.map.OfflineMapDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.utils.HmiActionLog.Companion.hmiAction
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
@@ -43,10 +44,10 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
private var dockerVersion: String? = null //工控机版本
|
||||
private var ipcUpgradeStateInfo: IPCUpgradeStateInfo?=null
|
||||
private var ipcUpgradeStateInfo: IPCUpgradeStateInfo? = null
|
||||
|
||||
private var needQueryContainers: Boolean = false
|
||||
private var dockerList: List<String>?=null
|
||||
private var dockerList: List<String>? = null
|
||||
private var previousProgress: Int = -1 //前一秒的下载进度,用于计算下载剩余时间
|
||||
private var currentProgress: Int = -1 //当前已下载包体大小
|
||||
|
||||
@@ -64,13 +65,13 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
|
||||
//鹰眼版本视图点击事件
|
||||
ivPadVersion.setOnClickListener {
|
||||
CallerLogger.i("$M_HMI$$TAG", "pad version view clicked")
|
||||
hmiAction("$M_HMI$$TAG", "pad version view clicked")
|
||||
CallerDevaToolsManager.queryAppUpgrade()
|
||||
}
|
||||
|
||||
//工控机版本视图点击事件
|
||||
ivAdVersion.setOnClickListener {
|
||||
CallerLogger.i("$M_HMI$$TAG", "ad version view clicked")
|
||||
hmiAction("$M_HMI$$TAG", "ad version view clicked")
|
||||
// if(AdUpgradeStateHelper.isUpgradeableStatus()){
|
||||
// if(autopilotStatus == 2){
|
||||
// //当前处于自动驾驶状态,不可进行升级,Toast提示
|
||||
@@ -89,15 +90,16 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
when {
|
||||
AdUpgradeStateHelper.isDownloading(it.status) -> {
|
||||
//下载中,点击Toast提示:下载剩余时间
|
||||
it.progress?.let { progress->
|
||||
progress.progressDetail?.let {progressDetail->
|
||||
if(AdUpgradeStateHelper.getRemainingTime(
|
||||
it.progress?.let { progress ->
|
||||
progress.progressDetail?.let { progressDetail ->
|
||||
if (AdUpgradeStateHelper.getRemainingTime(
|
||||
progressDetail.total,
|
||||
previousProgress,
|
||||
currentProgress
|
||||
).isEmpty()){
|
||||
).isEmpty()
|
||||
) {
|
||||
ToastUtils.showShort("下载已完成")
|
||||
}else{
|
||||
} else {
|
||||
ToastUtils.showShort(
|
||||
"预计" + AdUpgradeStateHelper.getRemainingTime(
|
||||
progressDetail.total,
|
||||
@@ -131,6 +133,10 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
ivHDCache.setOnClickListener {
|
||||
hmiAction(
|
||||
"$M_HMI$TAG",
|
||||
"HD map view click , isHDCached:$isHDCached , lon:${location?.longitude} , lat:${location?.latitude}"
|
||||
)
|
||||
if (isHDCached) {// 已缓存
|
||||
ToastUtils.showShort(resources.getString(R.string.offline_had_downloaded))
|
||||
} else {// 未缓存
|
||||
@@ -139,7 +145,6 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
ToastUtils.showShort(resources.getString(R.string.location_try_again))
|
||||
} else {// 拿到了高精的经纬度
|
||||
val dialog = OfflineMapDialog(context)
|
||||
CallerLogger.i("$M_HMI$$TAG", "location lon is:${location?.longitude}, lat is:${location?.latitude}")
|
||||
dialog.location = location
|
||||
dialog.show()
|
||||
}
|
||||
@@ -156,7 +161,7 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
if(AdUpgradeStateHelper.isConfirmUpgrade()){
|
||||
if (AdUpgradeStateHelper.isConfirmUpgrade()) {
|
||||
//将角标改为“下载中”
|
||||
ivAdStatus?.setImageResource(R.drawable.icon_downloading)
|
||||
// ivAdVersion?.setBackgroundResource(R.drawable.version_latest_background)
|
||||
@@ -172,7 +177,7 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
private fun setAdUpgradeInfo(ipcUpgradeStateInfo: IPCUpgradeStateInfo) {
|
||||
this.previousProgress = this.currentProgress
|
||||
ipcUpgradeStateInfo.progress?.let {
|
||||
it.progressDetail?.let {progressDetail->
|
||||
it.progressDetail?.let { progressDetail ->
|
||||
this.currentProgress = progressDetail.current
|
||||
}
|
||||
}
|
||||
@@ -183,22 +188,22 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
* 展示工控机下载、升级状态信息
|
||||
*
|
||||
*/
|
||||
fun showAdUpgradeStatus(ipcUpgradeStateInfo: IPCUpgradeStateInfo){
|
||||
ThreadUtils.runOnUiThread{
|
||||
fun showAdUpgradeStatus(ipcUpgradeStateInfo: IPCUpgradeStateInfo) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
setAdUpgradeInfo(ipcUpgradeStateInfo)
|
||||
AdUpgradeStateHelper.setUpgradeableStatus(false)
|
||||
ipcUpgradeStateInfo.status.let {status->
|
||||
ipcUpgradeStateInfo.status.let { status ->
|
||||
when {
|
||||
AdUpgradeStateHelper.isDownloading(status) -> {
|
||||
//正在下载,展示“下载中”角标,展示进度条,并设置当前下载进度
|
||||
ivAdStatus?.setImageResource(R.drawable.icon_downloading)
|
||||
adCircularProgressView?.let {adCircularProgressView->
|
||||
adCircularProgressView?.let { adCircularProgressView ->
|
||||
adCircularProgressView.visibility = View.VISIBLE
|
||||
CallerLogger.i(
|
||||
"$M_HMI$$TAG", "showAdUpgradeStatus status=$status"
|
||||
)
|
||||
ipcUpgradeStateInfo.progress?.let { progress->
|
||||
progress.progressDetail?.let {progressDetail->
|
||||
ipcUpgradeStateInfo.progress?.let { progress ->
|
||||
progress.progressDetail?.let { progressDetail ->
|
||||
adCircularProgressView.setProgress(
|
||||
AdUpgradeStateHelper.downloadProgress(
|
||||
progressDetail.current,
|
||||
@@ -219,14 +224,14 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
// ivAdVersion?.setBackgroundResource(R.drawable.version_latest_background)
|
||||
AdUpgradeStateHelper.setConfirmUpgrade(false)
|
||||
}
|
||||
AdUpgradeStateHelper.isDownloadFinish(status) ->{
|
||||
AdUpgradeStateHelper.isDownloadFinish(status) -> {
|
||||
//升级中,将状态设为“升级中”角标,并隐藏进度条
|
||||
ivAdStatus?.setImageResource(R.drawable.icon_upgrading)
|
||||
adCircularProgressView?.visibility = View.GONE
|
||||
// ivAdVersion?.setBackgroundResource(R.drawable.version_latest_background)
|
||||
AdUpgradeStateHelper.setConfirmUpgrade(false)
|
||||
}
|
||||
AdUpgradeStateHelper.isUpgrading(status) ->{
|
||||
AdUpgradeStateHelper.isUpgrading(status) -> {
|
||||
//升级中,将状态设为“升级中”角标,并隐藏进度条
|
||||
ivAdStatus?.setImageResource(R.drawable.icon_upgrading)
|
||||
adCircularProgressView?.visibility = View.GONE
|
||||
@@ -300,7 +305,7 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
}
|
||||
CallerHmiListenerManager.addListener(TAG, this)
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
CallerDevaToolsListenerManager.addListener(TAG,this)
|
||||
CallerDevaToolsListenerManager.addListener(TAG, this)
|
||||
CallerChassisLocationWGS84ListenerManager.addListener(TAG, this)
|
||||
needQueryContainers = true
|
||||
}
|
||||
@@ -328,13 +333,13 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
*/
|
||||
override fun queryContainersResponse(dockerList: List<String>) {
|
||||
this.dockerList = dockerList
|
||||
if(dockerList.isNotEmpty()){
|
||||
if (dockerList.isNotEmpty()) {
|
||||
//有更新任务,将状态设为“可升级”角标,并隐藏进度条
|
||||
ivAdStatus?.setImageResource(R.drawable.icon_upgradeable)
|
||||
adCircularProgressView?.visibility = View.GONE
|
||||
// ivAdVersion?.setBackgroundResource(R.drawable.version_upgradeable_background)
|
||||
AdUpgradeStateHelper.setUpgradeableStatus(true)
|
||||
}else{
|
||||
} else {
|
||||
ToastUtils.showLong("已是最新版本")
|
||||
ivAdStatus?.setImageResource(R.drawable.icon_latest_version)
|
||||
adCircularProgressView?.visibility = View.GONE
|
||||
|
||||
@@ -9,9 +9,12 @@ import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ROMA_CLICK
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ROMA_CLICK_END
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ROMA_CLOSE_CLICK
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ROMA_CLOUD_ERROR
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ROMA_CLOUD_PUSH
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ROMA_MAP_CHANGE_END
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ROMA_MAP_END
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ROMA_MAP_ERROR
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ROMA_MAP_START
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ROMA_REQUEST
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ROMA_REQUEST_ERROR
|
||||
@@ -29,6 +32,7 @@ import com.mogo.eagle.core.function.call.map.CallerMapRomaListener
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.updateLongSightLevel
|
||||
import com.mogo.eagle.core.function.utils.MapBizTrace
|
||||
import com.mogo.eagle.core.function.utils.MapBizTrace.Companion.getCurrentCNode
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.map.MogoMapUIController
|
||||
@@ -44,6 +48,10 @@ class AiCloudIdentifyDataManager : IMoGoPlanningRottingListener,
|
||||
companion object {
|
||||
private const val TAG = "AiCloudIdentifyData"
|
||||
|
||||
private const val H_ERROR_CLOUD = 1
|
||||
private const val H_ERROR_MAP = 2
|
||||
private const val H_DELAY_TIME = 3_000L
|
||||
|
||||
var START_METRE = 3
|
||||
var END_METRE = 2000
|
||||
|
||||
@@ -57,18 +65,40 @@ class AiCloudIdentifyDataManager : IMoGoPlanningRottingListener,
|
||||
|
||||
private var aiCloudDataChange = AtomicBoolean(false)
|
||||
|
||||
@Volatile
|
||||
private var cloudDataSize = 0
|
||||
|
||||
private val handler = Handler {
|
||||
if (it.what == 1) {
|
||||
if (it.what == H_ERROR_CLOUD) {
|
||||
if (!aiCloudDataChange.get()) {
|
||||
MapBizTrace.log(
|
||||
CHAIN_CODE_ROMA_MAP_START, CHAIN_CODE_ROMA_CLOUD_ERROR, TAG, GsonUtils.toJson(
|
||||
mutableMapOf(
|
||||
"msg" to "云端5秒内无感知数据下发",
|
||||
"msg" to "云端 $H_DELAY_TIME 秒内无感知数据下发",
|
||||
"socketStatus" to MogoStatusManager.getInstance().isSocketOnLine,
|
||||
"cityCode" to CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().cityCode
|
||||
)
|
||||
)
|
||||
)
|
||||
} else {
|
||||
MapBizTrace.log(
|
||||
CHAIN_CODE_ROMA_MAP_START, CHAIN_CODE_ROMA_CLOUD_PUSH, TAG, GsonUtils.toJson(
|
||||
mutableMapOf(
|
||||
"msg" to "延迟 $H_DELAY_TIME 秒内获取云端下发感知数据大小",
|
||||
"cloudDataSize" to cloudDataSize
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
if (it.what == H_ERROR_MAP) {
|
||||
MapBizTrace.log(
|
||||
CHAIN_CODE_ROMA_MAP_START, CHAIN_CODE_ROMA_MAP_ERROR, TAG, GsonUtils.toJson(
|
||||
mutableMapOf("msg" to "地图漫游模式启动失败")
|
||||
)
|
||||
)
|
||||
if (DebugConfig.isDebug()) {
|
||||
ToastUtils.showShort("进入漫游模式失败")
|
||||
}
|
||||
}
|
||||
true
|
||||
@@ -96,13 +126,16 @@ class AiCloudIdentifyDataManager : IMoGoPlanningRottingListener,
|
||||
obj?.let {
|
||||
obj.data?.let {
|
||||
if (it.allListList != null && it.allListList.size > 0) {
|
||||
aiCloudDataChange.set(true)
|
||||
if (!aiCloudDataChange.get()) {
|
||||
aiCloudDataChange.set(true)
|
||||
}
|
||||
}
|
||||
if (showAiCloud.get()) {
|
||||
if (it.allListList == null || it.allListList.size == 0) {
|
||||
MapIdentifySubscriber.instance.clearAiCloudRoma()
|
||||
return
|
||||
}
|
||||
cloudDataSize = it.allListList.size
|
||||
MapIdentifySubscriber.instance.renderAiCloudResult(it.allListList)
|
||||
}
|
||||
}
|
||||
@@ -112,17 +145,20 @@ class AiCloudIdentifyDataManager : IMoGoPlanningRottingListener,
|
||||
}
|
||||
|
||||
fun trigger(romaStatus: Boolean) {
|
||||
MapBizTrace.log(
|
||||
"",
|
||||
CHAIN_CODE_ROMA_CLICK,
|
||||
TAG,
|
||||
GsonUtils.toJson(mutableMapOf("trigger" to romaStatus))
|
||||
)
|
||||
// 乘客司机屏屏各自单独控制漫游
|
||||
if (romaStatus) {
|
||||
// 开启roma,当前非漫游,开启
|
||||
MapBizTrace.log(
|
||||
"",
|
||||
CHAIN_CODE_ROMA_CLICK,
|
||||
TAG,
|
||||
GsonUtils.toJson(mutableMapOf("trigger" to true))
|
||||
)
|
||||
openRoma()
|
||||
} else {
|
||||
// 跟上次关联,需要确认parent进度
|
||||
MapBizTrace.log(getCurrentCNode(), CHAIN_CODE_ROMA_CLOSE_CLICK, TAG, "")
|
||||
handler.removeMessages(H_ERROR_CLOUD)
|
||||
closeRoma()
|
||||
}
|
||||
}
|
||||
@@ -134,13 +170,13 @@ class AiCloudIdentifyDataManager : IMoGoPlanningRottingListener,
|
||||
}
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
private fun closeRoma(manual: Boolean = true) {
|
||||
updateLongSightLevel(false)
|
||||
requestRangeOfIdentify(false)
|
||||
MapIdentifySubscriber.instance.clearAiCloudRoma()
|
||||
// 主动关闭roma,回到中景视角
|
||||
if (manual) {
|
||||
MapBizTrace.logEnd(CHAIN_CODE_ROMA_CLICK, CHAIN_CODE_ROMA_CLICK_END, TAG, "")
|
||||
MogoMapUIController.getInstance()
|
||||
.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
|
||||
}
|
||||
@@ -160,7 +196,7 @@ class AiCloudIdentifyDataManager : IMoGoPlanningRottingListener,
|
||||
"socketStatus" to MogoStatusManager.getInstance().isSocketOnLine,
|
||||
"cityCode" to CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().cityCode
|
||||
)
|
||||
)
|
||||
), !dataReceive
|
||||
)
|
||||
aiCloudIdentifyNetWorkModel.requestIdentifyRange(
|
||||
dataReceive,
|
||||
@@ -178,7 +214,7 @@ class AiCloudIdentifyDataManager : IMoGoPlanningRottingListener,
|
||||
"startRange" to START_METRE,
|
||||
"endRange" to END_METRE,
|
||||
)
|
||||
)
|
||||
), !dataReceive
|
||||
)
|
||||
if (dataReceive) {
|
||||
// 请求地图开始漫游
|
||||
@@ -190,7 +226,7 @@ class AiCloudIdentifyDataManager : IMoGoPlanningRottingListener,
|
||||
},
|
||||
{ errorMsg ->
|
||||
// false,改变父节点信息
|
||||
MapBizTrace.logEnd(
|
||||
MapBizTrace.log(
|
||||
if (dataReceive) CHAIN_CODE_ROMA_REQUEST else "",
|
||||
CHAIN_CODE_ROMA_REQUEST_ERROR,
|
||||
TAG,
|
||||
@@ -201,7 +237,7 @@ class AiCloudIdentifyDataManager : IMoGoPlanningRottingListener,
|
||||
"startRange" to START_METRE,
|
||||
"endRange" to END_METRE
|
||||
)
|
||||
)
|
||||
), true
|
||||
)
|
||||
updateLongSightLevel(false)
|
||||
CallerMapRomaListener.invokeMapRoma(false)
|
||||
@@ -214,35 +250,53 @@ class AiCloudIdentifyDataManager : IMoGoPlanningRottingListener,
|
||||
//status 0:进入漫游模式成功 1;进入漫游模式失败 2:正常结束漫游 3:切换视角结束漫游
|
||||
override fun mapRomaStatus(status: Int, msg: String) {
|
||||
super.mapRomaStatus(status, msg)
|
||||
MapBizTrace.log(
|
||||
CHAIN_CODE_ROMA_REQUEST_OK,
|
||||
CHAIN_CODE_ROMA_MAP_START,
|
||||
TAG,
|
||||
GsonUtils.toJson(mutableMapOf("mapStatus" to status, "mapRomaMsg" to msg))
|
||||
)
|
||||
when (status) {
|
||||
0 -> {
|
||||
MapBizTrace.log(
|
||||
CHAIN_CODE_ROMA_REQUEST_OK,
|
||||
CHAIN_CODE_ROMA_MAP_START,
|
||||
TAG,
|
||||
GsonUtils.toJson(mutableMapOf("romaStart" to "地图开始漫游"))
|
||||
)
|
||||
showAiCloud.set(true)
|
||||
FunctionBuildConfig.isDrawIdentifyData = false
|
||||
// 5秒没有触发 则预警日志写入
|
||||
handler.sendEmptyMessageDelayed(1, 5_000L)
|
||||
handler.sendEmptyMessageDelayed(H_ERROR_CLOUD, H_DELAY_TIME)
|
||||
}
|
||||
1 -> {
|
||||
if (DebugConfig.isDebug()) {
|
||||
ToastUtils.showShort("进入漫游模式失败,msg:$msg")
|
||||
}
|
||||
handler.sendEmptyMessage(H_ERROR_MAP)
|
||||
reset()
|
||||
}
|
||||
2, 3 -> {
|
||||
if (showAiCloud.get()) {
|
||||
MapBizTrace.logEnd(
|
||||
CHAIN_CODE_ROMA_MAP_START, CHAIN_CODE_ROMA_MAP_END, TAG, GsonUtils.toJson(
|
||||
mutableMapOf("romaEnd" to "地图结束回调,状态:$status")
|
||||
)
|
||||
)
|
||||
showAiCloud.set(false)
|
||||
closeRoma(false)
|
||||
FunctionBuildConfig.isDrawIdentifyData = true
|
||||
}
|
||||
2 -> { // 地图自动漫游结束,重置状态,调用close通知服务端
|
||||
MapBizTrace.log(
|
||||
CHAIN_CODE_ROMA_MAP_START, CHAIN_CODE_ROMA_MAP_END, TAG, GsonUtils.toJson(
|
||||
mutableMapOf("romaEnd" to "地图结束回调,状态:$status")
|
||||
), true
|
||||
)
|
||||
reset()
|
||||
}
|
||||
3 -> { // 业务释放地图视角锁定,回调切换视角结束漫游
|
||||
MapBizTrace.log(
|
||||
CHAIN_CODE_ROMA_CLOSE_CLICK,
|
||||
CHAIN_CODE_ROMA_MAP_CHANGE_END,
|
||||
TAG,
|
||||
GsonUtils.toJson(
|
||||
mutableMapOf("romaEnd" to "地图结束回调,状态:$status")
|
||||
),
|
||||
true
|
||||
)
|
||||
reset(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun reset(invokeCloud: Boolean = true) {
|
||||
if (showAiCloud.get()) {
|
||||
showAiCloud.set(false)
|
||||
aiCloudDataChange.set(false)
|
||||
FunctionBuildConfig.isDrawIdentifyData = true
|
||||
if (invokeCloud) {
|
||||
closeRoma(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import android.annotation.SuppressLint
|
||||
import androidx.collection.ArraySet
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.w
|
||||
import com.mogo.map.identify.MogoIdentifyManager
|
||||
import mogo.yycp.api.proto.SocketDownData
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
@@ -36,12 +35,10 @@ class IdentifyAiCloudDataDrawer : Identify {
|
||||
override fun renderAiCloudResult(resultList: List<SocketDownData.CloudRoadDataProto>) {
|
||||
if (resultList.isEmpty()) {
|
||||
clearOldMarker()
|
||||
w(TAG, "感知数据为空无需渲染……")
|
||||
return
|
||||
}
|
||||
if (!MogoStatusManager.getInstance().isVrMode) {
|
||||
clearOldMarker()
|
||||
w(TAG, "渲染 adas 识别的数据 当前不是VR模式")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import android.annotation.SuppressLint
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.w
|
||||
import com.mogo.map.identify.MogoIdentifyManager
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo.telematics.pad.MessagePad.TrackedObject
|
||||
@@ -35,12 +34,10 @@ class IdentifyBeautifyDataDrawer : Identify {
|
||||
override fun renderAdasRecognizedResult(resultList: List<TrackedObject>?) {
|
||||
if (resultList == null || resultList.isEmpty()) {
|
||||
TrackManager.getInstance().clearAll()
|
||||
w(TAG, "感知数据为空无需渲染……")
|
||||
return
|
||||
}
|
||||
if (!MogoStatusManager.getInstance().isVrMode) {
|
||||
TrackManager.getInstance().clearAll()
|
||||
w(TAG, "渲染 adas 识别的数据 当前不是VR模式")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import androidx.collection.ArraySet
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.w
|
||||
import com.mogo.map.identify.MogoIdentifyManager
|
||||
import mogo.telematics.pad.MessagePad.PlanningObject
|
||||
import mogo.telematics.pad.MessagePad.TrackedObject
|
||||
@@ -57,12 +56,10 @@ class IdentifyOriginDataDrawer : Identify {
|
||||
override fun renderAdasRecognizedResult(resultList: List<TrackedObject>?) {
|
||||
if (resultList == null || resultList.isEmpty()) {
|
||||
clearOldMarker()
|
||||
w(TAG, "感知数据为空无需渲染……")
|
||||
return
|
||||
}
|
||||
if (!MogoStatusManager.getInstance().isVrMode) {
|
||||
clearOldMarker()
|
||||
w(TAG, "渲染 adas 识别的数据 当前不是VR模式")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -11,27 +11,55 @@ import com.zhjt.service.chain.ParentNodeAlias
|
||||
class MapBizTrace {
|
||||
|
||||
companion object {
|
||||
@ChainLog(
|
||||
linkChainLog = ChainConstant.CHAIN_TYPE_HD_MAP,
|
||||
linkCode = ChainConstant.CHAIN_SOURCE_MAP,
|
||||
paramIndexes = [2, 3],
|
||||
endPoint = false
|
||||
)
|
||||
fun log(@ParentNodeAlias pN: String, @ChildNodeAlias cN: String, data: Any, data1: Any) {
|
||||
|
||||
private var cNode: String = ""
|
||||
|
||||
fun log(pN: String, cN: String, data: Any, data1: Any, end: Boolean = false) {
|
||||
if (end) {
|
||||
logEnd(pN, cN, data, data1)
|
||||
} else {
|
||||
realLog(pN, cN, data, data1)
|
||||
}
|
||||
if (DebugConfig.isDebug()) {
|
||||
CallerLogger.d("$M_MAP${data.toString()}", data1)
|
||||
}
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = ChainConstant.CHAIN_TYPE_HD_MAP,
|
||||
linkCode = ChainConstant.CHAIN_SOURCE_MAP,
|
||||
paramIndexes = [2, 3],
|
||||
endPoint = false
|
||||
)
|
||||
private fun realLog(
|
||||
@ParentNodeAlias pN: String,
|
||||
@ChildNodeAlias cN: String,
|
||||
data: Any,
|
||||
data1: Any
|
||||
) {
|
||||
if (pN.isNotEmpty() && cN != ChainConstant.CHAIN_CODE_ROMA_CLOUD_ERROR) {
|
||||
cNode = cN
|
||||
}
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = ChainConstant.CHAIN_TYPE_HD_MAP,
|
||||
linkCode = ChainConstant.CHAIN_SOURCE_MAP,
|
||||
paramIndexes = [2, 3]
|
||||
)
|
||||
fun logEnd(@ParentNodeAlias pN: String, @ChildNodeAlias cN: String, data: Any, data1: Any) {
|
||||
if (DebugConfig.isDebug()) {
|
||||
CallerLogger.d("$M_MAP${data.toString()}", data1)
|
||||
private fun logEnd(
|
||||
@ParentNodeAlias pN: String,
|
||||
@ChildNodeAlias cN: String,
|
||||
data: Any,
|
||||
data1: Any
|
||||
) {
|
||||
if (pN.isNotEmpty() && cN != ChainConstant.CHAIN_CODE_ROMA_CLOUD_ERROR) {
|
||||
cNode = cN
|
||||
}
|
||||
}
|
||||
|
||||
fun getCurrentCNode():String{
|
||||
return cNode
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -107,15 +107,18 @@ class ChainConstant {
|
||||
const val CHAIN_CODE_HMI_ACTIONS = "CHAIN_CODE_HMI_ACTIONS"
|
||||
|
||||
const val CHAIN_CODE_ROMA_CLICK = "CHAIN_CODE_ROMA_CLICK"
|
||||
const val CHAIN_CODE_ROMA_CLICK_END = "CHAIN_CODE_ROMA_CLICK_END"
|
||||
const val CHAIN_CODE_ROMA_CLOSE_CLICK = "CHAIN_CODE_ROMA_CLOSE_CLICK"
|
||||
const val CHAIN_CODE_ROMA_REQUEST = "CHAIN_CODE_ROMA_REQUEST"
|
||||
const val CHAIN_CODE_ROMA_REQUEST_OK = "CHAIN_CODE_ROMA_REQUEST_OK"
|
||||
const val CHAIN_CODE_ROMA_REQUEST_ERROR = "CHAIN_CODE_ROMA_REQUEST_ERROR"
|
||||
const val CHAIN_CODE_ROMA_MODE_INVOKE = "CHAIN_CODE_ROMA_MODE_INVOKE"
|
||||
const val CHAIN_CODE_ROMA_MAP_START = "CHAIN_CODE_ROMA_MAP_START"
|
||||
const val CHAIN_CODE_ROMA_MAP_END = "CHAIN_CODE_ROMA_MAP_END"
|
||||
const val CHAIN_CODE_ROMA_CLOUD_ERROR = "CHAIN_CODE_ROMA_CLOUD_ERROR"
|
||||
const val CHAIN_CODE_ROMA_MAP_CHANGE_END = "CHAIN_CODE_ROMA_MAP_CHANGE_END"
|
||||
const val CHAIN_CODE_ROMA_ROUTE_MODE = "CHAIN_CODE_ROMA_ROUTE_MODE"
|
||||
const val CHAIN_CODE_ROMA_CLOUD_ERROR = "CHAIN_CODE_ROMA_CLOUD_ERROR"
|
||||
const val CHAIN_CODE_ROMA_CLOUD_PUSH = "CHAIN_CODE_ROMA_CLOUD_PUSH"
|
||||
const val CHAIN_CODE_ROMA_MAP_ERROR = "CHAIN_CODE_ROMA_MAP_ERROR"
|
||||
|
||||
}
|
||||
}
|
||||
@@ -32,8 +32,6 @@ import android.view.accessibility.AccessibilityEvent;
|
||||
import android.view.accessibility.AccessibilityNodeInfo;
|
||||
import android.widget.MediaController.MediaPlayerControl;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -136,11 +134,6 @@ public class TextureVideoView extends TextureView implements MediaPlayerControl
|
||||
}
|
||||
|
||||
public void setVideoURI(Uri uri, Map<String, String> headers) {
|
||||
if (uri == null) {
|
||||
CallerLogger.INSTANCE.i(TAG, "setVideoURI--- uri = null");
|
||||
} else {
|
||||
CallerLogger.INSTANCE.i(TAG, "setVideoURI--- uri = " + uri.getPath());
|
||||
}
|
||||
mUri = uri;
|
||||
mHeaders = headers;
|
||||
mSeekWhenPrepared = 0;
|
||||
@@ -161,15 +154,13 @@ public class TextureVideoView extends TextureView implements MediaPlayerControl
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
private void openVideo() {
|
||||
CallerLogger.INSTANCE.i(TAG, "openVideo");
|
||||
if (mUri == null) {
|
||||
CallerLogger.INSTANCE.i(TAG, "mUri == null ");
|
||||
return;
|
||||
}
|
||||
if (mSurface == null) {
|
||||
CallerLogger.INSTANCE.i(TAG, "mSurface == null ");
|
||||
return;
|
||||
}
|
||||
if (mUri == null || mSurface == null || isSuspendFromActivity) {
|
||||
CallerLogger.INSTANCE.i(TAG, "isSuspendFromActivity = " + isSuspendFromActivity);
|
||||
if (isSuspendFromActivity) {
|
||||
return;
|
||||
}
|
||||
release(false);
|
||||
@@ -217,15 +208,11 @@ public class TextureVideoView extends TextureView implements MediaPlayerControl
|
||||
public void onVideoSizeChanged(MediaPlayer mp, int width, int height) {
|
||||
mVideoWidth = mp.getVideoWidth();
|
||||
mVideoHeight = mp.getVideoHeight();
|
||||
if (mVideoWidth != 0 && mVideoHeight != 0) {
|
||||
CallerLogger.INSTANCE.i(TAG, "OnVideoSizeChangedListener mVideoWidth:" + " mVideoWidth:" + mVideoWidth + " mVideoHeight:" + mVideoHeight);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
MediaPlayer.OnPreparedListener mPreparedListener = new MediaPlayer.OnPreparedListener() {
|
||||
public void onPrepared(MediaPlayer mp) {
|
||||
CallerLogger.INSTANCE.i(TAG, "MediaPlayer.OnPreparedListener");
|
||||
mPrepareState = mCurrentState = STATE_PREPARED;
|
||||
mVideoWidth = mp.getVideoWidth();
|
||||
mVideoHeight = mp.getVideoHeight();
|
||||
@@ -251,7 +238,6 @@ public class TextureVideoView extends TextureView implements MediaPlayerControl
|
||||
|
||||
private final OnCompletionListener mCompletionListener = new OnCompletionListener() {
|
||||
public void onCompletion(MediaPlayer mp) {
|
||||
CallerLogger.INSTANCE.i(TAG, "MediaPlayer.OnCompletionListener");
|
||||
mTargetState = mCurrentState = STATE_PLAYBACK_COMPLETED;
|
||||
if (mOnCompletionListener != null) {
|
||||
mOnCompletionListener.onCompletion(mMediaPlayer);
|
||||
@@ -260,7 +246,6 @@ public class TextureVideoView extends TextureView implements MediaPlayerControl
|
||||
};
|
||||
|
||||
private final OnSeekCompleteListener mSeekCompleteListener = mp -> {
|
||||
CallerLogger.INSTANCE.i(TAG, "MediaPlayer.OnSeekCompleteListener");
|
||||
try {
|
||||
mCurrentState = mMediaPlayer.isPlaying() ? STATE_PLAYING : STATE_PAUSED;
|
||||
} catch (Exception e) {
|
||||
@@ -271,7 +256,6 @@ public class TextureVideoView extends TextureView implements MediaPlayerControl
|
||||
|
||||
private final OnErrorListener mErrorListener = new OnErrorListener() {
|
||||
public boolean onError(MediaPlayer mp, int framework_err, int impl_err) {
|
||||
CallerLogger.INSTANCE.i(TAG, "MediaPlayer.onError");
|
||||
mTargetState = mPrepareState = mCurrentState = STATE_ERROR;
|
||||
if (mOnErrorListener != null) {
|
||||
mOnErrorListener.onError(mMediaPlayer, framework_err,
|
||||
@@ -286,7 +270,6 @@ public class TextureVideoView extends TextureView implements MediaPlayerControl
|
||||
|
||||
@Override
|
||||
public boolean onInfo(MediaPlayer mp, int what, int extra) {
|
||||
CallerLogger.INSTANCE.i(TAG, "MediaPlayer.OnInfoListener---what = " + what + ";extra = " + extra);
|
||||
int messageId = 0;
|
||||
if (what == MEDIA_INFO_VIDEO_NOT_SUPPORTED) {
|
||||
messageId = R.string.VideoView_info_text_video_not_supported;
|
||||
@@ -305,7 +288,6 @@ public class TextureVideoView extends TextureView implements MediaPlayerControl
|
||||
|
||||
private final MediaPlayer.OnBufferingUpdateListener mBufferingUpdateListener = new MediaPlayer.OnBufferingUpdateListener() {
|
||||
public void onBufferingUpdate(MediaPlayer mp, int percent) {
|
||||
CallerLogger.INSTANCE.i(TAG, "MediaPlayer.OnBufferingUpdateListener");
|
||||
mCurrentBufferPercentage = percent;
|
||||
}
|
||||
};
|
||||
@@ -348,14 +330,12 @@ public class TextureVideoView extends TextureView implements MediaPlayerControl
|
||||
SurfaceTextureListener mSurfaceTextureListener = new SurfaceTextureListener() {
|
||||
@Override
|
||||
public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
|
||||
CallerLogger.INSTANCE.i(TAG, "onSurfaceTextureAvailable");
|
||||
mSurface = new Surface(surface);
|
||||
openVideo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int height) {
|
||||
CallerLogger.INSTANCE.i(TAG, "onSurfaceTextureSizeChanged mVideoWidth:" + " mVideoWidth:" + mVideoWidth + " mVideoHeight:" + mVideoHeight);
|
||||
boolean isValidState = (mTargetState == STATE_PLAYING);
|
||||
boolean hasValidSize = (mVideoWidth == width && mVideoHeight == height);
|
||||
if (mMediaPlayer != null && isValidState && hasValidSize) {
|
||||
@@ -373,7 +353,6 @@ public class TextureVideoView extends TextureView implements MediaPlayerControl
|
||||
|
||||
@Override
|
||||
public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) {
|
||||
CallerLogger.INSTANCE.i(TAG, "onSurfaceTextureDestroyed");
|
||||
mSurface = null;
|
||||
release(false);
|
||||
return false;
|
||||
@@ -389,7 +368,6 @@ public class TextureVideoView extends TextureView implements MediaPlayerControl
|
||||
* release the media player in any state
|
||||
*/
|
||||
private void release(boolean cleartargetstate) {
|
||||
CallerLogger.INSTANCE.i(TAG, "release ---cleartargetstate=" + cleartargetstate);
|
||||
mCurrentState = STATE_IDLE;
|
||||
|
||||
if (cleartargetstate) {
|
||||
@@ -441,14 +419,12 @@ public class TextureVideoView extends TextureView implements MediaPlayerControl
|
||||
}
|
||||
|
||||
public void start() {
|
||||
CallerLogger.INSTANCE.i(TAG, "TextureVideoView---start");
|
||||
if (isFocusLoss) {
|
||||
mTagetStateBackup = STATE_PLAYING;
|
||||
return;
|
||||
}
|
||||
//CallerLogger.INSTANCE.i(TAG, "mCurrentState = " + mCurrentState);
|
||||
if (isInPlaybackState()) {
|
||||
CallerLogger.INSTANCE.i(TAG, "MediaPlayer.start");
|
||||
mMediaPlayer.start();
|
||||
mCurrentState = STATE_PLAYING;
|
||||
}
|
||||
@@ -456,11 +432,8 @@ public class TextureVideoView extends TextureView implements MediaPlayerControl
|
||||
}
|
||||
|
||||
public void pause() {
|
||||
CallerLogger.INSTANCE.i(TAG, "TextureVideoView---pause");
|
||||
CallerLogger.INSTANCE.i(TAG, "mCurrentState = " + mCurrentState);
|
||||
if (isInPlaybackState()) {
|
||||
if (mMediaPlayer.isPlaying()) {
|
||||
CallerLogger.INSTANCE.i(TAG, " MediaPlayer.pause");
|
||||
mMediaPlayer.pause();
|
||||
mCurrentState = STATE_PAUSED;
|
||||
}
|
||||
@@ -469,7 +442,6 @@ public class TextureVideoView extends TextureView implements MediaPlayerControl
|
||||
}
|
||||
|
||||
public void suspend() {
|
||||
CallerLogger.INSTANCE.i(TAG, "TextureVideoView---suspend");
|
||||
if (!isSuspendFromActivity) {
|
||||
isSuspendFromActivity = true;
|
||||
if (mMediaPlayer != null) {
|
||||
@@ -482,15 +454,12 @@ public class TextureVideoView extends TextureView implements MediaPlayerControl
|
||||
}
|
||||
|
||||
public void resume() {
|
||||
CallerLogger.INSTANCE.i(TAG, "TextureVideoView---resume");
|
||||
isSuspendFromActivity = false;
|
||||
openVideo();
|
||||
seekTo(progressWhileSuspend);
|
||||
|
||||
if (mTagetStateBackup == STATE_IDLE)
|
||||
mTagetStateBackup = mTargetState;
|
||||
CallerLogger.INSTANCE.i(TAG, "isFocusLoss = " + isFocusLoss);
|
||||
CallerLogger.INSTANCE.i(TAG, "isInPlaybackState() = " + isInPlaybackState());
|
||||
if (isFocusLoss) {
|
||||
if (isInPlaybackState()) {
|
||||
if (mMediaPlayer.isPlaying()) {
|
||||
@@ -522,12 +491,10 @@ public class TextureVideoView extends TextureView implements MediaPlayerControl
|
||||
}
|
||||
|
||||
public void seekTo(int msec) {
|
||||
CallerLogger.INSTANCE.i(TAG, "TextureVideoView---seekTo---msec = " + msec);
|
||||
if (isInPlaybackState() && mCurrentState != STATE_SEEKING
|
||||
&& msec > 0 && msec < getDuration()) {
|
||||
mCurrentState = STATE_SEEKING;
|
||||
|
||||
CallerLogger.INSTANCE.i(TAG, "MediaPlayer.seekTo(msec) = " + msec);
|
||||
mMediaPlayer.seekTo(msec);
|
||||
mSeekWhenPrepared = 0;
|
||||
} else {
|
||||
@@ -591,7 +558,6 @@ public class TextureVideoView extends TextureView implements MediaPlayerControl
|
||||
}
|
||||
|
||||
public int getCurrentState() {
|
||||
CallerLogger.INSTANCE.i(TAG, "mCurrentState == " + mCurrentState);
|
||||
return mCurrentState;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.mogo.eagle.core.utilcode.util;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_UTIL;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.ContentUris;
|
||||
import android.content.Context;
|
||||
@@ -26,7 +24,6 @@ import android.text.TextUtils;
|
||||
import android.util.Base64;
|
||||
|
||||
import com.elegant.utils.IOUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
@@ -123,18 +120,12 @@ public class BitmapHelper {
|
||||
if ( quality == 100 ) {
|
||||
fullSize = bos.size();
|
||||
}
|
||||
CallerLogger.INSTANCE.i( M_UTIL + TAG, "quality<---->size, " + quality + "<---->" + bos.size() / 1024 );
|
||||
}
|
||||
while ( bos.size() > maxSizeOfBytes && ( quality -= ( fullSize > ONE_MB ) ? 10 : 5 ) >= 0 );
|
||||
|
||||
result = bos.toByteArray();
|
||||
|
||||
final long end = System.currentTimeMillis();
|
||||
CallerLogger.INSTANCE.i( M_UTIL + TAG,
|
||||
"bitmap to bytes costs " + ( end - start ) + "ms, \n" +
|
||||
"bitmap full size is " + ( fullSize / 1024 ) + "kb, \n" +
|
||||
"bitmap final size is " + ( bos.size() / 1024 ) + "kb, \n" +
|
||||
"bitmap quality is " + quality );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
result = null;
|
||||
@@ -297,7 +288,6 @@ public class BitmapHelper {
|
||||
sampleSize = sampleSize << 1;
|
||||
}
|
||||
|
||||
CallerLogger.INSTANCE.i( M_UTIL + TAG, "sample size is " + sampleSize );
|
||||
return sampleSize;
|
||||
}
|
||||
|
||||
@@ -338,8 +328,6 @@ public class BitmapHelper {
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
CallerLogger.INSTANCE.i( M_UTIL + TAG, "ExifInterface, degree is " + degree );
|
||||
|
||||
return degree;
|
||||
}
|
||||
|
||||
@@ -416,7 +404,6 @@ public class BitmapHelper {
|
||||
final long start = System.currentTimeMillis();
|
||||
|
||||
if ( bitmap == null || file == null ) {
|
||||
CallerLogger.INSTANCE.i( M_UTIL + TAG, "保存失败, bitmap or file is null." );
|
||||
return;
|
||||
}
|
||||
if ( file.getParentFile() != null && !file.getParentFile().exists() ) {
|
||||
@@ -428,15 +415,9 @@ public class BitmapHelper {
|
||||
bitmap.compress( Bitmap.CompressFormat.JPEG, 100, fos );
|
||||
fos.flush();
|
||||
fos.close();
|
||||
|
||||
if ( file.exists() ) {
|
||||
CallerLogger.INSTANCE.i(M_UTIL + TAG, "保存成功" );
|
||||
}
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
CallerLogger.INSTANCE.i( M_UTIL + TAG, "saving picture costs " + ( System.currentTimeMillis() - start ) + "ms" );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,6 +3,6 @@ ext {
|
||||
kotlin_version = '1.5.30'
|
||||
plugin_version = '10.0.0_mogo'
|
||||
hook_log_plugin_version = '1.7.2'
|
||||
service_chain_version = '5.2.8'
|
||||
service_chain_version = '5.2.9'
|
||||
lancetx_plugin_version = '10.0.3_mogo'
|
||||
}
|
||||
Reference in New Issue
Block a user