From ac77cf8407c1264dd813543915e70510702d7f8a Mon Sep 17 00:00:00 2001 From: prestoncraw Date: Thu, 11 Jun 2026 15:49:00 -0400 Subject: [PATCH] Move openSEE's .NET libraries that are shared with PQDigest for a single SOT --- .../FaultAlgorithms/FaultAlgorithms.csproj | 2 +- Libraries/FaultData/FaultData.csproj | 4 +- .../openXDA.Model/Events/BreakerRestrike.cs | 65 +++++ .../Events/Disturbances/Disturbance.cs | 67 +++++ Libraries/openXDA.Model/Events/Event.cs | 19 ++ Libraries/openXDA.Model/Events/EventStat.cs | 57 ++++ .../openXDA.Model/Events/Faults/Fault.cs | 137 ++++++++++ .../openXDA.Model/Events/Faults/FaultCurve.cs | 250 ++++++++++++++++++ .../openXDA.Model/Events/RelayPerformance.cs | 63 +++++ .../PQDigest/HomeScreenWidget.cs | 44 +++ Libraries/openXDA.Model/PQDigest/Widget.cs | 51 ++++ .../openXDA.Model/Settings/OpenSEESetting.cs | 33 +++ .../openXDA.Model/Settings/PQDigestSetting.cs | 33 +++ .../TransmissionElements/BreakerOperation.cs | 107 ++++++++ Libraries/openXDA.Model/openXDA.Model.csproj | 6 +- 15 files changed, 932 insertions(+), 6 deletions(-) create mode 100644 Libraries/openXDA.Model/Events/BreakerRestrike.cs create mode 100644 Libraries/openXDA.Model/Events/Disturbances/Disturbance.cs create mode 100644 Libraries/openXDA.Model/Events/EventStat.cs create mode 100644 Libraries/openXDA.Model/Events/Faults/Fault.cs create mode 100644 Libraries/openXDA.Model/Events/Faults/FaultCurve.cs create mode 100644 Libraries/openXDA.Model/Events/RelayPerformance.cs create mode 100644 Libraries/openXDA.Model/PQDigest/HomeScreenWidget.cs create mode 100644 Libraries/openXDA.Model/PQDigest/Widget.cs create mode 100644 Libraries/openXDA.Model/Settings/OpenSEESetting.cs create mode 100644 Libraries/openXDA.Model/Settings/PQDigestSetting.cs create mode 100644 Libraries/openXDA.Model/TransmissionElements/BreakerOperation.cs diff --git a/Libraries/FaultAlgorithms/FaultAlgorithms.csproj b/Libraries/FaultAlgorithms/FaultAlgorithms.csproj index b5829c2..bc76780 100644 --- a/Libraries/FaultAlgorithms/FaultAlgorithms.csproj +++ b/Libraries/FaultAlgorithms/FaultAlgorithms.csproj @@ -7,7 +7,7 @@ - + diff --git a/Libraries/FaultData/FaultData.csproj b/Libraries/FaultData/FaultData.csproj index 742b709..f4297a8 100644 --- a/Libraries/FaultData/FaultData.csproj +++ b/Libraries/FaultData/FaultData.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/Libraries/openXDA.Model/Events/BreakerRestrike.cs b/Libraries/openXDA.Model/Events/BreakerRestrike.cs new file mode 100644 index 0000000..e76661d --- /dev/null +++ b/Libraries/openXDA.Model/Events/BreakerRestrike.cs @@ -0,0 +1,65 @@ +//****************************************************************************************************** +// BreakerRestrike.cs - Gbtc +// +// Copyright © 2019, 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://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: +// ---------------------------------------------------------------------------------------------------- +// 08/30/2019 - Stephen C. Wills +// Generated original version of source code. +// +//****************************************************************************************************** + +using System.Data; +using Gemstone.Data; +using Gemstone.Data.Model; + +namespace openXDA.Model +{ + public class BreakerRestrike + { + [PrimaryKey(true)] + public int ID { get; set; } + + public int EventID { get; set; } + + public int PhaseID { get; set; } + + public int InitialExtinguishSample { get; set; } + + [FieldDataType(DbType.DateTime2, DatabaseType.SQLServer)] + public DateTime InitialExtinguishTime { get; set; } + public double InitialExtinguishVoltage { get; set; } + public int RestrikeSample { get; set; } + + [FieldDataType(DbType.DateTime2, DatabaseType.SQLServer)] + public DateTime RestrikeTime { get; set; } + public double RestrikeVoltage { get; set; } + public double RestrikeCurrentPeak { get; set; } + public double RestrikeVoltageDip { get; set; } + public int TransientPeakSample { get; set; } + + [FieldDataType(DbType.DateTime2, DatabaseType.SQLServer)] + public DateTime TransientPeakTime { get; set; } + public double TransientPeakVoltage { get; set; } + public double PerUnitTransientPeakVoltage { get; set; } + public int FinalExtinguishSample { get; set; } + + [FieldDataType(DbType.DateTime2, DatabaseType.SQLServer)] + public DateTime FinalExtinguishTime { get; set; } + public double FinalExtinguishVoltage { get; set; } + public double I2t { get; set; } + + } +} diff --git a/Libraries/openXDA.Model/Events/Disturbances/Disturbance.cs b/Libraries/openXDA.Model/Events/Disturbances/Disturbance.cs new file mode 100644 index 0000000..c83ce0e --- /dev/null +++ b/Libraries/openXDA.Model/Events/Disturbances/Disturbance.cs @@ -0,0 +1,67 @@ +//****************************************************************************************************** +// Disturbance.cs - Gbtc +// +// Copyright © 2017, 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://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: +// ---------------------------------------------------------------------------------------------------- +// 08/29/2017 - Billy Ernest +// Generated original version of source code. +// +//****************************************************************************************************** + +using System; +using Gemstone.Data.Model; + +namespace openXDA.Model +{ + public class Disturbance + { + [PrimaryKey(true)] + public int ID { get; set; } + public int EventID { get; set; } + public int EventTypeID { get; set; } + public int PhaseID { get; set; } + public double Magnitude { get; set; } + public double PerUnitMagnitude { get; set; } + + [FieldDataType(System.Data.DbType.DateTime2, Gemstone.Data.DatabaseType.SQLServer)] + public DateTime StartTime { get; set; } + + [FieldDataType(System.Data.DbType.DateTime2, Gemstone.Data.DatabaseType.SQLServer)] + public DateTime EndTime { get; set; } + + public double DurationSeconds { get; set; } + public double DurationCycles { get; set; } + public int StartIndex { get; set; } + public int EndIndex { get; set; } + public string UpdatedBy { get; set; } + } + + [TableName("DisturbanceView")] + public class DisturbanceView: Disturbance + { + public int MeterID { get; set; } + public int LineID { get; set; } + public int? SeverityCode { get; set; } + public string MeterName { get; set; } + public string PhaseName { get; set; } + } + + [TableName("DisturbanceView")] + public class DisturbancesForDay : DisturbanceView { } + + [TableName("DisturbanceView")] + public class DisturbancesForMeter : DisturbanceView { } +} \ No newline at end of file diff --git a/Libraries/openXDA.Model/Events/Event.cs b/Libraries/openXDA.Model/Events/Event.cs index 0b60dc4..992ad47 100644 --- a/Libraries/openXDA.Model/Events/Event.cs +++ b/Libraries/openXDA.Model/Events/Event.cs @@ -69,4 +69,23 @@ public class Event public string UpdatedBy { get; set; } } + + [TableName("EventView")] + public class EventView : Event + { + [PrimaryKey(true)] + public new int ID + { + get => base.ID; + set => base.ID = value; + } + + public string AssetName { get; set; } + + public string MeterName { get; set; } + + public string StationName { get; set; } + + public string EventTypeName { get; set; } + } } \ No newline at end of file diff --git a/Libraries/openXDA.Model/Events/EventStat.cs b/Libraries/openXDA.Model/Events/EventStat.cs new file mode 100644 index 0000000..6e004a3 --- /dev/null +++ b/Libraries/openXDA.Model/Events/EventStat.cs @@ -0,0 +1,57 @@ +//****************************************************************************************************** +// EventStat.cs - Gbtc +// +// Copyright © 2018, 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://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: +// ---------------------------------------------------------------------------------------------------- +// 11/07/2018 - Billy Ernest +// Generated original version of source code. +// +//****************************************************************************************************** + +using Gemstone.Data.Model; + +namespace openXDA.Model +{ + public class EventStat + { + [PrimaryKey(true)] + public int ID { get; set; } + public int EventID { get; set; } + public double? VPeak { get; set; } + public double? VAMax { get; set; } + public double? VBMax { get; set; } + public double? VCMax { get; set; } + public double? VABMax { get; set; } + public double? VBCMax { get; set; } + public double? VCAMax { get; set; } + public double? VAMin { get; set; } + public double? VBMin { get; set; } + public double? VCMin { get; set; } + public double? VABMin { get; set; } + public double? VBCMin { get; set; } + public double? VCAMin { get; set; } + public double? IPeak { get; set; } + public double? IAMax { get; set; } + public double? IBMax { get; set; } + public double? ICMax { get; set; } + public double? IA2t { get; set; } + public double? IB2t { get; set; } + public double? IC2t { get; set; } + public double? InitialMW { get; set; } + public double? FinalMW { get; set; } + public int? PQViewID { get; set; } + } +} diff --git a/Libraries/openXDA.Model/Events/Faults/Fault.cs b/Libraries/openXDA.Model/Events/Faults/Fault.cs new file mode 100644 index 0000000..dbf8b95 --- /dev/null +++ b/Libraries/openXDA.Model/Events/Faults/Fault.cs @@ -0,0 +1,137 @@ +//****************************************************************************************************** +// Fault.cs - Gbtc +// +// Copyright © 2017, 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://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: +// ---------------------------------------------------------------------------------------------------- +// 08/29/2017 - Billy Ernest +// Generated original version of source code. +// +//****************************************************************************************************** + +using System; +using Gemstone.Data.Model; + +namespace openXDA.Model +{ + [TableName("FaultSummary")] + public class Fault + { + [PrimaryKey(true)] + public int ID { get; set; } + + public int EventID { get; set; } + + public string Algorithm { get; set; } + + public int FaultNumber { get; set; } + + public int CalculationCycle { get; set; } + + public double Distance { get; set; } + + public int PathNumber { get; set; } + + public int LineSegmentID { get; set; } + + public double LineSegmentDistance { get; set; } + + public double CurrentMagnitude { get; set; } + + public double CurrentLag { get; set; } + + public double PrefaultCurrent { get; set; } + + public double PostfaultCurrent { get; set; } + + public double ReactanceRatio { get; set; } + + [FieldDataType(System.Data.DbType.DateTime2, Gemstone.Data.DatabaseType.SQLServer)] + public DateTime Inception { get; set; } + + public double DurationSeconds { get; set; } + + public double DurationCycles { get; set; } + + public string FaultType { get; set; } + + public bool IsSelectedAlgorithm { get; set; } + + public bool IsValid { get; set; } + + public bool IsSuppressed { get; set; } + } + + public class FaultSummary : Fault { } + + [TableName("FaultView")] + public class FaultView : Fault + { + public string MeterName { get; set; } + + public string ShortName { get; set; } + + public string LocationName { get; set; } + + public int MeterID { get; set; } + + public int LineID { get; set; } + + public string LineName { get; set; } + + public int Voltage { get; set; } + + public DateTime InceptionTime { get; set; } + + public double CurrentDistance { get; set; } + + public int RK { get; set; } + } + + [TableName("FaultView")] + public class FaultForMeter: FaultView { } + + public class FaultsDetailsByDate + { + public int thefaultid { get; set; } + + public string thesite { get; set; } + + public string locationname { get; set; } + + public int themeterid { get; set; } + + public int thelineid { get; set; } + + public int theeventid { get; set; } + + public string thelinename { get; set; } + + public int voltage { get; set; } + + public string theinceptiontime { get; set; } + + public string thefaulttype { get; set; } + + public double thecurrentdistance { get; set; } + + public int notecount { get; set; } + + public int rk { get; set; } + + [NonRecordField] + public string theeventtype { get; set; } + } +} \ No newline at end of file diff --git a/Libraries/openXDA.Model/Events/Faults/FaultCurve.cs b/Libraries/openXDA.Model/Events/Faults/FaultCurve.cs new file mode 100644 index 0000000..02268fa --- /dev/null +++ b/Libraries/openXDA.Model/Events/Faults/FaultCurve.cs @@ -0,0 +1,250 @@ +//****************************************************************************************************** +// FaultCurve.cs - Gbtc +// +// Copyright © 2017, 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://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: +// ---------------------------------------------------------------------------------------------------- +// 09/06/2017 - Stephen C. Wills +// Generated original version of source code. +// +//****************************************************************************************************** + +using System.ComponentModel.DataAnnotations; +using Gemstone; +using Gemstone.Data.Model; +using Ionic.Zlib; + +namespace openXDA.Model +{ + public class FaultCurve + { + [PrimaryKey(true)] + public int ID { get; set; } + + public int EventID { get; set; } + + public int PathNumber { get; set; } + + [StringLength(200)] + public string Algorithm { get; set; } + + public byte[] Data { get; set; } + + public byte[] AngleData { get; set; } + + #region [Private Class] + private class DataPoint + { + public DateTime Time; + public double Value; + } + + #endregion + + #region [Methods] + + public void Adjust(Ticks ticks) + { + // If the blob contains the GZip header, + // move from Legacy Compression to normal Compression + if (this.Data[0] == 0x1F && this.Data[1] == 0x8B) + { + this.Data = MigrateCompression(this.Data); + } + + // If the blob contains the GZip header, + // move from Legacy Compression to normal Compression + if (this.AngleData[0] == 0x1F && this.AngleData[1] == 0x8B) + { + this.AngleData = MigrateCompression(this.AngleData); + } + + this.Data = ChangeTS(this.Data, ticks); + this.AngleData = ChangeTS(this.AngleData, ticks); + + + } + + private static byte[] ChangeTS(byte[] data, Ticks ticks) + { + data[0] = 0x1F; + data[1] = 0x8B; + + byte[] uncompressedData = GZipStream.UncompressBuffer(data); + byte[] resultData = new byte[uncompressedData.Length]; + + uncompressedData.CopyTo(resultData,0); + + int offset = 0; + + int m_samples = LittleEndian.ToInt32(uncompressedData, offset); + offset += sizeof(int); + + int timeValues = LittleEndian.ToInt32(uncompressedData, offset); + + int startTS = offset; + + offset += sizeof(int); + + long currentValue = LittleEndian.ToInt64(uncompressedData, offset); + + DateTime startTime = new DateTime(currentValue); + startTime = startTime.AddTicks(ticks); + + LittleEndian.CopyBytes(startTime.Ticks, resultData, startTS); + + resultData = GZipStream.CompressBuffer(resultData); + resultData[0] = 0x44; + resultData[1] = 0x33; + return resultData; + } + + private static byte[] MigrateCompression(byte[] data) + { + byte[] uncompressedData; + int offset; + DateTime[] times; + List series; + int seriesID = 0; + + uncompressedData = GZipStream.UncompressBuffer(data); + offset = 0; + + int m_samples = LittleEndian.ToInt32(uncompressedData, offset); + offset += sizeof(int); + + times = new DateTime[m_samples]; + + for (int i = 0; i < m_samples; i++) + { + times[i] = new DateTime(LittleEndian.ToInt64(uncompressedData, offset)); + offset += sizeof(long); + } + + series = new List(); + + while (offset < uncompressedData.Length) + { + + seriesID = LittleEndian.ToInt32(uncompressedData, offset); + offset += sizeof(int); + + + for (int i = 0; i < m_samples; i++) + { + series.Add(new DataPoint() + { + Time = times[i], + Value = LittleEndian.ToDouble(uncompressedData, offset) + }); + + offset += sizeof(double); + } + } + + var timeSeries = series.Select(dataPoint => new { Time = dataPoint.Time.Ticks, Compressed = false }).ToList(); + + for (int i = 1; i < timeSeries.Count; i++) + { + long previousTimestamp = series[i - 1].Time.Ticks; + long timestamp = timeSeries[i].Time; + long diff = timestamp - previousTimestamp; + + if (diff >= 0 && diff <= ushort.MaxValue) + timeSeries[i] = new { Time = diff, Compressed = true }; + + + } + + int timeSeriesByteLength = timeSeries.Sum(obj => obj.Compressed ? sizeof(ushort) : sizeof(int) + sizeof(long)); + int dataSeriesByteLength = sizeof(int) + (2 * sizeof(double)) + (m_samples * sizeof(ushort)); + int totalByteLength = sizeof(int) + timeSeriesByteLength + dataSeriesByteLength; + + + byte[] result = new byte[totalByteLength]; + offset = 0; + + offset += LittleEndian.CopyBytes(m_samples, result, offset); + + List uncompressedIndexes = timeSeries + .Select((obj, Index) => new { obj.Compressed, Index }) + .Where(obj => !obj.Compressed) + .Select(obj => obj.Index) + .ToList(); + + for (int i = 0; i < uncompressedIndexes.Count; i++) + { + int index = uncompressedIndexes[i]; + int nextIndex = (i + 1 < uncompressedIndexes.Count) ? uncompressedIndexes[i + 1] : timeSeries.Count; + + offset += LittleEndian.CopyBytes(nextIndex - index, result, offset); + offset += LittleEndian.CopyBytes(timeSeries[index].Time, result, offset); + + for (int j = index + 1; j < nextIndex; j++) + offset += LittleEndian.CopyBytes((ushort)timeSeries[j].Time, result, offset); + } + + const ushort NaNValue = ushort.MaxValue; + const ushort MaxCompressedValue = ushort.MaxValue - 1; + double range = series.Select(item => item.Value).Max() - series.Select(item => item.Value).Min(); + double decompressionOffset = series.Select(item => item.Value).Min(); + double decompressionScale = range / MaxCompressedValue; + double compressionScale = (decompressionScale != 0.0D) ? 1.0D / decompressionScale : 0.0D; + + offset += LittleEndian.CopyBytes(seriesID, result, offset); + offset += LittleEndian.CopyBytes(decompressionOffset, result, offset); + offset += LittleEndian.CopyBytes(decompressionScale, result, offset); + + foreach (DataPoint dataPoint in series) + { + ushort compressedValue = (ushort)Math.Round((dataPoint.Value - decompressionOffset) * compressionScale); + + if (compressedValue == NaNValue) + compressedValue--; + + if (double.IsNaN(dataPoint.Value)) + compressedValue = NaNValue; + + offset += LittleEndian.CopyBytes(compressedValue, result, offset); + } + + byte[] returnArray = GZipStream.CompressBuffer(result); + returnArray[0] = 0x44; + returnArray[1] = 0x33; + + return returnArray; + + } + #endregion + } + + public class FaultCurveStatistic + { + [PrimaryKey(true)] + public int ID { get; set; } + + public int FaultCurveID { get; set; } + + public int FaultNumber { get; set; } + + public double Maximum { get; set; } + + public double Minimum { get; set; } + + public double Average { get; set; } + + public double StandardDeviation { get; set; } + } +} diff --git a/Libraries/openXDA.Model/Events/RelayPerformance.cs b/Libraries/openXDA.Model/Events/RelayPerformance.cs new file mode 100644 index 0000000..4950235 --- /dev/null +++ b/Libraries/openXDA.Model/Events/RelayPerformance.cs @@ -0,0 +1,63 @@ +//****************************************************************************************************** +// RelayPerformance.cs - Gbtc +// +// Copyright © 2019, 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://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: +// ---------------------------------------------------------------------------------------------------- +// 07/10/2019 - Christoph Lackner +// Generated original version of source code. +// 08/20/2021 - Christoph Lackner +// Added additional Trip Coil Curve points. +// +//****************************************************************************************************** + +using System.Data; +using Gemstone.Data; +using Gemstone.Data.Model; + +namespace openXDA.Model +{ + public class RelayPerformance + { + [PrimaryKey(true)] + public int ID { get; set; } + public int EventID { get; set; } + public int ChannelID { get; set; } + public double? Imax1 { get; set; } + public int? Tmax1 { get; set; } + public double? Imax2 { get; set; } + public int? TplungerLatch { get; set; } + public double IplungerLatch { get; set; } + public double? Idrop { get; set; } + public int? TiDrop { get; set; } + public int? Tend { get; set; } + + [FieldDataType(DbType.DateTime2, DatabaseType.SQLServer)] + public DateTime? TripInitiate { get; set; } + public int? TripTime { get; set; } + public int? PickupTime { get; set; } + public double? TripTimeCurrent { get; set;} + public double? PickupTimeCurrent { get; set; } + public double? TripCoilCondition { get; set; } + public int TripCoilConditionTime { get; set; } + public int? ExtinctionTimeA { get; set; } + public int? ExtinctionTimeB { get; set; } + public int? ExtinctionTimeC { get; set; } + public double? I2CA { get; set; } + public double? I2CB { get; set; } + public double? I2CC { get; set; } + + } +} diff --git a/Libraries/openXDA.Model/PQDigest/HomeScreenWidget.cs b/Libraries/openXDA.Model/PQDigest/HomeScreenWidget.cs new file mode 100644 index 0000000..ee82638 --- /dev/null +++ b/Libraries/openXDA.Model/PQDigest/HomeScreenWidget.cs @@ -0,0 +1,44 @@ +//****************************************************************************************************** +// HomeScreenWidget.cs - Gbtc +// +// Copyright © 2020, 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://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: +// ---------------------------------------------------------------------------------------------------- +// 08/10/2020 - C. Lackner +// Generated original version of source code. +// +//****************************************************************************************************** + +using Gemstone.Data.Model; + +namespace PQDigest.Model +{ + /// + /// Defines a widget used in PQDigest Home Screen + /// + [TableName("PQDigest.HomeScreenWidget"), UseEscapedName] + [PostRoles("Administrator")] + [DeleteRoles("Administrator")] + [PatchRoles("Administrator")] + public class HomeScreenWidget : Widget + { + #region [ Properties ] + + public int TimeFrame { get; set; } + + #endregion + } + +} \ No newline at end of file diff --git a/Libraries/openXDA.Model/PQDigest/Widget.cs b/Libraries/openXDA.Model/PQDigest/Widget.cs new file mode 100644 index 0000000..6042dea --- /dev/null +++ b/Libraries/openXDA.Model/PQDigest/Widget.cs @@ -0,0 +1,51 @@ +//****************************************************************************************************** +// Widget.cs - Gbtc +// +// Copyright © 2020, 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://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: +// ---------------------------------------------------------------------------------------------------- +// 08/10/2020 - C. Lackner +// Generated original version of source code. +// +//****************************************************************************************************** + +using Gemstone.Data.Model; + +namespace PQDigest.Model +{ + /// + /// Defines a widget used in PQDigest + /// + [TableName("PQDigest.EventViewWidget"), UseEscapedName] + [PostRoles("Administrator")] + [DeleteRoles("Administrator")] + [PatchRoles("Administrator")] + public class Widget + { + #region [ Properties ] + + [PrimaryKey(true)] + public int ID { get; set; } + + public string Name { get; set; } + + public string Setting { get; set; } + + public string Type { get; set; } + + #endregion + } + +} \ No newline at end of file diff --git a/Libraries/openXDA.Model/Settings/OpenSEESetting.cs b/Libraries/openXDA.Model/Settings/OpenSEESetting.cs new file mode 100644 index 0000000..a1e5adc --- /dev/null +++ b/Libraries/openXDA.Model/Settings/OpenSEESetting.cs @@ -0,0 +1,33 @@ +//****************************************************************************************************** +// OpenSEESetting.cs - Gbtc +// +// Copyright © 2017, 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://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/05/2026 - Gabriel Santos +// Generated original version of source code. +// +//****************************************************************************************************** + +using Gemstone.Data.Model; + +namespace openXDA.Model +{ + [TableName("OpenSEE.Setting"), UseEscapedName] + [PostRoles("Administrator")] + [DeleteRoles("Administrator")] + [PatchRoles("Administrator")] + public class OpenSEESetting : Setting { } +} \ No newline at end of file diff --git a/Libraries/openXDA.Model/Settings/PQDigestSetting.cs b/Libraries/openXDA.Model/Settings/PQDigestSetting.cs new file mode 100644 index 0000000..877bff8 --- /dev/null +++ b/Libraries/openXDA.Model/Settings/PQDigestSetting.cs @@ -0,0 +1,33 @@ +//****************************************************************************************************** +// PQDigestSetting.cs - Gbtc +// +// Copyright © 2017, 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://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: +// ---------------------------------------------------------------------------------------------------- +// 10/20/2025 - Gabriel Santos +// Generated original version of source code. +// +//****************************************************************************************************** + +using Gemstone.Data.Model; + +namespace openXDA.Model +{ + [TableName("PQDigest.Setting"), UseEscapedName] + [PostRoles("Administrator")] + [DeleteRoles("Administrator")] + [PatchRoles("Administrator")] + public class PQDigestSetting : Setting { } +} \ No newline at end of file diff --git a/Libraries/openXDA.Model/TransmissionElements/BreakerOperation.cs b/Libraries/openXDA.Model/TransmissionElements/BreakerOperation.cs new file mode 100644 index 0000000..3be64eb --- /dev/null +++ b/Libraries/openXDA.Model/TransmissionElements/BreakerOperation.cs @@ -0,0 +1,107 @@ +//****************************************************************************************************** +// BreakerOperation.cs - Gbtc +// +// Copyright © 2017, 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://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: +// ---------------------------------------------------------------------------------------------------- +// 08/29/2017 - Billy Ernest +// Generated original version of source code. +// +//****************************************************************************************************** + +using System.Data; +using Gemstone.Data; +using Gemstone.Data.Model; + +namespace openXDA.Model +{ + public class BreakerOperation + { + [PrimaryKey(true)] + public int ID { get; set; } + + public int EventID { get; set; } + + public int PhaseID { get; set; } + + public int BreakerOperationTypeID { get; set; } + + public string BreakerNumber { get; set; } + + [FieldDataType(DbType.DateTime2, DatabaseType.SQLServer)] + public DateTime TripCoilEnergized { get; set; } + + [FieldDataType(DbType.DateTime2, DatabaseType.SQLServer)] + public DateTime StatusBitSet { get; set; } + + public bool StatusBitChatter { get; set; } + + [FieldDataType(DbType.DateTime2, DatabaseType.SQLServer)] + public DateTime APhaseCleared { get; set; } + + [FieldDataType(DbType.DateTime2, DatabaseType.SQLServer)] + public DateTime BPhaseCleared { get; set; } + + [FieldDataType(DbType.DateTime2, DatabaseType.SQLServer)] + public DateTime CPhaseCleared { get; set; } + + public double BreakerTiming { get; set; } + + public double StatusTiming { get; set; } + + public double APhaseBreakerTiming { get; set; } + + public double BPhaseBreakerTiming { get; set; } + + public double CPhaseBreakerTiming { get; set; } + + public bool DcOffsetDetected { get; set; } + + public double BreakerSpeed { get; set; } + + public string UpdatedBy { get; set; } + } + + [TableName("BreakerOperation")] + public class BreakersForDay : BreakerOperation { } + + public class BreakerView + { + [PrimaryKey(true)] + public int ID { get; set; } + + public int MeterID { get; set; } + + public int EventID { get; set; } + + public string EventType { get; set; } + + public string Energized { get; set; } + + public int BreakerNumber { get; set; } + + public string LineName { get; set; } + + public string PhaseName { get; set; } + + public double Timing { get; set; } + + public int Speed { get; set; } + + public string OperationType { get; set; } + + public string UpdatedBy { get; set; } + } +} \ No newline at end of file diff --git a/Libraries/openXDA.Model/openXDA.Model.csproj b/Libraries/openXDA.Model/openXDA.Model.csproj index 2d9f682..68b24c0 100644 --- a/Libraries/openXDA.Model/openXDA.Model.csproj +++ b/Libraries/openXDA.Model/openXDA.Model.csproj @@ -7,9 +7,9 @@ - - - + + +