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
package com.ycl.api.YS.liveview.information;
 
import com.ycl.api.YS.NetDemo;
import com.ycl.api.YS.lib.NetDEVSDKLib.NETDEV_IVA_SHOW_RULE_E;
 
import javax.swing.*;
 
/**
 * 
 * @introduction IVA
 * @description Support IPC/NVR/VMS
 */
public class MetaData {
 
    /**
     * 
     * @introduction Set MetaData
     * @description Calling the interface of NETDEV_SetIVAShowParam 
     *
     */
    public static void setMetaData() {
        if(null == NetDemo.lpUserID) {
            JOptionPane.showMessageDialog(null, "Please Login device first. error code"+NetDemo.netdevsdk.NETDEV_GetLastError());
            return;
            }
        if(NetDemo.ChannelID == 0){
            JOptionPane.showMessageDialog(null, "Please select an online channel.");
            return;
        }
        int bEnableIVA=0;
        if(NetDemo.jCheckBoxVAEnable.isSelected()){
            bEnableIVA = 1;
        }else {
                JOptionPane.showMessageDialog(null, "Please first set enable");
                return;
        }
    boolean bRet=NetDemo.netdevsdk.NETDEV_SetIVAEnable(NetDemo.lpPlayHandle,bEnableIVA);
    if(bRet) {
        int numRow=NetDemo.VATable.getRowCount();
        for(int i=0;i<numRow;i++) {
            boolean checked=(boolean)NetDemo.VATable.getValueAt(i, 0);
            int dwShowParam    =0;
            String dwShowParamString=(String)NetDemo.VATable.getValueAt(i, 1);
            if(checked) {
                switch (dwShowParamString) {
                case "RULE":
                    dwShowParam = NETDEV_IVA_SHOW_RULE_E.NETDEV_IVA_SHOW_RULE;
                    break;
                case "TOUTH_RULE":
                    dwShowParam = NETDEV_IVA_SHOW_RULE_E.NETDEV_IVA_SHOW_RESULT_TOUTH_RULE;
                    break;
                case "UNTOUTH_RULE":
                    dwShowParam = NETDEV_IVA_SHOW_RULE_E.NETDEV_IVA_SHOW_RESULT_UNTOUTH_RULE;
                    break;
                case "TRACK":
                    dwShowParam = NETDEV_IVA_SHOW_RULE_E.NETDEV_IVA_SHOW_TRACK;
                    break;
                }
            }
            NetDemo.getVAsum+=dwShowParam;
        }
        
        boolean bRet2= NetDemo.netdevsdk.NETDEV_SetIVAShowParam(NetDemo.getVAsum);
        NetDemo.getVAsum=0;
        if(!bRet2) {
            JOptionPane.showMessageDialog(null, "Set failed,please fist start live,if already,maybe not support,error code"+NetDemo.netdevsdk.NETDEV_GetLastError());
            System.out.printf("NETDEV_SetIVAShowParam failed:%d\n", NetDemo.netdevsdk.NETDEV_GetLastError());
        }else {
            JOptionPane.showMessageDialog(null,"Set success");
        }
    }else {
            JOptionPane.showMessageDialog(null, "Set failed,please fist start live,"+NetDemo.netdevsdk.NETDEV_GetLastError());
            System.out.printf("NETDEV_SetIVAEnable failed:%d\n", NetDemo.netdevsdk.NETDEV_GetLastError());
        }
    }
}