73 lines
4.7 KiB
C#
73 lines
4.7 KiB
C#
|
|
using DTS.Common.Enums.Viewer.Reports;
|
|||
|
|
using DTS.Common.Interface;
|
|||
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.ComponentModel;
|
|||
|
|
using System.Linq;
|
|||
|
|
using System.Text;
|
|||
|
|
using System.Threading.Tasks;
|
|||
|
|
|
|||
|
|
namespace DTS.Viewer.PSDReportSettings
|
|||
|
|
{
|
|||
|
|
public class PSDReportSettingsModel : Common.Base.BasePropertyChanged, IPSDReportSettingsModel
|
|||
|
|
{
|
|||
|
|
private IPSDReportSettingsViewModel _parent;
|
|||
|
|
public IPSDReportSettingsViewModel Parent { get => _parent; set { if (_parent != null && _parent.Equals(value)) return; _parent = value; OnPropertyChanged("Parent"); } }
|
|||
|
|
|
|||
|
|
private bool _canPublishChanges = true;
|
|||
|
|
public bool CanPublishChanges { get => _canPublishChanges; set { _canPublishChanges = value; OnPropertyChanged("CanPublishChanges"); } }
|
|||
|
|
|
|||
|
|
private bool _lowPassFilterEnabled = false;
|
|||
|
|
public bool LowPassFilterEnabled { get => _lowPassFilterEnabled; set { ReadData = true; SetProperty(ref _lowPassFilterEnabled, value, "LowPassFilterEnabled"); } }
|
|||
|
|
private double _lowPassFilterFrequency = 2000;
|
|||
|
|
public double LowPassFilterFrequency { get => _lowPassFilterFrequency; set { ReadData = true; SetProperty(ref _lowPassFilterFrequency, value, "LowPassFilterFrequency"); } }
|
|||
|
|
private PassFilterType _lowPassFilterType = PassFilterType.Butterworth;
|
|||
|
|
public PassFilterType LowPassFilterType { get => _lowPassFilterType; set { ReadData = true; SetProperty(ref _lowPassFilterType, value, "LowPassFilterType"); } }
|
|||
|
|
private int _lowPassFilterOrder = 8;
|
|||
|
|
public int LowPassFilterOrder { get => _lowPassFilterOrder; set { ReadData = true; SetProperty(ref _lowPassFilterOrder, value, "LowPassFilterOrder"); } }
|
|||
|
|
|
|||
|
|
private bool _highPassFilterEnabled = false;
|
|||
|
|
public bool HighPassFilterEnabled { get => _highPassFilterEnabled; set { ReadData = true; SetProperty(ref _highPassFilterEnabled, value, "HighPassFilterEnabled"); } }
|
|||
|
|
private double _highPassFilterFrequency = 5;
|
|||
|
|
public double HighPassFilterFrequency { get => _highPassFilterFrequency; set { ReadData = true; SetProperty(ref _highPassFilterFrequency, value, "HighPassFilterFrequency"); } }
|
|||
|
|
private PassFilterType _highPassFilterType = PassFilterType.Butterworth;
|
|||
|
|
public PassFilterType HighPassFilterType { get => _highPassFilterType; set { ReadData = true; SetProperty(ref _highPassFilterType, value, "HighPassFilterType"); } }
|
|||
|
|
private int _highPassFilterOrder = 8;
|
|||
|
|
public int HighPassFilterOrder { get => _highPassFilterOrder; set { ReadData = true; SetProperty(ref _highPassFilterOrder, value, "HighPassFilterOrder"); } }
|
|||
|
|
|
|||
|
|
private WindowWidth _windowWidth = WindowWidth.FortyNinetySix;
|
|||
|
|
public WindowWidth WindowWidth { get => _windowWidth; set { ReadData = true; SetProperty(ref _windowWidth, value, "WindowWidth"); } }
|
|||
|
|
private WindowType _windowType = WindowType.Hanning;
|
|||
|
|
public WindowType WindowType { get => _windowType; set { ReadData = true; SetProperty(ref _windowType, value, "WindowType"); } }
|
|||
|
|
private WindowAveragingType _windowAveragingType = WindowAveragingType.Averaging;
|
|||
|
|
public WindowAveragingType WindowAveragingType { get => _windowAveragingType; set { ReadData = true; SetProperty(ref _windowAveragingType, value, "WindowAveragingType"); } }
|
|||
|
|
private double _windowOverlappingPercent = 50;
|
|||
|
|
public double WindowOverlappingPercent { get => _windowOverlappingPercent; set { ReadData = true; SetProperty(ref _windowOverlappingPercent, value, "WindowOverlappingPercent"); } }
|
|||
|
|
private bool _showEnvelope = false;
|
|||
|
|
public bool ShowEnvelope { get => _showEnvelope; set { ReadData = true; SetProperty(ref _showEnvelope, value, "ShowEnvelope"); } }
|
|||
|
|
|
|||
|
|
public bool IsSaved { get; }
|
|||
|
|
|
|||
|
|
private bool _readData = false;
|
|||
|
|
public bool ReadData { get => _readData; set => SetProperty(ref _readData, value, "ReadData"); }
|
|||
|
|
private double _dataStart = 0D;
|
|||
|
|
public double DataStart { get => _dataStart; set { ReadData = true; SetProperty(ref _dataStart, value, "DataStart"); } }
|
|||
|
|
private double _dataEnd = 0D;
|
|||
|
|
public double DataEnd { get => _dataEnd; set { ReadData = true; SetProperty(ref _dataEnd, value, "DataEnd"); } }
|
|||
|
|
|
|||
|
|
public override event PropertyChangedEventHandler PropertyChanged;
|
|||
|
|
public override void OnPropertyChanged(string propertyName)
|
|||
|
|
{
|
|||
|
|
var handler = PropertyChanged;
|
|||
|
|
|
|||
|
|
handler?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|||
|
|
|
|||
|
|
if (propertyName == "CanPublishChanges"
|
|||
|
|
|| propertyName == "Parent"
|
|||
|
|
|| propertyName == "ReadData") return;
|
|||
|
|
|
|||
|
|
if (CanPublishChanges) { Parent?.PublishChanges(); }
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|