-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SMHE-832: first steps config objects
- Loading branch information
Andre Bolder
committed
Jun 24, 2022
1 parent
d5e6bba
commit 6b0e7f3
Showing
6 changed files
with
246 additions
and
0 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
...tering/src/main/java/org/opensmartgridplatform/domain/smartmetering/config/Attribute.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.opensmartgridplatform.domain.smartmetering.config; | ||
|
||
public class Attribute { | ||
public int id; | ||
public String description; | ||
public String datatype; | ||
public String valuetype; | ||
public String value; | ||
public String access; | ||
} |
15 changes: 15 additions & 0 deletions
15
...ring/src/main/java/org/opensmartgridplatform/domain/smartmetering/config/CosumObject.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.opensmartgridplatform.domain.smartmetering.config; | ||
|
||
public class CosumObject { | ||
public String tag; | ||
public String description; | ||
|
||
@JsonProperty("class-id") | ||
public int classId; | ||
|
||
public int version; | ||
public String obis; | ||
public String group; | ||
public ArrayList<String> meterTypes; | ||
public ArrayList<Attribute> attributes; | ||
} |
11 changes: 11 additions & 0 deletions
11
...ring/src/main/java/org/opensmartgridplatform/domain/smartmetering/config/MeterConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.opensmartgridplatform.domain.smartmetering.config; | ||
|
||
import java.util.ArrayList; | ||
|
||
public class MeterConfig { | ||
public String profile; | ||
public String version; | ||
public String description; | ||
public ArrayList<Setting> settings; | ||
public ArrayList<CosumObject> cosumObjects; | ||
} |
6 changes: 6 additions & 0 deletions
6
...metering/src/main/java/org/opensmartgridplatform/domain/smartmetering/config/Setting.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.opensmartgridplatform.domain.smartmetering.config; | ||
|
||
public class Setting { | ||
@JsonProperty("firmware update type") | ||
public String firmwareUpdateType; | ||
} |
26 changes: 26 additions & 0 deletions
26
.../src/test/java/org/opensmartgridplatform/domain/smartmetering/config/MeterConfigTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright 2022 Alliander N.V. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
*/ | ||
|
||
package org.opensmartgridplatform.domain.smartmetering.config; | ||
|
||
import com.fasterxml.jackson.core.JsonProcessingException; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class MeterConfigTest { | ||
|
||
@Test | ||
void loadJsonFile() throws JsonProcessingException { | ||
|
||
final ObjectMapper objectMapper = new ObjectMapper(); | ||
|
||
objectMapper.readValue("meter-profile-config-SMR-5.0.json", MeterConfig.class); | ||
} | ||
} |
178 changes: 178 additions & 0 deletions
178
osgp/platform/osgp-domain-smartmetering/src/test/resources/meter-profile-config-SMR-5.0.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,178 @@ | ||
{ | ||
"profile": "SMR", | ||
"version": "5.0", | ||
"description": "Profile for Smart Meter Requirements 5.0", | ||
"settings": [ | ||
{ | ||
"firmware update type": "SMR" | ||
} | ||
], | ||
"cosumObjects": [ | ||
{ | ||
"tag": "CLOCK", | ||
"description": "Clock", | ||
"class-id": 8, | ||
"version": 0, | ||
"obis": "0-0:1.0.0.255", | ||
"group": "ABSTRACT", | ||
"meterTypes": [ | ||
"SP", | ||
"PP" | ||
], | ||
"attributes": [ | ||
{ | ||
"id": 2, | ||
"description": "time", | ||
"datatype": "octet-string", | ||
"valuetype": "DYNAMIC", | ||
"value": "CURRENT_LOCAL_DATE_AND_TIME", | ||
"access": "RW" | ||
}, | ||
{ | ||
"id": 3, | ||
"description": "time_zone", | ||
"datatype": "long", | ||
"valuetype": "FIXED_IN_PROFILE", | ||
"value": "-60", | ||
"access": "RW" | ||
}, | ||
{ | ||
"id": 4, | ||
"description": "status", | ||
"datatype": "clock_status", | ||
"valuetype": "DYNAMIC", | ||
"value": "OK", | ||
"access": "R" | ||
} | ||
] | ||
}, | ||
{ | ||
"tag": "ACTIVE_FIRMWARE_VERSION", | ||
"description": "Active firmware version", | ||
"class-id": 1, | ||
"version": 0, | ||
"obis": "1-0:0.2.0.255", | ||
"group": "ABSTRACT", | ||
"meterTypes": [ | ||
"SP", | ||
"PP" | ||
], | ||
"attributes": [ | ||
{ | ||
"id": 2, | ||
"description": "value", | ||
"datatype": "octet-string", | ||
"valuetype": "FIXED_IN_METER", | ||
"value": "firmware id 1", | ||
"access": "R" | ||
} | ||
] | ||
}, | ||
{ | ||
"tag": "ACTIVE_ENERGY_IMPORT", | ||
"description": "Active energy import (+A)", | ||
"class-id": 3, | ||
"version": 0, | ||
"obis": "1-0:1.8.0.255", | ||
"group": "ELECTRICITY", | ||
"meterTypes": [ | ||
"SP", | ||
"PP" | ||
], | ||
"attributes": [ | ||
{ | ||
"id": 2, | ||
"description": "value", | ||
"datatype": "double-long-unsigned", | ||
"valuetype": "DYNAMIC", | ||
"value": "100", | ||
"access": "R" | ||
}, | ||
{ | ||
"id": 3, | ||
"description": "scaler_unit", | ||
"datatype": "scal_unit_type", | ||
"valuetype": "FIXED_IN_PROFILE", | ||
"value": "0, Wh", | ||
"access": "R" | ||
} | ||
] | ||
}, | ||
{ | ||
"tag": "ACTIVE_ENERGY_EXPORT", | ||
"description": "Active energy export (-A)", | ||
"class-id": 3, | ||
"version": 0, | ||
"obis": "1-0:2.8.0.255", | ||
"group": "ELECTRICITY", | ||
"meterTypes": [ | ||
"SP", | ||
"PP" | ||
], | ||
"attributes": [ | ||
{ | ||
"id": 2, | ||
"description": "value", | ||
"datatype": "double-long-unsigned", | ||
"valuetype": "DYNAMIC", | ||
"value": "RANDOM(0,1000)", | ||
"access": "R" | ||
}, | ||
{ | ||
"id": 3, | ||
"description": "scaler_unit", | ||
"datatype": "scal_unit_type", | ||
"valuetype": "FIXED_IN_PROFILE", | ||
"value": "0, Wh", | ||
"access": "R" | ||
} | ||
] | ||
}, | ||
{ | ||
"tag": "MBUS_CLIENT_SETUP", | ||
"description": "M-Bus client setup", | ||
"class-id": 72, | ||
"version": 1, | ||
"obis": "0-c:24.1.0.255", | ||
"group": "GAS", | ||
"meterTypes": [ | ||
"SP", | ||
"PP" | ||
], | ||
"attributes": [ | ||
{ | ||
"id": 2, | ||
"description": "mbus_port_reference", | ||
"datatype": "octet-string", | ||
"valuetype": "FIXED_IN_PROFILE", | ||
"value": "0-0:24.6.0.255", | ||
"access": "R" | ||
}, | ||
{ | ||
"id": 3, | ||
"description": "capture_definition", | ||
"datatype": "array", | ||
"valuetype": "DYNAMIC", | ||
"value": "EMPTY_ARRAY", | ||
"access": "R" | ||
}, | ||
{ | ||
"id": 4, | ||
"description": "capture_period", | ||
"datatype": "double-long-unsigned", | ||
"valuetype": "FIXED_IN_PROFILE", | ||
"value": "0", | ||
"access": "RW" | ||
}, | ||
{ | ||
"id": 5, | ||
"description": "primary_address", | ||
"datatype": "unsigned", | ||
"valuetype": "FIXED_IN_PROFILE", | ||
"value": "0", | ||
"access": "RW" | ||
} | ||
] | ||
} | ||
] | ||
} |