Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
f802122
uppgrade to netcore 9 to perpare to move to gemstone
gcsantos-gpa Jan 19, 2026
c43d721
update and addition of packages
gcsantos-gpa Jan 19, 2026
f69b8bd
bulk change of usings
gcsantos-gpa Jan 19, 2026
9db3e9d
replace connection string with gemstone settings
gcsantos-gpa Jan 19, 2026
d340d37
add alternative local library for replacing old libraries that used t…
gcsantos-gpa Jan 19, 2026
2285480
update to be compatible with netcore 9
gcsantos-gpa Jan 20, 2026
2e3701c
additional required xda model imports
gcsantos-gpa Jan 20, 2026
d851799
fix to work with core 9
gcsantos-gpa Jan 20, 2026
aa2fcbb
migrated to netcore
gcsantos-gpa Jan 20, 2026
5e33f8a
change to migrate, security is a concern for later
gcsantos-gpa Jan 20, 2026
e066516
model additions for analysis controller
gcsantos-gpa Jan 20, 2026
1c80d1a
convert to net core 9
gcsantos-gpa Jan 20, 2026
a01ed95
update to netcore 9
gcsantos-gpa Jan 20, 2026
69eda93
cleanedup imports
gcsantos-gpa Jan 20, 2026
1333508
removing because security will need to be redone and this relies on G…
gcsantos-gpa Jan 20, 2026
3ca4cd6
migrated web components to wwwroot for easier setup in startup due to…
gcsantos-gpa Jan 28, 2026
54a67c4
change to use gemstone class for reflection
gcsantos-gpa Jan 28, 2026
c2bb405
replace auth with tempauth
gcsantos-gpa Jan 28, 2026
8464c7b
changes to migrate app startup to aspnetcore
gcsantos-gpa Jan 28, 2026
a5d3355
removed webgrease bundling, is not compatable with aspnetcore
gcsantos-gpa Jan 28, 2026
b2a7593
handle errors is taken care of by startup/program
gcsantos-gpa Jan 28, 2026
3fdbba5
route registration has been migrated to useendpoints as per microsoft…
gcsantos-gpa Jan 28, 2026
7c139a5
changed to be compatable with gemstone
gcsantos-gpa Jan 28, 2026
66d4ca4
removed uneeded files
gcsantos-gpa Jan 28, 2026
b2eac6f
removed uneeded extension, added static file function for providing a…
gcsantos-gpa Jan 28, 2026
e436733
added needed iis options
gcsantos-gpa Jan 28, 2026
1c6a80a
removed, most of this is covered by gemstone.configuration
gcsantos-gpa Jan 28, 2026
c627f48
removed due to removing appmodel (is not needed by frontend)
gcsantos-gpa Jan 28, 2026
fb6ff2c
removed isAdmin
gcsantos-gpa Jan 28, 2026
d5e3e54
added systemsettings model object
gcsantos-gpa Jan 28, 2026
2c449c0
added auth attribute to home controller
gcsantos-gpa Jan 28, 2026
0e877d1
removed, replaced by SystemSettings
gcsantos-gpa Jan 28, 2026
5a8e32f
functionality moved to program/startup
gcsantos-gpa Jan 28, 2026
2b8bdf4
settings are handled by gemstone.configuration
gcsantos-gpa Jan 28, 2026
e970c9f
moved some js to npm installation
gcsantos-gpa Feb 4, 2026
525dece
Add eventStat for CSVController
gcsantos-gpa Feb 5, 2026
2e4f930
add PQDS project for CSV Download
gcsantos-gpa Feb 5, 2026
1cabe7f
replace CSV IHttpHandler with aspnetcore compatible controller
gcsantos-gpa Feb 5, 2026
2afd977
add pqds project to solution
gcsantos-gpa Feb 5, 2026
f3f815a
fix settings pull
gcsantos-gpa Feb 5, 2026
200008f
fix bug where streamwriter closing will close the output filestream, …
gcsantos-gpa Feb 5, 2026
8f1ca2e
bugfix to reset stream position
gcsantos-gpa Feb 5, 2026
0577900
bug exists where datagroup has no asset, this change also lets us cut…
gcsantos-gpa Feb 5, 2026
f96a14b
update to new uri for download
gcsantos-gpa Feb 5, 2026
2a714ba
change bootstrap to be npm loaded
gcsantos-gpa Feb 5, 2026
1134607
added to provide jquery through webpack
gcsantos-gpa Feb 5, 2026
949b969
added builddev for easier dev without doing ci everytime
gcsantos-gpa Feb 5, 2026
80b48f0
added popper to npm instead of html load
gcsantos-gpa Feb 5, 2026
f22d427
removed jquery from npm since webpack takes care of it
gcsantos-gpa Feb 5, 2026
7912d9c
we get styled from gpa-gemstone, no need to install it seperately
gcsantos-gpa Feb 5, 2026
c261634
revert accidental removal
gcsantos-gpa Feb 5, 2026
7294396
update lock
gcsantos-gpa Feb 5, 2026
8066e19
remove unneeded entry points
gcsantos-gpa Feb 5, 2026
a7968c3
remove uneeded js files from project
gcsantos-gpa Feb 5, 2026
8e2d59f
we have manually generated assembly info, no need to automate it
gcsantos-gpa Feb 5, 2026
5d8999d
added required nuget packages for project
gcsantos-gpa Feb 5, 2026
52d93b2
updated info
gcsantos-gpa Feb 6, 2026
e4a7424
replace fault specifics with controller
gcsantos-gpa Feb 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -233,4 +233,4 @@ readme.txt
**/src/OpenSEE/NUglify.dll
**/src/OpenSEE/web.config.backup

**/src/OpenSee/scripts/*.js
**/src/OpenSee/wwwroot/scripts/*.js
122 changes: 122 additions & 0 deletions src/Libraries/FaultAlgorithms/Conductor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
//*********************************************************************************************************************
// Conductor.cs
// Version 1.1 and subsequent releases
//
// Copyright © 2013, 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 Eclipse Public License -v 1.0 (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/eclipse-1.0.php
//
// 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.
//
// --------------------------------------------------------------------------------------------------------------------
//
// Version 1.0
//
// Copyright 2012 ELECTRIC POWER RESEARCH INSTITUTE, INC. All rights reserved.
//
// openFLE ("this software") is licensed under BSD 3-Clause license.
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
// following conditions are met:
//
// • Redistributions of source code must retain the above copyright notice, this list of conditions and
// the following disclaimer.
//
// • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
// the following disclaimer in the documentation and/or other materials provided with the distribution.
//
// • Neither the name of the Electric Power Research Institute, Inc. (“EPRI”) nor the names of its contributors
// may be used to endorse or promote products derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL EPRI BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
//
// This software incorporates work covered by the following copyright and permission notice:
//
// • TVA Code Library 4.0.4.3 - Tennessee Valley Authority, tvainfo@tva.gov
// No copyright is claimed pursuant to 17 USC § 105. All Other Rights Reserved.
//
// Licensed under TVA Custom License based on NASA Open Source Agreement (TVA Custom NOSA);
// you may not use TVA Code Library except in compliance with the TVA Custom NOSA. You may
// obtain a copy of the TVA Custom NOSA at http://tvacodelibrary.codeplex.com/license.
//
// TVA Code Library is provided by the copyright holders and contributors "as is" and any express
// or implied warranties, including, but not limited to, the implied warranties of merchantability
// and fitness for a particular purpose are disclaimed.
//
//*********************************************************************************************************************
//
// Code Modification History:
// -------------------------------------------------------------------------------------------------------------------
// 06/14/2012 - Stephen C. Wills, Grid Protection Alliance
// Generated original version of source code.
//
//*********************************************************************************************************************

namespace FaultAlgorithms
{
/// <summary>
/// Contains data for both the voltage
/// and current on a conductor.
/// </summary>
public class Conductor
{
#region [ Members ]

// Fields

/// <summary>
/// One cycle of voltage data.
/// </summary>
public Cycle V;

/// <summary>
/// One cycle of current data.
/// </summary>
public Cycle I;

#endregion

#region [ Constructors ]

/// <summary>
/// Creates a new instance of the <see cref="Conductor"/> class.
/// </summary>
public Conductor()
{
V = new Cycle();
I = new Cycle();
}

/// <summary>
/// Creates a new instance of the <see cref="Conductor"/> class.
/// </summary>
/// <param name="cycleIndex">The index of the cycle to be calculated.</param>
/// <param name="sampleRateDivisor">The value to divide from the sample rate to determine the starting location of the cycle.</param>
/// <param name="frequency">The frequency of the sine wave during this cycle.</param>
/// <param name="voltageData">The voltage data points.</param>
/// <param name="currentData">The current data points.</param>
public Conductor(int cycleIndex, int sampleRateDivisor, double frequency, MeasurementData voltageData, MeasurementData currentData)
{
int vStart = cycleIndex * (voltageData.SampleRate / sampleRateDivisor);
int iStart = cycleIndex * (currentData.SampleRate / sampleRateDivisor);
V = new Cycle(vStart, frequency, voltageData);
I = new Cycle(iStart, frequency, currentData);
}

#endregion
}
}
200 changes: 200 additions & 0 deletions src/Libraries/FaultAlgorithms/Cycle.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
//*********************************************************************************************************************
// Cycle.cs
// Version 1.1 and subsequent releases
//
// Copyright � 2013, 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 Eclipse Public License -v 1.0 (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/eclipse-1.0.php
//
// 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.
//
// --------------------------------------------------------------------------------------------------------------------
//
// Version 1.0
//
// Copyright 2012 ELECTRIC POWER RESEARCH INSTITUTE, INC. All rights reserved.
//
// openFLE ("this software") is licensed under BSD 3-Clause license.
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
// following conditions are met:
//
// � Redistributions of source code must retain the above copyright notice, this list of conditions and
// the following disclaimer.
//
// � Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
// the following disclaimer in the documentation and/or other materials provided with the distribution.
//
// � Neither the name of the Electric Power Research Institute, Inc. (�EPRI�) nor the names of its contributors
// may be used to endorse or promote products derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL EPRI BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
//
// This software incorporates work covered by the following copyright and permission notice:
//
// � TVA Code Library 4.0.4.3 - Tennessee Valley Authority, tvainfo@tva.gov
// No copyright is claimed pursuant to 17 USC � 105. All Other Rights Reserved.
//
// Licensed under TVA Custom License based on NASA Open Source Agreement (TVA Custom NOSA);
// you may not use TVA Code Library except in compliance with the TVA Custom NOSA. You may
// obtain a copy of the TVA Custom NOSA at http://tvacodelibrary.codeplex.com/license.
//
// TVA Code Library is provided by the copyright holders and contributors "as is" and any express
// or implied warranties, including, but not limited to, the implied warranties of merchantability
// and fitness for a particular purpose are disclaimed.
//
//*********************************************************************************************************************
//
// Code Modification History:
// -------------------------------------------------------------------------------------------------------------------
// 05/23/2012 - J. Ritchie Carroll, Grid Protection Alliance
// Generated original version of source code.
//
//*********************************************************************************************************************

using Gemstone;
using Gemstone.Numeric;
using Gemstone.Numeric.Analysis;
using Gemstone.Units;

namespace FaultAlgorithms
{
/// <summary>
/// Represents a cycle of single phase power frequency-domain data.
/// </summary>
public class Cycle
{
#region [ Members ]

// Constants
private const double PiOverTwo = Math.PI / 2.0D;

// Fields

/// <summary>
/// The actual frequency of the cycle in hertz.
/// </summary>
public double Frequency;

/// <summary>
/// The complex number representation of the RMS phasor.
/// </summary>
public ComplexNumber Complex;

/// <summary>
/// The most extreme data point in the cycle.
/// </summary>
public double Peak;

/// <summary>
/// The error between the sine fit and the given data values.
/// </summary>
public double Error;

#endregion

#region [ Constructors ]

/// <summary>
/// Creates a new instance of the <see cref="Cycle"/> class.
/// </summary>
public Cycle()
{
}

/// <summary>
/// Creates a new instance of the <see cref="Cycle"/> class.
/// </summary>
/// <param name="startSample">The index of the start of the cycle.</param>
/// <param name="frequency">The frequency of the measured system, in Hz.</param>
/// <param name="waveFormData">The time-domain data to be used to calculate frequency-domain values.</param>
public Cycle(int startSample, double frequency, MeasurementData waveFormData)
{
long timeStart;
double[] timeInSeconds;
double[] measurements;
SineWave sineFit;

if (startSample < 0)
throw new ArgumentOutOfRangeException("startSample");

if (startSample + waveFormData.SampleRate > waveFormData.Times.Length)
throw new ArgumentOutOfRangeException("startSample");

if (startSample + waveFormData.SampleRate > waveFormData.Measurements.Length)
throw new ArgumentOutOfRangeException("startSample");

timeStart = waveFormData.Times[startSample];
timeInSeconds = new double[waveFormData.SampleRate];
measurements = new double[waveFormData.SampleRate];

for (int i = 0; i < waveFormData.SampleRate; i++)
{
timeInSeconds[i] = Ticks.ToSeconds(waveFormData.Times[i + startSample] - timeStart);
measurements[i] = waveFormData.Measurements[i + startSample];
}

sineFit = WaveFit.SineFit(measurements, timeInSeconds, frequency);

RMS = Math.Sqrt(measurements.Select(vi => vi * vi).Average());
Phase = sineFit.Phase - PiOverTwo;
Peak = sineFit.Amplitude;
Frequency = frequency;

Error = timeInSeconds
.Select(time => sineFit.CalculateY(time))
.Zip(measurements, (calc, measurement) => Math.Abs(calc - measurement))
.Sum();
}

#endregion

#region [ Properties ]

/// <summary>
/// Root-mean-square of the <see cref="MeasurementData.Measurements"/> in the cycle.
/// </summary>
public double RMS
{
get
{
return Complex.Magnitude;
}
set
{
Complex.Magnitude = value;
}
}

/// <summary>
/// Phase angle of the start of the cycle, relative to the reference angle.
/// </summary>
public Angle Phase
{
get
{
return Complex.Angle;
}
set
{
Complex.Angle = value;
}
}

#endregion
}
}
Loading