using IRIGCh10;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace DTS.Serialization.IRIGCH10.TMATS.DataConversion
{
public enum MeasurandAttributes
{
[Description("MN1")]
[MaxLength(64)]
Description,
[Description("MNA")]
[MaxLength(32)]
MeasurementAlias,
[Description("MN2")]
[MaxLength(10)]
ExcitationVoltage,
[Description("MN3")]
[MaxLength(16)]
EngineeringUnits,
[Description("MN4")]
[MaxLength(3)]
LinkType
}
public enum SourceDataTypeLinks
{
[Description("ANA")]
FM,
[Description("PCM")]
PCM,
[Description("PAM")]
PAM,
[Description("OTH")]
Other
}
///
/// implements the measurand section of the tmats document
///
public class MeasurandSection : TMATSSection
{
public MeasurandSection(int number) : base(AttributeIdentifiers.DataConversionAttributes, number)
{
}
///
/// DESCRIBE THE PARAMETER BEING MEASURED.
///
public string Description
{
get => GetValue(MeasurandAttributes.Description);
set => SetValueWithLength(MeasurandAttributes.Description, value);
}
///
/// ALTERNATE MEASURAND NAME
///
public string MeasurementAlias
{
get => GetValue(MeasurandAttributes.MeasurementAlias);
set => SetValueWithLength( MeasurandAttributes.MeasurementAlias, value);
}
///
/// SENSOR REFERENCE VOLTAGE, IN VOLTS
///
public string ExcitationVoltage
{
get => GetValue(MeasurandAttributes.ExcitationVoltage);
set => SetValueWithLength(MeasurandAttributes.ExcitationVoltage, value);
}
///
/// DEFINE THE ENGINEERING UNITS APPLICABLE TO THE OUTPUT DATA.
///
public string EngineeringUnits
{
get => GetValue(MeasurandAttributes.EngineeringUnits);
set => SetValueWithLength(MeasurandAttributes.EngineeringUnits, value);
}
///
/// DEFINE THE SOURCE DATA LINK TYPE:
///
///
public void SetLinkType(SourceDataTypeLinks linkType)
{
SetValueWithLength(MeasurandAttributes.LinkType, DescriptionDecoder.GetDescription(linkType));
}
}
}