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 System.Drawing.Text; using IntelligentControlForsx.Code; namespace IntelligentControlForsx.MyControls { public partial class StatusControl : UserControl { bool b=false; public StatusControl() { InitializeComponent(); this.tableLayoutPanel1.Name = Guid.NewGuid().ToString(); this.speed.Name = Guid.NewGuid().ToString(); this.power.Name = Guid.NewGuid().ToString(); this.tableLayoutPanel1.MouseEnter += new System.EventHandler(this.tableLayoutPanel1_MouseEnter); this.tableLayoutPanel1.MouseLeave += new System.EventHandler(this.tableLayoutPanel1_MouseLeave); this.title.MouseEnter += new System.EventHandler(this.tableLayoutPanel1_MouseEnter); this.title.MouseLeave += new System.EventHandler(this.tableLayoutPanel1_MouseLeave); this.speed.MouseEnter += new System.EventHandler(this.tableLayoutPanel1_MouseEnter); this.speed.MouseLeave += new System.EventHandler(this.tableLayoutPanel1_MouseLeave); this.power.MouseEnter += new System.EventHandler(this.tableLayoutPanel1_MouseEnter); this.power.MouseLeave += new System.EventHandler(this.tableLayoutPanel1_MouseLeave); this.label4.MouseEnter += new System.EventHandler(this.tableLayoutPanel1_MouseEnter); this.label4.MouseLeave += new System.EventHandler(this.tableLayoutPanel1_MouseLeave); this.label5.MouseEnter += new System.EventHandler(this.tableLayoutPanel1_MouseEnter); this.label5.MouseLeave += new System.EventHandler(this.tableLayoutPanel1_MouseLeave); //this.panel2.MouseEnter += new System.EventHandler(this.tableLayoutPanel1_MouseEnter); //this.panel2.MouseLeave += new System.EventHandler(this.tableLayoutPanel1_MouseLeave); //this.panel2.Visible = false; //string str1 = UserTools.Path + @"\fonts\webfont.ttf"; ////读取字体文件 //PrivateFontCollection pfc = new PrivateFontCollection(); //pfc.AddFontFile(str1); ////实例化字体 //Font f = new Font(pfc.Families[0], 16, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic)))); ////设置字体 //this.speed.Font = f; } public bool kg { get { return b; } set { b = value; if (b) { this.title.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); } else { this.title.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); } } } public string fWindTurbineId { set; get; } public string WindTurbineId { set; get; } public string StatusId { set { if (this.tableLayoutPanel1.Tag == null) { this.tableLayoutPanel1.Tag = new MyKeyValue(value, 0); } } get { return ((MyKeyValue)this.tableLayoutPanel1.Tag).Key; } } public string SpeedId { set { if (this.speed.Tag == null) { this.speed.Tag = new MyKeyValue(value, 0) ; } } get { return ((MyKeyValue)this.speed.Tag).Key; } } public string PowerId { set { if (this.power.Tag == null) { this.power.Tag = new MyKeyValue(value, 0); } } get { return ((MyKeyValue)this.power.Tag).Key; } } public string WindTurbineName { set { this.title.Text = value; } get { return this.title.Text; } } double speedvalue; public double Speed { get { return ((MyKeyValue)this.speed.Tag).Value; ; } } double powervalue; public double Power { get { return ((MyKeyValue)this.power.Tag).Value; } } /// /// 0, "待机";1, "手动停机";2, "正常发电";3, "发电降出力";4, "限电降出力";5, "限电停机";6, "故障"; /// 7, "故障受累";8, "检修";9, "检修受累";10, "电网受累";11, "环境受累";12, "离线"; /// int statusvalue; public int Status { get { return ((MyKeyValue)this.tableLayoutPanel1.Tag).Value; } } private void tableLayoutPanel1_MouseEnter(object sender, EventArgs e) { this.BackColor = Color.White; } private void tableLayoutPanel1_MouseLeave(object sender, EventArgs e) { this.BackColor = Color.Gray; } private void toolStripMenuItem3_Click(object sender, EventArgs e) { //this.title.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); kg = false; } private void toolStripMenuItem2_Click(object sender, EventArgs e) { //this.panel2.Visible = true; //SelectWTForm form = new SelectWTForm(this); //form.ShowDialog(); } public void Builder() { //LabelManger.AddLabel(this.speed); //LabelManger.AddLabel(this.power); //PanelMessage.AddPanel(this.tableLayoutPanel1); } public void Dop() { //LabelManger.DeleteLabel(this.speed); //LabelManger.DeleteLabel(this.power); //PanelMessage.DeletePanel(this.tableLayoutPanel1); } private void power_Click(object sender, EventArgs e) { } private void title_Click(object sender, EventArgs e) { } } }