接入最优路线推荐 数据通道
This commit is contained in:
@@ -9,6 +9,7 @@ import com.mogo.module.v2x.listener.V2XMessageListener_401009;
|
||||
import com.mogo.module.v2x.listener.V2XMessageListener_401010;
|
||||
import com.mogo.module.v2x.listener.V2XMessageListener_401011;
|
||||
import com.mogo.module.v2x.listener.V2XMessageListener_401012;
|
||||
import com.mogo.module.v2x.listener.V2XMessageListener_401019;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
|
||||
@@ -32,6 +33,7 @@ public class V2XSocketManager {
|
||||
private V2XMessageListener_401007 v2XMessageListener_401007;
|
||||
private V2XMessageListener_401009 v2XMessageListener_401009;
|
||||
private V2XMessageListener_401010 v2XMessageListener_401010;
|
||||
private V2XMessageListener_401019 v2XMessageListener_401019;
|
||||
|
||||
|
||||
private V2XSocketManager() {
|
||||
@@ -62,6 +64,8 @@ public class V2XSocketManager {
|
||||
}
|
||||
register401007();
|
||||
register401009();
|
||||
register401019();
|
||||
|
||||
// TODO 这里是前瞻需求,量产版本需要注释
|
||||
register401003();
|
||||
// TODO 旧版本的一种V2X预警形式,已经废弃了
|
||||
@@ -108,6 +112,11 @@ public class V2XSocketManager {
|
||||
.getMoGoSocketManager()
|
||||
.unregisterOnMessageListener(401009, v2XMessageListener_401009);
|
||||
}
|
||||
if (v2XMessageListener_401019 != null) {
|
||||
V2XServiceManager
|
||||
.getMoGoSocketManager()
|
||||
.unregisterOnMessageListener(401019, v2XMessageListener_401019);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -216,6 +225,21 @@ public class V2XSocketManager {
|
||||
v2XMessageListener_401009
|
||||
);
|
||||
}
|
||||
/**
|
||||
* * 车路云—场景预警-V1.0
|
||||
* * http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=52829799
|
||||
* * 最优路线推荐
|
||||
*/
|
||||
public void register401019() {
|
||||
v2XMessageListener_401019 = new V2XMessageListener_401019();
|
||||
// 道路事件,在线车辆绘制
|
||||
V2XServiceManager
|
||||
.getMoGoSocketManager()
|
||||
.registerOnMessageListener(
|
||||
401019,
|
||||
v2XMessageListener_401019
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.mogo.module.v2x.entity.net;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 最优路线推荐
|
||||
*/
|
||||
public class V2XOptimalRouteDataRes implements Serializable {
|
||||
private String sn;
|
||||
/**
|
||||
* 道路ID
|
||||
*/
|
||||
private String road_id;
|
||||
/**
|
||||
* 车道ID-2D路段
|
||||
*/
|
||||
private String current_lane_id;
|
||||
/**
|
||||
* 车道号:中心线编号为0, 中心线右侧编号为负数,3车道通行Road的车道编号,0,-1,-2,-3
|
||||
*/
|
||||
private int current_lane_num;
|
||||
/**
|
||||
* 最优车道平均速度
|
||||
*/
|
||||
private double most_speed;
|
||||
/**
|
||||
* 车道号:中心线编号为0, 中心线右侧编号为负数,3车道通行Road的车道编号,0,-1,-2,-3
|
||||
*/
|
||||
private int most_lane_num;
|
||||
/**
|
||||
* 线性经纬度轨迹列表
|
||||
**/
|
||||
private List<MogoLatLng> locus_list;
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public void setSn(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public String getRoad_id() {
|
||||
return road_id;
|
||||
}
|
||||
|
||||
public void setRoad_id(String road_id) {
|
||||
this.road_id = road_id;
|
||||
}
|
||||
|
||||
public String getCurrent_lane_id() {
|
||||
return current_lane_id;
|
||||
}
|
||||
|
||||
public void setCurrent_lane_id(String current_lane_id) {
|
||||
this.current_lane_id = current_lane_id;
|
||||
}
|
||||
|
||||
public int getCurrent_lane_num() {
|
||||
return current_lane_num;
|
||||
}
|
||||
|
||||
public void setCurrent_lane_num(int current_lane_num) {
|
||||
this.current_lane_num = current_lane_num;
|
||||
}
|
||||
|
||||
public double getMost_speed() {
|
||||
return most_speed;
|
||||
}
|
||||
|
||||
public void setMost_speed(double most_speed) {
|
||||
this.most_speed = most_speed;
|
||||
}
|
||||
|
||||
public int getMost_lane_num() {
|
||||
return most_lane_num;
|
||||
}
|
||||
|
||||
public void setMost_lane_num(int most_lane_num) {
|
||||
this.most_lane_num = most_lane_num;
|
||||
}
|
||||
|
||||
public List<MogoLatLng> getLocus_list() {
|
||||
return locus_list;
|
||||
}
|
||||
|
||||
public void setLocus_list(List<MogoLatLng> locus_list) {
|
||||
this.locus_list = locus_list;
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.mogo.module.v2x.entity.net;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author donghongyu
|
||||
* @date 4/8/21 4:52 PM
|
||||
* 最优路线推荐
|
||||
*/
|
||||
public class V2XRouteRes {
|
||||
private String sn;//车机SN
|
||||
private String roadId;//当前道路唯一标识
|
||||
private int laneNum;//当前车道唯一标识
|
||||
private int mostLaneNum;//最优车道号
|
||||
private double mostSpeed;//最优车道平均速度
|
||||
private List locusList;//线性经纬度轨迹列表
|
||||
private double locusLat;
|
||||
private double locusLon;
|
||||
|
||||
private double heading;// 车头朝向
|
||||
private long satelliteTime;//定位卫星时间
|
||||
private long showTime;//展示时间
|
||||
|
||||
private int warningType;// 1-最优车道,2-安全距离,3-交通预警
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.mogo.module.v2x.listener;
|
||||
|
||||
import com.mogo.module.v2x.entity.net.V2XOptimalRouteDataRes;
|
||||
import com.mogo.service.connection.IMogoOnMessageListener;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
|
||||
|
||||
/**
|
||||
* @author donghongyu
|
||||
* @description 车路云—场景预警-云下发数据监听 最优路线推荐
|
||||
* @since: 2021/4/13
|
||||
*/
|
||||
public class V2XMessageListener_401019 implements IMogoOnMessageListener<V2XOptimalRouteDataRes> {
|
||||
@Override
|
||||
public Class target() {
|
||||
return V2XOptimalRouteDataRes.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMsgReceived(V2XOptimalRouteDataRes message) {
|
||||
Logger.i(MODULE_NAME, "V2XMessageListener_401019:" + message);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user