From c54bdc8fce07ad7ed17ba6d0bf8b3991bcb7c25c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=AE=8F=E5=AE=87?= Date: Mon, 9 Aug 2021 15:10:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E6=B5=8BOBU=E7=BB=98=E5=88=B6?= =?UTF-8?q?=E5=91=A8=E8=BE=B9=E8=BD=A6=E8=BE=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../obu/mogo/map/ObuRecognizedResultDrawer.kt | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/modules/mogo-module-obu-mogo/src/main/java/com/mogo/module/obu/mogo/map/ObuRecognizedResultDrawer.kt b/modules/mogo-module-obu-mogo/src/main/java/com/mogo/module/obu/mogo/map/ObuRecognizedResultDrawer.kt index 7a8b3b2f5d..1277fc76cf 100644 --- a/modules/mogo-module-obu-mogo/src/main/java/com/mogo/module/obu/mogo/map/ObuRecognizedResultDrawer.kt +++ b/modules/mogo-module-obu-mogo/src/main/java/com/mogo/module/obu/mogo/map/ObuRecognizedResultDrawer.kt @@ -13,6 +13,8 @@ import com.mogo.module.common.constants.DataTypes import com.mogo.utils.WorkThreadHandler import com.mogo.utils.logger.Logger import com.zhidao.support.obu.model.CvxRvInfoIndInfo +import com.zhidao.support.obu.model.advance.MovingObjectInfo +import com.zhidao.support.obu.model.advance.Position import java.util.concurrent.ConcurrentHashMap /** @@ -47,6 +49,25 @@ class ObuRecognizedResultDrawer() { super.handleMessage(msg) drawerCvxRvInfo() + /*// TODO 测试数据 + mCvxRvInfoIndInfoMap.forEach { + + var latitude = ((it.value.basic_info.position.latitude * 10000000.0).toLong()) + var longitude = (it.value.basic_info.position.longitude * 10000000.0).toLong() + + latitude += 10 + //longitude += 100 + + it.value.basic_info.position.setValue( + 0, + latitude, + longitude, + 30 + ) + addCvxRvInfoIndInfo(it.value) + }*/ + + // 延时50毫秒重复发送自己,定时轮询进行车辆绘制,可以及时将已经不存在车辆删除 sendEmptyMessageDelayed(0, 100L) } @@ -55,6 +76,15 @@ class ObuRecognizedResultDrawer() { init { mContext = AbsMogoApplication.getApp() mDrawerHandler.sendEmptyMessageDelayed(1, 0L) + + /* // TODO 测试数据 + val cvxRvInfoIndInfo = CvxRvInfoIndInfo(0, 1, 2) + cvxRvInfoIndInfo.vehicle_id = "123321" + val position = Position(0, 399739429, 1164115207, 20) + val movingObjectInfo = MovingObjectInfo(0, position, 1800, 60) + cvxRvInfoIndInfo.basic_info = movingObjectInfo + addCvxRvInfoIndInfo(cvxRvInfoIndInfo)*/ + } /** @@ -75,7 +105,6 @@ class ObuRecognizedResultDrawer() { * 绘制 */ private fun drawerCvxRvInfo() { - //Logger.d(TAG, "drawerCvxRvInfo") // 数据为空的时候清除所有数据 if (mCvxRvInfoIndInfoMap.isEmpty()) { mMarkersCaches.forEach { @@ -85,6 +114,8 @@ class ObuRecognizedResultDrawer() { } else { // 循环绘制识别的数据 mCvxRvInfoIndInfoMap.forEach { + Logger.d(TAG, "drawerCvxRvInfo:${it.value}") + // 如果数据已经存在 Marker,取出做动画 if (mMarkersCaches[it.key] != null) { mMarkersCaches[it.key]?.let { it1 ->