[change] badcase 功能添加查询和接收配置接口,启动录制bag包接口加入前溯时间参数
This commit is contained in:
@@ -16,6 +16,7 @@ import com.zhidao.adas.client.bean.OriginalPointCloudData;
|
||||
import com.zhidao.adas.client.bean.PerceptionTrafficLight;
|
||||
import com.zhidao.adas.client.bean.PlanningObjects;
|
||||
import com.zhidao.adas.client.bean.PredictionObstacleTrajectory;
|
||||
import com.zhidao.adas.client.bean.RecordDataConfig;
|
||||
import com.zhidao.adas.client.bean.RecordPanel;
|
||||
import com.zhidao.adas.client.bean.StatusInfo;
|
||||
import com.zhidao.adas.client.bean.TrackedObjects;
|
||||
@@ -111,6 +112,7 @@ public class DataDistribution {
|
||||
public final List<String> listWarn = new ArrayList<>();
|
||||
public final List<String> listArrivalNotification = new ArrayList<>();
|
||||
public final List<String> listStatusInfo = new ArrayList<>();
|
||||
public final List<String> listRecordDataConfig = new ArrayList<>();
|
||||
public final List<String> listErrorData = new ArrayList<>();
|
||||
public final List<String> listPointCloud = new ArrayList<>();
|
||||
public final List<String> listOriginalPointCloud = new ArrayList<>();
|
||||
@@ -150,7 +152,7 @@ public class DataDistribution {
|
||||
if (listener != null && Constants.TITLE.RECEIVE_POINT_CLOUD.equals(listener.first)) {
|
||||
listener.second.onRefresh();
|
||||
}
|
||||
} else if (data instanceof OriginalPointCloudData) {
|
||||
} else if (data instanceof OriginalPointCloudData) {
|
||||
listOriginalPointCloud.add(0, time + str);
|
||||
if (listOriginalPointCloud.size() > LIST_SIZE) {
|
||||
listOriginalPointCloud.remove(listOriginalPointCloud.size() - 1);
|
||||
@@ -260,6 +262,14 @@ public class DataDistribution {
|
||||
if (listener != null && Constants.TITLE.RECEIVE_STATUS_QUERY_RESP.equals(listener.first)) {
|
||||
listener.second.onRefresh();
|
||||
}
|
||||
} else if (data instanceof RecordDataConfig) {
|
||||
listRecordDataConfig.add(0, time + str);
|
||||
if (listRecordDataConfig.size() > LIST_SIZE) {
|
||||
listRecordDataConfig.remove(listRecordDataConfig.size() - 1);
|
||||
}
|
||||
if (listener != null && Constants.TITLE.RECEIVE_RECORD_DATA_CONFIG_RESP.equals(listener.first)) {
|
||||
listener.second.onRefresh();
|
||||
}
|
||||
} else if (data instanceof ErrorData) {
|
||||
listErrorData.add(0, time + str);
|
||||
if (listErrorData.size() > 100) {
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.zhidao.adas.client.bean;
|
||||
|
||||
import com.google.protobuf.TextFormat;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
public class RecordDataConfig extends BaseInfo {
|
||||
public final MessagePad.RecordDataConfig bean;
|
||||
|
||||
public RecordDataConfig(MessagePad.Header header, MessagePad.RecordDataConfig bean, SimpleDateFormat sdf) {
|
||||
super("接收", bean.getSerializedSize(), header, sdf);
|
||||
this.bean = bean;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
|
||||
}
|
||||
}
|
||||
@@ -115,8 +115,10 @@ public class InfoFragment extends BaseFragment {
|
||||
adapter.setData(DataDistribution.getInstance().listTrajectory);
|
||||
} else if (Constants.TITLE.RECEIVE_ARRIVAL_NOTIFICATION.equals(title)) {
|
||||
adapter.setData(DataDistribution.getInstance().listArrivalNotification);
|
||||
} else if (Constants.TITLE.RECEIVE_STATUS_QUERY_RESP.equals(title)){
|
||||
} else if (Constants.TITLE.RECEIVE_STATUS_QUERY_RESP.equals(title)) {
|
||||
adapter.setData(DataDistribution.getInstance().listStatusInfo);
|
||||
} else if (Constants.TITLE.RECEIVE_RECORD_DATA_CONFIG_RESP.equals(title)) {
|
||||
adapter.setData(DataDistribution.getInstance().listRecordDataConfig);
|
||||
} else if (Constants.TITLE.RECEIVE_GLOBAL_PATH_RESP.equals(title)) {
|
||||
adapter.setData(DataDistribution.getInstance().listGlobalPathResp);
|
||||
} else if (Constants.TITLE.RECEIVE_RECORD_RESULT.equals(title)) {
|
||||
@@ -129,11 +131,11 @@ public class InfoFragment extends BaseFragment {
|
||||
adapter.setData(DataDistribution.getInstance().listPredictionObstacleTrajectory);
|
||||
} else if (Constants.TITLE.RECEIVE_POINT_CLOUD.equals(title)) {
|
||||
adapter.setData(DataDistribution.getInstance().listPointCloud);
|
||||
}else if (Constants.TITLE.RECEIVE_POINT_CLOUD_ORIGINAL.equals(title)) {
|
||||
} else if (Constants.TITLE.RECEIVE_POINT_CLOUD_ORIGINAL.equals(title)) {
|
||||
adapter.setData(DataDistribution.getInstance().listOriginalPointCloud);
|
||||
} else if (Constants.TITLE.RECEIVE_PLANNING_OBJECTS.equals(title)) {
|
||||
adapter.setData(DataDistribution.getInstance().listPlanningObjects);
|
||||
}else{
|
||||
} else {
|
||||
adapter.setData(DataDistribution.getInstance().listErrorData);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,6 +71,7 @@ import com.zhidao.adas.client.bean.OriginalPointCloudData;
|
||||
import com.zhidao.adas.client.bean.PerceptionTrafficLight;
|
||||
import com.zhidao.adas.client.bean.PlanningObjects;
|
||||
import com.zhidao.adas.client.bean.PredictionObstacleTrajectory;
|
||||
import com.zhidao.adas.client.bean.RecordDataConfig;
|
||||
import com.zhidao.adas.client.bean.RecordPanel;
|
||||
import com.zhidao.adas.client.bean.StatusInfo;
|
||||
import com.zhidao.adas.client.bean.TrackedObjects;
|
||||
@@ -623,6 +624,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_POINT_CLOUD_ORIGINAL);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_PLANNING_OBJECTS);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_CAR_CONFIG_RESP);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_RECORD_DATA_CONFIG_RESP);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_RECORD_RESULT);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_GLOBAL_PATH_RESP);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_ARRIVAL_NOTIFICATION);
|
||||
@@ -635,6 +637,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
titleBtnData.add(Constants.TITLE.SEND_GLOBAL_PATH_REQ);
|
||||
titleBtnData.add(Constants.TITLE.SEND_STATUS_QUERY_REQ);
|
||||
titleBtnData.add(Constants.TITLE.SEND_BASIC_INFO_RESP);
|
||||
titleBtnData.add(Constants.TITLE.SEND_RECORD_DATA_CONFIG_RESP);
|
||||
titleBtnData.add(Constants.TITLE.SEND_RECORD_DATA_5);
|
||||
titleBtnData.add(Constants.TITLE.SEND_RECORD_DATA_START);
|
||||
titleBtnData.add(Constants.TITLE.SEND_RECORD_DATA_END);
|
||||
@@ -918,6 +921,12 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
DataDistribution.getInstance().addData(base);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecordDataConfigResp(MessagePad.Header header, MessagePad.RecordDataConfig config) {
|
||||
RecordDataConfig base = new RecordDataConfig(header, config, sdf);
|
||||
DataDistribution.getInstance().addData(base);
|
||||
}
|
||||
|
||||
|
||||
private void initAdas() {
|
||||
CupidLogUtils.e(TAG, "--->初始化");
|
||||
@@ -1141,7 +1150,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
break;
|
||||
case Constants.TITLE.SEND_RECORD_DATA_5:
|
||||
//数据采集5秒
|
||||
boolean b = AdasManager.getInstance().startRecordPackage(1, 5, 1);
|
||||
boolean b = AdasManager.getInstance().startRecordPackage(1, 5, 1, 2);
|
||||
CupidLogUtils.w(TAG, "AutopilotRecord===>send:" + b);
|
||||
break;
|
||||
case Constants.TITLE.SEND_RECORD_DATA_START:
|
||||
@@ -1230,6 +1239,10 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
//关闭雨天模式
|
||||
AdasManager.getInstance().sendRainModeReq(0);
|
||||
break;
|
||||
case Constants.TITLE.SEND_RECORD_DATA_CONFIG_RESP:
|
||||
//关闭雨天模式
|
||||
AdasManager.getInstance().sendRecordDataConfigReq();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -165,6 +165,7 @@ public class Constants {
|
||||
String TITLE_CAR_CONFIG_RESP = "工控机版本\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t固定IP配置";
|
||||
String RECEIVE_CAR_CONFIG_RESP = "信息与配置";
|
||||
String RECEIVE_RECORD_RESULT = MessageType.TYPE_RECEIVE_RECORD_RESULT.desc;
|
||||
String RECEIVE_RECORD_DATA_CONFIG_RESP = MessageType.TYPE_RECEIVE_RECORD_DATA_CONFIG_RESP.desc;
|
||||
String RECEIVE_GLOBAL_PATH_RESP = MessageType.TYPE_RECEIVE_GLOBAL_PATH_RESP.desc;
|
||||
String RECEIVE_WARN = MessageType.TYPE_RECEIVE_WARN.desc;
|
||||
String RECEIVE_ARRIVAL_NOTIFICATION = MessageType.TYPE_RECEIVE_ARRIVAL_NOTIFICATION.desc;
|
||||
@@ -172,22 +173,22 @@ public class Constants {
|
||||
String RECEIVE_ERROR = "错误数据";
|
||||
|
||||
|
||||
|
||||
String SEND_SET_AUTOPILOT_MODE_REQ="自动驾驶模式";
|
||||
String SEND_GLOBAL_PATH_REQ="自动驾驶路径查询";
|
||||
String SEND_STATUS_QUERY_REQ="状态查询";
|
||||
String SEND_BASIC_INFO_RESP="下发SN";
|
||||
String SEND_RECORD_DATA_5="数据采集5秒";
|
||||
String SEND_RECORD_DATA_START="数据采集Start";
|
||||
String SEND_RECORD_DATA_END="数据采集End";
|
||||
String SEND_TRAFFIC_LIGHT_DATA="发送信号灯";
|
||||
String SEND_SET_AUTOPILOT_SPEED_REQ="自动驾驶限速";
|
||||
String SEND_SYSTEM_CMD_REQ_REBOOT="重启所有节点";
|
||||
String SEND_RECORD_CAUSE="采集类型";
|
||||
String SEND_SET_DEMO_MODE_REQ_OPEN="打开演示模式";
|
||||
String SEND_SET_DEMO_MODE_REQ_CLOSE="关闭演示模式";
|
||||
String SEND_SET_RAIN_MODE_REQ_OPEN="打开雨天模式";
|
||||
String SEND_SET_RAIN_MODE_REQ_CLOSE="关闭雨天模式";
|
||||
String SEND_SET_AUTOPILOT_MODE_REQ = "自动驾驶模式";
|
||||
String SEND_GLOBAL_PATH_REQ = "自动驾驶路径查询";
|
||||
String SEND_STATUS_QUERY_REQ = "状态查询";
|
||||
String SEND_BASIC_INFO_RESP = "下发SN";
|
||||
String SEND_RECORD_DATA_5 = "数据采集5秒";
|
||||
String SEND_RECORD_DATA_START = "数据采集Start";
|
||||
String SEND_RECORD_DATA_END = "数据采集End";
|
||||
String SEND_TRAFFIC_LIGHT_DATA = "发送信号灯";
|
||||
String SEND_SET_AUTOPILOT_SPEED_REQ = "自动驾驶限速";
|
||||
String SEND_SYSTEM_CMD_REQ_REBOOT = "重启所有节点";
|
||||
String SEND_RECORD_CAUSE = "采集类型";
|
||||
String SEND_SET_DEMO_MODE_REQ_OPEN = "打开演示模式";
|
||||
String SEND_SET_DEMO_MODE_REQ_CLOSE = "关闭演示模式";
|
||||
String SEND_SET_RAIN_MODE_REQ_OPEN = "打开雨天模式";
|
||||
String SEND_SET_RAIN_MODE_REQ_CLOSE = "关闭雨天模式";
|
||||
String SEND_RECORD_DATA_CONFIG_RESP = "数据采集配置";
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package mogo.telematics.pad;
|
||||
|
||||
enum ProtocolVersion{
|
||||
Defaultver = 0;
|
||||
CurrentVersion = 3; //每次修改proto文件增加1
|
||||
CurrentVersion = 4; //每次修改proto文件增加1
|
||||
}
|
||||
|
||||
enum MessageType
|
||||
@@ -20,6 +20,7 @@ enum MessageType
|
||||
MsgTypePredictionObstacleTrajectory = 0x10007; //他车轨迹预测
|
||||
MsgTypePointCloud = 0x10008; //点云透传
|
||||
MsgTypePlanningObjects = 0x10009; //planning障碍物
|
||||
MsgTypeOBU = 0x1000a; //OBU
|
||||
|
||||
MsgTypeBasicInfoReq = 0x10100; //自动驾驶设备基础信息请求
|
||||
MsgTypeBasicInfoResp = 0x10101; //自动驾驶设备基础信息应答
|
||||
@@ -41,6 +42,8 @@ enum MessageType
|
||||
MsgTypeStatusQueryReq = 0x10111; //状态查询请求
|
||||
MsgTypeStatusQueryResp = 0x10112; //状态查询应答
|
||||
MsgTypeSetRainModeReq = 0x10113; //设置雨天模式
|
||||
MsgTypeRecordDataConfigReq = 0x10114; //数据采集配置查询请求
|
||||
MsgTypeRecordDataConfigResp = 0x10115; //数据采集配置查询应答
|
||||
}
|
||||
|
||||
message Header
|
||||
@@ -150,6 +153,9 @@ message PlanningObjects
|
||||
repeated PlanningObject objs = 1;
|
||||
}
|
||||
|
||||
// message definition for MessageType: MsgTypeOBU
|
||||
// refer to obu.proto
|
||||
|
||||
// message definition for MsgTypeTrajectoryDownloadReq
|
||||
message Line
|
||||
{
|
||||
@@ -250,6 +256,7 @@ message RecordData
|
||||
uint32 type = 3; //采集类型, 1:badcase, 2: map; 3: rests
|
||||
bool isRecord = 4; //采集指令, true: 采集, false: 停止采集
|
||||
bool sustain = 5; //是否持续采集
|
||||
uint32 bduration = 6; //前溯时长
|
||||
}
|
||||
|
||||
// message definition for MsgTypeRecordResult
|
||||
@@ -299,7 +306,7 @@ message TrafficLightData
|
||||
int32 arrowNo = 8; //当前车道对应地面要素转向
|
||||
int32 flashYellow = 9; //黄灯总时间
|
||||
TrafficLightDetail laneDetail = 10; //灯态具体信息
|
||||
uint64 timestamp =11;//当前卫星时间, 单位: ms
|
||||
uint64 timestamp = 11;//当前卫星时间, 单位: ms
|
||||
}
|
||||
|
||||
// message definition for MsgTypeWarn
|
||||
@@ -345,3 +352,21 @@ message SetRainModeReq
|
||||
uint32 enable = 1; //1: enable, 0: disable
|
||||
}
|
||||
|
||||
// message definition for MsgTypeRecordDataConfigReq
|
||||
message RecordDataConfigReq
|
||||
{
|
||||
uint32 reqType = 1; // 0: all, 其他保留
|
||||
}
|
||||
|
||||
// message definition for MsgTypeRecordDataConfigResp
|
||||
message RecordDataType
|
||||
{
|
||||
uint32 id = 1; //采集类型id
|
||||
string desc = 2; //采集类型描述
|
||||
}
|
||||
|
||||
message RecordDataConfig
|
||||
{
|
||||
repeated RecordDataType recordTypes = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,4 +14,4 @@ message MogoPointCloud
|
||||
optional double self_yaw = 7;
|
||||
repeated uint32 del_data = 8 [packed=true];
|
||||
repeated double add_data = 9 [packed=true];
|
||||
}
|
||||
}
|
||||
|
||||
17
libraries/mogo-adas-data/src/main/proto/obu.proto
Normal file
17
libraries/mogo-adas-data/src/main/proto/obu.proto
Normal file
@@ -0,0 +1,17 @@
|
||||
syntax = "proto3";
|
||||
package mogo.telematics.pad;
|
||||
//第三方OBU接入
|
||||
|
||||
import "header.proto";
|
||||
|
||||
enum Type{
|
||||
Default = 0;
|
||||
DF_OBU = 1;//宜宾东风OBU msg格式:Json字符串
|
||||
}
|
||||
message Obu
|
||||
{
|
||||
common.Header header = 1;
|
||||
Type type = 2;//第三方类型 目前只有东风OBU
|
||||
bytes msg = 3;//OBU 数据
|
||||
}
|
||||
|
||||
@@ -729,17 +729,22 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
|
||||
@Override
|
||||
public boolean startRecordPackage(int id, int type) {
|
||||
return sendRecordData(id, 0, type, true);
|
||||
return sendRecordData(id, 0, type, true, -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startRecordPackage(int id, int duration, int type) {
|
||||
return sendRecordData(id, duration, type, true);
|
||||
return sendRecordData(id, duration, type, true, -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startRecordPackage(int id, int duration, int type, int bduration) {
|
||||
return sendRecordData(id, duration, type, true, bduration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean stopRecordPackage(int id, int type) {
|
||||
return sendRecordData(id, 0, type, false);
|
||||
return sendRecordData(id, 0, type, false, -1);
|
||||
}
|
||||
|
||||
|
||||
@@ -747,14 +752,16 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
* 数据采集请求 主动录制Bag包
|
||||
* sustain为true时 duration无效
|
||||
*
|
||||
* @param id 采集id
|
||||
* @param duration 采集时间长 Max:5*60 秒
|
||||
* @param type 采集类型, 1:badCase, 2: map; 3: rests
|
||||
* @param isRecord 采集指令, true: 采集, false: 停止采集
|
||||
* @param id 采集id
|
||||
* @param duration 采集时间长 Max:5*60 秒
|
||||
* @param type 采集类型, 1:badCase, 2: map; 3: rests
|
||||
* @param isRecord 采集指令, true: 采集, false: 停止采集
|
||||
* @param bduration 前溯时长
|
||||
* @param sustain 是否持续采集
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendRecordData(int id, int duration, int type, boolean isRecord) {
|
||||
public boolean sendRecordData(int id, int duration, int type, boolean isRecord, int bduration) {
|
||||
boolean sustain = false;
|
||||
if (isRecord) {
|
||||
if (duration <= 0) {
|
||||
@@ -762,14 +769,17 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
sustain = true;
|
||||
}
|
||||
}
|
||||
MessagePad.RecordData req = MessagePad.RecordData
|
||||
MessagePad.RecordData.Builder builder = MessagePad.RecordData
|
||||
.newBuilder()
|
||||
.setId(id)
|
||||
.setDuration(duration)
|
||||
.setType(type)
|
||||
.setIsRecord(isRecord)
|
||||
.setSustain(sustain)
|
||||
.build();
|
||||
.setSustain(sustain);
|
||||
if (bduration > -1) {
|
||||
builder.setBduration(bduration);
|
||||
}
|
||||
MessagePad.RecordData req = builder.build();
|
||||
return sendPBMessage(MessageType.TYPE_SEND_RECORD_DATA.typeCode, req.toByteArray());
|
||||
}
|
||||
|
||||
@@ -921,5 +931,19 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
.build();
|
||||
return sendPBMessage(MessageType.TYPE_SEND_SET_RAIN_MODE_REQ.typeCode, req.toByteArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据采集配置查询
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendRecordDataConfigReq() {
|
||||
MessagePad.RecordDataConfigReq req = MessagePad.RecordDataConfigReq
|
||||
.newBuilder()
|
||||
.setReqType(0)
|
||||
.build();
|
||||
return sendPBMessage(MessageType.TYPE_SEND_RECORD_DATA_CONFIG_REQ.typeCode, req.toByteArray());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -342,6 +342,18 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
return mChannel != null && mChannel.startRecordPackage(id, duration, type);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同下
|
||||
*
|
||||
* @param id
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean startRecordPackage(int id, int duration, int type, int bduration) {
|
||||
return mChannel != null && mChannel.startRecordPackage(id, duration, type, bduration);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同下
|
||||
*
|
||||
@@ -357,16 +369,16 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
/**
|
||||
* 数据采集请求 主动录制Bag包
|
||||
*
|
||||
* @param id 采集id
|
||||
* @param duration 采集时间长
|
||||
* @param type 采集类型, 1:badcase, 2: map; 3: rests
|
||||
* @param isRecord 采集指令, true: 采集, false: 停止采集
|
||||
* @param sustain 是否持续采集
|
||||
* @return
|
||||
* @param id 采集id
|
||||
* @param duration 采集时间长
|
||||
* @param type 采集类型, 1:badcase, 2: map; 3: rests
|
||||
* @param isRecord 采集指令, true: 采集, false: 停止采集
|
||||
* @param bduration 前溯时长
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendRecordData(int id, int duration, int type, boolean isRecord) {
|
||||
return mChannel != null && mChannel.sendRecordData(id, duration, type, isRecord);
|
||||
public boolean sendRecordData(int id, int duration, int type, boolean isRecord, int bduration) {
|
||||
return mChannel != null && mChannel.sendRecordData(id, duration, type, isRecord, bduration);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -456,6 +468,16 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
return mChannel != null && mChannel.sendRainModeReq(enable);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据采集配置查询
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendRecordDataConfigReq() {
|
||||
return mChannel != null && mChannel.sendRecordDataConfigReq();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工控机固定IP列表
|
||||
*
|
||||
|
||||
@@ -116,6 +116,17 @@ public interface IAdasNetCommApi {
|
||||
*/
|
||||
boolean startRecordPackage(int id, int duration, int type);
|
||||
|
||||
/**
|
||||
* 同下
|
||||
*
|
||||
* @param id
|
||||
* @param duration
|
||||
* @param type
|
||||
* @param bduration
|
||||
* @return
|
||||
*/
|
||||
boolean startRecordPackage(int id, int duration, int type, int bduration);
|
||||
|
||||
/**
|
||||
* 同下
|
||||
*
|
||||
@@ -128,13 +139,14 @@ public interface IAdasNetCommApi {
|
||||
/**
|
||||
* 数据采集请求 主动录制Bag包
|
||||
*
|
||||
* @param id 采集id
|
||||
* @param duration 采集时间长
|
||||
* @param type 采集类型, 1:badcase, 2: map; 3: rests
|
||||
* @param isRecord 采集指令, true: 采集, false: 停止采集
|
||||
* @param id 采集id
|
||||
* @param duration 采集时间长
|
||||
* @param type 采集类型, 1:badcase, 2: map; 3: rests
|
||||
* @param isRecord 采集指令, true: 采集, false: 停止采集
|
||||
* @param bduration 前溯时长
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendRecordData(int id, int duration, int type, boolean isRecord);
|
||||
boolean sendRecordData(int id, int duration, int type, boolean isRecord, int bduration);
|
||||
|
||||
/**
|
||||
* 设置自动驾驶最大速度
|
||||
@@ -203,6 +215,15 @@ public interface IAdasNetCommApi {
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendRainModeReq(int enable);
|
||||
|
||||
/**
|
||||
* 数据采集配置查询
|
||||
* 0: all, 其他保留
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendRecordDataConfigReq();
|
||||
|
||||
// TODO 需求暂停 待讨论
|
||||
// boolean getRoutes();
|
||||
|
||||
|
||||
@@ -171,6 +171,14 @@ public interface OnAdasListener {
|
||||
*/
|
||||
void onStatusQueryResp(MessagePad.Header header, SystemStatusInfo.StatusInfo statusInfo);
|
||||
|
||||
/**
|
||||
* 数据采集配置应答
|
||||
*
|
||||
* @param header 头
|
||||
* @param config 数据
|
||||
*/
|
||||
void onRecordDataConfigResp(MessagePad.Header header, MessagePad.RecordDataConfig config);
|
||||
|
||||
/**
|
||||
* 数据错误
|
||||
*
|
||||
|
||||
@@ -43,7 +43,9 @@ public enum MessageType {
|
||||
TYPE_SEND_TRAJECTORY_DOWNLOAD_REQ(MessagePad.MessageType.MsgTypeTrajectoryDownloadReq, "轨迹下载请求"),
|
||||
TYPE_SEND_STATUS_QUERY_REQ(MessagePad.MessageType.MsgTypeStatusQueryReq, "状态查询请求"),
|
||||
TYPE_RECEIVE_STATUS_QUERY_RESP(MessagePad.MessageType.MsgTypeStatusQueryResp, "状态查询应答"),
|
||||
TYPE_SEND_SET_RAIN_MODE_REQ(MessagePad.MessageType.MsgTypeSetRainModeReq, "设置雨天模式");
|
||||
TYPE_SEND_SET_RAIN_MODE_REQ(MessagePad.MessageType.MsgTypeSetRainModeReq, "设置雨天模式"),
|
||||
TYPE_SEND_RECORD_DATA_CONFIG_REQ(MessagePad.MessageType.MsgTypeRecordDataConfigReq, "数据采集配置查询"),
|
||||
TYPE_RECEIVE_RECORD_DATA_CONFIG_RESP(MessagePad.MessageType.MsgTypeRecordDataConfigResp, "数据采集配置");
|
||||
|
||||
/**
|
||||
* 消息action code
|
||||
|
||||
@@ -29,6 +29,7 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
private IMsg warnMessage;//预警数据
|
||||
private IMsg arrivalNotificationMessage;//到站提醒
|
||||
private IMsg statusQueryRespMessage;//状态查询应答
|
||||
private IMsg recordDataConfigRespMessage;//数据采集配置应答
|
||||
|
||||
|
||||
@Override
|
||||
@@ -135,6 +136,12 @@ public class MyMessageFactory implements IMyMessageFactory {
|
||||
statusQueryRespMessage = new StatusQueryRespMessage();
|
||||
}
|
||||
return statusQueryRespMessage;
|
||||
} else if (messageType == MessageType.TYPE_RECEIVE_RECORD_DATA_CONFIG_RESP.typeCode) {
|
||||
//数据采集配置应答
|
||||
if (recordDataConfigRespMessage == null) {
|
||||
recordDataConfigRespMessage = new RecordDataConfigRespMessage();
|
||||
}
|
||||
return recordDataConfigRespMessage;
|
||||
} else {
|
||||
//MessageType.TYPE_DEFAULT.typeCode
|
||||
return null;
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.zhidao.support.adas.high.msg;
|
||||
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.protocol.RawData;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
/**
|
||||
* 数据采集配置应答
|
||||
*/
|
||||
public class RecordDataConfigRespMessage extends MyAbstractMessageHandler {
|
||||
|
||||
@Override
|
||||
public void handlerMsg(RawData raw, OnAdasListener adasListener) throws InvalidProtocolBufferException {
|
||||
MessagePad.RecordDataConfig config = MessagePad.RecordDataConfig.parser().parseFrom(raw.originalData.toByteArray(), raw.getOffsetValue(), raw.getPackageLengthValue() - raw.getOffsetValue());
|
||||
if (adasListener != null) {
|
||||
adasListener.onRecordDataConfigResp(raw.getHeader(), config);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user