using NEIntelligentControl2.Models.PV;
using NEIntelligentControl2.Windows;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace NEIntelligentControl2.Views.Infos
{
///
/// 光伏详情数据点控件
///
public partial class InverterPoint : UserControl
{
// --------------依赖属性--------------
public static readonly DependencyProperty PointValueProperty = DependencyProperty.Register("PointValue", typeof(double), typeof(InverterPoint));
///
/// 数据点值
///
public double PointValue { get { return (double)GetValue(PointValueProperty); } set { SetValue(PointValueProperty, Math.Round(value, 2)); } }
private PVTagInfo tagInfo;
///
/// 光伏信息
///
public PVTagInfo TagInfo { get => tagInfo; set { tagInfo = value; tagInfo.ValueChanged = ValueChanged; } }
///
/// 光伏ID
///
public string PVId { get; internal set; }
public InverterPoint()
{
InitializeComponent();
}
private void ValueChanged(double obj)
{
this.PointValue = obj;
}
private void Border_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (e.ClickCount < 2) return;
HistoryDataWindow.ShowWindow(TagInfo.Name, TagInfo.Code, "windturbine", PVId, 1, 24);
}
}
}