62 lines
1.9 KiB
C#
62 lines
1.9 KiB
C#
using DTS.Common.Classes.Sensors;
|
|
using DTS.Common.Enums;
|
|
using DTS.Common.Enums.Sensors;
|
|
using DTS.Common.Interface.Sensors;
|
|
using DTS.Common.Storage;
|
|
using DTS.Common.Utilities.Logging;
|
|
using System;
|
|
|
|
namespace DTS.SensorDB
|
|
{
|
|
public class ThermocouplerSetting : SensorData
|
|
{
|
|
///<summary>
|
|
///</summary>
|
|
public ThermocouplerSetting() : base()
|
|
{
|
|
SetDefaults(this);
|
|
}
|
|
public ThermocouplerSetting(ThermocouplerSetting copy) : base(copy)
|
|
{
|
|
SetDefaults(this);
|
|
}
|
|
|
|
public ThermocouplerSetting(IThermocouplerRecord record)
|
|
{
|
|
SetDefaults(this);
|
|
try
|
|
{
|
|
DatabaseId = record.Id;
|
|
SerialNumber = record.SerialNumber;
|
|
Broken = record.Broken;
|
|
DoNotUse = record.DoNotUse;
|
|
LastModified = record.LastModified;
|
|
LastUpdatedBy = record.LastUpdatedBy;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
APILogger.Log("Failed to process: ", ex);
|
|
}
|
|
}
|
|
|
|
public static void SetDefaults(SensorData sd)
|
|
{
|
|
sd.SupportedExcitation = new Common.Enums.ExcitationVoltageOptions.ExcitationVoltageOption[] { ExcitationVoltageOptions.ExcitationVoltageOption.Undefined };
|
|
sd.Bridge = SensorConstants.BridgeType.Thermocoupler;
|
|
sd.AxisNumber = 0;
|
|
sd.NumberOfAxes = 1;
|
|
sd.Capacity = 1;
|
|
sd.DisplayUnit = "";
|
|
sd.BridgeResistance = double.NaN;
|
|
sd.CheckOffset = false;
|
|
sd.Manufacturer = "Generic";
|
|
sd.OffsetToleranceHigh = 0;
|
|
sd.OffsetToleranceLow = 0;
|
|
sd.Model = "Thermocoupler Setting";
|
|
sd.Shunt = ShuntMode.None;
|
|
sd.MeasureExcitation = false;
|
|
sd.MeasureNoise = false;
|
|
}
|
|
}
|
|
}
|