Files
YuPu-OrpaonEMS/OrpaonEMS.App/Models/EleMeter.cs
2025-02-28 22:23:13 +08:00

84 lines
1.8 KiB
C#

using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OrpaonEMS.App.Models
{
/// <summary>
/// 电表
/// </summary>
public class EleMeter : BindableBase
{
public EleMeter()
{
}
private double _RtPw;
/// <summary>
/// 实时功率
/// </summary>
public double RtPw
{
get { return _RtPw; }
set
{
ListAve.Add(value);
if (ListAve.Count()>20)
{
ListAve.RemoveAt(0);
}
AvePw= ListAve.Average();
_RtPw = value;
RaisePropertyChanged();
}
}
/// <summary>
/// 平均值
/// </summary>
public double AvePw { get; set; }
private bool _MeterLinkState;
/// <summary>
/// 连接状态
/// </summary>
public bool MeterLinkState
{
get { return _MeterLinkState; }
set { _MeterLinkState = value; RaisePropertyChanged(); }
}
private double _EleQ_P;
/// <summary>
/// 正向有功电能
/// </summary>
public double EleQ_P
{
get { return _EleQ_P; }
set { _EleQ_P = value; RaisePropertyChanged(); }
}
private double _EleQ_N;
/// <summary>
/// 反向有功电能
/// </summary>
public double EleQ_N
{
get { return _EleQ_N; }
set { _EleQ_N = value; RaisePropertyChanged(); }
}
/// <summary>
/// 数据集合
/// </summary>
private List<double> ListAve { get; set; } = new List<double>()
{
};
}
}