From dffef06340ee99c1d909b231f8af646784d0a6e5 Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Thu, 20 Oct 2022 18:28:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=A1=8C=E7=A8=8B=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zhidao/adas/client/ui/MainActivity.java | 6 ++++++ .../zhidao/adas/client/utils/Constants.java | 1 + .../autopilot/MoGoAutopilotProvider.kt | 12 +++++++++++ .../api/autopilot/IMoGoAutopilotProvider.kt | 10 ++++++++++ .../call/autopilot/CallerAutoPilotManager.kt | 12 +++++++++++ .../src/main/proto/message_pad.proto | 8 ++++---- .../zhidao/support/adas/high/AdasChannel.java | 20 +++++++++++++++++++ .../zhidao/support/adas/high/AdasManager.java | 13 ++++++++++++ .../support/adas/high/IAdasNetCommApi.java | 12 +++++++++++ .../support/adas/high/common/MessageType.java | 1 + 10 files changed, 91 insertions(+), 4 deletions(-) diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/MainActivity.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/MainActivity.java index 92d69df229..8bd832812b 100644 --- a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/MainActivity.java +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/MainActivity.java @@ -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; } } diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/utils/Constants.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/utils/Constants.java index 95052dc6b3..2ee184f5b2 100644 --- a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/utils/Constants.java +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/utils/Constants.java @@ -190,6 +190,7 @@ public class Constants { String SEND_DETOURING_OPEN = "绕障类功能开"; String SEND_DETOURING_CLOSE = "绕障类功能关"; String SEND_DETOURING_SPEED = "绕障速度阈值"; + String SEND_TRIP_INFO = "行程信息"; } diff --git a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutopilotProvider.kt b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutopilotProvider.kt index 02e192cb3c..850ad3c742 100644 --- a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutopilotProvider.kt +++ b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutopilotProvider.kt @@ -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) + } + /** * 发送工控机所有节点重启命令 */ diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotProvider.kt index d557a6fe7f..17c2717bce 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotProvider.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotProvider.kt @@ -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) } \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotManager.kt index c0c66f09a1..2a2d6de7d5 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotManager.kt @@ -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) + } + /** * 发送工控机所有节点重启命令 */ diff --git a/libraries/mogo-adas-data/src/main/proto/message_pad.proto b/libraries/mogo-adas-data/src/main/proto/message_pad.proto index f6a2111885..f66599735b 100644 --- a/libraries/mogo-adas-data/src/main/proto/message_pad.proto +++ b/libraries/mogo-adas-data/src/main/proto/message_pad.proto @@ -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 } diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasChannel.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasChannel.java index 7cc6b39a61..568bd1f4df 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasChannel.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasChannel.java @@ -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()); + } + } diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasManager.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasManager.java index 22eb4ec033..309cf44151 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasManager.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasManager.java @@ -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列表 * diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/IAdasNetCommApi.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/IAdasNetCommApi.java index ec5a0c170d..76722ecdef 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/IAdasNetCommApi.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/IAdasNetCommApi.java @@ -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(); diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/MessageType.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/MessageType.java index 98e5343365..38e3c5befa 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/MessageType.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/MessageType.java @@ -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决策状态");