fuliqi
2024-08-29 4163c93761115c7524ef74a557a1f5e01eafb429
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
package com.ycl.api.YS.maintenance;
 
import com.ycl.api.YS.NetDemo;
import com.ycl.api.YS.lib.NetDEVSDKLib.NETDEV_DEVICE_TYPE_E;
 
import javax.swing.*;
 
/**
 * @description Find logs,find alarm and find alarm logs.
 */
public class Find {
    /**
     * @description To find logs.
     * @introduction It is mainly realized by the constructor of MaintenaceLogWindow.
     */
    public static void LogLookUp() {
        if(null == NetDemo.lpUserID)
        {
            JOptionPane.showMessageDialog(null, "Please Login device first. error code"+NetDemo.netdevsdk.NETDEV_GetLastError());
            return;
        }
        if(NetDemo.pstDeviceInfo.dwDeviceType == NETDEV_DEVICE_TYPE_E.NETDEV_DTYPE_NVR||
            NetDemo. pstDeviceInfo.dwDeviceType == NETDEV_DEVICE_TYPE_E.NETDEV_DTYPE_HNVR||
                NetDemo.pstDeviceInfo.dwDeviceType == NETDEV_DEVICE_TYPE_E.NETDEV_DTYPE_NVR_BACKUP
            )
        {
            MaintenaceLogWindow m1=new MaintenaceLogWindow(0,NetDemo.lpUserID,NetDemo.ChannelID);
            m1.setVisible(true);
        }
        else if(NetDemo.pstDeviceInfo.dwDeviceType == NETDEV_DEVICE_TYPE_E.NETDEV_DTYPE_VMS) 
        {
            MaintenaceLogWindow m2=new MaintenaceLogWindow(1,NetDemo.lpUserID,NetDemo.ChannelID);
            m2.setVisible(true);
        }
        else
        {
            JOptionPane.showMessageDialog(null, "Not support IPC");
            return;
        }
    }
    /**
     * @description To find alarm.
     * @introduction It is mainly realized by the constructor of MaintenaceAlarmSearchWindow.
     */
    public static void AlarmLookUp() {
        if(null == NetDemo.lpUserID)
        {
            JOptionPane.showMessageDialog(null, "Please Login device first. error code"+NetDemo.netdevsdk.NETDEV_GetLastError());
            return;
        }
        if(NetDemo.pstDeviceInfo.dwDeviceType == NETDEV_DEVICE_TYPE_E.NETDEV_DTYPE_IPC ||
            NetDemo.pstDeviceInfo.dwDeviceType == NETDEV_DEVICE_TYPE_E.NETDEV_DTYPE_IPC_FISHEYE ||
                NetDemo.pstDeviceInfo.dwDeviceType == NETDEV_DEVICE_TYPE_E.NETDEV_DTYPE_IPC_ECONOMIC_FISHEYE ||
                    NetDemo.pstDeviceInfo.dwDeviceType == NETDEV_DEVICE_TYPE_E.NETDEV_DTYPE_IPC_ACS
            )
        {
            MaintenaceAlarmSearchWindow m=new MaintenaceAlarmSearchWindow(NetDemo.lpUserID,NetDemo.ChannelID);
            m.setVisible(true);
        }
        else
        {
            JOptionPane.showMessageDialog(null, "Only support IPC equipment.");
        }
        if(NetDemo.ChannelID == 0)
        {
            JOptionPane.showMessageDialog(null, "Please Select ChannelID.");
            return;
        }
    }
    /**
     * @description To find alarm logs.
     * @introduction It is mainly realized by the constructor of MaintenaceAlarmLogWindow.
     */
    public static void AlarmLogLookUp() {
        if(null == NetDemo.lpUserID)
        {
            JOptionPane.showMessageDialog(null, "Please Login device first. error code"+NetDemo.netdevsdk.NETDEV_GetLastError());
            return;
        }
        if(NetDemo.jComboBoxDeviceType.getSelectedIndex() == 1)
        {
            MaintenaceAlarmLogWindow m3=new MaintenaceAlarmLogWindow(NetDemo.lpUserID,NetDemo.ChannelID);
            m3.setVisible(true);
        }
        else if(NetDemo.jComboBoxDeviceType.getSelectedIndex() == 0)
        {
            JOptionPane.showMessageDialog(null, "Only support VMS equipment.");
        }
    }
}