DeviceChannel.java 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. package com.genersoft.iot.vmp.gb28181.bean;
  2. import com.genersoft.iot.vmp.gb28181.utils.MessageElement;
  3. import com.genersoft.iot.vmp.gb28181.utils.XmlUtil;
  4. import io.swagger.v3.oas.annotations.media.Schema;
  5. import lombok.Data;
  6. import lombok.EqualsAndHashCode;
  7. import lombok.extern.slf4j.Slf4j;
  8. import org.dom4j.Element;
  9. import java.lang.reflect.InvocationTargetException;
  10. @Data
  11. @Slf4j
  12. @Schema(description = "通道信息")
  13. @EqualsAndHashCode(callSuper = true)
  14. public class DeviceChannel extends CommonGBChannel {
  15. @Schema(description = "数据库自增ID")
  16. private int id;
  17. @Schema(description = "设备的数据库自增ID")
  18. private Integer deviceDbId;
  19. @MessageElement("DeviceID")
  20. @Schema(description = "编码")
  21. private String deviceId;
  22. @MessageElement("Name")
  23. @Schema(description = "名称")
  24. private String name;
  25. @MessageElement("Manufacturer")
  26. @Schema(description = "设备厂商")
  27. private String manufacturer;
  28. @MessageElement("Model")
  29. @Schema(description = "设备型号")
  30. private String model;
  31. // 2016
  32. @MessageElement("Owner")
  33. @Schema(description = "设备归属")
  34. private String owner;
  35. @MessageElement("CivilCode")
  36. @Schema(description = "行政区域")
  37. private String civilCode;
  38. @MessageElement("Block")
  39. @Schema(description = "警区")
  40. private String block;
  41. @MessageElement("Address")
  42. @Schema(description = "安装地址")
  43. private String address;
  44. @MessageElement("Parental")
  45. @Schema(description = "是否有子设备(必选)1有,0没有")
  46. private Integer parental;
  47. @MessageElement("ParentID")
  48. @Schema(description = "父节点ID")
  49. private String parentId;
  50. // 2016
  51. @MessageElement("SafetyWay")
  52. @Schema(description = "信令安全模式")
  53. private Integer safetyWay;
  54. @MessageElement("RegisterWay")
  55. @Schema(description = "注册方式")
  56. private Integer registerWay;
  57. // 2016
  58. @MessageElement("CertNum")
  59. @Schema(description = "证书序列号")
  60. private String certNum;
  61. // 2016
  62. @MessageElement("Certifiable")
  63. @Schema(description = "证书有效标识, 缺省为0;证书有效标识:0:无效 1:有效")
  64. private Integer certifiable;
  65. // 2016
  66. @MessageElement("ErrCode")
  67. @Schema(description = "无效原因码(有证书且证书无效的设备必选)")
  68. private Integer errCode;
  69. // 2016
  70. @MessageElement("EndTime")
  71. @Schema(description = "证书终止有效期(有证书且证书无效的设备必选)")
  72. private String endTime;
  73. @MessageElement("Secrecy")
  74. @Schema(description = "保密属性(必选)缺省为0;0-不涉密,1-涉密")
  75. private Integer secrecy;
  76. @MessageElement("IPAddress")
  77. @Schema(description = "设备/系统IPv4/IPv6地址")
  78. private String ipAddress;
  79. @MessageElement("Port")
  80. @Schema(description = "设备/系统端口")
  81. private Integer port;
  82. @MessageElement("Password")
  83. @Schema(description = "设备口令")
  84. private String password;
  85. @MessageElement("Status")
  86. @Schema(description = "设备状态")
  87. private String status;
  88. @MessageElement("Longitude")
  89. @Schema(description = "经度 WGS-84坐标系")
  90. private Double longitude;
  91. @MessageElement("Latitude")
  92. @Schema(description = ",纬度 WGS-84坐标系")
  93. private Double latitude;
  94. @MessageElement("Info.PTZType")
  95. @Schema(description = "摄像机结构类型,标识摄像机类型: 1-球机; 2-半球; 3-固定枪机; 4-遥控枪机;5-遥控半球;6-多目设备的全景/拼接通道;7-多目设备的分割通道")
  96. private Integer ptzType;
  97. @MessageElement("Info.PositionType")
  98. @Schema(description = "摄像机位置类型扩展。1-省际检查站、2-党政机关、3-车站码头、4-中心广场、5-体育场馆、" +
  99. "6-商业中心、7-宗教场所、8-校园周边、9-治安复杂区域、10-交通干线")
  100. private Integer positionType;
  101. @MessageElement("Info.RoomType")
  102. @Schema(description = "摄像机安装位置室外、室内属性。1-室外、2-室内。")
  103. private Integer roomType;
  104. @MessageElement("Info.UseType")
  105. @Schema(description = "用途属性, 1-治安、2-交通、3-重点。")
  106. private Integer useType;
  107. @MessageElement("Info.SupplyLightType")
  108. @Schema(description = "摄像机补光属性。1-无补光;2-红外补光;3-白光补光;4-激光补光;9-其他")
  109. private Integer supplyLightType;
  110. @MessageElement("Info.DirectionType")
  111. @Schema(description = "摄像机监视方位(光轴方向)属性。1-东(西向东)、2-西(东向西)、3-南(北向南)、4-北(南向北)、" +
  112. "5-东南(西北到东南)、6-东北(西南到东北)、7-西南(东北到西南)、8-西北(东南到西北)")
  113. private Integer directionType;
  114. @MessageElement("Info.Resolution")
  115. @Schema(description = "摄像机支持的分辨率,可多值")
  116. private String resolution;
  117. @MessageElement("Info.BusinessGroupID")
  118. @Schema(description = "虚拟组织所属的业务分组ID")
  119. private String businessGroupId;
  120. @MessageElement("Info.DownloadSpeed")
  121. @Schema(description = "下载倍速(可选),可多值")
  122. private String downloadSpeed;
  123. @MessageElement("Info.SVCSpaceSupportMode")
  124. @Schema(description = "空域编码能力,取值0-不支持;1-1级增强(1个增强层);2-2级增强(2个增强层);3-3级增强(3个增强层)")
  125. private Integer svcSpaceSupportMod;
  126. @MessageElement("Info.SVCTimeSupportMode")
  127. @Schema(description = "时域编码能力,取值0-不支持;1-1级增强;2-2级增强;3-3级增强(可选)")
  128. private Integer svcTimeSupportMode;
  129. @Schema(description = "云台类型描述字符串")
  130. private String ptzTypeText;
  131. @Schema(description = "创建时间")
  132. private String createTime;
  133. @Schema(description = "更新时间")
  134. private String updateTime;
  135. @Schema(description = "子设备数")
  136. private int subCount;
  137. @Schema(description = "流唯一编号,存在表示正在直播")
  138. private String streamId;
  139. @Schema(description = "是否含有音频")
  140. private Boolean hasAudio;
  141. @Schema(description = "GPS的更新时间")
  142. private String gpsTime;
  143. @Schema(description = "码流标识,优先级高于设备中码流标识," +
  144. "用于选择码流时组成码流标识。默认为null,不设置。可选值: stream/streamnumber/streamprofile/streamMode")
  145. private String streamIdentification;
  146. public void setPtzType(int ptzType) {
  147. this.ptzType = ptzType;
  148. switch (ptzType) {
  149. case 0:
  150. this.ptzTypeText = "未知";
  151. break;
  152. case 1:
  153. this.ptzTypeText = "球机";
  154. break;
  155. case 2:
  156. this.ptzTypeText = "半球";
  157. break;
  158. case 3:
  159. this.ptzTypeText = "固定枪机";
  160. break;
  161. case 4:
  162. this.ptzTypeText = "遥控枪机";
  163. break;
  164. case 5:
  165. this.ptzTypeText = "遥控半球";
  166. break;
  167. case 6:
  168. this.ptzTypeText = "多目设备的全景/拼接通道";
  169. break;
  170. case 7:
  171. this.ptzTypeText = "多目设备的分割通道";
  172. break;
  173. }
  174. }
  175. public static DeviceChannel decode(Element element) throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
  176. return XmlUtil.elementDecode(element, DeviceChannel.class);
  177. }
  178. public static DeviceChannel decodeWithOnlyDeviceId(Element element) {
  179. Element deviceElement = element.element("DeviceID");
  180. DeviceChannel deviceChannel = new DeviceChannel();
  181. deviceChannel.setDeviceId(deviceElement.getText());
  182. return deviceChannel;
  183. }
  184. }