|
3 | 3 | import java.util.Collection; |
4 | 4 | import java.util.concurrent.Executors; |
5 | 5 |
|
6 | | -import org.openscada.opc.dcom.list.ClassDetails; |
7 | | -import org.openscada.opc.lib.common.ConnectionInformation; |
8 | | -import org.openscada.opc.lib.da.Server; |
9 | | -import org.openscada.opc.lib.list.*; |
| 6 | +//import org.openscada.opc.dcom.list.ClassDetails; |
| 7 | +//import org.openscada.opc.lib.common.ConnectionInformation; |
| 8 | +//import org.openscada.opc.lib.da.Server; |
| 9 | +//import org.openscada.opc.lib.list.*; |
10 | 10 |
|
11 | 11 | public class Test |
12 | 12 | { |
13 | | - public static void main(String[] args) throws Exception |
14 | | - { |
15 | | - ConnectionInformation ci = new ConnectionInformation(); |
16 | | - ci.setHost("localhost"); |
17 | | - ci.setDomain(""); |
18 | | - ci.setUser("zzj"); |
19 | | - ci.setPassword("zhijun1090"); |
20 | | - ci.setClsid("7BC0CC8E-482C-47CA-ABDC-0FE7F9C6E729"); |
21 | | - Server server = new Server(ci, Executors.newSingleThreadScheduledExecutor()); |
22 | | - server.connect(); |
23 | | - |
24 | | - // 或以下获取OPCEnum方法 |
25 | | - ServerList serverList = new ServerList("localhost", "zzj", "zhijun1090", ""); |
26 | | - Collection<ClassDetails> classDetails = serverList.listServersWithDetails( |
27 | | - new Category[] { Categories.OPCDAServer10, Categories.OPCDAServer20, Categories.OPCDAServer30 }, |
28 | | - new Category[] {}); |
29 | | - for (ClassDetails cds : classDetails) |
30 | | - { |
31 | | - System.out.println(cds.getProgId() + "=" + cds.getDescription()); |
32 | | - } |
33 | | - } |
| 13 | +// public static void main(String[] args) throws Exception |
| 14 | +// { |
| 15 | +// ConnectionInformation ci = new ConnectionInformation(); |
| 16 | +// ci.setHost("localhost"); |
| 17 | +// ci.setDomain(""); |
| 18 | +// ci.setUser("zzz"); |
| 19 | +// ci.setPassword(""); |
| 20 | +// ci.setClsid("7BC0CC8E-482C-47CA-ABDC-0FE7F9C6E729"); |
| 21 | +// Server server = new Server(ci, Executors.newSingleThreadScheduledExecutor()); |
| 22 | +// server.connect(); |
| 23 | +// |
| 24 | +// // 或以下获取OPCEnum方法 |
| 25 | +// ServerList serverList = new ServerList("localhost", "lll", "", ""); |
| 26 | +// Collection<ClassDetails> classDetails = serverList.listServersWithDetails( |
| 27 | +// new Category[] { Categories.OPCDAServer10, Categories.OPCDAServer20, Categories.OPCDAServer30 }, |
| 28 | +// new Category[] {}); |
| 29 | +// for (ClassDetails cds : classDetails) |
| 30 | +// { |
| 31 | +// System.out.println(cds.getProgId() + "=" + cds.getDescription()); |
| 32 | +// } |
| 33 | +// } |
34 | 34 |
|
35 | 35 | } |
0 commit comments