using DTS.Common.Enums;
using DTS.Common.Enums.Sensors;
using DTS.Common.Interface.DASFactory.Diagnostics;
using DTS.Common.Interface.Sensors.SoftwareFilters;
using System;
using System.Xml;
namespace DTS.Common.Interface.DASFactory
{
public interface IAnalogInputDASChannel
{
///
/// Type of Wheatstone Bridge in the sensor; half, full, etc.
///
SensorConstants.BridgeType TypeOfBridge { get; set; }
///
/// 14042 Flash Clear turns of excitation for s6
/// this allows for ILevelTriggerable channels to store and cache a sample average for checking
/// level triggered
///
//double? ILevelTriggerable.SampleAverageADC { get; set; } = null;
///
/// used during TDAS diagnostics, it's a throw away value that's computed during configuration
/// then compared to during measure shunt.
///
int ShuntTargetADC { get; set; }
SensorConstants.BridgeType[] SupportedBridges { get; set; }
///
/// the types of digital input modes supported by the channel.
/// by default all digital modes are supported, and some hardware restrict the list (notably the g5)
///
DigitalInputModes[] SupportedDigitalInputModes { get; set; }
///
/// IEPE Coupling mode (AC, AC/DC)
/// correct voltage base on this property.
///
SensorConstants.CouplingModes CouplingMode { get; set; }
///
/// Resistance of the Bridge in the sensor.
///
double BridgeResistanceOhms { get; set; }
///
/// used to store 2D/3D IR-TRACC ZeroPoint Voltage data
///
double ZeroPoint { get; set; }
///
/// Bi-Polar maximum tolerance of sensor in Engineering Units.
///
double SensorCapacityEU { get; set; }
///
/// Sensor capacity specified in sensor database.
///
double SensorCapacity { get; set; }
///
/// Sensor polarity specified in sensor database.
///
string SensorPolarity { get; set; }
///
/// The desired Bi-Polar range of readings (in Engineering Units)
/// from this sensor for this test or event. This must be
/// within the SensorCapacityEU of the sensor.
///
double DesiredRangeWithHeadroomEU { get; set; }
///
/// Sensitivity of the sensor in Millivots per Engineering Unit
/// as specified by the sensor's manufacturer or hardware settings.
///
double SensitivityMilliVoltsPerEU { get; set; }
double SensitivityMilliVoltsPerEUNormalized { get; }
///
/// Are sensor readings proportional to excitation voltage?
///
bool IsProportionalToExcitation { get; set; }
bool IsSupported(ExcitationVoltageOptions.ExcitationVoltageOption o);
///
/// Is this sensor's output inverted?
///
bool IsInverted { get; set; }
string OriginalChannelName { get; set; }
string ChannelName2 { get; set; }
///
/// 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
///
string ChannelId { get; set; }
///
/// refers to the Group for a logical channel in the test
///
string ChannelGroupName { get; set; }
string HardwareChannelName { get; set; }
string DIUnits { get; set; }
DigitalInputModes DigitalMode { get; set; }
DTS.Common.Classes.Sensors.LinearizationFormula LinearizationFormula { get; set; }
///
/// The excitation voltage to apply to the sensor. Firmware will provide the
/// correct voltage base on this property.
///
ExcitationVoltageOptions.ExcitationVoltageOption Excitation { get; set; }
ExcitationVoltageOptions.ExcitationVoltageOption[] SupportedExcitation { get; set; }
///
/// String representation of the Engineering Units this sensor reads, for example
/// "g" or "m/s/s" or "meters per second", etc. Not mathematically relevant, only
/// used for display.
///
string EngineeringUnits { get; set; }
///
/// Serial number of the sensor.
///
string SerialNumber { get; set; }
///
/// Manufacturer of the sensor.
///
string Manufacturer { get; set; }
///
/// Model of the sensor.
///
string Model { get; set; }
///
/// A text description of the sensor.
///
string Description { get; set; }
///
/// How will this sensor be zeroed?
///
ZeroMethodType ZeroMethod { get; set; }
///
/// Start time for the zero window relative to T=0
/// used if ZeroMethod is AverageOverTime.
///
double ZeroAverageStartSeconds { get; set; }
///
/// Stop time for the zero window relative to T=0
/// used if ZeroMethod is AverageOverTime.
///
double ZeroAverageStopSeconds { get; set; }
///
/// The initial EU value
///
double InitialEU { get; set; }
string InitialOffset { get; set; }
bool Unipolar { get; set; }
///
/// Should the shunt be enabled?
///
bool ShuntIsEnabled { get; set; }
///
/// some DAS require holding zeromV in adc in the xml configuration (slice2)
/// this is here to hold that information
///
short ZeromVInADC { get; set; }
///
/// should voltage insertion (gain) check be enabled?
///
bool VoltageInsertionCheckEnabled { get; set; }
bool IEPEChannel { get; set; }
bool DigitalInputChannel { get; set; }
bool CalSignalIsEnabled { get; set; }
///
/// Setting this true will flag the hardware to compensate for the offset of the sensor
/// during a call to DiagnosticsService.Diagnose(...).
///
bool RemoveOffset { get; set; }
///
/// Should we verify the measured offset to the limits?
///
bool VerifyOffset { get; set; }
///
/// The lower limit on allowed offset for the connected sensor.
///
double OffsetToleranceLowMilliVolts { get; set; }
///
/// The upper limit on allowed offset for the connected sensor.
///
double OffsetToleranceHighMilliVolts { get; set; }
DateTime LastCalibrationDate { get; set; }
DateTime CalDueDate { get; set; }
///
/// The ISO code for this channel.
///
string ISOCode { get; set; }
///
/// Not available on slice or G5. Remove for now?
///
bool BypassAAFilter { get; set; }
string SensorID { get; set; }
///
/// Get the channel diagnostics results (if available) for this channel.
///
IDiagnosticResult Diagnostics { get; }
///
/// some channels should not be refreshed from the database prior to running configuration, for example sensors that are part of a group
/// should not be updated from database
///
bool UpdateChannelFromDatabase { get; set; }
///
///
/// Get/set the "trigger below" threshold. Set to "null" to deactivate.
///
double? TriggerBelowThresholdEu
{
get;
set;
}
///
///
/// Get/set the "trigger above" threshold. Set to "null" to deactivate.
///
double? TriggerAboveThresholdEu
{
get;
set;
}
bool AlreadyLevelTriggered
{
get;
set;
}
double MeasuredEULevelTriggerCheck
{
get;
set;
}
///
/// Temporary fix that'll be addressed in 1.1
///
double SoftwareFilterFrequency { get; set; }
///
/// Fb 13120 For now continue using SoftwareFilterFrequency needs to be refactored to use SoftwareFilterClass instead
///
IFilterClass SoftwareFilterClass { get; set; }
///
/// Get/set the for this channel.
///
IDiagnosticResult DiagnosticInformation { get; }
///
/// Get/set the measured excitation voltage.
///
double? MeasuredExcitationVolts { get; }
///
/// Get/set the factory excitation voltage.
///
double? FactoryExcitationVolts { get; }
double ScalefactorMilliVoltsPerADC { get; set; }
double ScalefactorEngineeringUnitsPerADC { get; set; }
double NoiseAsPercentOfFullScale { get; set; }
///
/// If this channel is supersampled, what the regular sampling rate is
///
double UnsupersampledSampleRate { get; set; }
///
/// If the channel has a serial number in the SerialNumber field, it is "Configured".
///
bool IsConfigured();
void WriteElementEnd(XmlWriter writer);
void WriteXml(XmlWriter writer);
string GetSupportedExcitationSerialized();
string GetSupportedDigitalInputModesSerialized();
string GetSupportedBridgesSerialized();
void WriteXmlCRC32(XmlWriter writer);
}
}