- Java tools: moved minTime, maxTime from GSEControl to GSE; updated

GOOSE server example CID file
pull/239/head
Michael Zillgith 5 years ago
parent b6b94b0438
commit 0e184389b9

@ -20,6 +20,8 @@
<P type="MAC-Address">01-0c-cd-01-00-01</P>
<P type="APPID">1000</P>
</Address>
<MinTime>1000</MinTime>
<MaxTime>3000</MaxTime>
</GSE>
<GSE ldInst="GenericIO" cbName="gcbAnalogValues">
<Address>
@ -59,36 +61,36 @@
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="ST" lnInst="1" doName="SPCSO3" daName="stVal" />
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="ST" lnInst="1" doName="SPCSO4" daName="stVal" />
</DataSet>
<DataSet name="Events2" desc="Events2">
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="ST" lnInst="1" doName="SPCSO1" />
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="ST" lnInst="1" doName="SPCSO2" />
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="ST" lnInst="1" doName="SPCSO3" />
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="ST" lnInst="1" doName="SPCSO4" />
</DataSet>
<DataSet name="AnalogValues" desc="analog values">
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="MX" lnInst="1" doName="AnIn1" />
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="MX" lnInst="1" doName="AnIn2" />
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="MX" lnInst="1" doName="AnIn3" />
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="MX" lnInst="1" doName="AnIn4" />
</DataSet>
<ReportControl name="EventsRCB" confRev="1" datSet="Events" rptID="Events" buffered="false" intgPd="1000" bufTime="50">
<TrgOps period="true" />
<OptFields seqNum="true" timeStamp="true" dataSet="true" reasonCode="true" configRef="true" />
<RptEnabled max="1" />
</ReportControl>
<ReportControl name="AnalogValuesRCB" confRev="1" datSet="AnalogValues" rptID="AnalogValues" buffered="false" intgPd="1000" bufTime="50">
<TrgOps period="true" />
<OptFields seqNum="true" timeStamp="true" dataSet="true" reasonCode="true" configRef="true" />
<RptEnabled max="1" />
</ReportControl>
<GSEControl appID="events" name="gcbEvents" type="GOOSE" datSet="Events" confRev="2" minTime="1000" maxTime="3000" />
<GSEControl appID="analog" name="gcbAnalogValues" type="GOOSE" datSet="AnalogValues" confRev="2"/>
<GSEControl appID="events" name="gcbEvents" type="GOOSE" datSet="Events" confRev="2" />
<GSEControl appID="analog" name="gcbAnalogValues" type="GOOSE" datSet="AnalogValues" confRev="2"/>
<DOI name="Mod">
<DAI name="ctlModel">
<Val>status-only</Val>

@ -86,12 +86,12 @@ public class ConnectedAP {
return smvs;
}
public PhyComAddress lookupGSEAddress(String logicalDeviceName, String name) {
public GSE lookupGSE(String logicalDeviceName, String name) {
for (GSE gse : this.getGses()) {
if (gse.getLdInst().equals(logicalDeviceName)) {
if (gse.getCbName().equals(name))
return gse.getAddress();
return gse;
}
}

@ -31,6 +31,9 @@ public class GSE {
private String ldInst;
private String cbName;
private int minTime = -1;
private int maxTime = -1;
private PhyComAddress address;
public GSE(Node gseNode) throws SclParserException {
@ -40,6 +43,18 @@ public class GSE {
if ((ldInst == null) || (cbName == null))
throw new SclParserException(gseNode, "GSE is missing required attribute");
Node minTimeNode = ParserUtils.getChildNodeWithTag(gseNode, "MinTime");
if (minTimeNode != null) {
minTime = Integer.parseInt(minTimeNode.getTextContent());
}
Node maxTimeNode = ParserUtils.getChildNodeWithTag(gseNode, "MaxTime");
if (maxTimeNode != null) {
maxTime = Integer.parseInt(maxTimeNode.getTextContent());
}
Node addressNode = ParserUtils.getChildNodeWithTag(gseNode, "Address");
if (addressNode == null)
@ -55,6 +70,14 @@ public class GSE {
public String getCbName() {
return cbName;
}
public int getMinTime() {
return minTime;
}
public int getMaxTime() {
return maxTime;
}
public PhyComAddress getAddress() {
return address;

@ -50,7 +50,7 @@ public class PhyComAddress {
throw new SclParserException(addressNode, "VLAN-ID value out of range");
}
else if (type.equals("VLAN-PRIORITY")) {
vlanPriority = new Integer(pNode.getTextContent());
vlanPriority = Integer.parseInt(pNode.getTextContent());
}
else if (type.equals("APPID")) {
appId = Integer.parseInt(pNode.getTextContent(), 16);

@ -34,8 +34,6 @@ public class GSEControl {
private int confRev = 1;
private String appID;
private boolean fixedOffs = false;
private int minTime = -1;
private int maxTime = -1;
public GSEControl(Node gseControlNode) throws SclParserException {
@ -57,17 +55,6 @@ public class GSEControl {
if (fixedOffs != null)
this.fixedOffs = fixedOffs;
String minTimeStr = ParserUtils.parseAttribute(gseControlNode,
"minTime");
String maxTimeStr = ParserUtils.parseAttribute(gseControlNode,
"maxTime");
if (minTimeStr != null)
minTime = new Integer(minTimeStr);
if (maxTimeStr != null)
maxTime = new Integer(maxTimeStr);
String typeString = ParserUtils.parseAttribute(gseControlNode, "type");
if (typeString != null)
@ -101,12 +88,4 @@ public class GSEControl {
return fixedOffs;
}
public int getMinTime() {
return minTime;
}
public int getMaxTime() {
return maxTime;
}
}

@ -3,7 +3,7 @@ package com.libiec61850.tools;
/*
* DynamicModelGenerator.java
*
* Copyright 2014-2016 Michael Zillgith
* Copyright 2014-2020 Michael Zillgith
*
* This file is part of libIEC61850.
*
@ -35,6 +35,7 @@ import com.libiec61850.scl.DataAttributeDefinition;
import com.libiec61850.scl.SclParser;
import com.libiec61850.scl.SclParserException;
import com.libiec61850.scl.communication.ConnectedAP;
import com.libiec61850.scl.communication.GSE;
import com.libiec61850.scl.communication.PhyComAddress;
import com.libiec61850.scl.model.AccessPoint;
import com.libiec61850.scl.model.DataAttribute;
@ -153,10 +154,15 @@ public class DynamicModelGenerator {
for (GSEControl gcb : logicalNode.getGSEControlBlocks()) {
LogicalDevice ld = logicalNode.getParentLogicalDevice();
GSE gse = null;
PhyComAddress gseAddress = null;
if (connectedAP != null)
gseAddress = connectedAP.lookupGSEAddress(ld.getInst(), gcb.getName());
if (connectedAP != null) {
gse = connectedAP.lookupGSE(ld.getInst(), gcb.getName());
if (gse != null)
gseAddress = gse.getAddress();
}
else
System.out.println("WARNING: IED \"" + ied.getName() + "\" has no connected access point!");
@ -170,9 +176,14 @@ public class DynamicModelGenerator {
else
output.print('0');
output.print(' ');
output.print(gcb.getMinTime());
output.print(' ');
output.print(gcb.getMaxTime());
if (gse != null) {
output.print(gse.getMinTime());
output.print(' ');
output.print(gse.getMaxTime());
}
else {
output.print("-1 -1");
}
output.print(' ');
if (gseAddress == null) {

@ -3,7 +3,7 @@ package com.libiec61850.tools;
/*
* StaticModelGenerator.java
*
* Copyright 2013-2016 Michael Zillgith
* Copyright 2013-2020 Michael Zillgith
*
* This file is part of libIEC61850.
*
@ -1027,8 +1027,10 @@ public class StaticModelGenerator {
for (GSEControl gseControlBlock : gseControlBlocks) {
PhyComAddress gseAddress = connectedAP.lookupGSEAddress(logicalDeviceName, gseControlBlock.getName());
GSE gse = connectedAP.lookupGSE(logicalDeviceName, gseControlBlock.getName());
PhyComAddress gseAddress = gse.getAddress();
String gseString = "";
String phyComAddrName = "";
@ -1082,8 +1084,8 @@ public class StaticModelGenerator {
else
gseString += "NULL, ";
gseString += gseControlBlock.getMinTime() + ", ";
gseString += gseControlBlock.getMaxTime() + ", ";
gseString += gse.getMinTime() + ", ";
gseString += gse.getMaxTime() + ", ";
currentGseVariableNumber++;

Loading…
Cancel
Save