Repository navigation
Expand file tree
/
Copy pathSclModels.cs
More file actions
140 lines (126 loc) · 5.54 KB
/
Copy pathSclModels.cs
File metadata and controls
140 lines (126 loc) · 5.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
using AR.Iec61850.Ethernet;
namespace AR.Iec61850.Scl;
public sealed class SclDocument
{
public string SourceName { get; init; } = string.Empty;
public string NamespaceUri { get; init; } = string.Empty;
public string HeaderId { get; init; } = string.Empty;
public string HeaderVersion { get; init; } = string.Empty;
public string HeaderRevision { get; init; } = string.Empty;
public SclEdition Edition { get; init; }
public IReadOnlyList<SclIed> Ieds { get; init; } = Array.Empty<SclIed>();
public IReadOnlyList<SclDataSet> DataSets { get; init; } = Array.Empty<SclDataSet>();
public IReadOnlyList<SclGooseStream> GooseStreams { get; init; } = Array.Empty<SclGooseStream>();
public IReadOnlyList<SclSampledValuesStream> SampledValuesStreams { get; init; } = Array.Empty<SclSampledValuesStream>();
public IReadOnlyList<SclReportControl> ReportControls { get; init; } = Array.Empty<SclReportControl>();
public IReadOnlyList<string> Warnings { get; init; } = Array.Empty<string>();
public IReadOnlyList<SclConflict> Conflicts { get; init; } = Array.Empty<SclConflict>();
}
public enum SclEdition
{
Unknown,
Edition1,
Edition2,
Edition21
}
public sealed class SclIed
{
public string Name { get; init; } = string.Empty;
public string Manufacturer { get; init; } = string.Empty;
public string Type { get; init; } = string.Empty;
public string ConfigVersion { get; init; } = string.Empty;
}
public sealed class SclDataSet
{
public string Key { get; init; } = string.Empty;
public string IedName { get; init; } = string.Empty;
public string LdInst { get; init; } = string.Empty;
public string LogicalNodePath { get; init; } = string.Empty;
public string Name { get; init; } = string.Empty;
public string Reference { get; init; } = string.Empty;
public IReadOnlyList<SclDataSetEntry> Entries { get; init; } = Array.Empty<SclDataSetEntry>();
}
public sealed class SclDataSetEntry
{
public int Index { get; init; }
public string SignalReference { get; init; } = string.Empty;
public string IedName { get; init; } = string.Empty;
public string LdInst { get; init; } = string.Empty;
public string Prefix { get; init; } = string.Empty;
public string LnClass { get; init; } = string.Empty;
public string LnInst { get; init; } = string.Empty;
public string DoName { get; init; } = string.Empty;
public string DaName { get; init; } = string.Empty;
public string Fc { get; init; } = string.Empty;
public string Cdc { get; init; } = string.Empty;
public string BType { get; init; } = string.Empty;
public string TypeId { get; init; } = string.Empty;
public string EnumType { get; init; } = string.Empty;
public bool IsQuality { get; init; }
public bool IsTimestamp { get; init; }
}
public abstract class SclProcessBusStream
{
public string Kind { get; init; } = string.Empty;
public string IedName { get; init; } = string.Empty;
public string LdInst { get; init; } = string.Empty;
public string ControlName { get; init; } = string.Empty;
public string ControlBlockReference { get; init; } = string.Empty;
public string DataSetName { get; init; } = string.Empty;
public string DataSetReference { get; init; } = string.Empty;
public uint ConfigurationRevision { get; init; }
public SclStreamAddress Address { get; init; } = new();
public IReadOnlyList<SclDataSetEntry> Entries { get; init; } = Array.Empty<SclDataSetEntry>();
}
public sealed class SclGooseStream : SclProcessBusStream
{
public string GoId { get; init; } = string.Empty;
public uint MinTimeMilliseconds { get; init; }
public uint MaxTimeMilliseconds { get; init; }
}
public sealed class SclSampledValuesStream : SclProcessBusStream
{
public string SvId { get; init; } = string.Empty;
public string SmvId { get; init; } = string.Empty;
public ushort SampleRate { get; init; }
public string SampleMode { get; init; } = string.Empty;
public ushort NoAsdu { get; init; } = 1;
}
public sealed class SclReportControl
{
public string IedName { get; init; } = string.Empty;
public string LdInst { get; init; } = string.Empty;
public string LogicalNodePath { get; init; } = string.Empty;
public string Name { get; init; } = string.Empty;
public string ReportId { get; init; } = string.Empty;
public string DataSetName { get; init; } = string.Empty;
public string DataSetReference { get; init; } = string.Empty;
public string ControlBlockReference { get; init; } = string.Empty;
public bool Buffered { get; init; }
public bool Indexed { get; init; } = true;
public uint ConfigurationRevision { get; init; }
public uint BufferTimeMilliseconds { get; init; }
public uint IntegrityPeriodMilliseconds { get; init; }
public IReadOnlyList<SclDataSetEntry> Entries { get; init; } = Array.Empty<SclDataSetEntry>();
}
public sealed class SclStreamAddress
{
public string AppIdText { get; init; } = string.Empty;
public ushort? AppId { get; init; }
public string DestinationMacText { get; init; } = string.Empty;
public MacAddress? DestinationMac { get; init; }
public ushort? VlanId { get; init; }
public byte? VlanPriority { get; init; }
public VlanTag? ToVlanTag()
{
if (!VlanId.HasValue)
return null;
return new VlanTag(VlanPriority ?? 0, VlanId.Value);
}
}
public sealed class SclConflict
{
public string Kind { get; init; } = string.Empty;
public string Key { get; init; } = string.Empty;
public string Description { get; init; } = string.Empty;
}