Files

1405 lines
60 KiB
C#
Raw Permalink Normal View History

2026-04-17 14:55:32 -04:00
using DTS.Common.Enums;
using DTS.Common.Enums.DASFactory;
using DTS.Common.Enums.Sensors;
using DTS.Common.Enums.Viewer;
using DTS.Common.Interface.ISO.ExtraProperties;
using DTS.Common.Interface.RegionOfInterest;
using DTS.Common.Interface.Tags;
using DTS.Common.Interface.TestSetups.TestSetupsList;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Web.Script.Serialization;
using DTS.Common.Constant.DASSpecific;
using System.Collections.ObjectModel;
namespace DTS.Common.Classes.TestSetups
{
/// <summary>
/// Describes a test setup record in the database
/// </summary>
public class TestSetupRecord : TagAwareBase, ITestSetupRecord
{
public override TagTypes TagType => TagTypes.TestSetup;
private int _id;
/// <summary>
/// Database Id of test setup
/// </summary>
public int Id
{
get => _id;
set => SetProperty(ref _id, value, "Id");
}
private string _name;
/// <summary>
/// Name of test setup
/// </summary>
public virtual string Name
{
get => _name;
set => SetProperty(ref _name, value, "Name");
}
private string _description = "";
/// <summary>
/// Description of test setup
/// </summary>
public string Description
{
get => _description;
set => SetProperty(ref _description, value, "Description");
}
private bool _automaticProgress;
/// <summary>
/// whether test execution should progress automatically
/// </summary>
public bool AutomaticProgression
{
get => _automaticProgress;
set => SetProperty(ref _automaticProgress, value, "AutomaticProgression");
}
private int _automaticProgressionDelayMS;
/// <summary>
/// delay between steps when using automatic progression
/// </summary>
public int AutomaticProgressionDelayMS
{
get => _automaticProgressionDelayMS;
set => SetProperty(ref _automaticProgressionDelayMS, value, "AutomaticProgressionDelayMS");
}
private bool _invertTriggerCompletion;
/// <summary>
/// whether the trigger polarity should be switched from close to open
/// </summary>
public bool InvertTriggerCompletion
{
get => _invertTriggerCompletion;
set => SetProperty(ref _invertTriggerCompletion, value, "InvertTriggerCompletion");
}
private bool _invertStartRecordCompletion;
/// <summary>
/// whether the start polarity should be switched from close to open
/// </summary>
public bool InvertStartRecordCompletion
{
get => _invertStartRecordCompletion;
set => SetProperty(ref _invertStartRecordCompletion, value, "InvertStartRecordCompletion");
}
private bool _ignoreShortedStartCompletion;
/// <summary>
/// whether a shorted start should be ignored or not
/// </summary>
public bool IgnoreShortedStartCompletion
{
get => _ignoreShortedStartCompletion;
set => SetProperty(ref _ignoreShortedStartCompletion, value, "IgnoreShortedStartCompletion");
}
private bool _ignoreShortedTriggerCompletion;
/// <summary>
/// whether a shorted trigger should be ignored or not
/// </summary>
public bool IgnoreShortedTriggerCompletion
{
get => _ignoreShortedTriggerCompletion;
set => SetProperty(ref _ignoreShortedTriggerCompletion, value, "IgnoreShortedTriggerCompletion");
}
private bool _viewDiagnostics = true;
/// <summary>
/// Whether diagnostics should be a viewable step when executing test
/// </summary>
public bool ViewDiagnostics
{
get => _viewDiagnostics;
set => SetProperty(ref _viewDiagnostics, value, "ViewDiagnostics");
}
private bool _verifyChannels = true;
/// <summary>
/// whether verify channels should be a viewable step when executing test
/// </summary>
public bool VerifyChannels
{
get => _verifyChannels;
set => SetProperty(ref _verifyChannels, value, "VerifyChannels");
}
private bool _autoVerifyChannels = true;
public bool AutoVerifyChannels
{
get => _autoVerifyChannels;
set => SetProperty(ref _autoVerifyChannels, value, "AutoVerifyChannels");
}
private double _autoVerifyDelaySeconds;
public double AutoVerifyDelaySeconds
{
get => _autoVerifyDelaySeconds;
set => SetProperty(ref _autoVerifyDelaySeconds, value, "AutoVerifyDelaySeconds");
}
private RecordingModes _recordingMode;
/// <summary>
/// overall recording mode of test
/// Some DAS may not support the actual recording mode but may support a related recording
/// mode (example circular buffer + UART versus circular buffer)
/// </summary>
public RecordingModes RecordingMode
{
get => _recordingMode;
set => SetProperty(ref _recordingMode, value, "RecordingMode");
}
private double _samplesPerSecondAggregate;
/// <summary>
/// samples per second for test as overall value
/// Each DAS can have it's own rate so this is mostly just to control the rate for new das added to a test
/// </summary>
public double SamplesPerSecondAggregate
{
get => _samplesPerSecondAggregate;
set => SetProperty(ref _samplesPerSecondAggregate, value, "SamplesPerSecondAggregate");
}
private double _preTriggerSeconds;
/// <summary>
/// amount of data pre trigger that is requested in seconds
/// </summary>
public double PreTriggerSeconds
{
get => _preTriggerSeconds;
set => SetProperty(ref _preTriggerSeconds, value, "PreTriggerSeconds");
}
private double _postTriggerSeconds;
/// <summary>
/// amount of data post trigger that is requested in seconds
/// </summary>
public double PostTriggerSeconds
{
get => _postTriggerSeconds;
set => SetProperty(ref _postTriggerSeconds, value, "PostTriggerSeconds");
}
private int _numberOfEvents;
/// <summary>
/// number of events to record if recording mode supports multiple events
/// </summary>
public int NumberOfEvents
{
get => _numberOfEvents;
set => SetProperty(ref _numberOfEvents, value, "NumberOfEvents");
}
private bool _strictDiagnostics;
/// <summary>
/// whether all channels are required to pass diagnostics for test execution
/// </summary>
public bool StrictDiagnostics
{
get => _strictDiagnostics;
set => SetProperty(ref _strictDiagnostics, value, "StrictDiagnostics");
}
private bool _requireUserConfirmationOnErrors;
/// <summary>
/// whether user confirmation is required on diagnostic errors discovered before
/// test execution continues
/// </summary>
public bool RequireUserConfirmationOnErrors
{
get => _requireUserConfirmationOnErrors;
set => SetProperty(ref _requireUserConfirmationOnErrors, value, "RequireUserConfirmationOnErrors");
}
private bool _doROIDownload;
/// <summary>
/// whether to perform a Region of Interest (ROI) download as a unique step of test execution
/// </summary>
public bool DoROIDownload
{
get => _doROIDownload;
set => SetProperty(ref _doROIDownload, value, "DoROIDownload");
}
private bool _viewROIDownload;
/// <summary>
/// whether to include viewing region of interest (ROI) as a step of test execution
/// </summary>
public bool ViewROIDownload
{
get => _viewROIDownload;
set => SetProperty(ref _viewROIDownload, value, "ViewROIDownload");
}
private bool _downloadAll;
/// <summary>
/// whether to include downloading all available data as a step of test execution
/// </summary>
public bool DownloadAll
{
get => _downloadAll;
set => SetProperty(ref _downloadAll, value, "DownloadAll");
}
protected bool _viewRealtime;
/// <summary>
/// whether to include real time as a step of test execution
/// </summary>
public bool ViewRealtime
{
get => _viewRealtime;
set => SetProperty(ref _viewRealtime, value, "ViewRealtime");
}
private short _defaultNumberRealtimeGraphs;
/// <summary>
/// the number of plots to show in real time if viewing real time
/// </summary>
public short DefaultNumberRealtimeGraphs
{
get => _defaultNumberRealtimeGraphs;
set => SetProperty(ref _defaultNumberRealtimeGraphs, value, "DefaultNumberRealtimeGraphs");
}
protected BindingList<IRegionOfInterest> _regionsOfInterest = new BindingList<IRegionOfInterest>();
public BindingList<IRegionOfInterest> RegionsOfInterest
{
get => _regionsOfInterest;
set => SetProperty(ref _regionsOfInterest, value, "RegionsOfInterest");
}
private double _roiStart;
/// <summary>
/// the start of the region of interest (deprecated?)
/// </summary>
public double ROIStart
{
get => _roiStart;
set => SetProperty(ref _roiStart, value, "ROIStart");
}
private double _roiEnd;
/// <summary>
/// the end of the region of interest (deprecated?)
/// </summary>
public double ROIEnd
{
get => _roiEnd;
set => SetProperty(ref _roiEnd, value, "ROIEnd");
}
private bool _viewDownloadAll;
/// <summary>
/// whether to include viewing of all download data as a step of test execution
/// </summary>
public bool ViewDownloadAll
{
get => _viewDownloadAll;
set => SetProperty(ref _viewDownloadAll, value, "ViewDownloadAll");
}
private bool _viewExport;
/// <summary>
/// whether to include export as a step of test execution
/// </summary>
public bool ViewExport
{
get => _viewExport;
set => SetProperty(ref _viewExport, value, "ViewExport");
}
private SupportedExportFormatBitFlags _exportFormats;
/// <summary>
/// Bit mask of export formats to select in export step by default
/// </summary>
public SupportedExportFormatBitFlags ExportFormats
{
get => _exportFormats;
set => SetProperty(ref _exportFormats, value, "ExportFormats");
}
private string _labDetails;
public string LabDetails
{
get => _labDetails;
set => SetProperty(ref _labDetails, value, "LabDetails");
}
private bool _useLabratoryDetails;
/// <summary>
/// Whether lab details should be included as a part of test execution
/// </summary>
public bool UseLabratoryDetails
{
get => _useLabratoryDetails;
set => SetProperty(ref _useLabratoryDetails, value, "UseLabratoryDetails");
}
private string _customerDetails;
public string CustomerDetails
{
get => _customerDetails;
set => SetProperty(ref _customerDetails, value, "CustomerDetails");
}
private bool _useCustomerDetails;
/// <summary>
/// Whether customer details should be included as a part of test execution
/// </summary>
public bool UseCustomerDetails
{
get => _useCustomerDetails;
set => SetProperty(ref _useCustomerDetails, value, "UseCustomerDetails");
}
private bool _allowMissingSensors;
/// <summary>
/// Whether to allow test execution to continue when sensors in test are missing
/// </summary>
public bool AllowMissingSensors
{
get => _allowMissingSensors;
set => SetProperty(ref _allowMissingSensors, value, "AllowMissingSensors");
}
private bool _allowSensorIdToBlankChannel;
/// <summary>
/// whether a sensor with an ID is allowed to be assigned on a channel if the Id
/// was not found on that channel
/// </summary>
public bool AllowSensorIdToBlankChannel
{
get => _allowSensorIdToBlankChannel;
set => SetProperty(ref _allowSensorIdToBlankChannel, value, "AllowSensorIdToBlankChannel");
}
private CalibrationBehaviors _calibrationBehaviors;
public CalibrationBehaviors CalibrationBehavior
{
get => _calibrationBehaviors;
set => SetProperty(ref _calibrationBehaviors, value, "CalibrationBehavior");
}
private bool _localOnly;
/// <summary>
/// whether test setup record should be synchronized with central server
/// (deprecated)
/// </summary>
public bool LocalOnly
{
get => _localOnly;
set => SetProperty(ref _localOnly, value, "LocalOnly");
}
private DateTime _lastModified = DateTime.MinValue;
/// <summary>
/// when test setup was last modified
/// </summary>
public DateTime LastModified
{
get => _lastModified;
set => SetProperty(ref _lastModified, value, "LastModified");
}
private string _lastModifiedBy;
/// <summary>
/// who last modified test setup
/// </summary>
public string LastModifiedBy
{
get => _lastModifiedBy;
set => SetProperty(ref _lastModifiedBy, value, "LastModifiedBy");
}
private bool _turnOffExcitation = true;
public bool TurnOffExcitation
{
get => _turnOffExcitation;
set => SetProperty(ref _turnOffExcitation, value, "TurnOffExcitation");
}
private bool _triggerCheckRealtime;
/// <summary>
/// whether to use EU levels to "trigger" channels in realtime viewer
/// </summary>
public bool TriggerCheckRealtime
{
get => _triggerCheckRealtime;
set => SetProperty(ref _triggerCheckRealtime, value, "TriggerCheckRealtime");
}
private bool _triggerCheckStep;
/// <summary>
/// Whether to include trigger check as a step in test execution
/// </summary>
public bool TriggerCheckStep
{
get => _triggerCheckStep;
set => SetProperty(ref _triggerCheckStep, value, "TriggerCheckStep");
}
private bool _postTestDiagnosticsLevel;
/// <summary>
/// whether to include post test diagnostics as a step in test execution
/// </summary>
public bool PostTestDiagnosticsLevel
{
get => _postTestDiagnosticsLevel;
set => SetProperty(ref _postTestDiagnosticsLevel, value, "PostTestDiagnosticsLevel");
}
private bool _commonStatusLine;
/// <summary>
/// whether there's an expectation that there is a common status line between all DAS
/// in test.
/// </summary>
public bool CommonStatusLine
{
get => _commonStatusLine;
set => SetProperty(ref _commonStatusLine, value, "CommonStatusLine");
}
private bool _sameAsDownloadFolder = true;
public bool SameAsDownloadFolder
{
get => _sameAsDownloadFolder;
set => SetProperty(ref _sameAsDownloadFolder, value, "SameAsDownloadFolder");
}
private bool _uploadData;
/// <summary>
/// whether to include upload data as a step
/// </summary>
public bool UploadData
{
get => _uploadData;
set => SetProperty(ref _uploadData, value, "UploadData");
}
private string _uploadFolder;
/// <summary>
/// folder to upload data to
/// [legacy, superseded by upload ini file]
/// </summary>
public string UploadFolder
{
get => _uploadFolder;
set => SetProperty(ref _uploadFolder, value, "UploadFolder");
}
private bool _uploadExportsOnly;
/// <summary>
/// whether to upload only export data files when uploading files
/// </summary>
public bool UploadExportsOnly
{
get => _uploadExportsOnly;
set => SetProperty(ref _uploadExportsOnly, value, "UploadExportsOnly");
}
private string _settings;
public string Settings
{
get => _settings;
set => SetProperty(ref _settings, value, "Settings");
}
private bool _warnOnFailedBattery;
public bool WarnOnFailedBattery
{
get => _warnOnFailedBattery;
set => SetProperty(ref _warnOnFailedBattery, value, "WarnOnFailedBattery");
}
private bool _dirty = true;
/// <summary>
/// whether test setup completion has been calculated yet or not
/// If dirty is true it has not been calculated and needs to be
/// </summary>
public bool Dirty
{
get => _dirty;
set => SetProperty(ref _dirty, value, "Dirty");
}
private bool _complete;
/// <summary>
/// whether the test setup is complete and ready to run
/// [dependent on Dirty]
/// </summary>
public bool IsComplete
{
get => _complete;
set => SetProperty(ref _complete, value, "IsComplete");
}
private string _errorMessage = string.Empty;
/// <summary>
/// any warnings or errors known in test setup, stored to avoid needing to calculate when retrieving all setups
/// </summary>
public string ErrorMessage
{
get => _errorMessage;
set => SetProperty(ref _errorMessage, value, "ErrorMessage");
}
private string _testEngineerDetails;
public string TestEngineerDetails
{
get => _testEngineerDetails;
set => SetProperty(ref _testEngineerDetails, value, "TestEngineerDetails");
}
private bool _useTestEngineerDetails;
/// <summary>
/// whether to use test engineer details in test execution
/// </summary>
public bool UseTestEngineerDetails
{
get => _useTestEngineerDetails;
set => SetProperty(ref _useTestEngineerDetails, value, "UseTestEngineerDetails");
}
private bool _doAutoArm;
/// <summary>
/// whether units in the test should be auto armed
/// </summary>
public bool DoAutoArm
{
get => _doAutoArm;
set => SetProperty(ref _doAutoArm, value, "DoAutoArm");
}
private bool _doEnableRepeat;
/// <summary>
/// whether units in the test should be auto armed or set to stream repeatedly
/// </summary>
public bool DoEnableRepeat
{
get => _doEnableRepeat;
set => SetProperty(ref _doEnableRepeat, value, "DoEnableRepeat");
}
private bool _checkoutMode;
/// <summary>
/// Whether test is a checkout test
/// this has multiple internal meanings including whether strict diagnostics are used or not, whether data
/// should be collected from sensors or not, etc
/// this should generally be false
/// </summary>
public bool CheckoutMode
{
get => _checkoutMode;
set => SetProperty(ref _checkoutMode, value, "CheckoutMode");
}
private string _isfFile;
/// <summary>
/// Instrumentation Setup File used to create test setup, if relevant
/// </summary>
public string ISFFile
{
get => _isfFile;
set => SetProperty(ref _isfFile, value, "ISFFile");
}
private bool _quitTestWithoutWarning;
public bool QuitTestWithoutWarning
{
get => _quitTestWithoutWarning;
set => SetProperty(ref _quitTestWithoutWarning, value, "QuitTestWithoutWarning");
}
private bool _AlignUDPToPPS = false;
/// <summary>
/// whether UDP should be aligned to PPS or not
/// </summary>
public bool AlignUDPToPPS
{
get => _AlignUDPToPPS;
set => SetProperty(ref _AlignUDPToPPS, value, "AlignUDPToPPS");
}
private bool _notAllChannelsRealtime;
public bool NotAllChannelsRealTime
{
get => _notAllChannelsRealtime;
set => SetProperty(ref _notAllChannelsRealtime, value, "NotAllChannelsRealTime");
}
private bool _notAllChannelsViewer;
public bool NotAllChannelsViewer
{
get => _notAllChannelsViewer;
set => SetProperty(ref _notAllChannelsViewer, value, "NotAllChannelsViewer");
}
private bool _supressMissingSensorsWarning;
public bool SuppressMissingSensorsWarning
{
get => _supressMissingSensorsWarning;
set => SetProperty(ref _supressMissingSensorsWarning, value, "SuppressMissingSensorsWarning");
}
private bool _doStreaming;
public bool DoStreaming
{
get => _doStreaming;
set => SetProperty(ref _doStreaming, value, "DoStreaming");
}
public bool WakeUpWithMotion
{
get
{
return WakeUpAndArmTriggerOn && WakeUpTrigger == WakeupTriggers.MotionDetect;
}
set
{
WakeUpAndArmTriggerOn = value;
WakeUpTrigger = value ? WakeupTriggers.MotionDetect : WakeupTriggers.MotionDetect; //Only one value in the enum right now
OnPropertyChanged("WakeUpWithMotion");
}
}
private ClockSyncProfile _clockSyncProfileMaster;
public ClockSyncProfile ClockSyncProfileMaster
{
get => _clockSyncProfileMaster;
set => SetProperty(ref _clockSyncProfileMaster, value, "ClockSyncProfileMaster");
}
private ClockSyncProfile _clockSyncProfileSlave;
public ClockSyncProfile ClockSyncProfileSlave
{
get => _clockSyncProfileSlave;
set => SetProperty(ref _clockSyncProfileSlave, value, "ClockSyncProfileSlave");
}
private List<IExtraProperty> _extraProperties = new List<IExtraProperty>();
public List<IExtraProperty> ExtraProperties
{
get => _extraProperties;
set => SetProperty(ref _extraProperties, value, TestTemplateTags.ExtraProperties.ToString());
}
private bool _measureSquibResistanceStep;
public bool MeasureSquibResistancesStep
{
get => _measureSquibResistanceStep;
set => SetProperty(ref _measureSquibResistanceStep, value, "MeasureSquibResistancesStep");
}
private string _testSetupUniqueId;
public string TestSetupUniqueId
{
get => _testSetupUniqueId;
set => SetProperty(ref _testSetupUniqueId, value, "TestSetupUniqueId");
}
protected bool _bLowgLevelTriggerOn = false;
public bool LowgLevelTriggerOn
{
get => _bLowgLevelTriggerOn;
set => SetProperty(ref _bLowgLevelTriggerOn, value, "LowgLevelTriggerOn");
}
protected bool _bLowgLevelTriggerOnX = false;
public bool LowgLevelTriggerOnX
{
get => _bLowgLevelTriggerOnX;
set => SetProperty(ref _bLowgLevelTriggerOnX, value, "LowgLevelTriggerOnX");
}
protected bool _bLowgLevelTriggerOnY = false;
public bool LowgLevelTriggerOnY
{
get => _bLowgLevelTriggerOnY;
set => SetProperty(ref _bLowgLevelTriggerOnY, value, "LowgLevelTriggerOnY");
}
protected bool _bLowgLevelTriggerOnZ = false;
public bool LowgLevelTriggerOnZ
{
get => _bLowgLevelTriggerOnZ;
set => SetProperty(ref _bLowgLevelTriggerOnZ, value, "LowgLevelTriggerOnZ");
}
protected bool _bHighgLevelTriggerOn = false;
public bool HighgLevelTriggerOn
{
get => _bHighgLevelTriggerOn;
set => SetProperty(ref _bHighgLevelTriggerOn, value, "HighgLevelTriggerOn");
}
protected bool _bHighgLevelTriggerOnX = false;
public bool HighgLevelTriggerOnX
{
get => _bHighgLevelTriggerOnX;
set => SetProperty(ref _bHighgLevelTriggerOnX, value, "HighgLevelTriggerOnX");
}
protected bool _bHighgLevelTriggerOnY = false;
public bool HighgLevelTriggerOnY
{
get => _bHighgLevelTriggerOnY;
set => SetProperty(ref _bHighgLevelTriggerOnY, value, "HighgLevelTriggerOnY");
}
protected bool _bHighgLevelTriggerOnZ = false;
public bool HighgLevelTriggerOnZ
{
get => _bHighgLevelTriggerOnZ;
set => SetProperty(ref _bHighgLevelTriggerOnZ, value, "HighgLevelTriggerOnZ");
}
protected bool _bAngularAccelLevelTriggerOn = false;
public bool AngularAccelLevelTriggerOn
{
get => _bAngularAccelLevelTriggerOn;
set => SetProperty(ref _bAngularAccelLevelTriggerOn, value, "AngularAccelLevelTriggerOn");
}
protected bool _bAngularAccelLevelTriggerOnX = false;
public bool AngularAccelLevelTriggerOnX
{
get => _bAngularAccelLevelTriggerOnX;
set => SetProperty(ref _bAngularAccelLevelTriggerOnX, value, "AngularAccelLevelTriggerOnX");
}
protected bool _bAngularAccelLevelTriggerOnY = false;
public bool AngularAccelLevelTriggerOnY
{
get => _bAngularAccelLevelTriggerOnY;
set => SetProperty(ref _bAngularAccelLevelTriggerOnY, value, "AngularAccelLevelTriggerOnY");
}
protected bool _bAngularAccelLevelTriggerOnZ = false;
public bool AngularAccelLevelTriggerOnZ
{
get => _bAngularAccelLevelTriggerOnZ;
set => SetProperty(ref _bAngularAccelLevelTriggerOnZ, value, "AngularAccelLevelTriggerOnZ");
}
protected bool _bAngularRateLevelTriggerOn = false;
public bool AngularRateLevelTriggerOn
{
get => _bAngularRateLevelTriggerOn;
set => SetProperty(ref _bAngularRateLevelTriggerOn, value, "AngularRateLevelTriggerOn");
}
protected bool _bAngularRateLevelTriggerOnX = false;
public bool AngularRateLevelTriggerOnX
{
get => _bAngularRateLevelTriggerOnX;
set => SetProperty(ref _bAngularRateLevelTriggerOnX, value, "AngularRateLevelTriggerOnX");
}
protected bool _bAngularRateLevelTriggerOnY = false;
public bool AngularRateLevelTriggerOnY
{
get => _bAngularRateLevelTriggerOnY;
set => SetProperty(ref _bAngularRateLevelTriggerOnY, value, "AngularRateLevelTriggerOnY");
}
protected bool _bAngularRateLevelTriggerOnZ = false;
public bool AngularRateLevelTriggerOnZ
{
get => _bAngularRateLevelTriggerOnZ;
set => SetProperty(ref _bAngularRateLevelTriggerOnZ, value, "AngularRateLevelTriggerOnZ");
}
protected double _lowgLinearLevelTriggerX;
public double LowgLinearLevelTriggerX
{
get => _lowgLinearLevelTriggerX;
set => SetProperty(ref _lowgLinearLevelTriggerX, value, "LowgLinearLevelTriggerX");
}
protected double _lowgLinearLevelTriggerY;
public double LowgLinearLevelTriggerY
{
get => _lowgLinearLevelTriggerY;
set => SetProperty(ref _lowgLinearLevelTriggerY, value, "LowgLinearLevelTriggerY");
}
protected double _lowgLinearLevelTriggerZ;
public double LowgLinearLevelTriggerZ
{
get => _lowgLinearLevelTriggerZ;
set => SetProperty(ref _lowgLinearLevelTriggerZ, value, "LowgLinearLevelTriggerZ");
}
protected double _highgLinearLevelTriggerX;
public double HighgLinearLevelTriggerX
{
get => _highgLinearLevelTriggerX;
set => SetProperty(ref _highgLinearLevelTriggerX, value, "HighgLinearLevelTriggerX");
}
protected double _highgLinearLevelTriggerY;
public double HighgLinearLevelTriggerY
{
get => _highgLinearLevelTriggerY;
set => SetProperty(ref _highgLinearLevelTriggerY, value, "HighgLinearLevelTriggerY");
}
protected double _highgLinearLevelTriggerZ;
public double HighgLinearLevelTriggerZ
{
get => _highgLinearLevelTriggerZ;
set => SetProperty(ref _highgLinearLevelTriggerZ, value, "HighgLinearLevelTriggerZ");
}
protected double _angularRateLevelTriggerX;
public double AngularRateLevelTriggerX
{
get => _angularRateLevelTriggerX;
set => SetProperty(ref _angularRateLevelTriggerX, value, "AngularRateLevelTriggerX");
}
protected double _angularRateLevelTriggerY;
public double AngularRateLevelTriggerY
{
get => _angularRateLevelTriggerY;
set => SetProperty(ref _angularRateLevelTriggerY, value, "AngularRateLevelTriggerY");
}
protected double _angularRateLevelTriggerZ;
public double AngularRateLevelTriggerZ
{
get => _angularRateLevelTriggerZ;
set => SetProperty(ref _angularRateLevelTriggerZ, value, "AngularRateLevelTriggerZ");
}
protected double _angularAccelLevelTriggerX;
public double AngularAccelLevelTriggerX
{
get => _angularAccelLevelTriggerX;
set => SetProperty(ref _angularAccelLevelTriggerX, value, "AngularAccelLevelTriggerX");
}
protected double _angularAccelLevelTriggerY;
public double AngularAccelLevelTriggerY
{
get => _angularAccelLevelTriggerY;
set => SetProperty(ref _angularAccelLevelTriggerY, value, "AngularAccelLevelTriggerY");
}
protected double _angularAccelLevelTriggerZ;
public double AngularAccelLevelTriggerZ
{
get => _angularAccelLevelTriggerZ;
set => SetProperty(ref _angularAccelLevelTriggerZ, value, "AngularAccelLevelTriggerZ");
}
protected bool _humidityLevelTriggerOn = false;
public bool HumidityLevelTriggerOn
{
get => _humidityLevelTriggerOn;
set => SetProperty(ref _humidityLevelTriggerOn, value, "HumidityLevelTriggerOn");
}
protected bool _pressureLevelTriggerOn = false;
public bool PressureLevelTriggerOn
{
get => _pressureLevelTriggerOn;
set => SetProperty(ref _pressureLevelTriggerOn, value, "PressureLevelTriggerOn");
}
protected bool _temperatureLevelTriggerOn = false;
public bool TemperatureLevelTriggerOn
{
get => _temperatureLevelTriggerOn;
set => SetProperty(ref _temperatureLevelTriggerOn, value, "TemperatureLevelTriggerOn");
}
protected double _humidityLevelTriggerBelow = 0;
public double HumidityLevelTriggerBelow
{
get => _humidityLevelTriggerBelow;
set => SetProperty(ref _humidityLevelTriggerBelow, value, "HumidityLevelTriggerBelow");
}
protected double _humidityLevelTriggerAbove = 0;
public double HumidityLevelTriggerAbove
{
get => _humidityLevelTriggerAbove;
set => SetProperty(ref _humidityLevelTriggerAbove, value, "HumidityLevelTriggerAbove");
}
protected double _pressureLevelTriggerBelow = 0;
public double PressureLevelTriggerBelow
{
get => _pressureLevelTriggerBelow;
set => SetProperty(ref _pressureLevelTriggerBelow, value, "PressureLevelTriggerBelow");
}
protected double _pressureLevelTriggerAbove = 0;
public double PressureLevelTriggerAbove
{
get => _pressureLevelTriggerAbove;
set => SetProperty(ref _pressureLevelTriggerAbove, value, "PressureLevelTriggerAbove");
}
protected double _temperatureLevelTriggerBelow = 0;
public double TemperatureLevelTriggerBelow
{
get => _temperatureLevelTriggerBelow;
set => SetProperty(ref _temperatureLevelTriggerBelow, value, "TemperatureLevelTriggerBelow");
}
protected double _temperatureLevelTriggerAbove = 0;
public double TemperatureLevelTriggerAbove
{
get => _temperatureLevelTriggerAbove;
set => SetProperty(ref _temperatureLevelTriggerAbove, value, "TemperatureLevelTriggerAbove");
}
protected double _lowgLinearAccRate = 0;
public double LowgLinearAccRate
{
get => _lowgLinearAccRate;
set => SetProperty(ref _lowgLinearAccRate, value, "LowgLinearAccRate");
}
protected double _highgLinearAccRate = 0;
public double HighgLinearAccRate
{
get => _highgLinearAccRate;
set => SetProperty(ref _highgLinearAccRate, value, "HighgLinearAccRate");
}
protected double _angularRate;
public double AngularRate
{
get => _angularRate;
set => SetProperty(ref _angularRate, value, "AngularRate");
}
protected double _temperatureHumidityPressureRate = 0;
public double TemperatureHumidityPressureRate
{
get => _temperatureHumidityPressureRate;
set => SetProperty(ref _temperatureHumidityPressureRate, value, "TemperatureHumidityPressureRate");
}
protected bool _batterySaverModeOn = false;
public bool BatterySaverModeOn
{
get => _batterySaverModeOn;
set => SetProperty(ref _batterySaverModeOn, value, "BatterySaverModeOn");
}
protected bool _wakeUpAndArmTriggerOn = false;
public bool WakeUpAndArmTriggerOn
{
get => _wakeUpAndArmTriggerOn;
set => SetProperty(ref _wakeUpAndArmTriggerOn, value, "WakeUpAndArmTriggerOn");
}
//The method of wakeup
protected WakeupTriggers _wakeUpTrigger = WakeupTriggers.MotionDetect;
public WakeupTriggers WakeUpTrigger
{
get => _wakeUpTrigger;
set => SetProperty(ref _wakeUpTrigger, value, "WakeUpTrigger");
}
//Wake up on magnet
protected int _wakeUpMagnetTimeout = 1;
public int WakeUpMagnetTimeout
{
get => _wakeUpMagnetTimeout;
set => SetProperty(ref _wakeUpMagnetTimeout, value, "WakeUpMagnetTimeout");
}
//Wake up on motion
protected int _wakeUpMotionTimeout = TSRAIR.WAKEUP_MOTION_TIMEOUT;
public int WakeUpMotionTimeout
{
get => _wakeUpMotionTimeout;
set => SetProperty(ref _wakeUpMotionTimeout, value, "WakeUpMotionTimeout");
}
//Wake up at a given time
protected DateTime _wakeUpTimeSessionStart = DateTime.MinValue;
public DateTime WakeUpTimeSessionStart
{
get => _wakeUpTimeSessionStart;
set => SetProperty(ref _wakeUpTimeSessionStart, value, "WakeUpTimeSessionStart");
}
//Stay awake for this amount of time
protected TimeSpan _wakeUpTimeDuration = TimeSpan.Zero;
public TimeSpan WakeUpTimeDuration
{
get => _wakeUpTimeDuration;
set => SetProperty(ref _wakeUpTimeDuration, value, "WakeUpTimeDuration");
}
protected bool _timedIntervalTriggerOn = false;
public bool TimedIntervalTriggerOn
{
get => _timedIntervalTriggerOn;
set => SetProperty(ref _timedIntervalTriggerOn, value, "TimedIntervalTriggerOn");
}
protected int _intervalBetweenEventStartsMinutes;
public int IntervalBetweenEventStartsMinutes
{
get => _intervalBetweenEventStartsMinutes;
set => SetProperty(ref _intervalBetweenEventStartsMinutes, value, "IntervalBetweenEventStartsMinutes");
}
protected TimeUnitTypeEnum _timedIntervalUnits;
public TimeUnitTypeEnum TimedIntervalUnits
{
get => _timedIntervalUnits;
set => SetProperty(ref _timedIntervalUnits, value, "TimedIntervalUnits");
}
protected double _timedIntervalDuration;
public double TimedIntervalDuration
{
get => _timedIntervalDuration;
set => SetProperty(ref _timedIntervalDuration, value, "TimedIntervalDuration");
}
protected double _timedIntervalEvents;
public double TimedIntervalEvents
{
get => _timedIntervalEvents;
set => SetProperty(ref _timedIntervalEvents, value, "TimedIntervalEvents");
}
protected bool _rtcScheduleTriggerOn = false;
public bool RTCScheduleTriggerOn
{
get => _rtcScheduleTriggerOn;
set => SetProperty(ref _rtcScheduleTriggerOn, value, "RTCScheduleTriggerOn");
}
protected DateTime _rtcScheduleStartDateTime = DateTime.MinValue;
public DateTime RTCScheduleStartDateTime
{
get => _rtcScheduleStartDateTime;
set => SetProperty(ref _rtcScheduleStartDateTime, value, "RTCScheduleStartDateTime");
}
protected TimeSpan _rtcScheduleDuration;
public TimeSpan RTCScheduleDuration
{
get => _rtcScheduleDuration;
set => SetProperty(ref _rtcScheduleDuration, value, "RTCScheduleDuration");
}
/// <summary>
/// This is used to signify that the TSR AIR "Vibration" mode is to be used.
/// This is like Recorder mode, but the event line, not the start line, is
/// used to initiate data collection.
///
/// </summary>
protected bool _startWithEvent;
public bool StartWithEvent
{
get => _startWithEvent;
set => SetProperty(ref _startWithEvent, value, "StartWithEvent");
}
public TestSetupRecord(ITestSetupRecord copy)
{
Copy(copy);
}
public void Copy(ITestSetupRecord copy)
{
Id = copy.Id;
Name = copy.Name;
TestSetupUniqueId = copy.TestSetupUniqueId;
Description = copy.Description;
AllowMissingSensors = copy.AllowMissingSensors;
AllowSensorIdToBlankChannel = copy.AllowSensorIdToBlankChannel;
AutomaticProgressionDelayMS = copy.AutomaticProgressionDelayMS;
AutomaticProgression = copy.AutomaticProgression;
AutoVerifyChannels = copy.AutoVerifyChannels;
CalibrationBehavior = copy.CalibrationBehavior;
CommonStatusLine = copy.CommonStatusLine;
UploadData = copy.UploadData;
UploadFolder = copy.UploadFolder;
UploadExportsOnly = copy.UploadExportsOnly;
CustomerDetails = copy.CustomerDetails;
TestEngineerDetails = copy.TestEngineerDetails;
ExtraProperties = copy.ExtraProperties;
DownloadAll = copy.DownloadAll;
ViewExport = copy.ViewExport;
ExportFormats = copy.ExportFormats;
InvertStartRecordCompletion = copy.InvertStartRecordCompletion;
IgnoreShortedStartCompletion = copy.IgnoreShortedStartCompletion;
IgnoreShortedTriggerCompletion = copy.IgnoreShortedTriggerCompletion;
TriggerCheckRealtime = copy.TriggerCheckRealtime;
TriggerCheckStep = copy.TriggerCheckStep;
PostTestDiagnosticsLevel = copy.PostTestDiagnosticsLevel;
InvertTriggerCompletion = copy.InvertTriggerCompletion;
LabDetails = copy.LabDetails;
LastModified = copy.LastModified;
LastModifiedBy = copy.LastModifiedBy;
LocalOnly = copy.LocalOnly;
PostTriggerSeconds = copy.PostTriggerSeconds;
PreTriggerSeconds = copy.PreTriggerSeconds;
NumberOfEvents = copy.NumberOfEvents;
WakeUpMotionTimeout = copy.WakeUpMotionTimeout;
DefaultNumberRealtimeGraphs = copy.DefaultNumberRealtimeGraphs;
RecordingMode = copy.RecordingMode;
RequireUserConfirmationOnErrors = copy.RequireUserConfirmationOnErrors;
DoROIDownload = copy.DoROIDownload;
ROIEnd = copy.ROIEnd;
ROIStart = copy.ROIStart;
RegionsOfInterest = copy.RegionsOfInterest;
SameAsDownloadFolder = copy.SameAsDownloadFolder;
SamplesPerSecondAggregate = copy.SamplesPerSecondAggregate;
Settings = copy.Settings;
WarnOnFailedBattery = copy.WarnOnFailedBattery;
StrictDiagnostics = copy.StrictDiagnostics;
UseCustomerDetails = copy.UseCustomerDetails;
UseTestEngineerDetails = copy.UseTestEngineerDetails;
TurnOffExcitation = copy.TurnOffExcitation;
UseLabratoryDetails = copy.UseLabratoryDetails;
VerifyChannels = copy.VerifyChannels;
AutoVerifyDelaySeconds = copy.AutoVerifyDelaySeconds;
ViewDiagnostics = copy.ViewDiagnostics;
ViewDownloadAll = copy.ViewDownloadAll;
ViewRealtime = copy.ViewRealtime;
ViewROIDownload = copy.ViewROIDownload;
Dirty = copy.Dirty;
IsComplete = copy.IsComplete;
ISFFile = copy.ISFFile;
ErrorMessage = copy.ErrorMessage;
CheckoutMode = copy.CheckoutMode;
QuitTestWithoutWarning = copy.QuitTestWithoutWarning;
SuppressMissingSensorsWarning = copy.SuppressMissingSensorsWarning;
NotAllChannelsRealTime = copy.NotAllChannelsRealTime;
NotAllChannelsViewer = copy.NotAllChannelsViewer;
var bytes = new byte[0];
if (copy.TagsBlobBytes.Any())
{
bytes = new byte[copy.TagsBlobBytes.Length];
copy.TagsBlobBytes.CopyTo(bytes, 0);
}
TagsBlobBytes = bytes;
DoAutoArm = copy.DoAutoArm;
DoStreaming = copy.DoStreaming;
DoEnableRepeat = copy.DoEnableRepeat;
ClockSyncProfileMaster = copy.ClockSyncProfileMaster;
ClockSyncProfileSlave = copy.ClockSyncProfileSlave;
MeasureSquibResistancesStep = copy.MeasureSquibResistancesStep;
LowgLevelTriggerOn = copy.LowgLevelTriggerOn;
LowgLevelTriggerOnX = copy.LowgLevelTriggerOnX;
LowgLevelTriggerOnY = copy.LowgLevelTriggerOnY;
LowgLevelTriggerOnZ = copy.LowgLevelTriggerOnZ;
HighgLevelTriggerOn = copy.HighgLevelTriggerOn;
HighgLevelTriggerOnX = copy.HighgLevelTriggerOnX;
HighgLevelTriggerOnY = copy.HighgLevelTriggerOnY;
HighgLevelTriggerOnZ = copy.HighgLevelTriggerOnZ;
AngularAccelLevelTriggerOn = copy.AngularAccelLevelTriggerOn;
AngularAccelLevelTriggerOnX = copy.AngularAccelLevelTriggerOnX;
AngularAccelLevelTriggerOnY = copy.AngularAccelLevelTriggerOnY;
AngularAccelLevelTriggerOnZ = copy.AngularAccelLevelTriggerOnZ;
AngularRateLevelTriggerOn = copy.AngularRateLevelTriggerOn;
AngularRateLevelTriggerOnX = copy.AngularRateLevelTriggerOnX;
AngularRateLevelTriggerOnY = copy.AngularRateLevelTriggerOnY;
AngularRateLevelTriggerOnZ = copy.AngularRateLevelTriggerOnZ;
LowgLinearLevelTriggerX = copy.LowgLinearLevelTriggerX;
LowgLinearLevelTriggerY = copy.LowgLinearLevelTriggerY;
LowgLinearLevelTriggerZ = copy.LowgLinearLevelTriggerZ;
HighgLinearLevelTriggerX = copy.HighgLinearLevelTriggerX;
HighgLinearLevelTriggerY = copy.HighgLinearLevelTriggerY;
HighgLinearLevelTriggerZ = copy.HighgLinearLevelTriggerZ;
AngularAccelLevelTriggerX = copy.AngularAccelLevelTriggerX;
AngularAccelLevelTriggerY = copy.AngularAccelLevelTriggerY;
AngularAccelLevelTriggerZ = copy.AngularAccelLevelTriggerZ;
AngularRateLevelTriggerX = copy.AngularRateLevelTriggerX;
AngularRateLevelTriggerY = copy.AngularRateLevelTriggerY;
AngularRateLevelTriggerZ = copy.AngularRateLevelTriggerZ;
HumidityLevelTriggerOn = copy.HumidityLevelTriggerOn;
PressureLevelTriggerOn = copy.PressureLevelTriggerOn;
TemperatureLevelTriggerOn = copy.TemperatureLevelTriggerOn;
HumidityLevelTriggerBelow = copy.HumidityLevelTriggerBelow;
HumidityLevelTriggerAbove = copy.HumidityLevelTriggerAbove;
PressureLevelTriggerBelow = copy.PressureLevelTriggerBelow;
PressureLevelTriggerAbove = copy.PressureLevelTriggerAbove;
TemperatureLevelTriggerBelow = copy.TemperatureLevelTriggerBelow;
TemperatureLevelTriggerAbove = copy.TemperatureLevelTriggerAbove;
LowgLinearAccRate = copy.LowgLinearAccRate;
HighgLinearAccRate = copy.HighgLinearAccRate;
AngularRate = copy.AngularRate;
TemperatureHumidityPressureRate = copy.TemperatureHumidityPressureRate;
BatterySaverModeOn = copy.BatterySaverModeOn;
WakeUpAndArmTriggerOn = copy.WakeUpAndArmTriggerOn;
WakeUpTrigger = copy.WakeUpTrigger;
WakeUpMotionTimeout = copy.WakeUpMotionTimeout;
WakeUpMagnetTimeout = copy.WakeUpMagnetTimeout;
WakeUpTimeSessionStart = copy.WakeUpTimeSessionStart;
WakeUpTimeDuration = copy.WakeUpTimeDuration;
TimedIntervalTriggerOn = copy.TimedIntervalTriggerOn;
TimedIntervalDuration = copy.TimedIntervalDuration;
TimedIntervalEvents = copy.TimedIntervalEvents;
IntervalBetweenEventStartsMinutes = copy.IntervalBetweenEventStartsMinutes;
TimedIntervalUnits = copy.TimedIntervalUnits;
RTCScheduleTriggerOn = copy.RTCScheduleTriggerOn;
RTCScheduleStartDateTime = copy.RTCScheduleStartDateTime;
RTCScheduleDuration = copy.RTCScheduleDuration;
StartWithEvent = copy.StartWithEvent;
AlignUDPToPPS = copy.AlignUDPToPPS;
}
public TestSetupRecord() { }
public TestSetupRecord(IDataReader reader, double defaultROIStart, double defaultROIEnd,
bool defaultIgnoreShortedStart, bool defaultIgnoreShortedTrigger, int storedProcedureVersionUsed,
out string[] errors)
{
var lErrors = new List<string>();
try
{
Id = Utility.GetInt(reader, "TestSetupId", -1);
Name = Utility.GetString(reader, "SetupName");
TestSetupUniqueId = Utility.GetString(reader, "TestSetupUniqueId");
Description = Utility.GetString(reader, "SetupDescription");
AllowMissingSensors = Utility.GetBool(reader, "AllowMissingSensors");
AllowSensorIdToBlankChannel = Utility.GetBool(reader, "AllowSensorIdToBlankChannel");
AutomaticProgressionDelayMS = Utility.GetInt(reader, "AutomaticProgressionDelayMS");
AutomaticProgression = Utility.GetBool(reader, "AutomaticTestProgression");
AutoVerifyChannels = Utility.GetBool(reader, "AutoVerifyChannels");
CalibrationBehavior = (CalibrationBehaviors)Utility.GetInt(reader, "CalibrationBehavior");
CommonStatusLine = Utility.GetBool(reader, "CommonStatusLine");
UploadData = Utility.GetBool(reader, "UploadData");
UploadFolder = Utility.GetString(reader, "UploadDataFolder");
UploadExportsOnly = Utility.GetBool(reader, "UploadExportsOnly", false);
CustomerDetails = Utility.GetString(reader, "CustomerDetails");
TestEngineerDetails = Utility.GetString(reader, "TestEngineerDetails");
var sProperties = Utility.GetString(reader, "ExtraProperties");
ExtraProperties.Clear();
var deserializedExProps = new JavaScriptSerializer()
.Deserialize<List<ExtraProperty>>(sProperties);
if (null != deserializedExProps) ExtraProperties.AddRange(deserializedExProps);
DownloadAll = Utility.GetBool(reader, "DownloadAll");
ViewExport = Utility.GetBool(reader, "Export");
ExportFormats = (SupportedExportFormatBitFlags)Utility.GetUlong(reader, "ExportFormat");
InvertStartRecordCompletion = Utility.GetBool(reader, "InvertStart");
if (storedProcedureVersionUsed >= Constants.IgnoreShorted_DB_VERSION)
{
// We're using a database that has these values in the TestSetups table.
// If we weren't we'd get them from the config file.
IgnoreShortedStartCompletion = Utility.GetBool(reader, "IgnoreShortedStart");
IgnoreShortedTriggerCompletion = Utility.GetBool(reader, "IgnoreShortedTrigger");
}
else
{
// We're using a database that DOESN'T have these values in the TestSetups table.
// So, we will get them from the config file instead - otherwise, there would be
// no way to set them to True.
IgnoreShortedStartCompletion = defaultIgnoreShortedStart;
IgnoreShortedTriggerCompletion = defaultIgnoreShortedTrigger;
}
TriggerCheckRealtime = Utility.GetBool(reader, "TriggerCheckRealtime");
TriggerCheckStep = Utility.GetBool(reader, "TriggerCheckStep");
PostTestDiagnosticsLevel = (0 != Utility.GetInt(reader, "PostTestDiagnostics", 0));
InvertTriggerCompletion = Utility.GetBool(reader, "InvertTrigger");
LabDetails = Utility.GetString(reader, "LabDetails");
LastModified = Utility.GetDateTime(reader, "LastModified", DateTime.MinValue);
LastModifiedBy = Utility.GetString(reader, "LastModifiedBy");
LocalOnly = Utility.GetBool(reader, "LocalOnly");
PostTriggerSeconds = Utility.GetDouble(reader, "PostTriggerSeconds");
PreTriggerSeconds = Utility.GetDouble(reader, "PreTriggerSeconds");
NumberOfEvents = Utility.GetInt(reader, "NumberOfEvents", 1);
WakeUpMotionTimeout = Utility.GetInt(reader, "WakeUpMotionTimeout", TSRAIR.WAKEUP_MOTION_TIMEOUT);
DefaultNumberRealtimeGraphs = Utility.GetShort(reader, "RealtimePlotCount");
RecordingMode = (RecordingModes)Utility.GetInt(reader, "RecordingMode");
RequireUserConfirmationOnErrors = Utility.GetBool(reader, "RequireConfirmationOnErrors");
DoROIDownload = Utility.GetBool(reader, "ROIDownload");
ROIEnd = Utility.GetDouble(reader, "ROIEnd");
ROIStart = Utility.GetDouble(reader, "ROIStart");
// If we are using a database that still has a string field for RegionsOfInterest in the TestSetups table,
// then Deserialize it, otherwise, we'll get build the RegionsOfInterest list from LoadRegionsOfInterestFromDb().
if (storedProcedureVersionUsed < Constants.ROITables_DB_VERSION)
{
var sRegions = Utility.GetString(reader, "RegionsOfInterest");
//the deserialization is going to fire off a whole bunch of change notifications that don't really mean anything
//just skip them
RegionOfInterest.Deserializing = true;
try
{
RegionsOfInterest.Clear();
var deserializedROIs = new JavaScriptSerializer()
.Deserialize<BindingList<RegionOfInterest>>(sRegions);
if (deserializedROIs == null)
{
//This may be from a Test Setup that was imported from an earlier release that
//didn't yet have the concept of multiple ROIs, so re-initialize to defaults, if available.
RegionsOfInterest.Add(new RegionOfInterest("", true, ROIStart, ROIEnd));
RegionsOfInterest.Add(new RegionOfInterest("", true, defaultROIStart, defaultROIEnd));
}
else
{
RegionsOfInterest.AddRange(deserializedROIs.ToArray());
}
}
finally { RegionOfInterest.Deserializing = false; }
}
SameAsDownloadFolder = Utility.GetBool(reader, "SameAsDownloadFolder");
SamplesPerSecondAggregate = Utility.GetDouble(reader, "SamplesPerSecond");
Settings = Utility.GetString(reader, "Settings");
WarnOnFailedBattery = Utility.GetBool(reader, "WarnOnBatteryFail");
StrictDiagnostics = Utility.GetInt(reader, "StrictDiagnostics") != 0;
UseCustomerDetails = Utility.GetBool(reader, "UseCustomerDetails");
UseTestEngineerDetails = Utility.GetBool(reader, "UseTestEngineerDetails");
TurnOffExcitation = Utility.GetBool(reader, "TurnOffExcitation");
UseLabratoryDetails = Utility.GetBool(reader, "UseLabDetails");
VerifyChannels = Utility.GetBool(reader, "VerifyChannels");
AutoVerifyDelaySeconds = Utility.GetDouble(reader, "VerifyChannelsDelayMS") / 1000D;
ViewDiagnostics = Utility.GetBool(reader, "ViewDiagnostics");
ViewDownloadAll = Utility.GetBool(reader, "ViewDownloadAll");
ViewRealtime = Utility.GetBool(reader, "ViewRealtime");
ViewROIDownload = Utility.GetBool(reader, "ViewROIDownload");
Dirty = Utility.GetBool(reader, "Dirty");
IsComplete = Utility.GetBool(reader, "Complete");
ISFFile = Utility.GetString(reader, "ISFFile");
ErrorMessage = Utility.GetString(reader, "ErrorMessage");
CheckoutMode = Utility.GetBool(reader, "CheckoutMode");
QuitTestWithoutWarning = Utility.GetBool(reader, "QuitTestWithoutWarning");
SuppressMissingSensorsWarning = Utility.GetBool(reader, "SuppressMissingSensorsWarning");
NotAllChannelsRealTime = Utility.GetBool(reader, "NotAllChannelsRealTime");
NotAllChannelsViewer = Utility.GetBool(reader, "NotAllChannelsViewer");
TagsBlobBytes = Utility.GetByteArray(reader, "UserTags");
DoAutoArm = Utility.GetBool(reader, "DoAutoArm");
DoStreaming = Utility.GetBool(reader, "DoStreaming");
if (storedProcedureVersionUsed >= Constants.EnableRepeat_DB_VERSION)
{
// We're using a database that has this value in the TestSetups table.
// If we weren't we'd get it from the System Settings in LoadFromDb().
DoEnableRepeat = Utility.GetBool(reader, "RepeatAutoArmOrStreaming");
}
var sClockMaster = Utility.GetString(reader, "ClockSyncProfileMaster");
if (string.IsNullOrWhiteSpace(sClockMaster)) { sClockMaster = ClockSyncProfile.None.ToString(); }
if (!Enum.TryParse(sClockMaster, out ClockSyncProfile clockMaster))
{
lErrors.Add($"{Strings.Strings.InvalidClockSyncProfileMaster} - {sClockMaster} - {Name}");
clockMaster = ClockSyncProfile.None;
}
if (Constants.OnePPSOutProfiles.Contains(clockMaster) && storedProcedureVersionUsed < Constants.ONEPPS_OUT_DB_VERSION)
{
clockMaster = ClockSyncProfile.None;
}
ClockSyncProfileMaster = clockMaster;
var sClockSlave = Utility.GetString(reader, "ClockSyncProfileSlave");
if (string.IsNullOrWhiteSpace(sClockSlave)) { sClockSlave = ClockSyncProfile.None.ToString(); }
if (!Enum.TryParse(sClockSlave, out ClockSyncProfile clockSlave))
{
lErrors.Add($"{Strings.Strings.InvalidClockSlave} - {sClockSlave} - {Name}");
clockSlave = ClockSyncProfile.None;
}
if (Constants.OnePPSOutProfiles.Contains(clockMaster) && storedProcedureVersionUsed < Constants.ONEPPS_OUT_DB_VERSION)
{
clockSlave = ClockSyncProfile.None;
}
ClockSyncProfileSlave = clockSlave;
MeasureSquibResistancesStep = Utility.GetBool(reader, "MeasureSquibResistancesStep");
GetTSRAirFields(reader);
if (storedProcedureVersionUsed >= Constants.ALIGNUDPTOPPS_DB_VERSION)
{
AlignUDPToPPS = Utility.GetBool(reader, "AlignUDPToPPS");
}
}
catch (Exception ex)
{
lErrors.Add($"{ex.Message} - {Name}");
}
errors = lErrors.ToArray();
}
/// <summary>
/// initializes a test template from an IDataReader
/// this is because the code constructing from an IDataReader was already really long
/// </summary>
public void GetTSRAirFields(IDataReader reader)
{
_wakeUpAndArmTriggerOn = Utility.GetBool(reader, "WakeupAndTriggerOn", false);
_wakeUpTrigger = (WakeupTriggers)Utility.GetInt(reader, "WakeupTrigger", 0);
_wakeUpMotionTimeout = Utility.GetInt(reader, "WakeUpMotionTimeout", 0);
_intervalBetweenEventStartsMinutes = Utility.GetInt(reader, "TimedIntervalFrequency", 0);
_rtcScheduleStartDateTime = Utility.GetDateTime(reader, "RTCScheduleStartDateTime", DateTime.Now);
_rtcScheduleDuration = TimeSpan.FromTicks(Utility.GetLong(reader, "RTCScheduleDuration", 0));
_startWithEvent = Utility.GetBool(reader, "StartWithEvent", false);
}
public void InitializeFromDefaults(CalibrationBehaviors calBehavior,
RecordingModes recordingMode, double preTriggerSeconds, double postTriggerSeconds,
int numEvents)
{
CalibrationBehavior = calBehavior;
RecordingMode = recordingMode;
PreTriggerSeconds = preTriggerSeconds;
PostTriggerSeconds = postTriggerSeconds;
NumberOfEvents = numEvents;
IsComplete = false;
}
}
}