Initial commit

This commit is contained in:
2025-05-13 19:24:51 +02:00
commit a950f49678
10604 changed files with 932663 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
package com.ubtrobot.jimu.exception;
import android.content.Context;
import com.ubtrobot.jimu.robotapi.R$string;
/* loaded from: classes2.dex */
public class BatteryException extends RobotActiveException {
public static final int CODE_VOLTAGE_HIGH = 1;
public static final int CODE_VOLTAGE_LOW = 0;
private int power;
public BatteryException(int i, int i2, String str) {
super(i, str);
this.power = i2;
}
public String getErrorMessage(Context context) {
int i = this.power;
if (i == 0) {
return context.getResources().getString(R$string.batter_low);
}
if (i == 1) {
return context.getResources().getString(R$string.batter_high);
}
return null;
}
public int getPowerCode() {
return this.power;
}
}

View File

@@ -0,0 +1,121 @@
package com.ubtrobot.jimu.exception;
import android.content.Context;
import com.ubtrobot.jimu.robotapi.R$string;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
/* loaded from: classes2.dex */
public class EngineProtectException extends RobotActiveException {
public static final int CODE_ELECTRICITY = 2;
public static final int CODE_FUSE_ENCRYPT = 64;
public static final int CODE_LOCK = 1;
public static final int CODE_OTHERS = 32;
public static final int CODE_OVER_VOLTAGE = 8;
public static final int CODE_TEMPERATURE = 4;
public static final int CODE_UNDER_VOLTAGE = 16;
private int engineType;
private Map<Integer, List<Integer>> errorMap;
public EngineProtectException(int i, String str, int i2, Map<Integer, List<Integer>> map) {
super(i, str);
this.engineType = i2;
this.errorMap = map;
}
private String getIdString(List<Integer> list) {
if (list == null || list.size() <= 0) {
return "";
}
StringBuilder sb = new StringBuilder();
for (int i = 0; i < list.size(); i++) {
sb.append(list.get(i));
if (i < list.size() - 1) {
sb.append(",");
}
}
return sb.toString();
}
public boolean canUnlock() {
return (getHigherExceptionCode() & 1) > 0;
}
public int getEngineType() {
return this.engineType;
}
public Map<Integer, List<Integer>> getErrorMap() {
return this.errorMap;
}
public List<Integer> getErrorMapByCode(int i) {
Map<Integer, List<Integer>> map = this.errorMap;
if (map == null || map.size() <= 0) {
return null;
}
return this.errorMap.get(Integer.valueOf(i));
}
public String getErrorMessage(Context context, int i, List<Integer> list) {
if (list == null || list.size() <= 0) {
return null;
}
String idString = getIdString(list);
int i2 = this.engineType;
if (i2 != 128) {
if (i2 != 10) {
return null;
}
if (i == 1) {
return String.format(context.getResources().getString(R$string.engine_protect_motor_lock), idString);
}
if (i != 32) {
return null;
}
return String.format(context.getResources().getString(R$string.engine_protect_motor_other), idString);
}
if (i == 1) {
return String.format(context.getResources().getString(R$string.engine_protect_lock), idString);
}
if (i != 2) {
if (i == 4) {
return String.format(context.getResources().getString(R$string.engine_protect_temp), idString);
}
if (i != 8 && i != 16) {
if (i == 32) {
return String.format(context.getResources().getString(R$string.engine_protect_other), idString);
}
if (i != 64) {
return null;
}
return String.format(context.getResources().getString(R$string.engine_protect_encrypt), idString);
}
}
return String.format(context.getResources().getString(R$string.engine_protect_electricity), idString);
}
public int getHigherExceptionCode() {
Map<Integer, List<Integer>> map = this.errorMap;
if (map == null || map.size() <= 0) {
return 0;
}
ArrayList arrayList = new ArrayList(this.errorMap.entrySet());
Collections.sort(arrayList, new Comparator() { // from class: com.ubtrobot.jimu.exception.a
@Override // java.util.Comparator
public final int compare(Object obj, Object obj2) {
int compareTo;
compareTo = ((Integer) ((Map.Entry) obj).getKey()).compareTo((Integer) ((Map.Entry) obj2).getKey());
return compareTo;
}
});
return ((Integer) ((Map.Entry) arrayList.get(0)).getKey()).intValue();
}
public boolean needHandUp() {
return getHigherExceptionCode() == 32 || getHigherExceptionCode() == 64;
}
}

View File

@@ -0,0 +1,21 @@
package com.ubtrobot.jimu.exception;
/* loaded from: classes2.dex */
public class EngineVersionException extends RobotActiveException {
private int mEngineType;
private int mInconformityId;
public EngineVersionException(int i, String str, int i2, int i3) {
super(i, str);
this.mInconformityId = i3;
this.mEngineType = i2;
}
public int getEngineType() {
return this.mEngineType;
}
public int getInconformityIds() {
return this.mInconformityId;
}
}

View File

@@ -0,0 +1,15 @@
package com.ubtrobot.jimu.exception;
/* loaded from: classes2.dex */
public class RobotActiveException extends Exception {
private int errorCode;
public RobotActiveException(int i, String str) {
super(str);
this.errorCode = i;
}
public int getErrorCode() {
return this.errorCode;
}
}