generated from gemstone/gemtem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConfigurationCell.cs
168 lines (153 loc) · 7.26 KB
/
ConfigurationCell.cs
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
//******************************************************************************************************
// ConfigurationCell.cs - Gbtc
//
// Copyright © 2012, Grid Protection Alliance. All Rights Reserved.
//
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
// the NOTICE file distributed with this work for additional information regarding copyright ownership.
// The GPA licenses this file to you under the MIT License (MIT), 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.opensource.org/licenses/MIT
//
// Unless agreed to in writing, the subject software distributed under the License is distributed on an
// "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
// License for the specific language governing permissions and limitations.
//
// Code Modification History:
// ----------------------------------------------------------------------------------------------------
// 02/08/2007 - J. Ritchie Carroll & Jian Ryan Zuo
// Generated original version of source code.
// 08/07/2009 - Josh L. Patterson
// Edited Comments.
// 09/15/2009 - Stephen C. Wills
// Added new header and license agreement.
// 12/17/2012 - Starlynn Danyelle Gilliam
// Modified Header.
//
//******************************************************************************************************
using System;
using System.Runtime.Serialization;
namespace Gemstone.PhasorProtocols.SelFastMessage
{
/// <summary>
/// Represents the SEL Fast Message implementation of a <see cref="IConfigurationCell"/> that can be sent or received.
/// </summary>
[Serializable]
public class ConfigurationCell : ConfigurationCellBase
{
#region [ Constructors ]
/// <summary>
/// Creates a new <see cref="ConfigurationCell"/> from specified parameters.
/// </summary>
/// <param name="parent">The parent <see cref="ConfigurationFrame"/>.</param>
public ConfigurationCell(ConfigurationFrame parent)
: base(parent, 0, Common.MaximumPhasorValues, Common.MaximumAnalogValues, Common.MaximumDigitalValues)
{
}
/// <summary>
/// Creates a new <see cref="ConfigurationCell"/> from serialization parameters.
/// </summary>
/// <param name="info">The <see cref="SerializationInfo"/> with populated with data.</param>
/// <param name="context">The source <see cref="StreamingContext"/> for this deserialization.</param>
protected ConfigurationCell(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
#endregion
#region [ Properties ]
/// <summary>
/// Gets a reference to the parent <see cref="ConfigurationFrame"/> for this <see cref="ConfigurationCell"/>.
/// </summary>
public new ConfigurationFrame Parent
{
get => base.Parent as ConfigurationFrame;
set => base.Parent = value;
}
/// <summary>
/// Gets or sets the ID code of this <see cref="ConfigurationCell"/>.
/// </summary>
public new uint IDCode
{
// SEL Fast Message only allows one device, so we share ID code with parent frame...
get => Parent.IDCode;
set
{
Parent.IDCode = value;
// Base classes constrain maximum value to 65535
base.IDCode = value > ushort.MaxValue ? ushort.MaxValue : (ushort)value;
}
}
/// <summary>
/// Gets or sets the <see cref="DataFormat"/> for the <see cref="IPhasorDefinition"/> objects in the <see cref="ConfigurationCellBase.PhasorDefinitions"/> of this <see cref="ConfigurationCell"/>.
/// </summary>
/// <remarks>
/// This property only supports floating-point data; SEL Fast Message doesn't transport scaled values.
/// </remarks>
/// <exception cref="NotSupportedException">SEL Fast Message only supports floating-point data.</exception>
public override DataFormat PhasorDataFormat
{
get => DataFormat.FloatingPoint;
set
{
if (value != DataFormat.FloatingPoint)
throw new NotSupportedException("SEL Fast Message only supports floating-point data");
}
}
/// <summary>
/// Gets or sets the <see cref="CoordinateFormat"/> for the <see cref="IPhasorDefinition"/> objects in the <see cref="ConfigurationCellBase.PhasorDefinitions"/> of this <see cref="ConfigurationCell"/>.
/// </summary>
/// <remarks>
/// This property only supports polar phasor data; SEL Fast Message doesn't transport rectangular phasor values.
/// </remarks>
/// <exception cref="NotSupportedException">SEL Fast Message only supports polar phasor data.</exception>
public override CoordinateFormat PhasorCoordinateFormat
{
get => CoordinateFormat.Polar;
set
{
if (value != CoordinateFormat.Polar)
throw new NotSupportedException("SEL Fast Message only supports polar phasor data");
}
}
/// <summary>
/// Gets or sets the <see cref="DataFormat"/> of the <see cref="FrequencyDefinition"/> of this <see cref="ConfigurationCell"/>.
/// </summary>
/// <remarks>
/// This property only supports floating-point data; SEL Fast Message doesn't transport scaled values.
/// </remarks>
/// <exception cref="NotSupportedException">SEL Fast Message only supports floating-point data.</exception>
public override DataFormat FrequencyDataFormat
{
get => DataFormat.FloatingPoint;
set
{
if (value != DataFormat.FloatingPoint)
throw new NotSupportedException("SEL Fast Message only supports floating-point data");
}
}
/// <summary>
/// Gets or sets the <see cref="DataFormat"/> for the <see cref="IAnalogDefinition"/> objects in the <see cref="ConfigurationCellBase.AnalogDefinitions"/> of this <see cref="ConfigurationCell"/>.
/// </summary>
/// <remarks>
/// This property only supports floating-point data; SEL Fast Message doesn't transport scaled values.
/// </remarks>
/// <exception cref="NotSupportedException">SEL Fast Message only supports floating-point data.</exception>
public override DataFormat AnalogDataFormat
{
get => DataFormat.FloatingPoint;
set
{
if (value != DataFormat.FloatingPoint)
throw new NotSupportedException("SEL Fast Message only supports floating-point data");
}
}
/// <summary>
/// Gets the maximum length of the <see cref="ConfigurationCellBase.StationName"/> of this <see cref="ConfigurationCell"/>.
/// </summary>
public override int MaximumStationNameLength =>
// The station name is defined external to the protocol, so there is no set limit
int.MaxValue;
#endregion
}
}