From 9ac3f3b3eef533a4f8396112e08c2e4929525a03 Mon Sep 17 00:00:00 2001 From: aibingbing Date: Mon, 29 Aug 2022 16:47:26 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=B8=85=E6=89=AB=E8=BD=A6]=20feat:=20?= =?UTF-8?q?=E5=BA=95=E7=9B=98=E6=95=B0=E6=8D=AE=E5=9B=9E=E8=B0=83=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9C=80=E5=B0=8F=E6=97=B6=E9=97=B4=E9=97=B4?= =?UTF-8?q?=E9=9A=94=E5=88=A4=E6=96=AD=EF=BC=8C=E9=81=BF=E5=85=8D=E5=9B=9E?= =?UTF-8?q?=E8=B0=83=E5=A4=AA=E9=A2=91=E7=B9=81=E5=AF=BC=E8=87=B4=E9=98=BB?= =?UTF-8?q?=E5=A1=9E;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sweeper/ui/SweeperOperatePanelView.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/ui/SweeperOperatePanelView.java b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/ui/SweeperOperatePanelView.java index 6c46ee3609..5814cf8329 100644 --- a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/ui/SweeperOperatePanelView.java +++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/ui/SweeperOperatePanelView.java @@ -736,6 +736,11 @@ public class SweeperOperatePanelView extends LinearLayout { }); } + // 当前时间戳 + private long mCurrentTimeMillis; + // 底盘数据回调时间间隔 + private static final long VEHICLE_STATE_INTERVAL_MILLIS = 500L; + /** * 底盘数据透传listener */ @@ -774,6 +779,13 @@ public class SweeperOperatePanelView extends LinearLayout { @Override public void onSweeperFutianCleanSystemState(@NonNull VehicleStateOuterClass.SweeperFuTianCleanSystemState cleanSystemState) { + long current = System.currentTimeMillis(); + if (current - mCurrentTimeMillis <= VEHICLE_STATE_INTERVAL_MILLIS) { + return; + } + mCurrentTimeMillis = current; + + Log.d(TAG, "onSweeperFutianCleanSystemState"); // 第一次进入时同步底盘状态,只拿第一次的数据 if (mSyncingVehicleState) { onSyncVehicleStateCallBack(cleanSystemState); @@ -793,11 +805,12 @@ public class SweeperOperatePanelView extends LinearLayout { protected void onAttachedToWindow() { super.onAttachedToWindow(); CallerAutopilotVehicleStateListenerManager.INSTANCE.addListener(TAG, mIMoGoAutopilotVehicleStateListener); + // TODO 最终调试时需要打开 //syncVehicleStateAndRecoverOperatePanelStates(); // Mock VehicleState 数据回调 - // UiThreadHandler.postDelayed(() -> { - // onSyncVehicleStateCallBack(SweeperFutianCmdUtil.buildSweeperFuTionCleanSystemStateMockData()); - // }, 3000L); + // UiThreadHandler.postDelayed(() -> { + // onSyncVehicleStateCallBack(SweeperFutianCmdUtil.buildSweeperFuTionCleanSystemStateMockData()); + // }, 3000L); } @Override