1078-图像分析报警参数设置
This commit is contained in:
@@ -223,9 +223,15 @@ public class JTDeviceConfig {
|
||||
@ConfigAttribute(id = 0x79, type="AlarmRecordingParam", description = "特殊报警录像参数设置")
|
||||
private AlarmRecordingParam alarmRecordingParam;
|
||||
|
||||
@ConfigAttribute(id = 0x79, type="VideoAlarmBit", description = "视频相关报警屏蔽字")
|
||||
@ConfigAttribute(id = 0x7a, type="VideoAlarmBit", description = "视频相关报警屏蔽字")
|
||||
private VideoAlarmBit videoAlarmBit;
|
||||
|
||||
@ConfigAttribute(id = 0x7b, type="AnalyzeAlarmParam", description = "图像分析报警参数设置")
|
||||
private AnalyzeAlarmParam analyzeAlarmParam;
|
||||
|
||||
@ConfigAttribute(id = 0x7c, type="AwakenParam", description = "终端休眠唤醒模式设置")
|
||||
private AwakenParam awakenParam;
|
||||
|
||||
@ConfigAttribute(id = 0x80, type="Long", description = "车辆里程表读数,单位'1/10km")
|
||||
private Long mileage;
|
||||
|
||||
@@ -283,6 +289,14 @@ public class JTDeviceConfig {
|
||||
private Integer canUploadIntervalForChannel2;
|
||||
|
||||
|
||||
public AnalyzeAlarmParam getAnalyzeAlarmParam() {
|
||||
return analyzeAlarmParam;
|
||||
}
|
||||
|
||||
public void setAnalyzeAlarmParam(AnalyzeAlarmParam analyzeAlarmParam) {
|
||||
this.analyzeAlarmParam = analyzeAlarmParam;
|
||||
}
|
||||
|
||||
public Long getKeepaliveInterval() {
|
||||
return keepaliveInterval;
|
||||
}
|
||||
@@ -971,6 +985,14 @@ public class JTDeviceConfig {
|
||||
this.alarmRecordingParam = alarmRecordingParam;
|
||||
}
|
||||
|
||||
public VideoAlarmBit getVideoAlarmBit() {
|
||||
return videoAlarmBit;
|
||||
}
|
||||
|
||||
public void setVideoAlarmBit(VideoAlarmBit videoAlarmBit) {
|
||||
this.videoAlarmBit = videoAlarmBit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "JTDeviceConfig{" +
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.genersoft.iot.vmp.jt1078.bean.config;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
/**
|
||||
* 视频分析报警参数
|
||||
*/
|
||||
public class AnalyzeAlarmParam implements JTDeviceSubConfig{
|
||||
|
||||
/**
|
||||
* 车辆核载人数
|
||||
*/
|
||||
private int numberForPeople;
|
||||
|
||||
|
||||
/**
|
||||
* 疲劳程度阈值
|
||||
*/
|
||||
private int fatigueThreshold;
|
||||
|
||||
|
||||
public int getNumberForPeople() {
|
||||
return numberForPeople;
|
||||
}
|
||||
|
||||
public void setNumberForPeople(int numberForPeople) {
|
||||
this.numberForPeople = numberForPeople;
|
||||
}
|
||||
|
||||
public int getFatigueThreshold() {
|
||||
return fatigueThreshold;
|
||||
}
|
||||
|
||||
public void setFatigueThreshold(int fatigueThreshold) {
|
||||
this.fatigueThreshold = fatigueThreshold;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ByteBuf encode() {
|
||||
ByteBuf byteBuf = Unpooled.buffer();
|
||||
byteBuf.writeByte(numberForPeople);
|
||||
byteBuf.writeByte(fatigueThreshold);
|
||||
return byteBuf;
|
||||
}
|
||||
|
||||
public static AnalyzeAlarmParam decode(ByteBuf byteBuf) {
|
||||
AnalyzeAlarmParam analyzeAlarmParam = new AnalyzeAlarmParam();
|
||||
analyzeAlarmParam.setNumberForPeople(byteBuf.readUnsignedByte());
|
||||
analyzeAlarmParam.setFatigueThreshold(byteBuf.readUnsignedByte());
|
||||
return analyzeAlarmParam;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.genersoft.iot.vmp.jt1078.bean.config;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class AwakenParam implements JTDeviceSubConfig{
|
||||
|
||||
@Override
|
||||
public ByteBuf encode() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -150,6 +150,11 @@ public class J0104 extends Re {
|
||||
Method methodForVideoAlarmBit = deviceConfig.getClass().getDeclaredMethod("set" + StringUtils.capitalize(field.getName()), VideoAlarmBit.class);
|
||||
methodForVideoAlarmBit.invoke(deviceConfig, videoAlarmBit);
|
||||
continue;
|
||||
case "AnalyzeAlarmParam":
|
||||
AnalyzeAlarmParam analyzeAlarmParam = AnalyzeAlarmParam.decode(buf);
|
||||
Method methodForAnalyzeAlarmParam = deviceConfig.getClass().getDeclaredMethod("set" + StringUtils.capitalize(field.getName()), AnalyzeAlarmParam.class);
|
||||
methodForAnalyzeAlarmParam.invoke(deviceConfig, analyzeAlarmParam);
|
||||
continue;
|
||||
default:
|
||||
System.err.println(field.getGenericType().getTypeName());
|
||||
continue;
|
||||
|
||||
@@ -94,6 +94,7 @@ public class J8103 extends Rs {
|
||||
case "AlarmRecordingParam":
|
||||
case "AlarmShielding":
|
||||
case "VideoAlarmBit":
|
||||
case "AnalyzeAlarmParam":
|
||||
field.setAccessible(true);
|
||||
JTDeviceSubConfig subConfig = (JTDeviceSubConfig)field.get(config);
|
||||
ByteBuf bytesForIllegalDrivingPeriods = subConfig.encode();
|
||||
|
||||
Reference in New Issue
Block a user