This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -0,0 +1,70 @@
using DTS.Common.Base.Classes;
using DTS.Common.Converters;
using System.ComponentModel;
namespace DTS.Common.Interface.TestSetups
{
[TypeConverter(typeof(EnumDescriptionTypeConverter))]
public enum Operations
{
[DescriptionResource("CalculatedChannel_Sum")]
SUM = 1,
[DescriptionResource("CalculatedChannel_Average")]
AVERAGE = 2,
[DescriptionResource("CalculatedChannel_IRTRACC3D_Thorax")]
IRTRACC3D = 3,
[DescriptionResource("CalculatedChannel_IRTRACC3D_Abdomen")]
IRTRACC3D_ABDOMEN = 4,
[DescriptionResource("CalculatedChannel_IRTRACC3D_LowerThorax")]
IRTRACC3D_LOWERTHORAX = 5,
[DescriptionResource("CalculatedChannel_Resultant")]
Resultant = 6,
[DescriptionResource("HIC")]
HIC = 7
}
/// <summary>
/// describes Calculated Channel record in the db
/// </summary>
public interface ICalculatedChannelRecord
{
string Name { get; set; }
string TestSetupName { get; set; }
/// <summary>
/// Database Id for record
/// </summary>
int Id { get; set; }
/// <summary>
/// operation to apply to input channels
/// </summary>
Operations Operation { get; set; }
/// <summary>
/// Single code (ISO or user) to associate with calculated channel
/// </summary>
string CalculatedValueCode { get; set; }
/// <summary>
/// CSV separated list of channel ids that are inputs for the calculation
/// </summary>
string [] InputChannelIds { get; set; }
/// <summary>
/// CFC to apply to input channels prior to calculation
/// </summary>
string CFCForInputChannels { get; set; }
/// <summary>
/// CFC to apply to output of calculation
/// </summary>
string ChannelFilterClassForOutput { get; set; }
/// <summary>
/// Database Id for test setup record
/// </summary>
int TestSetupId { get; set; }
/// <summary>
/// Whether channel can be viewed in realtime or not
/// </summary>
bool ViewInRealtime { get; set; }
/// <summary>
/// Clip length to apply to calculation if relevant
/// some calculations are a max over an clip for example
/// </summary>
int ClipLength { get; set; }
}
}

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,31 @@
namespace DTS.Common.Enums.SliceSimpleArm
{
public enum SSACommand
{
ConfigureDevice,
Diagnostics,
Arm,
StartRecord,
CheckForArmed,
Disarm,
Download,
SetLowPowerMode,
Trigger,
}
public enum SSAResponse
{
Unknown,
Status,
Pass,
Fail,
SystemNotArmed,
NoSensorsFound,
NoEIDsFound,
UnknownEIDFound,
NoDASConnected,
ExceptionThrown,
DiagnosticsFailedOffsetTolerance,
DiagnosticsFailedShuntCheck,
}
}

View File

@@ -0,0 +1,48 @@
using System;
using System.Globalization;
using System.IO;
using System.Windows.Data;
using DTS.Common.Classes.Groups;
namespace DTS.Common.Converters
{
/// <summary>
/// Converter which converts percentage to String.
/// </summary>
public class GroupImportErrorToStringConverter : IValueConverter
{
/// <summary>
///
/// </summary>
/// <param name="value">The decimal value to convert. This value can be a standard decimal value or a nullable decimal value.</param>
/// <param name="targetType">This parameter is not used.</param>
/// <param name="parameter">This parameter is not used.</param>
/// <param name="culture">The culture to use in the format operation.</param>
/// <returns>The value to be passed to the target dependency property.</returns>
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var error = value as GroupImportError;
if (null == error)
{
return string.Empty;
}
return error.ExtraInfo;
}
/// <summary>
/// Conversion back is not supported.
/// </summary>
/// <param name="value">A currency value.</param>
/// <param name="targetType">This parameter is not used.</param>
/// <param name="parameter">This parameter is not used.</param>
/// <param name="culture">This parameter is not used.</param>
/// <returns>The value to be passed to the source object.</returns>
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

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

View File

@@ -0,0 +1,194 @@
using DTS.Common.Base;
using DTS.Common.Interface.Graphs;
using System.ComponentModel.DataAnnotations;
using System.Data;
namespace DTS.Common.Classes.TestSetups
{
/// <summary>
/// Implementation of a graph record in the database
/// <inheritdoc cref="IGraphRecord"/>
/// </summary>
public class GraphRecord : BasePropertyChanged, IGraphRecord
{
private int _graphId;
/// <summary>
/// database key for graph
/// </summary>
public int GraphId
{
get => _graphId;
set => SetProperty(ref _graphId, value, "GraphId");
}
private int _testSetupId;
/// <summary>
/// test setup key for graph
/// </summary>
public int TestSetupId
{
get => _testSetupId;
set => SetProperty(ref _testSetupId, value, "TestSetupId");
}
private string _graphName;
/// <summary>
/// name of graph
/// </summary>
[MaxLength(50)]
public string GraphName
{
get => _graphName;
set => SetProperty(ref _graphName, value, "GraphName");
}
private string _graphDescription;
/// <summary>
/// description of graph
/// </summary>
[MaxLength(50)]
public string GraphDescription
{
get => _graphDescription;
set => SetProperty(ref _graphDescription, value, "GraphDescription");
}
private string _channelsString;
/// <summary>
/// all the channels in the graph
/// </summary>
[MaxLength(2048)]
public string ChannelsString
{
get => _channelsString;
set => SetProperty(ref _channelsString, value, "ChannelsString");
}
private bool _useDomainMin;
/// <summary>
/// whether to restrict domain axis to a min value
/// </summary>
public bool UseDomainMin
{
get => _useDomainMin;
set => SetProperty(ref _useDomainMin, value, "UseDomainMin");
}
private double _domainMin = double.MinValue;
/// <summary>
/// the minimum value to show on domain axis
/// (only valid when UseDomainMin is true)
/// </summary>
public double DomainMin
{
get => _domainMin;
set => SetProperty(ref _domainMin, value, "DomainMin");
}
private bool _useDomainMax;
/// <summary>
/// whether to restrict domain axis to a max value
/// </summary>
public bool UseDomainMax
{
get => _useDomainMax;
set => SetProperty(ref _useDomainMax, value, "UseDomainMax");
}
private double _domainMax = double.MaxValue;
/// <summary>
/// maximum value to show on domain axis
/// (only valid when UseDomainMax is true)
/// </summary>
public double DomainMax
{
get => _domainMax;
set => SetProperty(ref _domainMax, value, "DomainMax");
}
private bool _useRangeMin;
/// <summary>
/// whether to restrict range axis to a min value
/// </summary>
public bool UseRangeMin
{
get => _useRangeMin;
set => SetProperty(ref _useRangeMin, value, "UseRangeMin");
}
private double _rangeMin = double.MinValue;
/// <summary>
/// minimum value to show on range axis
/// (only valid when UseRangeMin is true)
/// </summary>
public double RangeMin
{
get => _rangeMin;
set => SetProperty(ref _rangeMin, value, "RangeMin");
}
private bool _useRangeMax;
/// <summary>
/// whether to restrict range axis to a max value
/// </summary>
public bool UseRangeMax
{
get => _useRangeMax;
set => SetProperty(ref _useRangeMax, value, "UseRangeMax");
}
private double _rangeMax = double.MaxValue;
/// <summary>
/// the maximum value to show on the range axis
/// (only valid when UseRangeMax is true)
/// </summary>
public double RangeMax
{
get => _rangeMax;
set => SetProperty(ref _rangeMax, value, "RangeMax");
}
private string _thresholdsString;
/// <summary>
/// any thresholds/lines to show on the graph
/// </summary>
[MaxLength(2048)]
public string ThresholdsString
{
get => _thresholdsString;
set => SetProperty(ref _thresholdsString, value, "ThresholdsString");
}
private bool _localOnly = false;
/// <summary>
/// whether to synchronize record with central db
/// [deprecated]
/// </summary>
public bool LocalOnly
{
get => _localOnly;
set => SetProperty(ref _localOnly, value, "LocalOnly");
}
public GraphRecord() { }
public GraphRecord(IGraphRecord copy)
{
DomainMax = copy.DomainMax;
DomainMin = copy.DomainMin;
ChannelsString = copy.ChannelsString;
ThresholdsString = copy.ThresholdsString;
GraphDescription = copy.GraphDescription;
GraphId = copy.GraphId;
GraphName = copy.GraphName;
RangeMax = copy.RangeMax;
RangeMin = copy.RangeMin;
TestSetupId = copy.TestSetupId;
UseDomainMax = copy.UseDomainMax;
UseDomainMin = copy.UseDomainMin;
UseRangeMax = copy.UseRangeMax;
UseRangeMin = copy.UseRangeMin;
}
public GraphRecord(IDataReader reader)
{
GraphId = Utility.GetInt(reader, "GraphId", -1);
TestSetupId = Utility.GetInt(reader, "TestSetupId", -1);
GraphName = Utility.GetString(reader,"GraphName");
GraphDescription = Utility.GetString(reader, "GraphDescription");
ChannelsString = Utility.GetString(reader, "Channels");
DomainMax = Utility.GetDouble(reader, "DomainMax", double.MaxValue);
DomainMin = Utility.GetDouble(reader, "DomainMin", double.MinValue);
RangeMax = Utility.GetDouble(reader, "RangeMax", double.MaxValue);
RangeMin = Utility.GetDouble(reader, "RangeMin", double.MinValue);
ThresholdsString = Utility.GetString(reader, "Thresholds");
UseDomainMax = Utility.GetBool(reader, "UseDomainMax");
UseDomainMin = Utility.GetBool(reader, "UseDomainMin");
UseRangeMax = Utility.GetBool(reader, "UseRangeMax");
UseRangeMin = Utility.GetBool(reader, "UseRangeMin");
}
}
}