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,27 @@
/*
* DTS.Slice.Control.Event.ChannelAccessor.cs
*
* Copyright © 2009
* Diversified Technical Systems, Inc.
* All Rights Reserved
*/
using DTS.Common.Utilities;
namespace DTS.Slice.Control
{
// *** see DTS.Slice.Control.Event.cs ***
public partial class Event
{
/// <summary>
/// A component object of the Event.DasModuleChannelAccessor.
/// </summary>
public class ChannelAccessor : ExceptionalDictionary<int, Module.Channel> // xxx change this int to DAS.(Module?).Channel.Id?
{
/// <summary>
/// Initialize an instance of the DTS.Slice.Control.Event.ChannelAccessor class.
/// </summary>
public ChannelAccessor() { }
}
}
}

View File

@@ -0,0 +1,26 @@
/*
* DTS.Slice.Control.Event.DasChannelAccessor.cs
*
* Copyright © 2009
* Diversified Technical Systems, Inc.
* All Rights Reserved
*/
using System.Collections.Generic;
using DTS.Common.Utilities;
namespace DTS.Slice.Control
{
// *** see DTS.Slice.Control.Event.cs ***
public partial class Event
{
/// <summary>
/// An object returned during Event creation that allows access to the event's channel
/// by DAS ID/DAS channel number pair.
/// </summary>
public class DasChannelAccessor : ExceptionalDictionary<Common.DAS.Concepts.DAS.Id, List<Module.Channel>>
{
public DasChannelAccessor() { }
}
}
}

View File

@@ -0,0 +1,26 @@
/*
* DTS.Slice.Control.Event.DasModuleAccessor.cs
*
* Copyright © 2009
* Diversified Technical Systems, Inc.
* All Rights Reserved
*/
using System.Collections.Generic;
using DTS.Common.Utilities;
namespace DTS.Slice.Control
{
// *** see DTS.Slice.Control.Event.cs ***
public partial class Event
{
/// <summary>
/// An object returned during Event creation that allows access to the event's module information
/// by DAS ID/DAS module number pair.
/// </summary>
public class DasModuleAccessor : ExceptionalDictionary<Common.DAS.Concepts.DAS.Id, List<Module>>
{
public DasModuleAccessor() { }
}
}
}

View File

@@ -0,0 +1,28 @@
/*
* DTS.Slice.Control.Event.DasModuleChannelAccessor.cs
*
* Copyright © 2009
* Diversified Technical Systems, Inc.
* All Rights Reserved
*/
using DTS.Common.Utilities;
namespace DTS.Slice.Control
{
// *** see DTS.Slice.Control.Event.cs ***
public partial class Event
{
/// <summary>
/// An object returned during Event creation that allows access to the event's channel information
/// by DAS ID/DAS module number/module channel number triplet.
/// </summary>
public class DasModuleChannelAccessor : ExceptionalDictionary<Common.DAS.Concepts.DAS.Id, ModuleChannelAccessor>
{
/// <summary>
/// Initialize an instance of the DTS.Slice.Control.Event.DasModuleChannelAccessor class.
/// </summary>
public DasModuleChannelAccessor() { }
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,59 @@
/*
* DTS.Slice.Control.Event.Module.AnalogInputChannel.ReviewableCfcAttribute.cs
*
* Copyright © 2009
* Diversified Technical Systems, Inc.
* All Rights Reserved
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTS.Utilities;
namespace DTS.Slice.Control
{
// *** see DTS.Slice.Control.Event.cs ***
public partial class Event
{
// *** see DTS.Slice.Control.Event.Module.cs ***
public partial class Module
{
// *** see DTS.Slice.Control.Event.Module.AnalogInputChannel.cs ***
public partial class AnalogInputChannel
{
/// <summary>
/// A reviewable CFC attribute attached to a specific channel.
/// </summary>
public class ReviewableCfcAttribute
: Slice.Control.Event.Module.Channel.ReviewableAttribute
{
/// <summary>
/// Initialize an instance of this class.
/// </summary>
///
/// <param name="channel">
/// The <see cref="Event.Module.Channel"/> to which this attribute is attached.
/// </param>
///
public ReviewableCfcAttribute(Event.Module.Channel channel)
: base("CFC",
delegate
{
//return ( new CfcValueAttributeCoder( ).DecodeAttributeValue( ( channel.CurrentFilter as SaeJ211Filter ).Type ) ).ToString( );
if (channel.CurrentFilter.Type == ChannelFilter.AdHoc) { return "N/A"; }
else { return (new CfcValueAttributeCoder().DecodeAttributeValue((channel.CurrentFilter as SaeJ211Filter).Type)).ToString(); }
}
)
{
}
}
} // *** end Channel ***
} // *** end Module ***
} // *** end Event ***
}

View File

@@ -0,0 +1,52 @@
/*
* DTS.Slice.Control.Event.Module.AnalogInputChannel.ReviewableCfcAttribute.cs
*
* Copyright © 2009
* Diversified Technical Systems, Inc.
* All Rights Reserved
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTS.Utilities;
namespace DTS.Slice.Control
{
// *** see DTS.Slice.Control.Event.cs ***
public partial class Event
{
// *** see DTS.Slice.Control.Event.Module.cs ***
public partial class Module
{
// *** see DTS.Slice.Control.Event.Module.AnalogInputChannel.cs ***
public partial class AnalogInputChannel
{
/// <summary>
/// A reviewable CFC attribute attached to a specific channel.
/// </summary>
public class ReviewableDescriptionAttribute
: Slice.Control.Event.Module.Channel.ReviewableAttribute
{
/// <summary>
/// Initialize an instance of this class.
/// </summary>
///
/// <param name="channel">
/// The <see cref="Event.Module.Channel"/> to which this attribute is attached.
/// </param>
///
public ReviewableDescriptionAttribute(Event.Module.Channel channel)
: base("Description", delegate { return channel.ChannelDescriptionString; })
{
}
}
} // *** end Channel ***
} // *** end Module ***
} // *** end Event ***
}

View File

@@ -0,0 +1,49 @@
/*
* DTS.Slice.Control.Event.Module.AnalogInputChannel.ReviewableFilterFrequencyAttribute.cs
*
* Copyright © 2009
* Diversified Technical Systems, Inc.
* All Rights Reserved
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTS.Utilities;
namespace DTS.Slice.Control
{
// *** see DTS.Slice.Control.Event.cs ***
public partial class Event {
// *** see DTS.Slice.Control.Event.Module.cs ***
public partial class Module {
// *** see DTS.Slice.Control.Event.Module.AnalogInputChannel.cs ***
public partial class AnalogInputChannel {
/// <summary>
/// A reviewable filter frequency attribute attached to a specific channel.
/// </summary>
public class ReviewableFilterFrequencyAttribute
: Slice.Control.Event.Module.Channel.ReviewableAttribute
{
/// <summary>
/// Initialize an instance of this class.
/// </summary>
///
/// <param name="channel">
/// The <see cref="Event.Module.Channel"/> to which this attribute is attached.
/// </param>
///
public ReviewableFilterFrequencyAttribute( Event.Module.Channel channel )
: base( "Filter Frequency", delegate { return ( ( int )( channel.CurrentFilter as SaeJ211Filter ).CutoffFrequencyHz ).ToString("N"); } )
{
}
}
} // *** end Channel ***
} // *** end Module ***
} // *** end Event ***
}

View File

@@ -0,0 +1,50 @@
/*
* DTS.Slice.Control.Event.Module.AnalogInputChannel.ReviewableIsoCodeAttribute.cs
*
* Copyright © 2009
* Diversified Technical Systems, Inc.
* All Rights Reserved
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DTS.Slice.Control
{
// *** see DTS.Slice.Control.Event.cs ***
public partial class Event
{
// *** see DTS.Slice.Control.Event.Module.cs ***
public partial class Module
{
// *** see DTS.Slice.Control.Event.Module.AnalogInputChannel.cs ***
public partial class AnalogInputChannel
{
/// <summary>
/// A reviewable serial number attribute attached to a specific channel.
/// </summary>
public class ReviewableIsoCodeAttribute
: Slice.Control.Event.Module.Channel.ReviewableAttribute
{
/// <summary>
/// Initialize an instance of this class.
/// </summary>
///
/// <param name="channel">
/// The <see cref="Event.Module.Channel"/> to which this attribute is attached.
/// </param>
///
public ReviewableIsoCodeAttribute(Event.Module.Channel channel)
: base("ISO Code", delegate { return (channel as AnalogInputChannel).IsoCode.ToString(); })
{
}
}
} // *** end Channel ***
} // *** end Module ***
} // *** end Event ***
}

View File

@@ -0,0 +1,70 @@
/*
* DTS.Slice.Control.Event.Module.AnalogInputChannel.ReviewableMeasuredShuntDeflectionAttribute.cs
*
* Copyright © 2009
* Diversified Technical Systems, Inc.
* All Rights Reserved
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DTS.Slice.Control
{
// *** see DTS.Slice.Control.Event.cs ***
public partial class Event
{
// *** see DTS.Slice.Control.Event.Module.cs ***
public partial class Module
{
// *** see DTS.Slice.Control.Event.Module.AnalogInputChannel.cs ***
public partial class AnalogInputChannel
{
/// <summary>
/// A reviewable measured shunt deflection attribute attached to a specific channel.
/// </summary>
public class ReviewableMeasuredShuntDeflectionAttribute
: Slice.Control.Event.Module.Channel.ReviewableAttribute
{
/// <summary>
/// Initialize an instance of this class.
/// </summary>
///
/// <param name="channel">
/// The <see cref="Event.Module.Channel"/> to which this attribute is attached.
/// </param>
///
public ReviewableMeasuredShuntDeflectionAttribute(Event.Module.Channel channel)
: base("Measured Shunt Deflection (mV)", delegate { return (channel as DTS.DAS.Concepts.DAS.Channel.IShuntAware).MeasuredShuntDeflectionMv.ToString("F1"); })
{
}
}
/// <summary>
/// A reviewable measured shunt deflection attribute attached to a specific channel.
/// </summary>
public class ReviewableMeasuredCalSignalAttribute
: Slice.Control.Event.Module.Channel.ReviewableAttribute
{
/// <summary>
/// Initialize an instance of this class.
/// </summary>
///
/// <param name="channel">
/// The <see cref="Event.Module.Channel"/> to which this attribute is attached.
/// </param>
///
public ReviewableMeasuredCalSignalAttribute(Event.Module.Channel channel)
: base("Measured Calibration Signal (mV)", delegate { return (channel as DTS.DAS.Concepts.DAS.Channel.ICalSignalAware).MeasuredCalSignalMv.ToString("F1"); })
{
}
}
} // *** end Channel ***
} // *** end Module ***
} // *** end Event ***
}

View File

@@ -0,0 +1,52 @@
/*
* DTS.Slice.Control.Event.Module.AnalogInputChannel.ReviewableMinMaxEuAttribute.cs
*
* Copyright © 2009
* Diversified Technical Systems, Inc.
* All Rights Reserved
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTS.Utilities;
namespace DTS.Slice.Control
{
// *** see DTS.Slice.Control.Event.cs ***
public partial class Event
{
// *** see DTS.Slice.Control.Event.Module.cs ***
public partial class Module
{
// *** see DTS.Slice.Control.Event.Module.AnalogInputChannel.cs ***
public partial class AnalogInputChannel
{
/// <summary>
/// A reviewable min/max EU attribute attached to a specific channel.
/// </summary>
public class ReviewableMinMaxEuAttribute
: Slice.Control.Event.Module.Channel.ReviewableAttribute
{
/// <summary>
/// Initialize an instance of this class.
/// </summary>
///
/// <param name="channel">
/// The <see cref="Event.Module.Channel"/> to which this attribute is attached.
/// </param>
///
public ReviewableMinMaxEuAttribute(Event.Module.Channel channel)
: base("Max/Min (EU)", delegate { return channel.DataMaxFilteredEu.ToString("F1") + "/" + channel.DataMinFilteredEu.ToString("F1"); })
{
}
}
} // *** end Channel ***
} // *** end Module ***
} // *** end Event ***
}

View File

@@ -0,0 +1,50 @@
/*
* DTS.Slice.Control.Event.Module.AnalogInputChannel.ReviewableSerialNumberAttribute.cs
*
* Copyright © 2009
* Diversified Technical Systems, Inc.
* All Rights Reserved
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DTS.Slice.Control
{
// *** see DTS.Slice.Control.Event.cs ***
public partial class Event
{
// *** see DTS.Slice.Control.Event.Module.cs ***
public partial class Module
{
// *** see DTS.Slice.Control.Event.Module.AnalogInputChannel.cs ***
public partial class AnalogInputChannel
{
/// <summary>
/// A reviewable serial number attribute attached to a specific channel.
/// </summary>
public class ReviewableSerialNumberAttribute
: Slice.Control.Event.Module.Channel.ReviewableAttribute
{
/// <summary>
/// Initialize an instance of this class.
/// </summary>
///
/// <param name="channel">
/// The <see cref="Event.Module.Channel"/> to which this attribute is attached.
/// </param>
///
public ReviewableSerialNumberAttribute(Event.Module.Channel channel)
: base("Serial Number", delegate { return (channel as AnalogInputChannel).SerialNumber.ToString(); })
{
}
}
} // *** end Channel ***
} // *** end Module ***
} // *** end Event ***
}

View File

@@ -0,0 +1,47 @@
/*
* DTS.Slice.Control.Event.Module.AnalogInputChannel.ReviewableShuntDeflectionAttribute.cs
*
* Copyright © 2009
* Diversified Technical Systems, Inc.
* All Rights Reserved
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DTS.Slice.Control
{
// *** see DTS.Slice.Control.Event.cs ***
public partial class Event {
// *** see DTS.Slice.Control.Event.Module.cs ***
public partial class Module {
// *** see DTS.Slice.Control.Event.Module.AnalogInputChannel.cs ***
public partial class AnalogInputChannel {
/// <summary>
/// A reviewable shunt deflection attribute attached to a specific channel.
/// </summary>
public class ReviewableShuntDeflectionAttribute
: Slice.Control.Event.Module.Channel.ReviewableAttribute
{
/// <summary>
/// Initialize an instance of this class.
/// </summary>
///
/// <param name="channel">
/// The <see cref="Event.Module.Channel"/> to which this attribute is attached.
/// </param>
///
public ReviewableShuntDeflectionAttribute( Event.Module.Channel channel )
: base( "Shunt Deflection (mV)", delegate { return ( channel as DTS.DAS.Concepts.DAS.Channel.IShuntAware ).MeasuredShuntDeflectionMv.ToString( "F1" ); } )
{
}
}
} // *** end Channel ***
} // *** end Module ***
} // *** end Event ***
}

View File

@@ -0,0 +1,69 @@
/*
* DTS.Slice.Control.Event.Module.AnalogInputChannel.ReviewableShuntDeflectionPercentageAttribute.cs
*
* Copyright © 2009
* Diversified Technical Systems, Inc.
* All Rights Reserved
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DTS.Slice.Control
{
// *** see DTS.Slice.Control.Event.cs ***
public partial class Event
{
// *** see DTS.Slice.Control.Event.Module.cs ***
public partial class Module
{
// *** see DTS.Slice.Control.Event.Module.AnalogInputChannel.cs ***
public partial class AnalogInputChannel
{
/// <summary>
/// A reviewable shunt deflection attribute attached to a specific channel.
/// </summary>
public class ReviewableShuntDeflectionPercentageAttribute
: Slice.Control.Event.Module.Channel.ReviewableAttribute
{
/// <summary>
/// Initialize an instance of this class.
/// </summary>
///
/// <param name="channel">
/// The <see cref="Event.Module.Channel"/> to which this attribute is attached.
/// </param>
///
public ReviewableShuntDeflectionPercentageAttribute(Event.Module.Channel channel)
: base("Shunt Error (%)", delegate { return (100.0 * ((channel as DTS.DAS.Concepts.DAS.Channel.IShuntAware).MeasuredShuntDeflectionMv - (channel as DTS.DAS.Concepts.DAS.Channel.IShuntAware).TargetShuntDeflectionMv) / (channel as DTS.DAS.Concepts.DAS.Channel.IShuntAware).TargetShuntDeflectionMv).ToString("F1"); })
{
}
}
/// <summary>
/// A reviewable shunt deflection attribute attached to a specific channel.
/// </summary>
public class ReviewableCalSignalPercentageAttribute
: Slice.Control.Event.Module.Channel.ReviewableAttribute
{
/// <summary>
/// Initialize an instance of this class.
/// </summary>
///
/// <param name="channel">
/// The <see cref="Event.Module.Channel"/> to which this attribute is attached.
/// </param>
///
public ReviewableCalSignalPercentageAttribute(Event.Module.Channel channel)
: base("Calibration Signal Error (%)", delegate { return (100.0 * ((channel as DTS.DAS.Concepts.DAS.Channel.ICalSignalAware).MeasuredCalSignalMv - (channel as DTS.DAS.Concepts.DAS.Channel.ICalSignalAware).TargetCalSignalMv) / (channel as DTS.DAS.Concepts.DAS.Channel.ICalSignalAware).TargetCalSignalMv).ToString("F1"); })
{
}
}
} // *** end Channel ***
} // *** end Module ***
} // *** end Event ***
}

View File

@@ -0,0 +1,69 @@
/*
* DTS.Slice.Control.Event.Module.AnalogInputChannel.ReviewableTargetShuntDeflectionAttribute.cs
*
* Copyright © 2009
* Diversified Technical Systems, Inc.
* All Rights Reserved
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DTS.Slice.Control
{
// *** see DTS.Slice.Control.Event.cs ***
public partial class Event
{
// *** see DTS.Slice.Control.Event.Module.cs ***
public partial class Module
{
// *** see DTS.Slice.Control.Event.Module.AnalogInputChannel.cs ***
public partial class AnalogInputChannel
{
/// <summary>
/// A reviewable target shunt deflection attribute attached to a specific channel.
/// </summary>
public class ReviewableTargetShuntDeflectionAttribute
: Slice.Control.Event.Module.Channel.ReviewableAttribute
{
/// <summary>
/// Initialize an instance of this class.
/// </summary>
///
/// <param name="channel">
/// The <see cref="Event.Module.Channel"/> to which this attribute is attached.
/// </param>
///
public ReviewableTargetShuntDeflectionAttribute(Event.Module.Channel channel)
: base("Target Shunt Deflection (mV)", delegate { return (channel as DTS.DAS.Concepts.DAS.Channel.IShuntAware).TargetShuntDeflectionMv.ToString("F1"); })
{
}
}
/// <summary>
/// A reviewable target shunt deflection attribute attached to a specific channel.
/// </summary>
public class ReviewableTargetCalSignalAttribute
: Slice.Control.Event.Module.Channel.ReviewableAttribute
{
/// <summary>
/// Initialize an instance of this class.
/// </summary>
///
/// <param name="channel">
/// The <see cref="Event.Module.Channel"/> to which this attribute is attached.
/// </param>
///
public ReviewableTargetCalSignalAttribute(Event.Module.Channel channel)
: base("Target Calibration Signal (mV)", delegate { return (channel as DTS.DAS.Concepts.DAS.Channel.ICalSignalAware).TargetCalSignalMv.ToString("F1"); })
{
}
}
} // *** end Channel ***
} // *** end Module ***
} // *** end Event ***
}

View File

@@ -0,0 +1,51 @@
/*
* DTS.Slice.Control.Event.Module.AnalogInputChannel.ReviewableUnitsAttribute.cs
*
* Copyright © 2009
* Diversified Technical Systems, Inc.
* All Rights Reserved
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DTS.Slice.Control
{
// *** see DTS.Slice.Control.Event.cs ***
public partial class Event
{
// *** see DTS.Slice.Control.Event.Module.cs ***
public partial class Module
{
// *** see DTS.Slice.Control.Event.Module.AnalogInputChannel.cs ***
public partial class AnalogInputChannel
{
/// <summary>
/// A reviewable engineering units attribute attached to a specific channel.
/// </summary>
public class ReviewableUnitsAttribute
: Slice.Control.Event.Module.Channel.ReviewableAttribute
{
/// <summary>
/// Initialize an instance of this class.
/// </summary>
///
/// <param name="channel">
/// The <see cref="Event.Module.Channel"/> to which this attribute is attached.
/// </param>
///
public ReviewableUnitsAttribute(Event.Module.Channel channel)
: base("Units", delegate { return (channel as DTS.DAS.Concepts.DAS.Channel.IEngineeringUnitAware).EngineeringUnits.ToString(); })
{
}
}
} // *** end Channel ***
} // *** end Module ***
} // *** end Event ***
}

View File

@@ -0,0 +1,418 @@
using System;
using System.Collections.Generic;
using System.Linq;
using DTS.Common.Interface.DASFactory.Diagnostics;
using DTS.Common.SerializationPlus;
using DTS.Common.Utilities;
namespace DTS.Slice.Control
{
// *** see DTS.Slice.Control.Event.cs ***
public partial class Event
{
// *** see DTS.Slice.Control.Event.Module.cs ***
public partial class Module
{
public partial class Channel
{
public abstract class CalculatedChannel : Channel, Common.DAS.Concepts.DAS.Channel.IEngineeringUnitAware
{
public enum Operation
{
Integral,
//DefiniteIntegral,
Derivative,
HeadInjuryCriteria,
FFT,
ImportedCSV,
Resultant,
TSR,
Scale,
Offset,
Sine,
Cosine,
}
private readonly Operation _operation;
public Operation CalculationType => _operation;
private readonly List<double> _x = new List<double>();
public double[] X => _x.ToArray();
private readonly List<double> _y = new List<double>();
public double[] Y => _y.ToArray();
private readonly XUnits _xAxis;
public XUnits XAxis => _xAxis;
public string XUnitsString
{
get
{
switch (_xAxis)
{
case XUnits.Hz: return "Hz";
case XUnits.msec: return "ms";
case XUnits.samples: return "samples";
case XUnits.sec: return "s";
default: return "N/A";
}
}
}
private string _yAxis;
public string EngineeringUnits
{
get => _yAxis;
set => _yAxis = value;
}
public override bool SupportsADC => false;
public override bool SupportsEU => true;
public override bool SupportsmV => false;
public override double ActualMaxRangeEu => _y.Max();
public override double ActualMaxRangeMv => throw new NotSupportedException();
public override double ActualMinRangeEu => _y.Min();
public override double ActualMinRangeMv => throw new NotImplementedException();
public override double DataHalfRangeValueEu => .5D * (_y.Min() + _y.Max());
public override double DataMaxEu => _y.Max();
public override double DataMinEu => _y.Min();
public override double DataRangeEu => (Math.Max(Math.Abs(_y.Min()), Math.Abs(_y.Max())));
public override short DataZeroLevelAdc => 0;
public override bool IsConfigured
{
get => true;
set => throw new NotSupportedException();
}
public override void FromDtsSerializationTestModuleChannel(Serialization.Test.Module.Channel that)
{
throw new NotSupportedException();
}
public override List<double> GetUnfilteredDataEu()
{
return new List<double>(_y);
}
/*
protected override void InitializeReviewableAttributes(List<ReviewableAttribute> reviewableAttributes)
{
switch (CalculationType)
{
case Operation.HeadInjuryCriteria:
break;
case Operation.ImportedCSV:
break;
case Operation.TSR:
break;
}
} */
public override void SetPropertyValuesFrom(DASLib.Service.DASChannel dasChannel)
{
throw new NotSupportedException();
}
public override void SetPropertyValuesFrom(IDiagnosticResult diagResults)
{
throw new NotSupportedException();
}
public override Serialization.Test.Module.Channel ToDtsSerializationTestModuleChannel(Serialization.Test.Module parentModule)
{
throw new NotSupportedException();
}
public override double SensorCapacityEU => throw new NotImplementedException();
public override List<double> GetUnfilteredDataMV()
{
throw new NotImplementedException();
}
public override double DesiredRangeEU => throw new NotImplementedException();
public enum XUnits
{
msec,
sec,
Hz,
samples
}
public CalculatedChannel(string name,
XUnits xAxis,
string yAxis,
double[] xValues,
double[] yValues,
Operation calcType,
int number,
Module parentModule
)
{
_x = new List<double>(xValues);
_y = new List<double>(yValues);
_xAxis = xAxis;
_yAxis = yAxis;
ChannelDescriptionString = name;
_operation = calcType;
Number = number;
CurrentFilter = new DefaultSaeJ211Filter(ChannelFilter.Unfiltered);
ParentModule = parentModule;
_UnfilteredDataEu = new List<double>(yValues);
DataCount = yValues.Length;
}
/// <summary>
/// Generate a <see cref="string"/> representation for this object.
/// </summary>
///
/// <returns>
/// The <see cref="string"/> representation of this object.
/// </returns>
///
public override string ToString()
{
try
{
return !string.IsNullOrEmpty(ChannelDescriptionString) ? ChannelDescriptionString : "N/A";
}
catch (System.Exception ex)
{
throw new Exception("encountered problem getting string representation", ex);
}
}
}
public class FFTCalculatedChannel : CalculatedChannel
{
private readonly double _peakFrequency;
public double PeakFrequency => _peakFrequency;
public FFTCalculatedChannel(string name,
XUnits xAxis,
string yAxis,
double[] xValues,
double[] yValues,
Operation calcType,
int number,
Module parentModule,
double peakFrequency)
: base(name, xAxis, yAxis, xValues, yValues, calcType, number, parentModule)
{
_peakFrequency = peakFrequency;
}
/*
protected override void InitializeReviewableAttributes(List<ReviewableAttribute> reviewableAttributes)
{
base.InitializeReviewableAttributes(reviewableAttributes);
//try { reviewableAttributes.Add(new ReviewablePeakFrequencyAttribute(this)); }
//catch { }
}
public class ReviewablePeakFrequencyAttribute : Slice.Control.Event.Module.Channel.ReviewableAttribute
{
public ReviewablePeakFrequencyAttribute(Event.Module.Channel channel)
: base("Peak (Hz)",
delegate { return (channel as FFTCalculatedChannel).PeakFrequency.ToString("N"); }) { }
}*/
}
public class IntegralCalculatedChannel : CalculatedChannel
{
public IntegralCalculatedChannel(string name,
XUnits xAxis,
string yAxis,
double[] xValues,
double[] yValues,
Operation calcType,
int number,
Module parentModule
)
: base(name, xAxis, yAxis, xValues, yValues, calcType, number, parentModule)
{ }
}
public class DerivativeCalculatedChannel : CalculatedChannel
{
public DerivativeCalculatedChannel(string name,
XUnits xAxis,
string yAxis,
double[] xValues,
double[] yValues,
Operation calcType,
int number,
Module parentModule
)
: base(name, xAxis, yAxis, xValues, yValues, calcType, number, parentModule)
{ }
}
public class ScaleCalculatedChannel : CalculatedChannel
{
public ScaleCalculatedChannel(string name,
XUnits xAxis,
string yAxis,
double[] xValues,
double[] yValues,
Operation calcType,
int number,
Module parentModule)
: base(name, xAxis, yAxis, xValues, yValues, calcType, number, parentModule)
{ }
}
public class OffsetCalculatedChannel : CalculatedChannel
{
public OffsetCalculatedChannel(string name,
XUnits xAxis,
string yAxis,
double[] xValues,
double[] yVAlues,
Operation calcType,
int number,
Module parentModule)
: base(name, xAxis, yAxis, xValues, yVAlues, calcType, number, parentModule)
{ }
}
public class ResultantCalculatedChannel : CalculatedChannel
{
public ResultantCalculatedChannel(string name,
XUnits xAxis,
string yAxis,
double[] xValues,
double[] yValues,
Operation calcType,
int number,
Module parentModule)
: base(name, xAxis, yAxis, xValues, yValues, calcType, number, parentModule)
{ }
}
public class AdditiveVectorCalculatedChannel : CalculatedChannel
{
public AdditiveVectorCalculatedChannel(string name,
XUnits xAxis,
string yAxis,
double[] xValues,
double[] yValues,
Operation calcType,
int number,
Module parentModule)
: base(name, xAxis, yAxis, xValues, yValues, calcType, number, parentModule)
{ }
}
public class SineCalculatedChannel : CalculatedChannel
{
public SineCalculatedChannel(string name,
XUnits xAxis,
string yAxis,
double[] xValues,
double[] yValues,
Operation calcType,
int number,
Module parentModule
)
: base(name, xAxis, yAxis, xValues, yValues, calcType, number, parentModule)
{ }
}
public class CosineCalculatedChannel : CalculatedChannel
{
public CosineCalculatedChannel(string name,
XUnits xAxis,
string yAxis,
double[] xValues,
double[] yValues,
Operation calcType,
int number,
Module parentModule
)
: base(name, xAxis, yAxis, xValues, yValues, calcType, number, parentModule)
{ }
}
/*
public class HICCalculatedChannel : CalculatedChannel
{
public double GetT1(bool ms)
{
double start = (double)HIC.StartSample - (double)ParentModule.TriggerSampleNumbers[0] +
(double)ParentModule.StartRecordSampleNumber;
start /= (double)ParentModule.SampleRateHz;
if (ms) { start *= 1000; }
return start;
}
public double GetT2(bool ms)
{
double end = (double)HIC.EndSample - (double)ParentModule.TriggerSampleNumbers[0]
+ (double)ParentModule.StartRecordSampleNumber;
end /= (double)ParentModule.SampleRateHz;
if (ms) { end *= 1000; }
return end;
}
public HICCalculatedChannel(string name,
XUnits xAxis,
string yAxis,
double[] xValues,
double[] yValues,
Operation calcType,
int number,
Module parentModule,
DTS.Calculations.HeadInjuryCriterion.HICResult hic
)
: base(name, xAxis, yAxis, xValues, yValues, calcType, number, parentModule)
{
_hic = hic;
}
private DTS.Calculations.HeadInjuryCriterion.HICResult _hic;
public DTS.Calculations.HeadInjuryCriterion.HICResult HIC { get { return _hic; } }
protected override void InitializeReviewableAttributes(List<ReviewableAttribute> reviewableAttributes)
{
base.InitializeReviewableAttributes(reviewableAttributes);
try { reviewableAttributes.Add(new ReviewableHICAttribute(this)); }
catch {}
try { reviewableAttributes.Add(new ReviewableHICLengthAttribute(this)); }
catch { }
try { reviewableAttributes.Add(new ReviewableHICT1T2Attribute(this)); }
catch { }
}
public class ReviewableHICLengthAttribute : Slice.Control.Event.Module.Channel.ReviewableAttribute
{
public ReviewableHICLengthAttribute(Event.Module.Channel channel)
: base("Clip Length",
delegate { return (channel as HICCalculatedChannel).HIC.HicLengthMS.ToString(); }) { }
}
public class ReviewableHICAttribute
: Slice.Control.Event.Module.Channel.ReviewableAttribute
{
/// <summary>
/// Initialize an instance of this class.
/// </summary>
///
/// <param name="channel">
/// The <see cref="Event.Module.Channel"/> to which this attribute is attached.
/// </param>
///
public ReviewableHICAttribute(Event.Module.Channel channel)
: base("HIC",
delegate { return (channel as HICCalculatedChannel).HIC.HIC.ToString("N1"); })
{
}
}
public class ReviewableHICT1T2Attribute
: Slice.Control.Event.Module.Channel.ReviewableAttribute
{
public ReviewableHICT1T2Attribute(Event.Module.Channel channel)
: base("T1/T2",
delegate
{
HICCalculatedChannel hic = channel as HICCalculatedChannel;
if (null == hic) { return ""; }
else { return string.Format("{0}s/{1}s", hic.GetT1(false), hic.GetT2(false)); }
})
{
}
}
}
* */
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,84 @@
/*
* DTS.Slice.Control.Event.Module.Channel.DataValues.cs
*
* Copyright © 2009
* Diversified Technical Systems, Inc.
* All Rights Reserved
*/
using DTS.Common.Utilities;
using DTS.Common.Utilities.DotNetProgrammingConstructs;
namespace DTS.Slice.Control
{
// *** see DTS.Slice.Control.Event.cs ***
public partial class Event
{
// *** see DTS.Slice.Control.Event.Module.cs ***
public partial class Module
{
// *** see DTS.Slice.Control.Event.Module.Channel.cs ***
public partial class Channel
{
/// <summary>
/// Representation of a channel's data.
/// </summary>
public class DataValues : Exceptional
{
/// <summary>
/// Initialize an instance of this class.
/// </summary>
public DataValues()
: this(true)
{
}
/// <summary>
/// Initialize an instance of this class.
/// </summary>
///
/// <param name="useMemoryMappedFile">
/// A <see cref="bool"/> determining whether or not this data class will use memory mapped files
/// to store data (necessary for data sets that exceed internal process memory limitations).
/// </param>
///
public DataValues(bool useMemoryMappedFile)
{
try
{
UseMemoryMappedFile = useMemoryMappedFile;
if (UseMemoryMappedFile)
{
}
}
catch (System.Exception ex)
{
throw new Exception("encountered problem constructing " + GetType().FullName, ex);
}
}
/// <summary>
/// Get/set the switch that will cause this class to use memory mapped files in lieu
/// of in-memory list.
/// </summary>
public bool UseMemoryMappedFile
{
get => _UseMemoryMappedFile.Value;
set => _UseMemoryMappedFile.Value = value;
}
private readonly Property<bool> _UseMemoryMappedFile =
new Property<bool>(
typeof(DataValues).Namespace + ".UseMemoryMappedFile",
false,
false
);
}
} // *** End Event.Module.Channel ***
} // *** End Event.Module ***
} // *** End Event ***
}

View File

@@ -0,0 +1,81 @@
/*
* DTS.Slice.Control.Event.Module.Channel.ReviewableAttribute.NotApplicableException.cs
*
* Copyright © 2009
* Diversified Technical Systems, Inc.
* All Rights Reserved
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DTS.Slice.Control
{
// *** see DTS.Slice.Control.Event.cs ***
public partial class Event
{
// *** see DTS.Slice.Control.Event.Module.cs ***
public partial class Module
{
// *** see DTS.Slice.Control.Event.Module.Channel.cs ***
public partial class Channel
{
// *** see DTS.Slice.Control.Event.Module.Channel.ReviewableAttribute.cs ***
public partial class ReviewableAttribute
{
/// <summary>
/// Representation of an attempt to use a channel attribute that is not
/// applicable to the associated channel.
/// </summary>
public class NotApplicableException : ApplicationException
{ ///
/// <summary>
/// Initialize an instance of the NotApplicableException class.
/// </summary>
///
public NotApplicableException()
{
}
/// <summary>
/// Initialize an instance of the NotApplicableException class.
/// </summary>
///
/// <param name="msg">
/// The <see cref="string"/> message to be associated with this exception.
/// </param>
///
public NotApplicableException(string msg)
: base(msg)
{
}
/// <summary>
/// Initialize an instance of the NotApplicableException class.
/// </summary>
///
/// <param name="msg">
/// The <see cref="string"/> message to be associated with this exception.
/// </param>
///
/// <param name="innerEx">
/// The <see cref="System.Exception"/> responsible for this exception inception.
/// </param>
///
public NotApplicableException(string msg, System.Exception innerEx)
: base(msg, innerEx)
{
}
}
} // *** end ReviewableAttribute ***
} // *** end Channel ***
} // *** end Module ***
} // *** end Event ***
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,74 @@
/*
* DTS.Slice.Control.Event.Module.ReviewableAttribute.cs
*
* Copyright © 2009
* Diversified Technical Systems, Inc.
* All Rights Reserved
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DTS.Slice.Control
{
// *** see DTS.Slice.Control.Event.cs ***
public partial class Event
{
// *** see DTS.Slice.Control.Event.Module.cs ***
public partial class Module
{
/// <summary>
/// A reviewable attribute attached to a specific channel.
/// </summary>
abstract public partial class ReviewableAttribute
: Slice.Control.ReviewableAttribute
{
/// <summary>
/// The concrete class should implement this constructor.
/// </summary>
///
/// <param name="channel">
/// The <see cref="DTS.Slice.Control.Event.Module"/> to which a specific instance
/// of this reviewable attribute class is attached. It should be used by this class' subclass'
/// DetermineAttributeValueString method.
/// </param>
///
public ReviewableAttribute(Event.Module channel)
: this(null, null)
{
try
{
throw new NotImplementedException("cannot initialize " + this.GetType().FullName + " with this constructor; must call parameterized version");
}
catch (System.Exception ex)
{
throw new Module.ReviewableAttribute.Exception("encountered problem constructing " + this.GetType().FullName, ex);
}
}
/// <summary>
/// Initialize an instance of this class.
/// </summary>
///
/// <param name="name">
/// The <see cref="string"/> name of the attribute represented by this class.
/// </param>
///
/// <param name="calculateValue">
/// The <see cref="DTS.Slice.Control.ReviewableAttribute.DetermineValueString"/>
/// </param>
///
protected ReviewableAttribute(string name, DetermineValueString calculateValue)
: base(name, calculateValue)
{
}
}
} // *** end Module ***
} // *** end Event ***
}

View File

@@ -0,0 +1,46 @@
/*
* DTS.Slice.Control.Event.Module.ReviewableDasSerialNumberAttribute.cs
*
* Copyright © 2009
* Diversified Technical Systems, Inc.
* All Rights Reserved
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTS.Utilities;
namespace DTS.Slice.Control
{
// *** see DTS.Slice.Control.Event.cs ***
public partial class Event
{
// *** see DTS.Slice.Control.Event.Module.cs ***
public partial class Module
{
/// <summary>
/// A reviewable filter frequency attribute attached to a specific channel.
/// </summary>
public class ReviewableDasSerialNumberAttribute
: Slice.Control.Event.Module.ReviewableAttribute
{
/// <summary>
/// Initialize an instance of this class.
/// </summary>
///
/// <param name="channel">
/// The <see cref="Event.Module"/> to which this attribute is attached.
/// </param>
///
public ReviewableDasSerialNumberAttribute(Event.Module module)
: base("DAS Serial Number", delegate { return module.DasSerialNumber; })
{
}
}
} // *** end Module ***
} // *** end Event ***
}

View File

@@ -0,0 +1,81 @@
/*
* DTS.Slice.Control.Event.Module.ReviewableSampleRateAttribute.cs
*
* Copyright © 2009
* Diversified Technical Systems, Inc.
* All Rights Reserved
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTS.Utilities;
namespace DTS.Slice.Control
{
// *** see DTS.Slice.Control.Event.cs ***
public partial class Event {
// *** see DTS.Slice.Control.Event.Module.cs ***
public partial class Module {
/// <summary>
/// A reviewable filter frequency attribute attached to a specific channel.
/// </summary>
public class ReviewableSampleRateAttribute
: Slice.Control.Event.Module.ReviewableAttribute
{
/// <summary>
/// Initialize an instance of this class.
/// </summary>
///
/// <param name="channel">
/// The <see cref="Event.Module"/> to which this attribute is attached.
/// </param>
///
public ReviewableSampleRateAttribute(Event.Module module)
: base("Sample Rate", delegate { return module.SampleRateHz.ToString("N"); })
{
}
}
/// <summary>
/// A reviewable filter frequency attribute attached to a specific channel.
/// </summary>
public class ReviewableTestDescriptionAttribute
: Slice.Control.Event.Module.ReviewableAttribute
{
/// <summary>
/// Initialize an instance of this class.
/// </summary>
///
/// <param name="channel">
/// The <see cref="Event.Module"/> to which this attribute is attached.
/// </param>
///
public ReviewableTestDescriptionAttribute(Event.Module module)
: base("Test Description", delegate { return module.ParentEvent.Description; })
{
}
}
public class ReviewableHardwareFrequencyAttribute
: Slice.Control.Event.Module.ReviewableAttribute
{
/// <summary>
/// Initialize an instance of this class.
/// </summary>
///
/// <param name="channel">
/// The <see cref="Event.Module.Channel"/> to which this attribute is attached.
/// </param>
///
public ReviewableHardwareFrequencyAttribute(Event.Module module)
: base("HW AAF", delegate { return module.AaFilterRateHz.ToString("N2"); })
{
}
}
} // *** end Module ***
} // *** end Event ***
}

View File

@@ -0,0 +1,27 @@
/*
* DTS.Slice.Control.Event.ModuleChannelAccessor.cs
*
* Copyright © 2009
* Diversified Technical Systems, Inc.
* All Rights Reserved
*/
using DTS.Common.Utilities;
namespace DTS.Slice.Control
{
// *** see DTS.Slice.Control.Event.cs ***
public partial class Event
{
/// <summary>
/// A component object of the Event.DasModuleChannelAccessor.
/// </summary>
public class ModuleChannelAccessor : ExceptionalDictionary<int, ChannelAccessor> // xxx change this int to DAS.Module.Id?
{
/// <summary>
/// Initialize an instance of the DTS.Slice.Control.Event.ModuleChannelAccessor class.
/// </summary>
public ModuleChannelAccessor() { }
}
}
}

View File

@@ -0,0 +1,82 @@
/*
* DTS.Slice.Control.Event.TestInformation.cs
*
* Copyright © 2009
* Diversified Technical Systems, Inc.
* All Rights Reserved
*/
using DTS.Common.DASResource;
using DTS.Common.Utilities;
using DTS.Common.Utilities.DotNetProgrammingConstructs;
namespace DTS.Slice.Control
{
// *** see DTS.Slice.Control.DAS.Event.cs ***
public partial class Event
{
/// <summary>
/// Internal representation of DAS event test information.
/// </summary>
private sealed class TestInformation : Exceptional
{
/// <summary>
/// Get/set the <see cref="string"/> ID of the test associated with this DAS event.
/// </summary>
public string Id
{
get => _Id.Value;
set => _Id.Value = value;
}
private readonly Property<string> _Id = new Property<string>("DTS.Slice.Control.Event.TestInformation.Id", null, false);
/// <summary>
/// Get/set the <see cref="string"/> description of the test associated with this DAS event.
/// </summary>
public string Description
{
get => _Description.Value;
set => _Description.Value = value;
}
private readonly Property<string> _Description = new Property<string>("DTS.Slice.Control.Event.TestInformation.Description", null, false);
/// <summary>
/// Initialize an instance of the DTS.Slice.Control.Event.TestInformation class.
/// </summary>
public TestInformation()
{ //
// NOTE that the invocation of this constructor will leave this class'
// properties uninitialized.
} //
/// <summary>
/// Initialize an instance of the DTS.Slice.Control.Event.TestInformation class.
/// </summary>
///
/// <param name="id">
/// The <see cref="string"/> ID of the test associated with this DAS event.
/// </param>
///
/// <param name="description">
/// The <see cref="string"/> description of the test associated with this DAS event.
/// </param>
///
public TestInformation(string id, string description)
{
try
{
Id = id;
Description = description;
}
catch (System.Exception ex)
{
throw new Exception(
string.Format(
Strings.DTS_Slice_Control_Event_ConstructionFailedString, GetType().FullName),
ex);
}
}
}
}
}

View File

@@ -0,0 +1,181 @@
/*
DTS.Slice.Control.IntervalSec.cs
Copyright © 2008
Diversified Technical Systems, Inc.
All Rights Reserved
*/
using DTS.Common.Utilities;
using DTS.Common.Utilities.DotNetProgrammingConstructs;
namespace DTS.Slice.Control
{
/// <summary>
/// Get/set the begin value.
/// </summary>
public class IntervalSec : Exceptional
{
/// <summary>
/// Create an instance of the IntervalSec class.
/// </summary>
public IntervalSec()
{ //
// Note that calling the parameterless constructor will leave the begin and
// end properties "uninitialized".
} //
/// <summary>
/// Create an instance of the IntervalSec class.
/// </summary>
///
/// <param name="begin">
/// The <see cref="double"/> begin time of this interval.
/// </param>
///
/// <param name="end">
/// The <see cref="double"/> end time of this interval.
/// </param>
///
public IntervalSec(double begin, double end)
{
try
{
Begin = begin;
End = end;
}
catch (System.Exception ex)
{
throw new Exception(
"encountered problem constructing " + GetType().FullName, ex);
}
}
/// <summary>
/// Get/set the <see cref="double"/> begin time of the interval.
/// </summary>
public double Begin
{
get => _Begin.Value;
set => _Begin.Value = value;
}
private readonly Property<double> _Begin
= new Property<double>(
typeof(IntervalSec).Namespace + ".IntervalSec.Begin", 0, false);
/// <summary>
/// Get/set the <see cref="double"/> end time of the interval.
/// </summary>
public double End
{
get => _End.Value;
set => _End.Value = value;
}
private readonly Property<double> _End
= new Property<double>(
typeof(IntervalSec).Namespace + ".IntervalSec.End", 0, false);
/// <summary>
/// Method to implicitly convert this type into a DTS.Serialization.Test.IntervalSec.
/// </summary>
///
/// <param name="thisInterval">
/// The <see cref="DTS.Slice.Control.IntervalSec"/> to be converted.
/// </param>
///
/// <returns>
/// A <see cref="DTS.Serialization.Test.IntervalSec"/> equivalent to the speceified interval
/// object.
/// </returns>
///
public static implicit operator Serialization.Test.IntervalSec(IntervalSec thisInterval)
{
try
{
return new Serialization.Test.IntervalSec(thisInterval.Begin, thisInterval.End);
}
catch (System.Exception ex)
{
throw new Exception("encountered problem implicitly converting " + typeof(IntervalSec).FullName + " to " + typeof(Serialization.Test.IntervalSec).FullName, ex);
}
}
/// <summary>
/// Method to implicitly convert a DTS.Serialization.Test.IntervalSec object into this type.
/// </summary>
///
/// <param name="thatInterval">
/// The <see cref="DTS.Serialization.Test.IntervalSec"/> to be converted.
/// </param>
///
/// <returns>
/// A <see cref="DTS.Slice.Control.IntervalSec"/> equivalent to the specified interval
/// object.
/// </returns>
///
public static implicit operator IntervalSec(Serialization.Test.IntervalSec thatInterval)
{
try
{
return new IntervalSec(thatInterval.Begin, thatInterval.End);
}
catch (System.Exception ex)
{
throw new Exception("encountered problem implicitly converting " + typeof(Serialization.Test.IntervalSec).FullName + " to " + typeof(IntervalSec).FullName, ex);
}
}
/// <summary>
/// Test the specified object for equality with this object.
/// </summary>
///
/// <param name="obj">
/// The <see cref="object"/> to be tested for equality.
/// </param>
///
/// <returns>
/// <see cref="bool"/> true if the specified object has memeberwise equality with
/// this object; false otherwise.
/// </returns>
///
public override bool Equals(object obj)
{
try
{
var that = obj as IntervalSec;
return null != obj
&& Begin.Equals(that.Begin)
&& End.Equals(that.End);
}
catch (System.Exception ex)
{
throw new Exception("encountered problem equality-testing the object " + (null != obj ? "\"" + obj.ToString() + "\"" : "<<NULL>>"), ex);
}
}
/// <summary>
/// Get has code for this object.
/// </summary>
///
/// <returns>
/// The <see cref="int"/> hash code for this object.
/// </returns>
///
public override int GetHashCode()
{
try
{
return base.GetHashCode();
}
catch (System.Exception ex)
{
throw new Exception("encountered problem generating hash code for " + GetType().FullName, ex);
}
}
}
}

View File

@@ -0,0 +1,118 @@
/*
* DTS.Slice.Control.ReviewableAttribute.cs
*
* Copyright © 2009
* Diversified Technical Systems, Inc.
* All Rights Reserved
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTS.Utilities;
using DTS.Utilities.DotNetProgrammingConstructs;
namespace DTS.Slice.Control
{
/// <summary>
/// Representation of a "reviewable" attribute.
/// </summary>
abstract public class ReviewableAttribute : Exceptional
{ ///
/// <summary>
/// Initialize an instance of the ReviewableAttribute class.
/// </summary>
///
/// <param name="name">
/// The <see cref="string"/> name of the attribute represented by this object.
/// </param>
///
/// <param name="value">
/// The value of the attribute represented by this object.
/// </param>
///
public ReviewableAttribute(string name, DetermineValueString calculateValue)
{
try
{
this.Name = name;
this.CalculateValue = calculateValue;
}
catch (System.Exception ex)
{
throw new ReviewableAttribute.Exception("encountered problem constructing " + this.GetType().FullName, ex);
}
}
/// <summary>
/// The <see cref="string"/> name associated with this review tab-displayable attribute.
/// </summary>
public string Name
{
get { return _Name.Value; }
private set { _Name.Value = value; }
}
private Property<string> _Name
= new Property<string>(
typeof(ReviewableAttribute).Namespace + ".ReviewableAttribute.Name",
null,
false
);
/// <summary>
/// Get the value <see cref="string"/> for this attribute.
/// </summary>
public string Value
{
get
{
try
{
return CalculateValue();
}
catch (System.Exception ex)
{
Utilities.Logging.APILogger.Log("encountered problem getting ReviewableAttribute value", ex);
return "N/A";
//throw new ReviewableAttribute.Exception( "encountered problem getting ReviewableAttribute value", ex );
}
}
}
// Need to attach the list of attribute "accessors" to the channel in a similar way
// we do with filters. Have an "available" list. And then an "active" list.
public delegate string DetermineValueString();
/// <summary>
/// Determine the value associated with this review tab-displayable attribute.
/// </summary>
private DetermineValueString CalculateValue
{
get
{
try
{
if (!_CalculateValueIsInitialized)
throw new ApplicationException("method property \"CalculateValue\" has not been initialized");
else return _CalculateValue;
}
catch (System.Exception ex)
{
throw new ReviewableAttribute.Exception("encountered problem getting property value", ex);
}
}
set
{
_CalculateValue = value;
_CalculateValueIsInitialized = true;
}
}
private DetermineValueString _CalculateValue;
private bool _CalculateValueIsInitialized = false;
}
}