using NEIntelligentControl2.Models.Datas;
using NEIntelligentControl2.Models.Windturbine;
using NEIntelligentControl2.Models.WinForms;
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 WindturbineDetailsCard : UserControl
{
public string CardTitle { get; internal set; }
public List Items { get; internal set; }
public WindturbineInfo Info { get; internal set; }
private List _PointTags;
public WindturbineDetailsCard()
{
InitializeComponent();
}
internal void RefreshData(Dictionary vs)
{
if (ug.Children.Count <= 0)
{
Init();
}
foreach (var v in _PointTags)
{
v.UpdateData(vs);
}
}
private void Init()
{
if (Items == null) return;
_PointTags = new List();
foreach (var v in Items)
{
if (string.IsNullOrWhiteSpace(v.Name)) continue;
PointTag pt = new PointTag(v, Info.WindturbineId) { Margin = new Thickness(1) };
ug.Children.Add(pt);
_PointTags.Add(pt);
}
}
}
}