Files
DP44/Common/DTS.Common/Classes/Groups/GroupGRPImportChannel.cs
2026-04-17 14:55:32 -04:00

86 lines
3.2 KiB
C#

using DTS.Common.Base;
namespace DTS.Common.Classes.Groups
{
// ReSharper disable once InconsistentNaming
/// <summary>
/// this class encapsulates a single channel or row in a TDC GRP file
/// </summary>
public class GroupGRPImportChannel : BasePropertyChanged
{
public const uint SerialNumberField = 0;
public const uint DisplayNameField = 1;
public const uint ISOCodeField = 2;
public const uint InvertField = 3;
public const uint CapacityField = 4;
public const uint InputModeField = 5;
public const uint DefaultValueField = 6;
public const uint ActiveValueField = 7;
public const uint FireModeField = 8;
public const uint DelayField = 9;
public const uint LimitDurationField = 10;
public const uint DurationField = 11;
public const uint CurrentField = 12;
public string SensorSerialNumber { get; set; }
public string DisplayName { get; set; }
public string ISOCode { get; set; }
public bool Invert { get; set; }
public double FullScale { get; set; }
public enum InputModes
{
na, //Not applicable. Used to denote a non-Digital Input channel
TLH, //TransitionLowToHigh (DigitalInput)
THL, //TransitionHighToLow (DigitalInput)
CCNO, //ContactClosureNormallyOpen(DigitalInput)
CCNC //ContactClosureNormallyClosed(DigitalInput)
}
public const InputModes DefaultInputMode = InputModes.CCNO;
public InputModes? InputMode { get; set; } = null;
public const double DefaultDefaultValue = 0.0;
public double? DefaultValue { get; set; } = null;
public const double DefaultActiveValue = 1.0;
public double? ActiveValue { get; set; } = null;
public enum FireModes
{
na, //Not applicable. Used to denote a non-Squib channel
CD, //CapacitorDischarge (Squib)
CC //ConstantCurrent (Squib)
}
public const FireModes DefaultFireMode = FireModes.CD;
public FireModes? FireMode { get; set; } = null;
public const double DefaultDelay = 0.00;
public double? Delay { get; set; } = null;
public const bool DefaultLimitDuration = true;
public bool? LimitDuration { get; set; } = null;
public const double DefaultDuration = 10.0;
public double? Duration { get; set; } = null;
public const double DefaultCurrent = 1.5;
public double? Current { get; set; } = null;
/// <summary>
/// error for the group, or null if there are no errors
/// an error at this level means the group can't be imported
/// </summary>
public GroupGRPImportError Error { get; set; } = null;
public GroupGRPImportGroup ParentGroup { get; set; }
public string GroupName => null == ParentGroup ? "---" : ParentGroup.GroupName;
/// <summary>
/// forces refresh for anything bound to GroupName
/// </summary>
public void GroupNameInvalidate()
{
OnPropertyChanged("GroupName");
}
}
}