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,72 @@
using System.Threading.Tasks;
// ReSharper disable CheckNamespace
namespace DTS.Common.Base
{
public interface IBaseViewModel : IBasePropertyChanged
{
/// <summary>
/// Gets, sets the IsMenuIncluded status.
/// </summary>
bool IsMenuIncluded { get; set; }
/// <summary>
/// Gets, sets the IsNavigationIncluded status.
/// </summary>
bool IsNavigationIncluded { get; set; }
/// <summary>
/// Gets the IsBusy status.
/// </summary>
bool IsBusy { get; set; }
/// <summary>
/// The Activated method.
/// </summary>
void Activated();
/// <summary>
/// Gets the IsDirty status.
/// </summary>
bool IsDirty { get; }
/// <summary>
/// The Cleanup method.
/// </summary>
void Cleanup();
/// <summary>
/// Starts the cleanup process asynchronously.
/// </summary>
Task CleanupAsync();
/// <summary>
/// The Initialize method.
/// </summary>
void Initialize();
/// <summary>
/// The Initialize method.
/// </summary>
/// <param name="parameter">The parameter to initialize the viewmodel.</param>
void Initialize(object parameter);
/// <summary>
/// The Initialize method.
/// </summary>
/// <param name="parameter">The parameter to initialize the viewmodel.</param>
/// <param name="model">Another parameter to initialize the viewmodel.</param>
void Initialize(object parameter, object model);
/// <summary>
/// Starts the initialization process asynchronously.
/// </summary>
Task InitializeAsync();
/// <summary>
/// Starts the initialization process asynchronously.
/// </summary>
/// <param name="parameter">The parameter to initialize the viewmodel.</param>
Task InitializeAsync(object parameter);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

View File

@@ -0,0 +1,18 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using DTS.Common.Base;
using DTS.Common.Interface.TestDefinition;
namespace DTS.Common.Interface
{
public interface ITestSummaryListViewModel : IBaseViewModel
{
/// <summary>
/// Gets the Shell View.
/// </summary>
ITestSummaryListView TestSummaryListView { get; }
ObservableCollection<ITestSummary> TestSummaryList { get; set; }
List<ITestSummary> SelectedTestSummaryList { get; set; }
void PublishSelectedTestSummaryList();
}
}

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.Any())
{
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 = Array.Find(segments, p => p.Contains(DTS.Common.Constants.EventNumber));
if (!string.IsNullOrWhiteSpace(segmentWithEvent))
{
var testSegments = segmentWithEvent.Split('_');
if (Array.Exists(testSegments, 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;
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 734 B

View File

@@ -0,0 +1,11 @@
using Prism.Events;
namespace DTS.Common.Events.TSRAIRGo
{
public class ClearIpAddressEvent : PubSubEvent<ClearIpAddressArg> { }
public class ClearIpAddressArg
{
public bool Clear { get; set; }
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -0,0 +1,7 @@
using DTS.Common.Base;
// ReSharper disable CheckNamespace
namespace DTS.Common.Interface
{
public interface IMainView : IBaseView { }
}