提交 | 用户 | 时间
|
a5b351
|
1 |
package com.jcdm.main.plcserver; |
C |
2 |
|
|
3 |
|
|
4 |
import com.jcdm.main.da.collectionParamConf.service.IDaCollectionParamConfService; |
|
5 |
import com.jcdm.main.da.paramCollection.service.IDaParamCollectionService; |
|
6 |
import com.jcdm.main.da.passingStationCollection.service.IDaPassingStationCollectionService; |
|
7 |
import com.jcdm.main.plcserver.conf.OPCElement; |
|
8 |
import com.jcdm.main.plcserver.sub.OPCUaSubscription; |
|
9 |
import com.kangaroohy.milo.service.MiloService; |
|
10 |
import org.springframework.beans.factory.annotation.Autowired; |
|
11 |
import org.springframework.boot.ApplicationArguments; |
|
12 |
import org.springframework.boot.ApplicationRunner; |
|
13 |
import org.springframework.stereotype.Component; |
|
14 |
|
|
15 |
import java.util.ArrayList; |
|
16 |
import java.util.List; |
|
17 |
|
|
18 |
@Component |
|
19 |
public class CustomRunner implements ApplicationRunner { |
|
20 |
|
|
21 |
@Autowired |
|
22 |
private MiloService miloService; |
|
23 |
|
|
24 |
@Autowired |
|
25 |
private IDaPassingStationCollectionService daPassingStationCollectionService; |
|
26 |
|
|
27 |
@Autowired |
|
28 |
private IDaCollectionParamConfService collectionParamConfService; |
|
29 |
|
|
30 |
@Autowired |
|
31 |
private IDaParamCollectionService daParamCollectionService; |
|
32 |
|
8f0f8d
|
33 |
@Autowired |
懒 |
34 |
private IDaCollectionParamConfService daCollectionParamConfService; |
|
35 |
|
a5b351
|
36 |
@Override |
C |
37 |
public void run(ApplicationArguments args) throws Exception { |
|
38 |
|
|
39 |
OPCUaSubscription opcUaSubscription = new OPCUaSubscription( |
|
40 |
miloService, |
|
41 |
daPassingStationCollectionService, |
|
42 |
collectionParamConfService, |
|
43 |
daParamCollectionService); |
|
44 |
|
|
45 |
List<String> lists = getSubList(); |
|
46 |
miloService.subscriptionFromOpcUa(lists,opcUaSubscription); |
|
47 |
|
|
48 |
} |
|
49 |
|
|
50 |
/** |
|
51 |
* 订阅内容 |
|
52 |
*/ |
|
53 |
public List<String> getSubList(){ |
|
54 |
List<String> lists = new ArrayList<>(); |
b5fcd8
|
55 |
lists.add(OPCElement.PACK_OP010_RecordSN);//请求下发SN号 |
懒 |
56 |
lists.add(OPCElement.PACK_OP230_RecordData);//请求记录数据 |
|
57 |
lists.add(OPCElement.PACK_OP240_RecordData);//请求记录数据 |
|
58 |
lists.add(OPCElement.PACK_OP240_AngleResult);//请求记录数据 |
|
59 |
lists.add(OPCElement.PACK_OP250_RecordData);//请求记录数据 |
|
60 |
lists.add(OPCElement.PACK_OP250_AngleResult);//请求记录数据 |
|
61 |
lists.add(OPCElement.PACK_OP380_RecordData);//请求记录数据 |
|
62 |
lists.add(OPCElement.PACK_OP380_AngleResult);//请求记录数据 |
|
63 |
lists.add(OPCElement.PACK_OP300_RecordData);//请求记录数据 |
|
64 |
lists.add(OPCElement.PACK_OP300_AngleResult);//请求记录数据 |
|
65 |
lists.add(OPCElement.PACK_OP270_RecordData);//请求记录数据 |
|
66 |
lists.add(OPCElement.PACK_OP270_AngleResult);//请求记录数据 |
a5b351
|
67 |
return lists; |
C |
68 |
} |
|
69 |
} |
|
70 |
|