init
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using DTS.Common.Base;
|
||||
using DTS.Common.Enums.Sensors;
|
||||
using DTS.Common.Interface;
|
||||
using DTS.Common.Interface.TestDefinition;
|
||||
using Microsoft.Practices.Prism.Commands;
|
||||
// ReSharper disable CheckNamespace
|
||||
// ReSharper disable RedundantDefaultMemberInitializer
|
||||
|
||||
namespace DTS.Common.Classes.Viewer.TestMetadata
|
||||
{
|
||||
public class TestSummary : ITestSummary
|
||||
{
|
||||
/// <summary>
|
||||
/// the _ROI Period x folder name if present
|
||||
/// 18411 Data will not export [CSV Unfiltered]
|
||||
/// </summary>
|
||||
public const string ROI_SUFFIX = @"_ROI Period";
|
||||
public string Id { get; set; }
|
||||
public string SetupName { get; set; }
|
||||
public string Description { get; set; }
|
||||
public int ChannelCount { get; set; }
|
||||
public DateTime FileDate { get; set; }
|
||||
public DateTime TimeStamp { get; set; }
|
||||
public string DataType { get; set; }
|
||||
private bool _isSelected = false;
|
||||
public bool IsSelected { get => _isSelected; set { if (value != IsSelected) { _isSelected = value; SelectionChanged(); OnPropertyChanged("IsSelected"); } } }
|
||||
public List<ITestGraphs> Graphs { get; set; }
|
||||
public List<ITestChannel> Channels { get; set; }
|
||||
public List<ITestChannel> CalculatedChannels { get; set; }
|
||||
public IBaseViewModel Parent { get; set; }
|
||||
public CalibrationBehaviors CalibrationBehavior { get; set; } = CalibrationBehaviors.NonLinearIfAvailable;
|
||||
public ITestMetadata TestMetadata { get; set; }
|
||||
|
||||
#region Commands
|
||||
|
||||
private DelegateCommand _isSelectedCommand;
|
||||
public DelegateCommand IsSelectedCommand
|
||||
{
|
||||
get => _isSelectedCommand ?? (_isSelectedCommand = new DelegateCommand(SelectionChanged));
|
||||
set => _isSelectedCommand = value;
|
||||
}
|
||||
public void SelectionChanged()
|
||||
{
|
||||
var parent = (ITestSummaryListViewModel) Parent;
|
||||
|
||||
if (parent == null) return;
|
||||
|
||||
var list = parent.SelectedTestSummaryList;
|
||||
|
||||
if (IsSelected) { if (!list.Contains(this)) list.Add(this); }
|
||||
else { if (list.Contains(this)) list.Remove(this); }
|
||||
|
||||
parent.PublishSelectedTestSummaryList();
|
||||
|
||||
}
|
||||
#endregion Commands
|
||||
|
||||
///<summary>
|
||||
///Occurs when a property value changes.
|
||||
///</summary>
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
public void OnPropertyChanged(string propertyName)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user