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,25 @@
using DTS.Common.Interface.Communication;
namespace DTS.Common.Enums.Communication
{
public static class CommunicationConstantsAndEnums
{
public enum CommunicationResult
{
ConnectOK,
ConnectFailed,
ConnectTimeout,
DisconnectOK,
DisconnectFailed,
DisconnectTimeout,
SendOK,
SendFailed,
SendTimeout,
ReceiveOK,
ReceiveFailed,
ReceiveTimeout,
Canceled
}
public delegate bool CommunicationCallback(ICommunicationReport report);
}
}

View File

@@ -0,0 +1,6 @@
using DTS.Common.Base;
namespace DTS.Common.Interface.Realtime
{
public interface IRealtimeChannelSelectView : IBaseView { }
}

View File

@@ -0,0 +1,6 @@
namespace DTS.Common.Interface.Sensors
{
public interface IZeroMethods
{
}
}

View File

@@ -0,0 +1,58 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;
namespace DTS.Common.Enums.TSRAIRGo
{
public class ArmStateMachineStates
{
public enum States
{
[Description("Checking Arm State")]
CheckingArmState,
[Description("Checking For DAS")]
CheckingForDAS,
[Description("Checking For Data")]
CheckingForData,
[Description("Clearing Flash")]
ClearingFlash,
[Description("Disarmed")]
Disarmed,
[Description("Downloading")]
Downloading,
[Description("Download cleaning up")]
DownloadCleaningUp,
[Description("Download finished")]
DownloadFinished,
[Description("Failed")]
Failed,
[Description("Faulted")]
Faulted,
[Description("Getting Event Info")]
GettingEventInfo,
[Description("Waiting for user")]
IDLE,
[Description("Post Test Processing")]
PostTestProcessing,
[Description("Preparing For Arming")]
PreparingForArming,
[Description("Ready For Download")]
ReadyForDownload,
[Description("Rearming")]
Rearming,
[Description("Recording")]
Recording,
[Description("Waiting For Interval")]
WaitingForInterval,
[Description("Waiting for schedule start")]
WaitingForSchedule,
[Description("Waiting For Trigger")]
WaitingForTrigger,
[Description("Streaming")]
Streaming,
}
}
}

View File

@@ -0,0 +1,20 @@
using DTS.Common.Base;
using Prism.Events;
// ReSharper disable CheckNamespace
namespace DTS.Common.Events
{
/// <summary>
/// The number of loaded Tests changed event.
/// </summary>
public class TestLoadedCountNotification : PubSubEvent<TestLoadedCountNotificationArg> { }
public class TestLoadedCountNotificationArg
{
public int LoadedCount { get; set; }
/// <summary>
/// 24417 start pulling apart viewer to allow reuse for PSD reports
/// </summary>
public IBaseViewModel ParentVM { get; set; }
}
}

View File

@@ -0,0 +1,16 @@
using DTS.Common.Base;
using Prism.Events;
namespace DTS.Common.Events
{
//A datafile was selected, but don't want to trip all of the DataFolderChangedEvent subscriptions
public class DataFileSelectedEvent : PubSubEvent<DataFileSelectionArg> { }
public class DataFileSelectionArg
{
public string File { get; set; }
/// <summary>
/// 24417 start pulling apart viewer to allow reuse for PSD reports
/// </summary>
public IBaseViewModel ParentVM { get; set; }
}
}

View File

@@ -0,0 +1,18 @@
using DTS.Common.Base;
using Prism.Events;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DTS.Common.Events
{
public class SaveReportToPDFRequestedEvent : PubSubEvent<SaveReportToPDFRequestedEventArgs> { }
public class SaveReportToPDFRequestedEventArgs
{
public string Directory { get; set; }
public IBaseViewModel ParentVM { get; set; }
}
}

View File

@@ -0,0 +1,201 @@
using DTS.Common.Base;
using DTS.Common.Enums.DASFactory;
using DTS.Common.Interface.DataRecorders;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data;
using System.Linq;
using System.Text;
namespace DTS.Common.Classes.Hardware
{
[Table("DAS")]
/// <summary>
/// Implementation of <seealso cref="IDASDBRecord"/>
/// <inheritdoc cref="IDASDBRecord"/>
/// </summary>
public class DASDBRecord : BasePropertyChanged, IDASDBRecord
{
public static DateTime INVALID_DATE => new DateTime(1970, 1, 1);
public DASDBRecord()
{
}
public DASDBRecord(IDASDBRecord copy)
{
CalDate = copy.CalDate;
Connection = copy.Connection;
Channels = copy.Channels;
FirmwareVersion = copy.FirmwareVersion;
LastModified = copy.LastModified;
LastModifiedBy = copy.LastModifiedBy;
LastUsed = copy.LastUsed;
LastUsedBy = copy.LastUsedBy;
LocalOnly = copy.LocalOnly;
MaxMemory = copy.MaxMemory;
MaxModules = copy.MaxModules;
MaxSampleRate = copy.MaxSampleRate;
MinSampleRate = copy.MinSampleRate;
Position = copy.Position;
IsReconfigurable = copy.IsReconfigurable;
IsModule = copy.IsModule;
IsProgrammable = copy.IsProgrammable;
ProtocolVersion = copy.ProtocolVersion;
SerialNumber = copy.SerialNumber;
DASType = copy.DASType;
DASId = copy.DASId;
var channelTypes = new int[copy.ChannelTypes.Length];
Array.Copy(copy.ChannelTypes, channelTypes, copy.ChannelTypes.Length);
ChannelTypes = channelTypes;
Version = copy.Version;
ParentDAS = copy.ParentDAS;
Port = copy.Port;
PositionOnChain = copy.PositionOnChain;
PositionOnDistributor = copy.PositionOnDistributor;
FirstUseDate = copy.FirstUseDate;
IsFirstUseValid = copy.IsFirstUseValid;
StandIn = copy.StandIn;
TestId = copy.TestId;
GroupId = copy.GroupId;
MaxAAFRate = copy.MaxAAFRate;
}
public DASDBRecord(IDataReader reader)
{
CalDate = Utility.GetDateTime(reader, "CalDate", DateTime.MinValue);
Connection = Utility.GetString(reader, "Connection", string.Empty);
Channels = Utility.GetInt(reader, "Channels", 0);
FirmwareVersion = Utility.GetString(reader, "FirmwareVersion", string.Empty);
LastModified = Utility.GetDateTime(reader, "LastModified", DateTime.MinValue);
LastModifiedBy = Utility.GetString(reader, "LastModifiedBy", string.Empty);
LastUsed = Utility.GetDateTime(reader, "LastUsed", DateTime.MinValue);
LastUsedBy = Utility.GetString(reader, "LastUsedBy", string.Empty);
LocalOnly = Utility.GetBool(reader, "LocalOnly", false);
MaxMemory = Utility.GetLong(reader, "MaxMemory", 0);
MaxModules = Utility.GetInt(reader, "MaxModules", 0);
MaxSampleRate = Utility.GetDouble(reader, "MaxSampleRate", 0);
MinSampleRate = Utility.GetDouble(reader, "MinSampleRate", 0);
Position = Utility.GetString(reader, "Position", string.Empty);
IsReconfigurable = Utility.GetBool(reader, "Reconfigurable", false);
IsModule = Utility.GetBool(reader, "IsModule", false);
IsProgrammable = Utility.GetBool(reader, "Reprogramable", false);
ProtocolVersion = Utility.GetInt(reader, "ProtocolVersion", 0);
SerialNumber = Utility.GetString(reader, "SerialNumber", string.Empty);
DASType = Utility.GetInt(reader, "Type", -1);
DASId = Utility.GetInt(reader, "DASId", -1);
var o = reader["ChannelTypes"];
if (null != o && !DBNull.Value.Equals(o))
{
var s = Utility.GetString(reader, "ChannelTypes", string.Empty);
var tokens = s.Split(new char[] { ',' });
var itemp = 0;
ChannelTypes = (from token in tokens where int.TryParse(token, out itemp) select itemp).ToArray();
}
Version = Utility.GetInt(reader, "Version", 0);
ParentDAS = Utility.GetString(reader, "ParentDAS", string.Empty);
Port = Utility.GetInt(reader, "Port", 0);
PositionOnChain = Utility.GetInt(reader, "PositionOnChain", 0);
PositionOnDistributor = Utility.GetInt(reader, "PositionOnDistributor", 0);
o = reader["FirstUseDate"];
if (DBNull.Value.Equals(o))
{
FirstUseDate = null;
IsFirstUseValid = false;
}
else
{
var dt = Convert.ToDateTime(o);
if (dt.Year.Equals(DFConstantsAndEnums.FIRST_USE_DATE_NOT_SET.Year))
{
FirstUseDate = null;
}
else
{
FirstUseDate = dt;
}
IsFirstUseValid = true;
}
StandIn = Utility.GetBool(reader, "StandIn", false);
TestId = Utility.GetNullableInt(reader, "TestId");
GroupId = Utility.GetNullableInt(reader, "GroupId");
MaxAAFRate = Utility.GetDouble(reader, "MaxAAFRate", double.NaN);
}
[Key]
[Column("DASId")]
public int DASId { get; set; }
[Required]
[StringLength(50)]
public string SerialNumber { get; set; }
public int DASType { get; set; }
public int MaxModules { get; set; }
public long MaxMemory { get; set; }
[Column(TypeName = "decimal(18, 0)")]
public double MaxSampleRate { get; set; }
[Column(TypeName = "decimal(18, 0)")]
public double MinSampleRate { get; set; }
[StringLength(50)]
public string FirmwareVersion { get; set; } = "";
[Column(TypeName = "datetime")]
public DateTime CalDate { get; set; } = INVALID_DATE;
public int ProtocolVersion { get; set; }
[Column(TypeName = "datetime")]
public DateTime LastModified { get; set; }
[StringLength(50)]
public string LastModifiedBy { get; set; } = "";
public int Version { get; set; }
public bool LocalOnly { get; set; }
[Column(TypeName = "datetime")]
public DateTime LastUsed { get; set; } = INVALID_DATE;
[StringLength(50)]
public string LastUsedBy { get; set; } = "";
[StringLength(50)]
public string Connection { get; set; } = "";
public int Channels { get; set; }
[Required]
[StringLength(50)]
public string Position { get; set; } = "";
[StringLength(255)]
public int[] ChannelTypes { get; set; } = new int[0];
public bool IsProgrammable { get; set; } = false;
public bool IsReconfigurable { get; set; } = false;
public bool IsModule { get; set; }
public int PositionOnDistributor { get; set; }
public int PositionOnChain { get; set; }
public int Port { get; set; }
[Column("ParentDAS")]
[StringLength(50)]
public string ParentDAS { get; set; } = "";
[Column(TypeName = "datetime")]
public DateTime? FirstUseDate { get; set; }
public int? TestId { get; set; }
public int? GroupId { get; set; }
public bool StandIn { get; set; }
[Column("MaxAAFRate", TypeName = "decimal(18, 0)")]
public double MaxAAFRate { get; set; }
/// <summary>
/// whether hardware supports and is using first use date
/// 15524 DAS "First Use Date"
/// </summary>
public bool IsFirstUseValid { get; set; } = false;
}
}