dongyukun
2024-12-31 6eeac9efdb16f92d19536bf23a2d1471705fe752
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
package com.iailab.netsdk.demo.frame.scada;
 
import com.iailab.netsdk.demo.module.LoginModule;
import com.iailab.netsdk.lib.NetSDKLib;
 
import static com.iailab.netsdk.demo.module.LoginModule.m_hLoginHandle;
 
/**
 * className:SCADAAttachModule
 * description:
 * author:251589
 * createTime:2021/5/7 20:16
 *
 * @version v1.0
 */
 
public class SCADAAttachModule {
    // 订阅实时信息句柄
    public static NetSDKLib.LLong attachInfoHandle = new NetSDKLib.LLong(0);
 
    // 订阅报警句柄
    public static NetSDKLib.LLong alarmAttachInfoHandle = new NetSDKLib.LLong(0);
 
    public static boolean attachInfo(NetSDKLib.fSCADAAttachInfoCallBack callBack){
        // 入参
        NetSDKLib.NET_IN_SCADA_ATTACH_INFO stIn = new NetSDKLib.NET_IN_SCADA_ATTACH_INFO();
        stIn.cbCallBack = callBack;
        // 出参
        NetSDKLib.NET_OUT_SCADA_ATTACH_INFO stOut = new NetSDKLib.NET_OUT_SCADA_ATTACH_INFO();
        attachInfoHandle = LoginModule.netsdk.CLIENT_SCADAAttachInfo(m_hLoginHandle, stIn, stOut, 3000);
        if (attachInfoHandle.longValue() != 0){
            System.out.println("AttachInfo succeed!");
        } else {
            System.err.println("AttachInfo failed!");
            return false;
        }
        return true;
    }
 
 
}