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,10 @@
using Prism.Events;
// ReSharper disable ClassNeverInstantiated.Global
// ReSharper disable CheckNamespace
namespace DTS.Common.Events
{
/// <summary>
/// The selected Test Summary list changed event.
/// </summary>
public class ChannelSelectionCountNotification : PubSubEvent<int> { }
}

View File

@@ -0,0 +1,180 @@
using DTS.Common.Base;
using DTS.Common.Enums;
using DTS.Common.Interface.Sensors;
using System;
using System.Data;
using System.Linq;
namespace DTS.Common.Classes.Sensors
{
public class DigitalOutDbRecord : BasePropertyChanged, IDigitalOutDbRecord
{
private string _serialNumber = "";
public string SerialNumber
{
get => _serialNumber;
set => SetProperty(ref _serialNumber, value, "SerialNumber");
}
private double _doDelay = 0D;
public double DODelay
{
get => _doDelay;
set => SetProperty(ref _doDelay, value, "DODelay");
}
private double _doDuration = 0D;
public double DODuration
{
get => _doDuration;
set => SetProperty(ref _doDuration, value, "DODuration");
}
private string _modifiedBy = "";
public string ModifiedBy
{
get => _modifiedBy;
set => SetProperty(ref _modifiedBy, value, "ModifiedBy");
}
private DateTime _lastModified = DateTime.MinValue;
public DateTime LastModified
{
get => _lastModified;
set => SetProperty(ref _lastModified, value, "LastModified");
}
private int _databaseId = -1;
public int DatabaseId
{
get => _databaseId;
set => SetProperty(ref _databaseId, value, "DatabaseId");
}
private string _isoCode = "";
public string ISOCode
{
get => _isoCode;
set => SetProperty(ref _isoCode, value, "ISOCode");
}
private string _isoChannelName = "";
public string ISOChannelName
{
get => _isoChannelName;
set => SetProperty(ref _isoChannelName, value, "ISOChannelName");
}
private string _userCode = "";
public string UserCode
{
get => _userCode;
set => SetProperty(ref _userCode, value, "UserCode");
}
private string _userChannelName = "";
public string UserChannelName
{
get => _userChannelName;
set => SetProperty(ref _userChannelName, value, "UserChannelName");
}
private bool _broken = false;
public bool Broken
{
get => _broken;
set => SetProperty(ref _broken, value, "Broken");
}
private bool _doNotUse = false;
public bool DoNotUse
{
get => _doNotUse;
set => SetProperty(ref _doNotUse, value, "DoNotUse");
}
private DigitalOutputModes _doMode = DigitalOutputModes.CCNC;
public DigitalOutputModes DOMode
{
get => _doMode;
set => SetProperty(ref _doMode, value, "DOMode");
}
private bool _limitDuration = true;
public bool LimitDuration
{
get => _limitDuration;
set => SetProperty(ref _limitDuration, value, "LimitDuration");
}
private int _version = 0;
public int Version
{
get => _version;
set => SetProperty(ref _version, value, "Version");
}
private byte[] _tagsBlobBytes = null;
public byte[] TagsBlobBytes
{
get => _tagsBlobBytes;
set => SetProperty(ref _tagsBlobBytes, value, "TagsBlobBytes");
}
public DigitalOutDbRecord()
{
}
public DigitalOutDbRecord(ISensorData copy, byte[] tagsBlobBytes)
{
SerialNumber = copy.SerialNumber;
DatabaseId = copy.DatabaseId;
Broken = copy.Broken;
DoNotUse = copy.DoNotUse;
Version = copy.Version;
DOMode = copy.DigitalOutputMode;
LimitDuration = copy.DigitalOutputLimitDuration;
ModifiedBy = copy.LastUpdatedBy;
LastModified = copy.LastModified;
DODuration = copy.DigitalOutputDurationMS;
DODelay = copy.DigitalOutputDelayMS;
if (null == tagsBlobBytes)
{
TagsBlobBytes = null;
}
else if (tagsBlobBytes.Any())
{
var bytes = new byte[tagsBlobBytes.Length];
Array.Copy(tagsBlobBytes, bytes, tagsBlobBytes.Length);
TagsBlobBytes = bytes;
}
else { TagsBlobBytes = new byte[0]; }
}
public DigitalOutDbRecord(IDigitalOutDbRecord copy)
{
SerialNumber = copy.SerialNumber;
DatabaseId = copy.DatabaseId;
Broken = copy.Broken;
DoNotUse = copy.DoNotUse;
Version = copy.Version;
DOMode = copy.DOMode;
LimitDuration = copy.LimitDuration;
ModifiedBy = copy.ModifiedBy;
LastModified = copy.LastModified;
DODuration = copy.DODuration;
DODelay = copy.DODelay;
if (null == copy.TagsBlobBytes)
{
TagsBlobBytes = null;
}
else if (copy.TagsBlobBytes.Any())
{
var tagsBlobBytes = new byte[copy.TagsBlobBytes.Length];
Array.Copy(copy.TagsBlobBytes, tagsBlobBytes, copy.TagsBlobBytes.Length);
TagsBlobBytes = tagsBlobBytes;
}
else { TagsBlobBytes = new byte[0]; }
}
public DigitalOutDbRecord(IDataReader reader)
{
DatabaseId = Utility.GetInt(reader, "Id", -1);
Broken = Utility.GetBool(reader, "Broken", false);
DoNotUse = Utility.GetBool(reader, "DoNotUse");
SerialNumber = Utility.GetString(reader, "SerialNumber");
Version = Utility.GetInt(reader, "Version");
DOMode = (DigitalOutputModes)Utility.GetInt(reader, "OutputMode");
LimitDuration = Utility.GetBool(reader, "LimitDuration", true);
ModifiedBy = Utility.GetString(reader, "LastModifiedBy", string.Empty);
LastModified = Utility.GetDateTime(reader, "LastModified", DateTime.MinValue);
DODuration = Utility.GetDouble(reader, "DurationMSFloat");
DODelay = Utility.GetDouble(reader, "DelayMS");
TagsBlobBytes = (byte[])reader["UserTags"];
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

View File

@@ -0,0 +1,24 @@
using System;
using System.Windows.Data;
using System.Windows.Media;
namespace DTS.Common.Converters
{
public class TriggerColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value is bool b)
{
if (b) { return BrushesAndColors.Brush_ApplicationStatus_Failed.Color; }
else { return BrushesAndColors.Brush_ApplicationStatus_Waiting.Color; }
}
return Brushes.Transparent.Color;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return null;
}
}
}

View File

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

View File

@@ -0,0 +1,41 @@
using DTS.Common.Converters;
using DTS.Common.Utils;
using System.ComponentModel;
namespace DTS.Common.Enums
{
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum UartBaudRate : uint
{
[Description("UartBaudRate_110")]
_110 = 110,
[Description("UartBaudRate_300")]
_300 = 300,
[Description("UartBaudRate_600")]
_600 = 600,
[Description("UartBaudRate_1200")]
_1200 = 1200,
[Description("UartBaudRate_2400")]
_2400 = 2400,
[Description("UartBaudRate_4800")]
_4800 = 4800,
[Description("UartBaudRate_9600")]
_9600 = 9600,
[Description("UartBaudRate_14400")]
_14400 = 14400,
[Description("UartBaudRate_19200")]
_19200 = 19200,
[Description("UartBaudRate_38400")]
_38400 = 38400,
[Description("UartBaudRate_57600")]
_57600 = 57600,
[Description("UartBaudRate_115200")]
_115200 = 115200,
[Description("UartBaudRate_230400")]
_230400 = 230400,
[Description("UartBaudRate_460800")]
_460800 = 460800,
[Description("UartBaudRate_921600")]
_921600 = 921600
}
}

View File

@@ -0,0 +1,12 @@
using DTS.Common.Base;
namespace DTS.Common.Interface
{
public interface IViewerViewModel : IBaseViewModel
{
/// <summary>
/// Gets the Tests View.
/// </summary>
IViewerView View { get; }
}
}