|
@@ -1,70 +1,82 @@
|
1
|
1
|
package com.gct.etl;
|
2
|
2
|
|
3
|
3
|
import com.gct.etl.ModbusReadConfig.Section;
|
|
4
|
+import com.gct.etl.parser.ByteToFloat;
|
|
5
|
+import com.gct.etl.parser.DefaultParser;
|
4
|
6
|
import lombok.Data;
|
5
|
7
|
|
|
8
|
+import java.util.HashMap;
|
|
9
|
+import java.util.Map;
|
|
10
|
+
|
6
|
11
|
/**
|
7
|
12
|
* @author xusirui 2024/7/9
|
8
|
13
|
*/
|
9
|
14
|
@Data
|
10
|
15
|
public class BHModbusReadConfig {
|
11
|
|
- private int offset = 7501;
|
|
16
|
+ public int offset = 7501;
|
|
17
|
+ public int stationId = 1;
|
|
18
|
+ public Map<Class, RegisterParser> parsers = new HashMap<Class, RegisterParser>();
|
|
19
|
+
|
|
20
|
+ {
|
|
21
|
+ parsers.put(Float.class, new ByteToFloat());
|
|
22
|
+ parsers.put(Integer.class, new DefaultParser());
|
|
23
|
+ }
|
12
|
24
|
|
13
|
|
- private Section maxLoad = new Section(1, 9500 - offset, 2);
|
|
25
|
+ public Section maxLoad = new Section(stationId, 9500 - offset, 2);
|
14
|
26
|
|
15
|
|
- private Section minLoad = new Section(1, 9502 - offset, 2);
|
|
27
|
+ public Section minLoad = new Section(stationId, 9502 - offset, 2);
|
16
|
28
|
|
17
|
|
- private Section theoryUpLoad = new Section(1, 9504 - offset, 2);
|
|
29
|
+ public Section theoryUpLoad = new Section(stationId, 9504 - offset, 2);
|
18
|
30
|
|
19
|
|
- private Section theoryDownLoad = new Section(1, 9506 - offset, 2);
|
|
31
|
+ public Section theoryDownLoad = new Section(stationId, 9506 - offset, 2);
|
20
|
32
|
|
21
|
|
- private Section fillCoefficient = new Section(1, 9508 - offset, 2);
|
|
33
|
+ public Section fillCoefficient = new Section(stationId, 9508 - offset, 2);
|
22
|
34
|
|
23
|
|
- private Section emptyFillCoefficient = new Section(1, 9510 - offset, 2);
|
|
35
|
+ public Section emptyFillCoefficient = new Section(stationId, 9510 - offset, 2);
|
24
|
36
|
|
25
|
|
- private Section liqProdMass = new Section(1, 9512 - offset, 2);
|
|
37
|
+ public Section liqProdMass = new Section(stationId, 9512 - offset, 2);
|
26
|
38
|
|
27
|
|
- private Section oilProdMass = new Section(1, 9514 - offset, 2);
|
|
39
|
+ public Section oilProdMass = new Section(stationId, 9514 - offset, 2);
|
28
|
40
|
|
29
|
|
- private Section waterProdMass = new Section(1, 9516 - offset, 2);
|
|
41
|
+ public Section waterProdMass = new Section(stationId, 9516 - offset, 2);
|
30
|
42
|
|
31
|
|
- private Section liqProdVolume = new Section(1, 9518 - offset, 2);
|
|
43
|
+ public Section liqProdVolume = new Section(stationId, 9518 - offset, 2);
|
32
|
44
|
|
33
|
|
- private Section oilProdVolume = new Section(1, 9520 - offset, 2);
|
|
45
|
+ public Section oilProdVolume = new Section(stationId, 9520 - offset, 2);
|
34
|
46
|
|
35
|
|
- private Section waterProdVolume = new Section(1, 9522 - offset, 2);
|
|
47
|
+ public Section waterProdVolume = new Section(stationId, 9522 - offset, 2);
|
36
|
48
|
|
37
|
|
- private Section theoryDisplacement = new Section(1, 9524 - offset, 2);
|
|
49
|
+ public Section theoryDisplacement = new Section(stationId, 9524 - offset, 2);
|
38
|
50
|
|
39
|
|
- private Section pumpEfficient = new Section(1, 9526 - offset, 2);
|
|
51
|
+ public Section pumpEfficient = new Section(stationId, 9526 - offset, 2);
|
40
|
52
|
|
41
|
|
- private Section gkCode = new Section(1, 9528 - offset, 1);
|
|
53
|
+ public Section gkCode = new Section(stationId, 9528 - offset, 1);
|
42
|
54
|
|
43
|
|
- private Section inversionDynamicLiquidLevel = new Section(1, 9529 - offset, 2);
|
|
55
|
+ public Section inversionDynamicLiquidLevel = new Section(stationId, 9529 - offset, 2);
|
44
|
56
|
|
45
|
|
- private Section liquidCorrectDifference = new Section(1, 9531 - offset, 2);
|
|
57
|
+ public Section liquidCorrectDifference = new Section(stationId, 9531 - offset, 2);
|
46
|
58
|
|
47
|
|
- private Section submergenceDegree = new Section(1, 9533 - offset, 2);
|
|
59
|
+ public Section submergenceDegree = new Section(stationId, 9533 - offset, 2);
|
48
|
60
|
|
49
|
|
- private Section downStrokeMaxElec = new Section(1, 9535 - offset, 2);
|
|
61
|
+ public Section downStrokeMaxElec = new Section(stationId, 9535 - offset, 2);
|
50
|
62
|
|
51
|
|
- private Section upStrokeMaxElec = new Section(1, 9537 - offset, 2);
|
|
63
|
+ public Section upStrokeMaxElec = new Section(stationId, 9537 - offset, 2);
|
52
|
64
|
|
53
|
|
- private Section elecBalance = new Section(1, 9539 - offset, 2);
|
|
65
|
+ public Section elecBalance = new Section(stationId, 9539 - offset, 2);
|
54
|
66
|
|
55
|
|
- private Section downStrokeMaxPower = new Section(1, 9541 - offset, 2);
|
|
67
|
+ public Section downStrokeMaxPower = new Section(stationId, 9541 - offset, 2);
|
56
|
68
|
|
57
|
|
- private Section upStrokeMaxPower = new Section(1, 9543 - offset, 2);
|
|
69
|
+ public Section upStrokeMaxPower = new Section(stationId, 9543 - offset, 2);
|
58
|
70
|
|
59
|
|
- private Section powerBalance = new Section(1, 9545 - offset, 2);
|
|
71
|
+ public Section powerBalance = new Section(stationId, 9545 - offset, 2);
|
60
|
72
|
|
61
|
|
- private Section stroke = new Section(1, 9547 - offset, 2);
|
|
73
|
+ public Section stroke = new Section(stationId, 9547 - offset, 2);
|
62
|
74
|
|
63
|
|
- private Section downholeSystemEfficient = new Section(1, 9549 - offset, 2);
|
|
75
|
+ public Section downholeSystemEfficient = new Section(stationId, 9549 - offset, 2);
|
64
|
76
|
|
65
|
|
- private Section upholeSystemEfficient = new Section(1, 9551 - offset, 2);
|
|
77
|
+ public Section upholeSystemEfficient = new Section(stationId, 9551 - offset, 2);
|
66
|
78
|
|
67
|
|
- private Section systemEfficient = new Section(1, 9553 - offset, 2);
|
|
79
|
+ public Section systemEfficient = new Section(stationId, 9553 - offset, 2);
|
68
|
80
|
|
69
|
|
- private Section elecCostPerHundredMeter = new Section(1, 9555 - offset, 2);
|
|
81
|
+ public Section elecCostPerHundredMeter = new Section(stationId, 9555 - offset, 2);
|
70
|
82
|
}
|