This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,128 @@
using System;
using System.ComponentModel;
namespace DatabaseImport
{
[Serializable]
public class RegionOfInterest : INotifyPropertyChanged
{
public RegionOfInterest()
{
Suffix = string.Empty;
Start = -1D;
End = 1D;
IsEnabled = true;
IsDefault = true;
}
public RegionOfInterest(bool isDefault = false)
: this()
{
IsDefault = isDefault;
}
public RegionOfInterest(string suffix = "", bool isDefault = false, double start = -1D, double end = 1D)
: this(isDefault)
{
Suffix = suffix;
Start = start;
End = end;
}
private string _suffix = string.Empty;
public string Suffix
{
get => _suffix;
set
{
if (!string.IsNullOrWhiteSpace(value) && !(value.StartsWith("_") && string.IsNullOrWhiteSpace(value.Substring(1))))
{
_suffix = value.StartsWith("_") ? value : "_" + value;
}
OnPropertyChanged("Suffix");
}
}
private double _start = double.MinValue;
public double Start
{
get => _start;
set
{
if (value >= End)
{
value = End - 0.01;
}
if (value < PreTrigger)
{
value = PreTrigger;
}
_start = value;
OnPropertyChanged("Start");
}
}
private double _end = double.MaxValue;
public double End
{
get => _end;
set
{
if (value <= Start)
{
value = Start + 0.01;
}
if (value > PostTrigger)
{
value = PostTrigger;
}
_end = value; OnPropertyChanged("End");
}
}
private double _preTrigger = double.MinValue;
public double PreTrigger
{
get => _preTrigger;
set
{
_preTrigger = value;
OnPropertyChanged("PreTrigger");
if (Start < PreTrigger)
{
Start = PreTrigger;
}
}
}
private double _postTrigger = double.MaxValue;
public double PostTrigger
{
get => _postTrigger;
set
{
_postTrigger = value;
OnPropertyChanged("PostTrigger");
if (End > PostTrigger)
{
End = PostTrigger;
}
}
}
private bool _isEnabled = true;
public bool IsEnabled
{
get => _isEnabled;
set { _isEnabled = value; OnPropertyChanged("IsEnabled"); }
}
public bool IsDefault { get; private set; }
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged(string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}