using DTS.Common.Base;
using DTS.Common.Interface.TestSetups;
using System.Data;
namespace DTS.Common.Classes.TestSetups
{
///
/// Describes a record in the TestSetupROIs table
///
public class TestSetupROIsRecord : BasePropertyChanged, ITestSetupROIRecord
{
///
/// The field that matches the same field in the ROIPeriodChannels table
///
private int _testSetupROIId;
public int TestSetupROIId
{
get => _testSetupROIId;
set => SetProperty(ref _testSetupROIId, value, "TestSetupROIId");
}
///
/// The field that matches the same field in the TestSetups table
///
private int _testSetupId;
public int TestSetupId
{
get => _testSetupId;
set => SetProperty(ref _testSetupId, value, "TestSetupId");
}
///
/// e.g. "_ROI Period 1", "_ROI Period 2", etc.
///
private string _suffix = "";
public string Suffix
{
get => _suffix;
set => SetProperty(ref _suffix, value, "Suffix");
}
///
/// The starting time of the ROI period.
///
private double _roiStart = -1.0D;
public double ROIStart
{
get => _roiStart;
set => SetProperty(ref _roiStart, value, "ROIStart");
}
///
/// The ending time of the ROI period.
///
private double _roiEnd = 1.0D;
public double ROIEnd
{
get => _roiEnd;
set => SetProperty(ref _roiEnd, value, "ROIEnd");
}
///
/// Whether or not the period is enabled.
///
private bool _isEnabled = true;
public bool IsEnabled
{
get => _isEnabled;
set => SetProperty(ref _isEnabled, value, "IsEnabled");
}
///
/// Whether or not the period is the default
///
private bool _isDefault = true;
public bool IsDefault
{
get => _isDefault;
set => SetProperty(ref _isDefault, value, "IsDefault");
}
///
/// Builds a TestSetupROIs record after a call to sp_TestSetupROIsGet
///
///
public TestSetupROIsRecord(IDataReader reader)
{
TestSetupROIId = Utility.GetInt(reader, "TestSetupROIId");
TestSetupId = Utility.GetInt(reader, "TestSetupROIId");
Suffix = Utility.GetString(reader, "Suffix");
ROIStart = Utility.GetDouble(reader, "ROIStart", -1);
ROIEnd = Utility.GetDouble(reader, "ROIEnd", 1);
IsEnabled = Utility.GetBool(reader, "IsEnabled");
IsDefault = Utility.GetBool(reader, "IsDefault");
}
}
}