init
This commit is contained in:
106
Common/DTS.Common.Serialization/FilteredData.cs
Normal file
106
Common/DTS.Common.Serialization/FilteredData.cs
Normal file
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* FtssCsv.File.Writer.FilteredData.cs
|
||||
*
|
||||
* Copyright © 2009
|
||||
* Diversified Technical Systems, Inc.
|
||||
* All Rights Reserved
|
||||
*/
|
||||
|
||||
using System;
|
||||
using DTS.Common.Utilities;
|
||||
using DTS.Common.Utilities.DotNetProgrammingConstructs;
|
||||
|
||||
namespace DTS.Serialization
|
||||
{
|
||||
///
|
||||
/// <summary>
|
||||
/// A <see cref="string"/> description/filtered <see cref="double"/> data set pair.
|
||||
/// </summary>
|
||||
///
|
||||
public class FilteredData : Exceptional, IComparable<FilteredData>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initialize an instance of this class.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="filterDescription">
|
||||
/// The <see cref="string"/> description of the filter that has been applied to the attached data vector.
|
||||
/// </param>
|
||||
///
|
||||
/// <param name="filterFrequencyHz">
|
||||
/// The <see cref="double"/> frequency of the filter that has been applied to the attached data vector.
|
||||
/// </param>
|
||||
///
|
||||
/// <param name="data">
|
||||
/// An array of filtered <see cref="double"/> data.
|
||||
/// </param>
|
||||
///
|
||||
|
||||
public FilteredData(string filterDescription, double filterFrequencyHz, double[] data, int absoluteDisplayOrder)
|
||||
{
|
||||
try
|
||||
{
|
||||
FilterDescription = filterDescription;
|
||||
FilterFrequencyHz = filterFrequencyHz;
|
||||
Data = data;
|
||||
AbsoluteDisplayOrder = absoluteDisplayOrder;
|
||||
}
|
||||
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
throw new Exception("encountered problem constructing class " + GetType().FullName, ex);
|
||||
}
|
||||
}
|
||||
|
||||
public int CompareTo(FilteredData other)
|
||||
{
|
||||
return AbsoluteDisplayOrder.CompareTo(other.AbsoluteDisplayOrder);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get/set the filter description <see cref="string"/>.
|
||||
/// </summary>
|
||||
public string FilterDescription
|
||||
{
|
||||
get => _FilterDescription.Value;
|
||||
set => _FilterDescription.Value = value;
|
||||
}
|
||||
private readonly Property<string> _FilterDescription
|
||||
= new Property<string>(
|
||||
typeof(FilteredData).FullName + ".FilterDescription",
|
||||
null,
|
||||
false
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Get set the <see cref="double"/> filter frequency.
|
||||
/// </summary>
|
||||
public double FilterFrequencyHz
|
||||
{
|
||||
get => _FilterFrequencyHz.Value;
|
||||
set => _FilterFrequencyHz.Value = value;
|
||||
}
|
||||
private readonly Property<double> _FilterFrequencyHz
|
||||
= new Property<double>(
|
||||
typeof(FilteredData).FullName + ".FilterFrequencyHz",
|
||||
0.0,
|
||||
false
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Get/set the filtered data vector.
|
||||
/// </summary>
|
||||
public double[] Data
|
||||
{
|
||||
get => _Data.Value;
|
||||
set => _Data.Value = value;
|
||||
}
|
||||
private readonly Property<double[]> _Data
|
||||
= new Property<double[]>(
|
||||
typeof(FilteredData).FullName + ".Data",
|
||||
null,
|
||||
false
|
||||
);
|
||||
public int AbsoluteDisplayOrder { get; } = -1;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user