123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216 |
- 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<string, int>(value, 0);
- }
- }
- get
- {
- return ((MyKeyValue<string, int>)this.tableLayoutPanel1.Tag).Key;
- }
- }
-
- public string SpeedId
- {
- set
- {
- if (this.speed.Tag == null)
- {
- this.speed.Tag = new MyKeyValue<string, double>(value, 0) ;
- }
- }
- get
- {
- return ((MyKeyValue<string, double>)this.speed.Tag).Key;
- }
- }
- public string PowerId
- {
- set
- {
- if (this.power.Tag == null)
- {
- this.power.Tag = new MyKeyValue<string, double>(value, 0);
- }
- }
- get
- {
- return ((MyKeyValue<string, double>)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<string, double>)this.speed.Tag).Value; ;
- }
- }
- double powervalue;
- public double Power
- {
- get
- {
- return ((MyKeyValue<string, double>)this.power.Tag).Value;
- }
- }
- /// <summary>
- /// 0, "待机";1, "手动停机";2, "正常发电";3, "发电降出力";4, "限电降出力";5, "限电停机";6, "故障";
- /// 7, "故障受累";8, "检修";9, "检修受累";10, "电网受累";11, "环境受累";12, "离线";
- /// </summary>
- int statusvalue;
- public int Status
- {
- get
- {
- return ((MyKeyValue<string, int>)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)
- {
- }
- }
- }
|