badcase数据中类型修改,CAN数据转向灯解析为常开关量

This commit is contained in:
xinfengkun
2022-01-25 17:53:51 +08:00
parent 48a9840168
commit 74cd779a18
4 changed files with 54 additions and 10 deletions

View File

@@ -67,11 +67,19 @@ public class CarStateInfo implements Serializable {
//开始接收数据时间
private String startReceiverDataTime;
//时间延迟
private long timeDiff=0;
private long timeDiff = 0;
private int turn_light; //转向灯状态 0是正常 1是左转 2是右转
private int flash_light; //双闪灯状态
private int brake_light; //刹车灯状态
private int frame_num;//统计发包个数
/**
* 常开 常关 转向灯
* 0 --关
* 1 --左转
* 2 --右转
*/
private int turnLightOften = 0;
public int getFrame_num() {
return frame_num;
@@ -81,6 +89,14 @@ public class CarStateInfo implements Serializable {
this.frame_num = frame_num;
}
public int getTurnLightOften() {
return turnLightOften;
}
public void setTurnLightOften(int turnLightOften) {
this.turnLightOften = turnLightOften;
}
public long getTimeDiff() {
return timeDiff;
}
@@ -238,15 +254,17 @@ public class CarStateInfo implements Serializable {
", gnss_speed=" + gnss_speed +
", vehicle_speed=" + vehicle_speed +
", satelliteTime='" + satelliteTime + '\'' +
", utcTimeDiffer='" + utcTimeDiffer + '\'' +
", utcTimeDiffer=" + utcTimeDiffer +
", systemTime='" + systemTime + '\'' +
", receiverDataTime='" + receiverDataTime + '\'' +
", adasSatelliteTime='" + adasSatelliteTime + '\'' +
", startReceiverDataTime='" + startReceiverDataTime + '\'' +
", timeDiff=" + timeDiff +
", turn_light=" + turn_light +
", flash_light=" + flash_light +
", brake_light=" + brake_light +
", frame_num=" + frame_num +
", turnLightOften=" + turnLightOften +
'}';
}
}

View File

@@ -12,7 +12,7 @@ import java.util.List;
public class AutopilotRecordResult {
//磁盘可用空间M
@SerializedName("disk_free")
private Integer diskFree;
private Long diskFree;
//采集时长(秒)
@SerializedName("duration")
private double duration;
@@ -45,7 +45,7 @@ public class AutopilotRecordResult {
private String timestamp;
//此次数据总大小M
@SerializedName("total_size")
private Integer totalSize;
private Long totalSize;
//触发指令
@SerializedName("triggerinfo")
private Triggerinfo triggerinfo;
@@ -103,7 +103,7 @@ public class AutopilotRecordResult {
}
}
public Integer getDiskFree() {
public Long getDiskFree() {
return diskFree;
}
@@ -143,7 +143,7 @@ public class AutopilotRecordResult {
return timestamp;
}
public Integer getTotalSize() {
public Long getTotalSize() {
return totalSize;
}

View File

@@ -4,11 +4,8 @@ import com.google.gson.Gson;
import com.google.protobuf.InvalidProtocolBufferException;
import com.zhidao.support.adas.high.OnAdasListener;
import com.zhidao.support.adas.high.bean.CarStateInfo;
import com.zhidao.support.adas.high.common.BaseTimeUtils;
import com.zhidao.support.adas.high.common.CupidLogUtils;
import java.util.Date;
import mogo.status.CarStatus;
/**
@@ -44,6 +41,7 @@ public class UdpCarStateMessage extends MyAbstractMessageHandler {
CarStateInfo carStateInfo = new CarStateInfo();
carStateInfo.setAction("state");
CarStateInfo.ValuesBean values = new CarStateInfo.ValuesBean();
setTurnLightState(values);
values.setLon(status.getLon());
values.setLat(status.getLat());
values.setAlt(status.getAlt());
@@ -69,4 +67,31 @@ public class UdpCarStateMessage extends MyAbstractMessageHandler {
}
}
/**
* 解析转向灯
*/
private int turnLightTimes = 0;
private boolean isOnTurnLight = false;
public void setTurnLightState(CarStateInfo.ValuesBean values) {
int turnLight = 0;
int turn_light = values.getTurn_light();
if (turn_light == 0) {
if (isOnTurnLight) {
if (turnLightTimes >= 12) {
isOnTurnLight = false;
}
turnLightTimes++;
}
} else if (turn_light == 1) {
turnLightTimes = 0;
isOnTurnLight = true;
turnLight = 1;
} else if (turn_light == 2) {
turnLightTimes = 0;
isOnTurnLight = true;
turnLight = 2;
}
values.setTurnLightOften(turnLight);
}
}

View File

@@ -4,6 +4,7 @@ import android.content.Intent;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.util.Log;
import com.google.gson.Gson;
import com.zhidao.support.adas.high.OnAdasListener;
@@ -27,7 +28,7 @@ public class WsAutopilotIdentify extends MyAbstractMessageHandler {
@Override
public void handlerMsg(Gson gson, OnAdasListener adasListener, String msg) {
CupidLogUtils.w("WsAutopilotIdentify===>" + msg);
Log.i("WsAutopilotIdentify","WsAutopilotIdentify===>" + msg);
AutopilotIdentifyInfo info = gson.fromJson(msg, AutopilotIdentifyInfo.class);
AutopilotIdentifyInfo.Result result = info.getResult();
AutopilotRecordResult panel = result.getPanel();