Skip to content

Commit ee9f5fd

Browse files
Merge pull request #490 from GridProtectionAlliance/SELCWSFileReadFix
SEL CWS Fix
2 parents 2bb6fef + 3499120 commit ee9f5fd

18 files changed

+69
-151
lines changed

Source/Libraries/GSF.PhasorProtocols/MultiProtocolFrameParser.cs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,7 +1468,6 @@ private void SharedClient_SendDataException(object sender, EventArgs<Exception>
14681468
private SharedTimer m_rateCalcTimer;
14691469
private IConfigurationFrame m_configurationFrame;
14701470
private CheckSumValidationFrameTypes m_checkSumValidationFrameTypes;
1471-
private long m_lastFramePublishTime;
14721471
private long m_dataStreamStartTime;
14731472
private long m_missingFramesOverflow;
14741473
private int m_frameRateTotal;
@@ -3399,7 +3398,7 @@ private void m_dataChannel_ReceiveDataComplete(object sender, EventArgs<byte[],
33993398
int length = e.Argument2;
34003399
Parse(SourceChannel.Data, buffer, 0, length);
34013400

3402-
if (TransportProtocol != TransportProtocol.File || m_dataChannel is not FileClient { CurrentState: ClientState.Connected } fileClient)
3401+
if (TransportProtocol != TransportProtocol.File || m_dataChannel is not FileClient { CurrentState: ClientState.Connected })
34033402
return;
34043403

34053404
// Read next buffer
@@ -3446,9 +3445,6 @@ private void m_dataChannel_ConnectionException(object sender, EventArgs<Exceptio
34463445

34473446
private void m_dataChannel_ConnectionTerminated(object sender, EventArgs e)
34483447
{
3449-
if (m_transportProtocol == TransportProtocol.File)
3450-
m_lastFramePublishTime = 0L;
3451-
34523448
ConnectionTerminated?.Invoke(this, EventArgs.Empty);
34533449
}
34543450

@@ -3726,8 +3722,6 @@ private void m_frameParser_ReceivedDataFrame(object sender, EventArgs<IDataFrame
37263722
// If injecting a simulated timestamp, use the last received time
37273723
if (InjectSimulatedTimestamp)
37283724
dataFrame.Timestamp = simulatedTimestamp;
3729-
3730-
m_lastFramePublishTime = DateTime.UtcNow.Ticks;
37313725
}
37323726

37333727
ReceivedDataFrame?.Invoke(this, e);
@@ -3835,15 +3829,14 @@ private void ReadNextFileBuffer()
38353829
if (m_dataChannel is not FileClient { CurrentState: ClientState.Connected } fileClient)
38363830
return;
38373831

3838-
while (QueuedBuffers > 0 || QueuedOutputs * 2 > m_definedFrameRate * 3)
3832+
while (QueuedBuffers > 0 || QueuedOutputs > 0)
38393833
{
38403834
Thread.Sleep(1);
38413835

38423836
if (fileClient.CurrentState != ClientState.Connected)
38433837
return;
38443838
}
3845-
3846-
// Read more file data when no data has been received for target frame period
3839+
38473840
fileClient.ReadNextBuffer();
38483841
}
38493842

Source/Libraries/GSF.PhasorProtocols/SelCWS/AnalogDefinition.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//******************************************************************************************************
22
// AnalogDefinition.cs - Gbtc
33
//
4-
// Copyright © 2012, Grid Protection Alliance. All Rights Reserved.
4+
// Copyright © 2025, Grid Protection Alliance. All Rights Reserved.
55
//
66
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
77
// the NOTICE file distributed with this work for additional information regarding copyright ownership.
@@ -16,12 +16,8 @@
1616
//
1717
// Code Modification History:
1818
// ----------------------------------------------------------------------------------------------------
19-
// 11/12/2004 - J. Ritchie Carroll
19+
// 11/04/2025 - Ritchie Carroll
2020
// Generated original version of source code.
21-
// 09/15/2009 - Stephen C. Wills
22-
// Added new header and license agreement.
23-
// 12/17/2012 - Starlynn Danyelle Gilliam
24-
// Modified Header.
2521
//
2622
//******************************************************************************************************
2723

Source/Libraries/GSF.PhasorProtocols/SelCWS/AnalogValue.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//******************************************************************************************************
22
// AnalogValue.cs - Gbtc
33
//
4-
// Copyright © 2012, Grid Protection Alliance. All Rights Reserved.
4+
// Copyright © 2025, Grid Protection Alliance. All Rights Reserved.
55
//
66
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
77
// the NOTICE file distributed with this work for additional information regarding copyright ownership.
@@ -16,12 +16,8 @@
1616
//
1717
// Code Modification History:
1818
// ----------------------------------------------------------------------------------------------------
19-
// 11/12/2004 - J. Ritchie Carroll
19+
// 11/04/2025 - Ritchie Carroll
2020
// Generated original version of source code.
21-
// 09/15/2009 - Stephen C. Wills
22-
// Added new header and license agreement.
23-
// 12/17/2012 - Starlynn Danyelle Gilliam
24-
// Modified Header.
2521
//
2622
//******************************************************************************************************
2723

Source/Libraries/GSF.PhasorProtocols/SelCWS/Common.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//******************************************************************************************************
22
// Common.cs - Gbtc
33
//
4-
// Copyright © 2012, Grid Protection Alliance. All Rights Reserved.
4+
// Copyright © 2025, Grid Protection Alliance. All Rights Reserved.
55
//
66
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
77
// the NOTICE file distributed with this work for additional information regarding copyright ownership.
@@ -16,12 +16,8 @@
1616
//
1717
// Code Modification History:
1818
// ----------------------------------------------------------------------------------------------------
19-
// 02/08/2007 - J. Ritchie Carroll & Jian Ryan Zuo
19+
// 11/04/2025 - Ritchie Carroll
2020
// Generated original version of source code.
21-
// 09/15/2009 - Stephen C. Wills
22-
// Added new header and license agreement.
23-
// 12/17/2012 - Starlynn Danyelle Gilliam
24-
// Modified Header.
2521
//
2622
//******************************************************************************************************
2723
// ReSharper disable InconsistentNaming

Source/Libraries/GSF.PhasorProtocols/SelCWS/CommonFrameHeader.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//******************************************************************************************************
22
// CommonFrameHeader.cs - Gbtc
33
//
4-
// Copyright © 2012, Grid Protection Alliance. All Rights Reserved.
4+
// Copyright © 2025, Grid Protection Alliance. All Rights Reserved.
55
//
66
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
77
// the NOTICE file distributed with this work for additional information regarding copyright ownership.
@@ -16,12 +16,8 @@
1616
//
1717
// Code Modification History:
1818
// ----------------------------------------------------------------------------------------------------
19-
// 03/20/2009 - J. Ritchie Carroll
19+
// 11/04/2025 - Ritchie Carroll
2020
// Generated original version of source code.
21-
// 09/15/2009 - Stephen C. Wills
22-
// Added new header and license agreement.
23-
// 12/17/2012 - Starlynn Danyelle Gilliam
24-
// Modified Header.
2521
//
2622
//******************************************************************************************************
2723
// ReSharper disable UnusedParameter.Local

Source/Libraries/GSF.PhasorProtocols/SelCWS/ConfigurationCell.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//******************************************************************************************************
22
// ConfigurationCell.cs - Gbtc
33
//
4-
// Copyright © 2012, Grid Protection Alliance. All Rights Reserved.
4+
// Copyright © 2025, Grid Protection Alliance. All Rights Reserved.
55
//
66
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
77
// the NOTICE file distributed with this work for additional information regarding copyright ownership.
@@ -16,12 +16,8 @@
1616
//
1717
// Code Modification History:
1818
// ----------------------------------------------------------------------------------------------------
19-
// 02/08/2007 - J. Ritchie Carroll & Jian Ryan Zuo
19+
// 11/04/2025 - Ritchie Carroll
2020
// Generated original version of source code.
21-
// 09/15/2009 - Stephen C. Wills
22-
// Added new header and license agreement.
23-
// 12/17/2012 - Starlynn Danyelle Gilliam
24-
// Modified Header.
2521
//
2622
//******************************************************************************************************
2723

Source/Libraries/GSF.PhasorProtocols/SelCWS/ConfigurationCellCollection.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//******************************************************************************************************
22
// ConfigurationCellCollection.cs - Gbtc
33
//
4-
// Copyright © 2012, Grid Protection Alliance. All Rights Reserved.
4+
// Copyright © 2025, Grid Protection Alliance. All Rights Reserved.
55
//
66
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
77
// the NOTICE file distributed with this work for additional information regarding copyright ownership.
@@ -16,12 +16,8 @@
1616
//
1717
// Code Modification History:
1818
// ----------------------------------------------------------------------------------------------------
19-
// 02/08/2007 - J. Ritchie Carroll & Jian Ryan Zuo
19+
// 11/04/2025 - Ritchie Carroll
2020
// Generated original version of source code.
21-
// 09/15/2009 - Stephen C. Wills
22-
// Added new header and license agreement.
23-
// 12/17/2012 - Starlynn Danyelle Gilliam
24-
// Modified Header.
2521
//
2622
//******************************************************************************************************
2723

Source/Libraries/GSF.PhasorProtocols/SelCWS/ConfigurationFrame.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//******************************************************************************************************
22
// ConfigurationFrame.cs - Gbtc
33
//
4-
// Copyright © 2012, Grid Protection Alliance. All Rights Reserved.
4+
// Copyright © 2025, Grid Protection Alliance. All Rights Reserved.
55
//
66
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
77
// the NOTICE file distributed with this work for additional information regarding copyright ownership.
@@ -16,14 +16,8 @@
1616
//
1717
// Code Modification History:
1818
// ----------------------------------------------------------------------------------------------------
19-
// 02/08/2007 - J. Ritchie Carroll & Jian Ryan Zuo
19+
// 11/04/2025 - Ritchie Carroll
2020
// Generated original version of source code.
21-
// 08/07/2009 - Josh L. Patterson
22-
// Edited Comments.
23-
// 09/15/2009 - Stephen C. Wills
24-
// Added new header and license agreement.
25-
// 12/17/2012 - Starlynn Danyelle Gilliam
26-
// Modified Header.
2721
//
2822
//******************************************************************************************************
2923
// ReSharper disable VirtualMemberCallInConstructor

Source/Libraries/GSF.PhasorProtocols/SelCWS/ConnectionParameters.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//******************************************************************************************************
22
// ConnectionParameters.cs - Gbtc
33
//
4-
// Copyright © 2012, Grid Protection Alliance. All Rights Reserved.
4+
// Copyright © 2025, Grid Protection Alliance. All Rights Reserved.
55
//
66
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
77
// the NOTICE file distributed with this work for additional information regarding copyright ownership.
@@ -16,12 +16,8 @@
1616
//
1717
// Code Modification History:
1818
// ----------------------------------------------------------------------------------------------------
19-
// 02/26/2007 - J. Ritchie Carroll & Jian Ryan Zuo
19+
// 11/04/2025 - Ritchie Carroll
2020
// Generated original version of source code.
21-
// 09/15/2009 - Stephen C. Wills
22-
// Added new header and license agreement.
23-
// 12/17/2012 - Starlynn Danyelle Gilliam
24-
// Modified Header.
2521
//
2622
//******************************************************************************************************
2723
// ReSharper disable StringLiteralTypo

Source/Libraries/GSF.PhasorProtocols/SelCWS/DataCell.cs

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//******************************************************************************************************
22
// DataCell.cs - Gbtc
33
//
4-
// Copyright © 2012, Grid Protection Alliance. All Rights Reserved.
4+
// Copyright © 2025, Grid Protection Alliance. All Rights Reserved.
55
//
66
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
77
// the NOTICE file distributed with this work for additional information regarding copyright ownership.
@@ -16,12 +16,8 @@
1616
//
1717
// Code Modification History:
1818
// ----------------------------------------------------------------------------------------------------
19-
// 02/08/2007 - J. Ritchie Carroll & Jian Ryan Zuo
19+
// 11/04/2025 - Ritchie Carroll
2020
// Generated original version of source code.
21-
// 09/15/2009 - Stephen C. Wills
22-
// Added new header and license agreement.
23-
// 12/17/2012 - Starlynn Danyelle Gilliam
24-
// Modified Header.
2521
//
2622
//******************************************************************************************************
2723
// ReSharper disable RedundantOverriddenMember
@@ -137,17 +133,14 @@ public override bool DeviceError
137133
}
138134
}
139135

136+
/// <inheritdoc />
137+
protected override int BodyLength => AnalogValues.Count * 4;
138+
140139
#endregion
141140

142141
#region [ Methods ]
143142

144-
/// <summary>
145-
/// Parses the binary body image.
146-
/// </summary>
147-
/// <param name="buffer">Binary image to parse.</param>
148-
/// <param name="startIndex">Start index into <paramref name="buffer"/> to begin parsing.</param>
149-
/// <param name="length">Length of valid data within <paramref name="buffer"/>.</param>
150-
/// <returns>The length of the data that was parsed.</returns>
143+
/// <inheritdoc />
151144
protected override int ParseBodyImage(byte[] buffer, int startIndex, int length)
152145
{
153146
int index = startIndex;
@@ -162,11 +155,7 @@ protected override int ParseBodyImage(byte[] buffer, int startIndex, int length)
162155
return index - startIndex;
163156
}
164157

165-
/// <summary>
166-
/// Populates a <see cref="SerializationInfo"/> with the data needed to serialize the target object.
167-
/// </summary>
168-
/// <param name="info">The <see cref="SerializationInfo"/> to populate with data.</param>
169-
/// <param name="context">The destination <see cref="StreamingContext"/> for this serialization.</param>
158+
/// <inheritdoc />
170159
public override void GetObjectData(SerializationInfo info, StreamingContext context)
171160
{
172161
base.GetObjectData(info, context);

0 commit comments

Comments
 (0)