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,6 @@
using DTS.Common.Base;
namespace DTS.Common.Interface
{
public interface IDiagView : IBaseView { }
}

View File

@@ -0,0 +1,11 @@
using DTS.Common.Base;
namespace DTS.Common.Interface.GroupTemplate
{
public interface IGroupTemplateViewModel : IBaseViewModel
{
IGroupTemplateImportView ImportView { get; set; }
IGroupTemplateExportView ExportView { get; set; }
void Unset();
}
}

View File

@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
namespace DTS.Common.XMLUtils
{
public class ChannelXMLClass
{
public ChannelXMLClass()
{
Settings = new SettingsXMLClass();
}
public string ISOChannelName { get; set; }
public string ISOCode { get; set; }
public string UserChannelName { get; set; }
public string UserCode { get; set; }
public string Disabled { get; set; }
[XmlElement("Settings")]
public SettingsXMLClass Settings { get; set; }
public string SensorId { get; set; }
public string DASId { get; set; }
public string DASChannelIdx { get; set; }
public string TestSetupOrder { get; set; }
public string GroupOrder { get; set; }
}
}

View File

@@ -0,0 +1,6 @@
using DTS.Common.Base;
namespace DTS.Common.Interface.DASFactory.Diagnostics.HardwareList
{
public interface IHardwareListView : IBaseView { }
}

View File

@@ -0,0 +1,138 @@
using DTS.Common.Base;
using DTS.Common.Enums;
using DTS.Common.Interface.Sensors;
using DTS.Common.Interface.Tags;
using DTS.Common.Utilities.Logging;
using System;
using System.Data;
using System.IO.Ports;
namespace DTS.Common.Classes.Sensors
{
public class UARTRecord : TagAwareBase, IUARTRecord
{
public override TagTypes TagType { get => TagTypes.Sensors; }
private int _id;
public int Id
{
get => _id;
set => SetProperty(ref _id, value, "Id");
}
private string _serialNumber;
public string SerialNumber
{
get => _serialNumber;
set => SetProperty(ref _serialNumber, value, "SerialNumber");
}
public const uint UART_BAUDRATE_DEFAULT = 57600;
private uint _uartBaudRate = UART_BAUDRATE_DEFAULT;
public uint UartBaudRate
{
get => _uartBaudRate;
set => _uartBaudRate = value;
}
public const uint UART_DATABITS_DEFAULT = 8;
private uint _uartDataBits = UART_DATABITS_DEFAULT;
public uint UartDataBits
{
get => _uartDataBits;
set => SetProperty(ref _uartDataBits, value, "UartDataBits");
}
private StopBits _uartStopBits = StopBits.None;
public const StopBits UART_STOPBITS_DEFAULT = StopBits.None;
public StopBits UartStopBits
{
get => _uartStopBits;
set => _uartStopBits = value;
}
public const UartDataFormat UART_DATAFORMAT_DEFAULT = UartDataFormat.Binary;
public const Handshake UART_FLOWCONTROL_DEFAULT = Handshake.None;
protected Handshake _flowControl = Handshake.None;
public Handshake UartFlowControl
{
get => _flowControl;
set => SetProperty(ref _flowControl, value, "UartFlowControl");
}
private UartDataFormat _uartDataFormat = UART_DATAFORMAT_DEFAULT;
public UartDataFormat UartDataFormat
{
get => _uartDataFormat;
set => SetProperty(ref _uartDataFormat, value, "UartDataFormat");
}
private DateTime _lastModified;
public DateTime LastModified
{
get => _lastModified;
set => SetProperty(ref _lastModified, value, "LastModified");
}
private string _lastUpdatedBy;
public string LastUpdatedBy
{
get => _lastUpdatedBy;
set => SetProperty(ref _lastUpdatedBy, value, "LastUpdatedBy");
}
private bool _doNotUse;
public bool DoNotUse
{
get => _doNotUse;
set => SetProperty(ref _doNotUse, value, "DoNotUse");
}
private bool _broken;
public bool Broken
{
get => _broken;
set => SetProperty(ref _broken, value, "Broken");
}
public const Parity UART_PARITY_DEFAULT = Parity.None;
protected Parity _parity = Parity.None;
public Parity UartParity
{
get => _parity;
set => SetProperty(ref _parity, value, "UartParity");
}
public UARTRecord(ISensorData sensor)
{
Id = sensor.DatabaseId;
SerialNumber = sensor.SerialNumber;
UartBaudRate = sensor.UartBaudRate;
UartDataBits = sensor.UartDataBits;
UartStopBits = sensor.UartStopBits;
UartParity = sensor.UartParity;
UartFlowControl = sensor.UartFlowControl;
UartDataFormat = sensor.UartDataFormat;
Broken = sensor.Broken;
DoNotUse = sensor.DoNotUse;
LastModified = sensor.LastModified;
LastUpdatedBy = sensor.LastUpdatedBy;
}
public UARTRecord(IDataReader reader)
{
try
{
Id = Utility.GetInt(reader,"Id");
SerialNumber = Utility.GetString(reader, "SerialNumber");
UartBaudRate = Utility.GetUInt(reader, "BaudRate");
UartDataBits = Utility.GetUInt(reader, "DataBits");
UartStopBits = (StopBits)Enum.Parse(typeof(StopBits), Utility.GetString(reader, "StopBits"));
UartParity = (Parity)Enum.Parse(typeof(Parity), Utility.GetString(reader, "Parity"));
UartFlowControl = (Handshake)Enum.Parse(typeof(Handshake), Utility.GetString(reader, "FlowControl"));
UartDataFormat = (UartDataFormat)Enum.Parse(typeof(UartDataFormat), Utility.GetString(reader, "DataFormat"));
Broken = Utility.GetBool(reader, "Broken");
DoNotUse = Utility.GetBool(reader, "DoNotUse");
LastModified = Utility.GetDateTime(reader, "LastModified", DateTime.MinValue);
LastUpdatedBy = Utility.GetString(reader, "LastModifiedBy");
}
catch (Exception ex)
{
APILogger.Log("Failed to process: ", ex);
}
}
}
}

View File

@@ -0,0 +1,51 @@
using System;
using System.Windows;
using System.Windows.Media.Animation;
namespace DTS.Common.Controls
{
public class GridLengthAnimation : AnimationTimeline
{
public GridLengthAnimation()
{
// no-op
}
public GridLength From
{
get => (GridLength)GetValue(FromProperty);
set => SetValue(FromProperty, value);
}
public static readonly DependencyProperty FromProperty =
DependencyProperty.Register("From", typeof(GridLength), typeof(GridLengthAnimation));
public GridLength To
{
get => (GridLength)GetValue(ToProperty);
set => SetValue(ToProperty, value);
}
public static readonly DependencyProperty ToProperty =
DependencyProperty.Register("To", typeof(GridLength), typeof(GridLengthAnimation));
public override Type TargetPropertyType => typeof(GridLength);
protected override Freezable CreateInstanceCore()
{
return new GridLengthAnimation();
}
public override object GetCurrentValue(object defaultOriginValue, object defaultDestinationValue, AnimationClock animationClock)
{
var fromValue = From.Value;
var toValue = To.Value;
if (fromValue > toValue)
{
return new GridLength((1 - animationClock.CurrentProgress.Value) * (fromValue - toValue) + toValue, To.IsStar ? GridUnitType.Star : GridUnitType.Pixel);
}
return new GridLength(animationClock.CurrentProgress.Value * (toValue - fromValue) + fromValue, To.IsStar ? GridUnitType.Star : GridUnitType.Pixel);
}
}
}