[670][adas][data-center] FSM2024升级;SM2024数据解析兼容,如果RepeatedPilotNotStandbyReason没有数据将获取PilotNotStandbyReason赋值到RepeatedPilotNotStandbyReason中;老版本fsm2024 pb中没有beautiful_mode和beautiful_mode字段,域控给的新pb这两个字段标识符为required,当连接老板域控时将会解析包错,估修改为optional修饰

This commit is contained in:
xinfengkun
2024-09-25 14:59:52 +08:00
parent e5889a3af8
commit 45526304ba
8 changed files with 188 additions and 47 deletions

View File

@@ -1,7 +1,8 @@
package com.zhjt.mogo.adas.data.bean;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import java.util.List;
import java.util.Objects;
/**
@@ -40,28 +41,46 @@ public class UnableLaunchReason {
/**
* 來源
*/
@NonNull
public final SourceType source;
/**
* 影响启动自驾或启动平行驾驶的具体类型
*/
@NonNull
public final UnableType unableType;
/**
* 具體原因
* 只有 unableType==UnableType.FSM2024_OFFER unableLaunchReason 才会有多个,其他状态有且仅有一个
*/
public final String unableLaunchReason;
@NonNull
public final List<String> unableLaunchReason;
public UnableLaunchReason(SourceType source, UnableType unableType, String unableLaunchReason) {
public UnableLaunchReason(@NonNull SourceType source, @NonNull UnableType unableType, @NonNull List<String> unableLaunchReason) {
this.source = source;
this.unableType = unableType;
this.unableLaunchReason = unableLaunchReason;
}
public String getUnableLaunchReason() {
if (unableLaunchReason.isEmpty()) {
return "";
}
StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < unableLaunchReason.size(); i++) {
stringBuilder.append(unableLaunchReason.get(i));
if (i < unableLaunchReason.size() - 1) {
stringBuilder.append(" && ");
}
}
return stringBuilder.toString();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
UnableLaunchReason that = (UnableLaunchReason) o;
return source == that.source && unableType == that.unableType && TextUtils.equals(unableLaunchReason, that.unableLaunchReason);
return source == that.source && unableType == that.unableType && Objects.equals(unableLaunchReason, that.unableLaunchReason);
}
@Override