690 lines
29 KiB
C#
690 lines
29 KiB
C#
|
|
/*
|
|||
|
|
Test.Module.Channel.cs
|
|||
|
|
|
|||
|
|
Copyright © 2008
|
|||
|
|
Diversified Technical Systems, Inc.
|
|||
|
|
All Rights Reserved
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Diagnostics;
|
|||
|
|
using System.Linq;
|
|||
|
|
using System.Text;
|
|||
|
|
using System.Xml;
|
|||
|
|
using System.Xml.Schema;
|
|||
|
|
using System.Xml.Serialization;
|
|||
|
|
using DTS.Utilities;
|
|||
|
|
using DTS.Utilities.DotNetProgrammingConstructs;
|
|||
|
|
using DTS.Utilities.Xml;
|
|||
|
|
|
|||
|
|
namespace DTS.Serialization
|
|||
|
|
{
|
|||
|
|
// *** see Test.cs ***
|
|||
|
|
public partial class Test
|
|||
|
|
{
|
|||
|
|
// *** see Test.Module.cs ***
|
|||
|
|
public partial class Module
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// Representation of serializable channel information.
|
|||
|
|
/// </summary>
|
|||
|
|
[XmlSerializationTag( "Channel" )]
|
|||
|
|
public abstract partial class Channel : Exceptional, IXmlSerializable
|
|||
|
|
{
|
|||
|
|
protected Channel()
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public Channel( Test.Module parentModule )
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
this.ParentModule = parentModule;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
catch ( System.Exception ex )
|
|||
|
|
{
|
|||
|
|
throw new Test.Module.Channel.Exception( "encountered problem constructing " + this.GetType( ).Name, ex );
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// The <see cref="DTS.Serialization.Test.Module"/> that contains this channel.
|
|||
|
|
/// </summary>
|
|||
|
|
public Test.Module ParentModule
|
|||
|
|
{
|
|||
|
|
get { return _ParentModule.Value; }
|
|||
|
|
private set { _ParentModule.Value = value; }
|
|||
|
|
}
|
|||
|
|
private Property<Test.Module> _ParentModule
|
|||
|
|
= new Property<Test.Module>(
|
|||
|
|
typeof( Test.Module.Channel ).Namespace + ".Test.Module.Channel.ParentModule",
|
|||
|
|
null,
|
|||
|
|
false
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Get/set the channel's ordinal number.
|
|||
|
|
/// </summary>
|
|||
|
|
[XmlSerializationTag( "Number" )]
|
|||
|
|
public int Number
|
|||
|
|
{
|
|||
|
|
get { return _Number.Value; }
|
|||
|
|
set { _Number.Value = value; }
|
|||
|
|
}
|
|||
|
|
private Property<int> _Number
|
|||
|
|
= new Property<int>(
|
|||
|
|
typeof( Channel ).Namespace + ".Test.Module.Channel.Number",
|
|||
|
|
-1,
|
|||
|
|
false
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// get/set the absolute display order of the channel (absolutenumber refers to physical number)
|
|||
|
|
/// </summary>
|
|||
|
|
[XmlSerializationTag("AbsoluteDisplayOrder")]
|
|||
|
|
public int AbsoluteDisplayOrder
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
if (_absoluteDisplayOrder.IsValueInitialized) { return _absoluteDisplayOrder.Value; }
|
|||
|
|
else { return -1; }
|
|||
|
|
}
|
|||
|
|
set { _absoluteDisplayOrder.Value = value; }
|
|||
|
|
}
|
|||
|
|
private Property<int> _absoluteDisplayOrder = new Property<int>(
|
|||
|
|
typeof(Channel).Namespace + ".Test.Module.Channel.AbsoluteDisplayOrder",
|
|||
|
|
-1, true);
|
|||
|
|
/// <summary>
|
|||
|
|
/// Get/set the start time for this channel.
|
|||
|
|
/// </summary>
|
|||
|
|
[XmlSerializationTag( "Start" )]
|
|||
|
|
public DateTime Start
|
|||
|
|
{
|
|||
|
|
get { return _Start.Value; }
|
|||
|
|
set { _Start.Value = value; }
|
|||
|
|
}
|
|||
|
|
private Property<DateTime> _Start
|
|||
|
|
= new Property<DateTime>(
|
|||
|
|
typeof( Channel ).Namespace + ".Test.Module.Channel.Start",
|
|||
|
|
DateTime.Now,
|
|||
|
|
false
|
|||
|
|
);
|
|||
|
|
public bool TimeOfFirstSampleValid
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return _TimeOfFirstSampleSec.IsInitialized;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// Get/set the time of first sample in this test.
|
|||
|
|
/// </summary>
|
|||
|
|
[XmlSerializationTag( "TimeOfFirstSample" )]
|
|||
|
|
public double TimeOfFirstSampleSec
|
|||
|
|
{
|
|||
|
|
get { return _TimeOfFirstSampleSec.Value; }
|
|||
|
|
set { _TimeOfFirstSampleSec.Value = value; }
|
|||
|
|
}
|
|||
|
|
protected Property<double> _TimeOfFirstSampleSec
|
|||
|
|
= new Property<double>(
|
|||
|
|
typeof( Channel ).Namespace + ".Test.Module.Channel.TimeOfFirstSample",
|
|||
|
|
0.0,
|
|||
|
|
false
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Get the type of this channel.
|
|||
|
|
/// </summary>
|
|||
|
|
[XmlSerializationTag( "ChannelType" )]
|
|||
|
|
public string ChannelType
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
return this.GetType( ).FullName;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
catch ( System.Exception ex )
|
|||
|
|
{
|
|||
|
|
throw new Test.Module.Channel.Exception( "encountered problem getting channel type property", ex );
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Get/set flag that determines whether or not data will be written to/read from XML serialization.
|
|||
|
|
/// </summary>
|
|||
|
|
public bool ExpressDataInlineOnXmlSerialization
|
|||
|
|
{
|
|||
|
|
get { return _ExpressDataInlineOnXmlSerialization.Value; }
|
|||
|
|
set { _ExpressDataInlineOnXmlSerialization.Value = value; }
|
|||
|
|
}
|
|||
|
|
private Property<bool> _ExpressDataInlineOnXmlSerialization
|
|||
|
|
= new Property<bool>(
|
|||
|
|
typeof( Channel ).Namespace + ".Test.Module.Channel.ExpressDataInlineOnXmlSerialization",
|
|||
|
|
false,
|
|||
|
|
true
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Get/set a user-readable description of this channel object.
|
|||
|
|
/// </summary>
|
|||
|
|
[XmlSerializationTag( "ChannelDescriptionString" )]
|
|||
|
|
public string ChannelDescriptionString
|
|||
|
|
{
|
|||
|
|
get { return _ChannelDescriptionString.Value; }
|
|||
|
|
set { _ChannelDescriptionString.Value = value; }
|
|||
|
|
}
|
|||
|
|
private Property<string> _ChannelDescriptionString
|
|||
|
|
= new Property<string>(
|
|||
|
|
typeof( Channel ).Namespace + ".Test.Module.Channel.ChannelDescriptionString",
|
|||
|
|
"",
|
|||
|
|
false
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
|
|||
|
|
[XmlSerializationTag("HardwareChannelName")]
|
|||
|
|
public string HardwareChannelName
|
|||
|
|
{
|
|||
|
|
get { return _HardwareChannelName.Value; }
|
|||
|
|
set { _HardwareChannelName.Value = value; }
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
private Property<string> _HardwareChannelName
|
|||
|
|
= new Property<string>(
|
|||
|
|
typeof(Channel).Namespace + ".Test.Module.Channel.HardwareChannelName",
|
|||
|
|
"", true);
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// refers to a unique id for a logical channel in the test
|
|||
|
|
/// for now this is using TestObjectChannel.GetId()
|
|||
|
|
/// which is in the form of TestObjectSerial_ChannelType_ChannelId
|
|||
|
|
/// </summary>
|
|||
|
|
[XmlSerializationTag("ChannelId")]
|
|||
|
|
public string ChannelId
|
|||
|
|
{
|
|||
|
|
//get { return _ChannelId.Value; }
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
if (!_ChannelId.IsInitialized || null == _ChannelId.Value)
|
|||
|
|
{
|
|||
|
|
return string.Format("{0}_{1}", HardwareChannelName, ChannelName2);
|
|||
|
|
}
|
|||
|
|
else { return _ChannelId.Value; }
|
|||
|
|
}
|
|||
|
|
set { _ChannelId.Value = value; }
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private Property<string> _ChannelId
|
|||
|
|
= new Property<string>(
|
|||
|
|
typeof(Channel).Namespace + ".Test.Module.Channel.ChannelId",
|
|||
|
|
"", true);
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// refers to the Group name for a logical channel in the test
|
|||
|
|
/// </summary>
|
|||
|
|
[XmlSerializationTag("ChannelGroupName")]
|
|||
|
|
public string ChannelGroupName
|
|||
|
|
{
|
|||
|
|
get { return _ChannelGroupName.Value; }
|
|||
|
|
set { _ChannelGroupName.Value = value; }
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private Property<string> _ChannelGroupName
|
|||
|
|
= new Property<string>(
|
|||
|
|
typeof(Channel).Namespace + ".Test.Module.Channel.ChannelGroupName",
|
|||
|
|
"", true);
|
|||
|
|
|
|||
|
|
[XmlSerializationTag("ChannelName2")]
|
|||
|
|
public string ChannelName2
|
|||
|
|
{
|
|||
|
|
get { return _ChannelName2.Value; }
|
|||
|
|
set { _ChannelName2.Value = value; }
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private Property<string> _ChannelName2
|
|||
|
|
= new Property<string>(
|
|||
|
|
typeof(Channel).Namespace + ".Test.Module.Channel.ChannelName2",
|
|||
|
|
"", true);
|
|||
|
|
/// <summary>
|
|||
|
|
/// Get/set the data values for this channel.
|
|||
|
|
/// </summary>
|
|||
|
|
[XmlSerializationTag( "Data" )]
|
|||
|
|
public DataArray<short> Data
|
|||
|
|
{
|
|||
|
|
get { return _Data.Value; }
|
|||
|
|
set { _Data.Value = value; }
|
|||
|
|
}
|
|||
|
|
private Property<DataArray<short>> _Data
|
|||
|
|
= new Property<DataArray<short>>(
|
|||
|
|
typeof( Channel ).Namespace + ".Test.Module.Channel.Data",
|
|||
|
|
null,
|
|||
|
|
false
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Get/set the subsampling indication for this channel's data.
|
|||
|
|
/// </summary>
|
|||
|
|
[XmlSerializationTag( "IsSubsampled" )]
|
|||
|
|
public bool IsSubsampled
|
|||
|
|
{
|
|||
|
|
get { return _IsSubsampled.Value; }
|
|||
|
|
set { _IsSubsampled.Value = value; }
|
|||
|
|
}
|
|||
|
|
private Property<bool> _IsSubsampled
|
|||
|
|
= new Property<bool>(
|
|||
|
|
typeof( Channel ).Namespace + ".Test.Module.Channel.IsSubsampled",
|
|||
|
|
false,
|
|||
|
|
true
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
[XmlSerializationTag("LastCalibrationDate")]
|
|||
|
|
public DateTime LastCalibrationDate
|
|||
|
|
{
|
|||
|
|
get { return _lastCalibrationDate.Value; }
|
|||
|
|
set { _lastCalibrationDate.Value = value; }
|
|||
|
|
}
|
|||
|
|
private Property<DateTime> _lastCalibrationDate
|
|||
|
|
= new Property<DateTime>(
|
|||
|
|
typeof(Channel).Namespace + ".Test.Module.Channel.LastCalibrationDate",
|
|||
|
|
DateTime.MinValue,
|
|||
|
|
true
|
|||
|
|
);
|
|||
|
|
public bool IsLastCalibrationDateValid
|
|||
|
|
{
|
|||
|
|
get { return _lastCalibrationDate.IsInitialized; }
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[XmlSerializationTag("SensorID")]
|
|||
|
|
public string SensorID
|
|||
|
|
{
|
|||
|
|
get { return _sensorID.Value; }
|
|||
|
|
set { _sensorID.Value = value; }
|
|||
|
|
}
|
|||
|
|
private Property<String> _sensorID =
|
|||
|
|
new Property<string>(
|
|||
|
|
typeof(Channel).Namespace + ".Test.Module.Channel.SensorID",
|
|||
|
|
"",
|
|||
|
|
true
|
|||
|
|
);
|
|||
|
|
public bool IsSensorIDValid
|
|||
|
|
{
|
|||
|
|
get { return _sensorID.IsInitialized; }
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[XmlSerializationTag("OffsetToleranceLowMv")]
|
|||
|
|
public double OffsetToleranceLowMv
|
|||
|
|
{
|
|||
|
|
get { return _offsetToleranceLowMv.Value; }
|
|||
|
|
set { _offsetToleranceLowMv.Value = value; }
|
|||
|
|
}
|
|||
|
|
private Property<double> _offsetToleranceLowMv =
|
|||
|
|
new Property<double>(
|
|||
|
|
typeof(Channel).Namespace + ".Test.Module.Channel.OffsetToleranceLowMv",
|
|||
|
|
0D,
|
|||
|
|
true
|
|||
|
|
);
|
|||
|
|
public bool IsOffsetToleranceLowMvValid
|
|||
|
|
{
|
|||
|
|
get { return _offsetToleranceLowMv.IsInitialized; }
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[XmlSerializationTag("OffsetToleranceHighMv")]
|
|||
|
|
public double OffsetToleranceHighMv
|
|||
|
|
{
|
|||
|
|
get { return _offsetToleranceHighMv.Value; }
|
|||
|
|
set { _offsetToleranceHighMv.Value = value; }
|
|||
|
|
}
|
|||
|
|
private Property<double> _offsetToleranceHighMv =
|
|||
|
|
new Property<double>(
|
|||
|
|
typeof(Channel).Namespace + ".Test.Module.Channel.OffsetToleranceHighMv",
|
|||
|
|
0D,
|
|||
|
|
true
|
|||
|
|
);
|
|||
|
|
public bool IsOffsetToleranceHighMvValid
|
|||
|
|
{
|
|||
|
|
get { return _offsetToleranceHighMv.IsInitialized; }
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
[XmlSerializationTag("UserValue1")]
|
|||
|
|
public string UserValue1
|
|||
|
|
{
|
|||
|
|
get { return _userValue1.Value; }
|
|||
|
|
set { _userValue1.Value = value; }
|
|||
|
|
}
|
|||
|
|
private Property<string> _userValue1 = new Property<string>(
|
|||
|
|
typeof(Channel).Namespace + ".Test.Module.Channel.UserValue1",
|
|||
|
|
"", true);
|
|||
|
|
|
|||
|
|
[XmlSerializationTag("UserValue2")]
|
|||
|
|
public string UserValue2
|
|||
|
|
{
|
|||
|
|
get { return _userValue2.Value; }
|
|||
|
|
set { _userValue2.Value = value; }
|
|||
|
|
}
|
|||
|
|
private Property<string> _userValue2 = new Property<string>(
|
|||
|
|
typeof(Channel).Namespace + ".Test.Module.Channel.UserValue2",
|
|||
|
|
"", true);
|
|||
|
|
|
|||
|
|
|
|||
|
|
[XmlSerializationTag("UserValue3")]
|
|||
|
|
public string UserValue3
|
|||
|
|
{
|
|||
|
|
get { return _userValue3.Value; }
|
|||
|
|
set { _userValue3.Value = value; }
|
|||
|
|
}
|
|||
|
|
private Property<string> _userValue3 = new Property<string>(
|
|||
|
|
typeof(Channel).Namespace + ".Test.Module.Channel.UserValue3",
|
|||
|
|
"", true);
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Get/set the unsubsampled sample rate for this channel (if applicable).
|
|||
|
|
/// </summary>
|
|||
|
|
[XmlSerializationTag( "UnsubsampledSampleRateHz" )]
|
|||
|
|
public float UnsubsampledSampleRateHz
|
|||
|
|
{
|
|||
|
|
get { return _UnsubsampledSampleRateHz.Value; }
|
|||
|
|
set { _UnsubsampledSampleRateHz.Value = value; }
|
|||
|
|
}
|
|||
|
|
private Property<float> _UnsubsampledSampleRateHz
|
|||
|
|
= new Property<float>(
|
|||
|
|
typeof( Channel ).Namespace + ".Test.Module.Channel.UnsubsampledSampleRateHz",
|
|||
|
|
0,
|
|||
|
|
true
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Get/set <see cref="double"/> noise as percentage of full scale value for this channel.
|
|||
|
|
/// </summary>
|
|||
|
|
public double NoiseAsPercentageOfFullScale
|
|||
|
|
{
|
|||
|
|
get { return _NoiseAsPercentageOfFullScale.Value; }
|
|||
|
|
set { _NoiseAsPercentageOfFullScale.Value = value; }
|
|||
|
|
}
|
|||
|
|
private Property<double> _NoiseAsPercentageOfFullScale
|
|||
|
|
= new Property<double>(
|
|||
|
|
typeof( Test.Module.Channel ).Namespace + ".Test.Module.Channel.NoiseAsPercentageOfFullScale",
|
|||
|
|
0.0,
|
|||
|
|
false
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Get the pre-test zero level (in ADC).
|
|||
|
|
/// </summary>
|
|||
|
|
public short PreTestZeroLevelAdc
|
|||
|
|
{
|
|||
|
|
get { return _PreTestZeroLevelAdc.Value; }
|
|||
|
|
set { _PreTestZeroLevelAdc.Value = value; }
|
|||
|
|
}
|
|||
|
|
private Property<short> _PreTestZeroLevelAdc
|
|||
|
|
= new Property<short>(
|
|||
|
|
typeof( Test.Module.Channel ).Namespace + ".Test.Module.Channel.PreTestZeroLevelAdc",
|
|||
|
|
0,
|
|||
|
|
false
|
|||
|
|
);
|
|||
|
|
//zeroMvInADC
|
|||
|
|
public short ZeroMvInADC
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
if (_ZeroMvInADC.IsValueInitialized) { return _ZeroMvInADC.Value; }
|
|||
|
|
else { return 0; }
|
|||
|
|
}
|
|||
|
|
set { _ZeroMvInADC.Value = value; }
|
|||
|
|
}
|
|||
|
|
private Property<short> _ZeroMvInADC
|
|||
|
|
= new Property<short>(
|
|||
|
|
typeof(Test.Module.Channel).Namespace + ".Test.Module.Channel.ZeroMvInADC",
|
|||
|
|
0,
|
|||
|
|
false);
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// WindowAverageADC is the average ADC over the averaging zero window for the channel
|
|||
|
|
/// WindowAverageADC is initialized to short.MinValue, so this value is considered
|
|||
|
|
/// an uninitialized or invalid value
|
|||
|
|
/// </summary>
|
|||
|
|
public short WindowAverageADC
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
if (_WindowAverageADC.IsValueInitialized) { return _WindowAverageADC.Value; }
|
|||
|
|
else { return short.MinValue; }
|
|||
|
|
}
|
|||
|
|
set { _WindowAverageADC.Value = value; }
|
|||
|
|
}
|
|||
|
|
private Property<short> _WindowAverageADC
|
|||
|
|
= new Property<short>(
|
|||
|
|
typeof(Test.Module.Channel).Namespace + ".Test.Module.Channel.WindowAverageADC",
|
|||
|
|
short.MinValue,
|
|||
|
|
false);
|
|||
|
|
|
|||
|
|
|
|||
|
|
public int TriggerAdjustmentSamples
|
|||
|
|
{
|
|||
|
|
get { return _TriggerAdjustmentSamples.Value; }
|
|||
|
|
set { _TriggerAdjustmentSamples.Value = value; }
|
|||
|
|
}
|
|||
|
|
private Property<int> _TriggerAdjustmentSamples
|
|||
|
|
= new Property<int>(
|
|||
|
|
typeof(Test.Module.Channel).Namespace + ".Test.Module.Channel.TriggerAdjustmentSamples",
|
|||
|
|
0,
|
|||
|
|
false);
|
|||
|
|
|
|||
|
|
public short OriginalOffsetADC
|
|||
|
|
{
|
|||
|
|
get { return _OriginalOffsetADC.Value; }
|
|||
|
|
set { _OriginalOffsetADC.Value = value; }
|
|||
|
|
}
|
|||
|
|
private Property<short> _OriginalOffsetADC
|
|||
|
|
= new Property<short>(
|
|||
|
|
typeof(Test.Module.Channel).Namespace + ".Test.Module.Channel.OriginalOffsetADC",
|
|||
|
|
0,
|
|||
|
|
false);
|
|||
|
|
|
|||
|
|
public double Excitation
|
|||
|
|
{
|
|||
|
|
get { return _Excitation.Value; }
|
|||
|
|
set { _Excitation.Value = value; }
|
|||
|
|
}
|
|||
|
|
private Property<double> _Excitation
|
|||
|
|
= new Property<double>(
|
|||
|
|
typeof(Test.Module.Channel).Namespace + ".Test.Module.Channel.Excitation",
|
|||
|
|
5D,
|
|||
|
|
false);
|
|||
|
|
|
|||
|
|
public int RemovedADC
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
if (_RemovedADC.IsValueInitialized) { return _RemovedADC.Value; }
|
|||
|
|
else { return 0; }
|
|||
|
|
}
|
|||
|
|
set { _RemovedADC.Value = value; }
|
|||
|
|
}
|
|||
|
|
private Property<int> _RemovedADC
|
|||
|
|
= new Property<int>(
|
|||
|
|
typeof(Test.Module.Channel).Namespace + ".Test.Module.Channel.RemovedADC",
|
|||
|
|
0,
|
|||
|
|
true
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
public int RemovedInternalADC
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
if (_RemovedInternalADC.IsValueInitialized) { return _RemovedInternalADC.Value; }
|
|||
|
|
else { return 0; }
|
|||
|
|
}
|
|||
|
|
set { _RemovedInternalADC.Value = value; }
|
|||
|
|
}
|
|||
|
|
private Property<int> _RemovedInternalADC
|
|||
|
|
= new Property<int>(
|
|||
|
|
typeof(Test.Module.Channel).Namespace + ".Test.Module.Channel.RemovedInternalADC",
|
|||
|
|
0,
|
|||
|
|
true
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Get data zero level counts.
|
|||
|
|
/// </summary>
|
|||
|
|
public abstract short DataZeroLevelAdc
|
|||
|
|
{
|
|||
|
|
get;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Get/set the persistent information for this channel.
|
|||
|
|
/// </summary>
|
|||
|
|
public DTS.Serialization.SliceRaw.File.PersistentChannel PersistentChannelInfo
|
|||
|
|
{
|
|||
|
|
get { return _PersistentChannelInfo.Value; }
|
|||
|
|
set { _PersistentChannelInfo.Value = value; }
|
|||
|
|
}
|
|||
|
|
private Property<DTS.Serialization.SliceRaw.File.PersistentChannel> _PersistentChannelInfo
|
|||
|
|
= new Property<DTS.Serialization.SliceRaw.File.PersistentChannel>(
|
|||
|
|
typeof( Channel ).Namespace + ".Test.Module.Channel.PersistentChannelInfo",
|
|||
|
|
null,
|
|||
|
|
false
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Get/set the persistent information for this channel.
|
|||
|
|
/// </summary>
|
|||
|
|
public DTS.Serialization.TDAS.File.PersistentChannel TDASPersistentChannelInfo
|
|||
|
|
{
|
|||
|
|
get { return _TDASPersistentChannelInfo.Value; }
|
|||
|
|
set { _TDASPersistentChannelInfo.Value = value; }
|
|||
|
|
}
|
|||
|
|
private Property<DTS.Serialization.TDAS.File.PersistentChannel> _TDASPersistentChannelInfo
|
|||
|
|
= new Property<DTS.Serialization.TDAS.File.PersistentChannel>(
|
|||
|
|
typeof(Channel).Namespace + ".Test.Module.Channel.TDASPersistentChannelInfo",
|
|||
|
|
null,
|
|||
|
|
false
|
|||
|
|
);
|
|||
|
|
|
|||
|
|
[XmlSerializationTag("DataFlag")]
|
|||
|
|
public int DataFlag
|
|||
|
|
{
|
|||
|
|
get { return _DataFlag.Value; }
|
|||
|
|
set { _DataFlag.Value = value; }
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private Property<int> _DataFlag = new Property<int>(
|
|||
|
|
typeof(Test.Module.Channel).Namespace + ".Test.Module.Channel.DataFlag",
|
|||
|
|
1, true);
|
|||
|
|
public bool IsDataFlagValid
|
|||
|
|
{
|
|||
|
|
get { return _DataFlag.IsInitialized; }
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
//public DTS.Slice.Control.Event.Module.Channel emc;
|
|||
|
|
public object emc;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Write XML serialization for this object to the specified writer.
|
|||
|
|
/// </summary>
|
|||
|
|
///
|
|||
|
|
/// <param name="writer">
|
|||
|
|
/// The <see cref="XmlWriter"/> to which this object's XML serialization
|
|||
|
|
/// will be written.
|
|||
|
|
/// </param>
|
|||
|
|
///
|
|||
|
|
public abstract void WriteXml( XmlWriter writer );
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Read XML serialization for this object from the specified reader.
|
|||
|
|
/// </summary>
|
|||
|
|
///
|
|||
|
|
/// <param name="reader">
|
|||
|
|
/// The <see cref="XmlReader"/> from which this object's XML serialization
|
|||
|
|
/// will be read.
|
|||
|
|
/// </param>
|
|||
|
|
///
|
|||
|
|
public abstract void ReadXml( XmlReader reader );
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Should normally return a schema representing the form of the XML
|
|||
|
|
/// generated/consumed by WriteXml/ReadXml, but it never called during
|
|||
|
|
/// the serialization process so ours just returns null.
|
|||
|
|
/// </summary>
|
|||
|
|
///
|
|||
|
|
/// <returns>
|
|||
|
|
/// Null <see cref="XmlSchema"/> reference, always.
|
|||
|
|
/// </returns>
|
|||
|
|
///
|
|||
|
|
public virtual XmlSchema GetSchema( )
|
|||
|
|
{
|
|||
|
|
// This method is never invoked during XML object serialization.
|
|||
|
|
return null;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <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
|
|||
|
|
{
|
|||
|
|
Test.Module.Channel that = obj as Test.Module.Channel;
|
|||
|
|
|
|||
|
|
return null != obj
|
|||
|
|
&& this.ChannelId.Equals(that.ChannelId)
|
|||
|
|
&& this.Data.Equals(that.Data)
|
|||
|
|
&& this.ExpressDataInlineOnXmlSerialization.Equals(that.ExpressDataInlineOnXmlSerialization)
|
|||
|
|
&& this.Number.Equals(that.Number)
|
|||
|
|
&& this.PreTestZeroLevelAdc.Equals(that.PreTestZeroLevelAdc)
|
|||
|
|
&& this.NoiseAsPercentageOfFullScale.Equals(that.NoiseAsPercentageOfFullScale)
|
|||
|
|
&& this.IsSubsampled.Equals(that.IsSubsampled)
|
|||
|
|
&& this.UnsubsampledSampleRateHz.Equals(that.UnsubsampledSampleRateHz)
|
|||
|
|
&& this._TimeOfFirstSampleSec.IsInitialized == that._TimeOfFirstSampleSec.IsInitialized && (this._TimeOfFirstSampleSec.IsInitialized ? this.TimeOfFirstSampleSec == that.TimeOfFirstSampleSec : true)
|
|||
|
|
&& this.Start.ToString().Equals(that.Start.ToString())
|
|||
|
|
&& this.UserValue1.Equals(that.UserValue1)
|
|||
|
|
&& this.UserValue2.Equals(that.UserValue2)
|
|||
|
|
&& this.UserValue3.Equals(that.UserValue3)
|
|||
|
|
&& this.AbsoluteDisplayOrder.Equals(that.AbsoluteDisplayOrder);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
catch ( System.Exception ex )
|
|||
|
|
{
|
|||
|
|
throw new Exception( "encountered problem equality-testing the object " + ( null != obj ? "\"" + obj.ToString( ) + "\"" : "<<NULL>>" ), ex );
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Return the hash code for this object.
|
|||
|
|
/// </summary>
|
|||
|
|
///
|
|||
|
|
/// <returns>
|
|||
|
|
/// The <see cref="int"/> hash code for this object.
|
|||
|
|
/// </returns>
|
|||
|
|
///
|
|||
|
|
public override int GetHashCode( )
|
|||
|
|
{
|
|||
|
|
return base.GetHashCode( );
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public override string ToString()
|
|||
|
|
{
|
|||
|
|
return ChannelDescriptionString;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|