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,11 @@
using Prism.Events;
// ReSharper disable CheckNamespace
namespace DTS.Common.Events
{
/// <summary>
/// The Data Folder changed event.
/// </summary>
public class CursorsClearChangedEvent : PubSubEvent<bool> { }
}

View File

@@ -0,0 +1,22 @@
using System;
using System.Windows.Data;
namespace DTS.Common.Converters
{
public class BooleanToBorderThicknessConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if ((bool)value)
{
return 1;
}
return 2;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return null;
}
}
}

View File

@@ -0,0 +1,84 @@
using DTS.Common.Enums;
using DTS.Common.Interface.Sensors;
using DTS.Common.Interface.Tags;
using DTS.Common.Utilities.Logging;
using System;
using System.Data;
namespace DTS.Common.Classes.Sensors
{
public class ThermocouplerRecord : TagAwareBase, IThermocouplerRecord
{
public override TagTypes TagType => 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");
}
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 ThermocouplerRecord(ISensorData sd)
{
try
{
Id = sd.DatabaseId;
SerialNumber = sd.SerialNumber;
Broken = sd.Broken;
DoNotUse = sd.DoNotUse;
LastModified = sd.LastModified;
LastUpdatedBy = sd.LastUpdatedBy;
}
catch (Exception ex)
{
APILogger.Log("Failed to process: ", ex);
}
}
public ThermocouplerRecord(IDataReader reader)
{
try
{
Id = Utility.GetInt(reader, "Id");
SerialNumber = Utility.GetString(reader, "SerialNumber");
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,26 @@
using System;
using System.Windows.Data;
namespace DTS.Common.Converters
{
public class NonZeroToColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value != null && value.ToString() == "0")
{
return BrushesAndColors.BrushApplicationStatusPowerGreen;
}
if (value != null && value.ToString() == "---")
{
return BrushesAndColors.BrushApplicationStatusPowerClear;
}
return BrushesAndColors.BrushApplicationStatusPowerRed;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return null;
}
}
}