init
This commit is contained in:
@@ -0,0 +1,515 @@
|
||||
/*
|
||||
* DTS.Slice.Control.Event.Module.Channel.SaeJ211Filter.cs
|
||||
*
|
||||
* Copyright © 2009
|
||||
* Diversified Technical Systems, Inc.
|
||||
* All Rights Reserved
|
||||
*/
|
||||
|
||||
using System;
|
||||
using DTS.Common.DAS.Concepts.DAS.Channel;
|
||||
using DTS.Common.Utilities;
|
||||
using DTS.Common.Utilities.DotNetProgrammingConstructs;
|
||||
using DTS.Common.Utilities.Logging;
|
||||
using DTS.Common.Utilities.SaeJ211;
|
||||
|
||||
namespace DTS.Slice.Control
|
||||
{
|
||||
public partial class Event
|
||||
{ // *** see DTS.Slice.Control.Event.cs ***
|
||||
public partial class Module
|
||||
{ // *** see DTS.Slice.Control.Event.Module.cs ***
|
||||
public partial class Channel
|
||||
{ // *** see DTS.Slice.Control.Event.Module.Channel.cs ***
|
||||
/// <summary>
|
||||
/// Base class for all SaeJ211-based event module channel filters. It is intended
|
||||
/// that fixed-filter-setting filters be derived from this class that will set their
|
||||
/// filter setting using the protected constructor.
|
||||
/// </summary>
|
||||
public class SaeJ211Filter
|
||||
: Filter
|
||||
{
|
||||
public SaeJ211Filter(SaeJ211Filter originalFilter)
|
||||
{
|
||||
OriginalType = originalFilter.OriginalType;
|
||||
_CutoffFrequencyHz.Value = originalFilter.CutoffFrequencyHz;
|
||||
}
|
||||
/// <summary>
|
||||
/// Initialize an instance of the DTS.Utility.SaeJ211Filter class.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="originalType">
|
||||
/// The <see cref="ChannelFilter"/> to be applied by this filter (ad hoc
|
||||
/// filters that correspond to CFC values will be converted to the CFC, hence the
|
||||
/// "original" qualification).
|
||||
/// </param>
|
||||
///
|
||||
public SaeJ211Filter(ChannelFilter originalType)
|
||||
{
|
||||
try
|
||||
{
|
||||
switch (OriginalType = originalType)
|
||||
{ //
|
||||
// Try to set the frequency value according to type. Note that we can't set to
|
||||
// "ad hoc" using this particular constructor as we don't know what frequency
|
||||
// should be associated with it.
|
||||
//
|
||||
case ChannelFilter.AdHoc:
|
||||
throw new Exception("cannot initialize SaeJ211 filter using only ChannelFilter of type " + OriginalType.ToString());
|
||||
|
||||
default:
|
||||
_CutoffFrequencyHz.Value = (double)originalType;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
throw new Exception("encountered problem constructing " + GetType().FullName, ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize an instance of the DTS.Utility.SaeJ211Filter class.
|
||||
/// </summary>
|
||||
///
|
||||
///<param name="adHocFrequency">
|
||||
///The <see cref="double"/> ad hoc frequency of this filter.
|
||||
/// </param>
|
||||
///
|
||||
public SaeJ211Filter(double cutoffFrequencyHz)
|
||||
{
|
||||
try
|
||||
{
|
||||
OriginalType = ChannelFilter.AdHoc;
|
||||
_CutoffFrequencyHz.Value = cutoffFrequencyHz;
|
||||
}
|
||||
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
throw new Exception("encountered problem constructing " + GetType().FullName, ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get <see cref="Boolean"/> value indicating whether or not this filter matches one of the
|
||||
/// specified CFC values.
|
||||
/// </summary>
|
||||
override public bool IsCfc
|
||||
{
|
||||
get
|
||||
{
|
||||
try
|
||||
{ //
|
||||
// If we're not unfiltered and we're not ad hoc, then we
|
||||
// must be CFC-compliant.
|
||||
//
|
||||
return Type != ChannelFilter.Unfiltered
|
||||
&& Type != ChannelFilter.AdHoc;
|
||||
}
|
||||
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
throw new Exception("encountered problem determining whether or not filter corresponds to a CFC value", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert the specified frequency into a ChannelFilter type.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="frequency">
|
||||
/// The <see cref="double"/> frequency to be converted.
|
||||
/// </param>
|
||||
///
|
||||
/// <returns>
|
||||
/// The best matching <see cref="ChannelFilter"/> type. A CFC match is preferred;
|
||||
/// if one does not exist, "ad hoc" will be selected (if frequency > 0).
|
||||
/// </returns>
|
||||
///
|
||||
private ChannelFilter ConvertFrequencyToChannelFilter(double frequency)
|
||||
{
|
||||
try
|
||||
{
|
||||
var matchingFilterType = ChannelFilter.Unfiltered;
|
||||
if (frequency > 0)
|
||||
{
|
||||
matchingFilterType = ChannelFilter.AdHoc;
|
||||
var cfcCoder = new CfcValueAttributeCoder();
|
||||
foreach (int filterValue in Enum.GetValues(typeof(ChannelFilter)))
|
||||
if (frequency == filterValue)
|
||||
matchingFilterType = (ChannelFilter)filterValue;
|
||||
}
|
||||
return matchingFilterType;
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
throw new Exception("encountered problem trying to match frequency to CRC value", ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the "best fitting" <see cref="ChannelFilter"/> value for this filter.
|
||||
/// </summary>
|
||||
override public ChannelFilter Type
|
||||
{
|
||||
get
|
||||
{
|
||||
try
|
||||
{
|
||||
var actualType = OriginalType;
|
||||
|
||||
switch (OriginalType)
|
||||
{
|
||||
case ChannelFilter.AdHoc:
|
||||
actualType = ConvertFrequencyToChannelFilter(CutoffFrequencyHz);
|
||||
break;
|
||||
|
||||
default:
|
||||
//
|
||||
// Don't waste time on stuff we don't need to convert.
|
||||
//
|
||||
actualType = OriginalType;
|
||||
break;
|
||||
}
|
||||
|
||||
return actualType;
|
||||
}
|
||||
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
throw new Exception("encountered problem determining filter type", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public char IsoDescription => new IsoDescriptionAttributeCoder().DecodeAttributeValue(OriginalType)[0];
|
||||
|
||||
/// <summary>
|
||||
/// Get the <see cref="double"/> cutoff frequency value.
|
||||
/// </summary>
|
||||
override public double CutoffFrequencyHz => _CutoffFrequencyHz.Value;
|
||||
|
||||
private readonly Property<double> _CutoffFrequencyHz
|
||||
= new Property<double>(
|
||||
typeof(SaeJ211Filter).Namespace + ".SaeJ211Filter.CutoffFrequencyHz",
|
||||
-1,
|
||||
true
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="ChannelFilter"/>ing done by this object.
|
||||
/// </summary>
|
||||
public ChannelFilter OriginalType
|
||||
{
|
||||
get => _OriginalType.Value;
|
||||
private set => _OriginalType.Value = value;
|
||||
}
|
||||
private readonly Property<ChannelFilter> _OriginalType
|
||||
= new Property<ChannelFilter>(
|
||||
typeof(SaeJ211Filter).Namespace + ".SaeJ211Filter.OriginalType",
|
||||
ChannelFilter.Unfiltered,
|
||||
false
|
||||
);
|
||||
|
||||
private const string CutoffFrequencyUnitString = "Hz";
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="string"/> name of this filter.
|
||||
/// </summary>
|
||||
public override string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
try
|
||||
{
|
||||
if (null == _Name)
|
||||
{
|
||||
var cult = new System.Globalization.CultureInfo("");
|
||||
_Name = ChannelFilter.AdHoc == Type
|
||||
? CutoffFrequencyHz.ToString(cult) + CutoffFrequencyUnitString
|
||||
: new DescriptionAttributeCoder<ChannelFilter>().DecodeAttributeValue(Type);
|
||||
}
|
||||
return _Name;
|
||||
}
|
||||
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
throw new Exception("encountered problem generating name string for " + GetType().FullName, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
private string _Name = null;
|
||||
|
||||
/// <summary>
|
||||
/// Apply this filter to the specified channel.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="channel">
|
||||
/// The <see cref="DTS.Slice.Control.Event.Module.Channel"/> to be filtered.
|
||||
/// </param>
|
||||
///
|
||||
/// <returns>
|
||||
/// The array of filtered <see cref="double"/> EU data.
|
||||
/// </returns>
|
||||
///
|
||||
public override double[] Apply
|
||||
(
|
||||
Channel channel,
|
||||
DataDisplayUnits displayUnits,
|
||||
bool bUseLegacyTDCSoftwareFilterAdjustment
|
||||
)
|
||||
{
|
||||
try
|
||||
{
|
||||
var filterUtility = new FilterUtility();
|
||||
filterUtility.Cfc = Type;
|
||||
filterUtility.AdHocFrequency = CutoffFrequencyHz;
|
||||
filterUtility.SampleRate = channel.ParentModule.SampleRateHz;
|
||||
|
||||
double[] data;
|
||||
switch (displayUnits)
|
||||
{
|
||||
case DataDisplayUnits.Adc:
|
||||
if (channel.UnfilteredData is Serialization.SliceRaw.File.PersistentChannel)
|
||||
{
|
||||
if (channel.UnfilteredData is ILargeDataAware)
|
||||
if (!(channel.UnfilteredData as ILargeDataAware).IsDataArraySized)
|
||||
throw new Serialization.SliceRaw.File.PersistentChannel.DataTooBigForArrayException("Data is too big to be viewed or filtered.");
|
||||
|
||||
using (var persistentUnfilteredData =
|
||||
channel.UnfilteredData as Serialization.SliceRaw.File.PersistentChannel)// ;
|
||||
{
|
||||
|
||||
var dataCount = persistentUnfilteredData.Count;
|
||||
data = new double[dataCount];
|
||||
for (var i = 0; i < dataCount; i++)
|
||||
data[i] = persistentUnfilteredData[(ulong) i];
|
||||
}
|
||||
//persistentUnfilteredData.Dispose();
|
||||
}
|
||||
else if (channel.UnfilteredData is Serialization.TDAS.File.PersistentChannel)
|
||||
{
|
||||
if (channel.UnfilteredData is ILargeDataAware)
|
||||
if (!(channel.UnfilteredData as ILargeDataAware).IsDataArraySized)
|
||||
throw new Serialization.TDAS.File.PersistentChannel.DataTooBigForArrayException("Data is too big to be viewed or filtered.");
|
||||
|
||||
using (var persistentUnfilteredData =
|
||||
channel.UnfilteredData as Serialization.TDAS.File.PersistentChannel)// ;
|
||||
{
|
||||
|
||||
var dataCount = persistentUnfilteredData.Count;
|
||||
data = new double[dataCount];
|
||||
for (var i = 0; i < dataCount; i++)
|
||||
data[i] = persistentUnfilteredData[(ulong)i];
|
||||
}
|
||||
//persistentUnfilteredData.Dispose();
|
||||
}
|
||||
|
||||
else data = channel.UnfilteredData.ConvertAll<double>(delegate(short datum) { return (double)datum; }).ToArray();
|
||||
break;
|
||||
|
||||
case DataDisplayUnits.Eu:
|
||||
data = channel.UnfilteredDataEu.ToArray();
|
||||
break;
|
||||
|
||||
case DataDisplayUnits.Mv:
|
||||
data = channel.UnfilteredDataMv.ToArray();
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new NotImplementedException("handling for display unit type \"" + displayUnits.ToString() + "\" has not been implemented");
|
||||
}
|
||||
|
||||
return filterUtility.ApplyFilter(data, new FilterUtility.InvalidDataDelegate(delegate()
|
||||
{
|
||||
var msg = string.Format("Invalid data in channel: {0}.", channel.ChannelDescriptionString);
|
||||
//var dr = System.Windows.Forms.MessageBox.Show(msg, "Warning", System.Windows.Forms.MessageBoxButtons.OK);
|
||||
APILogger.Log(msg);
|
||||
throw new Exception(msg);
|
||||
}), bUseLegacyTDCSoftwareFilterAdjustment);
|
||||
}
|
||||
|
||||
catch ( System.Exception ex )
|
||||
{
|
||||
throw new Exception( "encountered problem applying filter \"" + Name + "\" to channel", ex );
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Apply this filter to the specified channel.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="channel">
|
||||
/// The <see cref="DTS.Slice.Control.Event.Module.Channel"/> to be filtered.
|
||||
/// </param>
|
||||
/// <param name="bUseLegacyTDCSoftwareFilterAdjustment">
|
||||
/// controls whether filtered data is adjusted by one sample to match TDC behavior
|
||||
/// 8747
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// The array of filtered <see cref="double"/> EU data.
|
||||
/// </returns>
|
||||
public override double[] Apply
|
||||
(
|
||||
double [] data,
|
||||
double sampleRate,
|
||||
bool bUseLegacyTDCSoftwareFilterAdjustment
|
||||
)
|
||||
{
|
||||
try
|
||||
{
|
||||
var filterUtility = new FilterUtility();
|
||||
filterUtility.Cfc = Type;
|
||||
filterUtility.AdHocFrequency = CutoffFrequencyHz;
|
||||
filterUtility.SampleRate = sampleRate;
|
||||
|
||||
return filterUtility.ApplyFilter(data, new FilterUtility.InvalidDataDelegate(delegate()
|
||||
{
|
||||
var msg = string.Format("Invalid data in channel.");
|
||||
//var dr = System.Windows.Forms.MessageBox.Show(msg, "Warning", System.Windows.Forms.MessageBoxButtons.OK);
|
||||
APILogger.Log(msg);
|
||||
throw new Exception(msg);
|
||||
}), bUseLegacyTDCSoftwareFilterAdjustment);
|
||||
}
|
||||
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
throw new Exception("encountered problem applying filter \"" + Name + "\" to channel", ex);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Generate a string representation of this object.
|
||||
/// </summary>
|
||||
///
|
||||
/// <returns>
|
||||
/// A <see cref="string"/> representation of this object.
|
||||
/// </returns>
|
||||
///
|
||||
public override string ToString( )
|
||||
{
|
||||
try
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
|
||||
catch ( System.Exception ex )
|
||||
{
|
||||
throw new Exception( "encountered problem generating the string value for " + GetType( ).FullName, ex );
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generate a string representation of this object.
|
||||
/// </summary>
|
||||
///
|
||||
/// <returns>
|
||||
/// A <see cref="string"/> representation of this object.
|
||||
/// </returns>
|
||||
///
|
||||
public override string ToBaseString()
|
||||
{
|
||||
try
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
throw new Exception("encountered problem generating the string value for " + GetType().FullName, ex);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Determines whether this filter and the specified filter are the same.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="obj">
|
||||
/// The filter <see cref="object"/> to be compared with this one.
|
||||
/// </param>
|
||||
///
|
||||
/// <returns>
|
||||
/// <see cref="bool"/> true if the filters are the same, false otherwise.
|
||||
/// </returns>
|
||||
///
|
||||
public override bool Equals( object obj )
|
||||
{
|
||||
try
|
||||
{
|
||||
if (null == obj as SaeJ211Filter) { return false; }
|
||||
return Name.Equals( ( obj as SaeJ211Filter ).Name, StringComparison.OrdinalIgnoreCase );
|
||||
}
|
||||
|
||||
catch ( System.Exception ex )
|
||||
{
|
||||
throw new Exception(
|
||||
"encountered problem equality checking filter \""
|
||||
+ Name
|
||||
+ "\" with filter "
|
||||
+ ( null != obj && obj is SaeJ211Filter && null != ( obj as SaeJ211Filter ).Name ? "\"" + ( obj as SaeJ211Filter ).Name + "\"" : "<null>" ), ex );
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// provides an index for a given <see cref="DTS.Slice.Control.Event.Module.Channel.SaeJ211Filter"/>
|
||||
/// since we override Equals we should override get hashcode to ensure that any to objects considered
|
||||
/// "Equal" are also hashed to the same location, however the result index does not need to be unique
|
||||
/// between non equal objects.
|
||||
/// 6/10/2010 - dtm
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Name.ToLower().GetHashCode();
|
||||
}
|
||||
/// <summary>
|
||||
/// Create a filter from the specified string.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="serialization">
|
||||
/// The <see cref="string"/> representation of the filter to be instantiated.
|
||||
/// </param>
|
||||
///
|
||||
/// <returns>
|
||||
/// A <see cref="DTS.Slice.Control.Event.Module.Channel.Filter"/> equivalent of the
|
||||
/// specified string. Throws an exception if object could not be created.
|
||||
/// </returns>
|
||||
///
|
||||
static public Filter Parse( string serialization )
|
||||
{
|
||||
try
|
||||
{
|
||||
Filter filter = null;
|
||||
|
||||
if ( !string.IsNullOrEmpty( serialization ) )
|
||||
{
|
||||
if ( serialization.Contains( CutoffFrequencyUnitString ) )
|
||||
{
|
||||
var cult = new System.Globalization.CultureInfo("");
|
||||
filter = new DefaultSaeJ211Filter(double.Parse(serialization.Replace(CutoffFrequencyUnitString, ""), cult));
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
foreach ( ChannelFilter filterType in Enum.GetValues( typeof( ChannelFilter ) ) )
|
||||
{
|
||||
var coder = new DescriptionAttributeCoder<ChannelFilter>( );
|
||||
if ( coder.DecodeAttributeValue( filterType ).Equals( serialization, StringComparison.OrdinalIgnoreCase ) )
|
||||
filter = new DefaultSaeJ211Filter( filterType );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ( null != filter ? filter : new SaeJ211Filter( ChannelFilter.Unfiltered ) );
|
||||
}
|
||||
|
||||
catch ( System.Exception ex )
|
||||
{
|
||||
throw new Exception( "encountered problem parsing string " + ( null != serialization ? "\"" + serialization + "\"" : "<NULL>" ) + " into filter", ex );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,268 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using DTS.Utilities;
|
||||
using DTS.Utilities.DotNetProgrammingConstructs;
|
||||
|
||||
namespace DTS.Serialization
|
||||
{
|
||||
public partial class TestSetup : Exceptional
|
||||
{
|
||||
public partial class TestObject : Exceptional
|
||||
{
|
||||
public TestObject()
|
||||
{
|
||||
_BarrierHeight.Value = null;
|
||||
_BarrierWidth.Value = null;
|
||||
_ClassOfTestObject.Value = null;
|
||||
_CodeOfTestObject.Value = null;
|
||||
_Comment1.Value = null;
|
||||
_Comment2.Value = null;
|
||||
_Comment3.Value = null;
|
||||
_DriverPositionObject.Value = null;
|
||||
_ExcitationWarmupMS.Value = null;
|
||||
_ImpactSideTestObject.Value = null;
|
||||
_Location.Value = null;
|
||||
_MassOfTestObject.Value = null;
|
||||
_NameOfTestObject.Value = null;
|
||||
_NumberOfLoadCells.Value = null;
|
||||
_Offset.Value = null;
|
||||
_OriginX.Value = null;
|
||||
_OriginY.Value = null;
|
||||
_OriginZ.Value = null;
|
||||
_ReferenceSystem.Value = null;
|
||||
_RefNumberOfTestObject.Value = null;
|
||||
_SerialNumber.Value = null;
|
||||
_TargetSampleRate.Value = null;
|
||||
//_TypeOfTestObject.Value = null;
|
||||
_Velocity.Value = null;
|
||||
_Version.Value = "1.0.0.0";
|
||||
_YawAngle.Value = null;
|
||||
}
|
||||
|
||||
public string BarrierHeight
|
||||
{
|
||||
get { return _BarrierHeight.Value; }
|
||||
set { _BarrierHeight.Value = value; }
|
||||
}
|
||||
private Property<string> _BarrierHeight
|
||||
= new Property<string>(typeof(TestObject).Namespace + ".TestObject.BarrierHeight", "", false);
|
||||
|
||||
public string BarrierWidth
|
||||
{
|
||||
get { return _BarrierWidth.Value; }
|
||||
set { _BarrierWidth.Value = value; }
|
||||
}
|
||||
private Property<string> _BarrierWidth
|
||||
= new Property<string>(typeof(TestObject).Namespace + ".TestObject.BarrierWidth", "", false);
|
||||
|
||||
public List<TOChannel> Channels
|
||||
{
|
||||
get { return _Channels.Value; }
|
||||
set { _Channels.Value = value; }
|
||||
}
|
||||
private Property<List<TOChannel>> _Channels
|
||||
= new Property<List<TOChannel>>(typeof(TestObject).Namespace + "TestObject.Channels", new List<TOChannel>(), true);
|
||||
|
||||
public string ClassOfTestObject
|
||||
{
|
||||
get { return _ClassOfTestObject.Value; }
|
||||
set { _ClassOfTestObject.Value = value; }
|
||||
}
|
||||
private Property<string> _ClassOfTestObject
|
||||
= new Property<string>(typeof(TestObject).Namespace + ".TestObject.ClassOfTestObject", "", false);
|
||||
|
||||
public string CodeOfTestObject
|
||||
{
|
||||
get { return _CodeOfTestObject.Value; }
|
||||
set { _CodeOfTestObject.Value = value; }
|
||||
}
|
||||
private Property<string> _CodeOfTestObject
|
||||
= new Property<string>(typeof(TestObject).Namespace + ".TestObject.CodeOfTestObject", "", false);
|
||||
|
||||
public string Comment1
|
||||
{
|
||||
get { return _Comment1.Value; }
|
||||
set { _Comment1.Value = value; }
|
||||
}
|
||||
private Property<string> _Comment1
|
||||
= new Property<string>(typeof(TestObject).Namespace + ".TestObject.Comment1", "", false);
|
||||
|
||||
public string Comment2
|
||||
{
|
||||
get { return _Comment2.Value; }
|
||||
set { _Comment2.Value = value; }
|
||||
}
|
||||
private Property<string> _Comment2
|
||||
= new Property<string>(typeof(TestObject).Namespace + ".TestObject.Comment2", "", false);
|
||||
|
||||
public string Comment3
|
||||
{
|
||||
get { return _Comment3.Value; }
|
||||
set { _Comment3.Value = value; }
|
||||
}
|
||||
private Property<string> _Comment3
|
||||
= new Property<string>(typeof(TestObject).Namespace + ".TestObject.Comment3", "", false);
|
||||
|
||||
public List<DASHardware> DASHardwares
|
||||
{
|
||||
get { return _DASHardwares.Value; }
|
||||
set { _DASHardwares.Value = value; }
|
||||
}
|
||||
private Property<List<DASHardware>> _DASHardwares
|
||||
= new Property<List<DASHardware>>(typeof(TestObject).Namespace + "TestObject.DASHardwares", new List<DASHardware>(), true);
|
||||
|
||||
public string DriverPositionObject
|
||||
{
|
||||
get { return _DriverPositionObject.Value; }
|
||||
set { _DriverPositionObject.Value = value; }
|
||||
}
|
||||
private Property<string> _DriverPositionObject
|
||||
= new Property<string>(typeof(TestObject).Namespace + ".TestObject.DriverPositionObject", "", false);
|
||||
|
||||
public string ExcitationWarmupMS
|
||||
{
|
||||
get { return _ExcitationWarmupMS.Value; }
|
||||
set { _ExcitationWarmupMS.Value = value; }
|
||||
}
|
||||
private Property<string> _ExcitationWarmupMS
|
||||
= new Property<string>(typeof(TestObject).Namespace + ".TestObject.ExcitationWarmupMS", "", false);
|
||||
|
||||
public string ImpactSideTestObject
|
||||
{
|
||||
get { return _ImpactSideTestObject.Value; }
|
||||
set { _ImpactSideTestObject.Value = value; }
|
||||
}
|
||||
private Property<string> _ImpactSideTestObject
|
||||
= new Property<string>(typeof(TestObject).Namespace + ".TestObject.ImpactSideTestObject", "", false);
|
||||
|
||||
public string Location
|
||||
{
|
||||
get { return _Location.Value; }
|
||||
set { _Location.Value = value; }
|
||||
}
|
||||
private Property<string> _Location
|
||||
= new Property<string>(typeof(TestObject).Namespace + ".TestObject.Location", "", false);
|
||||
|
||||
public string MassOfTestObject
|
||||
{
|
||||
get { return _MassOfTestObject.Value; }
|
||||
set { _MassOfTestObject.Value = value; }
|
||||
}
|
||||
private Property<string> _MassOfTestObject
|
||||
= new Property<string>(typeof(TestObject).Namespace + ".TestObject.MassOfTestObject", "", false);
|
||||
|
||||
public string NameOfTestObject
|
||||
{
|
||||
get { return _NameOfTestObject.Value; }
|
||||
set { _NameOfTestObject.Value = value; }
|
||||
}
|
||||
private Property<string> _NameOfTestObject
|
||||
= new Property<string>(typeof(TestObject).Namespace + ".TestObject.NameOfTestObject", "", false);
|
||||
|
||||
public string NumberOfLoadCells
|
||||
{
|
||||
get { return _NumberOfLoadCells.Value; }
|
||||
set { _NumberOfLoadCells.Value = value; }
|
||||
}
|
||||
private Property<string> _NumberOfLoadCells
|
||||
= new Property<string>(typeof(TestObject).Namespace + ".TestObject.NumberOfLoadCells", "", false);
|
||||
|
||||
public string Offset
|
||||
{
|
||||
get { return _Offset.Value; }
|
||||
set { _Offset.Value = value; }
|
||||
}
|
||||
private Property<string> _Offset
|
||||
= new Property<string>(typeof(TestObject).Namespace + ".TestObject.Offset", "", false);
|
||||
|
||||
public string OriginX
|
||||
{
|
||||
get { return _OriginX.Value; }
|
||||
set { _OriginX.Value = value; }
|
||||
}
|
||||
private Property<string> _OriginX
|
||||
= new Property<string>(typeof(TestObject).Namespace + ".TestObject.OriginX", "", false);
|
||||
|
||||
public string OriginY
|
||||
{
|
||||
get { return _OriginY.Value; }
|
||||
set { _OriginY.Value = value; }
|
||||
}
|
||||
private Property<string> _OriginY
|
||||
= new Property<string>(typeof(TestObject).Namespace + ".TestObject.OriginY", "", false);
|
||||
|
||||
public string OriginZ
|
||||
{
|
||||
get { return _OriginZ.Value; }
|
||||
set { _OriginZ.Value = value; }
|
||||
}
|
||||
private Property<string> _OriginZ
|
||||
= new Property<string>(typeof(TestObject).Namespace + ".TestObject.OriginZ", "", false);
|
||||
|
||||
public string ReferenceSystem
|
||||
{
|
||||
get { return _ReferenceSystem.Value; }
|
||||
set { _ReferenceSystem.Value = value; }
|
||||
}
|
||||
private Property<string> _ReferenceSystem
|
||||
= new Property<string>(typeof(TestObject).Namespace + ".TestObject.ReferenceSystem", "", false);
|
||||
|
||||
public string RefNumberOfTestObject
|
||||
{
|
||||
get { return _RefNumberOfTestObject.Value; }
|
||||
set { _RefNumberOfTestObject.Value = value; }
|
||||
}
|
||||
private Property<string> _RefNumberOfTestObject
|
||||
= new Property<string>(typeof(TestObject).Namespace + ".TestObject.RefNumberOfTestObject", "", false);
|
||||
|
||||
public string SerialNumber
|
||||
{
|
||||
get { return _SerialNumber.Value; }
|
||||
set { _SerialNumber.Value = value; }
|
||||
}
|
||||
private Property<string> _SerialNumber
|
||||
= new Property<string>(typeof(TestObject).Namespace + ".TestObject.SerialNumber", "", false);
|
||||
|
||||
public string TargetSampleRate
|
||||
{
|
||||
get { return _TargetSampleRate.Value; }
|
||||
set { _TargetSampleRate.Value = value; }
|
||||
}
|
||||
private Property<string> _TargetSampleRate
|
||||
= new Property<string>(typeof(TestObject).Namespace + ".TestObject.TargetSampleRate", "", false);
|
||||
|
||||
//public string TypeOfTestObject
|
||||
//{
|
||||
// get { return _TypeOfTestObject.Value; }
|
||||
// set { _TypeOfTestObject.Value = value; }
|
||||
//}
|
||||
//private Property<string> _TypeOfTestObject
|
||||
// = new Property<string>(typeof(TestObject).Namespace + ".TestObject.TypeOfTestObject", "", false);
|
||||
public string Velocity
|
||||
{
|
||||
get { return _Velocity.Value; }
|
||||
set { _Velocity.Value = value; }
|
||||
}
|
||||
private Property<string> _Velocity
|
||||
= new Property<string>(typeof(TestObject).Namespace + ".TestObject.Velocity", "", false);
|
||||
|
||||
public string Version
|
||||
{
|
||||
get { return _Version.Value; }
|
||||
set { _Version.Value = value; }
|
||||
}
|
||||
private Property<string> _Version
|
||||
= new Property<string>(typeof(TestObject).Namespace + ".TestObject.Version", "", false);
|
||||
|
||||
public string YawAngle
|
||||
{
|
||||
get { return _YawAngle.Value; }
|
||||
set { _YawAngle.Value = value; }
|
||||
}
|
||||
private Property<string> _YawAngle
|
||||
= new Property<string>(typeof(TestObject).Namespace + ".TestObject.YawAngle", "", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user