1824 lines
100 KiB
Plaintext
1824 lines
100 KiB
Plaintext
|
|
/*
|
||
|
|
Test.Module.AnalogInputChannel.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.DAS.Concepts;
|
||
|
|
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 an analog channel.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag( "AnalogInputChanel" )]
|
||
|
|
public class AnalogInputChannel
|
||
|
|
: Channel,
|
||
|
|
DTS.DAS.Concepts.DAS.Channel.IEngineeringUnitAware,
|
||
|
|
DTS.DAS.Concepts.DAS.Channel.IInversionAware,
|
||
|
|
DTS.DAS.Concepts.DAS.Channel.ISerialNumberAware,
|
||
|
|
DTS.DAS.Concepts.DAS.Channel.IIsoCodeAware,
|
||
|
|
DTS.DAS.Concepts.DAS.Channel.IShuntAware,
|
||
|
|
DTS.DAS.Concepts.DAS.Channel.ICalSignalAware,
|
||
|
|
DTS.DAS.Concepts.DAS.Channel.IVoltageInsertionAware,
|
||
|
|
DTS.DAS.Concepts.DAS.Channel.ILinearized
|
||
|
|
{
|
||
|
|
/// <summary>
|
||
|
|
/// Initialize an instance of the <see cref="DTS.Serialization.Test.Module.AnalogInputChannel"/> class.
|
||
|
|
/// </summary>
|
||
|
|
///
|
||
|
|
/// <param name="parentModule">
|
||
|
|
/// The <see cref="DTS.Serialization.Test.Module"/> that contains this object.
|
||
|
|
/// </param>
|
||
|
|
///
|
||
|
|
public AnalogInputChannel( Test.Module parentModule )
|
||
|
|
: base( parentModule )
|
||
|
|
{
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the <see cref="Dts.DAS.Concepts.Test.Module.Channel.Sensor.BridgeType"/> bridge configuration of this channel.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag( "Bridge" )]
|
||
|
|
public DTS.DAS.Concepts.Test.Module.Channel.Sensor.BridgeType Bridge
|
||
|
|
{
|
||
|
|
get { return _Bridge.Value; }
|
||
|
|
set { _Bridge.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<DTS.DAS.Concepts.Test.Module.Channel.Sensor.BridgeType> _Bridge
|
||
|
|
= new Property<DTS.DAS.Concepts.Test.Module.Channel.Sensor.BridgeType>(
|
||
|
|
typeof( AnalogInputChannel ).Namespace + ".Test.Module.AnalogInputChannel.BridgeType",
|
||
|
|
DTS.DAS.Concepts.Test.Module.Channel.Sensor.BridgeType.FullBridge,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
[XmlSerializationTag( "ZeroPoint" )]
|
||
|
|
public double ZeroPoint
|
||
|
|
{
|
||
|
|
get
|
||
|
|
{
|
||
|
|
if (_ZeroPoint.IsValueInitialized)
|
||
|
|
{
|
||
|
|
return _ZeroPoint.Value;
|
||
|
|
}
|
||
|
|
else{ return 0D; }
|
||
|
|
}
|
||
|
|
set{ _ZeroPoint.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<double> _ZeroPoint
|
||
|
|
= new Property<double>(
|
||
|
|
typeof(AnalogInputChannel).Namespace + ".Test.Module.AnalogInputChannel.ZeroPoint",
|
||
|
|
0D,
|
||
|
|
false);
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the bridge resistance for this channel.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag( "BridgeResistanceOhms" )]
|
||
|
|
public double BridgeResistanceOhms
|
||
|
|
{
|
||
|
|
get { return _BridgeResistanceOhms.Value; }
|
||
|
|
set { _BridgeResistanceOhms.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<double> _BridgeResistanceOhms
|
||
|
|
= new Property<double>(
|
||
|
|
typeof( AnalogInputChannel ).Namespace + ".Test.Module.AnalogInputChannel.BridgeResistanceOhms",
|
||
|
|
0.0,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the unit conversion for this channel.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag("UnitConversion")]
|
||
|
|
public double UnitConversion
|
||
|
|
{
|
||
|
|
get { return _UnitConversion.Value; }
|
||
|
|
set { _UnitConversion.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<double> _UnitConversion
|
||
|
|
= new Property<double>(
|
||
|
|
typeof(AnalogInputChannel).Namespace + ".Test.Module.AnalogInputChannel.UnitConversion",
|
||
|
|
1.0,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the multiplier for this channel.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag("Multiplier")]
|
||
|
|
public double Multiplier
|
||
|
|
{
|
||
|
|
get { return _Multiplier.Value; }
|
||
|
|
set { _Multiplier.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<double> _Multiplier
|
||
|
|
= new Property<double>(
|
||
|
|
typeof(AnalogInputChannel).Namespace + ".Test.Module.AnalogInputChannel.Multiplier",
|
||
|
|
1.0,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the modified offset for this channel.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag("UserOffsetEU")]
|
||
|
|
public double UserOffsetEU
|
||
|
|
{
|
||
|
|
get { return _UserOffsetEU.Value; }
|
||
|
|
set { _UserOffsetEU.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<double> _UserOffsetEU
|
||
|
|
= new Property<double>(
|
||
|
|
typeof(AnalogInputChannel).Namespace + ".Test.Module.AnalogInputChannel.UserOffsetEU",
|
||
|
|
0.0,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the description for this channel.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag( "Description" )]
|
||
|
|
public string Description
|
||
|
|
{
|
||
|
|
get { return null != _Description.Value ? _Description.Value : ""; }
|
||
|
|
set { _Description.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<string> _Description
|
||
|
|
= new Property<string>(
|
||
|
|
typeof( AnalogInputChannel ).Namespace + ".Test.Module.AnalogInputChannel.Description",
|
||
|
|
"",
|
||
|
|
true
|
||
|
|
);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the manufacture for this channel's sensor.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag("Manufacturer")]
|
||
|
|
public string Manufacturer
|
||
|
|
{
|
||
|
|
get { return null != _Manufacturer.Value ? _Manufacturer.Value : ""; }
|
||
|
|
set { _Manufacturer.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<string> _Manufacturer
|
||
|
|
= new Property<string>(
|
||
|
|
typeof(AnalogInputChannel).Namespace + ".Test.Module.AnalogInputChannel.Manufacturer",
|
||
|
|
"",
|
||
|
|
true
|
||
|
|
);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the model for this channel's sensor.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag("Model")]
|
||
|
|
public string Model
|
||
|
|
{
|
||
|
|
get { return null != _Model.Value ? _Model.Value : ""; }
|
||
|
|
set { _Model.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<string> _Model
|
||
|
|
= new Property<string>(
|
||
|
|
typeof(AnalogInputChannel).Namespace + ".Test.Module.AnalogInputChannel.Model",
|
||
|
|
"",
|
||
|
|
true
|
||
|
|
);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the desired range for this channel.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag( "DesiredRange" )]
|
||
|
|
public double DesiredRange
|
||
|
|
{
|
||
|
|
get { return _DesiredRange.Value; }
|
||
|
|
set { _DesiredRange.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<double> _DesiredRange
|
||
|
|
= new Property<double>(
|
||
|
|
typeof( AnalogInputChannel ).Namespace + ".Test.Module.AnalogInputChannel.DesiredRange",
|
||
|
|
0.0,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the sensitivity for this channel.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag( "Sensitivity" )]
|
||
|
|
public double Sensitivity
|
||
|
|
{
|
||
|
|
get { return _Sensitivity.Value; }
|
||
|
|
set { _Sensitivity.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<double> _Sensitivity
|
||
|
|
= new Property<double>(
|
||
|
|
typeof( AnalogInputChannel ).Namespace + ".Test.Module.AnalogInputChannel.Sensitivity",
|
||
|
|
0.0,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the descriptor indiciating whether or not this channel is
|
||
|
|
/// based on output at capacity.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag("AtCapacity")]
|
||
|
|
public bool AtCapacity
|
||
|
|
{
|
||
|
|
get { return _AtCapacity.Value; }
|
||
|
|
set { _AtCapacity.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<bool> _AtCapacity
|
||
|
|
= new Property<bool>(
|
||
|
|
typeof(AnalogInputChannel).Namespace + ".Test.Module.AnalogInputChannel.AtCapacity",
|
||
|
|
false,
|
||
|
|
true
|
||
|
|
);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the capacity output is based on value for this channel.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag("CapacityOutputIsBasedOn")]
|
||
|
|
public double CapacityOutputIsBasedOn
|
||
|
|
{
|
||
|
|
get { return _CapacityOutputIsBasedOn.Value; }
|
||
|
|
set { _CapacityOutputIsBasedOn.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<double> _CapacityOutputIsBasedOn
|
||
|
|
= new Property<double>(
|
||
|
|
typeof(AnalogInputChannel).Namespace + ".Test.Module.AnalogInputChannel.CapacityOutputIsBasedOn",
|
||
|
|
1.000,
|
||
|
|
true
|
||
|
|
);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the Sensitivity Units for this channel.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag("SensitivityUnits")]
|
||
|
|
public DAS.Concepts.Test.Module.Channel.Sensor.SensUnits SensitivityUnits
|
||
|
|
{
|
||
|
|
get { return _SensitivityUnits.Value; }
|
||
|
|
set { _SensitivityUnits.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<DAS.Concepts.Test.Module.Channel.Sensor.SensUnits> _SensitivityUnits
|
||
|
|
= new Property<DAS.Concepts.Test.Module.Channel.Sensor.SensUnits>(
|
||
|
|
typeof(AnalogInputChannel).Namespace + ".Test.Module.AnalogInputChannel.SensitivityUnits",
|
||
|
|
DAS.Concepts.Test.Module.Channel.Sensor.SensUnits.NONE,
|
||
|
|
true
|
||
|
|
);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the descriptor indiciating whether or not this channel is
|
||
|
|
/// proportional to excitation.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag( "ProportionalToExcitation" )]
|
||
|
|
public bool ProportionalToExcitation
|
||
|
|
{
|
||
|
|
get { return _ProportionalToExcitation.Value; }
|
||
|
|
set { _ProportionalToExcitation.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<bool> _ProportionalToExcitation
|
||
|
|
= new Property<bool>(
|
||
|
|
typeof( AnalogInputChannel ).Namespace + ".Test.Module.AnalogInputChannel.ProportionalToExcitation",
|
||
|
|
false,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the excitation voltage for this channel.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag( "ExcitationVoltage" )]
|
||
|
|
public DAS.Concepts.Test.Module.Channel.Sensor.ExcitationVoltageOption ExcitationVoltage
|
||
|
|
{
|
||
|
|
get { return _ExcitationVoltage.Value; }
|
||
|
|
set { _ExcitationVoltage.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<DAS.Concepts.Test.Module.Channel.Sensor.ExcitationVoltageOption> _ExcitationVoltage
|
||
|
|
= new Property<DAS.Concepts.Test.Module.Channel.Sensor.ExcitationVoltageOption>(
|
||
|
|
typeof( AnalogInputChannel ).Namespace + ".Test.Module.AnalogInputChannel.ExcitationVoltage",
|
||
|
|
DAS.Concepts.Test.Module.Channel.Sensor.ExcitationVoltageOption.Volt5,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
public bool MeasuredExcitationVoltageValid
|
||
|
|
{
|
||
|
|
get { return _MeasuredExcitationVoltage.IsInitialized; }
|
||
|
|
}
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the measured excitation value for this channel.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag( "MeasuredExcitationVoltage" )]
|
||
|
|
public double MeasuredExcitationVoltage
|
||
|
|
{
|
||
|
|
get { return _MeasuredExcitationVoltage.Value; }
|
||
|
|
set { _MeasuredExcitationVoltage.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<double> _MeasuredExcitationVoltage
|
||
|
|
= new Property<double>(
|
||
|
|
typeof( AnalogInputChannel ).Namespace + ".Test.Module.AnalogInputChannel.MeasuredExcitationVoltage",
|
||
|
|
0.0,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
public bool FactoryExcitationVoltageValid
|
||
|
|
{
|
||
|
|
get { return _FactoryExcitationVoltage.IsInitialized; }
|
||
|
|
}
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the factory excitation value for this channel.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag( "FactoryExcitationVoltage" )]
|
||
|
|
public double FactoryExcitationVoltage
|
||
|
|
{
|
||
|
|
get { return _FactoryExcitationVoltage.Value; }
|
||
|
|
set { _FactoryExcitationVoltage.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<double> _FactoryExcitationVoltage
|
||
|
|
= new Property<double>(
|
||
|
|
typeof( AnalogInputChannel ).Namespace + ".Test.Module.AnalogInputChannel.FactoryExcitationVoltage",
|
||
|
|
0.0,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the engineering units for this channel.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag( "Eu" )]
|
||
|
|
public string EngineeringUnits
|
||
|
|
{
|
||
|
|
get { return _EngineeringUnits.Value; }
|
||
|
|
set { _EngineeringUnits.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<string> _EngineeringUnits
|
||
|
|
= new Property<string>(
|
||
|
|
typeof( AnalogInputChannel ).Namespace + ".Test.Module.AnalogInputChannel.EngineeringUnits",
|
||
|
|
null,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the ISO code for this channel's data source.
|
||
|
|
/// </summary>
|
||
|
|
public string IsoCode
|
||
|
|
{
|
||
|
|
get { return _IsoCode.Value; }
|
||
|
|
set { _IsoCode.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<string> _IsoCode
|
||
|
|
= new Property<string>(
|
||
|
|
typeof( AnalogInputChannel ).Namespace + ".Test.Module.AnalogInputChannel.IsoCode",
|
||
|
|
null,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
public bool IsIsoCodeValid
|
||
|
|
{
|
||
|
|
get { return _IsoCode.IsInitialized; }
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
public bool MeasureShuntDeflectionMvValid
|
||
|
|
{
|
||
|
|
get { return _MeasuredShuntDeflectionMv.IsInitialized; }
|
||
|
|
}
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the <see cref="double"/> measured shunt deflection value for this channel.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag( "MeasuredShuntDeflectionMv" )]
|
||
|
|
public double MeasuredShuntDeflectionMv
|
||
|
|
{
|
||
|
|
get { return _MeasuredShuntDeflectionMv.Value; }
|
||
|
|
set { _MeasuredShuntDeflectionMv.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<double> _MeasuredShuntDeflectionMv
|
||
|
|
= new Property<double>(
|
||
|
|
typeof( AnalogInputChannel ).Namespace + ".Test.Module.AnalogInputChannel.MeasuredShuntDeflectionMv",
|
||
|
|
0.0,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
public bool TargetShuntDeflectionMvValid
|
||
|
|
{
|
||
|
|
get { return _TargetShuntDeflectionMv.IsInitialized; }
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the <see cref="double"/> measured gain value for this channel.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag("MeasuredGain")]
|
||
|
|
public double MeasuredGain
|
||
|
|
{
|
||
|
|
get { return _MeasuredGain.Value; }
|
||
|
|
set { _MeasuredGain.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<double> _MeasuredGain
|
||
|
|
= new Property<double>(
|
||
|
|
typeof(AnalogInputChannel).Namespace + ".Test.Module.AnalogInputChannel.MeasuredGain",
|
||
|
|
0.0,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
public bool MeasuredGainValid
|
||
|
|
{
|
||
|
|
get { return _MeasuredGain.IsInitialized; }
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the <see cref="double"/> expected gain value for this channel.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag("ExpectedGain")]
|
||
|
|
public double ExpectedGain
|
||
|
|
{
|
||
|
|
get { return _ExpectedGain.Value; }
|
||
|
|
set { _ExpectedGain.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<double> _ExpectedGain
|
||
|
|
= new Property<double>(
|
||
|
|
typeof(AnalogInputChannel).Namespace + ".Test.Module.AnalogInputChannel.ExpectedGain",
|
||
|
|
0.0,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
public bool ExpectedGainValid
|
||
|
|
{
|
||
|
|
get { return _ExpectedGain.IsInitialized; }
|
||
|
|
}
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the <see cref="double"/> target shunt deflection value for this channel.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag( "TargetShuntDeflectionMv" )]
|
||
|
|
public double TargetShuntDeflectionMv
|
||
|
|
{
|
||
|
|
get { return _TargetShuntDeflectionMv.Value; }
|
||
|
|
set { _TargetShuntDeflectionMv.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<double> _TargetShuntDeflectionMv
|
||
|
|
= new Property<double>(
|
||
|
|
typeof( AnalogInputChannel ).Namespace + ".Test.Module.AnalogInputChannel.TargetShuntDeflectionMv",
|
||
|
|
0.0,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
public bool IsDigital() { return Bridge == DAS.Concepts.Test.Module.Channel.Sensor.BridgeType.DigitalInput; }
|
||
|
|
|
||
|
|
public bool IsSquib()
|
||
|
|
{
|
||
|
|
return ParentModule.SerialNumber.StartsWith("TOM")
|
||
|
|
|| ParentModule.SerialNumber.StartsWith("SPT")
|
||
|
|
|| ParentModule.SerialNumber.StartsWith("SLT");
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get the <see cref="bool"/> whether or not this is really a Squib channel.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag("IsSquibChannel")]
|
||
|
|
public bool IsSquibChannel
|
||
|
|
{
|
||
|
|
get { return IsSquib(); }
|
||
|
|
set { _isSquibChannel.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<bool> _isSquibChannel
|
||
|
|
= new Property<bool>(
|
||
|
|
typeof(AnalogInputChannel).Namespace + ".Test.Module.AnalogInputChannel.IsSquibChannel",
|
||
|
|
false,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
public bool IsSquibVoltage()
|
||
|
|
{
|
||
|
|
return IsSquib()
|
||
|
|
&& EngineeringUnits.Trim().Equals("V")
|
||
|
|
&& (ParentModule.SerialNumber.StartsWith("TOM")
|
||
|
|
|| ParentModule.SerialNumber.StartsWith("DR")
|
||
|
|
|| ParentModule.SerialNumber.StartsWith("SPT")
|
||
|
|
|| ParentModule.SerialNumber.StartsWith("SLT"));
|
||
|
|
}
|
||
|
|
|
||
|
|
public bool MeasuredCalSignalMvValid
|
||
|
|
{
|
||
|
|
get { return _MeasuredCalSignalMv.IsInitialized; }
|
||
|
|
}
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the <see cref="double"/> measured shunt deflection value for this channel.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag("MeasuredCalSignalMv")]
|
||
|
|
public double MeasuredCalSignalMv
|
||
|
|
{
|
||
|
|
get { return _MeasuredCalSignalMv.Value; }
|
||
|
|
set { _MeasuredCalSignalMv.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<double> _MeasuredCalSignalMv
|
||
|
|
= new Property<double>(
|
||
|
|
typeof(AnalogInputChannel).Namespace + ".Test.Module.AnalogInputChannel.MeasuredCalSignalMv",
|
||
|
|
0.0,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
public bool TargetCalSignalMvValid
|
||
|
|
{
|
||
|
|
get { return _TargetCalSignalMv.IsInitialized; }
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the <see cref="double"/> target shunt deflection value for this channel.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag("TargetCalSignalMv")]
|
||
|
|
public double TargetCalSignalMv
|
||
|
|
{
|
||
|
|
get { return _TargetCalSignalMv.Value; }
|
||
|
|
set { _TargetCalSignalMv.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<double> _TargetCalSignalMv
|
||
|
|
= new Property<double>(
|
||
|
|
typeof(AnalogInputChannel).Namespace + ".Test.Module.AnalogInputChannel.TargetShuntCalSignalMv",
|
||
|
|
0.0,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
public bool TriggerBelowThresholdValid { get { return _TriggerBelowThresholdEu.IsInitialized; } }
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the "trigger below" threshold. Set to "null" to deactivate.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag( "TriggerBelowThresholdEu" )]
|
||
|
|
public double? TriggerBelowThresholdEu
|
||
|
|
{
|
||
|
|
get { return _TriggerBelowThresholdEu.Value; }
|
||
|
|
set { _TriggerBelowThresholdEu.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<double?> _TriggerBelowThresholdEu
|
||
|
|
= new Property<double?>(
|
||
|
|
typeof( AnalogInputChannel ).FullName + ".TriggerBelowThresholdEu",
|
||
|
|
null,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
public bool TriggerAboveThresholdValid
|
||
|
|
{
|
||
|
|
get { return _TriggerAboveThresholdEu.IsInitialized; }
|
||
|
|
}
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the "trigger above" threshold. Set to "null" to deactivate.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag( "TriggerAboveThresholdEu" )]
|
||
|
|
public double? TriggerAboveThresholdEu
|
||
|
|
{
|
||
|
|
get { return _TriggerAboveThresholdEu.Value; }
|
||
|
|
set { _TriggerAboveThresholdEu.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<double?> _TriggerAboveThresholdEu
|
||
|
|
= new Property<double?>(
|
||
|
|
typeof( AnalogInputChannel ).FullName + ".TriggerAboveThresholdEu",
|
||
|
|
null,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
[XmlSerializationTag("LevelTriggerType")]
|
||
|
|
public DTS.DAS.Concepts.DAS.Channel.LevelTriggerTypes LevelTriggerType
|
||
|
|
{
|
||
|
|
get { return _levelTriggerType.Value; }
|
||
|
|
set { _levelTriggerType.Value = value; }
|
||
|
|
}
|
||
|
|
public bool LevelTriggerTypeValid
|
||
|
|
{
|
||
|
|
get { return _levelTriggerType.IsValueInitialized; }
|
||
|
|
}
|
||
|
|
private Property<DTS.DAS.Concepts.DAS.Channel.LevelTriggerTypes> _levelTriggerType
|
||
|
|
= new Property<DAS.Concepts.DAS.Channel.LevelTriggerTypes>(
|
||
|
|
typeof(AnalogInputChannel).Namespace + ".Test.Module.AnalogInputChannel.LevelTriggerType",
|
||
|
|
DTS.DAS.Concepts.DAS.Channel.LevelTriggerTypes.NONE,
|
||
|
|
true);
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the serial number for this channel's data source.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag( "SerialNumber" )]
|
||
|
|
public string SerialNumber
|
||
|
|
{
|
||
|
|
get { return _SerialNumber.Value; }
|
||
|
|
set { _SerialNumber.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<string> _SerialNumber
|
||
|
|
= new Property<string>(
|
||
|
|
typeof( AnalogInputChannel ).Namespace +".Test.Module.AnalogInputChannel.SerialNumber",
|
||
|
|
null,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the shunt enable indicator for this channel.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag( "ShuntEnabled" )]
|
||
|
|
public bool ShuntEnabled
|
||
|
|
{
|
||
|
|
get { return _ShuntEnabled.Value; }
|
||
|
|
set { _ShuntEnabled.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<bool> _ShuntEnabled
|
||
|
|
= new Property<bool>(
|
||
|
|
typeof( AnalogInputChannel ).Namespace + ".Test.Module.AnalogInputChannel.ShuntEnabled",
|
||
|
|
false,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the shunt enable indicator for this channel.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag("VoltageInsertionCheckEnabled")]
|
||
|
|
public bool VoltageInsertionCheckEnabled
|
||
|
|
{
|
||
|
|
get { return _VoltageInsertionCheckEnabled.Value; }
|
||
|
|
set { _VoltageInsertionCheckEnabled.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<bool> _VoltageInsertionCheckEnabled
|
||
|
|
= new Property<bool>(
|
||
|
|
typeof(AnalogInputChannel).Namespace + ".Test.Module.AnalogInputChannel.VoltageInsertionCheckEnabled",
|
||
|
|
false,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the shunt enable indicator for this channel.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag("CalSignalEnabled")]
|
||
|
|
public bool CalSignalEnabled
|
||
|
|
{
|
||
|
|
get { return _CalSignalEnabled.Value; }
|
||
|
|
set { _CalSignalEnabled.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<bool> _CalSignalEnabled
|
||
|
|
= new Property<bool>(
|
||
|
|
typeof(AnalogInputChannel).Namespace + ".Test.Module.AnalogInputChannel.CalSignalEnabled",
|
||
|
|
false,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the software filter for this channel's data source.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag( "SoftwareFilter" )]
|
||
|
|
public string SoftwareFilter
|
||
|
|
{
|
||
|
|
get { return _SoftwareFilter.Value; }
|
||
|
|
set { _SoftwareFilter.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<string> _SoftwareFilter
|
||
|
|
= new Property<string>(
|
||
|
|
typeof( AnalogInputChannel ).Namespace + ".Test.Module.AnalogInputChannel.SoftwareFilter",
|
||
|
|
null,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the remove offset option for this channel.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag( "RemoveOffset" )]
|
||
|
|
public bool RemoveOffset
|
||
|
|
{
|
||
|
|
get { return _RemoveOffset.Value; }
|
||
|
|
set { _RemoveOffset.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<bool> _RemoveOffset
|
||
|
|
= new Property<bool>(
|
||
|
|
typeof( AnalogInputChannel ).Namespace + ".Test.Module.AnalogInputChannel.RemoveOffset",
|
||
|
|
false,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the zero method option for this channel.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag( "ZeroMethod" )]
|
||
|
|
public DAS.Concepts.Test.Module.Channel.Sensor.ZeroMethodType ZeroMethod
|
||
|
|
{
|
||
|
|
get
|
||
|
|
{
|
||
|
|
try
|
||
|
|
{
|
||
|
|
if (null != LinearizationFormula && LinearizationFormula.IsValid())
|
||
|
|
{
|
||
|
|
switch (LinearizationFormula.Style)
|
||
|
|
{
|
||
|
|
case DAS.Concepts.LinearizationFormula.Styles.IRTraccDiagnosticsZero: _ZeroMethod.Value = DAS.Concepts.Test.Module.Channel.Sensor.ZeroMethodType.UsePreEventDiagnosticsZero; break;
|
||
|
|
case DAS.Concepts.LinearizationFormula.Styles.IRTraccAverageOverTime: _ZeroMethod.Value = DAS.Concepts.Test.Module.Channel.Sensor.ZeroMethodType.AverageOverTime; break;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
catch (System.Exception) { }
|
||
|
|
return _ZeroMethod.Value;
|
||
|
|
}
|
||
|
|
set { _ZeroMethod.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<DAS.Concepts.Test.Module.Channel.Sensor.ZeroMethodType> _ZeroMethod
|
||
|
|
= new Property<DAS.Concepts.Test.Module.Channel.Sensor.ZeroMethodType>(
|
||
|
|
typeof( AnalogInputChannel ).Namespace + ".Test.Module.AnalogInputChannel.ZeroMethod",
|
||
|
|
DAS.Concepts.Test.Module.Channel.Sensor.ZeroMethodType.AverageOverTime,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set zero average window definition.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag( "ZeroAverageWindow" )]
|
||
|
|
public IntervalSec ZeroAverageWindow
|
||
|
|
{
|
||
|
|
get { return _ZeroAverageWindow.Value; }
|
||
|
|
set { _ZeroAverageWindow.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<IntervalSec> _ZeroAverageWindow
|
||
|
|
= new Property<IntervalSec>(
|
||
|
|
typeof( AnalogInputChannel ).Namespace + ".Test.Module.AnalogInputChannel.ZeroAverageWindow",
|
||
|
|
null,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
private const int InvalidWindowAverage = short.MinValue;
|
||
|
|
/// <summary>
|
||
|
|
/// Get data zero level counts.
|
||
|
|
/// </summary>
|
||
|
|
public override short DataZeroLevelAdc
|
||
|
|
{
|
||
|
|
get
|
||
|
|
{
|
||
|
|
if (null == _DataZeroLevelAdc)
|
||
|
|
{
|
||
|
|
switch (this.ZeroMethod)
|
||
|
|
{
|
||
|
|
case DTS.DAS.Concepts.Test.Module.Channel.Sensor.ZeroMethodType.AverageOverTime:
|
||
|
|
if (WindowAverageADC != InvalidWindowAverage) { _DataZeroLevelAdc = WindowAverageADC; }
|
||
|
|
else
|
||
|
|
{
|
||
|
|
try
|
||
|
|
{
|
||
|
|
double preTriggerSeconds = 0;
|
||
|
|
try
|
||
|
|
{
|
||
|
|
if (null != ParentModule.TriggerSampleNumbers && ParentModule.TriggerSampleNumbers.Count > 0)
|
||
|
|
{
|
||
|
|
preTriggerSeconds = (double)ParentModule.TriggerSampleNumbers[0] - (double)ParentModule.StartRecordSampleNumber;
|
||
|
|
preTriggerSeconds /= ParentModule.SampleRateHz;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
catch { }
|
||
|
|
|
||
|
|
//figure out the average window, get the average in raw adc.
|
||
|
|
//per TJK and MB these values are okay in unfiltered ADC as the averaging mechanism is itself an filter mechanism
|
||
|
|
//and most serious users will have their own zeroing tools
|
||
|
|
double preTriggerTime = 0D;
|
||
|
|
if (null != ParentModule.TriggerSampleNumbers)
|
||
|
|
{
|
||
|
|
preTriggerTime = ((double)ParentModule.TriggerSampleNumbers[0] - (double)ParentModule.StartRecordSampleNumber) / (double)ParentModule.SampleRateHz;
|
||
|
|
}
|
||
|
|
if (preTriggerTime < 0) { preTriggerTime = 0; }
|
||
|
|
try
|
||
|
|
{
|
||
|
|
ulong numSamples = (ulong)((ZeroAverageWindow.End - ZeroAverageWindow.Begin) * ParentModule.SampleRateHz) + 1;
|
||
|
|
double[] windowSamples = new double[numSamples];
|
||
|
|
ulong startingIndex = ((ulong)((preTriggerTime + ZeroAverageWindow.Begin) * ParentModule.SampleRateHz));
|
||
|
|
|
||
|
|
var pc = PersistentChannelInfo;
|
||
|
|
|
||
|
|
int insertPoint = 0;
|
||
|
|
for (ulong i = startingIndex; i < startingIndex + numSamples; i++)
|
||
|
|
{
|
||
|
|
windowSamples[insertPoint++] = Convert.ToDouble(pc[i]);
|
||
|
|
}
|
||
|
|
_DataZeroLevelAdc = Convert.ToInt16(windowSamples.Average());
|
||
|
|
}
|
||
|
|
catch (System.Exception ex)
|
||
|
|
{
|
||
|
|
DTS.Utilities.Logging.APILogger.Log(ex);
|
||
|
|
_DataZeroLevelAdc = PreTestZeroLevelAdc;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
catch (System.Exception ex)
|
||
|
|
{
|
||
|
|
DTS.Utilities.Logging.APILogger.Log(ex);
|
||
|
|
_DataZeroLevelAdc = PreTestZeroLevelAdc;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
|
||
|
|
case DTS.DAS.Concepts.Test.Module.Channel.Sensor.ZeroMethodType.UsePreEventDiagnosticsZero:
|
||
|
|
_DataZeroLevelAdc = PreTestZeroLevelAdc;
|
||
|
|
break;
|
||
|
|
case DTS.DAS.Concepts.Test.Module.Channel.Sensor.ZeroMethodType.None:
|
||
|
|
if (null != LinearizationFormula && LinearizationFormula.IsValid()) { _DataZeroLevelAdc = 0; }
|
||
|
|
else { _DataZeroLevelAdc = ZeroMvInADC; }
|
||
|
|
break;
|
||
|
|
default:
|
||
|
|
throw new NotSupportedException("Test::Module::AnalogInputChannel DataZeroLevelAdc zeromethod not supported, " + ZeroMethod.ToString());
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return (short) _DataZeroLevelAdc;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
private short? _DataZeroLevelAdc = null;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the average value of all ADC so far added to this channel's data set.
|
||
|
|
/// </summary>
|
||
|
|
public AverageShortValueOverTime AverageAdcOverTime
|
||
|
|
{
|
||
|
|
get { return _AverageAdcOverTime.Value; }
|
||
|
|
set { _AverageAdcOverTime.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<AverageShortValueOverTime> _AverageAdcOverTime
|
||
|
|
= new Property<AverageShortValueOverTime>(
|
||
|
|
typeof( AnalogInputChannel ).Namespace + ".Event.Module.AnalogInputChannel.AverageAdcOverTime",
|
||
|
|
null,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the initial EU value.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag( "InitialEu" )]
|
||
|
|
public double InitialEu
|
||
|
|
{
|
||
|
|
get { return _InitialEu.Value; }
|
||
|
|
set { _InitialEu.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<double> _InitialEu
|
||
|
|
= new Property<double>(
|
||
|
|
typeof( AnalogInputChannel ).Namespace + ".Test.Module.AnalogInputChannel.InitialEu",
|
||
|
|
0.0,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
[XmlSerializationTag("InitialOffset")]
|
||
|
|
public string InitialOffset
|
||
|
|
{
|
||
|
|
get { return _initialOffset.Value; }
|
||
|
|
set
|
||
|
|
{
|
||
|
|
_initialOffset.Value = value;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
private Property<string> _initialOffset
|
||
|
|
= new Property<string>(
|
||
|
|
typeof(AnalogInputChannel).Namespace + ".Test.Module.AnalogInputChannel.InitialOffset",
|
||
|
|
"", true);
|
||
|
|
|
||
|
|
private const string BeginTagModifier = "Begin";
|
||
|
|
private const string EndTagModifier = "End";
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the inversion status of this channel.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag("IsInverted")]
|
||
|
|
public bool IsInverted
|
||
|
|
{
|
||
|
|
get { return _IsInverted.Value; }
|
||
|
|
set { _IsInverted.Value = value; }
|
||
|
|
}
|
||
|
|
|
||
|
|
private Property<bool> _IsInverted
|
||
|
|
= new Property<bool>(
|
||
|
|
typeof( AnalogInputChannel ).Namespace + ".Test.Module.AnalogInputChannel.IsInverted",
|
||
|
|
false,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Get/set the Linearization Formula of this channel.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag("LinearizationFormula")]
|
||
|
|
public DTS.DAS.Concepts.LinearizationFormula LinearizationFormula
|
||
|
|
{
|
||
|
|
get { if (!_LinearizationFormula.IsInitialized) { return new LinearizationFormula(); } else { return _LinearizationFormula.Value; } }
|
||
|
|
set { _LinearizationFormula.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<LinearizationFormula> _LinearizationFormula
|
||
|
|
= new Property<LinearizationFormula>(
|
||
|
|
typeof(AnalogInputChannel).Namespace + ".Test.Module.AnalogInputChannel.LinearizationFormula",
|
||
|
|
null,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
|
||
|
|
[XmlSerializationTag("DigitalMultiplier")]
|
||
|
|
public DTS.DAS.Concepts.DigitalInputScaleMultiplier DigitalMultiplier
|
||
|
|
{
|
||
|
|
get
|
||
|
|
{
|
||
|
|
if (!_DigitalMultiplier.IsInitialized || null == _DigitalMultiplier.Value) { _DigitalMultiplier.Value = new DigitalInputScaleMultiplier(); }
|
||
|
|
return _DigitalMultiplier.Value;
|
||
|
|
}
|
||
|
|
set { _DigitalMultiplier.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<DigitalInputScaleMultiplier> _DigitalMultiplier
|
||
|
|
= new Property<DigitalInputScaleMultiplier>(
|
||
|
|
typeof(AnalogInputChannel).Namespace + ".Test.Module.AnalogInputChannel.DigitalMultiplier",
|
||
|
|
null,
|
||
|
|
false);
|
||
|
|
|
||
|
|
|
||
|
|
[XmlSerializationTag("DigitalMode")]
|
||
|
|
public DTS.DAS.Concepts.DigitalInputScaleMultiplier.InputModes DigitalMode
|
||
|
|
{
|
||
|
|
get { if (!_digitalMode.IsInitialized) { return DigitalInputScaleMultiplier.InputModes.CCNC; } else { return _digitalMode.Value; } }
|
||
|
|
set { _digitalMode.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<DigitalInputScaleMultiplier.InputModes> _digitalMode
|
||
|
|
= new Property<DigitalInputScaleMultiplier.InputModes>(
|
||
|
|
typeof(AnalogInputChannel).Namespace + ".Test.Module.AnalogInputChannel.DigitalMode",
|
||
|
|
DTS.DAS.Concepts.DigitalInputScaleMultiplier.InputModes.CCNC, true
|
||
|
|
);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// The original sensor capacity from the sensor database.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag("SensorCapacity")]
|
||
|
|
public double SensorCapacity
|
||
|
|
{
|
||
|
|
get { return _sensorCapacity.Value; }
|
||
|
|
set { _sensorCapacity.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<double> _sensorCapacity
|
||
|
|
= new Property<double>(
|
||
|
|
typeof(AnalogInputChannel).Namespace + ".Test.Module.AnalogInputChannel.SensorCapacity",
|
||
|
|
0.0,
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// The name of the .chn file in the Binary folder that corresponds to this channel.
|
||
|
|
/// </summary>
|
||
|
|
[XmlSerializationTag("FileName")]
|
||
|
|
public string FileName
|
||
|
|
{
|
||
|
|
get { return _fileName.Value; }
|
||
|
|
set { _fileName.Value = value; }
|
||
|
|
}
|
||
|
|
private Property<string> _fileName
|
||
|
|
= new Property<string>(
|
||
|
|
typeof(AnalogInputChannel).Namespace + ".Test.Module.AnalogInputChannel.FileName",
|
||
|
|
"",
|
||
|
|
false
|
||
|
|
);
|
||
|
|
|
||
|
|
/// <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 override void WriteXml(XmlWriter writer)
|
||
|
|
{
|
||
|
|
AttributeExtractor<XmlSerializationTagAttribute> attributeExtractor = new AttributeExtractor<XmlSerializationTagAttribute>();
|
||
|
|
writer.WriteStartElement(attributeExtractor.ExtractAttachedAttributeFromObject(this).Value);
|
||
|
|
|
||
|
|
writeXmlAttributes(writer);
|
||
|
|
|
||
|
|
writer.WriteEndElement();
|
||
|
|
}
|
||
|
|
|
||
|
|
protected void writeXmlAttributes(XmlWriter writer)
|
||
|
|
{
|
||
|
|
int line = 0;
|
||
|
|
try
|
||
|
|
{
|
||
|
|
var cult = System.Globalization.CultureInfo.InvariantCulture;
|
||
|
|
DTS.Utilities.Logging.APILogger.Log(string.Format("{0} number : ", System.Reflection.MethodBase.GetCurrentMethod().Name, this.SerialNumber.ToString(cult)));
|
||
|
|
|
||
|
|
AttributeExtractor<XmlSerializationTagAttribute> attributeExtractor = new AttributeExtractor<XmlSerializationTagAttribute>();
|
||
|
|
|
||
|
|
line = 2;
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "ChannelType").Value, this.ChannelType.ToString(cult));
|
||
|
|
line = 3;
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "Number").Value, this.Number.ToString(cult));
|
||
|
|
line = 4;
|
||
|
|
try
|
||
|
|
{
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "DigitalMultiplier").Value, this.DigitalMultiplier.ToSerializeDbString());
|
||
|
|
}
|
||
|
|
catch (System.Exception) { }
|
||
|
|
line = 5;
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "DigitalMode").Value, this.DigitalMode.ToString());
|
||
|
|
line = 6;
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "Start").Value, this.Start.ToString(cult));
|
||
|
|
line = 7;
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "Bridge").Value, this.Bridge.ToString());
|
||
|
|
line = 8;
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "BridgeResistanceOhms").Value, this.BridgeResistanceOhms.ToString(cult));
|
||
|
|
|
||
|
|
writer.WriteAttributeString(
|
||
|
|
attributeExtractor.ExtractAttachedAttributeFromProperty(this, "ZeroPoint").Value,
|
||
|
|
this.ZeroPoint.ToString(cult));
|
||
|
|
|
||
|
|
line = 9;
|
||
|
|
try
|
||
|
|
{
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "ChannelDescriptionString").Value, this.ChannelDescriptionString.ToString(cult));
|
||
|
|
}
|
||
|
|
catch { }
|
||
|
|
line = 10;
|
||
|
|
try
|
||
|
|
{
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "ChannelName2").Value, this.ChannelName2.ToString());
|
||
|
|
}
|
||
|
|
catch { }
|
||
|
|
try
|
||
|
|
{
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "ChannelId").Value, this.ChannelId);
|
||
|
|
}
|
||
|
|
catch (System.Exception) { }
|
||
|
|
line = 11;
|
||
|
|
try
|
||
|
|
{
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "HardwareChannelName").Value, this.HardwareChannelName.ToString());
|
||
|
|
}
|
||
|
|
catch { }
|
||
|
|
line = 12;
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "Description").Value, this.Description.ToString(cult));
|
||
|
|
line = 13;
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "DesiredRange").Value, this.DesiredRange.ToString(cult));
|
||
|
|
line = 14;
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "Sensitivity").Value, this.Sensitivity.ToString(cult));
|
||
|
|
line = 15;
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "SoftwareFilter").Value, this.SoftwareFilter.ToString(cult));
|
||
|
|
line = 16;
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "ProportionalToExcitation").Value, this.ProportionalToExcitation.ToString(cult));
|
||
|
|
line = 17;
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "IsInverted").Value, this.IsInverted.ToString(cult));
|
||
|
|
line = 18;
|
||
|
|
if (null == LinearizationFormula) { LinearizationFormula = new LinearizationFormula(); }
|
||
|
|
line = 19;
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "LinearizationFormula").Value, this.LinearizationFormula.ToSerializeString());
|
||
|
|
line = 20;
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "IsSubsampled").Value, this.IsSubsampled.ToString(cult));
|
||
|
|
line = 21;
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "AbsoluteDisplayOrder").Value, this.AbsoluteDisplayOrder.ToString(cult));
|
||
|
|
line = 22;
|
||
|
|
if (this.IsLastCalibrationDateValid)
|
||
|
|
{
|
||
|
|
line = 23;
|
||
|
|
try
|
||
|
|
{
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "LastCalibrationDate").Value, this.LastCalibrationDate.ToString(cult));
|
||
|
|
}
|
||
|
|
catch { }
|
||
|
|
}
|
||
|
|
if (null == SensorID) { SensorID = ""; }
|
||
|
|
if (this.IsSensorIDValid)
|
||
|
|
{
|
||
|
|
line = 24;
|
||
|
|
try
|
||
|
|
{
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "SensorID").Value, this.SensorID.ToString());
|
||
|
|
}
|
||
|
|
catch { }
|
||
|
|
}
|
||
|
|
if (this.IsOffsetToleranceLowMvValid)
|
||
|
|
{
|
||
|
|
line = 25;
|
||
|
|
try
|
||
|
|
{
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "OffsetToleranceLowMv").Value, this.OffsetToleranceLowMv.ToString(cult));
|
||
|
|
}
|
||
|
|
catch { }
|
||
|
|
}
|
||
|
|
if (this.IsOffsetToleranceHighMvValid)
|
||
|
|
{
|
||
|
|
line = 26;
|
||
|
|
try
|
||
|
|
{
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "OffsetToleranceHighMv").Value, this.OffsetToleranceHighMv.ToString(cult));
|
||
|
|
}
|
||
|
|
catch { }
|
||
|
|
}
|
||
|
|
|
||
|
|
if (this.IsDataFlagValid)
|
||
|
|
{
|
||
|
|
try { writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "DataFlag").Value, this.DataFlag.ToString(cult)); }
|
||
|
|
catch { }
|
||
|
|
}
|
||
|
|
line = 27;
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "ExcitationVoltage").Value, this.ExcitationVoltage.ToString());
|
||
|
|
line = 28;
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "EngineeringUnits").Value, this.EngineeringUnits.ToString(cult));
|
||
|
|
line = 29;
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "SerialNumber").Value, this.SerialNumber.ToString(cult));
|
||
|
|
line = 30;
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "CalSignalEnabled").Value, this.CalSignalEnabled.ToString(cult));
|
||
|
|
line = 31;
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "ShuntEnabled").Value, this.ShuntEnabled.ToString(cult));
|
||
|
|
line = 32;
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "VoltageInsertionCheckEnabled").Value, this.VoltageInsertionCheckEnabled.ToString(cult));
|
||
|
|
line = 33;
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "RemoveOffset").Value, this.RemoveOffset.ToString(cult));
|
||
|
|
//writer.WriteAttributeString( attributeExtractor.ExtractAttachedAttributeFromProperty( this, "ZeroMethod" ).Value, this.ZeroMethod .ToString( ) );
|
||
|
|
line = 34;
|
||
|
|
switch (ZeroMethod)
|
||
|
|
{
|
||
|
|
case DTS.DAS.Concepts.Test.Module.Channel.Sensor.ZeroMethodType.UsePreEventDiagnosticsZero:
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "ZeroMethod").Value, "UsePreCalZero");
|
||
|
|
break;
|
||
|
|
default:
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "ZeroMethod").Value, this.ZeroMethod.ToString());
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
line = 35;
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "ZeroAverageWindow").Value + BeginTagModifier, this.ZeroAverageWindow.Begin.ToString(cult));
|
||
|
|
line = 36;
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "ZeroAverageWindow").Value + EndTagModifier, this.ZeroAverageWindow.End.ToString(cult));
|
||
|
|
line = 37;
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "InitialEu").Value, this.InitialEu.ToString(cult));
|
||
|
|
line = 38;
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "InitialOffset").Value, InitialOffset);
|
||
|
|
line = 39;
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "UnsubsampledSampleRateHz").Value, this.UnsubsampledSampleRateHz.ToString(cult));
|
||
|
|
line = 40;
|
||
|
|
if (!string.IsNullOrEmpty(UserValue1))
|
||
|
|
{
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "UserValue1").Value, this.UserValue1);
|
||
|
|
}
|
||
|
|
line = 41;
|
||
|
|
if (!string.IsNullOrEmpty(UserValue2))
|
||
|
|
{
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "UserValue2").Value, this.UserValue2);
|
||
|
|
}
|
||
|
|
line = 42;
|
||
|
|
if (!string.IsNullOrEmpty(UserValue3))
|
||
|
|
{
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "UserValue3").Value, this.UserValue3);
|
||
|
|
}
|
||
|
|
line = 43;
|
||
|
|
// Potentially valid "uninitialized" values need special handling.
|
||
|
|
if (this._MeasuredShuntDeflectionMv.IsInitialized)
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "MeasuredShuntDeflectionMv").Value, this.MeasuredShuntDeflectionMv.ToString(cult));
|
||
|
|
line = 44;
|
||
|
|
if (this._MeasuredGain.IsInitialized)
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "MeasuredGain").Value, this.MeasuredGain.ToString(cult));
|
||
|
|
line = 45;
|
||
|
|
if (this._ExpectedGain.IsInitialized)
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "ExpectedGain").Value, this.ExpectedGain.ToString(cult));
|
||
|
|
line = 46;
|
||
|
|
if (this._TargetShuntDeflectionMv.IsInitialized)
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "TargetShuntDeflectionMv").Value, this.TargetShuntDeflectionMv.ToString(cult));
|
||
|
|
line = 47;
|
||
|
|
if (this._MeasuredCalSignalMv.IsInitialized)
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "MeasuredCalSignalMv").Value, this.MeasuredCalSignalMv.ToString(cult));
|
||
|
|
line = 48;
|
||
|
|
if (this._TargetCalSignalMv.IsInitialized)
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "TargetCalSignalMv").Value, this.TargetCalSignalMv.ToString(cult));
|
||
|
|
line = 49;
|
||
|
|
if (this._MeasuredExcitationVoltage.IsInitialized)
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "MeasuredExcitationVoltage").Value, this.MeasuredExcitationVoltage.ToString(cult));
|
||
|
|
line = 50;
|
||
|
|
if (this._FactoryExcitationVoltage.IsInitialized)
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "FactoryExcitationVoltage").Value, this.FactoryExcitationVoltage.ToString(cult));
|
||
|
|
line = 51;
|
||
|
|
if (this._TimeOfFirstSampleSec.IsInitialized)
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "TimeOfFirstSampleSec").Value, this.TimeOfFirstSampleSec.ToString(cult));
|
||
|
|
line = 52;
|
||
|
|
// Potentially valid "uninitialized" and/or nullable values need special handling.
|
||
|
|
if (this._TriggerAboveThresholdEu.IsInitialized && null != TriggerAboveThresholdEu)
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "TriggerAboveThresholdEu").Value, ((double)this.TriggerAboveThresholdEu).ToString(cult));
|
||
|
|
line = 53;
|
||
|
|
if (this._TriggerBelowThresholdEu.IsInitialized && null != TriggerBelowThresholdEu)
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "TriggerBelowThresholdEu").Value, ((double)this.TriggerBelowThresholdEu).ToString(cult));
|
||
|
|
line = 54;
|
||
|
|
if (this._Multiplier.IsInitialized)
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "Multiplier").Value, this.Multiplier.ToString(cult));
|
||
|
|
line = 55;
|
||
|
|
if (this._UserOffsetEU.IsInitialized)
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "UserOffsetEU").Value, this.UserOffsetEU.ToString(cult));
|
||
|
|
line = 56;
|
||
|
|
if (this._UnitConversion.IsInitialized)
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "UnitConversion").Value, this.UnitConversion.ToString(cult));
|
||
|
|
line = 57;
|
||
|
|
if (this._AtCapacity.IsInitialized)
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "AtCapacity").Value, this.AtCapacity.ToString(cult));
|
||
|
|
line = 58;
|
||
|
|
if (this._CapacityOutputIsBasedOn.IsInitialized)
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "CapacityOutputIsBasedOn").Value, this.CapacityOutputIsBasedOn.ToString(cult));
|
||
|
|
line = 59;
|
||
|
|
if (this._SensitivityUnits.IsInitialized)
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "SensitivityUnits").Value, this.SensitivityUnits.ToString());
|
||
|
|
line = 60;
|
||
|
|
if (this._isSquibChannel.IsInitialized)
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "IsSquibChannel").Value, this.IsSquibChannel.ToString(cult));
|
||
|
|
line = 61;
|
||
|
|
if (this._sensorCapacity.IsInitialized)
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "SensorCapacity").Value, this.SensorCapacity.ToString(cult));
|
||
|
|
line = 62;
|
||
|
|
if (ExpressDataInlineOnXmlSerialization)
|
||
|
|
this.Data.WriteXml(writer);
|
||
|
|
line = 63;
|
||
|
|
try
|
||
|
|
{
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "ChannelGroupName").Value, this.ChannelGroupName);
|
||
|
|
}
|
||
|
|
catch (System.Exception) { }
|
||
|
|
line = 64;
|
||
|
|
if (this._Manufacturer.IsInitialized)
|
||
|
|
{
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "Manufacturer").Value, this.Manufacturer.ToString(cult));
|
||
|
|
}
|
||
|
|
line = 65;
|
||
|
|
if (this._Model.IsInitialized)
|
||
|
|
{
|
||
|
|
writer.WriteAttributeString(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "Model").Value, this.Model.ToString(cult));
|
||
|
|
}
|
||
|
|
line = 66;
|
||
|
|
}
|
||
|
|
catch (System.Exception ex)
|
||
|
|
{
|
||
|
|
throw new Exception("encountered problem converting " + this.GetType().FullName + " object to XML, Line: " + line.ToString(), ex);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <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>
|
||
|
|
///
|
||
|
|
//Note: This does not read in the parent (Channel) xml
|
||
|
|
public override void ReadXml(XmlReader reader)
|
||
|
|
{
|
||
|
|
try
|
||
|
|
{
|
||
|
|
var cult = new System.Globalization.CultureInfo("");
|
||
|
|
AttributeExtractor<XmlSerializationTagAttribute> attributeExtractor = new AttributeExtractor<XmlSerializationTagAttribute>();
|
||
|
|
|
||
|
|
DTS.Utilities.Xml.PropertyAttributeDecoder<Test.Module.AnalogInputChannel> xmlAttributeDecoder
|
||
|
|
= new PropertyAttributeDecoder<AnalogInputChannel>(this);
|
||
|
|
|
||
|
|
if (null != reader.GetAttribute("AbsoluteDisplayOrder"))
|
||
|
|
{
|
||
|
|
try { this.AbsoluteDisplayOrder = xmlAttributeDecoder.ExtractIntProperty("AbsoluteDisplayOrder", reader); }
|
||
|
|
catch (System.Exception) { }
|
||
|
|
}
|
||
|
|
|
||
|
|
if (null != reader.GetAttribute("Multiplier"))
|
||
|
|
{
|
||
|
|
try { this.Data.Multiplier = xmlAttributeDecoder.ExtractDoubleProperty("Multiplier", reader); }
|
||
|
|
catch (System.Exception ex) { string temp2 = ex.Message; }
|
||
|
|
}
|
||
|
|
|
||
|
|
if (null != reader.GetAttribute("UnitConversion"))
|
||
|
|
{
|
||
|
|
try { this.Data.UnitConversion = xmlAttributeDecoder.ExtractDoubleProperty("UnitConversion", reader); }
|
||
|
|
catch (System.Exception ex) { string temp2 = ex.Message; }
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
if (null != reader.GetAttribute("UserOffsetEU"))
|
||
|
|
{
|
||
|
|
try { this.Data.UserOffsetEU = xmlAttributeDecoder.ExtractDoubleProperty("UserOffsetEU", reader); }
|
||
|
|
catch (System.Exception ex) { string temp2 = ex.Message; }
|
||
|
|
}
|
||
|
|
|
||
|
|
if (null != reader.GetAttribute("AtCapacity"))
|
||
|
|
{
|
||
|
|
try { this.AtCapacity = xmlAttributeDecoder.ExtractBoolProperty("AtCapacity", reader, false); }
|
||
|
|
catch (System.Exception ex) { string temp2 = ex.Message; }
|
||
|
|
}
|
||
|
|
|
||
|
|
if (null != reader.GetAttribute("CapacityOutputIsBasedOn"))
|
||
|
|
{
|
||
|
|
try { this.CapacityOutputIsBasedOn = xmlAttributeDecoder.ExtractDoubleProperty("CapacityOutputIsBasedOn", reader); }
|
||
|
|
catch (System.Exception ex) { string temp2 = ex.Message; }
|
||
|
|
}
|
||
|
|
|
||
|
|
if (null != reader.GetAttribute("SensitivityUnits"))
|
||
|
|
{
|
||
|
|
try { this.SensitivityUnits = (DTS.DAS.Concepts.Test.Module.Channel.Sensor.SensUnits)xmlAttributeDecoder.ExtractEnumProperty("SensitivityUnits", typeof(DTS.DAS.Concepts.Test.Module.Channel.Sensor.SensUnits), reader); }
|
||
|
|
catch (System.Exception ex) { string temp2 = ex.Message; }
|
||
|
|
}
|
||
|
|
this.Number = xmlAttributeDecoder.ExtractIntProperty("Number", reader);
|
||
|
|
this.BridgeResistanceOhms = xmlAttributeDecoder.ExtractDoubleProperty("BridgeResistanceOhms", reader);
|
||
|
|
try
|
||
|
|
{
|
||
|
|
if (null != reader.GetAttribute("ZeroPoint"))
|
||
|
|
{
|
||
|
|
this.ZeroPoint = xmlAttributeDecoder.ExtractDoubleProperty("ZeroPoint", reader);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
catch (System.Exception)
|
||
|
|
{
|
||
|
|
}
|
||
|
|
this.ChannelDescriptionString = xmlAttributeDecoder.ExtractStringProperty("ChannelDescriptionString", reader);
|
||
|
|
try
|
||
|
|
{
|
||
|
|
this.ChannelName2 = xmlAttributeDecoder.ExtractStringProperty("ChannelName2", reader);
|
||
|
|
}
|
||
|
|
catch (System.Exception) { }
|
||
|
|
try
|
||
|
|
{
|
||
|
|
this.HardwareChannelName = xmlAttributeDecoder.ExtractStringProperty("HardwareChannelName", reader);
|
||
|
|
}
|
||
|
|
catch (System.Exception) { }
|
||
|
|
try
|
||
|
|
{
|
||
|
|
this.ChannelId = xmlAttributeDecoder.ExtractStringProperty("ChannelId", reader);
|
||
|
|
}
|
||
|
|
catch (System.Exception) { }
|
||
|
|
try
|
||
|
|
{
|
||
|
|
this.ChannelGroupName = xmlAttributeDecoder.ExtractStringProperty("ChannelGroupName", reader);
|
||
|
|
}
|
||
|
|
catch (System.Exception) { }
|
||
|
|
|
||
|
|
this.DesiredRange = xmlAttributeDecoder.ExtractDoubleProperty("DesiredRange", reader);
|
||
|
|
this.Description = xmlAttributeDecoder.ExtractStringProperty("Description", reader);
|
||
|
|
this.Manufacturer = xmlAttributeDecoder.ExtractStringProperty("Manufacturer", reader);
|
||
|
|
this.Model = xmlAttributeDecoder.ExtractStringProperty("Model", reader);
|
||
|
|
this.EngineeringUnits = xmlAttributeDecoder.ExtractStringProperty("EngineeringUnits", reader);
|
||
|
|
|
||
|
|
try
|
||
|
|
{
|
||
|
|
this.InitialOffset = xmlAttributeDecoder.ExtractStringProperty("InitialOffset", reader);
|
||
|
|
}
|
||
|
|
catch (System.Exception) { }
|
||
|
|
|
||
|
|
this.InitialEu = xmlAttributeDecoder.ExtractDoubleProperty("InitialEu", reader);
|
||
|
|
this.ProportionalToExcitation = xmlAttributeDecoder.ExtractBoolProperty("ProportionalToExcitation", reader);
|
||
|
|
this.RemoveOffset = xmlAttributeDecoder.ExtractBoolProperty("RemoveOffset", reader);
|
||
|
|
this.Sensitivity = xmlAttributeDecoder.ExtractDoubleProperty("Sensitivity", reader);
|
||
|
|
|
||
|
|
try
|
||
|
|
{
|
||
|
|
DateTime dt;
|
||
|
|
if (DateTime.TryParse(xmlAttributeDecoder.ExtractStringProperty("LastCalibrationDate", reader), cult, System.Globalization.DateTimeStyles.None, out dt))
|
||
|
|
{
|
||
|
|
this.LastCalibrationDate = dt;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
catch { }
|
||
|
|
|
||
|
|
this.SerialNumber = xmlAttributeDecoder.ExtractStringProperty("SerialNumber", reader);
|
||
|
|
try { this.CalSignalEnabled = xmlAttributeDecoder.ExtractBoolProperty("CalSignalEnabled", reader, false); }
|
||
|
|
catch { CalSignalEnabled = false; }
|
||
|
|
this.ShuntEnabled = xmlAttributeDecoder.ExtractBoolProperty("ShuntEnabled", reader);
|
||
|
|
try
|
||
|
|
{
|
||
|
|
this.VoltageInsertionCheckEnabled = xmlAttributeDecoder.ExtractBoolProperty("VoltageInsertionCheckEnabled", reader, false);
|
||
|
|
}
|
||
|
|
catch { VoltageInsertionCheckEnabled = false; }
|
||
|
|
this.SoftwareFilter = xmlAttributeDecoder.ExtractStringProperty("SoftwareFilter", reader);
|
||
|
|
|
||
|
|
this.Bridge = (DTS.DAS.Concepts.Test.Module.Channel.Sensor.BridgeType)xmlAttributeDecoder.ExtractEnumProperty("Bridge", typeof(DTS.DAS.Concepts.Test.Module.Channel.Sensor.BridgeType), reader);
|
||
|
|
this.ExcitationVoltage = (DTS.DAS.Concepts.Test.Module.Channel.Sensor.ExcitationVoltageOption)xmlAttributeDecoder.ExtractEnumProperty("ExcitationVoltage", typeof(DTS.DAS.Concepts.Test.Module.Channel.Sensor.ExcitationVoltageOption), reader);
|
||
|
|
|
||
|
|
string sZeroMethod = xmlAttributeDecoder.ExtractStringProperty("ZeroMethod", reader);
|
||
|
|
try
|
||
|
|
{
|
||
|
|
if (null != sZeroMethod && "UsePreCalZero" == sZeroMethod)
|
||
|
|
{
|
||
|
|
this.ZeroMethod = DTS.DAS.Concepts.Test.Module.Channel.Sensor.ZeroMethodType.UsePreEventDiagnosticsZero;
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
this.ZeroMethod = (DAS.Concepts.Test.Module.Channel.Sensor.ZeroMethodType)Enum.Parse(typeof(DAS.Concepts.Test.Module.Channel.Sensor.ZeroMethodType), sZeroMethod);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
catch
|
||
|
|
{
|
||
|
|
DTS.DAS.Concepts.Test.Module.Channel.Sensor.OriginalZeroMethodType originalZeroMethodType
|
||
|
|
= (DTS.DAS.Concepts.Test.Module.Channel.Sensor.OriginalZeroMethodType)xmlAttributeDecoder.ExtractEnumProperty("ZeroMethod", typeof(DTS.DAS.Concepts.Test.Module.Channel.Sensor.OriginalZeroMethodType), reader);
|
||
|
|
switch (originalZeroMethodType)
|
||
|
|
{
|
||
|
|
case DTS.DAS.Concepts.Test.Module.Channel.Sensor.OriginalZeroMethodType.AverageOverTime:
|
||
|
|
this.ZeroMethod = DTS.DAS.Concepts.Test.Module.Channel.Sensor.ZeroMethodType.AverageOverTime;
|
||
|
|
break;
|
||
|
|
|
||
|
|
case DTS.DAS.Concepts.Test.Module.Channel.Sensor.OriginalZeroMethodType.UsePreCalZero:
|
||
|
|
this.ZeroMethod = DTS.DAS.Concepts.Test.Module.Channel.Sensor.ZeroMethodType.UsePreEventDiagnosticsZero;
|
||
|
|
break;
|
||
|
|
|
||
|
|
case DTS.DAS.Concepts.Test.Module.Channel.Sensor.OriginalZeroMethodType.None:
|
||
|
|
this.ZeroMethod = DTS.DAS.Concepts.Test.Module.Channel.Sensor.ZeroMethodType.None;
|
||
|
|
break;
|
||
|
|
|
||
|
|
default://
|
||
|
|
// If we've gotten here, we've changed the enum and forgotten to put in
|
||
|
|
// a corresponding conversion.
|
||
|
|
//
|
||
|
|
Debug.Assert(false);
|
||
|
|
this.ZeroMethod = DTS.DAS.Concepts.Test.Module.Channel.Sensor.ZeroMethodType.None;
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
try
|
||
|
|
{
|
||
|
|
this.UnsubsampledSampleRateHz = float.Parse(reader.GetAttribute(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "UnsubsampledSampleRateHz").Value), cult);
|
||
|
|
}
|
||
|
|
catch ( System.Exception ) { this.UnsubsampledSampleRateHz = ParentModule.SampleRateHz; }
|
||
|
|
|
||
|
|
try
|
||
|
|
{
|
||
|
|
this.UserValue1 = xmlAttributeDecoder.ExtractStringProperty("UserValue1", reader);
|
||
|
|
}
|
||
|
|
catch (System.Exception) { }
|
||
|
|
try
|
||
|
|
{
|
||
|
|
this.UserValue2 = xmlAttributeDecoder.ExtractStringProperty("UserValue2", reader);
|
||
|
|
}
|
||
|
|
catch (System.Exception) { }
|
||
|
|
try
|
||
|
|
{
|
||
|
|
this.UserValue3 = xmlAttributeDecoder.ExtractStringProperty("UserValue3", reader);
|
||
|
|
}
|
||
|
|
catch (System.Exception) { }
|
||
|
|
|
||
|
|
double temp;
|
||
|
|
//try { this.MeasuredShuntDeflectionMv = double.Parse( reader.GetAttribute(attributeExtractor.ExtractAttachedAttributeFromProperty ( this, "MeasuredShuntDeflectionMv" ).Value ), cult ); }
|
||
|
|
//catch ( System.Exception ) { /*this.MeasuredShuntDeflectionMv = 0.0;*/ }
|
||
|
|
try
|
||
|
|
{
|
||
|
|
if (double.TryParse(reader.GetAttribute(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "MeasuredShuntDeflectionMv").Value), System.Globalization.NumberStyles.Any, cult, out temp))
|
||
|
|
{
|
||
|
|
this.MeasuredShuntDeflectionMv = temp;
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
catch (System.Exception) { }
|
||
|
|
|
||
|
|
try
|
||
|
|
{
|
||
|
|
if (double.TryParse(reader.GetAttribute(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "MeasuredGain").Value), System.Globalization.NumberStyles.Any, cult, out temp))
|
||
|
|
{
|
||
|
|
this.MeasuredGain = temp;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
catch (System.Exception) { }
|
||
|
|
|
||
|
|
try
|
||
|
|
{
|
||
|
|
if (double.TryParse(reader.GetAttribute(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "ExpectedGain").Value), System.Globalization.NumberStyles.Any, cult, out temp))
|
||
|
|
{
|
||
|
|
this.ExpectedGain = temp;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
catch (System.Exception) { }
|
||
|
|
|
||
|
|
try
|
||
|
|
{
|
||
|
|
if (double.TryParse(reader.GetAttribute(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "TargetShuntDeflectionMv").Value), System.Globalization.NumberStyles.Any, cult, out temp))
|
||
|
|
{
|
||
|
|
this.TargetShuntDeflectionMv = temp;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
catch (System.Exception) { }
|
||
|
|
|
||
|
|
try
|
||
|
|
{
|
||
|
|
if (double.TryParse(reader.GetAttribute(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "MeasuredCalSignalMv").Value), System.Globalization.NumberStyles.Any, cult, out temp))
|
||
|
|
{
|
||
|
|
this.MeasuredCalSignalMv = temp;
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
catch (System.Exception) { }
|
||
|
|
|
||
|
|
try
|
||
|
|
{
|
||
|
|
if (double.TryParse(reader.GetAttribute(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "TargetCalSignalMv").Value), System.Globalization.NumberStyles.Any, cult, out temp))
|
||
|
|
{
|
||
|
|
this.TargetCalSignalMv = temp;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
catch (System.Exception) { }
|
||
|
|
|
||
|
|
try
|
||
|
|
{
|
||
|
|
if (double.TryParse(reader.GetAttribute(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "TriggerAboveThresholdEu").Value), System.Globalization.NumberStyles.Any, cult, out temp))
|
||
|
|
{
|
||
|
|
this.TriggerAboveThresholdEu = temp;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
catch (System.Exception) { }
|
||
|
|
|
||
|
|
try
|
||
|
|
{
|
||
|
|
if (double.TryParse(reader.GetAttribute(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "TriggerBelowThresholdEu").Value), System.Globalization.NumberStyles.Any, cult, out temp))
|
||
|
|
{
|
||
|
|
this.TriggerBelowThresholdEu = temp;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
catch { }
|
||
|
|
|
||
|
|
|
||
|
|
try
|
||
|
|
{
|
||
|
|
if (double.TryParse(reader.GetAttribute(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "MeasuredExcitationVoltage").Value), System.Globalization.NumberStyles.Float, cult, out temp))
|
||
|
|
{
|
||
|
|
this.MeasuredExcitationVoltage = temp;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
catch (System.Exception) { /* leave it uninitialized */ }
|
||
|
|
|
||
|
|
try
|
||
|
|
{
|
||
|
|
if (double.TryParse(reader.GetAttribute(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "FactoryExcitationVoltage").Value), System.Globalization.NumberStyles.Float, cult, out temp))
|
||
|
|
{
|
||
|
|
this.FactoryExcitationVoltage = temp;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
catch (System.Exception) { /* leave it uninitialized */ }
|
||
|
|
|
||
|
|
try
|
||
|
|
{
|
||
|
|
if (double.TryParse(reader.GetAttribute(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "TimeOfFirstSampleSec").Value), System.Globalization.NumberStyles.Float, cult, out temp))
|
||
|
|
{
|
||
|
|
this.TimeOfFirstSampleSec = temp;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
catch (System.Exception) { }
|
||
|
|
|
||
|
|
|
||
|
|
try { this.IsInverted = xmlAttributeDecoder.ExtractBoolProperty("IsInverted", reader, false); }
|
||
|
|
catch (System.Exception) { this.IsInverted = false; }
|
||
|
|
|
||
|
|
try { this.IsSubsampled = xmlAttributeDecoder.ExtractBoolProperty("IsSubsampled", reader, false); }
|
||
|
|
catch (System.Exception) { this.IsSubsampled = false; }
|
||
|
|
|
||
|
|
try
|
||
|
|
{
|
||
|
|
this.LinearizationFormula = new LinearizationFormula();
|
||
|
|
this.LinearizationFormula.FromSerializeString(xmlAttributeDecoder.ExtractStringProperty("LinearizationFormula", reader));
|
||
|
|
}
|
||
|
|
catch (System.Exception) { this.LinearizationFormula = null; }
|
||
|
|
|
||
|
|
try
|
||
|
|
{
|
||
|
|
this.DigitalMultiplier = new DTS.DAS.Concepts.DigitalInputScaleMultiplier();
|
||
|
|
this.DigitalMultiplier.FromDbSerializeString(xmlAttributeDecoder.ExtractStringProperty("DigitalMultiplier", reader));
|
||
|
|
}
|
||
|
|
catch (System.Exception) { this.DigitalMultiplier = new DTS.DAS.Concepts.DigitalInputScaleMultiplier(); }
|
||
|
|
|
||
|
|
try
|
||
|
|
{
|
||
|
|
DTS.DAS.Concepts.DigitalInputScaleMultiplier.InputModes mode = DigitalInputScaleMultiplier.InputModes.CCNC;
|
||
|
|
Enum.TryParse(xmlAttributeDecoder.ExtractStringProperty("DigitalMode", reader), out mode);
|
||
|
|
DigitalMode = mode;
|
||
|
|
}
|
||
|
|
catch (System.Exception) { }
|
||
|
|
|
||
|
|
try
|
||
|
|
{
|
||
|
|
DateTime calDate;
|
||
|
|
if (DateTime.TryParse(reader.GetAttribute(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "LastCalibrationDate").Value), cult, System.Globalization.DateTimeStyles.None, out calDate))
|
||
|
|
{
|
||
|
|
this.LastCalibrationDate = calDate;
|
||
|
|
}
|
||
|
|
else { this.LastCalibrationDate = DateTime.MinValue; }
|
||
|
|
}
|
||
|
|
catch
|
||
|
|
{
|
||
|
|
this.LastCalibrationDate = DateTime.MinValue;
|
||
|
|
}
|
||
|
|
|
||
|
|
try { this.SensorID = xmlAttributeDecoder.ExtractStringProperty("SensorID", reader); }
|
||
|
|
catch (System.Exception) { this.SensorID = ""; }
|
||
|
|
|
||
|
|
try { this.OffsetToleranceLowMv = xmlAttributeDecoder.ExtractDoubleProperty("OffsetToleranceLowMv", reader); }
|
||
|
|
catch (System.Exception) { this.OffsetToleranceLowMv = 0; }
|
||
|
|
|
||
|
|
try { this.OffsetToleranceHighMv = xmlAttributeDecoder.ExtractDoubleProperty("OffsetToleranceHighMv", reader); }
|
||
|
|
catch (System.Exception) { this.OffsetToleranceHighMv = 0; }
|
||
|
|
|
||
|
|
try {
|
||
|
|
this.DataFlag = xmlAttributeDecoder.ExtractIntProperty("DataFlag", reader);
|
||
|
|
}
|
||
|
|
catch (System.Exception) { this.DataFlag =new DTS.Utilities.DataFlagAttributeCoder().DecodeAttributeValue(DTS.Utilities.DataFlag.Normal); }
|
||
|
|
|
||
|
|
try
|
||
|
|
{ //
|
||
|
|
// Extract and parse start time value.
|
||
|
|
//
|
||
|
|
string startTimeString;
|
||
|
|
try { startTimeString = reader.GetAttribute(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "Start").Value); }
|
||
|
|
catch (System.Exception ex)
|
||
|
|
{
|
||
|
|
throw new Test.Module.AnalogInputChannel.Exception("encountered problem extracting start time value string", ex);
|
||
|
|
}
|
||
|
|
|
||
|
|
try { this.Start = DateTime.Parse(startTimeString, cult); }
|
||
|
|
catch (System.Exception)
|
||
|
|
{
|
||
|
|
this.Start = DateTime.Now;
|
||
|
|
// throw new Test.Module.AnalogInputChannel.Exception( "encountered problem parsing DateTime value " + ( null != startTimeString ? ( "\"" + startTimeString + "\"" ) : "<<NULL>>" ), ex );
|
||
|
|
}
|
||
|
|
}
|
||
|
|
catch (System.Exception ex)
|
||
|
|
{
|
||
|
|
throw new Test.Module.AnalogInputChannel.Exception("encountered problem extracting start time property", ex);
|
||
|
|
}
|
||
|
|
|
||
|
|
try
|
||
|
|
{ //
|
||
|
|
// Extract and parse zero average window begin value.
|
||
|
|
//
|
||
|
|
string zeroAverageWindowBeginString;
|
||
|
|
try { zeroAverageWindowBeginString = reader.GetAttribute(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "ZeroAverageWindow").Value + BeginTagModifier); }
|
||
|
|
catch (System.Exception ex)
|
||
|
|
{
|
||
|
|
throw new Test.Module.AnalogInputChannel.Exception("encountered problem extracting ZeroAverageWindow begin value string", ex);
|
||
|
|
}
|
||
|
|
double zeroAverageWindowBeginValue;
|
||
|
|
try { zeroAverageWindowBeginValue = double.Parse(zeroAverageWindowBeginString, cult); }
|
||
|
|
catch (System.Exception ex)
|
||
|
|
{
|
||
|
|
throw new Test.Module.AnalogInputChannel.Exception("encountered problem parsing double value " + (null != zeroAverageWindowBeginString ? ("\"" + zeroAverageWindowBeginString + "\"") : "<<NULL>"), ex);
|
||
|
|
}
|
||
|
|
|
||
|
|
//
|
||
|
|
// Extract and parse zero average window end value.
|
||
|
|
//
|
||
|
|
string zeroAverageWindowEndString;
|
||
|
|
try { zeroAverageWindowEndString = reader.GetAttribute(attributeExtractor.ExtractAttachedAttributeFromProperty(this, "ZeroAverageWindow").Value + EndTagModifier); }
|
||
|
|
catch (System.Exception ex)
|
||
|
|
{
|
||
|
|
throw new Test.Module.AnalogInputChannel.Exception("encountered problem extacting ZeroAverageWindow end value string", ex);
|
||
|
|
}
|
||
|
|
double zeroAverageWindowEndValue;
|
||
|
|
try { zeroAverageWindowEndValue = double.Parse(zeroAverageWindowEndString, cult); }
|
||
|
|
catch (System.Exception ex)
|
||
|
|
{
|
||
|
|
throw new Test.Module.AnalogInputChannel.Exception("encountered problem parsing double value " + (null != zeroAverageWindowEndString ? ("\"" + zeroAverageWindowEndString + "\"") : "<<NULL>"), ex);
|
||
|
|
}
|
||
|
|
|
||
|
|
try
|
||
|
|
{ //
|
||
|
|
// Synthesize new zero average window value.
|
||
|
|
//
|
||
|
|
this.ZeroAverageWindow = new IntervalSec(zeroAverageWindowBeginValue, zeroAverageWindowEndValue);
|
||
|
|
}
|
||
|
|
catch (System.Exception ex)
|
||
|
|
{
|
||
|
|
throw new Test.Module.AnalogInputChannel.Exception("encountered problem synthesizing zero average window from begin: " + zeroAverageWindowBeginValue.ToString() + ", end: " + zeroAverageWindowEndValue.ToString(), ex);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
catch (System.Exception ex)
|
||
|
|
{
|
||
|
|
throw new Test.Module.AnalogInputChannel.Exception("encountered problem extracting zero average window property", ex);
|
||
|
|
}
|
||
|
|
|
||
|
|
if (ExpressDataInlineOnXmlSerialization)
|
||
|
|
{
|
||
|
|
reader.Read();
|
||
|
|
short[] dummyValues = { 0 };
|
||
|
|
this.Data = new DataArray<short>(dummyValues);
|
||
|
|
this.Data.ReadXml(reader);
|
||
|
|
}
|
||
|
|
|
||
|
|
try { this.IsSquibChannel = xmlAttributeDecoder.ExtractBoolProperty("IsSquibChannel", reader, false); }
|
||
|
|
catch (System.Exception) { this.IsSquibChannel = false; }
|
||
|
|
|
||
|
|
try
|
||
|
|
{
|
||
|
|
double d;
|
||
|
|
if (xmlAttributeDecoder.ExtractDoubleProperty("SensorCapacity", reader, out d))
|
||
|
|
{
|
||
|
|
this.SensorCapacity = d;
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
this.SensorCapacity = 0D;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
catch (System.Exception) { this.SensorCapacity = 0; }
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
catch (System.Exception ex)
|
||
|
|
{
|
||
|
|
throw new Exception("encountered problem converting XML to " + this.GetType().FullName + " object", 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
|
||
|
|
{
|
||
|
|
Test.Module.AnalogInputChannel that = obj as Test.Module.AnalogInputChannel;
|
||
|
|
return null != obj
|
||
|
|
|
||
|
|
// Must-be-initialized properties.
|
||
|
|
&& this.ChannelId.Equals(that.ChannelId)
|
||
|
|
&& this.ChannelGroupName.Equals(that.ChannelGroupName)
|
||
|
|
&& this.Data.Equals(that.Data)
|
||
|
|
&& this.ExpressDataInlineOnXmlSerialization.Equals(that.ExpressDataInlineOnXmlSerialization)
|
||
|
|
&& this.Number.Equals(that.Number)
|
||
|
|
&& this.Bridge.Equals(that.Bridge)
|
||
|
|
&& this.BridgeResistanceOhms.Equals(that.BridgeResistanceOhms)
|
||
|
|
&& this.ZeroPoint.Equals(that.ZeroPoint)
|
||
|
|
&& this.Description.Equals(that.Description, StringComparison.OrdinalIgnoreCase)
|
||
|
|
&& this.DesiredRange.Equals(that.DesiredRange)
|
||
|
|
&& this.EngineeringUnits.Equals(that.EngineeringUnits, StringComparison.OrdinalIgnoreCase)
|
||
|
|
&& this.ExcitationVoltage.Equals(that.ExcitationVoltage)
|
||
|
|
&& this.InitialEu.Equals(that.InitialEu)
|
||
|
|
&& this.InitialOffset.Equals(that.InitialOffset)
|
||
|
|
&& this.ProportionalToExcitation.Equals(that.ProportionalToExcitation)
|
||
|
|
&& this.IsInverted.Equals(that.IsInverted)
|
||
|
|
&& this.IsSubsampled.Equals(that.IsSubsampled)
|
||
|
|
//handle nullable
|
||
|
|
&& (this.IsLastCalibrationDateValid && that.IsLastCalibrationDateValid) ? this.LastCalibrationDate.Equals(that.LastCalibrationDate)
|
||
|
|
: that.IsLastCalibrationDateValid ? false : true
|
||
|
|
&& (this.IsSensorIDValid && that.IsSensorIDValid) ? this.SensorID.Equals(that.SensorID)
|
||
|
|
: that.IsSensorIDValid ? false : true
|
||
|
|
&& (this.IsOffsetToleranceLowMvValid && that.IsOffsetToleranceLowMvValid) ? this.OffsetToleranceLowMv.Equals(that.OffsetToleranceLowMv)
|
||
|
|
: that.IsOffsetToleranceLowMvValid ? false : true
|
||
|
|
&& (this.IsOffsetToleranceHighMvValid && that.IsOffsetToleranceHighMvValid) ? this.OffsetToleranceHighMv.Equals(that.OffsetToleranceHighMv)
|
||
|
|
: that.IsOffsetToleranceHighMvValid ? false : true
|
||
|
|
&& (
|
||
|
|
(null == this.LinearizationFormula && null == that.LinearizationFormula) ||
|
||
|
|
(null != this.LinearizationFormula && LinearizationFormula.Equals(that.LinearizationFormula))
|
||
|
|
)
|
||
|
|
&& this.IsoCode.Equals(that.IsoCode, StringComparison.OrdinalIgnoreCase)
|
||
|
|
&& this.RemoveOffset.Equals(that.RemoveOffset)
|
||
|
|
&& this.Sensitivity.Equals(that.Sensitivity)
|
||
|
|
&& this.SerialNumber.Equals(that.SerialNumber, StringComparison.OrdinalIgnoreCase)
|
||
|
|
&& this.ShuntEnabled.Equals(that.ShuntEnabled)
|
||
|
|
&& this.VoltageInsertionCheckEnabled.Equals(that.VoltageInsertionCheckEnabled)
|
||
|
|
&& this.CalSignalEnabled.Equals(that.CalSignalEnabled)
|
||
|
|
&& this.SoftwareFilter.Equals(that.SoftwareFilter)
|
||
|
|
&& this.UnsubsampledSampleRateHz.Equals(that.UnsubsampledSampleRateHz)
|
||
|
|
&& this.ZeroAverageWindow.Equals(that.ZeroAverageWindow)
|
||
|
|
&& this.ZeroMethod.Equals(that.ZeroMethod)
|
||
|
|
&& this.Start.ToString().Equals(that.Start.ToString())
|
||
|
|
&& this.AbsoluteDisplayOrder.Equals(that.AbsoluteDisplayOrder)
|
||
|
|
// Potentially valid-as-uninitialized and/or nullable properties.
|
||
|
|
&& this._MeasuredShuntDeflectionMv.IsInitialized ? this.MeasuredShuntDeflectionMv.Equals(that.MeasuredShuntDeflectionMv) : this._MeasuredShuntDeflectionMv.IsInitialized == that._MeasuredShuntDeflectionMv.IsInitialized
|
||
|
|
&& this._TargetShuntDeflectionMv.IsInitialized ? this.TargetShuntDeflectionMv.Equals(that.TargetShuntDeflectionMv) : this._TargetShuntDeflectionMv.IsInitialized == that._TargetShuntDeflectionMv.IsInitialized
|
||
|
|
&& this._TriggerAboveThresholdEu.IsInitialized ? this.TriggerAboveThresholdEu.Equals(that.TriggerAboveThresholdEu) : this._TriggerAboveThresholdEu.IsInitialized == that._TriggerAboveThresholdEu.IsInitialized
|
||
|
|
&& this._TriggerBelowThresholdEu.IsInitialized ? this.TriggerBelowThresholdEu.Equals(that.TriggerBelowThresholdEu) : this._TriggerBelowThresholdEu.IsInitialized == that._TriggerBelowThresholdEu.IsInitialized
|
||
|
|
&& this._MeasuredGain.IsInitialized ? this.MeasuredGain.Equals(that.MeasuredGain) : this._MeasuredGain.IsInitialized == that._MeasuredGain.IsInitialized
|
||
|
|
&& this.UserValue1 == that.UserValue1
|
||
|
|
&& this.UserValue2 == that.UserValue2
|
||
|
|
&& this.UserValue3 == that.UserValue3
|
||
|
|
&& this.DigitalMultiplier.ToSerializeDbString() == that.DigitalMultiplier.ToSerializeDbString()
|
||
|
|
&& this.DigitalMode == that.DigitalMode
|
||
|
|
&& this.DataFlag.Equals(that.DataFlag)
|
||
|
|
&& this._ExpectedGain.IsInitialized ? this.ExpectedGain.Equals(that.ExpectedGain) : this._ExpectedGain.IsInitialized == that._ExpectedGain.IsInitialized
|
||
|
|
&& this.UnitConversion.Equals(that.UnitConversion)
|
||
|
|
&& this.AtCapacity.Equals(that.AtCapacity)
|
||
|
|
&& this.CapacityOutputIsBasedOn.Equals(that.CapacityOutputIsBasedOn)
|
||
|
|
&& this.SensitivityUnits.Equals(that.SensitivityUnits);
|
||
|
|
}
|
||
|
|
|
||
|
|
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( );
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|