Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abdelaziz Said Modifications #38

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
c8f49bd
- Add ConnectionParam.java to extract the connection parameters under…
AbdelazizSaid250 Dec 30, 2021
9191f42
- Edit SclParser.java to set current timestamp.
AbdelazizSaid250 Dec 30, 2021
f1360c7
- Edit the IEC61850 Library as needed and converted it from gradle to…
AbdelazizSaid250 Jan 2, 2022
39c7ef8
- Add the Runtime module and the IEC61850-Bean library to Protocol_Co…
AbdelazizSaid250 Jan 2, 2022
e2807b9
-
AbdelazizSaid250 Jan 2, 2022
3ddfa9a
- Create a new module named Common and put the model, Service, and DA…
AbdelazizSaid250 Jan 2, 2022
271dbc0
- Add the Jlibmodbus library as a module in the project.
AbdelazizSaid250 Jan 3, 2022
ac45a7c
- Edit the Data Point Modbus table to contain the last value and last…
AbdelazizSaid250 Jan 5, 2022
bf9f3f9
- Edit the Data Point Modbus table to contain the last value and last…
AbdelazizSaid250 Jan 5, 2022
d814fe2
- Create AppConfiguration.java to check if the system is Windows or l…
AbdelazizSaid250 Jan 8, 2022
e82c93b
- init commit
AbdelazizSaid250 Jan 8, 2022
eea184e
- Finished the Runtime module to retrieve the runtime mapping from th…
AbdelazizSaid250 Jan 9, 2022
0948a27
- Put the ServerModel and ServerSap inside the Runtime Controller and…
AbdelazizSaid250 Jan 10, 2022
8ea2199
- Create a native query to find the DataSourceModbus with the Server ID.
AbdelazizSaid250 Jan 11, 2022
1a6dea4
- Add new APIs to DataSource61850, DataPoint61850, DataSourceModbus, …
AbdelazizSaid250 Jan 16, 2022
0eee857
- Change Modbus Master Connection type from JSSC to JSerialComm
AbdelazizSaid250 Jan 18, 2022
261f2f0
- Add ConnectionParam.java to extract the connection parameters under…
AbdelazizSaid250 Jul 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
474 changes: 257 additions & 217 deletions src/main/java/com/beanit/iec61850bean/BdaTimestamp.java

Large diffs are not rendered by default.

148 changes: 148 additions & 0 deletions src/main/java/com/beanit/iec61850bean/ConnectionParam.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
package com.beanit.iec61850bean;

import java.util.Objects;

public class ConnectionParam {
private String iedName;

private String IP;
private String IP_SUBNET;
private String OSI_AP_Title;
private String OSI_AE_Qualifier;
private String OSI_PSEL;
private String OSI_SSEL;
private String OSI_TSEL;
private String IP_GATEWAY;
private String S_Profile;
private String MAC_Address;


public String getIedName() {
return iedName;
}

public void setIedName(String iedName) {
this.iedName = iedName;
}

public String getIP() {
return IP;
}

public void setIP(String IP) {
this.IP = IP;
}

public String getIP_SUBNET() {
return IP_SUBNET;
}

public void setIP_SUBNET(String IP_SUBNET) {
this.IP_SUBNET = IP_SUBNET;
}

public String getOSI_AP_Title() {
return OSI_AP_Title;
}

public void setOSI_AP_Title(String OSI_AP_Title) {
this.OSI_AP_Title = OSI_AP_Title;
}

public String getOSI_AE_Qualifier() {
return OSI_AE_Qualifier;
}

public void setOSI_AE_Qualifier(String OSI_AE_Qualifier) {
this.OSI_AE_Qualifier = OSI_AE_Qualifier;
}

public String getOSI_PSEL() {
return OSI_PSEL;
}

public void setOSI_PSEL(String OSI_PSEL) {
this.OSI_PSEL = OSI_PSEL;
}

public String getOSI_SSEL() {
return OSI_SSEL;
}

public void setOSI_SSEL(String OSI_SSEL) {
this.OSI_SSEL = OSI_SSEL;
}

public String getOSI_TSEL() {
return OSI_TSEL;
}

public void setOSI_TSEL(String OSI_TSEL) {
this.OSI_TSEL = OSI_TSEL;
}

public String getIP_GATEWAY() {
return IP_GATEWAY;
}

public void setIP_GATEWAY(String IP_GATEWAY) {
this.IP_GATEWAY = IP_GATEWAY;
}

public String getS_Profile() {
return S_Profile;
}

public void setS_Profile(String s_Profile) {
S_Profile = s_Profile;
}

public String getMAC_Address() {
return MAC_Address;
}

public void setMAC_Address(String MAC_Address) {
this.MAC_Address = MAC_Address;
}


@Override
public String toString() {
return "iedName = " + iedName + '\n' +
"IP = " + IP + '\n' +
"IP_SUBNET = " + IP_SUBNET + '\n' +
"OSI_AP_Title = " + OSI_AP_Title + '\n' +
"OSI_AE_Qualifier = " + OSI_AE_Qualifier + '\n' +
"OSI_PSEL = " + OSI_PSEL + '\n' +
"OSI_SSEL = " + OSI_SSEL + '\n' +
"OSI_TSEL = " + OSI_TSEL + '\n' +
"IP_GATEWAY = " + IP_GATEWAY + '\n' +
"S_Profile = " + S_Profile + '\n' +
"MAC-Address = " + MAC_Address
;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ConnectionParam that = (ConnectionParam) o;
return iedName.equals(that.iedName) &&
IP.equals(that.IP) &&
Objects.equals(IP_SUBNET, that.IP_SUBNET) &&
Objects.equals(OSI_AP_Title, that.OSI_AP_Title) &&
Objects.equals(OSI_AE_Qualifier, that.OSI_AE_Qualifier) &&
Objects.equals(OSI_PSEL, that.OSI_PSEL) &&
Objects.equals(OSI_SSEL, that.OSI_SSEL) &&
Objects.equals(OSI_TSEL, that.OSI_TSEL) &&
Objects.equals(IP_GATEWAY, that.IP_GATEWAY) &&
Objects.equals(S_Profile, that.S_Profile) &&
Objects.equals(MAC_Address, that.MAC_Address);
}

@Override
public int hashCode() {
return Objects.hash(iedName, IP, IP_SUBNET, OSI_AP_Title, OSI_AE_Qualifier, OSI_PSEL, OSI_SSEL,
OSI_TSEL, IP_GATEWAY, S_Profile, MAC_Address);
}
}
126 changes: 75 additions & 51 deletions src/main/java/com/beanit/iec61850bean/FcDataObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package com.beanit.iec61850bean;

import com.beanit.iec61850bean.internal.mms.asn1.Data;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
Expand All @@ -30,66 +31,89 @@
*/
public class FcDataObject extends FcModelNode {

public FcDataObject(ObjectReference objectReference, Fc fc, List<FcModelNode> children) {
private final List<FcModelNode> fcModelNodes;
private String doType;
private String cdc;

this.children = new LinkedHashMap<>((int) ((children.size() / 0.75) + 1));
this.objectReference = objectReference;
for (ModelNode child : children) {
this.children.put(child.getReference().getName(), child);
child.setParent(this);
}
this.fc = fc;
}

@Override
public FcDataObject copy() {
List<FcModelNode> childCopies = new ArrayList<>(children.size());
for (ModelNode childNode : children.values()) {
childCopies.add((FcModelNode) childNode.copy());

public FcDataObject(ObjectReference objectReference, Fc fc, List<FcModelNode> children) {
this.fcModelNodes = children;
super.setDataAttributes(children);
this.children = new LinkedHashMap<>((int) ((children.size() / 0.75) + 1));
this.objectReference = objectReference;

for (ModelNode child : children) {
this.children.put(child.getReference().getName(), child);
child.setParent(this);
}
this.fc = fc;
}
return new FcDataObject(objectReference, fc, childCopies);
}

@Override
Data getMmsDataObj() {
Data.Structure dataStructure = new Data.Structure();
List<Data> seq = dataStructure.getData();

for (ModelNode modelNode : getChildren()) {
Data child = modelNode.getMmsDataObj();
if (child == null) {
throw new IllegalArgumentException(
"Unable to convert Child: " + modelNode.objectReference + " to MMS Data Object.");
}
seq.add(child);

@Override
public FcDataObject copy() {
List<FcModelNode> childCopies = new ArrayList<>(children.size());
for (ModelNode childNode : children.values()) {
childCopies.add((FcModelNode) childNode.copy());
}
return new FcDataObject(objectReference, fc, childCopies);
}
if (seq.size() == 0) {
throw new IllegalArgumentException(
"Converting ModelNode: "
+ objectReference
+ " to MMS Data Object resulted in Sequence of size zero.");

@Override
Data getMmsDataObj() {
Data.Structure dataStructure = new Data.Structure();
List<Data> seq = dataStructure.getData();

for (ModelNode modelNode : getChildren()) {
Data child = modelNode.getMmsDataObj();
if (child == null) {
throw new IllegalArgumentException(
"Unable to convert Child: " + modelNode.objectReference + " to MMS Data Object.");
}
seq.add(child);
}
if (seq.size() == 0) {
throw new IllegalArgumentException(
"Converting ModelNode: "
+ objectReference
+ " to MMS Data Object resulted in Sequence of size zero.");
}

Data data = new Data();
data.setStructure(dataStructure);

return data;
}

Data data = new Data();
data.setStructure(dataStructure);
@Override
void setValueFromMmsDataObj(Data data) throws ServiceError {
if (data.getStructure() == null) {
throw new ServiceError(ServiceError.TYPE_CONFLICT, "expected type: structure");
}
if (data.getStructure().getData().size() != children.size()) {
throw new ServiceError(
ServiceError.TYPE_CONFLICT,
"expected type: structure with " + children.size() + " elements");
}

Iterator<Data> iterator = data.getStructure().getData().iterator();
for (ModelNode child : children.values()) {
child.setValueFromMmsDataObj(iterator.next());
}
}

return data;
}
public String getDoType() {
return doType;
}

@Override
void setValueFromMmsDataObj(Data data) throws ServiceError {
if (data.getStructure() == null) {
throw new ServiceError(ServiceError.TYPE_CONFLICT, "expected type: structure");
public void setDoType(String doType) {
this.doType = doType;
}
if (data.getStructure().getData().size() != children.size()) {
throw new ServiceError(
ServiceError.TYPE_CONFLICT,
"expected type: structure with " + children.size() + " elements");

public String getCdc() {
return cdc;
}

Iterator<Data> iterator = data.getStructure().getData().iterator();
for (ModelNode child : children.values()) {
child.setValueFromMmsDataObj(iterator.next());
public void setCdc(String cdc) {
this.cdc = cdc;
}
}
}
Loading