using System; namespace DatabaseImport { /// /// this is a lightweight version of test TestTemplate, holding just the essential information /// [updated]: this concept is already present in testtemplate, /// by default it only loads information in the tblTestSetup, and then uses the IsLoaded flag to /// check whether it's populated information from other tables or not. /// I'll leave the class here for now in case we want to expand on it in the future, also I cleaned up a few things in the process anyhow /// public class TestTemplateLite : ITestSetup { public string Name { get; set; } public string Description { get; set; } = ""; public RecordingModes RecordingMode { get; set; } private double _preTriggerSeconds; public double PreTriggerSeconds { get { switch (RecordingMode) { case RecordingModes.Recorder: case RecordingModes.HybridRecorder: return 0D; case RecordingModes.CircularBuffer: return _preTriggerSeconds; default: return _preTriggerSeconds; } } set => _preTriggerSeconds = value; } public string ErrorMessage { get; set; } = string.Empty; /// /// returns the error messages for a test setup /// calculated at the same time is complete is calculated, however doesn't have a check against /// is dirty, like IsComplete does ... /// public string CompletionErrorMessage => ErrorMessage.Length > 250 ? ErrorMessage.Substring(0, 250) : ErrorMessage; public double PostTriggerSeconds { get; set; } public DateTime LastModified { get; set; } public string LastModifiedBy { get; set; } public bool IsComplete { get; set; } } }