using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using IntelligentControlForsx.Service.WindturbineInfo; namespace IntelligentControlForsx.MyControls.windturbine { public partial class PointValueAI : UserControl { public PointValueAI() { InitializeComponent(); } private string nameString; public string NameString { set { nameString = value; lblName.Text = value; } get { return nameString; } } private string unitString; public string UnitString { set { unitString = value; lblUnit.Text = value; } get { return unitString; } } private string valueString; public string ValueString { set { valueString = value; lblValue.ValueString = value; } get { return valueString; } } public void BindData(UniformCodeInfo data) { if (string.IsNullOrEmpty(data.Name)) { lblValue.Visible = false; lblUnit.Text = ""; lblName.Text = ""; } else { lblValue.Visible = true; lblName.Text = data.Name; if (data.Name.Contains("总发电量") || data.Name.Contains("发电量") || data.Name.Contains("量")) { double? pointValue = Convert.ToDouble(data.PointValue); double finalValue = pointValue.Value / 10000; lblValue.BindData(data.WindturbineId, data.UniformCode, finalValue.ToString("f2"), data.Name); } else if (data.Name.Contains("发电机转速") && data.ModelId == "UP105-2000-S") { double? pointValue = Convert.ToDouble(data.PointValue); double finalValue = pointValue.Value * 9.55; lblValue.BindData(data.WindturbineId, data.UniformCode, finalValue.ToString("f2"), data.Name); } else { lblValue.ValueString = data.PointValue; lblValue.BindData(data.WindturbineId, data.UniformCode, data.PointValue, data.Name); } lblUnit.Text = data.Unit; } } } }