提交 | 用户 | 时间
|
1e2ff5
|
1 |
package com.billion.main.plcServer; |
H |
2 |
|
a2cd0f
|
3 |
import com.billion.main.bs.service.IBsBomChildInfoService; |
H |
4 |
import com.billion.main.constant.Constants; |
bf5dcc
|
5 |
import com.billion.main.da.service.IDaCollectionParamConfService; |
H |
6 |
import com.billion.main.da.service.IDaMaterialCollectionService; |
1e2ff5
|
7 |
import com.billion.main.da.service.IDaParamCollectionService; |
a2cd0f
|
8 |
import com.billion.main.da.service.IDaStationCollectionService; |
H |
9 |
import com.billion.main.om.service.IOmOrderSchedulingService; |
|
10 |
import com.billion.main.om.service.IOmProductionOrderInfoService; |
1e2ff5
|
11 |
import com.billion.main.plcServer.sub.OPCUaSubscription; |
b9df2f
|
12 |
import com.billion.main.sys.service.ISysCountService; |
1e2ff5
|
13 |
import com.kangaroohy.milo.service.MiloService; |
H |
14 |
import org.springframework.beans.factory.annotation.Autowired; |
|
15 |
import org.springframework.boot.ApplicationArguments; |
|
16 |
import org.springframework.boot.ApplicationRunner; |
a2cd0f
|
17 |
import org.springframework.stereotype.Component; |
1e2ff5
|
18 |
|
H |
19 |
import java.util.ArrayList; |
|
20 |
import java.util.List; |
a2cd0f
|
21 |
@Component |
1e2ff5
|
22 |
public class CustomRunner implements ApplicationRunner { |
H |
23 |
@Autowired |
|
24 |
private MiloService miloService; |
|
25 |
|
|
26 |
@Autowired |
|
27 |
public IDaParamCollectionService daParamCollectionService; |
a2cd0f
|
28 |
|
H |
29 |
@Autowired |
|
30 |
public IDaStationCollectionService daStationCollectionService; |
|
31 |
|
|
32 |
@Autowired |
|
33 |
public IOmProductionOrderInfoService omProductionOrderInfoService; |
|
34 |
@Autowired |
|
35 |
public IOmOrderSchedulingService omOrderSchedulingService; |
|
36 |
@Autowired |
bf5dcc
|
37 |
public IBsBomChildInfoService bsBomChildInfoService; |
H |
38 |
@Autowired |
|
39 |
public IDaCollectionParamConfService daCollectionParamConfService; |
|
40 |
@Autowired |
|
41 |
public IDaMaterialCollectionService daMaterialCollectionService; |
b9df2f
|
42 |
@Autowired |
H |
43 |
public ISysCountService sysCountService; |
a2cd0f
|
44 |
|
H |
45 |
|
1e2ff5
|
46 |
@Override |
H |
47 |
public void run(ApplicationArguments args) throws Exception { |
b9df2f
|
48 |
//PLC1设备//排查上下线 |
H |
49 |
Constants.PLC1.add(Constants.C010); |
|
50 |
Constants.PLC1.add(Constants.C020); |
|
51 |
Constants.PLC1.add(Constants.C030); |
|
52 |
Constants.PLC1.add(Constants.C050); |
|
53 |
Constants.PLC1.add(Constants.C060); |
|
54 |
//PLC2设备//排查上下线 |
|
55 |
Constants.PLC2.add(Constants.OP005); |
|
56 |
Constants.PLC2.add(Constants.OP010); |
|
57 |
Constants.PLC2.add(Constants.OP020); |
|
58 |
Constants.PLC2.add(Constants.OP040); |
|
59 |
Constants.PLC2.add(Constants.OP045); |
|
60 |
Constants.PLC2.add(Constants.OP060); |
|
61 |
Constants.PLC2.add(Constants.OP070); |
|
62 |
Constants.PLC2.add(Constants.OP075); |
|
63 |
Constants.PLC2.add(Constants.OP080); |
|
64 |
Constants.PLC2.add(Constants.OP090); |
|
65 |
Constants.PLC2.add(Constants.OP095_1); |
|
66 |
Constants.PLC2.add(Constants.OP095_2); |
|
67 |
Constants.PLC2.add(Constants.OP100_1); |
|
68 |
Constants.PLC2.add(Constants.OP100_2); |
|
69 |
Constants.PLC2.add(Constants.OP120); |
|
70 |
//PLC3设备//排查上下线 |
|
71 |
Constants.PLC3.add(Constants.OP130); |
|
72 |
Constants.PLC3.add(Constants.OP145_1); |
|
73 |
Constants.PLC3.add(Constants.OP145_2); |
|
74 |
Constants.PLC3.add(Constants.OP150_1); |
|
75 |
Constants.PLC3.add(Constants.OP150_2); |
|
76 |
Constants.PLC3.add(Constants.OP160); |
|
77 |
Constants.PLC3.add(Constants.OP165_1); |
|
78 |
Constants.PLC3.add(Constants.OP165_2); |
|
79 |
Constants.PLC3.add(Constants.OP170_1); |
|
80 |
Constants.PLC3.add(Constants.OP170_2); |
|
81 |
Constants.PLC3.add(Constants.OP180); |
|
82 |
Constants.PLC3.add(Constants.OP190_1); |
|
83 |
Constants.PLC3.add(Constants.OP190_2); |
|
84 |
Constants.PLC3.add(Constants.OP200_1); |
|
85 |
Constants.PLC3.add(Constants.OP200_2); |
|
86 |
Constants.PLC3.add(Constants.OP210_1); |
|
87 |
Constants.PLC3.add(Constants.OP210_2); |
|
88 |
Constants.PLC3.add(Constants.OP220_1); |
|
89 |
Constants.PLC3.add(Constants.OP220_2); |
|
90 |
Constants.PLC3.add(Constants.OP230_1); |
|
91 |
Constants.PLC3.add(Constants.OP230_2); |
|
92 |
Constants.PLC3.add(Constants.OP240_1); |
|
93 |
Constants.PLC3.add(Constants.OP240_2); |
|
94 |
Constants.PLC3.add(Constants.OP250_1); |
|
95 |
Constants.PLC3.add(Constants.OP250_2); |
|
96 |
Constants.PLC3.add(Constants.OP260_1); |
|
97 |
Constants.PLC3.add(Constants.OP260_2); |
|
98 |
Constants.PLC3.add(Constants.OP270_1); |
|
99 |
Constants.PLC3.add(Constants.OP270_2); |
|
100 |
Constants.PLC3.add(Constants.OP275); |
|
101 |
Constants.PLC3.add(Constants.OP280); |
|
102 |
Constants.PLC3.add(Constants.OP290_1); |
|
103 |
Constants.PLC3.add(Constants.OP290_2); |
|
104 |
Constants.PLC3.add(Constants.OP295); |
|
105 |
Constants.PLC3.add(Constants.OP300); |
|
106 |
Constants.PLC3.add(Constants.OP310); |
|
107 |
//PLC4//排查上下线 |
|
108 |
Constants.PLC4.add(Constants.C040); |
|
109 |
Constants.PLC4.add(Constants.OP030); |
|
110 |
Constants.PLC4.add(Constants.OP050); |
|
111 |
Constants.PLC4.add(Constants.OP110); |
|
112 |
Constants.PLC4.add(Constants.OP140); |
|
113 |
|
|
114 |
//上线工位 |
|
115 |
Constants.ONLINE.add(Constants.C005); |
|
116 |
Constants.ONLINE.add(Constants.OP005); |
|
117 |
//下线工位 |
|
118 |
Constants.OFFLINE.add(Constants.C070); |
|
119 |
Constants.OFFLINE.add(Constants.OP310); |
|
120 |
Constants.OFFLINE.add(Constants.P010); |
1e2ff5
|
121 |
|
H |
122 |
OPCUaSubscription OPCUaSubscription = new OPCUaSubscription(miloService, |
a2cd0f
|
123 |
daParamCollectionService, |
H |
124 |
daStationCollectionService, |
|
125 |
omProductionOrderInfoService, |
|
126 |
omOrderSchedulingService, |
bf5dcc
|
127 |
bsBomChildInfoService, |
H |
128 |
daCollectionParamConfService, |
b9df2f
|
129 |
daMaterialCollectionService, |
H |
130 |
sysCountService); |
1e2ff5
|
131 |
|
H |
132 |
List<String> lists = getList(); |
|
133 |
System.out.println("订阅内容:"+lists); |
|
134 |
miloService.subscriptionFromOpcUa(lists,OPCUaSubscription); |
|
135 |
|
|
136 |
} |
|
137 |
|
|
138 |
public List<String> getList(){ |
|
139 |
List<String> lists = new ArrayList<>(); |
b9df2f
|
140 |
//PLC1 |
H |
141 |
lists.add("PLC1.C005.RecordData"); |
|
142 |
lists.add("PLC1.C005.WorkOrderRequest");//请求工单 |
|
143 |
lists.add("PLC1.C010.RecordData"); |
|
144 |
lists.add("PLC1.C020.RecordData"); |
|
145 |
lists.add("PLC1.C030.RecordData"); |
|
146 |
lists.add("PLC1.C050.RecordData"); |
|
147 |
lists.add("PLC1.C060.RecordData"); |
|
148 |
lists.add("PLC1.C070.RecordData"); |
|
149 |
//PLC2 |
|
150 |
lists.add("PLC2.OP005.RecordData"); |
|
151 |
lists.add("PLC2.OP010.WorkOrderRequest");//请求工单 |
|
152 |
lists.add("PLC2.OP020.RecordData"); |
|
153 |
lists.add("PLC2.OP040.RecordData"); |
|
154 |
lists.add("PLC2.OP045.RecordData"); |
|
155 |
lists.add("PLC2.OP060.RecordData"); |
|
156 |
lists.add("PLC2.OP070.RecordData"); |
|
157 |
lists.add("PLC2.OP075.RecordData"); |
|
158 |
lists.add("PLC2.OP080.RecordData"); |
|
159 |
lists.add("PLC2.OP090.RecordData"); |
|
160 |
lists.add("PLC2.OP095-1.RecordData"); |
|
161 |
lists.add("PLC2.OP095-2.RecordData"); |
|
162 |
lists.add("PLC2.OP100-1.RecordData"); |
|
163 |
lists.add("PLC2.OP100-2.RecordData"); |
|
164 |
lists.add("PLC2.OP120.RecordData"); |
|
165 |
lists.add("PLC2.P010.RecordData"); |
|
166 |
lists.add("PLC2.P010.WorkOrderRequest");//请求工单 |
|
167 |
//PLC3 |
|
168 |
lists.add("PLC3.OP130.RecordData"); |
|
169 |
lists.add("PLC3.OP145-1.RecordData"); |
|
170 |
lists.add("PLC3.OP145-2.RecordData"); |
|
171 |
lists.add("PLC3.OP150-1.RecordData"); |
|
172 |
lists.add("PLC3.OP150-2.RecordData"); |
|
173 |
lists.add("PLC3.OP160.RecordData"); |
|
174 |
lists.add("PLC3.OP165-1.RecordData"); |
|
175 |
lists.add("PLC3.OP165-2.RecordData"); |
|
176 |
lists.add("PLC3.OP170-1.RecordData"); |
|
177 |
lists.add("PLC3.OP170-2.RecordData"); |
|
178 |
lists.add("PLC3.OP180.RecordData"); |
|
179 |
lists.add("PLC3.OP190-1.RecordData"); |
|
180 |
lists.add("PLC3.OP190-2.RecordData"); |
|
181 |
lists.add("PLC3.OP200-1.RecordData"); |
|
182 |
lists.add("PLC3.OP200-2.RecordData"); |
|
183 |
lists.add("PLC3.OP210-1.RecordData"); |
|
184 |
lists.add("PLC3.OP210-2.RecordData"); |
|
185 |
lists.add("PLC3.OP220-1.RecordData"); |
|
186 |
lists.add("PLC3.OP220-2.RecordData"); |
|
187 |
lists.add("PLC3.OP230-1.RecordData"); |
|
188 |
lists.add("PLC3.OP230-2.RecordData"); |
|
189 |
lists.add("PLC3.OP240-1.RecordData"); |
|
190 |
lists.add("PLC3.OP240-2.RecordData"); |
|
191 |
lists.add("PLC3.OP250-1.RecordData"); |
|
192 |
lists.add("PLC3.OP250-2.RecordData"); |
|
193 |
lists.add("PLC3.OP260-1.RecordData"); |
|
194 |
lists.add("PLC3.OP260-2.RecordData"); |
|
195 |
lists.add("PLC3.OP270-1.RecordData"); |
|
196 |
lists.add("PLC3.OP270-2.RecordData"); |
|
197 |
lists.add("PLC3.OP275.RecordData"); |
|
198 |
lists.add("PLC3.OP280.RecordData"); |
|
199 |
lists.add("PLC3.OP290-1.RecordData"); |
|
200 |
lists.add("PLC3.OP290-2.RecordData"); |
|
201 |
lists.add("PLC3.OP295.RecordData"); |
|
202 |
lists.add("PLC3.OP300.RecordData"); |
|
203 |
lists.add("PLC3.OP310.RecordData"); |
|
204 |
//PLC4 |
|
205 |
lists.add("PLC4.C040.RecordData"); |
|
206 |
lists.add("PLC4.OP030.RecordData"); |
|
207 |
lists.add("PLC4.OP050.RecordData"); |
|
208 |
lists.add("PLC4.OP070.RecordData"); |
|
209 |
lists.add("PLC3.OP110.RecordData"); |
|
210 |
lists.add("PLC3.OP140.RecordData"); |
|
211 |
|
|
212 |
|
|
213 |
|
a2cd0f
|
214 |
|
1e2ff5
|
215 |
return lists; |
H |
216 |
} |
|
217 |
} |