/*
ChannelFilter.cs
$Log: ChannelFilter.cs,v $
Revision 1.2 2007/04/20 17:46:32 Paul Hrissikopoulos
Added integration and differentiation to standard filter set.
Revision 1.1 2006/10/26 22:06:47 Paul Hrissikopoulos
Added channel data filtering.
Copyright © 2006
Diversified Technical Systems, Inc.
All Righst Reserved
*/
using System;
using System.ComponentModel;
namespace DTS.Common.Utilities
{
///
/// Enumeration of all possible filters that may be applied to channel
/// data. These can be used as software filters in data review.
///
///
public enum ChannelFilter
{
///
/// no filter is applied
///
[Description("UnfilteredZero")]
[CFCValue(0)]
[IsoDescription("0")]
[Enumerability(true)]
UnfilteredZero = -2,
///
/// no filter is applied
///
[Description("Unfiltered")]
[CFCValue(0)]
[IsoDescription("0")]
[Enumerability(true)]
Unfiltered = 0,
///
/// filter at 17Hz (Channel Frequency Class)
///
[Description("CFC 10")]
[CFCValue(10)]
[IsoDescription("Q")]
[Enumerability(true)]
Class10 = 17,
///
/// filter at 100Hz (Channel Frequency Class)
/// 3 dB limit Frequncy
/// stop damping -30 dB
/// sample frequency > 600Hz
///
[Description("CFC 60")]
[CFCValue(60)]
[IsoDescription("D")]
[Enumerability(true)]
Class60 = 100,
///
/// filter at 300Hz (Channel Frequency Class)
/// 3 dB limit frequency
/// stop damping -30Db
/// sampling frequency > 1800Hz
///
[Description("CFC 180")]
[CFCValue(180)]
[IsoDescription("C")]
[Enumerability(true)]
Class180 = 300,
///
/// 3Db limit frequency 1000Hz (channel frequency class)
/// stop damping -40Db
/// sampling frequency > 6 khz
///
[Description("CFC 600")]
[CFCValue(600)]
[IsoDescription("B")]
[Enumerability(true)]
Class600 = 1000,
///
/// 3dB limit frequency 1650Hz
/// stop damping -40dB
/// sampling frequency > 10khz
///
[Description("CFC 1000")]
[CFCValue(1000)]
[IsoDescription("A")]
[Enumerability(true)]
Class1000 = 1650,
[Description("Custom")]
[CFCValue(-1)]
//FB 13120 AdHoc ISO code is S
[IsoDescription("S")]
[Enumerability(false)]
AdHoc = -1
//[Description( "1st Integration")]
//[IsoDescription( "?" )]
//Integral = 2000,
//[Description( "1st Derivative")]
//[IsoDescription( "?" )]
//Derivative = 2001,
}
///
/// Attribute for specifying the ISO code fragment description of the attached
/// field's representation. Intended to be applied to enumerations that
/// represent ISO-codeable elements.
///
[AttributeUsage(AttributeTargets.Field)]
public class IsoDescriptionAttribute : Attribute
{
////////////////////////////////////////////////////////////////////////////////
///
/// Get the that ISO-describes whatever this attribute
/// is attached to.
///
public string IsoDescription { get; }
////////////////////////////////////////////////////////////////////////////////
///
///
/// Initializes an instance of the IsoDescriptionAttribute class.
///
///
/// The that ISO-describes whatever this attribute
/// is attached to.
///
public IsoDescriptionAttribute(string isoDescription)
{
IsoDescription = isoDescription;
}
}
///
/// Tool for manipulating -attached s.
///
public class IsoDescriptionAttributeCoder
: AttributeCoder
{
///
/// Initializes an instance of the IsoDescriptionAttributeCoder class.
///
public IsoDescriptionAttributeCoder()
: base(attribute => attribute.IsoDescription, null)
{
}
}
///
/// Attribute for specifying the "enumerability" of the attached
/// field's representation. Intended to be applied to enumerations that
/// contain valid, but special case elements that should never be automatically
/// enumerated.
///
///
[AttributeUsage(AttributeTargets.Field)]
public class EnumerabilityAttribute : Attribute
{
////////////////////////////////////////////////////////////////////////////////
///
/// Get the that describes enumerability.
///
public bool IsEnumerable { get; private set; }
////////////////////////////////////////////////////////////////////////////////
///
/// Initializes an instance of the EnumerablilityAttribute class.
///
///
///
/// The that describes the attached object's enumerability.
///
///
public EnumerabilityAttribute(bool isEnumerable)
{
IsEnumerable = isEnumerable;
}
}
///
/// Tool for manipulating -attached s.
///
public class EnumerabilityAttributeCoder
: AttributeCoder
{
///
/// Initializes an instance of the EnumerabilityAttributeCoder class.
///
public EnumerabilityAttributeCoder()
: base(attribute => attribute.IsEnumerable, null)
{
}
}
///
/// Attribute for specifying the numeric value of the filter CFC.
///
[AttributeUsage(AttributeTargets.Field)]
public class CFCValueAttribute : Attribute
{
////////////////////////////////////////////////////////////////////////////////
///
/// Get the value of the CFC this attribute is attached to.
///
public double CFCValue => _cfcValue;
private readonly double _cfcValue;
////////////////////////////////////////////////////////////////////////////////
///
/// Initializes an instance of the CFCValueAttribute class.
///
///
///
/// The value of the CFC this attribute is attached to.
///
///
public CFCValueAttribute(double cfcValue)
{
_cfcValue = cfcValue;
}
}
///
/// Tool for manipulating -attached s.
///
public class CfcValueAttributeCoder
: AttributeCoder
{
///
/// Initializes an instance of the CfcValueAttributeCoder class.
///
public CfcValueAttributeCoder()
: base(attribute => attribute.CFCValue, null)
{
}
}
}