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