-
admin
2024-05-17 68f0c8f92fb7c82dc447b9aaed2d23760c546f25
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
package com.jcdm.main.plcserver;
 
 
import com.jcdm.main.da.collectionParamConf.service.IDaCollectionParamConfService;
import com.jcdm.main.da.paramCollection.service.IDaParamCollectionService;
import com.jcdm.main.da.passingStationCollection.service.IDaPassingStationCollectionService;
import com.jcdm.main.da.testDeviceInterface.service.IDaTestDeviceInterfaceService;
import com.jcdm.main.om.productionOrde.service.IOmProductionOrdeInfoService;
import com.jcdm.main.plcserver.conf.OPCElement;
import com.jcdm.main.plcserver.sub.OPCUaSubscription;
import com.kangaroohy.milo.service.MiloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
 
import java.util.ArrayList;
import java.util.List;
 
@Component
public class CustomRunner implements ApplicationRunner {
 
    @Autowired
    private MiloService miloService;
 
    @Autowired
    private IDaPassingStationCollectionService daPassingStationCollectionService;
 
    @Autowired
    private IDaCollectionParamConfService collectionParamConfService;
 
    @Autowired
    private IDaParamCollectionService daParamCollectionService;
 
    @Autowired
    private IDaCollectionParamConfService daCollectionParamConfService;
 
    @Autowired
    private IOmProductionOrdeInfoService omProductionOrdeInfoService;
 
    @Autowired
    private IDaTestDeviceInterfaceService daTestDeviceInterfaceService;
 
    @Override
    public void run(ApplicationArguments args) throws Exception {
 
        OPCUaSubscription opcUaSubscription = new OPCUaSubscription(
                miloService,
                daPassingStationCollectionService,
                collectionParamConfService,
                daParamCollectionService,
                omProductionOrdeInfoService,
                daTestDeviceInterfaceService);
 
        List<String> lists = getSubList();
        System.out.println("订阅内容:"+lists);
        miloService.subscriptionFromOpcUa(lists,50,opcUaSubscription);
    }
 
    /**
     * 订阅内容
     */
    public List<String> getSubList(){
        List<String> lists = new ArrayList<>();
        lists.add(OPCElement.PACK_OP230_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP240_RecordData);//请求记录数据.
        lists.add(OPCElement.PACK_OP240_AngleResult);//请求记录数据
        lists.add(OPCElement.PACK_OP2501_AngleResult);//请求记录数据
        lists.add(OPCElement.PACK_OP2502_AngleResult);//请求记录数据
        lists.add(OPCElement.PACK_OP2503_AngleResult);//请求记录数据
        lists.add(OPCElement.PACK_OP260_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP260_AngleResult);//请求记录数据
        lists.add(OPCElement.PACK_OP270_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP270_AngleResult);//请求记录数据
        lists.add(OPCElement.PACK_OP290_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP290_AngleResult);//请求记录数据
        lists.add(OPCElement.PACK_OP300A_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP300B_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP310A_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP310B_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP330_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP380_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP380_AngleResult);//请求记录数据
        lists.add(OPCElement.PACK_OP400_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP400_AngleResult);//请求记录数据
        lists.add(OPCElement.PACK_OP410_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP410_AngleResult);//请求记录数据
        lists.add(OPCElement.PACK_OP4301_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP4302_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP4303_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP4304_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP440_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP450_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP450_AngleResult);//请求记录数据
        lists.add(OPCElement.PACK_OP460_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP460_AngleResult);//请求记录数据
        lists.add(OPCElement.PACK_OP4801_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP4802_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP4803_RecordData);//请求记录数据
 
        lists.add(OPCElement.PACK_OP500_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP500_AngleResult);//请求记录数据
//
        lists.add(OPCElement.PACK_OP280_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP320A_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP320B_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP340A_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP340B_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP350A_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP350B_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP360_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP365_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP370_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP390_RecordData);//请求记录数据
        lists.add(OPCElement.PACK_OP470_RecordData);//请求记录数据
 
        return lists;
    }
}