Jay
2024-11-01 03e8aca3ad6201c0d74e00d4c8d7367cdaaa54f9
提交 | 用户 | 时间
ce910c 1 package com.netsdk.demo.frame.scada;
H 2
3 import com.netsdk.common.Res;
4 import com.netsdk.demo.module.LoginModule;
5 import com.netsdk.lib.NetSDKLib;
6
7 import static com.netsdk.demo.module.LoginModule.m_hLoginHandle;
8
9 /**
10  * className:SCADAAttachModule
11  * description:
12  * author:251589
13  * createTime:2021/5/7 20:16
14  *
15  * @version v1.0
16  */
17
18 public class SCADAAttachModule {
19     // 订阅实时信息句柄
20     public static NetSDKLib.LLong attachInfoHandle = new NetSDKLib.LLong(0);
21
22     // 订阅报警句柄
23     public static NetSDKLib.LLong alarmAttachInfoHandle = new NetSDKLib.LLong(0);
24
25     public static boolean attachInfo(NetSDKLib.fSCADAAttachInfoCallBack callBack){
26         // 入参
27         NetSDKLib.NET_IN_SCADA_ATTACH_INFO stIn = new NetSDKLib.NET_IN_SCADA_ATTACH_INFO();
28         stIn.cbCallBack = callBack;
29         // 出参
30         NetSDKLib.NET_OUT_SCADA_ATTACH_INFO stOut = new NetSDKLib.NET_OUT_SCADA_ATTACH_INFO();
31         attachInfoHandle = LoginModule.netsdk.CLIENT_SCADAAttachInfo(m_hLoginHandle, stIn, stOut, 3000);
32         if (attachInfoHandle.longValue() != 0){
33             System.out.println("AttachInfo succeed!");
34         } else {
35             System.err.println("AttachInfo failed!");
36             return false;
37         }
38         return true;
39     }
40
41
42 }