添加行程信息接口
This commit is contained in:
@@ -651,6 +651,8 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
titleBtnData.add(Constants.TITLE.SEND_DETOURING_OPEN);
|
||||
titleBtnData.add(Constants.TITLE.SEND_DETOURING_CLOSE);
|
||||
titleBtnData.add(Constants.TITLE.SEND_DETOURING_SPEED);
|
||||
titleBtnData.add(Constants.TITLE.SEND_TRIP_INFO);
|
||||
|
||||
}
|
||||
|
||||
private void initBtnRecyclerView() {
|
||||
@@ -1364,6 +1366,10 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
//绕障速度设置
|
||||
showDetouringSpeedDialog();
|
||||
break;
|
||||
case Constants.TITLE.SEND_TRIP_INFO:
|
||||
//行程信息
|
||||
AdasManager.getInstance().sendTripInfoReq(1, "", "", false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -190,6 +190,7 @@ public class Constants {
|
||||
String SEND_DETOURING_OPEN = "绕障类功能开";
|
||||
String SEND_DETOURING_CLOSE = "绕障类功能关";
|
||||
String SEND_DETOURING_SPEED = "绕障速度阈值";
|
||||
String SEND_TRIP_INFO = "行程信息";
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -558,6 +558,18 @@ class MoGoAutopilotProvider :
|
||||
AdasManager.getInstance().sendOperatorCmdSetHorn(value)
|
||||
}
|
||||
|
||||
/**
|
||||
* 行程信息
|
||||
* @param type 事件类型, 1:行程开始, 2:行程结束, 3:出站, 4:进站, 5:城市占道施工预警
|
||||
* @param lineName 路线名, for type 1, 2
|
||||
* @param stopName 站点名, for type 3, 4
|
||||
* @param isLastStop
|
||||
* @return
|
||||
*/
|
||||
override fun sendTripInfo(type: Int, lineName: String, stopName: String, isLastStop: Boolean) {
|
||||
AdasManager.getInstance().sendTripInfoReq(type, lineName, stopName, isLastStop)
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送工控机所有节点重启命令
|
||||
*/
|
||||
|
||||
@@ -247,4 +247,14 @@ interface IMoGoAutopilotProvider : IMoGoFunctionServerProvider {
|
||||
* 鸣笛 开始:1,结束:2
|
||||
*/
|
||||
fun sendOperatorSetHorn(value: Double)
|
||||
|
||||
/**
|
||||
* 行程信息
|
||||
* @param type 事件类型, 1:行程开始, 2:行程结束, 3:出站, 4:进站, 5:城市占道施工预警
|
||||
* @param lineName 路线名, for type 1, 2
|
||||
* @param stopName 站点名, for type 3, 4
|
||||
* @param isLastStop 是否是最后一站
|
||||
* @return
|
||||
*/
|
||||
fun sendTripInfo(type: Int, lineName: String, stopName: String, isLastStop: Boolean)
|
||||
}
|
||||
@@ -285,6 +285,18 @@ object CallerAutoPilotManager {
|
||||
providerApi?.sendOperatorSetHorn(value)
|
||||
}
|
||||
|
||||
/**
|
||||
* 行程信息
|
||||
* @param type 事件类型, 1:行程开始, 2:行程结束, 3:出站, 4:进站, 5:城市占道施工预警
|
||||
* @param lineName 路线名, for type 1, 2
|
||||
* @param stopName 站点名, for type 3, 4
|
||||
* @param isLastStop 是否终点站
|
||||
* @return
|
||||
*/
|
||||
fun sendTripInfo(type: Int, lineName: String, stopName: String, isLastStop: Boolean) {
|
||||
providerApi?.sendTripInfo(type, lineName, stopName, isLastStop)
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送工控机所有节点重启命令
|
||||
*/
|
||||
|
||||
@@ -488,10 +488,10 @@ message SetParamReq
|
||||
//message definition for MsgTypeTripInfoEvent
|
||||
message TripInfoEvent
|
||||
{
|
||||
uint32 type = 1; //事件类型, 1:行程开始, 2:出站, 3:进站, 4:城市占道施工预警
|
||||
string lineName = 2; //路线名, for type 1
|
||||
string stopName = 3; //站点名, for type 2, 3
|
||||
bool isLastStop = 4; //是否最终站, for type 2, 3
|
||||
uint32 type = 1; //事件类型, 1:行程开始, 2:行程结束, 3:出站, 4:进站, 5:城市占道施工预警
|
||||
string lineName = 2; //路线名, for type 1, 2
|
||||
string stopName = 3; //站点名, for type 3, 4
|
||||
bool isLastStop = 4; //是否最终站, for type 3, 4
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1264,5 +1264,25 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
return sendSetParamReq(2, String.valueOf(speed));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type 事件类型, 1:行程开始, 2:行程结束, 3:出站, 4:进站, 5:城市占道施工预警
|
||||
* @param lineName 路线名, for type 1, 2
|
||||
* @param stopName 站点名, for type 3, 4
|
||||
* @param isLastStop
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean sendTripInfoReq(int type, String lineName, String stopName, boolean isLastStop) {
|
||||
MessagePad.TripInfoEvent req = MessagePad.TripInfoEvent
|
||||
.newBuilder()
|
||||
.setType(type)
|
||||
.setLineName(lineName)
|
||||
.setStopName(stopName)
|
||||
.setIsLastStop(isLastStop)
|
||||
.build();
|
||||
return sendPBMessage(MessageType.TYPE_SEND_TRIP_INFO_REQ.typeCode, req.toByteArray());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -653,6 +653,19 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
return mChannel != null && mChannel.sendDetouringSpeed(speed);
|
||||
}
|
||||
|
||||
/**
|
||||
* 行程信息
|
||||
* @param type 事件类型, 1:行程开始, 2:行程结束, 3:出站, 4:进站, 5:城市占道施工预警
|
||||
* @param lineName 路线名, for type 1, 2
|
||||
* @param stopName 站点名, for type 3, 4
|
||||
* @param isLastStop 是否终点站
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean sendTripInfoReq(int type, String lineName, String stopName, boolean isLastStop) {
|
||||
return mChannel != null && mChannel.sendTripInfoReq(type,lineName,stopName,isLastStop);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工控机固定IP列表
|
||||
*
|
||||
|
||||
@@ -379,6 +379,18 @@ public interface IAdasNetCommApi {
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendDetouringSpeed(double speed);
|
||||
|
||||
/**
|
||||
* 发生行程相关
|
||||
*
|
||||
* @param type 事件类型, 1:行程开始, 2:行程结束, 3:出站, 4:进站, 5:城市占道施工预警
|
||||
* @param lineName 路线名, for type 1, 2
|
||||
* @param stopName 站点名, for type 3, 4
|
||||
* @return boolean 是否最终站, for type 3, 4
|
||||
*/
|
||||
boolean sendTripInfoReq(int type, String lineName, String stopName, boolean isLastStop);
|
||||
|
||||
|
||||
// TODO 需求暂停 待讨论
|
||||
// boolean getRoutes();
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ public enum MessageType {
|
||||
TYPE_RECEIVE_RECORD_DATA_CONFIG_RESP(MessagePad.MessageType.MsgTypeRecordDataConfigResp, "数据采集配置"),
|
||||
TYPE_SEND_SUBSCRIBE_DATA_REQ(MessagePad.MessageType.MsgTypeSubscribeDataReq, "数据订阅、取消订阅请求"),
|
||||
TYPE_SEND_SET_PARAM_REQ(MessagePad.MessageType.MsgTypeSetParamReq, "设置参数命令"),
|
||||
TYPE_SEND_TRIP_INFO_REQ(MessagePad.MessageType.MsgTypeTripInfoEvent, "行程信息"),
|
||||
//透传 原始pb文件中不存在以下type。由于Java中无法强转所以在mogo-adas-data message_pad.proto中放开注释
|
||||
TYPE_RECEIVE_PLANNING_DECISION_STATE(MessagePad.MessageType.MsgTypePlanningDecisionState, "Planning决策状态");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user