Browse Source

摄像机配置

platform-api
4670101279 2 years ago
parent
commit
f6affd9d32
  1. 23
      ruoyi-code/src/main/java/utils/CameraUtil.java
  2. 8
      ruoyi-code/src/main/java/utils/RegisterUtil.java
  3. 3476
      ruoyi-code/src/main/java/utils/run_device_cfg.java

23
ruoyi-code/src/main/java/utils/CameraUtil.java

@ -3,6 +3,7 @@ package utils;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.sun.jna.NativeLong; import com.sun.jna.NativeLong;
import com.sun.jna.ptr.IntByReference; import com.sun.jna.ptr.IntByReference;
import sdk.java.lib.netmanager.NetEnums;
import sdk.java.lib.netmanager.NetLib; import sdk.java.lib.netmanager.NetLib;
import sdk.java.lib.netmanager.NetStructs; import sdk.java.lib.netmanager.NetStructs;
@ -12,13 +13,25 @@ public class CameraUtil {
public static void main(String[] args) { public static void main(String[] args) {
NetLib.instance.Net_Init(null, null); NetLib.instance.Net_Init(null, null);
String strIp="36.133.93.214"; String strIp="36.134.51.220";
int nPort= 27778; int nPort= 16754;
String strUsername="admin"; String strUsername="admin";
String strPassword="admin123"; String strPassword="admin123";
IntByReference error = null; String strDevSN="8R23R300003";
NativeLong loginID = NetLib.instance.Net_LoginDevice(strIp, nPort, strUsername, strPassword, null, error);
System.out.println(loginID); IntByReference nErr = new IntByReference(0);
// 此接口专为 主动注册登陆 接口,与 Net_LoginDevice 有区别
NativeLong lLoginID = NetLib.instance.Net_LoginDeviceSpec(
strIp,
nPort,
strUsername,
strPassword,
NetEnums.EM_LOGIN_PROTOCAL_TYPE.EM_LOGIN_PROTOCAL_TYPE_REG_SERVER,
strDevSN,
null,
nErr);
System.out.println(lLoginID);
//重启设备 //重启设备
// boolean bResult = NetLib.instance.Net_RebootDevice(loginID); // boolean bResult = NetLib.instance.Net_RebootDevice(loginID);

8
ruoyi-code/src/main/java/utils/RegisterUtil.java

@ -58,8 +58,8 @@ import java.util.*;
@Component @Component
public class RegisterUtil implements ActionListener { public class RegisterUtil implements ActionListener {
// private String m_jtfServerIP = "172.16.46.58"; private String m_jtfServerIP = "172.16.46.58";
private String m_jtfServerIP = "192.168.1.11"; // private String m_jtfServerIP = "192.168.1.11";
private String m_jtfServerPort = "8020"; private String m_jtfServerPort = "8020";
private String m_jtfDevUsername = "admin"; private String m_jtfDevUsername = "admin";
private String m_jtfDevPassword = "admin123"; private String m_jtfDevPassword = "admin123";
@ -143,7 +143,7 @@ public class RegisterUtil implements ActionListener {
m_frame = new JFrame(); m_frame = new JFrame();
m_frame.setTitle("查看实时视频"); m_frame.setTitle("查看实时视频");
m_frame.setSize(1400,1100) ; m_frame.setSize(1000,800) ;
Toolkit toolkit = Toolkit.getDefaultToolkit(); Toolkit toolkit = Toolkit.getDefaultToolkit();
int x = (int)(toolkit.getScreenSize().getWidth()-m_frame.getWidth())/2; int x = (int)(toolkit.getScreenSize().getWidth()-m_frame.getWidth())/2;
int y = (int)(toolkit.getScreenSize().getHeight()-m_frame.getHeight())/2; int y = (int)(toolkit.getScreenSize().getHeight()-m_frame.getHeight())/2;
@ -154,7 +154,7 @@ public class RegisterUtil implements ActionListener {
m_frame.getContentPane().setLayout(null); m_frame.getContentPane().setLayout(null);
m_panelVideo = new Panel(); m_panelVideo = new Panel();
m_panelVideo.setBounds(0, 0, 1400, 1100); m_panelVideo.setBounds(0, 0, 1000, 800);
m_panelVideo.setBackground(Color.BLACK); m_panelVideo.setBackground(Color.BLACK);
m_frame.getContentPane().add(m_panelVideo); m_frame.getContentPane().add(m_panelVideo);

3476
ruoyi-code/src/main/java/utils/run_device_cfg.java

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save