[Update]ADAS日志样式更新

This commit is contained in:
chenfufeng
2022-05-16 15:29:17 +08:00
parent 4396901fc2
commit 0fc07997df
4 changed files with 35 additions and 9 deletions

View File

@@ -75,6 +75,7 @@ class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener,
} else if (ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.NOT_FOUND_ADDRESS) {
CallerLogger.d("$M_ADAS_IMPL$TAG", "webSocket 找不到可用IP 传入的IP不可用或固定IP列表中所有IP不可用")
}
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().ipcConnStatus = ipcConnectionStatus
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().connectStatusDescribe=reason
CallerAutoPilotStatusListenerManager.invokeAutoPilotStatus()
}

View File

@@ -91,6 +91,7 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
private RecyclerView mConnectInfoRV;
private ConnInfoAdapter mConnAdapter;
private List<AutopilotStatusInfo> dataList = new ArrayList<>();
private int mLastStatus = 0x00;
private boolean isFloatingLayerHidden = false;
@Override
@@ -372,22 +373,31 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
@Override
public void onAutopilotStatusResponse(@NonNull AutopilotStatusInfo autoPilotStatusInfo) {
mConnectInfoRV.post(() -> updateConnectInfoView(autoPilotStatusInfo));
int status = autoPilotStatusInfo.getIpcConnStatus();
if (mLastStatus != status) {
AutopilotStatusInfo statusInfo = autoPilotStatusInfo.clone();
mConnectInfoRV.post(() -> updateConnectInfoView(statusInfo));
mLastStatus = status;
}
}
@Override
public void onAutopilotArriveAtStation(@Nullable MessagePad.ArrivalNotification arrivalNotification) {}
public void onAutopilotArriveAtStation(@Nullable MessagePad.ArrivalNotification arrivalNotification) {
}
@Override
public void onAutopilotGuardian(@Nullable MogoReportMsg.MogoReportMessage guardianInfo) {}
public void onAutopilotGuardian(@Nullable MogoReportMsg.MogoReportMessage guardianInfo) {
}
@Override
public void onAutopilotSNRequest() {}
public void onAutopilotSNRequest() {
}
private void updateConnectInfoView(@NonNull AutopilotStatusInfo autoPilotStatusInfo) {
if (!isFloatingLayerHidden) {// 遮罩层显示的时候
mConnAdapter.updateData(autoPilotStatusInfo);
mConnectInfoRV.scrollToPosition(mConnAdapter.getItemCount() - 1);
mLastStatus = autoPilotStatusInfo.getIpcConnStatus();
} else {// 遮罩层隐藏的时候
CallerAutoPilotStatusListenerManager.INSTANCE.removeListener(TAG);
}

View File

@@ -89,8 +89,10 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvConnectInfo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_width="1200px"
android:layout_height="680px"
android:layout_gravity="bottom"
/>
</FrameLayout>