Skip to content

Commit 066463a

Browse files
authored
Merge pull request #1567 from OSGP/feature/simulator_data_not_valid
Only set DATA_NOT_VALID for first value in profile
2 parents a4851bd + 0a733d8 commit 066463a

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

osgp/protocol-adapter-dlms/osgp-protocol-simulator-dlms/simulator/dlms-device-simulator/src/main/java/org/opensmartgridplatform/simulator/protocol/dlms/cosem/LoadProfileWithPeriod1.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,16 @@ private void initBufferData() {
137137

138138
this.bufferData = new CircularFifoQueue<>(PROFILE_ENTRIES);
139139

140-
final short amrProfileStatusCode = 4;
140+
short amrProfileStatusCode = 0;
141141
long importValue = 0;
142142
long exportValue = 0;
143143

144144
for (int i = 0; i < PROFILE_ENTRIES; i++) {
145+
if (i == 0) {
146+
amrProfileStatusCode = 4; // DATA_NOT_VALID
147+
} else {
148+
amrProfileStatusCode = 0;
149+
}
145150
final Calendar cal = this.getNextDateTime();
146151
importValue += 1;
147152
exportValue += 2;

osgp/protocol-adapter-dlms/osgp-protocol-simulator-dlms/simulator/dlms-device-simulator/src/main/java/org/opensmartgridplatform/simulator/protocol/dlms/cosem/LoadProfileWithPeriod2.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ private void initBufferData() {
178178

179179
this.bufferData = new CircularFifoQueue<>(PROFILE_ENTRIES);
180180

181-
final short amrProfileStatusCode = 4;
181+
short amrProfileStatusCode = 0;
182182
long importRate1 = 0;
183183
long importRate2 = 0;
184184
long exportRate1 = 0;
@@ -189,6 +189,11 @@ private void initBufferData() {
189189
long mBusValue4 = 0;
190190

191191
for (int i = 0; i < PROFILE_ENTRIES; i++) {
192+
if (i == 0) {
193+
amrProfileStatusCode = 4; // DATA_NOT_VALID
194+
} else {
195+
amrProfileStatusCode = 0;
196+
}
192197
importRate1 += 1;
193198
importRate2 += 2;
194199
exportRate1 += 3;

0 commit comments

Comments
 (0)