init
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
using DTS.Common.Interface.DASFactory.Diagnostics;
|
||||
using System;
|
||||
|
||||
namespace DTS.Common.Classes.DASFactory
|
||||
{
|
||||
public class CanDiagnostics : Base.BasePropertyChanged, ICanDiagnosticResult
|
||||
{
|
||||
private bool _Active = false;
|
||||
public bool Active
|
||||
{
|
||||
get => _Active;
|
||||
set => SetProperty(ref _Active, value);
|
||||
}
|
||||
private int _ChannelIndex = -1;
|
||||
public int ChannelIndex
|
||||
{
|
||||
get => _ChannelIndex;
|
||||
set => SetProperty(ref _ChannelIndex, value);
|
||||
}
|
||||
private int _Data = 0;
|
||||
public int Data
|
||||
{
|
||||
get => _Data;
|
||||
set => SetProperty(ref _Data, value);
|
||||
}
|
||||
private int _ErrorFrame = 0;
|
||||
public int ErrorFrame
|
||||
{
|
||||
get => _ErrorFrame;
|
||||
set
|
||||
{
|
||||
SetProperty(ref _ErrorFrame, value);
|
||||
OnPropertyChanged("Errors");
|
||||
}
|
||||
}
|
||||
private double _Load;
|
||||
public double Load
|
||||
{
|
||||
get => _Load;
|
||||
set => SetProperty(ref _Load, value);
|
||||
}
|
||||
private int _Overruns = 0;
|
||||
public int Overruns
|
||||
{
|
||||
get => _Overruns;
|
||||
set
|
||||
{
|
||||
SetProperty(ref _Overruns, value);
|
||||
OnPropertyChanged("Errors");
|
||||
}
|
||||
}
|
||||
private DateTime _LastUpdate = DateTime.MinValue;
|
||||
public DateTime LastUpdate
|
||||
{
|
||||
get => _LastUpdate;
|
||||
set => SetProperty(ref _LastUpdate, value);
|
||||
}
|
||||
public int Errors
|
||||
{
|
||||
get => _ErrorFrame != 0 ? 1 + Overruns : Overruns;
|
||||
}
|
||||
private string _ChannelName = string.Empty;
|
||||
public string ChannelName
|
||||
{
|
||||
get => _ChannelName;
|
||||
set => SetProperty(ref _ChannelName, value);
|
||||
}
|
||||
public void Copy(ICanDiagnosticResult source)
|
||||
{
|
||||
Active = source.Active;
|
||||
ChannelIndex = source.ChannelIndex;
|
||||
Data = source.Data;
|
||||
ErrorFrame = source.ErrorFrame;
|
||||
Load = source.Load;
|
||||
Overruns = source.Overruns;
|
||||
LastUpdate = source.LastUpdate;
|
||||
ChannelName = source.ChannelName;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user