116 lines
6.8 KiB
C#
116 lines
6.8 KiB
C#
using DTS.Common.Interface.Sensors.AnalogDiagnostics;
|
|
using System;
|
|
using System.ComponentModel;
|
|
using System.Data.SqlClient;
|
|
|
|
namespace DTS.Common.Classes.Sensors.AnalogDiagnostics
|
|
{
|
|
public class DiagnosticEntry : IDiagnosticEntry
|
|
{
|
|
private long? _Id = null;
|
|
public long? Id { get => _Id; set => _Id = value; }
|
|
|
|
private long _DiagnosticRunId = -1;
|
|
public long DiagnosticRunId { get => _DiagnosticRunId; set => _DiagnosticRunId = value; }
|
|
|
|
private double? _Excitation = null;
|
|
public double? Excitation { get => _Excitation; set => _Excitation = value; }
|
|
|
|
private DiagnosticStatus _ExcitationStatus = DiagnosticStatus.Untested;
|
|
public DiagnosticStatus ExcitationStatus { get => _ExcitationStatus; set => _ExcitationStatus = value; }
|
|
|
|
private double? _Offset = null;
|
|
public double? Offset { get => _Offset; set => _Offset = value; }
|
|
|
|
private DiagnosticStatus _OffsetStatus = DiagnosticStatus.Untested;
|
|
public DiagnosticStatus OffsetStatus { get => _OffsetStatus; set => _OffsetStatus = value; }
|
|
|
|
private double? _ActualRange = null;
|
|
public double? ActualRange { get => _ActualRange; set => _ActualRange = value; }
|
|
|
|
private DiagnosticStatus _ActualRangeStatus = DiagnosticStatus.Untested;
|
|
public DiagnosticStatus ActualRangeStatus { get => _ActualRangeStatus; set => _ActualRangeStatus = value; }
|
|
|
|
private double? _Noise = null;
|
|
public double? Noise { get => _Noise; set => _Noise = value; }
|
|
|
|
private DiagnosticStatus _NoiseStatus = DiagnosticStatus.Untested;
|
|
public DiagnosticStatus NoiseStatus { get => _NoiseStatus; set => _NoiseStatus = value; }
|
|
|
|
private double? _Shunt = null;
|
|
public double? Shunt { get => _Shunt; set => _Shunt = value; }
|
|
|
|
private DiagnosticStatus _ShuntStatus = DiagnosticStatus.Untested;
|
|
public DiagnosticStatus ShuntStatus { get => _ShuntStatus; set => _ShuntStatus = value; }
|
|
|
|
private int? _SensorId;
|
|
public int? SensorId { get => _SensorId; set => _SensorId = value; }
|
|
|
|
private string _SensorSerialNumber = string.Empty;
|
|
public string SensorSerialNumber { get => _SensorSerialNumber; set => _SensorSerialNumber = value; }
|
|
|
|
private int? _DASId = null;
|
|
public int? DASId { get => _DASId; set => _DASId = value; }
|
|
|
|
private string _dasSerialNumber = string.Empty;
|
|
public string DASSerialNumber { get => _dasSerialNumber; set => _dasSerialNumber = value; }
|
|
|
|
private int _dasChannelIdx = 0;
|
|
public int DASChannelIdx { get => _dasChannelIdx; set => _dasChannelIdx = value; }
|
|
|
|
private string _UserCode = string.Empty;
|
|
public string UserCode { get => _UserCode; set => _UserCode = value; }
|
|
|
|
private string _UserChannelName = string.Empty;
|
|
public string UserChannelName { get => _UserChannelName; set => _UserChannelName = value; }
|
|
|
|
private string _IsoCode = string.Empty;
|
|
public string IsoCode { get => _IsoCode; set => _IsoCode = value; }
|
|
|
|
private string _IsoChannelName = string.Empty;
|
|
public string IsoChannelName { get => _IsoChannelName; set => _IsoChannelName = value; }
|
|
|
|
private double _scaleFactor = 1;
|
|
public double ScaleFactor { get => _scaleFactor; set => _scaleFactor = value; }
|
|
|
|
private int _calibrationRecordId = -1;
|
|
public int CalibrationRecordId { get => _calibrationRecordId; set => _calibrationRecordId = value; }
|
|
|
|
private string _calibrationRecordXML = string.Empty;
|
|
public string CalibrationRecordXML { get => _calibrationRecordXML; set => _calibrationRecordXML = value; }
|
|
|
|
private DateTime _timeStamp = DateTime.MinValue;
|
|
public DateTime Timestamp { get => _timeStamp; set => _timeStamp = value; }
|
|
|
|
public DiagnosticEntry() { }
|
|
public DiagnosticEntry (SqlDataReader reader)
|
|
{
|
|
if (!DBNull.Value.Equals(reader["Id"])) { Id = (long)reader["Id"]; }
|
|
if (!DBNull.Value.Equals(reader["DiagnosticRunId"])) { DiagnosticRunId = (long)reader["DiagnosticRunId"]; }
|
|
if (!DBNull.Value.Equals(reader["Excitation"])) { Excitation = (double)reader["Excitation"]; }
|
|
if (!DBNull.Value.Equals(reader["ExcitationStatus"])) { ExcitationStatus = (DiagnosticStatus)(short)reader["ExcitationStatus"]; }
|
|
if (!DBNull.Value.Equals(reader["Offset"])) { Offset = (double)reader["Offset"]; }
|
|
if (!DBNull.Value.Equals(reader["OffsetStatus"])) { OffsetStatus = (DiagnosticStatus)(short)reader["OffsetStatus"]; }
|
|
if (!DBNull.Value.Equals(reader["ActualRange"])) { ActualRange = (double)reader["ActualRange"]; }
|
|
if (!DBNull.Value.Equals(reader["ActualRangeStatus"])) { ActualRangeStatus = (DiagnosticStatus)(short)reader["ActualRangeStatus"]; }
|
|
if (!DBNull.Value.Equals(reader["Noise"])) { Noise = (double)reader["Noise"]; }
|
|
if (!DBNull.Value.Equals(reader["NoiseStatus"])) { NoiseStatus = (DiagnosticStatus)(short)reader["NoiseStatus"]; }
|
|
if (!DBNull.Value.Equals(reader["Shunt"])) { Shunt = (double)reader["Shunt"]; }
|
|
if (!DBNull.Value.Equals(reader["ShuntStatus"])) { ShuntStatus = (DiagnosticStatus)(short)reader["ShuntStatus"]; }
|
|
if (!DBNull.Value.Equals(reader["SensorId"])) { SensorId = (int)reader["SensorId"]; }
|
|
if (!DBNull.Value.Equals(reader["SensorSerialNumber"])) { SensorSerialNumber = (string)reader["SensorSerialNumber"]; }
|
|
if (!DBNull.Value.Equals(reader["DASId"])) { DASId = (int)reader["DASId"]; }
|
|
if (!DBNull.Value.Equals(reader["DASSerialNumber"])) { DASSerialNumber = (string)reader["DASSerialNumber"]; }
|
|
if (!DBNull.Value.Equals(reader["DASChannelIdx"])) { DASChannelIdx = (short)reader["DASChannelIdx"]; }
|
|
if (!DBNull.Value.Equals(reader["UserCode"])) { UserCode = (string)reader["UserCode"]; }
|
|
if (!DBNull.Value.Equals(reader["UserChannelName"])) { UserChannelName = (string)reader["UserChannelName"]; }
|
|
if (!DBNull.Value.Equals(reader["IsoCode"])) { IsoCode = (string)reader["IsoCode"]; }
|
|
if (!DBNull.Value.Equals(reader["IsoChannelName"])) { IsoChannelName = (string)reader["IsoChannelName"]; }
|
|
if (!DBNull.Value.Equals(reader["ScaleFactor"])) { ScaleFactor = (double)reader["ScaleFactor"]; }
|
|
if (!DBNull.Value.Equals(reader["CalibrationRecordId"])) { CalibrationRecordId = (int)reader["CalibrationRecordId"]; }
|
|
if (!DBNull.Value.Equals(reader["CalibrationRecordXML"])) { CalibrationRecordXML = (string)reader["CalibrationRecordXML"]; }
|
|
if (!DBNull.Value.Equals(reader["Timestamp"])) { Timestamp = (DateTime)reader["Timestamp"]; }
|
|
}
|
|
}
|
|
}
|