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,253 @@
/*
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
{
/// <summary>
/// Enumeration of all possible filters that may be applied to channel
/// data. These can be used as software filters in data review.
///
/// </summary>
public enum ChannelFilter
{
/// <summary>
/// no filter is applied
/// </summary>
[Description("UnfilteredZero")]
[CFCValue(0)]
[IsoDescription("0")]
[Enumerability(true)]
UnfilteredZero = -2,
/// <summary>
/// no filter is applied
/// </summary>
[Description("Unfiltered")]
[CFCValue(0)]
[IsoDescription("0")]
[Enumerability(true)]
Unfiltered = 0,
/// <summary>
/// filter at 17Hz (Channel Frequency Class)
/// </summary>
[Description("CFC 10")]
[CFCValue(10)]
[IsoDescription("Q")]
[Enumerability(true)]
Class10 = 17,
/// <summary>
/// filter at 100Hz (Channel Frequency Class)
/// 3 dB limit Frequncy
/// stop damping -30 dB
/// sample frequency > 600Hz
/// </summary>
[Description("CFC 60")]
[CFCValue(60)]
[IsoDescription("D")]
[Enumerability(true)]
Class60 = 100,
/// <summary>
/// filter at 300Hz (Channel Frequency Class)
/// 3 dB limit frequency
/// stop damping -30Db
/// sampling frequency > 1800Hz
/// </summary>
[Description("CFC 180")]
[CFCValue(180)]
[IsoDescription("C")]
[Enumerability(true)]
Class180 = 300,
/// <summary>
/// 3Db limit frequency 1000Hz (channel frequency class)
/// stop damping -40Db
/// sampling frequency > 6 khz
/// </summary>
[Description("CFC 600")]
[CFCValue(600)]
[IsoDescription("B")]
[Enumerability(true)]
Class600 = 1000,
/// <summary>
/// 3dB limit frequency 1650Hz
/// stop damping -40dB
/// sampling frequency > 10khz
/// </summary>
[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,
}
/// <summary>
/// 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.
/// </summary>
[AttributeUsage(AttributeTargets.Field)]
public class IsoDescriptionAttribute : Attribute
{
////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Get the <see cref="string"/> that ISO-describes whatever this attribute
/// is attached to.
/// </summary>
public string IsoDescription { get; }
////////////////////////////////////////////////////////////////////////////////
/// <inheritdoc />
/// <summary>
/// Initializes an instance of the IsoDescriptionAttribute class.
/// </summary>
/// <param name="isoDescription">
/// The <see cref="T:System.String" /> that ISO-describes whatever this attribute
/// is attached to.
/// </param>
public IsoDescriptionAttribute(string isoDescription)
{
IsoDescription = isoDescription;
}
}
/// <summary>
/// Tool for manipulating <see cref="ChannelFilter"/>-attached <see cref="IsoDescriptionAttribute"/>s.
/// </summary>
public class IsoDescriptionAttributeCoder
: AttributeCoder<ChannelFilter, IsoDescriptionAttribute, string>
{
/// <summary>
/// Initializes an instance of the IsoDescriptionAttributeCoder class.
/// </summary>
public IsoDescriptionAttributeCoder()
: base(attribute => attribute.IsoDescription, null)
{
}
}
/// <summary>
/// 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.
/// </summary>
///
[AttributeUsage(AttributeTargets.Field)]
public class EnumerabilityAttribute : Attribute
{
////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Get the <see cref="bool"/> that describes enumerability.
/// </summary>
public bool IsEnumerable { get; private set; }
////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Initializes an instance of the EnumerablilityAttribute class.
/// </summary>
///
/// <param name="isEnumerable">
/// The <see cref="bool"/> that describes the attached object's enumerability.
/// </param>
///
public EnumerabilityAttribute(bool isEnumerable)
{
IsEnumerable = isEnumerable;
}
}
/// <summary>
/// Tool for manipulating <see cref="ChannelFilter"/>-attached <see cref="EnumerabilityAttribute"/>s.
/// </summary>
public class EnumerabilityAttributeCoder
: AttributeCoder<ChannelFilter, EnumerabilityAttribute, bool>
{
/// <summary>
/// Initializes an instance of the EnumerabilityAttributeCoder class.
/// </summary>
public EnumerabilityAttributeCoder()
: base(attribute => attribute.IsEnumerable, null)
{
}
}
/// <summary>
/// Attribute for specifying the numeric value of the filter CFC.
/// </summary>
[AttributeUsage(AttributeTargets.Field)]
public class CFCValueAttribute : Attribute
{
////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Get the <see cref="double"/> value of the CFC this attribute is attached to.
/// </summary>
public double CFCValue => _cfcValue;
private readonly double _cfcValue;
////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Initializes an instance of the CFCValueAttribute class.
/// </summary>
///
/// <param name="cfcValue">
/// The <see cref="double"/> value of the CFC this attribute is attached to.
/// </param>
///
public CFCValueAttribute(double cfcValue)
{
_cfcValue = cfcValue;
}
}
/// <summary>
/// Tool for manipulating <see cref="ChannelFilter"/>-attached <see cref="CFCValueAttribute"/>s.
/// </summary>
public class CfcValueAttributeCoder
: AttributeCoder<ChannelFilter, CFCValueAttribute, double>
{
/// <summary>
/// Initializes an instance of the CfcValueAttributeCoder class.
/// </summary>
public CfcValueAttributeCoder()
: base(attribute => attribute.CFCValue, null)
{
}
}
}

View File

@@ -0,0 +1,101 @@
/*
* ExceptionalList.cs
*
* Copyright © 2009
* Diversified Technical Systems, Inc.
* All Rights Reserved
*/
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
namespace DTS.Common.Utilities
{
/// <summary>
/// A version of <see cref="T:List"/> that provides its own exception type.
/// </summary>
///
/// <typeparam name="T">
/// The type of object contained by this list.
/// </typeparam>
///
/// <remarks>
/// Sample usage:
/// public class A : ExceptionalList &lt;int&gt;
/// {
/// public void ScrewItUp( )
/// {
/// private bool error = true;
/// if ( error ) throw new A.Exception( "Class A-specific screwup." );
/// }
/// }
///
/// ...
///
/// try
/// {
/// A.ScrewItUp( );
/// B.ScrewItUp( );
/// C.ScrewItUp( );
/// }
/// catch ( A.Exception ex )
/// {
/// // Can pick A's exceptions out of a crowd, or not and just treat it
/// // polymorphically as a System.Exception.
/// }
/// </remarks>
///
[global::System.Serializable]
public class ExceptionalList<T> : List<T>
{
/// <summary>
/// Initialize an instance of the ExceptionalList class.
/// </summary>
public ExceptionalList()
: base()
{
}
/// <summary>
/// Initialize an instance of the ExceptionalList class.
/// </summary>
///
/// <param name="capacity">
/// The number of elements that the list can initially store.
/// </param>
///
public ExceptionalList(int capacity)
: base(capacity)
{
}
/// <summary>
/// Initialize an instance of the ExceptionalList class.
/// </summary>
///
/// <param name="collection">
/// The collection whose elements are copied to the new list.
/// </param>
///
public ExceptionalList(IEnumerable<T> collection)
: base(collection)
{
}
/// <summary>
/// A representation of the DerivedClass.Exception class.
/// </summary>
public class Exception : ApplicationException
{
public Exception() { }
public Exception(string msg) : base(msg) { }
public Exception(string msg, System.Exception innerEx) : base(msg, innerEx) { }
protected Exception(
System.Runtime.Serialization.SerializationInfo info,
System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
}
}
}