This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
namespace DTS.Common.Interface.Tags
{
/// <summary>
/// defines the interface tag aware classes must implement
/// </summary>
public interface ITagAware
{
void SetTags(string[] tagsText);
string[] GetTagsArray();
int[] GetTagIDs();
void RemoveTags(string[] tagsText);
bool ContainsAnyTag(int[] tags);
}
}

View File

@@ -0,0 +1,12 @@
using System.Collections.Generic;
using DTS.Common.Interface;
using Microsoft.Practices.Prism.Events;
// ReSharper disable CheckNamespace
namespace DTS.Common.Events
{
/// <summary>
/// The number of selected Graphs changed event.
/// </summary>
public class ChannelsModificationNotification : CompositePresentationEvent<List<ITestChannel>> { }
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@@ -0,0 +1,73 @@
using DTS.Common.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DTS.Common.Utils
{
//FB 29410 POCO class to be used as parameter for MinUnixTime method
public class TestModuleTimeStamp
{
public int TriggerTimestampSec { get; set; }
public int TriggerTimestampNanoSec { get; set; }
}
public static class TestUtils
{
// FB15333: Add PTP/RTC timestamp column for CSV exports
//FB 29410 refactor the orginal method to use IEnumerable<TestModuleTimeStamp> basemodules as input parameter to be able to use this method in different projects
public static Tuple<double, double> MinUnixTime(IEnumerable<TestModuleTimeStamp> basemodules)
{
if (null != basemodules && basemodules.Count() > 0)
{
var utcAverage = basemodules.Average(module => (double)(module.TriggerTimestampSec + module.TriggerTimestampNanoSec / Common.Constants.NANOS_PER_SECOND));
var utcStandardDeviation = basemodules.Select(module => (double)(module.TriggerTimestampSec + module.TriggerTimestampNanoSec / Common.Constants.NANOS_PER_SECOND)).StandardDeviation();
utcStandardDeviation = utcStandardDeviation > Common.Constants.TEN_MILLIS_IN_SEC ? Common.Constants.TEN_MILLIS_IN_SEC : utcStandardDeviation; // select min within standard dev or 10ms, whichever is smaller
var minUnixTime = new Tuple<double, double>(basemodules.First().TriggerTimestampSec, basemodules.First().TriggerTimestampNanoSec);
foreach (var module in basemodules)
{
var moduleTime = (double)(module.TriggerTimestampSec + module.TriggerTimestampNanoSec / Common.Constants.NANOS_PER_SECOND);
if (module.TriggerTimestampSec <= minUnixTime.Item1 && module.TriggerTimestampNanoSec < minUnixTime.Item2 &&
moduleTime > utcAverage - utcStandardDeviation)
{
minUnixTime = new Tuple<double, double>(module.TriggerTimestampSec, module.TriggerTimestampNanoSec);
}
}
return minUnixTime;
}
return null;
}
public static string ParseROISuffix(string test)
{
var testitems = new string[] { };
if (test.Length > 0 && (testitems = test.Split(":".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)).Length > 3)
{
return testitems.Last();
}
//FB 18312 Get the ROI of particular event
if (test.Length > 0)
{
var segments = test.Split(":".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
var segmentWithEvent = segments.FirstOrDefault(p => p.Contains(DTS.Common.Constants.EventNumber));
if (!string.IsNullOrWhiteSpace(segmentWithEvent))
{
var testSegments = segmentWithEvent.Split('_');
if (testSegments.Any(p => p.Contains(DTS.Common.Constants.EventNumber.Replace("_", ""))))
{
//found an roi suffix
if (!testSegments.Last().Contains(DTS.Common.Constants.EventNumber.Replace("_", "")))
{
return "_" + testSegments.Last();
}
}
}
}
return string.Empty;
}
}
}

View File

@@ -0,0 +1,63 @@
using DTS.Common.Interface.Tags;
using System.Data;
namespace DTS.Common.Classes.Tags
{
/// <summary>
/// describes a database record for a tag
/// <inheritdoc cref="ITag"/>
/// </summary>
/// <summary>
/// represents a single tag, which is composed of an ID and a string of text
/// we don't currently let you obsolete, delete, or edit tags, just add
/// </summary>
public class Tag : Base.BasePropertyChanged, ITag
{
public Tag(string tagText, int tagId)
{
ID = tagId;
Text = tagText;
IsObsolete = false;
}
public const int INVALID_ID = -1;
private int _id;
public int ID
{
get => _id;
set => SetProperty(ref _id, value, "ID");
}
private string _text = "";
public string Text
{
get => _text;
set => SetProperty(ref _text, value, "Text");
}
private bool _isObsolete = false;
public bool IsObsolete
{
get => _isObsolete;
set => SetProperty(ref _isObsolete, value, "IsObsolete");
}
public Tag(Tag copy)
{
ID = copy.ID;
Text = copy.Text;
IsObsolete = copy.IsObsolete;
}
public Tag(IDataReader reader)
{
ID = Utility.GetInt(reader, "TagId");
IsObsolete = Utility.GetBool(reader, "Obsolete");
Text = Utility.GetString(reader, "TagText");
}
public Tag() { }
public object Clone()
{
return new Tag(this);
}
}
}

View File

@@ -0,0 +1,30 @@
using System;
using System.ComponentModel;
using DTS.Common.Converters;
using DTS.Common.Utils;
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;
// ReSharper disable CheckNamespace
namespace DTS.Common.Enums.Viewer
{
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum YRangeScaleEnum
{
[Description("Auto Range")]
AutoRange = 0,
[Description("% Full Scale")]
FullScale = 1,
[Description("Fixed")]
Fixed = 2,
[Description("Manual")]
Manual = 3
}
public class YRangeScaleItemSource : IItemsSource
{
public ItemCollection GetValues()
{
return EnumUtil.GetValuesList<YRangeScaleEnum>();
}
}
}

View File

@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DTS.Common.Enums
{
/// <summary>
/// Specifies constants defining which information to display.
/// </summary>
public enum PopupWindowImage
{
// The popup window contains a symbol consisting of an exclamation point in a triangle with a yellow background.
Warning = 0,
// The popup window contains a symbol consisting of white X in a circle with a red background.
Error = 1,
// The popup window contains a symbol consisting of a question mark in a circle.
Question = 2,
// The popup window contains a symbol consisting of a lowercase letter i in a circle.
Information = 3
}
}

View File

@@ -0,0 +1,131 @@
using DTS.Common.Base.Classes;
using DTS.Common.Interface.TestMetaData;
using DTS.Common.Utilities.Logging;
using System;
using System.ComponentModel;
using System.Data;
using System.IO;
using System.Xml;
using System.Xml.Serialization;
namespace DTS.Common.Classes.TestEngineerDetails
{
public class TestEngineerDetailsDbRecord : Base.BasePropertyChanged, ITestEngineerDetailsDbRecord
{
private int _testEngineerId = -1;
[Browsable(false)]
[ReadOnly(true)]
public int TestEngineerId
{
get => _testEngineerId;
set => SetProperty(ref _testEngineerId, value, "TestEngineerId");
}
private string _name = "";
[Browsable(false)]
[ReadOnly(true)]
public string Name
{
get => _name;
set => SetProperty(ref _name, value, "Name");
}
private string _testEngineerName = "NOVALUE";
[DisplayResource("TestEngineerName")]
public string TestEngineerName
{
get => _testEngineerName;
set => SetProperty(ref _testEngineerName, value, "TestEngineerName");
}
private string _testEngineerPhone = "NOVALUE";
[DisplayResource("TestEngineerPhone")]
public string TestEngineerPhone
{
get => _testEngineerPhone;
set => SetProperty(ref _testEngineerPhone, value, "TestEngineerPhone");
}
private string _testEngineerFax = "NOVALUE";
[DisplayResource("TestEngineerFax")]
public string TestEngineerFax
{
get => _testEngineerFax;
set => SetProperty(ref _testEngineerFax, value, "TestEngineerFax");
}
private string _testEngineerEmail = "NOVALUE";
[DisplayResource("TestEngineerEmail")]
public string TestEngineerEmail
{
get => _testEngineerEmail;
set => SetProperty(ref _testEngineerEmail, value, "TestEngineerEmail");
}
private bool _localOnly = false;
[Browsable(false)]
[ReadOnly(true)]
public bool LocalOnly
{
get => _localOnly;
set => SetProperty(ref _localOnly, value, "LocalOnly");
}
private DateTime _lastModified = DateTime.MinValue;
[Browsable(false)]
[ReadOnly(true)]
public DateTime LastModified
{
get => _lastModified;
set => SetProperty(ref _lastModified, value, "LastModified");
}
private string _lastModifiedBy = "";
[Browsable(false)]
[ReadOnly(true)]
public string LastModifiedBy
{
get => _lastModifiedBy;
set => SetProperty(ref _lastModifiedBy, value, "LastModifiedBy");
}
private int _version = -1;
[Browsable(false)]
[ReadOnly(true)]
public int Version
{
get => _version;
set => SetProperty(ref _version, value, "Version");
}
public TestEngineerDetailsDbRecord(ITestEngineerDetailsDbRecord testEngineerDetailsDbRecord)
{
Name = testEngineerDetailsDbRecord.Name;
TestEngineerName = testEngineerDetailsDbRecord.TestEngineerName;
TestEngineerPhone = testEngineerDetailsDbRecord.TestEngineerPhone;
TestEngineerFax = testEngineerDetailsDbRecord.TestEngineerFax;
TestEngineerEmail = testEngineerDetailsDbRecord.TestEngineerEmail;
LastModified = testEngineerDetailsDbRecord.LastModified;
Version = testEngineerDetailsDbRecord.Version;
LastModifiedBy = testEngineerDetailsDbRecord.LastModifiedBy;
LocalOnly = testEngineerDetailsDbRecord.LocalOnly;
}
public TestEngineerDetailsDbRecord() { }
public TestEngineerDetailsDbRecord(IDataReader reader)
{
Name = Utility.GetString(reader, "Name");
TestEngineerName = Utility.GetString(reader, "TestEngineerName");
TestEngineerPhone = Utility.GetString(reader, "TestEngineerPhone");
TestEngineerFax = Utility.GetString(reader, "TestEngineerFax");
TestEngineerEmail = Utility.GetString(reader, "TestEngineerEmail");
LastModified = Utility.GetDateTime(reader, "LastModified", DateTime.MinValue);
Version = Utility.GetInt(reader, "Version");
LastModifiedBy = Utility.GetString(reader, "LastModifiedBy");
LocalOnly = Utility.GetBool(reader, "LocalOnly");
}
public bool IsInvalidBlank()
{
return string.IsNullOrWhiteSpace(Name);
}
}
}