using DTS.Common.Classes.Sensors;
using DTS.Common.Enums;
using DTS.Common.Enums.Sensors;
using DTS.Common.Interface.Sensors.SoftwareFilters;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DTS.Common.Interface.Sensors
{
///
/// describes the a record of an analog sensor in the db
///
public interface IAnalogDbRecord
{
///
/// the database id of the sensor
///
[Key]
int Id { get; set; }
///
/// Serial number of sensor
/// [required to be unique]
///
[Required]
[StringLength(50)]
string SerialNumber { get; set; }
///
/// deprecated
/// which axis the record is for when the sensor is multi-axis
///
short AxisNumber { get; set; }
///
/// deprecated
///
short BridgeLegMode { get; set; }
///
/// the expected resistance in Ohms if applicable for the sensor
///
double BridgeResistance { get; set; }
///
/// the type of bridge or sensor
/// [DO NOT USE BITMASK VALUE WHEN READING/WRITING TO DB]
///
SensorConstants.BridgeType Bridge { get; set; }
///
/// Whether the sensor has been marked as broken by a user
///
bool Broken { get; set; }
///
/// whether the sensor has it's own filtering or should otherwise bypass
/// hardware filters when collecting data
/// (not supported on all hardware)
///
bool BypassFilter { get; set; }
///
/// deprecated?
///
bool CalibrationSignal { get; set; }
///
/// calibration interval in days, used in determining when sensor is out of cal
///
int CalInterval { get; set; }
///
/// capacity of the sensor in EU
///
double Capacity { get; set; }
///
/// Whether to check the sensor output in mV against thresholds in diagnostics
///
bool CheckOffset { get; set; }
///
/// user supplied descriptive comment on sensor
///
[Required]
[StringLength(50)]
string Comment { get; set; }
///
/// IEPE coupling mode to use for data collection if applicable
///
SensorConstants.CouplingModes CouplingMode { get; set; }
///
/// date sensor record was created (if available)
///
[Column(TypeName = "datetime")]
DateTime Created { get; set; }
///
/// Whether this sensor should only record internal resistance and record no external signal
/// [generally only useful for testing purposes]
///
bool DiagnosticsMode { get; set; }
///
/// Engineering units for sensor
/// (deprecated, db value not used)
///
string DisplayUnit { get; set; }
///
/// whether this sensor has been marked not to be used by user
///
bool DoNotUse { get; set; }
//FB 43046
///
/// SensitivityTolerancePercent
///
double SensitivityTolerancePercent { get; set; }
///
/// whether this sensor which has been marked inspect before use is cleared
///
bool InspectBeforeUseCleared { get; set; }
///
/// Electronic Identification tag
/// [DALLAS or TEDS ID TAG]
/// if present required to be unique
///
[Required]
[Column("eId")]
[StringLength(50)]
string EId { get; set; }
///
/// TDAS supports external resistance when measuring shunt resistance
/// this is the value of external resistance applied
///
double ExternalShuntResistance { get; set; }
///
/// The default software filter class to apply to data channel when viewing
/// filtered EU data
///
IFilterClass Filter { get; set; }
///
/// Amount of EU to add in when EU is calculated
/// Used to offset EU readings by a specific amount
/// Note that analog sensor calibration records
/// can contain a more sophisticated EU offset
///
[Column("InitialEU")]
[Required]
[StringLength(50)]
double? InitialEu { get; set; }
///
/// TDAS supports performing external and internal resistance when measuring shunt resistance
/// This is the value to use when internal shunt resistance is used
///
double InternalShuntResistance { get; set; }
///
/// whether output of the sensor in EU should be inverted or not
///
bool Invert { get; set; }
///
/// ISO 13499 channel name to apply to a data channel when a data channel is
/// created using the sensor
///
[Required]
[StringLength(255)]
string ISOChannelName { get; set; }
///
/// ISO 13499 code to apply to a data channel when a data channel is created
/// using the sensor
///
[Required]
[StringLength(50)]
string ISOCode { get; set; }
///
/// when the sensor was last modified
///
[Column(TypeName = "datetime")]
DateTime LastModified { get; set; }
///
/// deprecated, used to determine which sensors should not propagate up to central database
///
bool LocalOnly { get; set; }
///
/// Maker of sensor
///
[StringLength(50)]
string Manufacturer { get; set; }
///
/// model of sensor
///
[StringLength(50)]
string Model { get; set; }
///
/// who last modified the sensor record
///
[Required]
[StringLength(50)]
string ModifiedBy { get; set; }
///
/// deprecated/reserved
/// number of axes associated with this serial number
///
short NumberOfAxes { get; set; }
///
/// allowable tolerance in mV on the high side for an idle reading of sensor
/// used to determine if the sensor output is too high in diagnostics
///
double OffsetToleranceHigh { get; set; }
///
/// allowable tolerance in mV on the low side for an idle reading of sensor
/// used to determine if the sensor output is too low in diagnostics
///
double OffsetToleranceLow { get; set; }
///
/// typical medium range for sensor in applications
///
double RangeMedium { get; set; }
///
/// typical high range for sensor in applications
///
double RangeHigh { get; set; }
///
/// typical low range for sensor in applications
///
double RangeLow { get; set; }
///
/// The type of sensor
/// Deprecated, remains for TDC purposes
/// Normal = 0,
/// POT = 1,
/// IRTracc = 2,
/// Polynomial = 3
///
int SensorCategory { get; set; }
///
/// the database id of the sensor model, if applicable
///
///
int SensorModelId { get; set; }
///
/// The type of shunt used for measuring shunt results
/// note all SLICE hardware only supports emulation (or none)
/// None = 0,
/// Emulation = 1,
/// Internal = 2,
/// External = 3
///
short Shunt { get; set; }
[Required]
[StringLength(50)]
///
/// reserved/not in use
///
SensorStatus Status { get; set; }
///
/// Excitation voltages supported by the sensor
/// used to prevent the sensor from being used in a situation that might damaged it
/// (say a 2V sensor being fed 10V excitation)
///
[Required]
[StringLength(50)]
ExcitationVoltageOptions.ExcitationVoltageOption[] SupportedExcitation { get; set; }
///
/// bytes representing a delimited string of tag ids
///
byte[] TagsBlobBytes { get; set; }
///
/// Reserved/Not used
///
long TimesUsed { get; set; }
///
/// flag indicating that the sensor should be interpreted as 0-n rather than -x<0
bool UniPolar { get; set; }
///
/// User channel name to apply when sensor is applied to a blank channel
///
[Required]
[StringLength(255)]
string UserChannelName { get; set; }
///
/// User channel code to apply when sensor is applied to a blank channel
///
[Required]
[StringLength(50)]
string UserCode { get; set; }
[Required]
[StringLength(50)]
string UserSerialNumber { get; set; }
///
/// user supplied string
/// travels with the sensor to data channels when
/// data is recorded with the sensor
///
[StringLength(50)]
string UserValue1 { get; set; }
///
/// user supplied string
/// travels with the sensor to data channels when
/// data is recorded with the sensor
///
[StringLength(50)]
string UserValue2 { get; set; }
///
/// user supplied string
/// travels with the sensor to data channels when
/// data is recorded with the sensor
///
[StringLength(50)]
string UserValue3 { get; set; }
///
/// deprectated
///
int Version { get; set; }
[Column(TypeName = "datetime")]
///
/// Date of first destructive use since sensor was calibrated,
/// only valid when using latest calibration
/// null indicates not set
///
DateTime? FirstUseDate { get; set; }
///
/// deprecated
/// Originally held the id of the latest calibration record
/// for sensor
///
int? LatestCalibrationId { get; set; }
///
/// whether to use AC Coupling when using a bridge mode (full/half/quarter/half+sig)
/// 18294 Implement Bridge AC/DC coupling(fw update dependent)
///
bool ACCouplingModeEnabled { get; set; }
///
/// The name of an Assembly (group of sensors)
///
string AssemblyName { get; set; }
///
/// The number of times a sensor has been used
///
int UsageCount { get; set; }
///
/// The maximum number of times a sensor can be used before generating an error
///
int MaximumUsage { get; set; }
}
}