mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-05-24 14:07:50 +08:00
1078-添加位置附加信息定义
This commit is contained in:
parent
d54787f323
commit
9badf1c7fe
@ -0,0 +1,25 @@
|
|||||||
|
package com.genersoft.iot.vmp.jt1078.bean;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
|
||||||
|
@Schema(description = "位置附加信息")
|
||||||
|
public class JTPositionAdditionalInfo {
|
||||||
|
|
||||||
|
@Schema(description = "里程, 单位为1/10km, 对应车上里程表读数")
|
||||||
|
private int mileage;
|
||||||
|
|
||||||
|
@Schema(description = "油量, 单位为1/10L, 对应车上油量表读数")
|
||||||
|
private int oil;
|
||||||
|
|
||||||
|
@Schema(description = "行驶记录功能获取的速度,单位为1/10km/h")
|
||||||
|
private int speed;
|
||||||
|
|
||||||
|
@Schema(description = "报警事件的 ID")
|
||||||
|
private int alarmId;
|
||||||
|
// TODO 暂不支持胎压
|
||||||
|
|
||||||
|
@Schema(description = "车厢温度 ,单位为摄氏度")
|
||||||
|
private int carriageTemperature;
|
||||||
|
// TODO 暂不支持胎压
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,147 @@
|
|||||||
|
package com.genersoft.iot.vmp.jt1078.bean;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
|
||||||
|
@Schema(description = "位置基本信息")
|
||||||
|
public class JTPositionBaseInfo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报警标志
|
||||||
|
*/
|
||||||
|
@Schema(description = "报警标志")
|
||||||
|
private JTAlarmSign alarmSign;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
@Schema(description = "状态")
|
||||||
|
private JTStatus status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 经度
|
||||||
|
*/
|
||||||
|
@Schema(description = "经度")
|
||||||
|
private Double longitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 纬度
|
||||||
|
*/
|
||||||
|
@Schema(description = "纬度")
|
||||||
|
private Double latitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 高程
|
||||||
|
*/
|
||||||
|
@Schema(description = "高程")
|
||||||
|
private Integer altitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 速度
|
||||||
|
*/
|
||||||
|
@Schema(description = "速度")
|
||||||
|
private Integer speed;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 方向
|
||||||
|
*/
|
||||||
|
@Schema(description = "方向")
|
||||||
|
private Integer direction;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时间
|
||||||
|
*/
|
||||||
|
@Schema(description = "时间")
|
||||||
|
private String time;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 视频报警
|
||||||
|
*/
|
||||||
|
@Schema(description = "视频报警")
|
||||||
|
private JTVideoAlarm videoAlarm;
|
||||||
|
|
||||||
|
public JTAlarmSign getAlarmSign() {
|
||||||
|
return alarmSign;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAlarmSign(JTAlarmSign alarmSign) {
|
||||||
|
this.alarmSign = alarmSign;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTStatus getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(JTStatus status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getLongitude() {
|
||||||
|
return longitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLongitude(Double longitude) {
|
||||||
|
this.longitude = longitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getLatitude() {
|
||||||
|
return latitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLatitude(Double latitude) {
|
||||||
|
this.latitude = latitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getAltitude() {
|
||||||
|
return altitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAltitude(Integer altitude) {
|
||||||
|
this.altitude = altitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSpeed() {
|
||||||
|
return speed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpeed(Integer speed) {
|
||||||
|
this.speed = speed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getDirection() {
|
||||||
|
return direction;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDirection(Integer direction) {
|
||||||
|
this.direction = direction;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTime() {
|
||||||
|
return time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTime(String time) {
|
||||||
|
this.time = time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTVideoAlarm getVideoAlarm() {
|
||||||
|
return videoAlarm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVideoAlarm(JTVideoAlarm videoAlarm) {
|
||||||
|
this.videoAlarm = videoAlarm;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "位置汇报信息: " +
|
||||||
|
" \n 报警标志:" + alarmSign.toString() +
|
||||||
|
" \n 状态:" + status.toString() +
|
||||||
|
" \n 经度:" + longitude +
|
||||||
|
" \n 纬度:" + latitude +
|
||||||
|
" \n 高程: " + altitude +
|
||||||
|
" \n 速度: " + speed +
|
||||||
|
" \n 方向: " + direction +
|
||||||
|
" \n 时间: " + time +
|
||||||
|
" \n";
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -6,142 +6,30 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
|||||||
public class JTPositionInfo {
|
public class JTPositionInfo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 报警标志
|
* 位置基本信息
|
||||||
*/
|
*/
|
||||||
@Schema(description = "报警标志")
|
@Schema(description = "位置基本信息")
|
||||||
private JTAlarmSign alarmSign;
|
private JTPositionBaseInfo base;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态
|
* 位置基本信息
|
||||||
*/
|
*/
|
||||||
@Schema(description = "状态")
|
@Schema(description = "位置附加信息")
|
||||||
private JTStatus status;
|
private JTPositionAdditionalInfo additional;
|
||||||
|
|
||||||
/**
|
public JTPositionBaseInfo getBase() {
|
||||||
* 经度
|
return base;
|
||||||
*/
|
|
||||||
@Schema(description = "经度")
|
|
||||||
private Double longitude;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 纬度
|
|
||||||
*/
|
|
||||||
@Schema(description = "纬度")
|
|
||||||
private Double latitude;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 高程
|
|
||||||
*/
|
|
||||||
@Schema(description = "高程")
|
|
||||||
private Integer altitude;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 速度
|
|
||||||
*/
|
|
||||||
@Schema(description = "速度")
|
|
||||||
private Integer speed;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 方向
|
|
||||||
*/
|
|
||||||
@Schema(description = "方向")
|
|
||||||
private Integer direction;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 时间
|
|
||||||
*/
|
|
||||||
@Schema(description = "时间")
|
|
||||||
private String time;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 视频报警
|
|
||||||
*/
|
|
||||||
@Schema(description = "视频报警")
|
|
||||||
private JTVideoAlarm videoAlarm;
|
|
||||||
|
|
||||||
public JTAlarmSign getAlarmSign() {
|
|
||||||
return alarmSign;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAlarmSign(JTAlarmSign alarmSign) {
|
public void setBase(JTPositionBaseInfo base) {
|
||||||
this.alarmSign = alarmSign;
|
this.base = base;
|
||||||
}
|
}
|
||||||
|
|
||||||
public JTStatus getStatus() {
|
public JTPositionAdditionalInfo getAdditional() {
|
||||||
return status;
|
return additional;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStatus(JTStatus status) {
|
public void setAdditional(JTPositionAdditionalInfo additional) {
|
||||||
this.status = status;
|
this.additional = additional;
|
||||||
}
|
|
||||||
|
|
||||||
public Double getLongitude() {
|
|
||||||
return longitude;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLongitude(Double longitude) {
|
|
||||||
this.longitude = longitude;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Double getLatitude() {
|
|
||||||
return latitude;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLatitude(Double latitude) {
|
|
||||||
this.latitude = latitude;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getAltitude() {
|
|
||||||
return altitude;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAltitude(Integer altitude) {
|
|
||||||
this.altitude = altitude;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getSpeed() {
|
|
||||||
return speed;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSpeed(Integer speed) {
|
|
||||||
this.speed = speed;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getDirection() {
|
|
||||||
return direction;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDirection(Integer direction) {
|
|
||||||
this.direction = direction;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTime() {
|
|
||||||
return time;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTime(String time) {
|
|
||||||
this.time = time;
|
|
||||||
}
|
|
||||||
|
|
||||||
public JTVideoAlarm getVideoAlarm() {
|
|
||||||
return videoAlarm;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setVideoAlarm(JTVideoAlarm videoAlarm) {
|
|
||||||
this.videoAlarm = videoAlarm;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "位置汇报信息: " +
|
|
||||||
" \n 报警标志:" + alarmSign.toString() +
|
|
||||||
" \n 状态:" + status.toString() +
|
|
||||||
" \n 经度:" + longitude +
|
|
||||||
" \n 纬度:" + latitude +
|
|
||||||
" \n 高程: " + altitude +
|
|
||||||
" \n 速度: " + speed +
|
|
||||||
" \n 方向: " + direction +
|
|
||||||
" \n 时间: " + time +
|
|
||||||
" \n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,11 +24,11 @@ import org.springframework.context.ApplicationEvent;
|
|||||||
public class J0200 extends Re {
|
public class J0200 extends Re {
|
||||||
|
|
||||||
private final static Logger log = LoggerFactory.getLogger(J0100.class);
|
private final static Logger log = LoggerFactory.getLogger(J0100.class);
|
||||||
private JTPositionInfo positionInfo;
|
private JTPositionBaseInfo positionInfo;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Rs decode0(ByteBuf buf, Header header, Session session) {
|
protected Rs decode0(ByteBuf buf, Header header, Session session) {
|
||||||
positionInfo = new JTPositionInfo();
|
positionInfo = new JTPositionBaseInfo();
|
||||||
int alarmSignInt = buf.readInt();
|
int alarmSignInt = buf.readInt();
|
||||||
positionInfo.setAlarmSign(new JTAlarmSign(alarmSignInt));
|
positionInfo.setAlarmSign(new JTAlarmSign(alarmSignInt));
|
||||||
|
|
||||||
@ -43,15 +43,18 @@ public class J0200 extends Re {
|
|||||||
byte[] timeBytes = new byte[6];
|
byte[] timeBytes = new byte[6];
|
||||||
buf.readBytes(timeBytes);
|
buf.readBytes(timeBytes);
|
||||||
positionInfo.setTime(BCDUtil.transform(timeBytes));
|
positionInfo.setTime(BCDUtil.transform(timeBytes));
|
||||||
|
boolean readable = buf.isReadable();
|
||||||
// 支持1078的视频报警上报
|
// 读取附加信息
|
||||||
int alarm = buf.readInt();
|
if (buf.isReadable()) {
|
||||||
int loss = buf.readInt();
|
// 支持1078的视频报警上报
|
||||||
int occlusion = buf.readInt();
|
int alarm = buf.readInt();
|
||||||
short storageFault = buf.readShort();
|
int loss = buf.readInt();
|
||||||
short driving = buf.readShort();
|
int occlusion = buf.readInt();
|
||||||
JTVideoAlarm videoAlarm = JTVideoAlarm.getInstance(alarm, loss, occlusion, storageFault, driving);
|
short storageFault = buf.readShort();
|
||||||
positionInfo.setVideoAlarm(videoAlarm);
|
short driving = buf.readShort();
|
||||||
|
JTVideoAlarm videoAlarm = JTVideoAlarm.getInstance(alarm, loss, occlusion, storageFault, driving);
|
||||||
|
positionInfo.setVideoAlarm(videoAlarm);
|
||||||
|
}
|
||||||
log.info("[JT-位置汇报]: {}", positionInfo.toString());
|
log.info("[JT-位置汇报]: {}", positionInfo.toString());
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user