]> git.basschouten.com Git - openhab-addons.git/blob
394b4c3c6d3798ffeb53c25e4a8d451bdec0fa9e
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.modbus.sunspec.internal.dto;
14
15 import java.util.Optional;
16
17 /**
18  *
19  * Data object for the parsed information from a sunspec meter
20  *
21  * @author Nagy Attila Gabor - Initial contribution
22  *
23  */
24 public class MeterModelBlock {
25
26     /**
27      * Sunspec device type id
28      */
29     public Integer sunspecDID;
30
31     /**
32      * Block length
33      */
34     public Integer length;
35
36     /**
37      * AC Total Current value
38      */
39     public Short acCurrentTotal;
40
41     /**
42      * Descriptors for phase A
43      */
44     public PhaseBlock phaseA = new PhaseBlock();
45
46     /**
47      * Descriptors for phase B
48      */
49     public PhaseBlock phaseB = new PhaseBlock();
50
51     /**
52      * Descriptors for phase C
53      */
54     public PhaseBlock phaseC = new PhaseBlock();
55
56     /**
57      * AC Current scale factor
58      */
59     public Short acCurrentSF;
60
61     /**
62      * AC Voltage Line to line value
63      */
64     public Optional<Short> acVoltageLineToNAverage;
65
66     /**
67      * AC Voltage Line to N value
68      */
69     public Optional<Short> acVoltageLineToLineAverage;
70
71     /**
72      * AC Voltage scale factor
73      */
74     public Short acVoltageSF;
75
76     /**
77      * AC Frequency value
78      */
79     public Short acFrequency;
80
81     /**
82      * AC Frequency scale factor
83      */
84     public Optional<Short> acFrequencySF;
85
86     /**
87      * Total real power
88      */
89     public Short acRealPowerTotal;
90
91     /**
92      * AC Real Power Scale Factor
93      */
94     public Short acRealPowerSF;
95
96     /**
97      * Total apparent power
98      */
99     public Optional<Short> acApparentPowerTotal;
100
101     /**
102      * AC Apparent Power Scale Factor
103      */
104     public Optional<Short> acApparentPowerSF;
105
106     /**
107      * Total reactive power
108      */
109     public Optional<Short> acReactivePowerTotal;
110
111     /**
112      * AC Reactive Power Scale Factor
113      */
114     public Optional<Short> acReactivePowerSF;
115
116     /**
117      * Power factor
118      */
119     public Optional<Short> acPowerFactor;
120
121     /**
122      * Power factor scale factor
123      */
124     public Optional<Short> acPowerFactorSF;
125
126     /**
127      * Total exported real energy
128      */
129     public Optional<Long> acExportedRealEnergyTotal;
130
131     /**
132      * Total imported real energy
133      */
134     public Long acImportedRealEnergyTotal;
135
136     /**
137      * Real Energy Scale Factor
138      */
139     public Short acRealEnergySF;
140
141     /**
142      * Total exported apparent energy
143      */
144     public Optional<Long> acExportedApparentEnergyTotal;
145
146     /**
147      * Total imported apparent energy
148      */
149     public Optional<Long> acImportedApparentEnergyTotal;
150
151     /**
152      * Apparent Energy Scale Factor
153      */
154     public Optional<Short> acApparentEnergySF;
155
156     /**
157      * Quadrant 1: Total imported reactive energy
158      */
159     public Optional<Long> acImportedReactiveEnergyQ1Total;
160
161     /**
162      * Quadrant 2: Total imported reactive energy
163      */
164     public Optional<Long> acImportedReactiveEnergyQ2Total;
165
166     /**
167      * Quadrant 3: Total exported reactive energy
168      */
169     public Optional<Long> acExportedReactiveEnergyQ3Total;
170
171     /**
172      * Quadrant 4: Total exported reactive energy
173      */
174     public Optional<Long> acExportedReactiveEnergyQ4Total;
175
176     /**
177      * Reactive Energy Scale Factor
178      */
179     public Optional<Short> acReactiveEnergySF;
180
181     /**
182      * This subclass is used to store raw data for a single phase in
183      * multi phase meters.
184      */
185     public static class PhaseBlock {
186         /**
187          * AC Phase A Current value
188          */
189         public Optional<Short> acPhaseCurrent;
190
191         /**
192          * AC Voltage Phase Phase to N value
193          */
194         public Optional<Short> acVoltageToN;
195
196         /**
197          * AC Voltage Phase Line to next Line value
198          */
199         public Optional<Short> acVoltageToNext;
200
201         /**
202          * Phase A AC real power
203          */
204         public Optional<Short> acRealPower;
205
206         /**
207          * Phase A AC apparent power
208          */
209         public Optional<Short> acApparentPower;
210
211         /**
212          * Phase A AC reactive power
213          */
214         public Optional<Short> acReactivePower;
215
216         /**
217          * Phase A Power factor
218          */
219         public Optional<Short> acPowerFactor;
220
221         /**
222          * Phase A exported real energy
223          */
224         public Optional<Long> acExportedRealEnergy;
225
226         /**
227          * Phase A imported real energy
228          */
229         public Optional<Long> acImportedRealEnergy;
230
231         /**
232          * Phase A exported apparent energy
233          */
234         public Optional<Long> acExportedApparentEnergy;
235
236         /**
237          * Phase A imported apparent energy
238          */
239         public Optional<Long> acImportedApparentEnergy;
240
241         /**
242          * Quadrant 1: Phase A imported reactive energy
243          */
244         public Optional<Long> acImportedReactiveEnergyQ1;
245
246         /**
247          * Quadrant 2: Phase A imported reactive energy
248          */
249         public Optional<Long> acImportedReactiveEnergyQ2;
250
251         /**
252          * Quadrant 3: Phase A exported reactive energy
253          */
254         public Optional<Long> acExportedReactiveEnergyQ3;
255
256         /**
257          * Quadrant 4: Phase A exported reactive energy
258          */
259         public Optional<Long> acExportedReactiveEnergyQ4;
260     }
261 }