增加 street与shelves的关联关系表

camera_merge
王一鸣 5 years ago
parent 2f042cb089
commit 3f58cca548

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

@ -7,10 +7,7 @@ import com.zhehekeji.web.pojo.realTime.RealTime;
import com.zhehekeji.web.service.RealTimeService; import com.zhehekeji.web.service.RealTimeService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
@ -29,4 +26,13 @@ public class RealTimeController {
public Result<List<RealTime>> realTimes() { public Result<List<RealTime>> realTimes() {
return Result.success(realTimeService.realTimes()); return Result.success(realTimeService.realTimes());
} }
@GetMapping("/lychee")
@ApiOperation(value = "获取荔枝的ip")
//@SessionHandler
public Result<String> lychee() {
return Result.success(realTimeService.lychee());
}
} }

@ -0,0 +1,16 @@
package com.zhehekeji.web.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@Data
@TableName("`lychee`")
public class Lychee {
@TableId
private Integer id;
private String ip;
}

@ -231,18 +231,21 @@ public class PtzControlModule {
public static void downloadMp4(Integer cameraId,int channelId){ public static void downloadMp4(Integer cameraId,int channelId){
NetSDKLib.NET_TIME startTime = new NetSDKLib.NET_TIME(); NetSDKLib.NET_TIME startTime = new NetSDKLib.NET_TIME();
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
LocalDateTime start = now.minusMinutes(1); LocalDateTime start = now.minusMinutes(10);
startTime.setTime(start.getYear(),start.getMonthValue(),start.getDayOfMonth(),start.getHour(),start.getMinute(),start.getSecond()); startTime.setTime(start.getYear(),start.getMonthValue(),start.getDayOfMonth(),start.getHour(),start.getMinute(),start.getSecond());
NetSDKLib.NET_TIME endTime = new NetSDKLib.NET_TIME(); NetSDKLib.NET_TIME endTime = new NetSDKLib.NET_TIME();
LocalDateTime end = now.plusMinutes(1); LocalDateTime end = now.minusMinutes(8);
endTime.setTime(end.getYear(),end.getMonthValue(),end.getDayOfMonth(),end.getHour(),end.getMinute(),end.getSecond()); endTime.setTime(end.getYear(),end.getMonthValue(),end.getDayOfMonth(),end.getHour(),end.getMinute(),end.getSecond());
//NetSDKLib.LLong l = LoginModule.netsdk.CLIENT_DownloadByTimeEx2(CameraConnMap.getConnId(cameraId),channelId,0,startTime,endTime,"d://www/qq.mp4",null,null,null,null,3,null); //NetSDKLib.LLong l = LoginModule.netsdk.CLIENT_DownloadByTimeEx2(CameraConnMap.getConnId(cameraId),channelId,0,startTime,endTime,"./q2q.mp4",null,null,null,null,3,null);
NetSDKLib.LLong m_hDownLoadHandle = LoginModule.netsdk.CLIENT_DownloadByTimeEx(CameraConnMap.getConnId(cameraId), channelId, 0, NetSDKLib.LLong l = LoginModule.netsdk.CLIENT_DownloadByTimeEx2(CameraConnMap.getConnId(cameraId),channelId,0,startTime,endTime,"./q2q.mp4",null,null,null,null,3,null);
startTime, endTime, "d://www/qq.mp4", // NetSDKLib.LLong m_hDownLoadHandle = LoginModule.netsdk.CLIENT_DownloadByTimeEx(CameraConnMap.getConnId(cameraId), channelId, 0,
null, null, null, null, null); // startTime, endTime, "./qq.dav",
// null, null, null, null, null);
System.out.println(m_hDownLoadHandle.longValue()); if(l.longValue() == 0){
System.out.println(ToolKits.getErrorCodePrint());
}
System.out.println();
} }

@ -0,0 +1,469 @@
package com.zhehekeji.web.lib;
import com.zhehekeji.web.lib.common.ErrorCode;
import com.zhehekeji.web.lib.NetSDKLib.LLong;
import com.sun.jna.Memory;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import com.sun.jna.ptr.IntByReference;
import javax.imageio.ImageIO;
import javax.swing.*;
import javax.swing.filechooser.FileFilter;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.image.BufferedImage;
import java.io.*;
import java.text.SimpleDateFormat;
public class ToolKits {
static NetSDKLib netsdkapi = NetSDKLib.NETSDK_INSTANCE;
static NetSDKLib configapi = NetSDKLib.CONFIG_INSTANCE;
/***************************************************************************************************
* *
***************************************************************************************************/
public static void GetPointerData(Pointer pNativeData, Structure pJavaStu)
{
GetPointerDataToStruct(pNativeData, 0, pJavaStu);
}
public static void GetPointerDataToStruct(Pointer pNativeData, long OffsetOfpNativeData, Structure pJavaStu) {
pJavaStu.write();
Pointer pJavaMem = pJavaStu.getPointer();
pJavaMem.write(0, pNativeData.getByteArray(OffsetOfpNativeData, pJavaStu.size()), 0,
pJavaStu.size());
pJavaStu.read();
}
public static void GetPointerDataToStructArr(Pointer pNativeData, Structure[]pJavaStuArr) {
long offset = 0;
for (int i=0; i<pJavaStuArr.length; ++i)
{
GetPointerDataToStruct(pNativeData, offset, pJavaStuArr[i]);
offset += pJavaStuArr[i].size();
}
}
/**
*
* @param pNativeData
* @param pJavaStuArr
*/
public static void SetStructArrToPointerData(Structure[]pJavaStuArr, Pointer pNativeData) {
long offset = 0;
for (int i = 0; i < pJavaStuArr.length; ++i) {
SetStructDataToPointer(pJavaStuArr[i], pNativeData, offset);
offset += pJavaStuArr[i].size();
}
}
public static void SetStructDataToPointer(Structure pJavaStu, Pointer pNativeData, long OffsetOfpNativeData){
pJavaStu.write();
Pointer pJavaMem = pJavaStu.getPointer();
pNativeData.write(OffsetOfpNativeData, pJavaMem.getByteArray(0, pJavaStu.size()), 0, pJavaStu.size());
}
public static void savePicture(byte[] pBuf, String sDstFile) throws IOException
{
FileOutputStream fos=null;
try
{
fos = new FileOutputStream(sDstFile);
fos.write(pBuf);
} catch (Exception e){
e.printStackTrace();
}finally{
fos.close();
}
}
public static void savePicture(byte[] pBuf, int dwBufOffset, int dwBufSize, String sDstFile) throws IOException
{
FileOutputStream fos=null;
try
{
fos = new FileOutputStream(sDstFile);
fos.write(pBuf, dwBufOffset, dwBufSize);
} catch (Exception e){
e.printStackTrace();
}finally{
fos.close();
}
}
public static void savePicture(Pointer pBuf, int dwBufSize, String sDstFile) throws IOException
{
FileOutputStream fos=null;
try
{
fos = new FileOutputStream(sDstFile);
fos.write(pBuf.getByteArray(0, dwBufSize), 0, dwBufSize);
} catch (Exception e){
e.printStackTrace();
}finally{
fos.close();
}
}
public static void savePicture(Pointer pBuf, int dwBufOffset, int dwBufSize, String sDstFile) throws IOException
{
FileOutputStream fos=null;
try
{
fos = new FileOutputStream(sDstFile);
fos.write(pBuf.getByteArray(dwBufOffset, dwBufSize), 0, dwBufSize);
} catch (Exception e){
e.printStackTrace();
}finally{
fos.close();
}
}
// 将Pointer值转为byte[]
public static String GetPointerDataToByteArr(Pointer pointer) {
String str = "";
if(pointer == null) {
return str;
}
int length = 0;
byte[] bufferPlace = new byte[1];
for(int i = 0; i < 2048; i++) {
pointer.read(i, bufferPlace, 0, 1);
if(bufferPlace[0] == '\0') {
length = i;
break;
}
}
if(length > 0) {
byte[] buffer = new byte[length];
pointer.read(0, buffer, 0, length);
try {
str = new String(buffer, "GBK").trim();
} catch (UnsupportedEncodingException e) {
return str;
}
}
return str;
}
// 获取当前时间
public static String getDate() {
SimpleDateFormat simpleDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String date = simpleDate.format(new java.util.Date()).replace(" ", "_").replace(":", "-");
return date;
}
// 获取当前时间
public static String getDay() {
SimpleDateFormat simpleDate = new SimpleDateFormat("yyyy-MM-dd");
String date = simpleDate.format(new java.util.Date());
return date;
}
// 限制JTextField 长度,以及内容
public static void limitTextFieldLength(final JTextField jTextField, final int size) {
jTextField.addKeyListener(new KeyListener() {
@Override
public void keyTyped(KeyEvent e) {
String number = "0123456789" + (char)8;
if(number.indexOf(e.getKeyChar()) < 0 || jTextField.getText().trim().length() >= size) {
e.consume();
return;
}
}
@Override
public void keyReleased(KeyEvent e) {
}
@Override
public void keyPressed(KeyEvent e) {
}
});
}
// 获取当前窗口
public static JFrame getFrame(ActionEvent e) {
JButton btn = (JButton)e.getSource();
JFrame frame = (JFrame)btn.getRootPane().getParent();
return frame;
}
// 获取操作平台信息
public static String getLoadLibrary(String library) {
String path = "";
String os = System.getProperty("os.name");
if(os.toLowerCase().startsWith("win")) {
path = "./libs/";
} else if(os.toLowerCase().startsWith("linux")) {
path = "";
}
return (path + library);
}
public static String getOsName() {
String osName = "";
String os = System.getProperty("os.name");
if(os.toLowerCase().startsWith("win")) {
osName = "win";
} else if(os.toLowerCase().startsWith("linux")) {
osName = "linux";
}
return osName;
}
/**
*
* @param filePath
* @return
*/
public static long GetFileSize(String filePath) {
File f = new File(filePath);
if (f.exists() && f.isFile()) {
return f.length();
}
else
{
return 0;
}
}
/**
*
* @param file
* @param memory
* @return
* @throws IOException
*/
public static boolean ReadAllFileToMemory(String file, Memory memory) throws IOException {
if (memory != Memory.NULL)
{
long fileLen = GetFileSize(file);
if (fileLen <= 0)
{
return false;
}
FileInputStream in =null;
try {
File infile = new File(file);
if (infile.canRead())
{
in = new FileInputStream(infile);
int buffLen = 1024;
byte[] buffer = new byte[buffLen];
long currFileLen = 0;
int readLen = 0;
while (currFileLen < fileLen)
{
readLen = in.read(buffer);
memory.write(currFileLen, buffer, 0, readLen);
currFileLen += readLen;
}
return true;
}
else
{
System.err.println("Failed to open file %s for read!!!\n");
return false;
}
}catch (Exception e)
{
System.err.println("Failed to open file %s for read!!!\n");
e.printStackTrace();
}finally{
if(in!=null){
in.close();
}
}
}
return false;
}
static class JPGFilter extends FileFilter {
public boolean accept(File f) {
if(f.getName().toLowerCase().endsWith(".JPG")
|| f.getName().toLowerCase().endsWith(".jpg")
|| f.isDirectory()) {
return true;
}
return false;
}
@Override
public String getDescription() {
return "*.jpg; *.JPG";
}
}
/**
*
* @return
* @throws IOException
*/
public static Memory readPictureFile(String picPath) throws IOException {
int nPicBufLen = 0;
Memory memory = null;
/*
*
*/
nPicBufLen = (int)ToolKits.GetFileSize(picPath);
// 读取文件大小失败
if (nPicBufLen <= 0) {
System.err.println("读取图片大小失败,请重新选择!");
return null;
}
/*
*
*/
memory = new Memory(nPicBufLen); // 申请缓存
memory.clear();
if (!ToolKits.ReadAllFileToMemory(picPath, memory)) {
System.err.println("读取图片数据,请重新选择!");
return null;
}
return memory;
}
/**
* ,
*/
public static String getErrorCodeShow() {
return ErrorCode.getErrorCode(LoginModule.netsdk.CLIENT_GetLastError());
}
/**
*
* @return
*/
public static String getErrorCodePrint() {
return "\n{error code: (0x80000000|" + (LoginModule.netsdk.CLIENT_GetLastError() & 0x7fffffff) +").参考 NetSDKLib.java }"
+ " - {error info:" + ErrorCode.getErrorCode(LoginModule.netsdk.CLIENT_GetLastError()) + "}\n";
}
/**
*
* @param hLoginHandle
* @param nChn -1
* @param strCmd
* @param cmdObject
* @return true
*/
public static boolean GetDevConfig(LLong hLoginHandle, int nChn, String strCmd, Structure cmdObject) {
boolean result = false;
IntByReference error = new IntByReference(0);
int nBufferLen = 2*1024*1024;
byte[] strBuffer = new byte[nBufferLen];
if(netsdkapi.CLIENT_GetNewDevConfig( hLoginHandle, strCmd , nChn, strBuffer, nBufferLen,error,3000)) {
cmdObject.write();
if (configapi.CLIENT_ParseData(strCmd, strBuffer, cmdObject.getPointer(),
cmdObject.size(), null)) {
cmdObject.read();
result = true;
} else {
System.err.println("Parse " + strCmd + " Config Failed!" + ToolKits.getErrorCodePrint());
result = false;
}
} else {
System.err.printf("Get %s Config Failed!Last Error = %s\n" , strCmd , getErrorCodePrint());
result = false;
}
return result;
}
/**
*
* @param hLoginHandle
* @param nChn -1
* @param strCmd
* @param cmdObject
* @return true
*/
public static boolean SetDevConfig(LLong hLoginHandle, int nChn, String strCmd, Structure cmdObject) {
boolean result = false;
int nBufferLen = 2*1024*1024;
byte szBuffer[] = new byte[nBufferLen];
for(int i=0; i<nBufferLen; i++)szBuffer[i]=0;
IntByReference error = new IntByReference(0);
IntByReference restart = new IntByReference(0);
cmdObject.write();
if (configapi.CLIENT_PacketData(strCmd, cmdObject.getPointer(), cmdObject.size(),
szBuffer, nBufferLen)) {
cmdObject.read();
if( netsdkapi.CLIENT_SetNewDevConfig(hLoginHandle, strCmd , nChn , szBuffer, nBufferLen, error, restart, 3000)) {
result = true;
} else {
System.err.printf("Set %s Config Failed! Last Error = %s\n" , strCmd , getErrorCodePrint());
result = false;
}
} else {
System.err.println("Packet " + strCmd + " Config Failed!" + getErrorCodePrint());
result = false;
}
return result;
}
// Win下将GBK String类型的转为Pointer
public static Pointer GetGBKStringToPointer(String src) {
Pointer pointer = null;
try {
byte[] b = src.getBytes("GBK");
pointer = new Memory(b.length+1);
pointer.clear(b.length+1);
pointer.write(0, b, 0, b.length);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return pointer;
}
/**
* (src dst)
* @param src
* @param dst
*/
public static void StringToByteArray(String src, byte[] dst) {
for(int i = 0; i < dst.length; i++) {
dst[i] = 0;
}
System.arraycopy(src.getBytes(), 0, dst, 0, src.getBytes().length);
}
/**
* (src dst)
* @param
* @param dst
*/
public static void ByteArrayToByteArray(byte[] src, byte[] dst) {
for(int i = 0; i < dst.length; i++) {
dst[i] = 0;
}
System.arraycopy(src, 0, dst, 0, src.length);
}
}

@ -0,0 +1,553 @@
/*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
// Base64解码 使用1.8版本源码 鉴于1.8部分特性1.6版本使用不到 故只保留能使用到的代码 其余删除
package com.zhehekeji.web.lib.common;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.util.Arrays;
/**
* This class consists exclusively of static methods for obtaining
* encoders and decoders for the Base64 encoding scheme. The
* implementation of this class supports the following types of Base64
* as specified in
* <a href="http://www.ietf.org/rfc/rfc4648.txt">RFC 4648</a> and
*
* <ul>
* <li><a name="basic"><b>Basic</b></a>
* <p> Uses "The Base64 Alphabet" as specified in Table 1 of
* RFC 4648 and RFC 2045 for encoding and decoding operation.
* The encoder does not add any line feed (line separator)
* character. The decoder rejects data that contains characters
* outside the base64 alphabet.</p></li>
*
* <p> Unless otherwise noted, passing a {@code null} argument to a
* method of this class will cause a {@link NullPointerException
* NullPointerException} to be thrown.
*
* @author Xueming Shen
* @since 1.8
*/
public class Base64 {
private Base64() {}
/**
* Returns a {@link Encoder} that encodes using the
* <a href="#basic">Basic</a> type base64 encoding scheme.
*
* @return A Base64 encoder.
*/
public static Encoder getEncoder() {
return Encoder.RFC4648;
}
/**
* This class implements an encoder for encoding byte data using
* the Base64 encoding scheme as specified in RFC 4648 and RFC 2045.
*
* <p> Instances of {@link Encoder} class are safe for use by
* multiple concurrent threads.
*
* <p> Unless otherwise noted, passing a {@code null} argument to
* a method of this class will cause a
* {@link NullPointerException NullPointerException} to
* be thrown.
*
* @see Decoder
* @since 1.8
*/
public static class Encoder {
private final byte[] newline;
private final int linemax;
private final boolean isURL;
private final boolean doPadding;
private Encoder(boolean isURL, byte[] newline, int linemax, boolean doPadding) {
this.isURL = isURL;
this.newline = newline;
this.linemax = linemax;
this.doPadding = doPadding;
}
/**
* This array is a lookup table that translates 6-bit positive integer
* index values into their "Base64 Alphabet" equivalents as specified
* in "Table 1: The Base64 Alphabet" of RFC 2045 (and RFC 4648).
*/
private static final char[] toBase64 = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'
};
/**
* It's the lookup table for "URL and Filename safe Base64" as specified
* in Table 2 of the RFC 4648, with the '+' and '/' changed to '-' and
* '_'. This table is used when BASE64_URL is specified.
*/
private static final char[] toBase64URL = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '_'
};
static final Encoder RFC4648 = new Encoder(false, null, -1, true);
private final int outLength(int srclen) {
int len = 0;
if (doPadding) {
len = 4 * ((srclen + 2) / 3);
} else {
int n = srclen % 3;
len = 4 * (srclen / 3) + (n == 0 ? 0 : n + 1);
}
if (linemax > 0) // line separators
len += (len - 1) / linemax * newline.length;
return len;
}
/**
* Encodes all bytes from the specified byte array into a newly-allocated
* byte array using the {@link Base64} encoding scheme. The returned byte
* array is of the length of the resulting bytes.
*
* @param src
* the byte array to encode
* @return A newly-allocated byte array containing the resulting
* encoded bytes.
*/
public byte[] encode(byte[] src) {
int len = outLength(src.length); // dst array size
byte[] dst = new byte[len];
int ret = encode0(src, 0, src.length, dst);
if (ret != dst.length)
return Arrays.copyOf(dst, ret);
return dst;
}
/**
* Encodes all bytes from the specified byte array using the
* {@link Base64} encoding scheme, writing the resulting bytes to the
* given output byte array, starting at offset 0.
*
* <p> It is the responsibility of the invoker of this method to make
* sure the output byte array {@code dst} has enough space for encoding
* all bytes from the input byte array. No bytes will be written to the
* output byte array if the output byte array is not big enough.
*
* @param src
* the byte array to encode
* @param dst
* the output byte array
* @return The number of bytes written to the output byte array
*
* @throws IllegalArgumentException if {@code dst} does not have enough
* space for encoding all input bytes.
*/
public int encode(byte[] src, byte[] dst) {
int len = outLength(src.length); // dst array size
if (dst.length < len)
throw new IllegalArgumentException(
"Output byte array is too small for encoding all input bytes");
return encode0(src, 0, src.length, dst);
}
/**
* Encodes the specified byte array into a String using the {@link Base64}
* encoding scheme.
*
* <p> In other words, an invocation of this method has exactly the same
* effect as invoking
* {@code new String(encode(src), StandardCharsets.ISO_8859_1)}.
*
* @param src
* the byte array to encode
* @return A String containing the resulting Base64 encoded characters
*/
@SuppressWarnings("deprecation")
public String encodeToString(byte[] src) {
byte[] encoded = encode(src);
return new String(encoded, 0, 0, encoded.length);
}
/**
* Returns an encoder instance that encodes equivalently to this one,
* but without adding any padding character at the end of the encoded
* byte data.
*
* <p> The encoding scheme of this encoder instance is unaffected by
* this invocation. The returned encoder instance should be used for
* non-padding encoding operation.
*
* @return an equivalent encoder that encodes without adding any
* padding character at the end
*/
public Encoder withoutPadding() {
if (!doPadding)
return this;
return new Encoder(isURL, newline, linemax, false);
}
private int encode0(byte[] src, int off, int end, byte[] dst) {
char[] base64 = isURL ? toBase64URL : toBase64;
int sp = off;
int slen = (end - off) / 3 * 3;
int sl = off + slen;
if (linemax > 0 && slen > linemax / 4 * 3)
slen = linemax / 4 * 3;
int dp = 0;
while (sp < sl) {
int sl0 = Math.min(sp + slen, sl);
for (int sp0 = sp, dp0 = dp ; sp0 < sl0; ) {
int bits = (src[sp0++] & 0xff) << 16 |
(src[sp0++] & 0xff) << 8 |
(src[sp0++] & 0xff);
dst[dp0++] = (byte)base64[(bits >>> 18) & 0x3f];
dst[dp0++] = (byte)base64[(bits >>> 12) & 0x3f];
dst[dp0++] = (byte)base64[(bits >>> 6) & 0x3f];
dst[dp0++] = (byte)base64[bits & 0x3f];
}
int dlen = (sl0 - sp) / 3 * 4;
dp += dlen;
sp = sl0;
if (dlen == linemax && sp < end) {
for (byte b : newline){
dst[dp++] = b;
}
}
}
if (sp < end) { // 1 or 2 leftover bytes
int b0 = src[sp++] & 0xff;
dst[dp++] = (byte)base64[b0 >> 2];
if (sp == end) {
dst[dp++] = (byte)base64[(b0 << 4) & 0x3f];
if (doPadding) {
dst[dp++] = '=';
dst[dp++] = '=';
}
} else {
int b1 = src[sp++] & 0xff;
dst[dp++] = (byte)base64[(b0 << 4) & 0x3f | (b1 >> 4)];
dst[dp++] = (byte)base64[(b1 << 2) & 0x3f];
if (doPadding) {
dst[dp++] = '=';
}
}
}
return dp;
}
}
/**
* Returns a {@link Decoder} that decodes using the
* <a href="#basic">Basic</a> type base64 encoding scheme.
*
* @return A Base64 decoder.
*/
public static Decoder getDecoder() {
return Decoder.RFC4648;
}
/**
* This class implements a decoder for decoding byte data using the
* Base64 encoding scheme as specified in RFC 4648 and RFC 2045.
*
* <p> The Base64 padding character {@code '='} is accepted and
* interpreted as the end of the encoded byte data, but is not
* required. So if the final unit of the encoded byte data only has
* two or three Base64 characters (without the corresponding padding
* character(s) padded), they are decoded as if followed by padding
* character(s). If there is a padding character present in the
* final unit, the correct number of padding character(s) must be
* present, otherwise {@code IllegalArgumentException} (
* {@code IOException} when reading from a Base64 stream) is thrown
* during decoding.
*
* <p> Instances of {@link Decoder} class are safe for use by
* multiple concurrent threads.
*
* <p> Unless otherwise noted, passing a {@code null} argument to
* a method of this class will cause a
* {@link NullPointerException NullPointerException} to
* be thrown.
*
* @see Encoder
* @since 1.8
*/
public static class Decoder {
private final boolean isURL;
private final boolean isMIME;
private Decoder(boolean isURL, boolean isMIME) {
this.isURL = isURL;
this.isMIME = isMIME;
}
/**
* Lookup table for decoding unicode characters drawn from the
* "Base64 Alphabet" (as specified in Table 1 of RFC 2045) into
* their 6-bit positive integer equivalents. Characters that
* are not in the Base64 alphabet but fall within the bounds of
* the array are encoded to -1.
*
*/
private static final int[] fromBase64 = new int[256];
static {
Arrays.fill(fromBase64, -1);
for (int i = 0; i < Encoder.toBase64.length; i++)
fromBase64[Encoder.toBase64[i]] = i;
fromBase64['='] = -2;
}
/**
* Lookup table for decoding "URL and Filename safe Base64 Alphabet"
* as specified in Table2 of the RFC 4648.
*/
private static final int[] fromBase64URL = new int[256];
static {
Arrays.fill(fromBase64URL, -1);
for (int i = 0; i < Encoder.toBase64URL.length; i++)
fromBase64URL[Encoder.toBase64URL[i]] = i;
fromBase64URL['='] = -2;
}
static final Decoder RFC4648 = new Decoder(false, false);
static final Decoder RFC4648_URLSAFE = new Decoder(true, false);
static final Decoder RFC2045 = new Decoder(false, true);
/**
* Decodes all bytes from the input byte array using the {@link Base64}
* encoding scheme, writing the results into a newly-allocated output
* byte array. The returned byte array is of the length of the resulting
* bytes.
*
* @param src
* the byte array to decode
*
* @return A newly-allocated byte array containing the decoded bytes.
*
* @throws IllegalArgumentException
* if {@code src} is not in valid Base64 scheme
*/
public byte[] decode(byte[] src) {
byte[] dst = new byte[outLength(src, 0, src.length)];
int ret = decode0(src, 0, src.length, dst);
if (ret != dst.length) {
dst = Arrays.copyOf(dst, ret);
}
return dst;
}
public byte[] decode(String src) {
return decode(src.getBytes(Charset.forName("ISO-8859-1")));
}
/**
* Decodes all bytes from the input byte array using the {@link Base64}
* encoding scheme, writing the results into the given output byte array,
* starting at offset 0.
*
* <p> It is the responsibility of the invoker of this method to make
* sure the output byte array {@code dst} has enough space for decoding
* all bytes from the input byte array. No bytes will be be written to
* the output byte array if the output byte array is not big enough.
*
* <p> If the input byte array is not in valid Base64 encoding scheme
* then some bytes may have been written to the output byte array before
* IllegalargumentException is thrown.
*
* @param src
* the byte array to decode
* @param dst
* the output byte array
*
* @return The number of bytes written to the output byte array
*
* @throws IllegalArgumentException
* if {@code src} is not in valid Base64 scheme, or {@code dst}
* does not have enough space for decoding all input bytes.
*/
public int decode(byte[] src, byte[] dst) {
int len = outLength(src, 0, src.length);
if (dst.length < len)
throw new IllegalArgumentException(
"Output byte array is too small for decoding all input bytes");
return decode0(src, 0, src.length, dst);
}
/**
* Decodes all bytes from the input byte buffer using the {@link Base64}
* encoding scheme, writing the results into a newly-allocated ByteBuffer.
*
* <p> Upon return, the source buffer's position will be updated to
* its limit; its limit will not have been changed. The returned
* output buffer's position will be zero and its limit will be the
* number of resulting decoded bytes
*
* <p> {@code IllegalArgumentException} is thrown if the input buffer
* is not in valid Base64 encoding scheme. The position of the input
* buffer will not be advanced in this case.
*
* @param buffer
* the ByteBuffer to decode
*
* @return A newly-allocated byte buffer containing the decoded bytes
*
* @throws IllegalArgumentException
* if {@code src} is not in valid Base64 scheme.
*/
public ByteBuffer decode(ByteBuffer buffer) {
int pos0 = buffer.position();
try {
byte[] src;
int sp, sl;
if (buffer.hasArray()) {
src = buffer.array();
sp = buffer.arrayOffset() + buffer.position();
sl = buffer.arrayOffset() + buffer.limit();
buffer.position(buffer.limit());
} else {
src = new byte[buffer.remaining()];
buffer.get(src);
sp = 0;
sl = src.length;
}
byte[] dst = new byte[outLength(src, sp, sl)];
return ByteBuffer.wrap(dst, 0, decode0(src, sp, sl, dst));
} catch (IllegalArgumentException iae) {
buffer.position(pos0);
throw iae;
}
}
private int outLength(byte[] src, int sp, int sl) {
int[] base64 = isURL ? fromBase64URL : fromBase64;
int paddings = 0;
int len = sl - sp;
if (len == 0)
return 0;
if (len < 2) {
if (isMIME && base64[0] == -1)
return 0;
throw new IllegalArgumentException(
"Input byte[] should at least have 2 bytes for base64 bytes");
}
if (isMIME) {
// scan all bytes to fill out all non-alphabet. a performance
// trade-off of pre-scan or Arrays.copyOf
int n = 0;
while (sp < sl) {
int b = src[sp++] & 0xff;
if (b == '=') {
len -= (sl - sp + 1);
break;
}
if ((b = base64[b]) == -1)
n++;
}
len -= n;
} else {
if (src[sl - 1] == '=') {
paddings++;
if (src[sl - 2] == '=')
paddings++;
}
}
if (paddings == 0 && (len & 0x3) != 0)
paddings = 4 - (len & 0x3);
return 3 * ((len + 3) / 4) - paddings;
}
private int decode0(byte[] src, int sp, int sl, byte[] dst) {
int[] base64 = isURL ? fromBase64URL : fromBase64;
int dp = 0;
int bits = 0;
int shiftto = 18; // pos of first byte of 4-byte atom
while (sp < sl) {
int b = src[sp++] & 0xff;
if ((b = base64[b]) < 0) {
if (b == -2) { // padding byte '='
// = shiftto==18 unnecessary padding
// x= shiftto==12 a dangling single x
// x to be handled together with non-padding case
// xx= shiftto==6&&sp==sl missing last =
// xx=y shiftto==6 last is not =
if (shiftto == 6 && (sp == sl || src[sp++] != '=') ||
shiftto == 18) {
throw new IllegalArgumentException(
"Input byte array has wrong 4-byte ending unit");
}
break;
}
if (isMIME) // skip if for rfc2045
continue;
else
throw new IllegalArgumentException(
"Illegal base64 character " +
Integer.toString(src[sp - 1], 16));
}
bits |= (b << shiftto);
shiftto -= 6;
if (shiftto < 0) {
dst[dp++] = (byte)(bits >> 16);
dst[dp++] = (byte)(bits >> 8);
dst[dp++] = (byte)(bits);
shiftto = 18;
bits = 0;
}
}
// reached end of byte array or hit padding '=' characters.
if (shiftto == 6) {
dst[dp++] = (byte)(bits >> 16);
} else if (shiftto == 0) {
dst[dp++] = (byte)(bits >> 16);
dst[dp++] = (byte)(bits >> 8);
} else if (shiftto == 12) {
// dangling single "x", incorrectly encoded.
throw new IllegalArgumentException(
"Last unit does not have enough valid bits");
}
// anything left is invalid, if is not MIME.
// if MIME, ignore all non-base64 character
while (sp < sl) {
if (isMIME && base64[src[sp++]] < 0)
continue;
throw new IllegalArgumentException(
"Input byte array has incorrect ending byte at " + sp);
}
return dp;
}
}
}

@ -0,0 +1,16 @@
package com.zhehekeji.web.lib.common;
import javax.swing.*;
import javax.swing.border.Border;
/*
*
*/
public class BorderEx {
public static void set(JComponent object, String title, int width) {
Border innerBorder = BorderFactory.createTitledBorder(title);
Border outerBorder = BorderFactory.createEmptyBorder(width, width, width, width);
object.setBorder(BorderFactory.createCompoundBorder(outerBorder, innerBorder));
}
}

@ -0,0 +1,93 @@
package com.zhehekeji.web.lib.common;
import java.lang.reflect.Method;
import java.util.NoSuchElementException;
import java.util.Scanner;
import java.util.Vector;
public class CaseMenu {
public static class Item {
private Object object;
private String itemName;
private String methodName;
public Item(Object object, String itemName, String methodName) {
super();
this.object = object;
this.itemName = itemName;
this.methodName = methodName;
}
public Object getObject() {
return object;
}
public String getItemName() {
return itemName;
}
public String getMethodName() {
return methodName;
}
}
private Vector<Item> items;
public CaseMenu() {
super();
items = new Vector<Item>();
}
public void addItem(Item item) {
items.add(item);
}
private void showItem() {
final String format = "%2d\t%-20s\n";
int index = 0;
System.out.printf(format, index++, "exit App");
for (Item item : items) {
System.out.printf(format, index++, item.getItemName());
}
System.out.println("Please input a item index to invoke the method:");
}
public void run() {
Scanner scanner = new Scanner(System.in);
while(true) {
showItem();
try {
int input = Integer.parseInt(scanner.nextLine());
if (input <= 0 ) {
System.err.println("input <= 0 || scanner.nextLine() == null");
// scanner.close();
// System.exit(0);
break;
}
if (input < 0 || input > items.size()) {
System.err.println("Input Error Item Index.");
continue;
}
Item item = items.get(input - 1);
Class<?> itemClass = item.getObject().getClass();
Method method = itemClass.getMethod(item.getMethodName());
method.invoke(item.getObject());
} catch (NoSuchElementException e) {
// scanner.close();
// System.exit(0);
break;
} catch (NumberFormatException e) {
System.err.println("Input Error NumberFormat.");
continue;
} catch (Exception e) {
e.printStackTrace();
}
}
scanner.close();
}
}

@ -0,0 +1,871 @@
package com.zhehekeji.web.lib.common;
import com.zhehekeji.web.lib.NetSDKLib;
/**
*
*/
public class ErrorCode {
/**
*
* @param err CLIENT_GetLastError, error code: (0x80000000|" + (LoginModule.netsdk.CLIENT_GetLastError() & 0x7fffffff) +")
* @return
*/
public static String getErrorCode(int err) {
String msg = "";
switch(err) {
case NetSDKLib.NET_NOERROR: // 0 没有错误
msg = Res.string().getBundle().getString("NET_ERROR");
break;
case NetSDKLib.NET_ERROR: // -1 未知错误
msg = Res.string().getBundle().getString("NET_ERROR");
break;
case NetSDKLib.NET_SYSTEM_ERROR: // (0x80000000|1) Windows系统出错
msg = Res.string().getBundle().getString("NET_SYSTEM_ERROR");
break;
case NetSDKLib.NET_NETWORK_ERROR: // (0x80000000|2) 网络错误,可能是因为网络超时
msg = Res.string().getBundle().getString("NET_NETWORK_ERROR");
break;
case NetSDKLib.NET_DEV_VER_NOMATCH: // (0x80000000|3) 设备协议不匹配
msg = Res.string().getBundle().getString("NET_DEV_VER_NOMATCH");
break;
case NetSDKLib.NET_INVALID_HANDLE: // (0x80000000|4) 句柄无效
msg = Res.string().getBundle().getString("NET_INVALID_HANDLE");
break;
case NetSDKLib.NET_OPEN_CHANNEL_ERROR: // (0x80000000|5) 打开通道失败
msg = Res.string().getBundle().getString("NET_OPEN_CHANNEL_ERROR");
break;
case NetSDKLib.NET_CLOSE_CHANNEL_ERROR: // (0x80000000|6) 关闭通道失败
msg = Res.string().getBundle().getString("NET_CLOSE_CHANNEL_ERROR");
break;
case NetSDKLib.NET_ILLEGAL_PARAM: // (0x80000000|7) 用户参数不合法
msg = Res.string().getBundle().getString("NET_ILLEGAL_PARAM");
break;
case NetSDKLib.NET_SDK_INIT_ERROR: // (0x80000000|8) SDK初始化出错
msg = Res.string().getBundle().getString("NET_SDK_INIT_ERROR");
break;
case NetSDKLib.NET_SDK_UNINIT_ERROR: // (0x80000000|9) SDK清理出错
msg = Res.string().getBundle().getString("NET_SDK_UNINIT_ERROR");
break;
case NetSDKLib.NET_RENDER_OPEN_ERROR: // (0x80000000|10) 申请render资源出错
msg = Res.string().getBundle().getString("NET_RENDER_OPEN_ERROR");
break;
case NetSDKLib.NET_DEC_OPEN_ERROR: // (0x80000000|11) 打开解码库出错
msg = Res.string().getBundle().getString("NET_DEC_OPEN_ERROR");
break;
case NetSDKLib.NET_DEC_CLOSE_ERROR: // (0x80000000|12) 关闭解码库出错
msg = Res.string().getBundle().getString("NET_DEC_CLOSE_ERROR");
break;
case NetSDKLib.NET_MULTIPLAY_NOCHANNEL: // (0x80000000|13) 多画面预览中检测到通道数为0
msg = Res.string().getBundle().getString("NET_MULTIPLAY_NOCHANNEL");
break;
case NetSDKLib.NET_TALK_INIT_ERROR: // (0x80000000|14) 录音库初始化失败
msg = Res.string().getBundle().getString("NET_TALK_INIT_ERROR");
break;
case NetSDKLib.NET_TALK_NOT_INIT: // (0x80000000|15) 录音库未经初始化
msg = Res.string().getBundle().getString("NET_TALK_NOT_INIT");
break;
case NetSDKLib.NET_TALK_SENDDATA_ERROR: // (0x80000000|16) 发送音频数据出错
msg = Res.string().getBundle().getString("NET_TALK_SENDDATA_ERROR");
break;
case NetSDKLib.NET_REAL_ALREADY_SAVING: // (0x80000000|17) 实时数据已经处于保存状态
msg = Res.string().getBundle().getString("NET_REAL_ALREADY_SAVING");
break;
case NetSDKLib.NET_NOT_SAVING: // (0x80000000|18) 未保存实时数据
msg = Res.string().getBundle().getString("NET_NOT_SAVING");
break;
case NetSDKLib.NET_OPEN_FILE_ERROR: // (0x80000000|19) 打开文件出错
msg = Res.string().getBundle().getString("NET_OPEN_FILE_ERROR");
break;
case NetSDKLib.NET_PTZ_SET_TIMER_ERROR: // (0x80000000|20) 启动云台控制定时器失败
msg = Res.string().getBundle().getString("NET_PTZ_SET_TIMER_ERROR");
break;
case NetSDKLib.NET_RETURN_DATA_ERROR: // (0x80000000|21) 对返回数据的校验出错
msg = Res.string().getBundle().getString("NET_RETURN_DATA_ERROR");
break;
case NetSDKLib.NET_INSUFFICIENT_BUFFER: // (0x80000000|22) 没有足够的缓存
msg = Res.string().getBundle().getString("NET_INSUFFICIENT_BUFFER");
break;
case NetSDKLib.NET_NOT_SUPPORTED: // (0x80000000|23) 当前SDK未支持该功能
msg = Res.string().getBundle().getString("NET_NOT_SUPPORTED");
break;
case NetSDKLib.NET_NO_RECORD_FOUND: // (0x80000000|24) 查询不到录像
msg = Res.string().getBundle().getString("NET_NO_RECORD_FOUND");
break;
case NetSDKLib.NET_NOT_AUTHORIZED: // (0x80000000|25) 无操作权限
msg = Res.string().getBundle().getString("NET_NOT_AUTHORIZED");
break;
case NetSDKLib.NET_NOT_NOW: // (0x80000000|26) 暂时无法执行
msg = Res.string().getBundle().getString("NET_NOT_NOW");
break;
case NetSDKLib.NET_NO_TALK_CHANNEL: // (0x80000000|27) 未发现对讲通道
msg = Res.string().getBundle().getString("NET_NO_TALK_CHANNEL");
break;
case NetSDKLib.NET_NO_AUDIO: // (0x80000000|28) 未发现音频
msg = Res.string().getBundle().getString("NET_NO_AUDIO");
break;
case NetSDKLib.NET_NO_INIT: // (0x80000000|29) 网络SDK未经初始化
msg = Res.string().getBundle().getString("NET_NO_INIT");
break;
case NetSDKLib.NET_DOWNLOAD_END: // (0x80000000|30) 下载已结束
msg = Res.string().getBundle().getString("NET_DOWNLOAD_END");
break;
case NetSDKLib.NET_EMPTY_LIST: // (0x80000000|31) 查询结果为空
msg = Res.string().getBundle().getString("NET_EMPTY_LIST");
break;
case NetSDKLib.NET_ERROR_GETCFG_SYSATTR: // (0x80000000|32) 获取系统属性配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_SYSATTR");
break;
case NetSDKLib.NET_ERROR_GETCFG_SERIAL: // (0x80000000|33) 获取序列号失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_SERIAL");
break;
case NetSDKLib.NET_ERROR_GETCFG_GENERAL: // (0x80000000|34) 获取常规属性失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_GENERAL");
break;
case NetSDKLib.NET_ERROR_GETCFG_DSPCAP: // (0x80000000|35) 获取DSP能力描述失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_DSPCAP");
break;
case NetSDKLib.NET_ERROR_GETCFG_NETCFG: // (0x80000000|36) 获取网络配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_NETCFG");
break;
case NetSDKLib.NET_ERROR_GETCFG_CHANNAME: // (0x80000000|37) 获取通道名称失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_CHANNAME");
break;
case NetSDKLib.NET_ERROR_GETCFG_VIDEO: // (0x80000000|38) 获取视频属性失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_VIDEO");
break;
case NetSDKLib.NET_ERROR_GETCFG_RECORD: // (0x80000000|39) 获取录象配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_RECORD");
break;
case NetSDKLib.NET_ERROR_GETCFG_PRONAME: // (0x80000000|40) 获取解码器协议名称失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_PRONAME");
break;
case NetSDKLib.NET_ERROR_GETCFG_FUNCNAME: // (0x80000000|41) 获取232串口功能名称失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_FUNCNAME");
break;
case NetSDKLib.NET_ERROR_GETCFG_485DECODER: // (0x80000000|42) 获取解码器属性失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_485DECODER");
break;
case NetSDKLib.NET_ERROR_GETCFG_232COM: // (0x80000000|43) 获取232串口配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_232COM");
break;
case NetSDKLib.NET_ERROR_GETCFG_ALARMIN: // (0x80000000|44) 获取外部报警输入配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_ALARMIN");
break;
case NetSDKLib.NET_ERROR_GETCFG_ALARMDET: // (0x80000000|45) 获取动态检测报警失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_ALARMDET");
break;
case NetSDKLib.NET_ERROR_GETCFG_SYSTIME: // (0x80000000|46) 获取设备时间失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_SYSTIME");
break;
case NetSDKLib.NET_ERROR_GETCFG_PREVIEW: // (0x80000000|47) 获取预览参数失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_PREVIEW");
break;
case NetSDKLib.NET_ERROR_GETCFG_AUTOMT: // (0x80000000|48) 获取自动维护配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_AUTOMT");
break;
case NetSDKLib.NET_ERROR_GETCFG_VIDEOMTRX: // (0x80000000|49) 获取视频矩阵配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_VIDEOMTRX");
break;
case NetSDKLib.NET_ERROR_GETCFG_COVER: // (0x80000000|50) 获取区域遮挡配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_COVER");
break;
case NetSDKLib.NET_ERROR_GETCFG_WATERMAKE: // (0x80000000|51) 获取图象水印配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_WATERMAKE");
break;
case NetSDKLib.NET_ERROR_GETCFG_MULTICAST: // (0x80000000|52) 获取配置失败位置:组播端口按通道配置
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_MULTICAST");
break;
case NetSDKLib.NET_ERROR_SETCFG_GENERAL: // (0x80000000|55) 修改常规属性失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_GENERAL");
break;
case NetSDKLib.NET_ERROR_SETCFG_NETCFG: // (0x80000000|56) 改网络配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_NETCFG");
break;
case NetSDKLib.NET_ERROR_SETCFG_CHANNAME: // (0x80000000|57) 修改通道名称失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_CHANNAME");
break;
case NetSDKLib.NET_ERROR_SETCFG_VIDEO: // (0x80000000|58) 修改视频属性失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_VIDEO");
break;
case NetSDKLib.NET_ERROR_SETCFG_RECORD: // (0x80000000|59) 修改录象配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_RECORD");
break;
case NetSDKLib.NET_ERROR_SETCFG_485DECODER: // (0x80000000|60) 修改解码器属性失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_485DECODER");
break;
case NetSDKLib.NET_ERROR_SETCFG_232COM: // (0x80000000|61) 修改232串口配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_232COM");
break;
case NetSDKLib.NET_ERROR_SETCFG_ALARMIN: // (0x80000000|62) 修改外部输入报警配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_ALARMIN");
break;
case NetSDKLib.NET_ERROR_SETCFG_ALARMDET: // (0x80000000|63) 修改动态检测报警配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_ALARMDET");
break;
case NetSDKLib.NET_ERROR_SETCFG_SYSTIME: // (0x80000000|64) 修改设备时间失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_SYSTIME");
break;
case NetSDKLib.NET_ERROR_SETCFG_PREVIEW: // (0x80000000|65) 修改预览参数失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_PREVIEW");
break;
case NetSDKLib.NET_ERROR_SETCFG_AUTOMT: // (0x80000000|66) 修改自动维护配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_AUTOMT");
break;
case NetSDKLib.NET_ERROR_SETCFG_VIDEOMTRX: // (0x80000000|67) 修改视频矩阵配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_VIDEOMTRX");
break;
case NetSDKLib.NET_ERROR_SETCFG_COVER: // (0x80000000|68) 修改区域遮挡配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_COVER");
break;
case NetSDKLib.NET_ERROR_SETCFG_WATERMAKE: // (0x80000000|69) 修改图象水印配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_WATERMAKE");
break;
case NetSDKLib.NET_ERROR_SETCFG_WLAN: // (0x80000000|70) 修改无线网络信息失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_WLAN");
break;
case NetSDKLib.NET_ERROR_SETCFG_WLANDEV: // (0x80000000|71) 选择无线网络设备失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_WLANDEV");
break;
case NetSDKLib.NET_ERROR_SETCFG_REGISTER: // (0x80000000|72) 修改主动注册参数配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_REGISTER");
break;
case NetSDKLib.NET_ERROR_SETCFG_CAMERA: // (0x80000000|73) 修改摄像头属性配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_CAMERA");
break;
case NetSDKLib.NET_ERROR_SETCFG_INFRARED: // (0x80000000|74) 修改红外报警配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_INFRARED");
break;
case NetSDKLib.NET_ERROR_SETCFG_SOUNDALARM: // (0x80000000|75) 修改音频报警配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_SOUNDALARM");
break;
case NetSDKLib.NET_ERROR_SETCFG_STORAGE: // (0x80000000|76) 修改存储位置配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_STORAGE");
break;
case NetSDKLib.NET_AUDIOENCODE_NOTINIT: // (0x80000000|77) 音频编码接口没有成功初始化
msg = Res.string().getBundle().getString("NET_AUDIOENCODE_NOTINIT");
break;
case NetSDKLib.NET_DATA_TOOLONGH: // (0x80000000|78) 数据过长
msg = Res.string().getBundle().getString("NET_DATA_TOOLONGH");
break;
case NetSDKLib.NET_UNSUPPORTED: // (0x80000000|79) 备不支持该操作
msg = Res.string().getBundle().getString("NET_UNSUPPORTED");
break;
case NetSDKLib.NET_DEVICE_BUSY: // (0x80000000|80) 设备资源不足
msg = Res.string().getBundle().getString("NET_DEVICE_BUSY");
break;
case NetSDKLib.NET_SERVER_STARTED: // (0x80000000|81) 服务器已经启动
msg = Res.string().getBundle().getString("NET_SERVER_STARTED");
break;
case NetSDKLib.NET_SERVER_STOPPED: // (0x80000000|82) 服务器尚未成功启动
msg = Res.string().getBundle().getString("NET_SERVER_STOPPED");
break;
case NetSDKLib.NET_LISTER_INCORRECT_SERIAL: // (0x80000000|83) 输入序列号有误
msg = Res.string().getBundle().getString("NET_LISTER_INCORRECT_SERIAL");
break;
case NetSDKLib.NET_QUERY_DISKINFO_FAILED: // (0x80000000|84) 获取硬盘信息失败
msg = Res.string().getBundle().getString("NET_QUERY_DISKINFO_FAILED");
break;
case NetSDKLib.NET_ERROR_GETCFG_SESSION: // (0x80000000|85) 获取连接Session信息
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_SESSION");
break;
case NetSDKLib.NET_USER_FLASEPWD_TRYTIME: // (0x80000000|86) 输入密码错误超过限制次数
msg = Res.string().getBundle().getString("NET_USER_FLASEPWD_TRYTIME");
break;
case NetSDKLib.NET_LOGIN_ERROR_PASSWORD: // (0x80000000|100) 密码不正确
msg = Res.string().getBundle().getString("NET_LOGIN_ERROR_PASSWORD");
break;
case NetSDKLib.NET_LOGIN_ERROR_USER: // (0x80000000|101) 帐户不存在
msg = Res.string().getBundle().getString("NET_LOGIN_ERROR_USER");
break;
case NetSDKLib.NET_LOGIN_ERROR_TIMEOUT: // (0x80000000|102) 等待登录返回超时
msg = Res.string().getBundle().getString("NET_LOGIN_ERROR_TIMEOUT");
break;
case NetSDKLib.NET_LOGIN_ERROR_RELOGGIN: // (0x80000000|103) 帐号已登录
msg = Res.string().getBundle().getString("NET_LOGIN_ERROR_RELOGGIN");
break;
case NetSDKLib.NET_LOGIN_ERROR_LOCKED: // (0x80000000|104) 帐号已被锁定
msg = Res.string().getBundle().getString("NET_LOGIN_ERROR_LOCKED");
break;
case NetSDKLib.NET_LOGIN_ERROR_BLACKLIST: // (0x80000000|105) 帐号已被列为黑名单
msg = Res.string().getBundle().getString("NET_LOGIN_ERROR_BLACKLIST");
break;
case NetSDKLib.NET_LOGIN_ERROR_BUSY: // (0x80000000|106) 资源不足,系统忙
msg = Res.string().getBundle().getString("NET_LOGIN_ERROR_BUSY");
break;
case NetSDKLib.NET_LOGIN_ERROR_CONNECT: // (0x80000000|107) 登录设备超时,请检查网络并重试
msg = Res.string().getBundle().getString("NET_LOGIN_ERROR_CONNECT");
break;
case NetSDKLib.NET_LOGIN_ERROR_NETWORK: // (0x80000000|108) 网络连接失败
msg = Res.string().getBundle().getString("NET_LOGIN_ERROR_NETWORK");
break;
case NetSDKLib.NET_LOGIN_ERROR_SUBCONNECT: // (0x80000000|109) 登录设备成功,但无法创建视频通道,请检查网
msg = Res.string().getBundle().getString("NET_LOGIN_ERROR_SUBCONNECT");
break;
case NetSDKLib.NET_LOGIN_ERROR_MAXCONNECT: // (0x80000000|110) 超过最大连接数
msg = Res.string().getBundle().getString("NET_LOGIN_ERROR_MAXCONNECT");
break;
case NetSDKLib.NET_LOGIN_ERROR_PROTOCOL3_ONLY: // (0x80000000|111) 只支持3代协议
msg = Res.string().getBundle().getString("NET_LOGIN_ERROR_PROTOCOL3_ONLY");
break;
case NetSDKLib.NET_LOGIN_ERROR_UKEY_LOST: // (0x80000000|112) 插入U盾或U盾信息错误
msg = Res.string().getBundle().getString("NET_LOGIN_ERROR_UKEY_LOST");
break;
case NetSDKLib.NET_LOGIN_ERROR_NO_AUTHORIZED: // (0x80000000|113) 客户端IP地址没有登录权限
msg = Res.string().getBundle().getString("NET_LOGIN_ERROR_NO_AUTHORIZED");
break;
case NetSDKLib.NET_LOGIN_ERROR_USER_OR_PASSOWRD: // (0x80000000|117) 账号或密码错误
msg = Res.string().getBundle().getString("NET_LOGIN_ERROR_USER_OR_PASSOWRD");
break;
case NetSDKLib.NET_LOGIN_ERROR_DEVICE_NOT_INIT: // (0x80000000|118) 设备尚未初始化,不能登录,请先初始化设备
msg = Res.string().getBundle().getString("NET_LOGIN_ERROR_DEVICE_NOT_INIT");
break;
case NetSDKLib.NET_RENDER_SOUND_ON_ERROR: // (0x80000000|120) Render库打开音频出错
msg = Res.string().getBundle().getString("NET_RENDER_SOUND_ON_ERROR");
break;
case NetSDKLib.NET_RENDER_SOUND_OFF_ERROR: // (0x80000000|121) Render库关闭音频出错
msg = Res.string().getBundle().getString("NET_RENDER_SOUND_OFF_ERROR");
break;
case NetSDKLib.NET_RENDER_SET_VOLUME_ERROR: // (0x80000000|122) Render库控制音量出错
msg = Res.string().getBundle().getString("NET_RENDER_SET_VOLUME_ERROR");
break;
case NetSDKLib.NET_RENDER_ADJUST_ERROR: // (0x80000000|123) Render库设置画面参数出错
msg = Res.string().getBundle().getString("NET_RENDER_ADJUST_ERROR");
break;
case NetSDKLib.NET_RENDER_PAUSE_ERROR: // (0x80000000|124) Render库暂停播放出错
msg = Res.string().getBundle().getString("NET_RENDER_PAUSE_ERROR");
break;
case NetSDKLib.NET_RENDER_SNAP_ERROR: // (0x80000000|125) Render库抓图出错
msg = Res.string().getBundle().getString("NET_RENDER_SNAP_ERROR");
break;
case NetSDKLib.NET_RENDER_STEP_ERROR: // (0x80000000|126) Render库步进出错
msg = Res.string().getBundle().getString("NET_RENDER_STEP_ERROR");
break;
case NetSDKLib.NET_RENDER_FRAMERATE_ERROR: // (0x80000000|127) Render库设置帧率出错
msg = Res.string().getBundle().getString("NET_RENDER_FRAMERATE_ERROR");
break;
case NetSDKLib.NET_RENDER_DISPLAYREGION_ERROR: // (0x80000000|128) Render库设置显示区域出错
msg = Res.string().getBundle().getString("NET_RENDER_DISPLAYREGION_ERROR");
break;
case NetSDKLib.NET_RENDER_GETOSDTIME_ERROR: // (0x80000000|129) Render库获取当前播放时间出错
msg = Res.string().getBundle().getString("NET_RENDER_GETOSDTIME_ERROR");
break;
case NetSDKLib.NET_GROUP_EXIST: // (0x80000000|140) 组名已存在
msg = Res.string().getBundle().getString("NET_GROUP_EXIST");
break;
case NetSDKLib.NET_GROUP_NOEXIST: // (0x80000000|141) 组名不存在
msg = Res.string().getBundle().getString("NET_GROUP_NOEXIST");
break;
case NetSDKLib.NET_GROUP_RIGHTOVER: // (0x80000000|142) 组的权限超出权限列表范围
msg = Res.string().getBundle().getString("NET_GROUP_RIGHTOVER");
break;
case NetSDKLib.NET_GROUP_HAVEUSER: // (0x80000000|143) 组下有用户,不能删除
msg = Res.string().getBundle().getString("NET_GROUP_HAVEUSER");
break;
case NetSDKLib.NET_GROUP_RIGHTUSE: // (0x80000000|144) 组的某个权限被用户使用,不能出除
msg = Res.string().getBundle().getString("NET_GROUP_RIGHTUSE");
break;
case NetSDKLib.NET_GROUP_SAMENAME: // (0x80000000|145) 新组名同已有组名重复
msg = Res.string().getBundle().getString("NET_GROUP_SAMENAME");
break;
case NetSDKLib.NET_USER_EXIST: // (0x80000000|146) 用户已存在
msg = Res.string().getBundle().getString("NET_USER_EXIST");
break;
case NetSDKLib.NET_USER_NOEXIST: // (0x80000000|147) 用户不存在
msg = Res.string().getBundle().getString("NET_USER_NOEXIST");
break;
case NetSDKLib.NET_USER_RIGHTOVER: // (0x80000000|148) 用户权限超出组权限
msg = Res.string().getBundle().getString("NET_USER_RIGHTOVER");
break;
case NetSDKLib.NET_USER_PWD: // (0x80000000|149) 保留帐号,不容许修改密码
msg = Res.string().getBundle().getString("NET_USER_PWD");
break;
case NetSDKLib.NET_USER_FLASEPWD: // (0x80000000|150) 密码不正确
msg = Res.string().getBundle().getString("NET_USER_FLASEPWD");
break;
case NetSDKLib.NET_USER_NOMATCHING: // (0x80000000|151) 密码不匹配
msg = Res.string().getBundle().getString("NET_USER_NOMATCHING");
break;
case NetSDKLib.NET_USER_INUSE: // (0x80000000|152) 账号正在使用中
msg = Res.string().getBundle().getString("NET_USER_INUSE");
break;
case NetSDKLib.NET_ERROR_GETCFG_ETHERNET: // (0x80000000|300) 获取网卡配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_ETHERNET");
break;
case NetSDKLib.NET_ERROR_GETCFG_WLAN: // (0x80000000|301) 获取无线网络信息失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_WLAN");
break;
case NetSDKLib.NET_ERROR_GETCFG_WLANDEV: // (0x80000000|302) 获取无线网络设备失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_WLANDEV");
break;
case NetSDKLib.NET_ERROR_GETCFG_REGISTER: // (0x80000000|303) 获取主动注册参数失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_REGISTER");
break;
case NetSDKLib.NET_ERROR_GETCFG_CAMERA: // (0x80000000|304) 获取摄像头属性失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_CAMERA");
break;
case NetSDKLib.NET_ERROR_GETCFG_INFRARED: // (0x80000000|305) 获取红外报警配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_INFRARED");
break;
case NetSDKLib.NET_ERROR_GETCFG_SOUNDALARM: // (0x80000000|306) 获取音频报警配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_SOUNDALARM");
break;
case NetSDKLib.NET_ERROR_GETCFG_STORAGE: // (0x80000000|307) 获取存储位置配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_STORAGE");
break;
case NetSDKLib.NET_ERROR_GETCFG_MAIL: // (0x80000000|308) 获取邮件配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_MAIL");
break;
case NetSDKLib.NET_CONFIG_DEVBUSY: // (0x80000000|309) 暂时无法设置
msg = Res.string().getBundle().getString("NET_CONFIG_DEVBUSY");
break;
case NetSDKLib.NET_CONFIG_DATAILLEGAL: // (0x80000000|310) 配置数据不合法
msg = Res.string().getBundle().getString("NET_CONFIG_DATAILLEGAL");
break;
case NetSDKLib.NET_ERROR_GETCFG_DST: // (0x80000000|311) 获取夏令时配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_DST");
break;
case NetSDKLib.NET_ERROR_SETCFG_DST: // (0x80000000|312) 设置夏令时配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_DST");
break;
case NetSDKLib.NET_ERROR_GETCFG_VIDEO_OSD: // (0x80000000|313) 获取视频OSD叠加配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_VIDEO_OSD");
break;
case NetSDKLib.NET_ERROR_SETCFG_VIDEO_OSD: // (0x80000000|314) 设置视频OSD叠加配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_VIDEO_OSD");
break;
case NetSDKLib.NET_ERROR_GETCFG_GPRSCDMA: // (0x80000000|315) 获取CDMA\GPRS网络配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_GPRSCDMA");
break;
case NetSDKLib.NET_ERROR_SETCFG_GPRSCDMA: // (0x80000000|316) 设置CDMA\GPRS网络配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_GPRSCDMA");
break;
case NetSDKLib.NET_ERROR_GETCFG_IPFILTER: // (0x80000000|317) 获取IP过滤配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_IPFILTER");
break;
case NetSDKLib.NET_ERROR_SETCFG_IPFILTER: // (0x80000000|318) 设置IP过滤配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_IPFILTER");
break;
case NetSDKLib.NET_ERROR_GETCFG_TALKENCODE: // (0x80000000|319) 获取语音对讲编码配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_TALKENCODE");
break;
case NetSDKLib.NET_ERROR_SETCFG_TALKENCODE: // (0x80000000|320) 设置语音对讲编码配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_TALKENCODE");
break;
case NetSDKLib.NET_ERROR_GETCFG_RECORDLEN: // (0x80000000|321) 获取录像打包长度配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_RECORDLEN");
break;
case NetSDKLib.NET_ERROR_SETCFG_RECORDLEN: // (0x80000000|322) 设置录像打包长度配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_RECORDLEN");
break;
case NetSDKLib.NET_DONT_SUPPORT_SUBAREA: // (0x80000000|323) 不支持网络硬盘分区
msg = Res.string().getBundle().getString("NET_DONT_SUPPORT_SUBAREA");
break;
case NetSDKLib.NET_ERROR_GET_AUTOREGSERVER: // (0x80000000|324) 获取设备上主动注册服务器信息失败
msg = Res.string().getBundle().getString("NET_ERROR_GET_AUTOREGSERVER");
break;
case NetSDKLib.NET_ERROR_CONTROL_AUTOREGISTER: // (0x80000000|325) 主动注册重定向注册错误
msg = Res.string().getBundle().getString("NET_ERROR_CONTROL_AUTOREGISTER");
break;
case NetSDKLib.NET_ERROR_DISCONNECT_AUTOREGISTER: // (0x80000000|326) 断开主动注册服务器错误
msg = Res.string().getBundle().getString("NET_ERROR_DISCONNECT_AUTOREGISTER");
break;
case NetSDKLib.NET_ERROR_GETCFG_MMS: // (0x80000000|327) 获取mms配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_MMS");
break;
case NetSDKLib.NET_ERROR_SETCFG_MMS: // (0x80000000|328) 设置mms配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_MMS");
break;
case NetSDKLib.NET_ERROR_GETCFG_SMSACTIVATION: // (0x80000000|329) 获取短信激活无线连接配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_SMSACTIVATION");
break;
case NetSDKLib.NET_ERROR_SETCFG_SMSACTIVATION: // (0x80000000|330) 设置短信激活无线连接配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_SMSACTIVATION");
break;
case NetSDKLib.NET_ERROR_GETCFG_DIALINACTIVATION: // (0x80000000|331) 获取拨号激活无线连接配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_DIALINACTIVATION");
break;
case NetSDKLib.NET_ERROR_SETCFG_DIALINACTIVATION: // (0x80000000|332) 设置拨号激活无线连接配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_DIALINACTIVATION");
break;
case NetSDKLib.NET_ERROR_GETCFG_VIDEOOUT: // (0x80000000|333) 查询视频输出参数配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_VIDEOOUT");
break;
case NetSDKLib.NET_ERROR_SETCFG_VIDEOOUT: // (0x80000000|334) 设置视频输出参数配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_VIDEOOUT");
break;
case NetSDKLib.NET_ERROR_GETCFG_OSDENABLE: // (0x80000000|335) 获取osd叠加使能配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_OSDENABLE");
break;
case NetSDKLib.NET_ERROR_SETCFG_OSDENABLE: // (0x80000000|336) 设置osd叠加使能配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_OSDENABLE");
break;
case NetSDKLib.NET_ERROR_SETCFG_ENCODERINFO: // (0x80000000|337) 设置数字通道前端编码接入配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_ENCODERINFO");
break;
case NetSDKLib.NET_ERROR_GETCFG_TVADJUST: // (0x80000000|338) 获取TV调节配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_TVADJUST");
break;
case NetSDKLib.NET_ERROR_SETCFG_TVADJUST: // (0x80000000|339) 设置TV调节配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_TVADJUST");
break;
case NetSDKLib.NET_ERROR_CONNECT_FAILED: // (0x80000000|340) 请求建立连接失败
msg = Res.string().getBundle().getString("NET_ERROR_CONNECT_FAILED");
break;
case NetSDKLib.NET_ERROR_SETCFG_BURNFILE: // (0x80000000|341) 请求刻录文件上传失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_BURNFILE");
break;
case NetSDKLib.NET_ERROR_SNIFFER_GETCFG: // (0x80000000|342) 获取抓包配置信息失败
msg = Res.string().getBundle().getString("NET_ERROR_SNIFFER_GETCFG");
break;
case NetSDKLib.NET_ERROR_SNIFFER_SETCFG: // (0x80000000|343) 设置抓包配置信息失败
msg = Res.string().getBundle().getString("NET_ERROR_SNIFFER_SETCFG");
break;
case NetSDKLib.NET_ERROR_DOWNLOADRATE_GETCFG: // (0x80000000|344) 查询下载限制信息失败
msg = Res.string().getBundle().getString("NET_ERROR_DOWNLOADRATE_GETCFG");
break;
case NetSDKLib.NET_ERROR_DOWNLOADRATE_SETCFG: // (0x80000000|345) 设置下载限制信息失败
msg = Res.string().getBundle().getString("NET_ERROR_DOWNLOADRATE_SETCFG");
break;
case NetSDKLib.NET_ERROR_SEARCH_TRANSCOM: // (0x80000000|346) 查询串口参数失败
msg = Res.string().getBundle().getString("NET_ERROR_SEARCH_TRANSCOM");
break;
case NetSDKLib.NET_ERROR_GETCFG_POINT: // (0x80000000|347) 获取预制点信息错误
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_POINT");
break;
case NetSDKLib.NET_ERROR_SETCFG_POINT: // (0x80000000|348) 设置预制点信息错误
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_POINT");
break;
case NetSDKLib.NET_SDK_LOGOUT_ERROR: // (0x80000000|349) SDK没有正常登出设备
msg = Res.string().getBundle().getString("NET_SDK_LOGOUT_ERROR");
break;
case NetSDKLib.NET_ERROR_GET_VEHICLE_CFG: // (0x80000000|350) 获取车载配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GET_VEHICLE_CFG");
break;
case NetSDKLib.NET_ERROR_SET_VEHICLE_CFG: // (0x80000000|351) 设置车载配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SET_VEHICLE_CFG");
break;
case NetSDKLib.NET_ERROR_GET_ATM_OVERLAY_CFG: // (0x80000000|352) 获取atm叠加配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GET_ATM_OVERLAY_CFG");
break;
case NetSDKLib.NET_ERROR_SET_ATM_OVERLAY_CFG: // (0x80000000|353) 设置atm叠加配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SET_ATM_OVERLAY_CFG");
break;
case NetSDKLib.NET_ERROR_GET_ATM_OVERLAY_ABILITY: // (0x80000000|354) 获取atm叠加能力失败
msg = Res.string().getBundle().getString("NET_ERROR_GET_ATM_OVERLAY_ABILITY");
break;
case NetSDKLib.NET_ERROR_GET_DECODER_TOUR_CFG: // (0x80000000|355) 获取解码器解码轮巡配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GET_DECODER_TOUR_CFG");
break;
case NetSDKLib.NET_ERROR_SET_DECODER_TOUR_CFG: // (0x80000000|356) 设置解码器解码轮巡配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SET_DECODER_TOUR_CFG");
break;
case NetSDKLib.NET_ERROR_CTRL_DECODER_TOUR: // (0x80000000|357) 控制解码器解码轮巡失败
msg = Res.string().getBundle().getString("NET_ERROR_CTRL_DECODER_TOUR");
break;
case NetSDKLib.NET_GROUP_OVERSUPPORTNUM: // (0x80000000|358) 超出设备支持最大用户组数目
msg = Res.string().getBundle().getString("NET_GROUP_OVERSUPPORTNUM");
break;
case NetSDKLib.NET_USER_OVERSUPPORTNUM: // (0x80000000|359) 超出设备支持最大用户数目
msg = Res.string().getBundle().getString("NET_USER_OVERSUPPORTNUM");
break;
case NetSDKLib.NET_ERROR_GET_SIP_CFG: // (0x80000000|368) 获取SIP配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GET_SIP_CFG");
break;
case NetSDKLib.NET_ERROR_SET_SIP_CFG: // (0x80000000|369) 设置SIP配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SET_SIP_CFG");
break;
case NetSDKLib.NET_ERROR_GET_SIP_ABILITY: // (0x80000000|370) 获取SIP能力失败
msg = Res.string().getBundle().getString("NET_ERROR_GET_SIP_ABILITY");
break;
case NetSDKLib.NET_ERROR_GET_WIFI_AP_CFG: // (0x80000000|371) 获取WIFI ap配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GET_WIFI_AP_CFG");
break;
case NetSDKLib.NET_ERROR_SET_WIFI_AP_CFG: // (0x80000000|372) 设置WIFI ap配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SET_WIFI_AP_CFG");
break;
case NetSDKLib.NET_ERROR_GET_DECODE_POLICY: // (0x80000000|373) 获取解码策略配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GET_DECODE_POLICY");
break;
case NetSDKLib.NET_ERROR_SET_DECODE_POLICY: // (0x80000000|374) 设置解码策略配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SET_DECODE_POLICY");
break;
case NetSDKLib.NET_ERROR_TALK_REJECT: // (0x80000000|375) 拒绝对讲
msg = Res.string().getBundle().getString("NET_ERROR_TALK_REJECT");
break;
case NetSDKLib.NET_ERROR_TALK_OPENED: // (0x80000000|376) 对讲被其他客户端打开
msg = Res.string().getBundle().getString("NET_ERROR_TALK_OPENED");
break;
case NetSDKLib.NET_ERROR_TALK_RESOURCE_CONFLICIT: // (0x80000000|377) 资源冲突
msg = Res.string().getBundle().getString("NET_ERROR_TALK_RESOURCE_CONFLICIT");
break;
case NetSDKLib.NET_ERROR_TALK_UNSUPPORTED_ENCODE: // (0x80000000|378) 不支持的语音编码格式
msg = Res.string().getBundle().getString("NET_ERROR_TALK_UNSUPPORTED_ENCODE");
break;
case NetSDKLib.NET_ERROR_TALK_RIGHTLESS: // (0x80000000|379) 无权限
msg = Res.string().getBundle().getString("NET_ERROR_TALK_RIGHTLESS");
break;
case NetSDKLib.NET_ERROR_TALK_FAILED: // (0x80000000|380) 请求对讲失败
msg = Res.string().getBundle().getString("NET_ERROR_TALK_FAILED");
break;
case NetSDKLib.NET_ERROR_GET_MACHINE_CFG: // (0x80000000|381) 获取机器相关配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GET_MACHINE_CFG");
break;
case NetSDKLib.NET_ERROR_SET_MACHINE_CFG: // (0x80000000|382) 设置机器相关配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SET_MACHINE_CFG");
break;
case NetSDKLib.NET_ERROR_GET_DATA_FAILED: // (0x80000000|383) 设备无法获取当前请求数据
msg = Res.string().getBundle().getString("NET_ERROR_GET_DATA_FAILED");
break;
case NetSDKLib.NET_ERROR_MAC_VALIDATE_FAILED: // (0x80000000|384) MAC地址验证失败
msg = Res.string().getBundle().getString("NET_ERROR_MAC_VALIDATE_FAILED");
break;
case NetSDKLib.NET_ERROR_GET_INSTANCE: // (0x80000000|385) 获取服务器实例失败
msg = Res.string().getBundle().getString("NET_ERROR_GET_INSTANCE");
break;
case NetSDKLib.NET_ERROR_JSON_REQUEST: // (0x80000000|386) 生成的json字符串错误
msg = Res.string().getBundle().getString("NET_ERROR_JSON_REQUEST");
break;
case NetSDKLib.NET_ERROR_JSON_RESPONSE: // (0x80000000|387) 响应的json字符串错误
msg = Res.string().getBundle().getString("NET_ERROR_JSON_RESPONSE");
break;
case NetSDKLib.NET_ERROR_VERSION_HIGHER: // (0x80000000|388) 协议版本低于当前使用的版本
msg = Res.string().getBundle().getString("NET_ERROR_VERSION_HIGHER");
break;
case NetSDKLib.NET_SPARE_NO_CAPACITY: // (0x80000000|389) 热备操作失败, 容量不足
msg = Res.string().getBundle().getString("NET_SPARE_NO_CAPACITY");
break;
case NetSDKLib.NET_ERROR_SOURCE_IN_USE: // (0x80000000|390) 显示源被其他输出占用
msg = Res.string().getBundle().getString("NET_ERROR_SOURCE_IN_USE");
break;
case NetSDKLib.NET_ERROR_REAVE: // (0x80000000|391) 高级用户抢占低级用户资源
msg = Res.string().getBundle().getString("NET_ERROR_REAVE");
break;
case NetSDKLib.NET_ERROR_NETFORBID: // (0x80000000|392) 禁止入网
msg = Res.string().getBundle().getString("NET_ERROR_NETFORBID");
break;
case NetSDKLib.NET_ERROR_GETCFG_MACFILTER: // (0x80000000|393) 获取MAC过滤配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_MACFILTER");
break;
case NetSDKLib.NET_ERROR_SETCFG_MACFILTER: // (0x80000000|394) 设置MAC过滤配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_MACFILTER");
break;
case NetSDKLib.NET_ERROR_GETCFG_IPMACFILTER: // (0x80000000|395) 获取IP/MAC过滤配置失败
msg = Res.string().getBundle().getString("NET_ERROR_GETCFG_IPMACFILTER");
break;
case NetSDKLib.NET_ERROR_SETCFG_IPMACFILTER: // (0x80000000|396) 设置IP/MAC过滤配置失败
msg = Res.string().getBundle().getString("NET_ERROR_SETCFG_IPMACFILTER");
break;
case NetSDKLib.NET_ERROR_OPERATION_OVERTIME: // (0x80000000|397) 当前操作超时
msg = Res.string().getBundle().getString("NET_ERROR_OPERATION_OVERTIME");
break;
case NetSDKLib.NET_ERROR_SENIOR_VALIDATE_FAILED: // (0x80000000|398) 高级校验失败
msg = Res.string().getBundle().getString("NET_ERROR_SENIOR_VALIDATE_FAILED");
break;
case NetSDKLib.NET_ERROR_DEVICE_ID_NOT_EXIST: // (0x80000000|399) 设备ID不存在
msg = Res.string().getBundle().getString("NET_ERROR_DEVICE_ID_NOT_EXIST");
break;
case NetSDKLib.NET_ERROR_UNSUPPORTED: // (0x80000000|400) 不支持当前操作
msg = Res.string().getBundle().getString("NET_ERROR_UNSUPPORTED");
break;
case NetSDKLib.NET_ERROR_PROXY_DLLLOAD: // (0x80000000|401) 代理库加载失败
msg = Res.string().getBundle().getString("NET_ERROR_PROXY_DLLLOAD");
break;
case NetSDKLib.NET_ERROR_PROXY_ILLEGAL_PARAM: // (0x80000000|402) 代理用户参数不合法
msg = Res.string().getBundle().getString("NET_ERROR_PROXY_ILLEGAL_PARAM");
break;
case NetSDKLib.NET_ERROR_PROXY_INVALID_HANDLE: // (0x80000000|403) 代理句柄无效
msg = Res.string().getBundle().getString("NET_ERROR_PROXY_INVALID_HANDLE");
break;
case NetSDKLib.NET_ERROR_PROXY_LOGIN_DEVICE_ERROR: // (0x80000000|404) 代理登入前端设备失败
msg = Res.string().getBundle().getString("NET_ERROR_PROXY_LOGIN_DEVICE_ERROR");
break;
case NetSDKLib.NET_ERROR_PROXY_START_SERVER_ERROR: // (0x80000000|405) 启动代理服务失败
msg = Res.string().getBundle().getString("NET_ERROR_PROXY_START_SERVER_ERROR");
break;
case NetSDKLib.NET_ERROR_SPEAK_FAILED: // (0x80000000|406) 请求喊话失败
msg = Res.string().getBundle().getString("NET_ERROR_SPEAK_FAILED");
break;
case NetSDKLib.NET_ERROR_NOT_SUPPORT_F6: // (0x80000000|407) 设备不支持此F6接口调用
msg = Res.string().getBundle().getString("NET_ERROR_NOT_SUPPORT_F6");
break;
case NetSDKLib.NET_ERROR_CD_UNREADY: // (0x80000000|408) 光盘未就绪
msg = Res.string().getBundle().getString("NET_ERROR_CD_UNREADY");
break;
case NetSDKLib.NET_ERROR_DIR_NOT_EXIST: // (0x80000000|409) 目录不存在
msg = Res.string().getBundle().getString("NET_ERROR_DIR_NOT_EXIST");
break;
case NetSDKLib.NET_ERROR_UNSUPPORTED_SPLIT_MODE: // (0x80000000|410) 设备不支持的分割模式
msg = Res.string().getBundle().getString("NET_ERROR_UNSUPPORTED_SPLIT_MODE");
break;
case NetSDKLib.NET_ERROR_OPEN_WND_PARAM: // (0x80000000|411) 开窗参数不合法
msg = Res.string().getBundle().getString("NET_ERROR_OPEN_WND_PARAM");
break;
case NetSDKLib.NET_ERROR_LIMITED_WND_COUNT: // (0x80000000|412) 开窗数量超过限制
msg = Res.string().getBundle().getString("NET_ERROR_LIMITED_WND_COUNT");
break;
case NetSDKLib.NET_ERROR_UNMATCHED_REQUEST: // (0x80000000|413) 请求命令与当前模式不匹配
msg = Res.string().getBundle().getString("NET_ERROR_UNMATCHED_REQUEST");
break;
case NetSDKLib.NET_RENDER_ENABLELARGEPICADJUSTMENT_ERROR: // (0x80000000|414) Render库启用高清图像内部调整策略出错
msg = Res.string().getBundle().getString("NET_RENDER_ENABLELARGEPICADJUSTMENT_ERROR");
break;
case NetSDKLib.NET_ERROR_UPGRADE_FAILED: // (0x80000000|415) 设备升级失败
msg = Res.string().getBundle().getString("NET_ERROR_UPGRADE_FAILED");
break;
case NetSDKLib.NET_ERROR_NO_TARGET_DEVICE: // (0x80000000|416) 找不到目标设备
msg = Res.string().getBundle().getString("NET_ERROR_NO_TARGET_DEVICE");
break;
case NetSDKLib.NET_ERROR_NO_VERIFY_DEVICE: // (0x80000000|417) 找不到验证设备
msg = Res.string().getBundle().getString("NET_ERROR_NO_VERIFY_DEVICE");
break;
case NetSDKLib.NET_ERROR_CASCADE_RIGHTLESS: // (0x80000000|418) 无级联权限
msg = Res.string().getBundle().getString("NET_ERROR_CASCADE_RIGHTLESS");
break;
case NetSDKLib.NET_ERROR_LOW_PRIORITY: // (0x80000000|419) 低优先级
msg = Res.string().getBundle().getString("NET_ERROR_LOW_PRIORITY");
break;
case NetSDKLib.NET_ERROR_REMOTE_REQUEST_TIMEOUT: // (0x80000000|420) 远程设备请求超时
msg = Res.string().getBundle().getString("NET_ERROR_REMOTE_REQUEST_TIMEOUT");
break;
case NetSDKLib.NET_ERROR_LIMITED_INPUT_SOURCE: // (0x80000000|421) 输入源超出最大路数限制
msg = Res.string().getBundle().getString("NET_ERROR_LIMITED_INPUT_SOURCE");
break;
case NetSDKLib.NET_ERROR_SET_LOG_PRINT_INFO: // (0x80000000|422) 设置日志打印失败
msg = Res.string().getBundle().getString("NET_ERROR_SET_LOG_PRINT_INFO");
break;
case NetSDKLib.NET_ERROR_PARAM_DWSIZE_ERROR: // (0x80000000|423) 入参的dwsize字段出错
msg = Res.string().getBundle().getString("NET_ERROR_PARAM_DWSIZE_ERROR");
break;
case NetSDKLib.NET_ERROR_LIMITED_MONITORWALL_COUNT: // (0x80000000|424) 电视墙数量超过上限
msg = Res.string().getBundle().getString("NET_ERROR_LIMITED_MONITORWALL_COUNT");
break;
case NetSDKLib.NET_ERROR_PART_PROCESS_FAILED: // (0x80000000|425) 部分过程执行失败
msg = Res.string().getBundle().getString("NET_ERROR_PART_PROCESS_FAILED");
break;
case NetSDKLib.NET_ERROR_TARGET_NOT_SUPPORT: // (0x80000000|426) 该功能不支持转发
msg = Res.string().getBundle().getString("NET_ERROR_TARGET_NOT_SUPPORT");
break;
case NetSDKLib.NET_ERROR_VISITE_FILE: // (0x80000000|510) 访问文件失败
msg = Res.string().getBundle().getString("NET_ERROR_VISITE_FILE");
break;
case NetSDKLib.NET_ERROR_DEVICE_STATUS_BUSY: // (0x80000000|511) 设备忙
msg = Res.string().getBundle().getString("NET_ERROR_DEVICE_STATUS_BUSY");
break;
case NetSDKLib.NET_USER_PWD_NOT_AUTHORIZED: // (0x80000000|512)修改密码无权限
msg = Res.string().getBundle().getString("NET_USER_PWD_NOT_AUTHORIZED");
break;
case NetSDKLib.NET_USER_PWD_NOT_STRONG: // (0x80000000|513) 密码强度不够
msg = Res.string().getBundle().getString("NET_USER_PWD_NOT_STRONG");
break;
case NetSDKLib.NET_ERROR_NO_SUCH_CONFIG: // (0x80000000|514) 没有对应的配置
msg = Res.string().getBundle().getString("NET_ERROR_NO_SUCH_CONFIG");
break;
case NetSDKLib.NET_ERROR_AUDIO_RECORD_FAILED: // (0x80000000|515) 录音失败
msg = Res.string().getBundle().getString("NET_ERROR_AUDIO_RECORD_FAILED");
break;
case NetSDKLib.NET_ERROR_SEND_DATA_FAILED: // (0x80000000|516) 数据发送失败
msg = Res.string().getBundle().getString("NET_ERROR_SEND_DATA_FAILED");
break;
case NetSDKLib.NET_ERROR_OBSOLESCENT_INTERFACE: // (0x80000000|517) 废弃接口
msg = Res.string().getBundle().getString("NET_ERROR_OBSOLESCENT_INTERFACE");
break;
case NetSDKLib.NET_ERROR_INSUFFICIENT_INTERAL_BUF: // (0x80000000|518) 内部缓冲不足
msg = Res.string().getBundle().getString("NET_ERROR_INSUFFICIENT_INTERAL_BUF");
break;
case NetSDKLib.NET_ERROR_NEED_ENCRYPTION_PASSWORD: // (0x80000000|519) 修改设备ip时,需要校验密码
msg = Res.string().getBundle().getString("NET_ERROR_NEED_ENCRYPTION_PASSWORD");
break;
case NetSDKLib.NET_ERROR_NOSUPPORT_RECORD: // (0x80000000|520) 设备不支持此记录集
msg = Res.string().getBundle().getString("NET_ERROR_NOSUPPORT_RECORD");
break;
case NetSDKLib.NET_ERROR_SERIALIZE_ERROR: // (0x80000000|1010) 数据序列化错误
msg = Res.string().getBundle().getString("NET_ERROR_SERIALIZE_ERROR");
break;
case NetSDKLib.NET_ERROR_DESERIALIZE_ERROR: // (0x80000000|1011) 数据反序列化错误
msg = Res.string().getBundle().getString("NET_ERROR_DESERIALIZE_ERROR");
break;
case NetSDKLib.NET_ERROR_LOWRATEWPAN_ID_EXISTED: // (0x80000000|1012) 该无线ID已存在
msg = Res.string().getBundle().getString("NET_ERROR_LOWRATEWPAN_ID_EXISTED");
break;
case NetSDKLib.NET_ERROR_LOWRATEWPAN_ID_LIMIT: // (0x80000000|1013) 无线ID数量已超限
msg = Res.string().getBundle().getString("NET_ERROR_LOWRATEWPAN_ID_LIMIT");
break;
case NetSDKLib.NET_ERROR_LOWRATEWPAN_ID_ABNORMAL: // (0x80000000|1014) 无线异常添加
msg = Res.string().getBundle().getString("NET_ERROR_LOWRATEWPAN_ID_ABNORMAL");
break;
case NetSDKLib.NET_ERROR_ENCRYPT: // (0x80000000|1015) 加密数据失败
msg = Res.string().getBundle().getString("NET_ERROR_ENCRYPT");
break;
case NetSDKLib.NET_ERROR_PWD_ILLEGAL: // (0x80000000|1016) 新密码不合规范
msg = Res.string().getBundle().getString("NET_ERROR_PWD_ILLEGAL");
break;
case NetSDKLib.NET_ERROR_DEVICE_ALREADY_INIT: // (0x80000000|1017) 设备已经初始化
msg = Res.string().getBundle().getString("NET_ERROR_DEVICE_ALREADY_INIT");
break;
case NetSDKLib.NET_ERROR_SECURITY_CODE: // (0x80000000|1018) 安全码错误
msg = Res.string().getBundle().getString("NET_ERROR_SECURITY_CODE");
break;
case NetSDKLib.NET_ERROR_SECURITY_CODE_TIMEOUT: // (0x80000000|1019) 安全码超出有效期
msg = Res.string().getBundle().getString("NET_ERROR_SECURITY_CODE_TIMEOUT");
break;
case NetSDKLib.NET_ERROR_GET_PWD_SPECI: // (0x80000000|1020) 获取密码规范失败
msg = Res.string().getBundle().getString("NET_ERROR_GET_PWD_SPECI");
break;
case NetSDKLib.NET_ERROR_NO_AUTHORITY_OF_OPERATION: // (0x80000000|1021) 无权限进行该操作
msg = Res.string().getBundle().getString("NET_ERROR_NO_AUTHORITY_OF_OPERATION");
break;
case NetSDKLib.NET_ERROR_DECRYPT: // (0x80000000|1022) 解密数据失败
msg = Res.string().getBundle().getString("NET_ERROR_DECRYPT");
break;
case NetSDKLib.NET_ERROR_2D_CODE: // (0x80000000|1023) 2D code校验失败
msg = Res.string().getBundle().getString("NET_ERROR_2D_CODE");
break;
case NetSDKLib.NET_ERROR_INVALID_REQUEST: // (0x80000000|1024) 非法的RPC请求
msg = Res.string().getBundle().getString("NET_ERROR_INVALID_REQUEST");
break;
case NetSDKLib.NET_ERROR_PWD_RESET_DISABLE: // (0x80000000|1025) 密码重置功能已关闭
msg = Res.string().getBundle().getString("NET_ERROR_PWD_RESET_DISABLE");
break;
case NetSDKLib.NET_ERROR_PLAY_PRIVATE_DATA: // (0x80000000|1026) 显示私有数据,比如规则框等失败
msg = Res.string().getBundle().getString("NET_ERROR_PLAY_PRIVATE_DATA");
break;
case NetSDKLib.NET_ERROR_ROBOT_OPERATE_FAILED: // (0x80000000|1027) 机器人操作失败
msg = Res.string().getBundle().getString("NET_ERROR_ROBOT_OPERATE_FAILED");
break;
case NetSDKLib.NET_ERROR_PHOTOSIZE_EXCEEDSLIMIT: // (0x80000000|1028) 图片大小超限
msg = Res.string().getBundle().getString("NET_ERROR_PHOTOSIZE_EXCEEDSLIMIT");
break;
case NetSDKLib.NET_ERROR_USERID_INVALID: // (0x80000000|1029) 用户ID不存在
msg = Res.string().getBundle().getString("NET_ERROR_USERID_INVALID");
break;
case NetSDKLib.NET_ERROR_EXTRACTFEATURE_FAILED: // (0x80000000|1030) 照片特征值提取失败
msg = Res.string().getBundle().getString("NET_ERROR_EXTRACTFEATURE_FAILED");
break;
case NetSDKLib.NET_ERROR_PHOTO_EXIST: // (0x80000000|1031) 照片已存在
msg = Res.string().getBundle().getString("NET_ERROR_PHOTO_EXIST");
break;
case NetSDKLib.NET_ERROR_PHOTO_OVERFLOW: // (0x80000000|1032) 照片数量超过上限
msg = Res.string().getBundle().getString("NET_ERROR_PHOTO_OVERFLOW");
break;
case NetSDKLib.NET_ERROR_CHANNEL_ALREADY_OPENED: // (0x80000000|1033) 通道已经打开
msg = Res.string().getBundle().getString("NET_ERROR_CHANNEL_ALREADY_OPENED");
break;
case NetSDKLib.NET_ERROR_CREATE_SOCKET: // (0x80000000|1034) 创建套接字失败
msg = Res.string().getBundle().getString("NET_ERROR_CREATE_SOCKET");
break;
case NetSDKLib.NET_ERROR_CHANNEL_NUM: // (0x80000000|1035) 通道号错误
msg = Res.string().getBundle().getString("NET_ERROR_CHANNEL_NUM");
break;
case NetSDKLib.NET_ERROR_FACE_RECOGNITION_SERVER_GROUP_ID_EXCEED: // (0x80000000|1051) 组ID超过最大值
msg = Res.string().getBundle().getString("NET_ERROR_FACE_RECOGNITION_SERVER_GROUP_ID_EXCEED");
break;
default:
msg = Res.string().getBundle().getString("NET_ERROR");
break;
}
return msg;
}
}

@ -0,0 +1,79 @@
package com.zhehekeji.web.lib.common;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.LinkedBlockingDeque;
public class EventTaskCommonQueue {
// 设置一个队列,容量看情况改
private final int MAX_TASK_COUNT = 10000; // 队列容量
private final LinkedBlockingDeque<EventTaskHandler> eventTasks = new LinkedBlockingDeque<EventTaskHandler>(MAX_TASK_COUNT);
// 起一个线程池
private final int MAX_THREAD_COUNT = 10; // 线程池容量
private ExecutorService eventQueueService = Executors.newFixedThreadPool(MAX_THREAD_COUNT);
// 用于检验服务运行状态
private volatile boolean running = true;
// 用于查看当前线程状态
private Future<?> eventQueueThreadStatus;
// 初始化
public void init() {
eventQueueThreadStatus = eventQueueService.submit(new Thread(new Runnable() {
@Override
public void run() {
while (running) {
try {
EventTaskHandler task = eventTasks.take(); //开始一个任务
try {
task.eventTaskProcess(); // 主要的运行函数
} catch (Exception e) {
System.err.println("任务处理发生错误"); // error
}
} catch (InterruptedException e) {
System.err.println("任务已意外停止"); // error
running = false;
}
}
}
}, "Event call back thread init"));
}
// 向队列添加新的任务
public boolean addEvent(EventTaskHandler eventHandler) {
if (!running) {
System.out.println("任务已停止"); // warning
return false;
}
boolean success = eventTasks.offer(eventHandler);
if (!success) {
// 队列已满,无法再添加
System.out.println("添加到事件队列失败");
}
return success;
}
// 手动启动服务
public void activeService() {
running = true;
if (eventQueueService.isShutdown()) {
eventQueueService = Executors.newFixedThreadPool(MAX_THREAD_COUNT);;
init();
System.out.println("线程池已关闭,重新初始化线程池及任务");
}
if (eventQueueThreadStatus.isDone()) {
init();
System.out.println("线程池任务结束,重新初始化任务");
}
}
// 手动关闭服务
public void destroy() {
running = false;
eventQueueService.shutdownNow();
}
}

@ -0,0 +1,6 @@
package com.zhehekeji.web.lib.common;
public interface EventTaskHandler {
void eventTaskProcess();
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,76 @@
package com.zhehekeji.web.lib.common;
import com.zhehekeji.web.lib.ToolKits;
import java.io.File;
public class SavePath {
private SavePath() {}
private static class SavePathHolder {
private static SavePath instance = new SavePath();
}
public static SavePath getSavePath() {
return SavePathHolder.instance;
}
String s_captureSavePath = "./Capture/" + ToolKits.getDay() + "/"; // 抓拍图片保存路径
String s_imageSavePath = "./Image/" + ToolKits.getDay() + "/"; // 图片保存路径
String s_recordFileSavePath = "./RecordFile/" + ToolKits.getDay() + "/"; // 录像保存路径
/*
*
*/
public String getSaveCapturePath() {
File path1 = new File("./Capture/");
if (!path1.exists()) {
path1.mkdir();
}
File path2 = new File(s_captureSavePath);
if (!path2.exists()) {
path2.mkdir();
}
String strFileName = path2.getAbsolutePath() + "/" + ToolKits.getDate() + ".jpg";
return strFileName;
}
/*
*
*/
public String getSaveTrafficImagePath() {
File path1 = new File("./Image/");
if (!path1.exists()) {
path1.mkdir();
}
File path = new File(s_imageSavePath);
if (!path.exists()) {
path.mkdir();
}
return s_imageSavePath;
}
/*
*
*/
public String getSaveRecordFilePath() {
File path1 = new File("./RecordFile/");
if (!path1.exists()) {
path1.mkdir();
}
File path2 = new File(s_recordFileSavePath);
if (!path2.exists()) {
path2.mkdir();
}
String SavedFileName = s_recordFileSavePath + ToolKits.getDate() + ".dav"; // 默认保存路径
return SavedFileName;
}
}

@ -0,0 +1,7 @@
package com.zhehekeji.web.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhehekeji.web.entity.Lychee;
public interface LycheeMapper extends BaseMapper<Lychee> {
}

@ -1,8 +1,11 @@
package com.zhehekeji.web.service; package com.zhehekeji.web.service;
import com.zhehekeji.core.util.Assert;
import com.zhehekeji.web.entity.Camera; import com.zhehekeji.web.entity.Camera;
import com.zhehekeji.web.entity.Lychee;
import com.zhehekeji.web.entity.Street; import com.zhehekeji.web.entity.Street;
import com.zhehekeji.web.mapper.CameraMapper; import com.zhehekeji.web.mapper.CameraMapper;
import com.zhehekeji.web.mapper.LycheeMapper;
import com.zhehekeji.web.mapper.StreetMapper; import com.zhehekeji.web.mapper.StreetMapper;
import com.zhehekeji.web.pojo.realTime.RealTime; import com.zhehekeji.web.pojo.realTime.RealTime;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -21,6 +24,14 @@ public class RealTimeService {
private StreetMapper streetMapper; private StreetMapper streetMapper;
@Resource @Resource
private CameraMapper cameraMapper; private CameraMapper cameraMapper;
@Resource
private LycheeMapper lycheeMapper;
public String lychee(){
Lychee lychee = lycheeMapper.selectById(1);
Assert.notNull(lychee,"未配置荔枝转码服务");
return lychee.getIp();
}
public List<RealTime> realTimes(){ public List<RealTime> realTimes(){
List<Street> streets = streetMapper.selectByMap(new HashMap<>(0)); List<Street> streets = streetMapper.selectByMap(new HashMap<>(0));

Loading…
Cancel
Save