- small code format updates

v1.6
Michael Zillgith 4 months ago
parent 1e1e9045ba
commit a0ee6c816c

@ -225,8 +225,6 @@ namespace IEC61850
if (IedName != null)
name += IedName;
//name += lnClass;
if (inst != null)
name += inst;
@ -240,7 +238,6 @@ namespace IEC61850
}
public string Inst
{
get
@ -251,17 +248,9 @@ namespace IEC61850
{
inst = value;
UpdateName();
}
}
public List<LogicalNode> LogicalNodes
{
get
@ -288,13 +277,9 @@ namespace IEC61850
SclDocument = sclDocument;
this.name = name;
this.inst = inst;
//
objRef = this.name;
//
this.sclLDevice = sclLDevice;
}
}
public class LogicalNode : IEDModelNode
@ -304,7 +289,6 @@ namespace IEC61850
private string inst;
private Namespace nameSpace = null;
private SclLN sclElement = null;
private List<DataSet> dataSets = null;
@ -317,7 +301,6 @@ namespace IEC61850
private Inputs inputs = null;
private SclSettingControl settingControl = null;
public SclLN SclElement { get => sclElement; set => sclElement = value; }
public void UpdateName()
@ -538,7 +521,6 @@ namespace IEC61850
{
settingControl = sclElement.SettingControl;
settingControl.Parent = this;
}
}
}
@ -588,13 +570,9 @@ namespace IEC61850
public class DataObjectOrAttribute : IEDModelNode
{
public DataObjectOrAttribute(string name, IEDModelNode parent) : base(name, parent)
{
}
}
public class DataObject : DataObjectOrAttribute
@ -869,11 +847,6 @@ namespace IEC61850
public SclLogControl SclLogControl { get => sclLogControl; set => sclLogControl = value; }
}
}
}
}

@ -108,8 +108,6 @@ namespace IEC61850.SCL
XmlAttribute when = xmlNode.Attributes["when"];
if (when == null)
SclxmlDocument.AddIssue(xmlNode, "ERROR", "Model integrity", "No when attribute on Hitem", this, "when");
}
public SclHitem(XmlDocument xmlDocument)
@ -292,6 +290,7 @@ namespace IEC61850.SCL
return false;
}
public XmlNode Node
{
get { return xmlNode; }
@ -324,7 +323,6 @@ namespace IEC61850.SCL
if (historyNode != null)
history = new SclHistory(SclxmlDocument, historyNode, nsManager);
}
public SclHeader(SclDocument SclDocument, XmlNamespaceManager nsManager)
@ -336,8 +334,6 @@ namespace IEC61850.SCL
history = new SclHistory(SclDocument.XmlDocument);
xmlNode.AppendChild(history.XmlNode);
}
}
}

@ -527,19 +527,15 @@ namespace ModelGenerator
c_DataAttributeStructure.sclFC = SclFC.SG;
}
if (dataAttribute.subDataAttributes.Count > 0)
c_DataAttributeStructure.child = c_DataAttributeStructure.objRef + "_" + dataAttribute.subDataAttributes.First().Name;
if (dataAttribute.Count > 0)
{
for (int idx = 0; idx < dataAttribute.Count; idx++)
{
C_DataAttributeStructure arrayElement = new C_DataAttributeStructure();
c_DO_DA_Structures.Add(arrayElement);
arrayElement.name = "NULL";
@ -556,7 +552,6 @@ namespace ModelGenerator
arrayElement.elementCount = 0;
arrayElement.arrayIndex = idx;
if (idx == 0)
c_DataAttributeStructure.child = arrayElement.objRef;
@ -579,7 +574,6 @@ namespace ModelGenerator
createDataAttributeCStructure(c_DO_DA_Structures, c_DataAttributeStructure.objRef, dataObjectOrAttribute, dataAttribute, isDoTransient, sclSDI, -1);
}
}
SclDAI sclDAI = getDAI(daiObj, dataAttribute.Name);
@ -587,7 +581,6 @@ namespace ModelGenerator
if (sclDAI != null)
if (sclDAI.Val != null)
printValue(c_DataAttributeStructure, sclDAI.Val);
}
SclDAI getDAI(object parent, string name)
@ -601,8 +594,6 @@ namespace ModelGenerator
return sclSDI.SclDAIs.Find(x => x.Name == name);
else
return null;
}
SclSDI getSDI(object parent, string name)
@ -616,8 +607,6 @@ namespace ModelGenerator
return sclSDI.SclSDIs.Find(x => x.Name == name);
else
return null;
}
private void printValue(C_DataAttributeStructure c_DataAttributeStructure, string value)
@ -791,7 +780,6 @@ namespace ModelGenerator
c_SettingGroupControlStructure.settingControl = settingControl;
c_SettingGroupControlStructure.parent = lnPrefix;
c_SettingGroupControlStructure.externName = lnPrefix + "_sgcb";
}
private void createDataCStructure(IEDDataModel iedModel, string modelPrefix, bool isTransient)
@ -856,8 +844,6 @@ namespace ModelGenerator
{
Console.WriteLine("GSE not found for GoCB " + gSEControl.Name);
}
}
int gseIndex = 0;
@ -930,7 +916,6 @@ namespace ModelGenerator
c_IEDModelStructure.logs = c_LogStructures.First().externName;
}
if (logicalNode.SettingControl != null)
{
addSettingGroulBlockInstance(c_LogicalNodeStructure.objRef, logicalNode.SettingControl);
@ -991,19 +976,16 @@ namespace ModelGenerator
clientAddress[j + 1] = iPAddress.GetAddressBytes()[j];
}
}
}
addReportControlBlockInstance(c_LogicalNodeStructure.objRef, reportControl, index, logicalNode.ReportControlBlocks.Count, reportsCount, clientAddress);
reportsCount++;
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
else
{
@ -1011,7 +993,6 @@ namespace ModelGenerator
clientAddress[0] = 0;
addReportControlBlockInstance(c_LogicalNodeStructure.objRef, reportControl, "", logicalNode.ReportControlBlocks.Count, reportsCount, clientAddress);
reportsCount++;
}
int rptIndex = 0;
@ -1030,9 +1011,6 @@ namespace ModelGenerator
c_IEDModelStructure.rcbs = c_ReportContorlBlockStructures.First().externName;
}
}
int datasetCOunt = 0;
@ -1100,6 +1078,7 @@ namespace ModelGenerator
componentName = componentNamePart;
}
}
if (componentName != "")
c_DatasetEntry.componentName = componentName;
@ -1170,14 +1149,12 @@ namespace ModelGenerator
hOut.WriteLine("#include <stdlib.h>");
hOut.WriteLine("#include \"iec61850_model.h\"");
hOut.WriteLine();
}
private void printHeaderFileFooter(StreamWriter hOut, string hDefineName)
{
hOut.WriteLine();
hOut.WriteLine("#endif /* " + hDefineName + " */\n");
}
private void printCFileHeader(string filename, string outputFileName, StreamWriter cOut)
@ -1196,6 +1173,5 @@ namespace ModelGenerator
cOut.WriteLine("#include \"" + include);
cOut.WriteLine();
}
}
}

Loading…
Cancel
Save