You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
3783 lines
137 KiB
3783 lines
137 KiB
package utils; |
|
|
|
import java.awt.Container; |
|
import java.awt.EventQueue; |
|
import java.awt.Toolkit; |
|
import java.awt.event.ActionEvent; |
|
import java.awt.event.ActionListener; |
|
import java.util.Calendar; |
|
import java.util.Enumeration; |
|
import java.util.HashMap; |
|
import java.util.Map; |
|
import java.util.Vector; |
|
|
|
import javax.swing.JButton; |
|
import javax.swing.JFrame; |
|
import javax.swing.JLabel; |
|
import javax.swing.JList; |
|
import javax.swing.JOptionPane; |
|
import javax.swing.JScrollPane; |
|
import javax.swing.JTable; |
|
import javax.swing.JTextField; |
|
import javax.swing.event.ListSelectionEvent; |
|
import javax.swing.event.ListSelectionListener; |
|
import javax.swing.table.DefaultTableModel; |
|
import javax.swing.table.JTableHeader; |
|
import javax.swing.table.TableCellRenderer; |
|
import javax.swing.table.TableColumn; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
import com.ruoyi.code.camera.domain.Camera; |
|
import com.ruoyi.code.camera.domain.CameraNetFtp; |
|
import com.sun.jna.NativeLong; |
|
import com.sun.jna.Pointer; |
|
import com.sun.jna.Structure; |
|
import com.sun.jna.ptr.IntByReference; |
|
|
|
import sdk.java.common.GlobalTool; |
|
import sdk.java.lib.DataUtils; |
|
import sdk.java.lib.netmanager.NetDefs; |
|
import sdk.java.lib.netmanager.NetLib; |
|
import sdk.java.lib.netmanager.NetEnums.EM_DEVICE_CFG_TYPE; |
|
import sdk.java.lib.netmanager.NetEnums.EM_WHITE_BALANCE; |
|
import sdk.java.lib.netmanager.NetStructs; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_ALARM_IN_PARAM; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_ALARM_OUT_PARAM; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_ALARM_PARAM; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_ALL_NETCARD; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_AUTO_MAINTAIN; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_CAMERA; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_CAPTURE_MODE; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_CLOUD_SERVICE; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_COM; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_COM_ITEM; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_DST; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_ENCODE_CONFIG_PARAM; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_ENCODE_PARAM; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_FACE_GROUP_RECOGNIZE_RULE; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_FACE_GROUP_RECOGNIZE_RULES; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_GB28181_PARAM; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_INTELLI_RULE_FACE_DETECT; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_INTELLI_RULE_FACE_STATISTIC; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_INTELLI_SCENE_FACE_DETECT; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_LOG; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_LOG_INFO; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_NET_PORT; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_NET_RTSP; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_NET_SERVICE; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_NET_STORAGE_FTP; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_NET_STORAGE_TRANS; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_NET_STORAGE_TRANS_ITEM; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_NET_WB_INFO; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_NET_WB_ITEM; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_NET_WEB; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_NTP; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_ONE_NETCARD; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_ONVIF; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_OVERLAP_PIC; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_RECORD; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_SNAP_CUTOUT; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_SNAP_TIMES; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_STORAGE; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_TELNET; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_USER_GET; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_USER_INFO; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_USER_ONLINE_ITEM; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_USER_ONLINE_ITEMS; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_USER_SET; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_VIDEO_OSD; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_WATER_MARK; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_WIFI_CONFIG; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_ZK_SERVICE; |
|
import sdk.java.lib.netmanager.NetStructs.STU_CFG_ZK_SERVICE_ITEM; |
|
import sdk.java.lib.netmanager.NetStructs.STU_SYS_INFO; |
|
import sdk.java.lib.netmanager.NetStructs.STU_SYS_PROCESSOR_INFO; |
|
import sdk.java.lib.netmanager.NetStructs.STU_TIME; |
|
|
|
public class run_device_cfg implements ActionListener, ListSelectionListener { |
|
|
|
private JFrame m_frame; |
|
|
|
private JTextField m_jtf_ip; |
|
private JTextField m_jtf_port; |
|
private JTextField m_jtf_username; |
|
private JTextField m_jtf_password; |
|
private JTable m_table_result; |
|
private DefaultTableModel m_tableModel; |
|
|
|
private JButton m_btn_login; |
|
private JButton m_btn_logout; |
|
private JButton m_btn_refresh; |
|
private JButton m_btn_set; |
|
|
|
private JList<String> m_list_cfg_type; |
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
private NativeLong m_loginID = new NativeLong(0); |
|
private JLabel m_lbl_notify; |
|
private Object m_curStuObj = null; |
|
|
|
private Map<Integer, Integer> m_mapIndexToCfgType = new HashMap<Integer, Integer>(); |
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
/** |
|
* Create the application. |
|
*/ |
|
public run_device_cfg() { |
|
initialize(); |
|
initilizeRyNetLib(); |
|
} |
|
|
|
/** |
|
* Initialize the contents of the frame. |
|
*/ |
|
private void initialize() { |
|
m_frame = new JFrame(); |
|
m_frame.setTitle("设备配置"); |
|
m_frame.setBounds(100, 100, 694, 683); |
|
Toolkit kit = Toolkit.getDefaultToolkit(); |
|
int x = kit.getScreenSize().width/2 - this.m_frame.getWidth()/2; |
|
int y = kit.getScreenSize().height/2 - this.m_frame.getHeight()/2; |
|
m_frame.setLocation(x, y); |
|
m_frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
|
m_frame.getContentPane().setLayout(null); |
|
|
|
JLabel lblIp = new JLabel("IP:"); |
|
lblIp.setBounds(10, 10, 79, 15); |
|
m_frame.getContentPane().add(lblIp); |
|
|
|
JLabel lblPort = new JLabel("Port:"); |
|
lblPort.setBounds(10, 35, 79, 15); |
|
m_frame.getContentPane().add(lblPort); |
|
|
|
JLabel lblUsername = new JLabel("Username:"); |
|
lblUsername.setBounds(10, 60, 79, 15); |
|
m_frame.getContentPane().add(lblUsername); |
|
|
|
JLabel lblPassword = new JLabel("Password:"); |
|
lblPassword.setBounds(10, 85, 79, 15); |
|
m_frame.getContentPane().add(lblPassword); |
|
|
|
m_jtf_ip = new JTextField(); |
|
m_jtf_ip.setBounds(99, 7, 224, 21); |
|
m_frame.getContentPane().add(m_jtf_ip); |
|
m_jtf_ip.setColumns(10); |
|
|
|
m_jtf_port = new JTextField(); |
|
m_jtf_port.setBounds(99, 32, 224, 21); |
|
m_frame.getContentPane().add(m_jtf_port); |
|
m_jtf_port.setColumns(10); |
|
|
|
m_jtf_username = new JTextField(); |
|
m_jtf_username.setBounds(99, 57, 224, 21); |
|
m_frame.getContentPane().add(m_jtf_username); |
|
m_jtf_username.setColumns(10); |
|
|
|
m_jtf_password = new JTextField(); |
|
m_jtf_password.setBounds(99, 82, 224, 21); |
|
m_frame.getContentPane().add(m_jtf_password); |
|
m_jtf_password.setColumns(10); |
|
|
|
m_btn_login = new JButton("登陆"); |
|
m_btn_login.addActionListener(this); |
|
m_btn_login.setBounds(408, 31, 93, 23); |
|
m_frame.getContentPane().add(m_btn_login); |
|
|
|
m_btn_logout = new JButton("登出"); |
|
m_btn_logout.addActionListener(this); |
|
m_btn_logout.setEnabled(false); |
|
m_btn_logout.setBounds(511, 31, 93, 23); |
|
m_frame.getContentPane().add(m_btn_logout); |
|
|
|
JLabel label = new JLabel("选择配置类型:"); |
|
label.setBounds(10, 143, 138, 15); |
|
m_frame.getContentPane().add(label); |
|
|
|
m_list_cfg_type = new JList<String>(); |
|
m_list_cfg_type.addListSelectionListener(this); |
|
m_list_cfg_type.setEnabled(false); |
|
m_list_cfg_type.setBounds(10, 168, 194, 402); |
|
|
|
JScrollPane listScrollPane = new JScrollPane(m_list_cfg_type); |
|
listScrollPane.setBounds(10, 168, 194, 402); |
|
|
|
m_frame.getContentPane().add(listScrollPane); |
|
|
|
Vector<String> columTitle = new Vector<String>(); |
|
columTitle.addElement("查询内容"); |
|
columTitle.addElement("值"); |
|
Vector<Vector<String>> data = new Vector<Vector<String>>(); |
|
m_tableModel = new DefaultTableModel(data, columTitle); |
|
|
|
m_table_result = new JTable(m_tableModel); |
|
m_table_result.setEnabled(false); |
|
m_table_result.setBounds(10, 232, 227, 257); |
|
m_table_result.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
|
|
|
JScrollPane jsp = new JScrollPane(m_table_result); |
|
jsp.setBounds(214, 168, 454, 402); |
|
|
|
m_frame.getContentPane().add(jsp); |
|
|
|
m_lbl_notify = new JLabel(""); |
|
m_lbl_notify.setBounds(10, 613, 658, 15); |
|
m_frame.getContentPane().add(m_lbl_notify); |
|
|
|
m_btn_refresh = new JButton("刷新"); |
|
m_btn_refresh.addActionListener(this); |
|
m_btn_refresh.setBounds(472, 580, 93, 23); |
|
m_frame.getContentPane().add(m_btn_refresh); |
|
|
|
m_btn_set = new JButton("修改"); |
|
m_btn_set.addActionListener(this); |
|
m_btn_set.setBounds(575, 580, 93, 23); |
|
m_frame.getContentPane().add(m_btn_set); |
|
} |
|
|
|
private void addListItems() |
|
{ |
|
Vector<String> listData = new Vector<String>(); |
|
int index = 0; |
|
listData.addElement("设备系统配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_SYS); |
|
index++; |
|
listData.addElement("网络配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_NET); |
|
index++; |
|
listData.addElement("时间配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_SYS_TIME); |
|
index++; |
|
listData.addElement("夏令时配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_TIME_DST); |
|
index++; |
|
listData.addElement("NTP配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_NTP); |
|
index++; |
|
listData.addElement("通道配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_CHANNEL); |
|
index++; |
|
listData.addElement("录像配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_RECORD); |
|
index++; |
|
listData.addElement("串口配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_SERIAL_PORT); |
|
index++; |
|
listData.addElement("对讲配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_TALK); |
|
index++; |
|
listData.addElement("自动维护配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_AUTO_MAINTAIN); |
|
index++; |
|
listData.addElement("人脸识别规则配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_FACE_RECOGNIZE_RULES); |
|
index++; |
|
listData.addElement("抓拍模式配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_CAPTURE_MODE); |
|
index++; |
|
listData.addElement("抓拍张数配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_SNAP_TIMES); |
|
index++; |
|
listData.addElement("Web HTTP/HTTPS 配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_WEB); |
|
index++; |
|
listData.addElement("RTSP 配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_RTSP); |
|
index++; |
|
listData.addElement("NetService 配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_NET_SERVICE); |
|
index++; |
|
listData.addElement("端口配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_NET_PORT); |
|
index++; |
|
listData.addElement("WIFI使能配置 设置或者获取wifi使能配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_WIFI_ENABLE); |
|
index++; |
|
listData.addElement("WIFI操作配置;包括扫描;链接;断开链接"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_WIFI_OPERATE); |
|
index++; |
|
listData.addElement("水印配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_WATERMARK); |
|
index++; |
|
listData.addElement("摄像头属性配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_CAMERA); |
|
index++; |
|
listData.addElement("视频OSD叠加配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_VIDEO_OSD); |
|
index++; |
|
listData.addElement("存储配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_STORAGE); |
|
index++; |
|
listData.addElement("网络存储传输配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_NET_STORAGE_TRANS); |
|
index++; |
|
listData.addElement("Telnet配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_TELNET); |
|
index++; |
|
listData.addElement("日志搜索"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_LOGSEARCH); |
|
index++; |
|
listData.addElement("黑白名单"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_NETWHITEBLACK); |
|
index++; |
|
listData.addElement("用户管理"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_USER); |
|
index++; |
|
listData.addElement("获取在线用户"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_USER_ONLINE); |
|
index++; |
|
listData.addElement("抠图配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_SNAP_CUTOUT); |
|
index++; |
|
listData.addElement("叠加与抓图配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_OVERLAP_PIC); |
|
index++; |
|
listData.addElement("人脸检测智能场景配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_INTELLI_SCENE_FACE_DETECT); |
|
index++; |
|
listData.addElement("人脸检测规则配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_INTELLI_RULE_FACE_DETECT); |
|
index++; |
|
listData.addElement("人脸检测统计配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_INTELLI_RULE_FACE_DETECT_STAT); |
|
index++; |
|
listData.addElement("报警参数"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_ALARM_PARAM); |
|
index++; |
|
listData.addElement("编码配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_ENCODE_PARAM); |
|
index++; |
|
listData.addElement("GB28181参数配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_GB28181_PARAM); |
|
index++; |
|
listData.addElement("ONVIF 配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_ONVIF); |
|
index++; |
|
listData.addElement("云服务配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_CLOUD_SERVICE); |
|
index++; |
|
listData.addElement("ZK配置"); |
|
m_mapIndexToCfgType.put(index, EM_DEVICE_CFG_TYPE.DEVICE_CFG_ZK); |
|
index++; |
|
|
|
// 添加内容 |
|
m_list_cfg_type.setListData(listData); |
|
} |
|
|
|
private void initilizeRyNetLib() |
|
{ |
|
NetLib.instance.Net_Init(null, null); |
|
} |
|
|
|
protected void finalize() |
|
{ |
|
NetLib.instance.Net_Exit(); |
|
} |
|
|
|
private boolean checkParams() |
|
{ |
|
String tmp = this.m_jtf_ip.getText().trim(); |
|
if(tmp.isEmpty()) |
|
{ |
|
return false; |
|
} |
|
|
|
tmp = this.m_jtf_port.getText().trim(); |
|
if(tmp.isEmpty()) |
|
{ |
|
return false; |
|
} |
|
|
|
tmp = this.m_jtf_username.getText().trim(); |
|
if(tmp.isEmpty()) |
|
{ |
|
return false; |
|
} |
|
|
|
tmp = this.m_jtf_password.getText().trim(); |
|
if(tmp.isEmpty()) |
|
{ |
|
return false; |
|
} |
|
|
|
return true; |
|
} |
|
|
|
private void setNotifyInfo(String info) |
|
{ |
|
m_lbl_notify.setText(info); |
|
} |
|
|
|
private void refreshEnables() |
|
{ |
|
boolean bLogin = 0 != this.m_loginID.longValue() ? true : false; |
|
this.m_btn_login.setEnabled(!bLogin); |
|
this.m_btn_logout.setEnabled(bLogin); |
|
this.m_list_cfg_type.setEnabled(bLogin); |
|
this.m_tableModel.setRowCount(0); |
|
} |
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
private void autoFitTabelColums(JTable myTable) |
|
{ |
|
JTableHeader header = myTable.getTableHeader(); |
|
int nRowCount = myTable.getRowCount(); |
|
|
|
Enumeration<TableColumn> columns = myTable.getColumnModel().getColumns(); |
|
while(columns.hasMoreElements()) |
|
{ |
|
TableColumn column = (TableColumn) columns.nextElement(); |
|
int nCol = header.getColumnModel().getColumnIndex(column.getIdentifier()); |
|
TableCellRenderer tableHeaderRenderer = (TableCellRenderer) header.getDefaultRenderer().getTableCellRendererComponent( |
|
myTable, column.getIdentifier(), false, false, -1, nCol); |
|
int nWidth = (int) ((Container) tableHeaderRenderer).getPreferredSize().getWidth(); |
|
|
|
for(int nRow=0; nRow<nRowCount; nRow++) |
|
{ |
|
TableCellRenderer tableCellRenderer = (TableCellRenderer) myTable.getCellRenderer(nRow, nCol) |
|
.getTableCellRendererComponent(myTable, myTable.getValueAt(nRow, nCol), false, false, nRow, nCol); |
|
int nCellWidth = (int) ((Container) tableCellRenderer).getPreferredSize().getWidth(); |
|
|
|
// 在内容和表头之间选择较宽的一个 |
|
nWidth = Math.max(nWidth, nCellWidth); |
|
} |
|
|
|
nWidth = Math.min(nWidth, 300); |
|
header.setResizingColumn(column); |
|
column.setWidth(nWidth + myTable.getIntercellSpacing().width + 10); |
|
} |
|
} |
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
private void insertRow(Vector<Vector<String>> tableContent, String strContent, String strValue) |
|
{ |
|
Vector<String> rowData = new Vector<String>(); |
|
rowData.addElement(strContent); |
|
rowData.addElement(strValue); |
|
|
|
tableContent.addElement(rowData); |
|
} |
|
|
|
private void ui_refreshTableContent(Vector<Vector<String>> tableContent) |
|
{ |
|
for(int i=0; i<tableContent.size(); i++) |
|
{ |
|
this.m_tableModel.addRow(tableContent.get(i)); |
|
} |
|
|
|
autoFitTabelColums(this.m_table_result); |
|
} |
|
|
|
private Pointer initStuData(int command, IntByReference outBufferSize) |
|
{ |
|
Pointer pStuData = null; |
|
Structure stuObj = initStu(command); |
|
|
|
if(null != stuObj) |
|
{ |
|
outBufferSize.setValue(stuObj.size()); |
|
pStuData = DataUtils.sdk_data_createPtr(outBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuObj, pStuData, 0); |
|
} |
|
|
|
return pStuData; |
|
} |
|
|
|
private Structure initStu(int command) |
|
{ |
|
Structure stu = null; |
|
|
|
if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_SYS == command) |
|
{ |
|
stu = new STU_SYS_INFO(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_NET == command) |
|
{ |
|
stu = new STU_CFG_ALL_NETCARD(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_SYS_TIME == command) |
|
{ |
|
stu = new STU_TIME(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_TIME_DST == command) |
|
{ |
|
stu = new STU_CFG_DST(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_NTP == command) |
|
{ |
|
stu = new STU_CFG_NTP(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_CHANNEL == command) |
|
{ |
|
|
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_RECORD == command) |
|
{ |
|
stu = new STU_CFG_RECORD(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_SERIAL_PORT == command) |
|
{ |
|
stu = new STU_CFG_COM(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_TALK == command) |
|
{ |
|
|
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_AUTO_MAINTAIN == command) |
|
{ |
|
stu = new STU_CFG_AUTO_MAINTAIN(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_FACE_RECOGNIZE_RULES == command) |
|
{ |
|
stu = new STU_CFG_FACE_GROUP_RECOGNIZE_RULES(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_CAPTURE_MODE == command) |
|
{ |
|
stu = new STU_CFG_CAPTURE_MODE(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_SNAP_TIMES == command) |
|
{ |
|
stu = new STU_CFG_SNAP_TIMES(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_WEB == command) |
|
{ |
|
stu = new STU_CFG_NET_WEB(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_RTSP == command) |
|
{ |
|
stu = new STU_CFG_NET_RTSP(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_NET_SERVICE == command) |
|
{ |
|
stu = new STU_CFG_NET_SERVICE(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_NET_PORT == command) |
|
{ |
|
stu = new STU_CFG_NET_PORT(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_WIFI_ENABLE == command) |
|
{ |
|
stu = new STU_CFG_WIFI_CONFIG(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_WIFI_OPERATE == command) |
|
{ |
|
|
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_WATERMARK == command) |
|
{ |
|
stu = new STU_CFG_WATER_MARK(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_CAMERA == command) |
|
{ |
|
stu = new STU_CFG_CAMERA(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_VIDEO_OSD == command) |
|
{ |
|
stu = new STU_CFG_VIDEO_OSD(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_STORAGE == command) |
|
{ |
|
stu = new STU_CFG_STORAGE(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_NET_STORAGE_TRANS == command) |
|
{ |
|
stu = new STU_CFG_NET_STORAGE_TRANS(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_TELNET == command) |
|
{ |
|
stu = new STU_CFG_TELNET(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_LOGSEARCH == command) |
|
{ |
|
STU_CFG_LOG stuLogSearch = new STU_CFG_LOG(); |
|
String strStartTime = "2000-01-01 00:00:00"; |
|
byte[] tmpByArr = DataUtils.sdk_data_stringToByteArray(strStartTime, GlobalTool.getEncodeType()); |
|
System.arraycopy(tmpByArr, 0, stuLogSearch.stuSearchCondition.cStartTime, 0, tmpByArr.length); |
|
|
|
Calendar cal = Calendar.getInstance(); |
|
String strEndTime = String.format("%04d-%02d-%02d %02d:%02d:%02d", |
|
cal.get(Calendar.YEAR), cal.get(Calendar.MONTH)+1, cal.get(Calendar.DAY_OF_MONTH), |
|
cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), cal.get(Calendar.SECOND)); |
|
tmpByArr = DataUtils.sdk_data_stringToByteArray(strEndTime, GlobalTool.getEncodeType()); |
|
System.arraycopy(tmpByArr, 0, stuLogSearch.stuSearchCondition.cEndTime, 0, tmpByArr.length); |
|
stu = stuLogSearch; |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_NETWHITEBLACK == command) |
|
{ |
|
stu = new STU_CFG_NET_WB_INFO(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_USER == command) |
|
{ |
|
STU_CFG_USER_GET stuUserCfgGet = new STU_CFG_USER_GET(); |
|
stuUserCfgGet.uCount = 10; |
|
stuUserCfgGet.uOffset = 0; |
|
stu = stuUserCfgGet; |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_USER_ONLINE == command) |
|
{ |
|
STU_CFG_USER_ONLINE_ITEMS stuCfgOnlineUser = new STU_CFG_USER_ONLINE_ITEMS(); |
|
stuCfgOnlineUser.uCount = 10; |
|
stuCfgOnlineUser.uOffset = 0; |
|
stu = stuCfgOnlineUser; |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_SNAP_CUTOUT == command) |
|
{ |
|
stu = new STU_CFG_SNAP_CUTOUT(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_OVERLAP_PIC == command) |
|
{ |
|
stu = new STU_CFG_OVERLAP_PIC(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_INTELLI_SCENE_FACE_DETECT == command) |
|
{ |
|
stu = new STU_CFG_INTELLI_SCENE_FACE_DETECT(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_INTELLI_RULE_FACE_DETECT == command) |
|
{ |
|
stu = new STU_CFG_INTELLI_RULE_FACE_DETECT(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_INTELLI_RULE_FACE_DETECT_STAT == command) |
|
{ |
|
stu = new STU_CFG_INTELLI_RULE_FACE_STATISTIC(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_ALARM_PARAM == command) |
|
{ |
|
stu = new STU_CFG_ALARM_PARAM(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_ENCODE_PARAM == command) |
|
{ |
|
stu = new STU_CFG_ENCODE_PARAM(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_GB28181_PARAM == command) |
|
{ |
|
stu = new STU_CFG_GB28181_PARAM(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_ONVIF == command) |
|
{ |
|
stu = new STU_CFG_ONVIF(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_CLOUD_SERVICE == command) |
|
{ |
|
stu = new STU_CFG_CLOUD_SERVICE(); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_ZK == command) |
|
{ |
|
stu = new STU_CFG_ZK_SERVICE(); |
|
}else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_SOC_CONSTANT_LAMP == command) |
|
{ |
|
stu = new NetStructs.STU_CFG_SOC_CONSTANT_LAMP_PARAM(); |
|
} |
|
|
|
return stu; |
|
} |
|
|
|
private void displayParsedData(int command, Pointer ptrOutBuffer) |
|
{ |
|
Vector<Vector<String>> tableContent = new Vector<Vector<String>>(); |
|
|
|
if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_SYS == command) |
|
{ |
|
STU_SYS_INFO stuSysInfo = new STU_SYS_INFO(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuSysInfo); |
|
m_curStuObj = stuSysInfo; |
|
insertSysInfo(tableContent, stuSysInfo); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_NET == command) |
|
{ |
|
STU_CFG_ALL_NETCARD stuCfgAllNetCard = new STU_CFG_ALL_NETCARD(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgAllNetCard); |
|
m_curStuObj = stuCfgAllNetCard; |
|
insertAllNetCard(tableContent, stuCfgAllNetCard); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_SYS_TIME == command) |
|
{ |
|
STU_TIME stuTime = new STU_TIME(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuTime); |
|
m_curStuObj = stuTime; |
|
insertStuTime(tableContent, stuTime); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_TIME_DST == command) |
|
{ |
|
STU_CFG_DST stuCfgDst = new STU_CFG_DST(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgDst); |
|
m_curStuObj = stuCfgDst; |
|
insertCfgDst(tableContent, stuCfgDst); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_NTP == command) |
|
{ |
|
STU_CFG_NTP stuCfgNtp = new STU_CFG_NTP(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgNtp); |
|
m_curStuObj = stuCfgNtp; |
|
insertCfgNtp(tableContent, stuCfgNtp); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_RECORD == command) |
|
{ |
|
STU_CFG_RECORD stuCfgRecord = new STU_CFG_RECORD(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgRecord); |
|
m_curStuObj = stuCfgRecord; |
|
insertCfgRecord(tableContent, stuCfgRecord); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_SERIAL_PORT == command) |
|
{ |
|
STU_CFG_COM stuCfgCom = new STU_CFG_COM(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgCom); |
|
m_curStuObj = stuCfgCom; |
|
insertCfgCom(tableContent, stuCfgCom); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_AUTO_MAINTAIN == command) |
|
{ |
|
STU_CFG_AUTO_MAINTAIN stuCfgAutoMaintain = new STU_CFG_AUTO_MAINTAIN(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgAutoMaintain); |
|
m_curStuObj = stuCfgAutoMaintain; |
|
insertCfgAutoMain(tableContent, stuCfgAutoMaintain); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_FACE_RECOGNIZE_RULES == command) |
|
{ |
|
STU_CFG_FACE_GROUP_RECOGNIZE_RULES stuCfgFaceGroupRecRules = new STU_CFG_FACE_GROUP_RECOGNIZE_RULES(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgFaceGroupRecRules); |
|
m_curStuObj = stuCfgFaceGroupRecRules; |
|
insertCfgFaceGroupRecResult(tableContent, stuCfgFaceGroupRecRules); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_CAPTURE_MODE == command) |
|
{ |
|
STU_CFG_CAPTURE_MODE stuCfgCapMode = new STU_CFG_CAPTURE_MODE(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgCapMode); |
|
m_curStuObj = stuCfgCapMode; |
|
insertCfgCapMode(tableContent, stuCfgCapMode); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_SNAP_TIMES == command) |
|
{ |
|
STU_CFG_SNAP_TIMES stuCfgSnapTimes = new STU_CFG_SNAP_TIMES(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgSnapTimes); |
|
m_curStuObj = stuCfgSnapTimes; |
|
insertCfgSnapTimes(tableContent, stuCfgSnapTimes); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_WEB == command) |
|
{ |
|
STU_CFG_NET_WEB stuCfgNetWeb = new STU_CFG_NET_WEB(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgNetWeb); |
|
m_curStuObj = stuCfgNetWeb; |
|
insertCfgNetWeb(tableContent, stuCfgNetWeb); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_RTSP == command) |
|
{ |
|
STU_CFG_NET_RTSP stuCfgNetRtsp = new STU_CFG_NET_RTSP(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgNetRtsp); |
|
m_curStuObj = stuCfgNetRtsp; |
|
insertCfgNetRtsp(tableContent, stuCfgNetRtsp); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_NET_SERVICE == command) |
|
{ |
|
STU_CFG_NET_SERVICE stuCfgNetService = new STU_CFG_NET_SERVICE(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgNetService); |
|
m_curStuObj = stuCfgNetService; |
|
insertCfgNetService(tableContent, stuCfgNetService); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_NET_PORT == command) |
|
{ |
|
STU_CFG_NET_PORT stuCfgNetPort = new STU_CFG_NET_PORT(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgNetPort); |
|
m_curStuObj = stuCfgNetPort; |
|
insertCfgNetService(tableContent, stuCfgNetPort); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_WIFI_ENABLE == command) |
|
{ |
|
STU_CFG_WIFI_CONFIG stuCfgWifiConfig = new STU_CFG_WIFI_CONFIG(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgWifiConfig); |
|
m_curStuObj = stuCfgWifiConfig; |
|
insertCfgWifiConfig(tableContent, stuCfgWifiConfig); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_WATERMARK == command) |
|
{ |
|
STU_CFG_WATER_MARK stuCfgWaterMark = new STU_CFG_WATER_MARK(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgWaterMark); |
|
m_curStuObj = stuCfgWaterMark; |
|
insertCfgWaterMark(tableContent, stuCfgWaterMark); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_CAMERA == command) |
|
{ |
|
STU_CFG_CAMERA stuCfgCamera = new STU_CFG_CAMERA(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgCamera); |
|
m_curStuObj = stuCfgCamera; |
|
insertCfgCamera(tableContent, stuCfgCamera); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_VIDEO_OSD == command) |
|
{ |
|
STU_CFG_VIDEO_OSD stuCfgVideoOsd = new STU_CFG_VIDEO_OSD(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgVideoOsd); |
|
m_curStuObj = stuCfgVideoOsd; |
|
insertCfgVideoOsd(tableContent, stuCfgVideoOsd); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_STORAGE == command) |
|
{ |
|
STU_CFG_STORAGE stuCfgStorage = new STU_CFG_STORAGE(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgStorage); |
|
m_curStuObj = stuCfgStorage; |
|
insertCfgStorage(tableContent, stuCfgStorage); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_NET_STORAGE_TRANS == command) |
|
{ |
|
STU_CFG_NET_STORAGE_TRANS stuCfgNetStorageTrans = new STU_CFG_NET_STORAGE_TRANS(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgNetStorageTrans); |
|
m_curStuObj = stuCfgNetStorageTrans; |
|
insertCfgNetStorageTrans(tableContent, stuCfgNetStorageTrans); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_TELNET == command) |
|
{ |
|
STU_CFG_TELNET stuCfgTelnet = new STU_CFG_TELNET(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgTelnet); |
|
m_curStuObj = stuCfgTelnet; |
|
insertCfgTelnet(tableContent, stuCfgTelnet); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_LOGSEARCH == command) |
|
{ |
|
STU_CFG_LOG stuCfgLog = new STU_CFG_LOG(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgLog); |
|
m_curStuObj = stuCfgLog; |
|
insertCfgLog(tableContent, stuCfgLog); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_NETWHITEBLACK == command) |
|
{ |
|
STU_CFG_NET_WB_INFO stuCfgNetWbInfo = new STU_CFG_NET_WB_INFO(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgNetWbInfo); |
|
m_curStuObj = stuCfgNetWbInfo; |
|
insertCfgNetWbInfo(tableContent, stuCfgNetWbInfo); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_USER == command) |
|
{ |
|
STU_CFG_USER_GET stuCfgUser = new STU_CFG_USER_GET(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgUser); |
|
m_curStuObj = stuCfgUser; |
|
insertCfgUser(tableContent, stuCfgUser); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_USER_ONLINE == command) |
|
{ |
|
STU_CFG_USER_ONLINE_ITEMS stuCfgUserOnlineItems = new STU_CFG_USER_ONLINE_ITEMS(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgUserOnlineItems); |
|
m_curStuObj = stuCfgUserOnlineItems; |
|
insertCfgUserOnline(tableContent, stuCfgUserOnlineItems); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_SNAP_CUTOUT == command) |
|
{ |
|
STU_CFG_SNAP_CUTOUT stuCfgSnapCutout = new STU_CFG_SNAP_CUTOUT(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgSnapCutout); |
|
m_curStuObj = stuCfgSnapCutout; |
|
insertCfgSnapCutout(tableContent, stuCfgSnapCutout); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_OVERLAP_PIC == command) |
|
{ |
|
STU_CFG_OVERLAP_PIC stuCfgOverlapPic = new STU_CFG_OVERLAP_PIC(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgOverlapPic); |
|
m_curStuObj = stuCfgOverlapPic; |
|
insertCfgOverlapPic(tableContent, stuCfgOverlapPic); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_INTELLI_SCENE_FACE_DETECT == command) |
|
{ |
|
STU_CFG_INTELLI_SCENE_FACE_DETECT stuCfgIntelliSceneFaceDetect = new STU_CFG_INTELLI_SCENE_FACE_DETECT(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgIntelliSceneFaceDetect); |
|
m_curStuObj = stuCfgIntelliSceneFaceDetect; |
|
insertCfgIntelliSceneFaceDetect(tableContent, stuCfgIntelliSceneFaceDetect); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_INTELLI_RULE_FACE_DETECT == command) |
|
{ |
|
STU_CFG_INTELLI_RULE_FACE_DETECT stuCfgIntelliRuleFaceDetect = new STU_CFG_INTELLI_RULE_FACE_DETECT(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgIntelliRuleFaceDetect); |
|
m_curStuObj = stuCfgIntelliRuleFaceDetect; |
|
insertCfgIntelliRuleFaceDetect(tableContent, stuCfgIntelliRuleFaceDetect); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_INTELLI_RULE_FACE_DETECT_STAT == command) |
|
{ |
|
STU_CFG_INTELLI_RULE_FACE_STATISTIC stuCfgIntelliRuleFaceSta = new STU_CFG_INTELLI_RULE_FACE_STATISTIC(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgIntelliRuleFaceSta); |
|
m_curStuObj = stuCfgIntelliRuleFaceSta; |
|
insertCfgIntelliRuleFaceSta(tableContent, stuCfgIntelliRuleFaceSta); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_ALARM_PARAM == command) |
|
{ |
|
STU_CFG_ALARM_PARAM stuCfgAlarmParam = new STU_CFG_ALARM_PARAM(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgAlarmParam); |
|
m_curStuObj = stuCfgAlarmParam; |
|
insertCfgAlarmParam(tableContent, stuCfgAlarmParam); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_ENCODE_PARAM == command) |
|
{ |
|
STU_CFG_ENCODE_PARAM stuCfgEncodeParam = new STU_CFG_ENCODE_PARAM(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgEncodeParam); |
|
m_curStuObj = stuCfgEncodeParam; |
|
insertCfgEncodeParam(tableContent, stuCfgEncodeParam); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_GB28181_PARAM == command) |
|
{ |
|
STU_CFG_GB28181_PARAM.ByReference stuCfgGB28181Param = new STU_CFG_GB28181_PARAM.ByReference(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgGB28181Param); |
|
m_curStuObj = stuCfgGB28181Param; |
|
insertCfgGB28181Param(tableContent, stuCfgGB28181Param); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_ONVIF == command) |
|
{ |
|
STU_CFG_ONVIF stuCfgOnvif = new STU_CFG_ONVIF(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgOnvif); |
|
m_curStuObj = stuCfgOnvif; |
|
insertCfgOnvif(tableContent, stuCfgOnvif); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_CLOUD_SERVICE == command) |
|
{ |
|
STU_CFG_CLOUD_SERVICE stuCfgCloudService = new STU_CFG_CLOUD_SERVICE(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgCloudService); |
|
m_curStuObj = stuCfgCloudService; |
|
insertCfgCloudService(tableContent, stuCfgCloudService); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_ZK == command) |
|
{ |
|
STU_CFG_ZK_SERVICE stuCfgZkService = new STU_CFG_ZK_SERVICE(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgZkService); |
|
m_curStuObj = stuCfgZkService; |
|
insertCfgZkService(tableContent, stuCfgZkService); |
|
} |
|
|
|
ui_refreshTableContent(tableContent); |
|
} |
|
|
|
private void insertSysInfo(Vector<Vector<String>> tableContent, STU_SYS_INFO stuSysInfo) |
|
{ |
|
String value = 1 == stuSysInfo.bAppAutoStart ? "支持" : "不支持"; |
|
insertRow(tableContent, "应用程序是否自启动", value); |
|
|
|
value = String.format("%d", stuSysInfo.nSupportLangNum); |
|
insertRow(tableContent, "支持的语言种数", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuSysInfo.szLanguages, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "语言", value); |
|
|
|
// 处理器信息 |
|
value = String.format("%d", stuSysInfo.nProcessorNum); |
|
insertRow(tableContent, "处理器个数", value); |
|
|
|
for(int i=0; i<stuSysInfo.nProcessorNum; i++) |
|
{ |
|
STU_SYS_PROCESSOR_INFO stuSysProcessorInfo = stuSysInfo.stuProcessorInfoArray[i]; |
|
|
|
String title = String.format("处理器_%d信息", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuSysProcessorInfo.szModel, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("处理器_%d频率", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuSysProcessorInfo.szFrequency, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("处理器_%d利用率(%%)", i+1); |
|
value = String.format("%d", stuSysProcessorInfo.nUsage); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("处理器_%d温度(摄氏度)", i+1); |
|
value = String.format("%d", stuSysProcessorInfo.nTemperature); |
|
insertRow(tableContent, title, value); |
|
} |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuSysInfo.stuDeviceInfo.szDeviceType, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "设备类型", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuSysInfo.stuDeviceInfo.szDeviceClass, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "设备类别", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuSysInfo.stuDeviceInfo.szSerialNumber, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "设备序列号", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuSysInfo.stuSoftWareVer.szVersion, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "软件版本信息", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuSysInfo.stuSoftWareVer.szBuildDate, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "软件版本发布时间", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuSysInfo.stuHardWareVer.szVersion, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "硬件版本信息", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuSysInfo.stuHardWareVer.szModel, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "硬件版本发布时间", value); |
|
|
|
value = String.format("%d", stuSysInfo.stuMemoryInfo.nTotalSize); |
|
insertRow(tableContent, "内存总大小(字节)", value); |
|
|
|
value = String.format("%d", stuSysInfo.stuMemoryInfo.nFreeSize); |
|
insertRow(tableContent, "内存空余大小(字节)", value); |
|
} |
|
|
|
private void insertAllNetCard(Vector<Vector<String>> tableContent, STU_CFG_ALL_NETCARD stuCfgAllNetCard) |
|
{ |
|
String value = String.format("%d", stuCfgAllNetCard.uNetCardNum); |
|
insertRow(tableContent, "真实的网卡数量", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgAllNetCard.szDefaultNetCard, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "默认网卡名称", value); |
|
|
|
for(int i=0; i<stuCfgAllNetCard.uNetCardNum; i++) |
|
{ |
|
STU_CFG_ONE_NETCARD stuCfgOneNetCard = stuCfgAllNetCard.stuNetCardsInfo[i]; |
|
|
|
String title = String.format("网卡_%d是否有效", i+1); |
|
value = 1 == stuCfgOneNetCard.bValid ? "是" : "否"; |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("网卡_%d MTU(获取后不能设置)", i+1); |
|
value = String.format("%d", stuCfgOneNetCard.nMTU); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("网卡_%d 名称(获取后不能设置)", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgOneNetCard.szNetCardName, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("网卡_%d MAC 地址(获取后不能设置)", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgOneNetCard.szMacAddress, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("网卡_%d IPv4是否有效,无效时不用配置(获取后不能设置)", i+1); |
|
value = 1 == stuCfgOneNetCard.stuCfgIpv4.bValid ? "是" : "否"; |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("网卡_%d IPv4 DHCP 使能", i+1); |
|
value = 1 == stuCfgOneNetCard.stuCfgIpv4.bDhcpEnable ? "是" : "否"; |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("网卡_%d IPv4 地址", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgOneNetCard.stuCfgIpv4.szIpAddress, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("网卡_%d IPv4子网掩码", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgOneNetCard.stuCfgIpv4.szSubnetMask, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("网卡_%d IPv4默认网关", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgOneNetCard.stuCfgIpv4.szDefaultGateway, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("网卡_%d IPv4 首选 DNS 服务地址", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgOneNetCard.stuCfgIpv4.szMainDnsServer, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("网卡_%d IPv4 备用 DNS 服务地址", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgOneNetCard.stuCfgIpv4.szExtraDnsServer, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("网卡_%d IPv6 是否有效,无效时不用配置(获取后不能设置)", i+1); |
|
value = 1 == stuCfgOneNetCard.stuCfgIpv6.bValid ? "是" : "否"; |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("网卡_%d IPv6 DHCP 使能(不支持设置)", i+1); |
|
value = 1 == stuCfgOneNetCard.stuCfgIpv6.bDhcpEnable ? "是" : "否"; |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("网卡_%d 系统自动分配的IPv6本地链路地址, 该地址只能直联,不需要Gateway(获取后不能设置)", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgOneNetCard.stuCfgIpv6.szIpLinkLocalAddress, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("网卡_%d IPv6 网络前缀", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgOneNetCard.stuCfgIpv6.szPrefix, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("网卡_%d IPv6 地址", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgOneNetCard.stuCfgIpv6.szIpAddress, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("网卡_%d IPv6子网掩码", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgOneNetCard.stuCfgIpv6.szSubnetMask, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("网卡_%d IPv6默认网关", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgOneNetCard.stuCfgIpv6.szDefaultGateway, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("网卡_%d IPv6 首选 DNS 服务地址", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgOneNetCard.stuCfgIpv6.szMainDnsServer, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("网卡_%d IPv6 备用 DNS 服务地址", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgOneNetCard.stuCfgIpv6.szExtraDnsServer, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
} |
|
} |
|
|
|
private void insertStuTime(Vector<Vector<String>> tableContent, STU_TIME stuTime) |
|
{ |
|
String value = String.format("%d", stuTime.nYear); |
|
insertRow(tableContent, "年", value); |
|
|
|
value = String.format("%d", stuTime.nMonth); |
|
insertRow(tableContent, "月", value); |
|
|
|
value = String.format("%d", stuTime.nDay); |
|
insertRow(tableContent, "日", value); |
|
|
|
value = String.format("%d", stuTime.nHour); |
|
insertRow(tableContent, "时", value); |
|
|
|
value = String.format("%d", stuTime.nMinute); |
|
insertRow(tableContent, "分", value); |
|
|
|
value = String.format("%d", stuTime.nSecond); |
|
insertRow(tableContent, "秒", value); |
|
} |
|
|
|
private void insertCfgDst(Vector<Vector<String>> tableContent, STU_CFG_DST stuCfgDst) |
|
{ |
|
String value = 1 == stuCfgDst.bEnable ? "是" : "否"; |
|
insertRow(tableContent, "是否使能", value); |
|
|
|
value = String.format("%d", stuCfgDst.iTimeZone); |
|
insertRow(tableContent, "正数标示东,负数标示西,[-12 ~ 13]", value); |
|
|
|
value = String.format("%02d-%02d-%02d-%02d", |
|
stuCfgDst.stuDstStartTime.iMouth, stuCfgDst.stuDstStartTime.iWeek, |
|
stuCfgDst.stuDstStartTime.iDay, stuCfgDst.stuDstStartTime.iHour); |
|
insertRow(tableContent, "开始时间(月-周-日-时)", value); |
|
|
|
value = String.format("%02d-%02d-%02d-%02d", |
|
stuCfgDst.stuDstEndTime.iMouth, stuCfgDst.stuDstEndTime.iWeek, |
|
stuCfgDst.stuDstEndTime.iDay, stuCfgDst.stuDstEndTime.iHour); |
|
insertRow(tableContent, "结束时间(月-周-日-时)", value); |
|
} |
|
|
|
private void insertCfgNtp(Vector<Vector<String>> tableContent, STU_CFG_NTP stuCfgNtp) |
|
{ |
|
String value = DataUtils.sdk_data_byteArrayToString(stuCfgNtp.szDomainName, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "域名称", value); |
|
} |
|
|
|
private void insertCfgRecord(Vector<Vector<String>> tableContent, STU_CFG_RECORD stuCfgRecord) |
|
{ |
|
String value = String.format("%d", stuCfgRecord.stuRecordPlan.bControlMode); |
|
insertRow(tableContent, "录像模式 0-自动,1-手动,2-关闭", value); |
|
|
|
for(int i=0; i<NetDefs.WEEK_SECTION; i++) |
|
{ |
|
for(int j=0; j<NetDefs.TIME_SECTION; j++) |
|
{ |
|
String title = String.format("时段_%d", i+1); |
|
value = 1 == stuCfgRecord.stuRecordPlan.stuWeekTimeSection.stuTimeDay[i].stuTimeSection[j].bValue ? "是" : "否"; |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("时段_%d 开始时间-小时", i+1); |
|
value = String.format("%d", stuCfgRecord.stuRecordPlan.stuWeekTimeSection.stuTimeDay[i].stuTimeSection[j].nStartHour); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("时段_%d 开始时间-分钟", i+1); |
|
value = String.format("%d", stuCfgRecord.stuRecordPlan.stuWeekTimeSection.stuTimeDay[i].stuTimeSection[j].nStartMinute); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("时段_%d 开始时间-秒", i+1); |
|
value = String.format("%d", stuCfgRecord.stuRecordPlan.stuWeekTimeSection.stuTimeDay[i].stuTimeSection[j].nStartSecond); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("时段_%d 结束时间-小时", i+1); |
|
value = String.format("%d", stuCfgRecord.stuRecordPlan.stuWeekTimeSection.stuTimeDay[i].stuTimeSection[j].nEndHour); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("时段_%d 结束时间-分钟", i+1); |
|
value = String.format("%d", stuCfgRecord.stuRecordPlan.stuWeekTimeSection.stuTimeDay[i].stuTimeSection[j].nEndMinute); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("时段_%d 结束时间-秒", i+1); |
|
value = String.format("%d", stuCfgRecord.stuRecordPlan.stuWeekTimeSection.stuTimeDay[i].stuTimeSection[j].nEndSecond); |
|
insertRow(tableContent, title, value); |
|
} |
|
} |
|
|
|
value = String.format("%d", stuCfgRecord.stuRecordOptions.uPackSize); |
|
insertRow(tableContent, "录像打包长度", value); |
|
|
|
value = String.format("%d", stuCfgRecord.stuRecordOptions.uPackTime); |
|
insertRow(tableContent, "录像打包时间", value); |
|
|
|
value = String.format("%d", stuCfgRecord.stuRecordOptions.uPreRecordTime); |
|
insertRow(tableContent, "预录时间", value); |
|
|
|
value = String.format("%d", stuCfgRecord.stuRecordOptions.bPackType); |
|
insertRow(tableContent, "录像打包类型 0是按时间录像", value); |
|
|
|
value = String.format("%d", stuCfgRecord.stuRecordOptions.bStreamType); |
|
insertRow(tableContent, "码流类型,0是主码流,1是副码流1,2是副码流2", value); |
|
} |
|
|
|
private void insertCfgCom(Vector<Vector<String>> tableContent, STU_CFG_COM stuCfgCom) |
|
{ |
|
String value = String.format("%d", stuCfgCom.uNums); |
|
insertRow(tableContent, "串口数目", value); |
|
|
|
for(int i=0; i<stuCfgCom.uNums; i++) |
|
{ |
|
STU_CFG_COM_ITEM stuCfgComItem = stuCfgCom.stuComItems[i]; |
|
|
|
String title = String.format("串口_%d 是否使能", i+1); |
|
value = 1 == stuCfgComItem.bEnable ? "是" : "否"; |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("串口_%d 串口类型", i+1); |
|
value = String.format("%d", stuCfgComItem.emComType); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("串口_%d 波特率", i+1); |
|
value = String.format("%d", stuCfgComItem.stuAttribute.uBaudRate); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("串口_%d 数据位", i+1); |
|
value = String.format("%d", stuCfgComItem.stuAttribute.nDataBits); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("串口_%d 校验模式", i+1); |
|
value = String.format("%d", stuCfgComItem.stuAttribute.emParity); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("串口_%d 停止位", i+1); |
|
value = String.format("%d", stuCfgComItem.stuAttribute.emStopBit); |
|
insertRow(tableContent, title, value); |
|
} |
|
} |
|
|
|
private void insertCfgAutoMain(Vector<Vector<String>> tableContent, |
|
STU_CFG_AUTO_MAINTAIN stuCfgAutoMaintain) |
|
{ |
|
String value = 1 == stuCfgAutoMaintain.bEnable ? "是" : "否"; |
|
insertRow(tableContent, "是否使能", value); |
|
|
|
value = String.format("%d", stuCfgAutoMaintain.uWeekDay); |
|
insertRow(tableContent, "周几重启,[0-6],0代表周日,6代表周六", value); |
|
|
|
value = String.format("%d", stuCfgAutoMaintain.uHour); |
|
insertRow(tableContent, "几点重启,[0-23]", value); |
|
} |
|
|
|
private void insertCfgFaceGroupRecResult(Vector<Vector<String>> tableContent, |
|
STU_CFG_FACE_GROUP_RECOGNIZE_RULES stuCfgFaceGroupRecRules) |
|
{ |
|
String value = String.format("%d", stuCfgFaceGroupRecRules.nRuleCount); |
|
insertRow(tableContent, "人脸识别规则实际数目", value); |
|
|
|
for(int i=0; i<stuCfgFaceGroupRecRules.nRuleCount; i++) |
|
{ |
|
STU_CFG_FACE_GROUP_RECOGNIZE_RULE stuCfgFaceGroupRecRule = stuCfgFaceGroupRecRules.stRuleArray[i]; |
|
|
|
value = String.format("%d", stuCfgFaceGroupRecRule.nGroupID); |
|
insertRow(tableContent, "人脸组 ID", value); |
|
|
|
String title = String.format("人脸组_%d 录像使能", i+1); |
|
value = 1 == stuCfgFaceGroupRecRule.stEventHandler.bRecordEnable ? "是" : "否"; |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("人脸组_%d 预录时间 [10s-300s],单位:秒", i+1); |
|
value = String.format("%d", stuCfgFaceGroupRecRule.stEventHandler.nRecordLatch); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("人脸组_%d 实际录像通道个数", i+1); |
|
value = String.format("%d", stuCfgFaceGroupRecRule.stEventHandler.nRecordChannelNum); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("人脸组_%d 报警输出使能", i+1); |
|
value = 1 == stuCfgFaceGroupRecRule.stEventHandler.bAlarmOutEnable ? "是" : "否"; |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("人脸组_%d 报警输入停止后,输出延时时间 [1s,300s],单位:秒", i+1); |
|
value = String.format("%d", stuCfgFaceGroupRecRule.stEventHandler.nAlarmOutLatch); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("人脸组_%d 实际报警输出通道个数", i+1); |
|
value = String.format("%d", stuCfgFaceGroupRecRule.stEventHandler.nAlarmOutChannelNum); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("人脸组_%d 抓图使能", i+1); |
|
value = 1 == stuCfgFaceGroupRecRule.stEventHandler.bCaptureEnable ? "是" : "否"; |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("人脸组_%d 图片关联录像的预录时间,不能大于通用的预录时间,单位:秒", i+1); |
|
value = String.format("%d", stuCfgFaceGroupRecRule.stEventHandler.nCapturePreRecordTime); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("人脸组_%d 实际抓图通道数", i+1); |
|
value = String.format("%d", stuCfgFaceGroupRecRule.stEventHandler.nCaptureChannelNum); |
|
insertRow(tableContent, title, value); |
|
} |
|
} |
|
|
|
private void insertCfgCapMode(Vector<Vector<String>> tableContent, STU_CFG_CAPTURE_MODE stuCfgCapMode) |
|
{ |
|
String value = String.format("%d", stuCfgCapMode.nMatchMode); |
|
insertRow(tableContent, "抓拍匹配模式,0-非实时匹配,1-实时匹配", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgCapMode.szMode, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "抓拍模式", value); |
|
} |
|
|
|
private void insertCfgSnapTimes(Vector<Vector<String>> tableContent, STU_CFG_SNAP_TIMES stuCfgSnapTimes) |
|
{ |
|
String value = String.format("%d", stuCfgSnapTimes.nRuleFaceDetectCapNum); |
|
insertRow(tableContent, "人脸检测抓拍张数,-1 表示不设置", value); |
|
|
|
value = String.format("%d", stuCfgSnapTimes.nRuleTrafficPassCapNum); |
|
insertRow(tableContent, "交通卡口抓拍张数,-1 表示不设置", value); |
|
} |
|
|
|
private void insertCfgNetWeb(Vector<Vector<String>> tableContent, STU_CFG_NET_WEB stuCfgNetWeb) |
|
{ |
|
String value = String.format("%d", stuCfgNetWeb.uHttpEnable); |
|
insertRow(tableContent, "使能开关,0 - 禁用;1 - 开启", value); |
|
|
|
value = String.format("%d", stuCfgNetWeb.uHttpPort); |
|
insertRow(tableContent, "http 端口", value); |
|
|
|
value = String.format("%d", stuCfgNetWeb.uHttpsEnable); |
|
insertRow(tableContent, "使能开关,0 - 禁用;1 - 开启", value); |
|
|
|
value = String.format("%d", stuCfgNetWeb.uHttpsPort); |
|
insertRow(tableContent, "https 端口", value); |
|
} |
|
|
|
private void insertCfgNetRtsp(Vector<Vector<String>> tableContent, STU_CFG_NET_RTSP stuCfgNetRtsp) |
|
{ |
|
String value = String.format("%d", stuCfgNetRtsp.nEnable); |
|
insertRow(tableContent, "使能开关,0 - 禁用;1 - 开启", value); |
|
|
|
value = String.format("%d", stuCfgNetRtsp.nRtspPort); |
|
insertRow(tableContent, "rtsp 端口", value); |
|
|
|
value = String.format("%d", stuCfgNetRtsp.nMaxConnectNum); |
|
insertRow(tableContent, "最大连接数", value); |
|
|
|
value = String.format("%d", stuCfgNetRtsp.stuRtp.uStartPort); |
|
insertRow(tableContent, "rtp 起始端口", value); |
|
|
|
value = String.format("%d", stuCfgNetRtsp.stuRtp.uEndPort); |
|
insertRow(tableContent, "rtp 结束端口", value); |
|
} |
|
|
|
private void insertCfgNetService(Vector<Vector<String>> tableContent, STU_CFG_NET_SERVICE stuCfgNetService) |
|
{ |
|
String value = String.format("%d", stuCfgNetService.uTcpPort); |
|
insertRow(tableContent, "数据传输服务 TCP 端口", value); |
|
|
|
value = String.format("%d", stuCfgNetService.uUdpPort); |
|
insertRow(tableContent, "数据传输服务 UDP 端口", value); |
|
|
|
value = String.format("%d", stuCfgNetService.uMaxConnectNum); |
|
insertRow(tableContent, "最大连接数", value); |
|
} |
|
|
|
private void insertCfgNetService(Vector<Vector<String>> tableContent, STU_CFG_NET_PORT stuCfgNetPort) |
|
{ |
|
String value = String.format("%d", stuCfgNetPort.uHttpPort); |
|
insertRow(tableContent, "http端口", value); |
|
|
|
value = String.format("%d", stuCfgNetPort.uHttpsPort); |
|
insertRow(tableContent, "https端口", value); |
|
|
|
value = String.format("%d", stuCfgNetPort.uRtspPort); |
|
insertRow(tableContent, "rtsp端口", value); |
|
|
|
value = String.format("%d", stuCfgNetPort.uServerPort); |
|
insertRow(tableContent, "server端口", value); |
|
} |
|
|
|
private void insertCfgWifiConfig(Vector<Vector<String>> tableContent, STU_CFG_WIFI_CONFIG stuCfgWifiConfig) |
|
{ |
|
String value = 1 == stuCfgWifiConfig.bEnable ? "是" : "否"; |
|
insertRow(tableContent, "wifi使能", value); |
|
} |
|
|
|
private void insertCfgWaterMark(Vector<Vector<String>> tableContent, STU_CFG_WATER_MARK stuCfgWaterMark) |
|
{ |
|
String value = 1 == stuCfgWaterMark.bEnable ? "是" : "否"; |
|
insertRow(tableContent, "是否添加水印", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgWaterMark.szData, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "水印信息", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgWaterMark.szKey, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "水印密钥", value); |
|
} |
|
|
|
private void insertCfgCamera(Vector<Vector<String>> tableContent, STU_CFG_CAMERA stuCfgCamera) |
|
{ |
|
String value = String.format("%d", stuCfgCamera.stuDayNightParam.byMode); |
|
insertRow(tableContent, "色彩切换模式,0-总是彩色,1-根据亮度或时间自动切换,2-总是黑白", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuDayNightParam.byDayNightSensitivity); |
|
insertRow(tableContent, "日夜模式切换灵敏度,范围1-3", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuDayNightParam.byDayNightSwitchDelay); |
|
insertRow(tableContent, "日夜模式切换延迟时间 单位秒,范围2-10", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuColor[0].byBrightness); |
|
insertRow(tableContent, "白天亮度", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuColor[0].byContrast); |
|
insertRow(tableContent, "白天对比度", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuColor[0].bySaturation); |
|
insertRow(tableContent, "白天饱和度", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuColor[0].byHue); |
|
insertRow(tableContent, "白天色调", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuColor[1].byBrightness); |
|
insertRow(tableContent, "夜晚亮度", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuColor[1].byContrast); |
|
insertRow(tableContent, "夜晚对比度", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuColor[1].bySaturation); |
|
insertRow(tableContent, "夜晚饱和度", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuColor[1].byHue); |
|
insertRow(tableContent, "夜晚色调", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuColor[2].byBrightness); |
|
insertRow(tableContent, "其他时段亮度", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuColor[2].byContrast); |
|
insertRow(tableContent, "其他时段对比度", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuColor[2].bySaturation); |
|
insertRow(tableContent, "其他时段饱和度", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuColor[2].byHue); |
|
insertRow(tableContent, "其他时段色调", value); |
|
|
|
value = 1 == stuCfgCamera.stuIris[0].bIrisAuto ? "是" : "否"; |
|
insertRow(tableContent, "白天自动光圈使能", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuIris[0].byIrisType); |
|
insertRow(tableContent, "白天光圈类型,0-正序光圈P90,1-反序光圈P90,2-DC光圈,3-固定光圈", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuIris[0].dwIris); |
|
insertRow(tableContent, "白天精确的手动光圈大小", value); |
|
|
|
value = 1 == stuCfgCamera.stuIris[1].bIrisAuto ? "是" : "否"; |
|
insertRow(tableContent, "黑夜自动光圈使能", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuIris[1].byIrisType); |
|
insertRow(tableContent, "黑夜光圈类型,0-正序光圈P90,1-反序光圈P90,2-DC光圈,3-固定光圈", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuIris[1].dwIris); |
|
insertRow(tableContent, "黑夜精确的手动光圈大小", value); |
|
|
|
value = 1 == stuCfgCamera.stuIris[2].bIrisAuto ? "是" : "否"; |
|
insertRow(tableContent, "其他时段自动光圈使能", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuIris[2].byIrisType); |
|
insertRow(tableContent, "其他时段光圈类型,0-正序光圈P90,1-反序光圈P90,2-DC光圈,3-固定光圈", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuIris[2].dwIris); |
|
insertRow(tableContent, "其他时段精确的手动光圈大小", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stu3DDenoise.byTridimDenoise); |
|
insertRow(tableContent, "是否开启3D降噪,0-关闭,1-开启,2-只开启视频,3-只开启图片", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stu3DDenoise.byTridimIntensity[0]); |
|
insertRow(tableContent, "视频三维降噪时域降噪强度,范围0~100", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stu3DDenoise.byTridimIntensity[1]); |
|
insertRow(tableContent, "图片三维降噪时域降噪强度,范围0~100", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stu3DDenoise.byTridimIntensitySpatial[0]); |
|
insertRow(tableContent, "视频三维降噪空域降噪强度,范围0~100", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stu3DDenoise.byTridimIntensitySpatial[1]); |
|
insertRow(tableContent, "图片三维降噪空域降噪强度,范围0~100", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stueExposure[0].bGainAuto); |
|
insertRow(tableContent, "视频自动增益", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stueExposure[0].byGainMin); |
|
insertRow(tableContent, "视频自动增益下限,范围0~100,小于GainMax", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stueExposure[0].byGainMax); |
|
insertRow(tableContent, "视频自动增益上限,范围0~100", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stueExposure[0].byGain); |
|
insertRow(tableContent, "视频固定增益调节,0~100", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stueExposure[1].bGainAuto); |
|
insertRow(tableContent, "图片流自动增益", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stueExposure[1].byGainMin); |
|
insertRow(tableContent, "图片流自动增益下限,范围0~100,小于GainMax", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stueExposure[1].byGainMax); |
|
insertRow(tableContent, "图片流自动增益上限,范围0~100", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stueExposure[1].byGain); |
|
insertRow(tableContent, "图片流固定增益调节,0~100", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stueExposure[2].bGainAuto); |
|
insertRow(tableContent, "抓拍帧自动增益", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stueExposure[2].byGainMin); |
|
insertRow(tableContent, "抓拍帧自动增益下限,范围0~100,小于GainMax", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stueExposure[2].byGainMax); |
|
insertRow(tableContent, "抓拍帧自动增益上限,范围0~100", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stueExposure[2].byGain); |
|
insertRow(tableContent, "抓拍帧固定增益调节,0~100", value); |
|
|
|
value = getWhiteBalanceString(stuCfgCamera.stuWhiteBalance[0].emWhiteBalance); |
|
insertRow(tableContent, "视频白平衡模式", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuWhiteBalance[0].byColorTemperatureLevel); |
|
insertRow(tableContent, "视频色温等级调节,白平衡为\"自定义色温等级\"模式下有效 0~255", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuWhiteBalance[0].byGainRed); |
|
insertRow(tableContent, "视频红色增益调节,白平衡为\"自定义\"模式下有效 0~100", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuWhiteBalance[0].byGainBlue); |
|
insertRow(tableContent, "视频蓝色增益调节,白平衡为\"自定义\"模式下有效 0~100", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuWhiteBalance[0].byGainGreen); |
|
insertRow(tableContent, "视频绿色增益调节,白平衡为\"自定义\"模式下有效 0~100", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuWhiteBalance[0].byPartWhiteBalanceWeight); |
|
insertRow(tableContent, "视频权重参数,用来调整局部白平衡和全局白平衡的权重比例 范围0-100", value); |
|
|
|
value = getWhiteBalanceString(stuCfgCamera.stuWhiteBalance[1].emWhiteBalance); |
|
insertRow(tableContent, "图片流白平衡模式", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuWhiteBalance[1].byColorTemperatureLevel); |
|
insertRow(tableContent, "图片流色温等级调节,白平衡为\"自定义色温等级\"模式下有效 0~255", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuWhiteBalance[1].byGainRed); |
|
insertRow(tableContent, "图片流红色增益调节,白平衡为\"自定义\"模式下有效 0~100", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuWhiteBalance[1].byGainBlue); |
|
insertRow(tableContent, "图片流蓝色增益调节,白平衡为\"自定义\"模式下有效 0~100", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuWhiteBalance[1].byGainGreen); |
|
insertRow(tableContent, "图片流绿色增益调节,白平衡为\"自定义\"模式下有效 0~100", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuWhiteBalance[1].byPartWhiteBalanceWeight); |
|
insertRow(tableContent, "图片流权重参数,用来调整局部白平衡和全局白平衡的权重比例 范围0-100", value); |
|
|
|
value = getWhiteBalanceString(stuCfgCamera.stuWhiteBalance[2].emWhiteBalance); |
|
insertRow(tableContent, "抓拍帧白平衡模式", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuWhiteBalance[2].byColorTemperatureLevel); |
|
insertRow(tableContent, "抓拍帧色温等级调节,白平衡为\"自定义色温等级\"模式下有效 0~255", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuWhiteBalance[2].byGainRed); |
|
insertRow(tableContent, "抓拍帧红色增益调节,白平衡为\"自定义\"模式下有效 0~100", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuWhiteBalance[2].byGainBlue); |
|
insertRow(tableContent, "抓拍帧蓝色增益调节,白平衡为\"自定义\"模式下有效 0~100", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuWhiteBalance[2].byGainGreen); |
|
insertRow(tableContent, "抓拍帧绿色增益调节,白平衡为\"自定义\"模式下有效 0~100", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuWhiteBalance[2].byPartWhiteBalanceWeight); |
|
insertRow(tableContent, "抓拍帧权重参数,用来调整局部白平衡和全局白平衡的权重比例,范围0-100", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuDefog[0].byMode); |
|
insertRow(tableContent, "白天透雾模式,0-关闭,1-自动,2-手动", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuDefog[0].nValue); |
|
insertRow(tableContent, "白天手动模式强度", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuDefog[1].byMode); |
|
insertRow(tableContent, "黑夜透雾模式,0-关闭,1-自动,2-手动", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuDefog[1].nValue); |
|
insertRow(tableContent, "黑夜手动模式强度", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuDefog[2].byMode); |
|
insertRow(tableContent, "其它时段透雾模式,0-关闭,1-自动,2-手动", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuDefog[2].nValue); |
|
insertRow(tableContent, "其它时段手动模式强度", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuMetering.byMode); |
|
insertRow(tableContent, "测光类型, 0-全局测光,1-局部测光,2-背光补偿,3-强光抑制", value); |
|
|
|
value = String.format("%d", stuCfgCamera.stuMetering.byIntensity); |
|
insertRow(tableContent, "测光强度,0-关闭,1-弱,2-中,3-强", value); |
|
} |
|
|
|
private String getWhiteBalanceString(int emWhiteBalance) |
|
{ |
|
String str = ""; |
|
|
|
if(EM_WHITE_BALANCE.WHITEBALANCE_DISABLE == emWhiteBalance) |
|
{ |
|
str = "禁止"; |
|
} |
|
else if(EM_WHITE_BALANCE.WHITEBALANCE_AUTO == emWhiteBalance) |
|
{ |
|
str = "自动"; |
|
} |
|
else if(EM_WHITE_BALANCE.WHITEBALANCE_SUNNY == emWhiteBalance) |
|
{ |
|
str = "晴天,7500K左右"; |
|
} |
|
else if(EM_WHITE_BALANCE.WHITEBALANCE_CLOUDY == emWhiteBalance) |
|
{ |
|
str = "阴天,7500K左右"; |
|
} |
|
else if(EM_WHITE_BALANCE.WHITEBALANCE_HOME == emWhiteBalance) |
|
{ |
|
str = "家,5000K左右"; |
|
} |
|
else if(EM_WHITE_BALANCE.WHITEBALANCE_OFFICE == emWhiteBalance) |
|
{ |
|
str = "办公,4400K左右"; |
|
} |
|
else if(EM_WHITE_BALANCE.WHITEBALANCE_NIGHT == emWhiteBalance) |
|
{ |
|
str = "夜晚,2800K左右"; |
|
} |
|
else if(EM_WHITE_BALANCE.WHITEBALANCE_CT_HIGH == emWhiteBalance) |
|
{ |
|
str = "高色温区间"; |
|
} |
|
else if(EM_WHITE_BALANCE.WHITEBALANCE_CT_LOW == emWhiteBalance) |
|
{ |
|
str = "低色温区间"; |
|
} |
|
else if(EM_WHITE_BALANCE.WHITEBALANCE_CT_AUTO == emWhiteBalance) |
|
{ |
|
str = "自动色温区间"; |
|
} |
|
else if(EM_WHITE_BALANCE.WHITEBALANCE_CT_CUSTOM == emWhiteBalance) |
|
{ |
|
str = "自定义色温等级"; |
|
} |
|
else if(EM_WHITE_BALANCE.WHITEBALANCE_PART == emWhiteBalance) |
|
{ |
|
str = "自定义多区域白平衡"; |
|
} |
|
else |
|
{ |
|
str = "未知"; |
|
} |
|
|
|
return str; |
|
} |
|
|
|
private void insertCfgVideoOsd(Vector<Vector<String>> tableContent, STU_CFG_VIDEO_OSD stuCfgVideoOsd) |
|
{ |
|
String value = String.format("%d", stuCfgVideoOsd.byFontSize); |
|
insertRow(tableContent, "字体大小 24/32/48...", value); |
|
|
|
value = String.format("%d", stuCfgVideoOsd.byFontType); |
|
insertRow(tableContent, "字体类型 0-宋体 1-楷体 2-雅黑", value); |
|
|
|
value = 1 == stuCfgVideoOsd.stuChannelOsd.bEnable ? "是" : "否"; |
|
insertRow(tableContent, "通道OSD使能", value); |
|
|
|
value = String.format("%d, %d, %d, %d", |
|
stuCfgVideoOsd.stuChannelOsd.stuRect.nLeft, stuCfgVideoOsd.stuChannelOsd.stuRect.nTop, |
|
stuCfgVideoOsd.stuChannelOsd.stuRect.nRight, stuCfgVideoOsd.stuChannelOsd.stuRect.nBottom); |
|
insertRow(tableContent, "通道OSD显示位置【0-8192】坐标系", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgVideoOsd.stuChannelOsd.szText, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "通道OSD标题", value); |
|
|
|
value = 1 == stuCfgVideoOsd.stuTimeOsd.bEnable ? "是" : "否"; |
|
insertRow(tableContent, "时间OSD使能", value); |
|
|
|
value = 1 == stuCfgVideoOsd.stuTimeOsd.bShowWeek ? "是" : "否"; |
|
insertRow(tableContent, "时间OSD使能", value); |
|
|
|
value = String.format("%d, %d, %d, %d", |
|
stuCfgVideoOsd.stuTimeOsd.stuRect.nLeft, stuCfgVideoOsd.stuTimeOsd.stuRect.nTop, |
|
stuCfgVideoOsd.stuTimeOsd.stuRect.nRight, stuCfgVideoOsd.stuTimeOsd.stuRect.nBottom); |
|
insertRow(tableContent, "时间OSD显示位置【0-8192】坐标系", value); |
|
|
|
value = String.format("%d", stuCfgVideoOsd.nRealCustomOsdCount); |
|
insertRow(tableContent, "自定义OSD个数", value); |
|
|
|
for(int i=0; i<stuCfgVideoOsd.nRealCustomOsdCount; i++) |
|
{ |
|
String title = String.format("自定义OSD_%d 使能", i+1); |
|
value = 1 == stuCfgVideoOsd.stuCustomOsdArray[i].bEnable ? "是" : "否"; |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("自定义OSD_%d 显示位置【0-8192】坐标系", i+1); |
|
value = String.format("%d, %d, %d, %d", |
|
stuCfgVideoOsd.stuCustomOsdArray[i].stuRect.nLeft, stuCfgVideoOsd.stuCustomOsdArray[i].stuRect.nTop, |
|
stuCfgVideoOsd.stuCustomOsdArray[i].stuRect.nRight, stuCfgVideoOsd.stuCustomOsdArray[i].stuRect.nBottom); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("自定义OSD_%d 标题", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgVideoOsd.stuCustomOsdArray[i].szText, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
} |
|
} |
|
|
|
private void insertCfgStorage(Vector<Vector<String>> tableContent, STU_CFG_STORAGE stuCfgStorage) |
|
{ |
|
String value = 1 == stuCfgStorage.stuStorPoint[0].bSupportFtp ? "是" : "否"; |
|
insertRow(tableContent, "录像支持ftp", value); |
|
|
|
value = 1 == stuCfgStorage.stuStorPoint[0].bSupportLocal ? "是" : "否"; |
|
insertRow(tableContent, "录像支持本地", value); |
|
|
|
value = 1 == stuCfgStorage.stuStorPoint[0].bSupportUsb ? "是" : "否"; |
|
insertRow(tableContent, "录像支持usb", value); |
|
|
|
value = 1 == stuCfgStorage.stuStorPoint[1].bSupportFtp ? "是" : "否"; |
|
insertRow(tableContent, "抓图支持ftp", value); |
|
|
|
value = 1 == stuCfgStorage.stuStorPoint[1].bSupportLocal ? "是" : "否"; |
|
insertRow(tableContent, "抓图支持本地", value); |
|
|
|
value = 1 == stuCfgStorage.stuStorPoint[1].bSupportUsb ? "是" : "否"; |
|
insertRow(tableContent, "抓图支持usb", value); |
|
|
|
value = 1 == stuCfgStorage.stuStoragePolicy.bOverWrite ? "是" : "否"; |
|
insertRow(tableContent, "存储空间是否满覆盖", value); |
|
|
|
value = 1 == stuCfgStorage.stuStoragePolicy.bEmergenceStorage ? "是" : "否"; |
|
insertRow(tableContent, "是否紧急存储,否为使用本地存储", value); |
|
} |
|
|
|
private void insertCfgNetStorageTrans(Vector<Vector<String>> tableContent, |
|
STU_CFG_NET_STORAGE_TRANS stuCfgNetStorageTrans) |
|
{ |
|
String value = String.format("%d", stuCfgNetStorageTrans.uItemCount); |
|
insertRow(tableContent, "网络存储配置个数", value); |
|
|
|
for(int i=0; i<stuCfgNetStorageTrans.uItemCount; i++) |
|
{ |
|
STU_CFG_NET_STORAGE_TRANS_ITEM stuItem = stuCfgNetStorageTrans.stuItemArray[i]; |
|
|
|
String title = String.format("配置项_%d 协议名称", i+1); |
|
String ftpValue = DataUtils.sdk_data_byteArrayToString(stuItem.szProtocol, GlobalTool.getEncodeType()); |
|
|
|
if(!ftpValue.isEmpty()) |
|
{ |
|
insertRow(tableContent, title, ftpValue); |
|
|
|
title = String.format("配置项_%d 服务地址, IP 或 域名", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuItem.szAddress, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("配置项_%d 断网续传使能", i+1); |
|
value = 1 == stuItem.bOfflineEnable ? "是" : "否"; |
|
insertRow(tableContent, title, value); |
|
|
|
if(0 == ftpValue.compareTo("Ftp")) |
|
{ |
|
STU_CFG_NET_STORAGE_FTP stuCfgNetStorageFtp = stuItem.stuFtpParams; |
|
|
|
title = String.format("配置项_%d 实时上传图片使能", i+1); |
|
value = 1 == stuCfgNetStorageFtp.uFtpPort ? "是" : "否"; |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("配置项_%d Ftp 服务器端口", i+1); |
|
value = String.format("%d", stuCfgNetStorageFtp.bRealtimeEnable); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("配置项_%d Ftp 用户名", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgNetStorageFtp.szUserName, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("配置项_%d Ftp 用户密码", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgNetStorageFtp.szPassword, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("配置项_%d Ftp 上传图片路径规则", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgNetStorageFtp.szPathRule, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("配置项_%d 路径编码类型", i+1); |
|
value = String.format("%d", stuCfgNetStorageFtp.emPathEncodeType); |
|
insertRow(tableContent, title, value); |
|
} |
|
} |
|
} |
|
} |
|
|
|
private void insertCfgTelnet(Vector<Vector<String>> tableContent, STU_CFG_TELNET stuCfgTelnet) |
|
{ |
|
String value = 1 == stuCfgTelnet.bEnable ? "是" : "否"; |
|
insertRow(tableContent, "Telnet使能", value); |
|
} |
|
|
|
private void insertCfgLog(Vector<Vector<String>> tableContent, STU_CFG_LOG stuCfgLog) |
|
{ |
|
String value = DataUtils.sdk_data_byteArrayToString(stuCfgLog.stuSearchCondition.cStartTime, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "日志查询开始时间", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgLog.stuSearchCondition.cEndTime, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "日志查询结束时间", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgLog.stuSearchCondition.cMainType, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "主日志类型,空则查询所有主类型", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgLog.stuSearchCondition.cSubType, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "次日志类型,空则查询所有子类型", value); |
|
|
|
value = String.format("%d", stuCfgLog.stuLogResult.uTotal); |
|
insertRow(tableContent, "查询到的总共的日志条数", value); |
|
|
|
value = String.format("%d", stuCfgLog.stuLogResult.uCurAmount); |
|
insertRow(tableContent, "当前返回的日志条数", value); |
|
|
|
for(int i=0; i<stuCfgLog.stuLogResult.uCurAmount; i++) |
|
{ |
|
STU_CFG_LOG_INFO stuLogInfo = stuCfgLog.stuLogResult.stuResult[i]; |
|
|
|
String title = String.format("日志信息_%d 日志记录时间", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuLogInfo.cLogTime, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("日志信息_%d 操作用户名", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuLogInfo.cOperUserName, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("日志信息_%d 主日志类型", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuLogInfo.cMainType, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("日志信息_%d 次日志类型", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuLogInfo.cSubType, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("日志信息_%d 通道号", i+1); |
|
value = String.format("%d", stuLogInfo.stuLogDetail.iChannel); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("日志信息_%d 远程登录IP", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuLogInfo.stuLogDetail.cRemoteIP, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("日志信息_%d 配置名称", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuLogInfo.stuLogDetail.cConfigName, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("日志信息_%d 网卡名称", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuLogInfo.stuLogDetail.cNetAdapter, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("日志信息_%d 客户端类型", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuLogInfo.stuLogDetail.cClientType, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
} |
|
} |
|
|
|
private void insertCfgNetWbInfo(Vector<Vector<String>> tableContent, STU_CFG_NET_WB_INFO stuCfgNetWbInfo) |
|
{ |
|
String value = String.format("%d", stuCfgNetWbInfo.bType); |
|
insertRow(tableContent, "黑白名单类型:0-无;1-黑名单,2-白名单", value); |
|
|
|
value = String.format("%d", stuCfgNetWbInfo.uIPv4Count); |
|
insertRow(tableContent, "IPv4 黑白名单信息个数", value); |
|
|
|
for(int i=0; i<stuCfgNetWbInfo.uIPv4Count; i++) |
|
{ |
|
STU_CFG_NET_WB_ITEM wbItem = stuCfgNetWbInfo.stuIPv4WBInfoArray[i]; |
|
|
|
|
|
String title = String.format("IPv4 黑白名单信息_%d ip地址类型: 0代表单个 IP 地址, 1代表 IP 范围", i+1); |
|
value = String.format("%d", wbItem.bIPType); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("IPv4 黑白名单信息_%d 起始 IP 地址", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(wbItem.cBeginIPAddr, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("IPv4 黑白名单信息_%d 终止 IP 地址", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(wbItem.cEndIPAddr, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
} |
|
|
|
value = String.format("%d", stuCfgNetWbInfo.uIPv6Count); |
|
insertRow(tableContent, "IPv6黑白名单信息个数", value); |
|
|
|
for(int i=0; i<stuCfgNetWbInfo.uIPv6Count; i++) |
|
{ |
|
STU_CFG_NET_WB_ITEM wbItem = stuCfgNetWbInfo.stuIPv6WBInfoArray[i]; |
|
|
|
|
|
String title = String.format("IPv6 黑白名单信息_%d ip地址类型: 0代表单个 IP 地址, 1代表 IP 范围", i+1); |
|
value = String.format("%d", wbItem.bIPType); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("IPv6 黑白名单信息_%d 起始 IP 地址", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(wbItem.cBeginIPAddr, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("IPv6 黑白名单信息_%d 终止 IP 地址", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(wbItem.cEndIPAddr, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
} |
|
} |
|
|
|
private void insertCfgUser(Vector<Vector<String>> tableContent, STU_CFG_USER_GET stuCfgUser) |
|
{ |
|
String value = String.format("%d", stuCfgUser.uActualCount); |
|
insertRow(tableContent, "需要获取的用户个数", value); |
|
|
|
for(int i=0; i<stuCfgUser.uActualCount; i++) |
|
{ |
|
STU_CFG_USER_INFO userInfo = stuCfgUser.stuUserInfo[i]; |
|
|
|
String title = String.format("用户_%d 用户级别", i + 1); |
|
value = String.format("%d", userInfo.nUserLevel); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("用户_%d 用户名", i + 1); |
|
value = DataUtils.sdk_data_byteArrayToString(userInfo.cUserName, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("用户_%d 密码", i + 1); |
|
value = DataUtils.sdk_data_byteArrayToString(userInfo.cPassword, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("用户_%d 备注信息", i + 1); |
|
value = DataUtils.sdk_data_byteArrayToString(userInfo.cComment, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
} |
|
} |
|
|
|
private void insertCfgUserOnline( |
|
Vector<Vector<String>> tableContent, STU_CFG_USER_ONLINE_ITEMS stuCfgUserOnlineItems) |
|
{ |
|
String value = String.format("%d", stuCfgUserOnlineItems.uActualCount); |
|
insertRow(tableContent, "需要获取的用户个数", value); |
|
|
|
for(int i=0; i<stuCfgUserOnlineItems.uActualCount; i++) |
|
{ |
|
STU_CFG_USER_ONLINE_ITEM onlineUser = stuCfgUserOnlineItems.stuUserInfo[i]; |
|
|
|
String title = String.format("用户_%d 用户级别", i + 1); |
|
value = String.format("%d", onlineUser.nUserLevel); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("用户_%d 地址", i + 1); |
|
value = DataUtils.sdk_data_byteArrayToString(onlineUser.cClientAddr, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("用户_%d 类型", i + 1); |
|
value = DataUtils.sdk_data_byteArrayToString(onlineUser.cClientType, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("用户_%d 登录时间", i + 1); |
|
value = DataUtils.sdk_data_byteArrayToString(onlineUser.cLoginTime, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("用户_%d 用户名称", i + 1); |
|
value = DataUtils.sdk_data_byteArrayToString(onlineUser.cUserName, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
} |
|
} |
|
|
|
private void insertCfgSnapCutout(Vector<Vector<String>> tableContent, STU_CFG_SNAP_CUTOUT stuCfgSnapCutout) |
|
{ |
|
String value = 1 == stuCfgSnapCutout.bEnable ? "是" : "否"; |
|
insertRow(tableContent, "抠图配置使能", value); |
|
|
|
value = String.format("%d", stuCfgSnapCutout.nType); |
|
insertRow(tableContent, "抠图配置类型,-1 表示无效; 0是人脸抠图; 1是半身抠图; 2是全身抠图; 3是车牌抠图", value); |
|
} |
|
|
|
private void insertCfgOverlapPic(Vector<Vector<String>> tableContent, STU_CFG_OVERLAP_PIC stuCfgOverlapPic) |
|
{ |
|
String value = 1 == stuCfgOverlapPic.stuOverLap.bMajorStreamIntelliTrack ? "是" : "否"; |
|
insertRow(tableContent, "是否叠加跟踪信息", value); |
|
|
|
value = 1 == stuCfgOverlapPic.stuOverLap.bMajorStreamDebug ? "是" : "否"; |
|
insertRow(tableContent, "是否叠加调试信息", value); |
|
|
|
value = 1 == stuCfgOverlapPic.stuGrapPic.bPictureUpload ? "是" : "否"; |
|
insertRow(tableContent, "是否显示背景图", value); |
|
} |
|
|
|
private void insertCfgIntelliSceneFaceDetect(Vector<Vector<String>> tableContent, |
|
STU_CFG_INTELLI_SCENE_FACE_DETECT stuCfgIntelliSceneFaceDetect) |
|
{ |
|
String value = DataUtils.sdk_data_byteArrayToString(stuCfgIntelliSceneFaceDetect.szClass, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "业务大类, 不可设置", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgIntelliSceneFaceDetect.szAlgorithm, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "算法版本,不可设置", value); |
|
|
|
value = String.format("%d", stuCfgIntelliSceneFaceDetect.stuParam.nFaceSize); |
|
insertRow(tableContent, "抓拍人脸的最小像素", value); |
|
|
|
value = String.format("%d", stuCfgIntelliSceneFaceDetect.stuParam.nAnalyseInterval); |
|
insertRow(tableContent, "算法处理间隔, 单位 ms,范围 0-2000,0 表示不作限制", value); |
|
|
|
value = String.format("%d", stuCfgIntelliSceneFaceDetect.stuParam.nAnalyseCount); |
|
insertRow(tableContent, "满足过滤阈值的最大处理次数,范围 0-20", value); |
|
|
|
value = String.format("%f", stuCfgIntelliSceneFaceDetect.stuParam.fPoseRoll); |
|
insertRow(tableContent, "最大转头角度;roll 角度", value); |
|
|
|
value = String.format("%f", stuCfgIntelliSceneFaceDetect.stuParam.fPosePitch); |
|
insertRow(tableContent, "最大点头角度;picth 角度", value); |
|
|
|
value = String.format("%f", stuCfgIntelliSceneFaceDetect.stuParam.fPoseYaw); |
|
insertRow(tableContent, "最大摇头角度;yaw 角度", value); |
|
|
|
value = String.format("%f", stuCfgIntelliSceneFaceDetect.stuParam.fBlurThreshold); |
|
insertRow(tableContent, "抓拍人脸的模糊程度约束", value); |
|
|
|
value = String.format("%d, %d, %d, %d", |
|
stuCfgIntelliSceneFaceDetect.stuParam.stuDetectRect.nLeft, |
|
stuCfgIntelliSceneFaceDetect.stuParam.stuDetectRect.nTop, |
|
stuCfgIntelliSceneFaceDetect.stuParam.stuDetectRect.nRight, |
|
stuCfgIntelliSceneFaceDetect.stuParam.stuDetectRect.nBottom); |
|
insertRow(tableContent, "人脸检测区域 [0-8192]坐标系", value); |
|
} |
|
|
|
private void insertCfgIntelliRuleFaceDetect(Vector<Vector<String>> tableContent, |
|
STU_CFG_INTELLI_RULE_FACE_DETECT stuCfgIntelliRuleFaceDetect) |
|
{ |
|
String value = 1 == stuCfgIntelliRuleFaceDetect.bEnable ? "是" : "否"; |
|
insertRow(tableContent, "人脸检测规则使能", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgIntelliRuleFaceDetect.szClass, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "业务大类, 不可设置", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgIntelliRuleFaceDetect.szType, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "业务小类, 不可设置", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgIntelliRuleFaceDetect.szName, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "规则名称, 不可设置", value); |
|
|
|
value = 1 == stuCfgIntelliRuleFaceDetect.stuConfig.bRecogniseFace ? "是" : "否"; |
|
insertRow(tableContent, "是否需要识别属性", value); |
|
|
|
value = String.format("%d", stuCfgIntelliRuleFaceDetect.stuConfig.nSnapInterval); |
|
insertRow(tableContent, "抓拍间隔,单位 ms", value); |
|
|
|
value = String.format("%d", stuCfgIntelliRuleFaceDetect.stuConfig.nQualityThreshold); |
|
insertRow(tableContent, "质量阈值 [0-100],小于阈值的图片会被过滤", value); |
|
|
|
value = 1 == stuCfgIntelliRuleFaceDetect.stuEventHandler.bRecordEnable ? "是" : "否"; |
|
insertRow(tableContent, "视频分析联动 录像使能", value); |
|
|
|
value = String.format("%d", stuCfgIntelliRuleFaceDetect.stuEventHandler.nRecordLatch); |
|
insertRow(tableContent, "视频分析联动 预录时间 [10s-300s],单位:秒", value); |
|
|
|
value = String.format("%d", stuCfgIntelliRuleFaceDetect.stuEventHandler.nRecordChannelNum); |
|
insertRow(tableContent, "视频分析联动 实际录像通道个数", value); |
|
|
|
value = 1 == stuCfgIntelliRuleFaceDetect.stuEventHandler.bAlarmOutEnable ? "是" : "否"; |
|
insertRow(tableContent, "视频分析联动 报警输出使能", value); |
|
|
|
value = String.format("%d", stuCfgIntelliRuleFaceDetect.stuEventHandler.nAlarmOutLatch); |
|
insertRow(tableContent, "视频分析联动 报警输入停止后,输出延时时间 [1s,300s],单位:秒", value); |
|
|
|
value = String.format("%d", stuCfgIntelliRuleFaceDetect.stuEventHandler.nAlarmOutChannelNum); |
|
insertRow(tableContent, "视频分析联动 实际报警输出通道个数", value); |
|
|
|
value = 1 == stuCfgIntelliRuleFaceDetect.stuEventHandler.bCaptureEnable ? "是" : "否"; |
|
insertRow(tableContent, "视频分析联动 抓图使能", value); |
|
|
|
value = String.format("%d", stuCfgIntelliRuleFaceDetect.stuEventHandler.nCapturePreRecordTime); |
|
insertRow(tableContent, "视频分析联动 图片关联录像的预录时间,不能大于通用的预录时间,单位:秒", value); |
|
|
|
value = String.format("%d", stuCfgIntelliRuleFaceDetect.stuEventHandler.nCaptureChannelNum); |
|
insertRow(tableContent, "视频分析联动 实际抓图通道数", value); |
|
} |
|
|
|
private void insertCfgIntelliRuleFaceSta(Vector<Vector<String>> tableContent, |
|
STU_CFG_INTELLI_RULE_FACE_STATISTIC stuCfgIntelliRuleFaceSta) |
|
{ |
|
String value = 1 == stuCfgIntelliRuleFaceSta.bEnable ? "是" : "否"; |
|
insertRow(tableContent, "人脸检测统计规则使能", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgIntelliRuleFaceSta.szClass, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "业务大类, 不可设置", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgIntelliRuleFaceSta.szType, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "业务小类, 不可设置", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgIntelliRuleFaceSta.szName, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "规则名称, 不可设置", value); |
|
|
|
value = String.format("%d", stuCfgIntelliRuleFaceSta.stuConfig.nInterval); |
|
insertRow(tableContent, "统计周期, 单位 s", value); |
|
} |
|
|
|
private void insertCfgAlarmParam(Vector<Vector<String>> tableContent, STU_CFG_ALARM_PARAM stuCfgAlarmParam) |
|
{ |
|
String value = String.format("%d", stuCfgAlarmParam.uAlarmInChannels); |
|
insertRow(tableContent, "报警输入通道数", value); |
|
|
|
for(int i=0; i<stuCfgAlarmParam.uAlarmInChannels; i++) |
|
{ |
|
STU_CFG_ALARM_IN_PARAM inParam = stuCfgAlarmParam.stuAlarmInParams[i]; |
|
|
|
String title = String.format("报警输入通道_%d 报警输入使能", i + 1); |
|
value = 1 == inParam.bEnable ? "是" : "否"; |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("报警输入通道_%d 传感器类型, 0是常开, 1是常闭", i + 1); |
|
value = String.format("%d", inParam.bSensorType); |
|
insertRow(tableContent, title, value); |
|
} |
|
|
|
value = String.format("%d", stuCfgAlarmParam.uAlarmOutChannels); |
|
insertRow(tableContent, "报警输出通道数", value); |
|
|
|
for(int i=0; i<stuCfgAlarmParam.uAlarmOutChannels; i++) |
|
{ |
|
STU_CFG_ALARM_OUT_PARAM outParam = stuCfgAlarmParam.stuAlarmOutParams[i]; |
|
|
|
String title = String.format("报警输出通道_%d 输出模式", i + 1); |
|
value = String.format("%d", outParam.bMode); |
|
insertRow(tableContent, title, value); |
|
} |
|
} |
|
|
|
private void insertCfgEncodeParam(Vector<Vector<String>> tableContent, STU_CFG_ENCODE_PARAM stuCfgEncodeParam) |
|
{ |
|
int nMaxCnt = stuCfgEncodeParam.stuEncodeConfig.uMainStreamNums; |
|
String value = String.format("%d", nMaxCnt); |
|
insertRow(tableContent, "主码流个数", value); |
|
insertCfrEncodeInfoRow(tableContent, stuCfgEncodeParam.stuEncodeConfig.stuMainStreamEncodeConfig, nMaxCnt, "主码流"); |
|
|
|
nMaxCnt = stuCfgEncodeParam.stuEncodeConfig.uExtraStreamNums; |
|
value = String.format("%d", nMaxCnt); |
|
insertRow(tableContent, "辅码流个数", value); |
|
insertCfrEncodeInfoRow(tableContent, stuCfgEncodeParam.stuEncodeConfig.stuExtraStreamEncodeConfig, nMaxCnt, "辅码流"); |
|
|
|
nMaxCnt = stuCfgEncodeParam.stuEncodeConfig.uCaptureStreamNums; |
|
value = String.format("%d", nMaxCnt); |
|
insertRow(tableContent, "抓图码流个数", value); |
|
insertCfrEncodeInfoRow(tableContent, stuCfgEncodeParam.stuEncodeConfig.stuCaptureStreamEncodeConfig, nMaxCnt, "抓图码流"); |
|
} |
|
|
|
private void insertCfrEncodeInfoRow( |
|
Vector<Vector<String>> tableContent, STU_CFG_ENCODE_CONFIG_PARAM[] stuCfgEncodeCfgParamList, |
|
int nMaxCnt, String strStreamType) |
|
{ |
|
for(int i=0; i<nMaxCnt; i++) |
|
{ |
|
STU_CFG_ENCODE_CONFIG_PARAM stuCfgEncodeCfgParam = stuCfgEncodeCfgParamList[i]; |
|
String title = String.format("%s_%d 使能", strStreamType, i + 1); |
|
String value = 1 == stuCfgEncodeCfgParam.bEnable ? "是" : "否"; |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("%s_%d 编码类型", strStreamType, i + 1); |
|
value = String.format("%d", stuCfgEncodeCfgParam.stuEncodeVideoConfig.nCompressionType); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("%s_%d 码流控制类型", strStreamType, i + 1); |
|
value = String.format("%d", stuCfgEncodeCfgParam.stuEncodeVideoConfig.nCtrlType); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("%s_%d 分辨率类型", strStreamType, i + 1); |
|
value = String.format("%d", stuCfgEncodeCfgParam.stuEncodeVideoConfig.nResolutionType); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("%s_%d 帧率", strStreamType, i + 1); |
|
value = String.format("%d", stuCfgEncodeCfgParam.stuEncodeVideoConfig.nFPS); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("%s_%d 码率大小", strStreamType, i + 1); |
|
value = String.format("%d", stuCfgEncodeCfgParam.stuEncodeVideoConfig.nBitRate); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("%s_%d I 帧间隔", strStreamType, i + 1); |
|
value = String.format("%d", stuCfgEncodeCfgParam.stuEncodeVideoConfig.nGop); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("%s_%d 图像质量,取值[1-6]", strStreamType, i + 1); |
|
value = String.format("%d", stuCfgEncodeCfgParam.stuEncodeVideoConfig.nQuality); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("%s_%d h264的svc层数", strStreamType, i + 1); |
|
value = String.format("%d", stuCfgEncodeCfgParam.stuEncodeVideoConfig.nH264SVCTLayer); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("%s_%d h264编码级别", strStreamType, i + 1); |
|
value = String.format("%d", stuCfgEncodeCfgParam.stuEncodeVideoConfig.nH264EncodeLevel); |
|
insertRow(tableContent, title, value); |
|
} |
|
} |
|
|
|
private void insertCfgGB28181Param(Vector<Vector<String>> tableContent, STU_CFG_GB28181_PARAM stuCfgGB28181Param) |
|
{ |
|
String value = 1 == stuCfgGB28181Param.bEnable ? "是" : "否"; |
|
insertRow(tableContent, "GB28181 配置参数 使能", value); |
|
|
|
value = String.format("%d", stuCfgGB28181Param.uAlarmInChannelNum); |
|
insertRow(tableContent, "报警输入通道数", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgGB28181Param.cAlarmInId, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "报警输入通道编号", value); |
|
|
|
value = String.format("%d", stuCfgGB28181Param.uChannelNum); |
|
insertRow(tableContent, "通道总数", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgGB28181Param.cChannelId, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "通道编号", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgGB28181Param.cCivilCode, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "行政区识别码", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgGB28181Param.cUserName, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "用户名,即设备id", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgGB28181Param.cPassword, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "注册密码", value); |
|
|
|
value = String.format("%d", stuCfgGB28181Param.uKeepAliveInterval); |
|
insertRow(tableContent, "心跳时间间隔", value); |
|
|
|
value = String.format("%d", stuCfgGB28181Param.uLocalSipPort); |
|
insertRow(tableContent, "本地sip端口号", value); |
|
|
|
value = String.format("%d", stuCfgGB28181Param.uMaxTimeoutCount); |
|
insertRow(tableContent, "最大心跳超时时间", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgGB28181Param.cSipDomain, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "域名", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgGB28181Param.cSipServerId, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "SIP 服务器 ID", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgGB28181Param.cSipServerIP, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "SIP 服务器 IP", value); |
|
|
|
value = String.format("%d", stuCfgGB28181Param.uSipServerPort); |
|
insertRow(tableContent, "SIP 服务器端口", value); |
|
} |
|
|
|
private void insertCfgOnvif(Vector<Vector<String>> tableContent, STU_CFG_ONVIF stuCfgOnvif) |
|
{ |
|
String value = 1 == stuCfgOnvif.bEnable ? "是" : "否"; |
|
insertRow(tableContent, "ONVIF 使能", value); |
|
} |
|
|
|
private void insertCfgCloudService(Vector<Vector<String>> tableContent, STU_CFG_CLOUD_SERVICE stuCfgCloudService) |
|
{ |
|
String value = 1 == stuCfgCloudService.bEnable ? "是" : "否"; |
|
insertRow(tableContent, "云服务 使能", value); |
|
|
|
value = String.format("%d", stuCfgCloudService.uPort); |
|
insertRow(tableContent, "服务端口", value); |
|
|
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgCloudService.szAddress, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, "服务地址、域名", value); |
|
} |
|
|
|
private void insertCfgZkService(Vector<Vector<String>> tableContent, STU_CFG_ZK_SERVICE stuCfgZkService) |
|
{ |
|
String value = String.format("%d", stuCfgZkService.uRealCount); |
|
insertRow(tableContent, "ZK服务配置个数", value); |
|
|
|
for(int i=0; i<stuCfgZkService.uRealCount; i++) |
|
{ |
|
STU_CFG_ZK_SERVICE_ITEM stuCfgZKServiceItem = stuCfgZkService.pstItems[i]; |
|
|
|
String title = String.format("ZK服务配置项_%d 是否使能", i+1); |
|
value = 1 == stuCfgZKServiceItem.bEnable ? "是" : "否"; |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("ZK服务配置项_%d 服务端口号", i+1); |
|
value = String.format("%d", stuCfgZKServiceItem.uPort); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("ZK服务配置项_%d 服务 IP 地址", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgZKServiceItem.szIpAddr, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
|
|
title = String.format("ZK服务配置项_%d 服务名称", i+1); |
|
value = DataUtils.sdk_data_byteArrayToString(stuCfgZKServiceItem.szName, GlobalTool.getEncodeType()); |
|
insertRow(tableContent, title, value); |
|
} |
|
} |
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
private Pointer createStuCfgZK(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_ZK_SERVICE stuCfgZkService = new STU_CFG_ZK_SERVICE(); |
|
|
|
for(int i=0; i<stuCfgZkService.uRealCount; i++) |
|
{ |
|
int nNewValue = (stuCfgZkService.pstItems[i].bEnable + 1) % 2; |
|
stuCfgZkService.pstItems[i].bEnable = nNewValue; |
|
} |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgZkService.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgZkService, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuCfgCloudService(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_CLOUD_SERVICE stuCfgCloudService = (STU_CFG_CLOUD_SERVICE) m_curStuObj; |
|
|
|
int nNewValue = (stuCfgCloudService.bEnable + 1) % 2; |
|
stuCfgCloudService.bEnable = nNewValue; |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgCloudService.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgCloudService, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuCfgOnvif(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_ONVIF stuCfgOnvif = (STU_CFG_ONVIF) m_curStuObj; |
|
|
|
int nNewValue = (stuCfgOnvif.bEnable + 1) % 2; |
|
stuCfgOnvif.bEnable = nNewValue; |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgOnvif.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgOnvif, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuCfgGB28181Param(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_GB28181_PARAM stuCfgGB28181Param = (STU_CFG_GB28181_PARAM) m_curStuObj; |
|
|
|
int nNewValue = (stuCfgGB28181Param.bEnable + 1) % 2; |
|
stuCfgGB28181Param.bEnable = nNewValue; |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgGB28181Param.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgGB28181Param, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuCfgEncodeParam(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_ENCODE_PARAM stuCfgEncodeParam = (STU_CFG_ENCODE_PARAM) m_curStuObj; |
|
|
|
int nSize = stuCfgEncodeParam.stuEncodeConfig.uExtraStreamNums; |
|
if(0 < nSize) |
|
{ |
|
int nNewValue = (stuCfgEncodeParam.stuEncodeConfig.stuExtraStreamEncodeConfig[0].bEnable + 1) % 2; |
|
stuCfgEncodeParam.stuEncodeConfig.stuExtraStreamEncodeConfig[0].bEnable = nNewValue; |
|
} |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgEncodeParam.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgEncodeParam, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuCfgAlarmParam(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_ALARM_PARAM stuCfgAlarmParam = (STU_CFG_ALARM_PARAM) m_curStuObj; |
|
|
|
if(0 < stuCfgAlarmParam.uAlarmInChannels) |
|
{ |
|
int nNewValue = (stuCfgAlarmParam.stuAlarmInParams[0].bEnable + 1) % 2; |
|
stuCfgAlarmParam.stuAlarmInParams[0].bEnable = nNewValue; |
|
} |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgAlarmParam.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgAlarmParam, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuCfgIntelliRuleFaceDetectStat(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_INTELLI_RULE_FACE_STATISTIC stuCfgIntelliRuleFaceSta = (STU_CFG_INTELLI_RULE_FACE_STATISTIC) m_curStuObj; |
|
|
|
int nNewValue = (stuCfgIntelliRuleFaceSta.bEnable + 1) % 2; |
|
stuCfgIntelliRuleFaceSta.bEnable = nNewValue; |
|
|
|
if(1 == nNewValue) |
|
stuCfgIntelliRuleFaceSta.stuConfig.nInterval = 10; |
|
else |
|
stuCfgIntelliRuleFaceSta.stuConfig.nInterval = 0; |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgIntelliRuleFaceSta.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgIntelliRuleFaceSta, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
|
|
} |
|
|
|
private Pointer createStuCfgIntelliRuleFaceDetect(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_INTELLI_RULE_FACE_DETECT stuCfgIntelliRuleFaceDetect = (STU_CFG_INTELLI_RULE_FACE_DETECT) m_curStuObj; |
|
|
|
int nNewValue = (stuCfgIntelliRuleFaceDetect.bEnable + 1) % 2; |
|
stuCfgIntelliRuleFaceDetect.bEnable = nNewValue; |
|
|
|
nNewValue = (stuCfgIntelliRuleFaceDetect.stuConfig.bRecogniseFace + 1) % 2; |
|
stuCfgIntelliRuleFaceDetect.stuConfig.bRecogniseFace = nNewValue; |
|
|
|
if(1 == nNewValue) |
|
stuCfgIntelliRuleFaceDetect.stuConfig.nSnapInterval = 100; |
|
else |
|
stuCfgIntelliRuleFaceDetect.stuConfig.nSnapInterval = 0; |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgIntelliRuleFaceDetect.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgIntelliRuleFaceDetect, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuCfgIntelliSceneFaceDetect(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_INTELLI_SCENE_FACE_DETECT stuCfgIntelliSceneFaceDetect = (STU_CFG_INTELLI_SCENE_FACE_DETECT) m_curStuObj; |
|
|
|
stuCfgIntelliSceneFaceDetect.stuParam.nFaceSize = 60; |
|
|
|
if(0 == stuCfgIntelliSceneFaceDetect.stuParam.nAnalyseInterval) |
|
{ |
|
stuCfgIntelliSceneFaceDetect.stuParam.nAnalyseInterval = 2000; |
|
} |
|
else |
|
{ |
|
stuCfgIntelliSceneFaceDetect.stuParam.nAnalyseInterval = 0; |
|
} |
|
|
|
if(0 == stuCfgIntelliSceneFaceDetect.stuParam.nAnalyseCount) |
|
{ |
|
stuCfgIntelliSceneFaceDetect.stuParam.nAnalyseCount = 20; |
|
} |
|
else |
|
{ |
|
stuCfgIntelliSceneFaceDetect.stuParam.nAnalyseCount = 0; |
|
} |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgIntelliSceneFaceDetect.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgIntelliSceneFaceDetect, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuCfgOverlapPic(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_OVERLAP_PIC stuCfgOverlapPic = (STU_CFG_OVERLAP_PIC) m_curStuObj; |
|
|
|
int nNewValue = (stuCfgOverlapPic.stuOverLap.bMajorStreamIntelliTrack + 1) % 2; |
|
stuCfgOverlapPic.stuOverLap.bMajorStreamIntelliTrack = nNewValue; |
|
|
|
nNewValue = (stuCfgOverlapPic.stuOverLap.bMajorStreamDebug + 1) % 2; |
|
stuCfgOverlapPic.stuOverLap.bMajorStreamDebug = nNewValue; |
|
|
|
nNewValue = (stuCfgOverlapPic.stuGrapPic.bPictureUpload + 1) % 2; |
|
stuCfgOverlapPic.stuGrapPic.bPictureUpload = nNewValue; |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgOverlapPic.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgOverlapPic, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuCfgSnapCutout(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_SNAP_CUTOUT stuCfgSnapCutout = (STU_CFG_SNAP_CUTOUT) m_curStuObj; |
|
|
|
int nNewValue = (stuCfgSnapCutout.bEnable + 1) % 2; |
|
stuCfgSnapCutout.bEnable = (byte) nNewValue; |
|
|
|
nNewValue = (stuCfgSnapCutout.nType + 1) % 4; |
|
stuCfgSnapCutout.nType = (byte) nNewValue; |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgSnapCutout.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgSnapCutout, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuCfgUser(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_USER_SET stuCfgUserSet = new STU_CFG_USER_SET(); |
|
STU_CFG_USER_GET stuCfgUserGet = (STU_CFG_USER_GET) m_curStuObj; |
|
|
|
if(1 < stuCfgUserGet.uCount) |
|
{ |
|
String strComment = DataUtils.sdk_data_byteArrayToString(stuCfgUserGet.stuUserInfo[1].cComment, GlobalTool.getEncodeType()); |
|
if(0 == strComment.compareTo("")) |
|
{ |
|
strComment = "aaa"; |
|
byte[] tmpByArr = DataUtils.sdk_data_stringToByteArray(strComment, GlobalTool.getEncodeType()); |
|
stuCfgUserGet.stuUserInfo[1].cComment = new byte[32]; |
|
System.arraycopy(tmpByArr, 0, stuCfgUserGet.stuUserInfo[1].cComment, 0, tmpByArr.length); |
|
} |
|
else |
|
{ |
|
stuCfgUserGet.stuUserInfo[1].cComment = new byte[32]; |
|
} |
|
|
|
stuCfgUserSet.bOperType = 3; |
|
stuCfgUserSet.stuUserInfo = stuCfgUserGet.stuUserInfo[1]; |
|
} |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgUserSet.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgUserSet, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuCfgNetWhiteBlack(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_NET_WB_INFO stuCfgNetWbInfo = (STU_CFG_NET_WB_INFO) m_curStuObj; |
|
|
|
int nNewValue = (stuCfgNetWbInfo.bType + 1) % 3; |
|
stuCfgNetWbInfo.bType = (byte) nNewValue; |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgNetWbInfo.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgNetWbInfo, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuCfgTelent(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_TELNET stuCfgTelnet = (STU_CFG_TELNET) m_curStuObj; |
|
|
|
int nNewValue = (stuCfgTelnet.bEnable + 1) % 2; |
|
stuCfgTelnet.bEnable = nNewValue; |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgTelnet.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgTelnet, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuCfgNetStorageTrans(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_NET_STORAGE_TRANS stuCfgNetStorageTrans = (STU_CFG_NET_STORAGE_TRANS) m_curStuObj; |
|
|
|
if(0 < stuCfgNetStorageTrans.uItemCount) |
|
{ |
|
int nNewValue = (stuCfgNetStorageTrans.stuItemArray[0].bOfflineEnable + 1) % 2; |
|
stuCfgNetStorageTrans.stuItemArray[0].bOfflineEnable = nNewValue; |
|
|
|
|
|
// if(0 < stuCfgNetStorageTrans.uItemCount) |
|
// { |
|
// for(int i=0; i<stuCfgNetStorageTrans.uItemCount; i++) |
|
// { |
|
// String name = DataUtils.sdk_data_byteArrayToString(stuCfgNetStorageTrans.stuItemArray[i].szProtocol,GlobalTool.getEncodeType()); |
|
// if("ftp".equalsIgnoreCase(name)){ |
|
// System.out.println(JSON.toJSON(stuCfgNetStorageTrans.stuItemArray[i]).toString()); |
|
// stuCfgNetStorageTrans.stuItemArray[i].szAddress = getNewArray(64,DataUtils.sdk_data_stringToByteArray("1.1.1.1",GlobalTool.getEncodeType())); |
|
// stuCfgNetStorageTrans.stuItemArray[i].stuFtpParams.szUserName = getNewArray(64,DataUtils.sdk_data_stringToByteArray("test",GlobalTool.getEncodeType())); |
|
// stuCfgNetStorageTrans.stuItemArray[i].stuFtpParams.szPassword = getNewArray(64,DataUtils.sdk_data_stringToByteArray("test123",GlobalTool.getEncodeType())); |
|
// } |
|
// } |
|
// |
|
// } |
|
} |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgNetStorageTrans.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
System.out.println("stuCfgNetStorageTrans"); |
|
System.out.println(JSON.toJSON(stuCfgNetStorageTrans).toString()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgNetStorageTrans, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
|
|
|
|
private byte[] getNewArray(int length,byte[] newArr){ |
|
byte[] arr = new byte[length]; |
|
for (int i = 0; i < length; i++) { |
|
if(newArr.length >= i+1){ |
|
arr[i] = newArr[i]; |
|
}else { |
|
arr[i] = 0; |
|
} |
|
} |
|
return arr; |
|
} |
|
|
|
private Pointer createStuCfgStorage(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_STORAGE stuCfgStorage = (STU_CFG_STORAGE) m_curStuObj; |
|
|
|
int nNewValue = (stuCfgStorage.stuStorPoint[0].bSupportFtp + 1) % 2; |
|
stuCfgStorage.stuStorPoint[0].bSupportFtp = nNewValue; |
|
|
|
nNewValue = (stuCfgStorage.stuStorPoint[0].bSupportLocal + 1) % 2; |
|
stuCfgStorage.stuStorPoint[0].bSupportLocal = nNewValue; |
|
|
|
nNewValue = (stuCfgStorage.stuStorPoint[0].bSupportUsb + 1) % 2; |
|
stuCfgStorage.stuStorPoint[0].bSupportUsb = nNewValue; |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgStorage.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgStorage, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuCfgVideoOsd(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_VIDEO_OSD stuCfgVideoOsd = (STU_CFG_VIDEO_OSD) m_curStuObj; |
|
|
|
int nNewValue = (stuCfgVideoOsd.byFontType + 1) % 3; |
|
stuCfgVideoOsd.byFontType = (byte) nNewValue; |
|
|
|
nNewValue = (stuCfgVideoOsd.stuChannelOsd.bEnable + 1) % 2; |
|
stuCfgVideoOsd.stuChannelOsd.bEnable = nNewValue; |
|
|
|
if(1 == nNewValue) |
|
{ |
|
stuCfgVideoOsd.stuChannelOsd.stuRect.nLeft = 50; |
|
stuCfgVideoOsd.stuChannelOsd.stuRect.nTop = 50; |
|
stuCfgVideoOsd.stuChannelOsd.stuRect.nRight = 90; |
|
stuCfgVideoOsd.stuChannelOsd.stuRect.nBottom = 90; |
|
} |
|
else |
|
{ |
|
stuCfgVideoOsd.stuChannelOsd.stuRect.nLeft = 0; |
|
stuCfgVideoOsd.stuChannelOsd.stuRect.nTop = 8191; |
|
stuCfgVideoOsd.stuChannelOsd.stuRect.nRight = 0; |
|
stuCfgVideoOsd.stuChannelOsd.stuRect.nBottom = 8191; |
|
} |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgVideoOsd.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgVideoOsd, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuCfgCamera(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_CAMERA stuCfgCamera = (STU_CFG_CAMERA) m_curStuObj; |
|
|
|
int nNewValue = (stuCfgCamera.stuDayNightParam.byMode + 1) % 3; |
|
stuCfgCamera.stuDayNightParam.byMode = (byte) nNewValue; |
|
|
|
stuCfgCamera.stuDayNightParam.byDayNightSensitivity = 3; |
|
stuCfgCamera.stuDayNightParam.byDayNightSwitchDelay = 9; |
|
|
|
stuCfgCamera.stuColor[0].byBrightness = 50; |
|
|
|
nNewValue = (stuCfgCamera.stuIris[0].bIrisAuto + 1) % 2; |
|
stuCfgCamera.stuIris[0].bIrisAuto = (byte) nNewValue; |
|
|
|
nNewValue = (stuCfgCamera.stu3DDenoise.byTridimDenoise + 1) % 4; |
|
stuCfgCamera.stu3DDenoise.byTridimDenoise = (byte) nNewValue; |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgCamera.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgCamera, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuCfgWaterMark(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_WATER_MARK stuCfgWaterMark = (STU_CFG_WATER_MARK) m_curStuObj; |
|
|
|
int nNewValue = (stuCfgWaterMark.bEnable + 1) % 2; |
|
stuCfgWaterMark.bEnable = nNewValue; |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgWaterMark.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgWaterMark, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuCfgWifiEnale(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_WIFI_CONFIG stuCfgWifiConfig = (STU_CFG_WIFI_CONFIG) m_curStuObj; |
|
|
|
int nNewValue = (stuCfgWifiConfig.bEnable + 1) % 2; |
|
stuCfgWifiConfig.bEnable = nNewValue; |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgWifiConfig.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgWifiConfig, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuCfgNetPort(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_NET_PORT stuCfgNetPort = (STU_CFG_NET_PORT) m_curStuObj; |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgNetPort.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgNetPort, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuCfgNetService(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_NET_SERVICE stuCfgNetService = (STU_CFG_NET_SERVICE) m_curStuObj; |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgNetService.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgNetService, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuCfgRtsp(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_NET_RTSP stuCfgNetRtsp = (STU_CFG_NET_RTSP) m_curStuObj; |
|
|
|
if(1 == stuCfgNetRtsp.nEnable) |
|
{ |
|
stuCfgNetRtsp.nRtspPort = 554; |
|
stuCfgNetRtsp.nMaxConnectNum = 15; |
|
stuCfgNetRtsp.stuRtp.uStartPort = 20000; |
|
stuCfgNetRtsp.stuRtp.uEndPort = 40000; |
|
} |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgNetRtsp.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgNetRtsp, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuCfgWeb(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_NET_WEB stuCfgNetWeb = (STU_CFG_NET_WEB) m_curStuObj; |
|
|
|
if(1 == stuCfgNetWeb.uHttpEnable) |
|
{ |
|
stuCfgNetWeb.uHttpPort = 80; |
|
} |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgNetWeb.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgNetWeb, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuCfgSnapTimes(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_SNAP_TIMES stuCfgSnapTimes = (STU_CFG_SNAP_TIMES) m_curStuObj; |
|
|
|
if(1 == stuCfgSnapTimes.nRuleFaceDetectCapNum) |
|
stuCfgSnapTimes.nRuleFaceDetectCapNum = 5; |
|
else |
|
stuCfgSnapTimes.nRuleFaceDetectCapNum = 1; |
|
|
|
if(1 == stuCfgSnapTimes.nRuleTrafficPassCapNum) |
|
stuCfgSnapTimes.nRuleTrafficPassCapNum = 5; |
|
else |
|
stuCfgSnapTimes.nRuleTrafficPassCapNum = 1; |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgSnapTimes.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgSnapTimes, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuCfgCaptureMode(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_CAPTURE_MODE stuCfgCapMode = (STU_CFG_CAPTURE_MODE) m_curStuObj; |
|
|
|
int nNewValue = (stuCfgCapMode.nMatchMode + 1) % 2; |
|
stuCfgCapMode.nMatchMode = nNewValue; |
|
|
|
String strMode = DataUtils.sdk_data_byteArrayToString(stuCfgCapMode.szMode, GlobalTool.getEncodeType()); |
|
for(int i=0; i<stuCfgCapMode.szMode.length; i++) |
|
{ |
|
stuCfgCapMode.szMode[i] = 0; |
|
} |
|
|
|
if(0 == strMode.compareTo("Auto")) |
|
{ |
|
byte[] tmpByArr = DataUtils.sdk_data_stringToByteArray("Best", GlobalTool.getEncodeType()); |
|
System.arraycopy(tmpByArr, 0, stuCfgCapMode.szMode, 0, tmpByArr.length); |
|
} |
|
else |
|
{ |
|
byte[] tmpByArr = DataUtils.sdk_data_stringToByteArray("Auto", GlobalTool.getEncodeType()); |
|
System.arraycopy(tmpByArr, 0, stuCfgCapMode.szMode, 0, tmpByArr.length); |
|
} |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgCapMode.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgCapMode, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuCfgFaceRecRules(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_FACE_GROUP_RECOGNIZE_RULES stuCfgFaceGroupRecRules = (STU_CFG_FACE_GROUP_RECOGNIZE_RULES) m_curStuObj; |
|
|
|
if(1 == stuCfgFaceGroupRecRules.stRuleArray[0].stEventHandler.bRecordEnable) |
|
{ |
|
stuCfgFaceGroupRecRules.stRuleArray[0].stEventHandler.bRecordEnable = 0; |
|
stuCfgFaceGroupRecRules.stRuleArray[0].stEventHandler.nRecordLatch = 10; |
|
stuCfgFaceGroupRecRules.stRuleArray[0].stEventHandler.nRecordChannelNum = 0; |
|
} |
|
else |
|
{ |
|
stuCfgFaceGroupRecRules.stRuleArray[0].stEventHandler.bRecordEnable = 1; |
|
stuCfgFaceGroupRecRules.stRuleArray[0].stEventHandler.nRecordLatch = 300; |
|
stuCfgFaceGroupRecRules.stRuleArray[0].stEventHandler.nRecordChannelNum = 0; |
|
} |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgFaceGroupRecRules.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgFaceGroupRecRules, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuCfgAutoMaintain(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_AUTO_MAINTAIN stuCfgAutoMaintain = (STU_CFG_AUTO_MAINTAIN) m_curStuObj; |
|
|
|
if(1 == stuCfgAutoMaintain.bEnable) |
|
{ |
|
stuCfgAutoMaintain.bEnable = 0; |
|
stuCfgAutoMaintain.uWeekDay = 0; |
|
stuCfgAutoMaintain.uHour = 2; |
|
} |
|
else |
|
{ |
|
stuCfgAutoMaintain.bEnable = 1; |
|
stuCfgAutoMaintain.uWeekDay = 6; |
|
stuCfgAutoMaintain.uHour = 23; |
|
} |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgAutoMaintain.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgAutoMaintain, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuCfgRecord(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_RECORD stuCfgRecord = (STU_CFG_RECORD) m_curStuObj; |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgRecord.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgRecord, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuCfgNtp(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_NTP stuCfgNtp = (STU_CFG_NTP) m_curStuObj; |
|
|
|
int nNewValue = (stuCfgNtp.bEnable + 1) % 2; |
|
stuCfgNtp.bEnable = nNewValue; |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgNtp.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgNtp, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuCfgTimeDst(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_DST stuCfgDst = (STU_CFG_DST) m_curStuObj; |
|
|
|
int nNewValue = (stuCfgDst.bEnable + 1) % 2; |
|
stuCfgDst.bEnable = nNewValue; |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgDst.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgDst, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuCfgSysTime(IntByReference inBufferSize) |
|
{ |
|
STU_TIME stuTime = (STU_TIME) m_curStuObj; |
|
|
|
Calendar c = Calendar.getInstance(); |
|
stuTime.nYear = c.get(Calendar.YEAR); |
|
stuTime.nMonth = c.get(Calendar.DAY_OF_MONTH); |
|
stuTime.nDay = c.get(Calendar.DATE); |
|
stuTime.nHour = c.get(Calendar.HOUR_OF_DAY); |
|
stuTime.nMinute = c.get(Calendar.MINUTE); |
|
stuTime.nSecond = c.get(Calendar.SECOND); |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuTime.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuTime, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuCfgAllNetCard(IntByReference inBufferSize) |
|
{ |
|
STU_CFG_ALL_NETCARD stuCfgAllNetCard = (STU_CFG_ALL_NETCARD) m_curStuObj; |
|
|
|
for(int i=0; i<stuCfgAllNetCard.uNetCardNum; i++) |
|
{ |
|
if(0 == stuCfgAllNetCard.stuNetCardsInfo[i].bValid) |
|
{ |
|
continue; |
|
} |
|
|
|
if(1 == stuCfgAllNetCard.stuNetCardsInfo[i].stuCfgIpv4.bValid) |
|
{ |
|
// 设置为1,即true后,ip动态分配 |
|
stuCfgAllNetCard.stuNetCardsInfo[i].stuCfgIpv4.bDhcpEnable = 0; |
|
|
|
String ipv4Ip = this.m_jtf_ip.getText(); |
|
byte[] tmpByArr = DataUtils.sdk_data_stringToByteArray(ipv4Ip, GlobalTool.getEncodeType()); |
|
System.arraycopy(tmpByArr, 0, stuCfgAllNetCard.stuNetCardsInfo[i].stuCfgIpv4.szIpAddress, 0, tmpByArr.length); |
|
|
|
String ip[] = ipv4Ip.split("\\."); |
|
String strTmp = ip[0] + "." + ip[1] + "." + ip[2] + ".1"; |
|
tmpByArr = DataUtils.sdk_data_stringToByteArray(strTmp, GlobalTool.getEncodeType()); |
|
|
|
System.arraycopy(tmpByArr, 0, stuCfgAllNetCard.stuNetCardsInfo[i].stuCfgIpv4.szDefaultGateway, 0, tmpByArr.length); |
|
System.arraycopy(tmpByArr, 0, stuCfgAllNetCard.stuNetCardsInfo[i].stuCfgIpv4.szMainDnsServer, 0, tmpByArr.length); |
|
System.arraycopy(tmpByArr, 0, stuCfgAllNetCard.stuNetCardsInfo[i].stuCfgIpv4.szExtraDnsServer, 0, tmpByArr.length); |
|
} |
|
} |
|
|
|
/* |
|
* |
|
* |
|
* |
|
*/ |
|
|
|
inBufferSize.setValue(stuCfgAllNetCard.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgAllNetCard, ptrInBuffer, 0); |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
private Pointer createStuBuffer(int nCommand, IntByReference inBufferSize) |
|
{ |
|
Pointer ptrInBuffer = null; |
|
|
|
if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_SYS == nCommand) |
|
{ |
|
this.setNotifyInfo("不支持"); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_NET == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgAllNetCard(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_SYS_TIME == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgSysTime(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_TIME_DST == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgTimeDst(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_NTP == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgNtp(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_RECORD == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgRecord(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_AUTO_MAINTAIN == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgAutoMaintain(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_FACE_RECOGNIZE_RULES == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgFaceRecRules(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_CAPTURE_MODE == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgCaptureMode(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_SNAP_TIMES == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgSnapTimes(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_WEB == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgWeb(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_RTSP == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgRtsp(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_NET_SERVICE == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgNetService(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_NET_PORT == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgNetPort(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_WIFI_ENABLE == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgWifiEnale(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_WATERMARK == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgWaterMark(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_CAMERA == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgCamera(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_VIDEO_OSD == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgVideoOsd(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_STORAGE == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgStorage(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_NET_STORAGE_TRANS == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgNetStorageTrans(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_TELNET == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgTelent(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_NETWHITEBLACK == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgNetWhiteBlack(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_USER == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgUser(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_SNAP_CUTOUT == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgSnapCutout(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_OVERLAP_PIC == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgOverlapPic(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_INTELLI_SCENE_FACE_DETECT == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgIntelliSceneFaceDetect(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_INTELLI_RULE_FACE_DETECT == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgIntelliRuleFaceDetect(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_INTELLI_RULE_FACE_DETECT_STAT == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgIntelliRuleFaceDetectStat(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_ALARM_PARAM == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgAlarmParam(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_ENCODE_PARAM == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgEncodeParam(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_GB28181_PARAM == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgGB28181Param(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_ONVIF == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgOnvif(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_CLOUD_SERVICE == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgCloudService(inBufferSize); |
|
} |
|
else if(EM_DEVICE_CFG_TYPE.DEVICE_CFG_ZK == nCommand) |
|
{ |
|
ptrInBuffer = createStuCfgZK(inBufferSize); |
|
} |
|
|
|
return ptrInBuffer; |
|
} |
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
private boolean getDeviceCfg() |
|
{ |
|
int curSelIndex = this.m_list_cfg_type.getSelectedIndex(); |
|
if(0 > curSelIndex) |
|
return false; |
|
|
|
this.m_tableModel.setRowCount(0); |
|
int command = m_mapIndexToCfgType.get(curSelIndex); |
|
IntByReference outBufferSize = new IntByReference(0); |
|
Pointer ptrOutBuffer = initStuData(command, outBufferSize); |
|
IntByReference nReturnSize = new IntByReference(0); |
|
|
|
if(null == ptrOutBuffer) |
|
return false; |
|
|
|
boolean bResult = NetLib.instance.Net_GetDeviceCfg( |
|
m_loginID, |
|
command, |
|
0, |
|
ptrOutBuffer, |
|
outBufferSize.getValue(), |
|
nReturnSize, |
|
6000); |
|
|
|
if(!bResult) |
|
{ |
|
int error = NetLib.instance.Net_LastError(); |
|
String strError = String.format("Net_GetDeviceCfg fail, command = %d, errorCode = %d", command, error); |
|
System.out.println(strError); |
|
return false; |
|
} |
|
|
|
displayParsedData(command, ptrOutBuffer); |
|
|
|
return true; |
|
} |
|
|
|
private boolean setDeviceCfg() |
|
{ |
|
if(-1 == this.m_list_cfg_type.getSelectedIndex()) |
|
return false; |
|
|
|
int nCommand = m_mapIndexToCfgType.get(this.m_list_cfg_type.getSelectedIndex()); |
|
IntByReference inBufferSize = new IntByReference(0); |
|
Pointer ptrInBuffer = createStuBuffer(nCommand, inBufferSize); |
|
|
|
if(null == ptrInBuffer) |
|
return false; |
|
|
|
System.out.println("ptrInBuffer="+JSON.toJSON(ptrInBuffer).toString()); |
|
System.out.println("inBufferSize="+ inBufferSize.getValue()); |
|
boolean bResult = NetLib.instance.Net_SetDeviceCfg( |
|
m_loginID, |
|
nCommand, |
|
0, |
|
ptrInBuffer, |
|
inBufferSize.getValue(), |
|
6000); |
|
|
|
if(!bResult) |
|
{ |
|
int error = NetLib.instance.Net_LastError(); |
|
String strError = String.format("Net_SetDeviceCfg fail, command = %d, errorCode = %d", nCommand, error); |
|
System.out.println(strError); |
|
return false; |
|
} |
|
|
|
getDeviceCfg(); |
|
|
|
return true; |
|
} |
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
private boolean onBtnLogin() |
|
{ |
|
if(checkParams()) |
|
{ |
|
int nPort = Integer.parseInt(m_jtf_port.getText()); |
|
IntByReference nError = new IntByReference(0); |
|
|
|
this.m_loginID = NetLib.instance.Net_LoginDevice(m_jtf_ip.getText(), nPort, m_jtf_username.getText(), m_jtf_password.getText(), null, nError); |
|
if(0 == this.m_loginID.longValue()) |
|
{ |
|
|
|
JOptionPane.showMessageDialog(null, "登陆失败", "提示", JOptionPane.ERROR_MESSAGE); |
|
int error = NetLib.instance.Net_LastError(); |
|
String strError = String.format("Net_LoginDevice fail, errorCode = %d", error); |
|
System.out.println(strError); |
|
setNotifyInfo("登陆失败"); |
|
return false; |
|
} |
|
|
|
setNotifyInfo("登陆成功"); |
|
// 添加 |
|
addListItems(); |
|
refreshEnables(); |
|
} |
|
|
|
return true; |
|
} |
|
|
|
private void onBtnLogout() |
|
{ |
|
if(0 != this.m_loginID.longValue()) |
|
{ |
|
boolean bResult = NetLib.instance.Net_LogoutDevice(this.m_loginID); |
|
if(!bResult) |
|
{ |
|
int error = NetLib.instance.Net_LastError(); |
|
String strError = String.format("Net_GetAllFaceGroups fail, errorCode = %d", error); |
|
System.out.println(strError); |
|
setNotifyInfo("登出失败"); |
|
return; |
|
} |
|
|
|
setNotifyInfo("登出成功"); |
|
this.m_loginID = new NativeLong(0); |
|
this.m_list_cfg_type.setSelectedIndex(-1); |
|
this.m_list_cfg_type.setListData(new Vector<String>()); |
|
refreshEnables(); |
|
} |
|
} |
|
|
|
private void onBtnRefreshCfgTypeList() |
|
{ |
|
if(getDeviceCfg()) |
|
{ |
|
setNotifyInfo("查询成功"); |
|
} |
|
else |
|
{ |
|
setNotifyInfo("查询失败"); |
|
} |
|
} |
|
|
|
private void onBtnSet() |
|
{ |
|
if(setDeviceCfg()) |
|
{ |
|
setNotifyInfo("设置成功"); |
|
} |
|
else |
|
{ |
|
setNotifyInfo("设置失败"); |
|
} |
|
} |
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
@Override |
|
public void actionPerformed(ActionEvent e) |
|
{ |
|
Object obj = e.getSource(); |
|
if(obj == this.m_btn_login) |
|
{ |
|
onBtnLogin(); |
|
} |
|
else if(obj == this.m_btn_logout) |
|
{ |
|
onBtnLogout(); |
|
} |
|
else if(obj == this.m_btn_refresh) |
|
{ |
|
onBtnRefreshCfgTypeList(); |
|
} |
|
else if(obj == this.m_btn_set) |
|
{ |
|
onBtnSet(); |
|
} |
|
} |
|
|
|
@Override |
|
public void valueChanged(ListSelectionEvent e) |
|
{ |
|
Object obj = e.getSource(); |
|
if(obj == this.m_list_cfg_type && this.m_list_cfg_type.getValueIsAdjusting()) |
|
{ |
|
onBtnRefreshCfgTypeList(); |
|
} |
|
} |
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
/** |
|
* Launch the application. |
|
*/ |
|
public static void main(String[] args) { |
|
EventQueue.invokeLater(new Runnable() { |
|
public void run() { |
|
try { |
|
run_device_cfg window = new run_device_cfg(); |
|
window.m_frame.setVisible(true); |
|
} catch (Exception e) { |
|
e.printStackTrace(); |
|
} |
|
} |
|
}); |
|
} |
|
|
|
|
|
////////////////////////////////////////////////////////// |
|
public void startCfg(){ |
|
String strIp="192.168.1.64"; |
|
int nPort= 27778; |
|
String strUsername="admin"; |
|
String strPassword="admin123"; |
|
String strDevSN="8R23R300003"; |
|
IntByReference nError = new IntByReference(0); |
|
|
|
NativeLong loginID = NetLib.instance.Net_LoginDevice(strIp, nPort, strUsername, strPassword, null, nError); |
|
System.out.println("loginID = "+loginID); |
|
|
|
//bRealtimeEnable为0时 bOfflineEnable只能为0 |
|
int bRealtimeEnable = 0; |
|
int bOfflineEnable = 0; |
|
String szAddress = "192.168.1.1"; |
|
int uFtpPort = 22; |
|
String szUserName = "test"; |
|
String szPassword = "test123"; |
|
boolean result = setDeviceFtpCfg(loginID, bRealtimeEnable, bOfflineEnable, szAddress, uFtpPort, szUserName, szPassword); |
|
|
|
System.out.println("result = " + result); |
|
} |
|
|
|
public void getLigntCfg(NativeLong loginID){ |
|
int nCommand = EM_DEVICE_CFG_TYPE.DEVICE_CFG_SOC_CONSTANT_LAMP; |
|
NetStructs.STU_CFG_SOC_CONSTANT_LAMP_PARAM cfgSupplementLightItem = getCfgSupplementLightItem(loginID,nCommand); |
|
System.out.println(JSON.toJSONString(cfgSupplementLightItem.stSOCLamps[0])); |
|
} |
|
|
|
|
|
public NetStructs.STU_CFG_SOC_CONSTANT_LAMP_PARAM getCfgSupplementLightItem(NativeLong loginID, int nCommand){ |
|
|
|
IntByReference outBufferSize = new IntByReference(0); |
|
IntByReference nReturnSize = new IntByReference(0); |
|
Pointer ptrOutBuffer = initStuData(nCommand, outBufferSize); |
|
boolean bResult = NetLib.instance.Net_GetDeviceCfg( |
|
loginID, |
|
nCommand, |
|
0, |
|
ptrOutBuffer, |
|
outBufferSize.getValue(), |
|
nReturnSize, |
|
6000); |
|
|
|
if(!bResult) |
|
{ |
|
int error = NetLib.instance.Net_LastError(); |
|
String strError = String.format("Net_GetDeviceCfg fail, command = %d, errorCode = %d", nCommand, error); |
|
System.out.println(strError); |
|
return null; |
|
} |
|
|
|
NetStructs.STU_CFG_SOC_CONSTANT_LAMP_PARAM cfg = new NetStructs.STU_CFG_SOC_CONSTANT_LAMP_PARAM(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, cfg); |
|
|
|
return cfg; |
|
} |
|
/** |
|
* |
|
* @param bRealtimeEnable 使能 0-否 1-是 |
|
* @param szAddress 服务地址 |
|
* @param bOfflineEnable 断网续传 0-否 1-是 |
|
* @param uFtpPort 端口 |
|
* @param szUserName 用户名 |
|
* @param szPassword 密码 |
|
* @return |
|
*/ |
|
public boolean setDeviceFtpCfg(NativeLong loginID, int bRealtimeEnable,int bOfflineEnable,String szAddress,int uFtpPort,String szUserName,String szPassword){ |
|
//上传图片路径规则 |
|
String szPathRule = "/%n/%Y/%M/%D/%Y_%M_%D_%h_%m_%s.jpg"; |
|
byte[] szPathRuleBytes = getNewArray(160,DataUtils.sdk_data_stringToByteArray(szPathRule,GlobalTool.getEncodeType())); |
|
//路径编码类型 |
|
int emPathEncodeType = 0; |
|
byte[] szAddressBytes = getNewArray(64,DataUtils.sdk_data_stringToByteArray(szAddress,GlobalTool.getEncodeType())); |
|
byte[] szUserNameBytes = getNewArray(64,DataUtils.sdk_data_stringToByteArray(szUserName,GlobalTool.getEncodeType())); |
|
byte[] szPasswordBytes = getNewArray(64,DataUtils.sdk_data_stringToByteArray(szPassword,GlobalTool.getEncodeType())); |
|
|
|
|
|
// 句柄 - 网络存储传输配置 |
|
int nCommand = EM_DEVICE_CFG_TYPE.DEVICE_CFG_NET_STORAGE_TRANS; |
|
|
|
STU_CFG_NET_STORAGE_TRANS stuCfgNetStorageTrans = getStuCfgNetStorageTrans(loginID,nCommand); |
|
IntByReference inBufferSize = new IntByReference(0); |
|
Pointer ptrInBuffer = getDeviceCfgPointer(stuCfgNetStorageTrans,inBufferSize,bRealtimeEnable,bOfflineEnable,szAddressBytes,uFtpPort,szUserNameBytes,szPasswordBytes,szPathRuleBytes,emPathEncodeType); |
|
|
|
if(null == ptrInBuffer) |
|
return false; |
|
|
|
System.out.println("ptrInBuffer="+JSON.toJSON(ptrInBuffer).toString()); |
|
System.out.println("inBufferSize="+ inBufferSize.getValue()); |
|
|
|
boolean bResult2 = NetLib.instance.Net_SetDeviceCfg( |
|
loginID, |
|
nCommand, |
|
0, |
|
ptrInBuffer, |
|
inBufferSize.getValue(), |
|
6000); |
|
|
|
if(!bResult2) |
|
{ |
|
int error = NetLib.instance.Net_LastError(); |
|
String strError = String.format("Net_SetDeviceCfg fail, command = %d, errorCode = %d", nCommand, error); |
|
System.out.println(strError); |
|
return false; |
|
} |
|
|
|
|
|
System.out.println("33333333333333333333333333333333"); |
|
STU_CFG_NET_STORAGE_TRANS stuCfgNetStorageTrans2 = getStuCfgNetStorageTrans(loginID,nCommand); |
|
System.out.println(JSON.toJSON(stuCfgNetStorageTrans2.stuItemArray[1]).toString()); |
|
return true; |
|
} |
|
|
|
public STU_CFG_NET_STORAGE_TRANS getStuCfgNetStorageTrans(NativeLong loginID, int nCommand){ |
|
|
|
IntByReference outBufferSize = new IntByReference(0); |
|
IntByReference nReturnSize = new IntByReference(0); |
|
Pointer ptrOutBuffer = initStuData(nCommand, outBufferSize); |
|
boolean bResult = NetLib.instance.Net_GetDeviceCfg( |
|
loginID, |
|
nCommand, |
|
0, |
|
ptrOutBuffer, |
|
outBufferSize.getValue(), |
|
nReturnSize, |
|
6000); |
|
|
|
if(!bResult) |
|
{ |
|
int error = NetLib.instance.Net_LastError(); |
|
String strError = String.format("Net_GetDeviceCfg fail, command = %d, errorCode = %d", nCommand, error); |
|
System.out.println(strError); |
|
return null; |
|
} |
|
|
|
STU_CFG_NET_STORAGE_TRANS stuCfgNetStorageTrans = new STU_CFG_NET_STORAGE_TRANS(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgNetStorageTrans); |
|
|
|
return stuCfgNetStorageTrans; |
|
} |
|
|
|
public Pointer getDeviceCfgPointer(STU_CFG_NET_STORAGE_TRANS stuCfgNetStorageTrans,IntByReference inBufferSize,int bRealtimeEnable, |
|
int bOfflineEnable,byte[] szAddress,int uFtpPort, |
|
byte[] szUserName,byte[] szPassword,byte[] szPathRule,int emPathEncodeType){ |
|
|
|
if(0 < stuCfgNetStorageTrans.uItemCount) |
|
{ |
|
for(int i=0; i<stuCfgNetStorageTrans.uItemCount; i++) |
|
{ |
|
String name = DataUtils.sdk_data_byteArrayToString(stuCfgNetStorageTrans.stuItemArray[i].szProtocol,GlobalTool.getEncodeType()); |
|
if("ftp".equalsIgnoreCase(name)){ |
|
System.out.println("111111111111111111"); |
|
System.out.println(JSON.toJSON(stuCfgNetStorageTrans.stuItemArray[i]).toString()); |
|
stuCfgNetStorageTrans.stuItemArray[i].szAddress = szAddress; |
|
stuCfgNetStorageTrans.stuItemArray[i].bOfflineEnable = bOfflineEnable; |
|
stuCfgNetStorageTrans.stuItemArray[i].stuFtpParams.szUserName = szUserName; |
|
stuCfgNetStorageTrans.stuItemArray[i].stuFtpParams.szPassword = szPassword; |
|
stuCfgNetStorageTrans.stuItemArray[i].stuFtpParams.uFtpPort = uFtpPort; |
|
stuCfgNetStorageTrans.stuItemArray[i].stuFtpParams.bRealtimeEnable = bRealtimeEnable; |
|
stuCfgNetStorageTrans.stuItemArray[i].stuFtpParams.szPathRule = szPathRule; |
|
stuCfgNetStorageTrans.stuItemArray[i].stuFtpParams.emPathEncodeType = emPathEncodeType; |
|
} |
|
} |
|
|
|
} |
|
|
|
System.out.println("222222222222222222222222222"); |
|
System.out.println(JSON.toJSON(stuCfgNetStorageTrans.stuItemArray[1]).toString()); |
|
|
|
inBufferSize.setValue(stuCfgNetStorageTrans.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
System.out.println("stuCfgNetStorageTrans"); |
|
System.out.println(JSON.toJSON(stuCfgNetStorageTrans).toString()); |
|
DataUtils.sdk_data_structureToPtr(stuCfgNetStorageTrans, ptrInBuffer, 0); |
|
return ptrInBuffer; |
|
} |
|
|
|
public CameraNetFtp getCfg(NativeLong loginID){ |
|
STU_CFG_NET_STORAGE_TRANS stuCfgNetStorageTrans = getStuCfgNetStorageTrans(loginID,EM_DEVICE_CFG_TYPE.DEVICE_CFG_NET_STORAGE_TRANS); |
|
|
|
CameraNetFtp ftpCfg = new CameraNetFtp(); |
|
for(int i=0; i<stuCfgNetStorageTrans.uItemCount; i++) |
|
{ |
|
STU_CFG_NET_STORAGE_TRANS_ITEM stuItem = stuCfgNetStorageTrans.stuItemArray[i]; |
|
String ftpValue = DataUtils.sdk_data_byteArrayToString(stuItem.szProtocol, GlobalTool.getEncodeType()); |
|
if("ftp".equalsIgnoreCase(ftpValue)) |
|
{ |
|
String address = DataUtils.sdk_data_byteArrayToString(stuItem.szAddress, GlobalTool.getEncodeType()); |
|
ftpCfg.setAddress(address); |
|
|
|
STU_CFG_NET_STORAGE_FTP stuCfgNetStorageFtp = stuItem.stuFtpParams; |
|
|
|
ftpCfg.setIsEnable((long) stuCfgNetStorageFtp.bRealtimeEnable); |
|
ftpCfg.setPort((long) stuCfgNetStorageFtp.uFtpPort); |
|
|
|
String username = DataUtils.sdk_data_byteArrayToString(stuCfgNetStorageFtp.szUserName, GlobalTool.getEncodeType()); |
|
ftpCfg.setUsername(username); |
|
|
|
String pwd = DataUtils.sdk_data_byteArrayToString(stuCfgNetStorageFtp.szPassword, GlobalTool.getEncodeType()); |
|
ftpCfg.setPassword(pwd); |
|
|
|
String pathrule = DataUtils.sdk_data_byteArrayToString(stuCfgNetStorageFtp.szPathRule, GlobalTool.getEncodeType()); |
|
ftpCfg.setPathRule(pathrule); |
|
} |
|
} |
|
return ftpCfg; |
|
} |
|
|
|
//获取自动重启配置 |
|
public STU_CFG_AUTO_MAINTAIN getAutoCfg(NativeLong loginID ,int nCommand){ |
|
|
|
|
|
IntByReference outBufferSize = new IntByReference(0); |
|
IntByReference nReturnSize = new IntByReference(0); |
|
Pointer ptrOutBuffer = initStuData(nCommand, outBufferSize); |
|
boolean bResult = NetLib.instance.Net_GetDeviceCfg( |
|
loginID, |
|
nCommand, |
|
0, |
|
ptrOutBuffer, |
|
outBufferSize.getValue(), |
|
nReturnSize, |
|
6000); |
|
|
|
STU_CFG_AUTO_MAINTAIN stuCfgAutoMaintain = new STU_CFG_AUTO_MAINTAIN(); |
|
DataUtils.sdk_data_ptrToStructure(ptrOutBuffer, stuCfgAutoMaintain); |
|
System.out.println(stuCfgAutoMaintain); |
|
return stuCfgAutoMaintain; |
|
} |
|
|
|
|
|
//设置自动重启 |
|
/** |
|
* |
|
* @param bEnable 使能 0-否 1-是 |
|
* @param uHour 几点重启 |
|
* @param uWeekDay 周几重启 |
|
* @return |
|
*/ |
|
public STU_CFG_AUTO_MAINTAIN setAutoFtpCfg(NativeLong loginID, int bEnable,int uHour,int uWeekDay){ |
|
|
|
|
|
|
|
// 句柄 - 网络存储传输配置 |
|
int nCommand = EM_DEVICE_CFG_TYPE.DEVICE_CFG_AUTO_MAINTAIN; |
|
|
|
STU_CFG_AUTO_MAINTAIN stuCfgAutoMaintain = getAutoCfg(loginID, nCommand); |
|
|
|
IntByReference inBufferSize = new IntByReference(0); |
|
|
|
stuCfgAutoMaintain.bEnable=bEnable; |
|
stuCfgAutoMaintain.uHour=uHour; |
|
stuCfgAutoMaintain.uWeekDay=uWeekDay; |
|
|
|
|
|
inBufferSize.setValue(stuCfgAutoMaintain.size()); |
|
Pointer ptrInBuffer = DataUtils.sdk_data_createPtr(inBufferSize.getValue()); |
|
|
|
DataUtils.sdk_data_structureToPtr(stuCfgAutoMaintain, ptrInBuffer, 0); |
|
|
|
|
|
if(null == ptrInBuffer) |
|
return null; |
|
|
|
boolean bResult2 = NetLib.instance.Net_SetDeviceCfg( |
|
loginID, |
|
nCommand, |
|
0, |
|
ptrInBuffer, |
|
inBufferSize.getValue(), |
|
6000); |
|
|
|
if(!bResult2) |
|
{ |
|
int error = NetLib.instance.Net_LastError(); |
|
String strError = String.format("Net_SetDeviceCfg fail, command = %d, errorCode = %d", nCommand, error); |
|
return null; |
|
} |
|
System.out.println(stuCfgAutoMaintain); |
|
return stuCfgAutoMaintain; |
|
} |
|
}
|
|
|