userAlarm

1114
nodyang@aliyun.com 1 week ago
parent b5da282858
commit 6925c22d4d

@ -34,7 +34,9 @@
this.panContent = new System.Windows.Forms.Panel();
this.panel9 = new System.Windows.Forms.Panel();
this.panel8 = new System.Windows.Forms.Panel();
this.button4 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.btnShow = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.btnMes = new System.Windows.Forms.Button();
this.btnAccount = new System.Windows.Forms.Button();
@ -44,7 +46,7 @@
this.btnMain = new System.Windows.Forms.Button();
this.panel2 = new System.Windows.Forms.Panel();
this.label1 = new System.Windows.Forms.Label();
this.btnShow = new System.Windows.Forms.Button();
this.hslLanternSimplePlc = new HslControls.HslLanternSimple();
this.panel1.SuspendLayout();
this.panel6.SuspendLayout();
this.panel7.SuspendLayout();
@ -106,8 +108,10 @@
// panel8
//
this.panel8.BackColor = System.Drawing.Color.Transparent;
this.panel8.Controls.Add(this.hslLanternSimplePlc);
this.panel8.Controls.Add(this.button2);
this.panel8.Controls.Add(this.button1);
this.panel8.Controls.Add(this.btnShow);
this.panel8.Controls.Add(this.button4);
this.panel8.Controls.Add(this.button3);
this.panel8.Controls.Add(this.btnMes);
this.panel8.Controls.Add(this.btnAccount);
@ -122,27 +126,58 @@
this.panel8.Size = new System.Drawing.Size(370, 954);
this.panel8.TabIndex = 3;
//
// button4
// button2
//
this.button2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(21)))), ((int)(((byte)(182)))), ((int)(((byte)(173)))));
this.button2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.button2.Font = new System.Drawing.Font("宋体", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button2.ForeColor = System.Drawing.SystemColors.Window;
this.button2.Location = new System.Drawing.Point(22, 420);
this.button2.Margin = new System.Windows.Forms.Padding(4);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(300, 50);
this.button2.TabIndex = 9;
this.button2.Text = "扫码设置";
this.button2.UseVisualStyleBackColor = false;
//
// button1
//
this.button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(21)))), ((int)(((byte)(182)))), ((int)(((byte)(173)))));
this.button1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.button1.Font = new System.Drawing.Font("宋体", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button1.ForeColor = System.Drawing.SystemColors.Window;
this.button1.Location = new System.Drawing.Point(22, 362);
this.button1.Margin = new System.Windows.Forms.Padding(4);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(300, 50);
this.button1.TabIndex = 8;
this.button1.Text = "打印设置";
this.button1.UseVisualStyleBackColor = false;
//
// btnShow
//
this.button4.BackgroundImage = global::RfidWeb.Properties.Resources.;
this.button4.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.button4.Font = new System.Drawing.Font("宋体", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button4.Location = new System.Drawing.Point(84, 590);
this.button4.Margin = new System.Windows.Forms.Padding(4);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(146, 159);
this.button4.TabIndex = 6;
this.button4.UseVisualStyleBackColor = true;
this.btnShow.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(21)))), ((int)(((byte)(182)))), ((int)(((byte)(173)))));
this.btnShow.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.btnShow.Font = new System.Drawing.Font("宋体", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnShow.ForeColor = System.Drawing.SystemColors.Window;
this.btnShow.Location = new System.Drawing.Point(22, 14);
this.btnShow.Margin = new System.Windows.Forms.Padding(4);
this.btnShow.Name = "btnShow";
this.btnShow.Size = new System.Drawing.Size(300, 50);
this.btnShow.TabIndex = 7;
this.btnShow.Text = "总览图";
this.btnShow.UseVisualStyleBackColor = false;
this.btnShow.Click += new System.EventHandler(this.btnShow_Click);
//
// button3
//
this.button3.BackgroundImage = global::RfidWeb.Properties.Resources.;
this.button3.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.button3.Font = new System.Drawing.Font("宋体", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button3.Location = new System.Drawing.Point(22, 495);
this.button3.Location = new System.Drawing.Point(135, 812);
this.button3.Margin = new System.Windows.Forms.Padding(4);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(300, 87);
this.button3.Size = new System.Drawing.Size(166, 87);
this.button3.TabIndex = 5;
this.button3.UseVisualStyleBackColor = true;
//
@ -197,7 +232,7 @@
this.btnExit.Location = new System.Drawing.Point(22, 812);
this.btnExit.Margin = new System.Windows.Forms.Padding(4);
this.btnExit.Name = "btnExit";
this.btnExit.Size = new System.Drawing.Size(291, 87);
this.btnExit.Size = new System.Drawing.Size(105, 87);
this.btnExit.TabIndex = 2;
this.btnExit.Text = "退出";
this.btnExit.UseVisualStyleBackColor = true;
@ -257,20 +292,13 @@
this.label1.TabIndex = 0;
this.label1.Text = "佳通RFID层合裁切设备";
//
// btnShow
// hslLanternSimplePlc
//
this.btnShow.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(21)))), ((int)(((byte)(182)))), ((int)(((byte)(173)))));
this.btnShow.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.btnShow.Font = new System.Drawing.Font("宋体", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnShow.ForeColor = System.Drawing.SystemColors.Window;
this.btnShow.Location = new System.Drawing.Point(22, 14);
this.btnShow.Margin = new System.Windows.Forms.Padding(4);
this.btnShow.Name = "btnShow";
this.btnShow.Size = new System.Drawing.Size(300, 50);
this.btnShow.TabIndex = 7;
this.btnShow.Text = "总览图";
this.btnShow.UseVisualStyleBackColor = false;
this.btnShow.Click += new System.EventHandler(this.btnShow_Click);
this.hslLanternSimplePlc.Location = new System.Drawing.Point(22, 515);
this.hslLanternSimplePlc.Name = "hslLanternSimplePlc";
this.hslLanternSimplePlc.Size = new System.Drawing.Size(78, 94);
this.hslLanternSimplePlc.TabIndex = 10;
this.hslLanternSimplePlc.Text = "Plc指示灯";
//
// FormMain
//
@ -293,8 +321,6 @@
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel panel6;
private System.Windows.Forms.Panel panel8;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button btnMes;
private System.Windows.Forms.Button btnAccount;
private System.Windows.Forms.Button btnAlarm;
@ -307,5 +333,9 @@
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnShow;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button1;
private HslControls.HslLanternSimple hslLanternSimplePlc;
}
}

@ -38,16 +38,16 @@ namespace RfidWeb
var rfidSetting = RfidSetting.Current;
InitializeComponent();
//if (this.FormBorderStyle == FormBorderStyle.None)
//{
// this.FormBorderStyle = FormBorderStyle.FixedSingle;
// this.WindowState = FormWindowState.Normal;
//}
//else
//{
// this.FormBorderStyle = FormBorderStyle.None;
// this.WindowState = FormWindowState.Maximized;
//}
if (this.FormBorderStyle == FormBorderStyle.None)
{
this.FormBorderStyle = FormBorderStyle.FixedSingle;
this.WindowState = FormWindowState.Normal;
}
else
{
this.FormBorderStyle = FormBorderStyle.None;
this.WindowState = FormWindowState.Maximized;
}
Init();
}
@ -70,7 +70,7 @@ namespace RfidWeb
buttons.Add(btnAccount);
buttons.Add(btnMes);
btnShow_Click(new object(), new EventArgs());
btnShow_Click(new object(), EventArgs.Empty);
}
@ -226,5 +226,7 @@ namespace RfidWeb
panContent.Controls.Add(new UserAlarmShow());
CheckButton(btnShow);
}
}
}

@ -28,7 +28,7 @@
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.dataGridView2 = new System.Windows.Forms.DataGridView();
this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
@ -37,14 +37,38 @@
this.al = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Msg = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.panel1 = new System.Windows.Forms.Panel();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.hslLanternSimple1 = new HslControls.HslLanternSimple();
this.hslA12 = new HslControls.HslLanternSimple();
this.hslA11 = new HslControls.HslLanternSimple();
this.hslA10 = new HslControls.HslLanternSimple();
this.hslA9 = new HslControls.HslLanternSimple();
this.hslA8 = new HslControls.HslLanternSimple();
this.hslA7 = new HslControls.HslLanternSimple();
this.hslA6 = new HslControls.HslLanternSimple();
this.hslA5 = new HslControls.HslLanternSimple();
this.hslA1 = new HslControls.HslLanternSimple();
this.hslA4 = new HslControls.HslLanternSimple();
this.hslA3 = new HslControls.HslLanternSimple();
this.hslA2 = new HslControls.HslLanternSimple();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.hslB14 = new HslControls.HslLanternSimple();
this.hslB13 = new HslControls.HslLanternSimple();
this.hsl0 = new HslControls.HslLanternSimple();
this.hslB2 = new HslControls.HslLanternSimple();
this.hslB3 = new HslControls.HslLanternSimple();
this.hslB1 = new HslControls.HslLanternSimple();
this.hslB5 = new HslControls.HslLanternSimple();
this.hslB7 = new HslControls.HslLanternSimple();
this.hslB8 = new HslControls.HslLanternSimple();
this.hslB9 = new HslControls.HslLanternSimple();
this.hslB10 = new HslControls.HslLanternSimple();
this.hslB11 = new HslControls.HslLanternSimple();
this.tableLayoutPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.panel1.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// tableLayoutPanel1
@ -106,12 +130,12 @@
this.dataGridView1.Location = new System.Drawing.Point(3, 3);
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.ReadOnly = true;
dataGridViewCellStyle6.BackColor = System.Drawing.Color.Red;
dataGridViewCellStyle6.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle6.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.Red;
dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.White;
this.dataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle6;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.Red;
dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle1.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.Color.Red;
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.White;
this.dataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle1;
this.dataGridView1.RowTemplate.Height = 23;
this.dataGridView1.Size = new System.Drawing.Size(449, 270);
this.dataGridView1.TabIndex = 0;
@ -142,10 +166,154 @@
this.panel1.Size = new System.Drawing.Size(910, 330);
this.panel1.TabIndex = 1;
//
// groupBox1
//
this.groupBox1.BackgroundImage = global::RfidWeb.Properties.Resources.Snipaste_2024_11_14_10_28_21;
this.groupBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.groupBox1.Controls.Add(this.hslA12);
this.groupBox1.Controls.Add(this.hslA11);
this.groupBox1.Controls.Add(this.hslA10);
this.groupBox1.Controls.Add(this.hslA9);
this.groupBox1.Controls.Add(this.hslA8);
this.groupBox1.Controls.Add(this.hslA7);
this.groupBox1.Controls.Add(this.hslA6);
this.groupBox1.Controls.Add(this.hslA5);
this.groupBox1.Controls.Add(this.hslA1);
this.groupBox1.Controls.Add(this.hslA4);
this.groupBox1.Controls.Add(this.hslA3);
this.groupBox1.Controls.Add(this.hslA2);
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox1.Location = new System.Drawing.Point(0, 0);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(910, 330);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "卷料侧(收料1)";
//
// hslA12
//
this.hslA12.LanternBackground = System.Drawing.Color.Chartreuse;
this.hslA12.Location = new System.Drawing.Point(678, 279);
this.hslA12.Name = "hslA12";
this.hslA12.Size = new System.Drawing.Size(20, 20);
this.hslA12.TabIndex = 12;
this.hslA12.Text = "hslLanternSimple1";
//
// hslA11
//
this.hslA11.LanternBackground = System.Drawing.Color.Chartreuse;
this.hslA11.Location = new System.Drawing.Point(855, 193);
this.hslA11.Name = "hslA11";
this.hslA11.Size = new System.Drawing.Size(20, 20);
this.hslA11.TabIndex = 11;
this.hslA11.Text = "hslLanternSimple1";
//
// hslA10
//
this.hslA10.LanternBackground = System.Drawing.Color.Chartreuse;
this.hslA10.Location = new System.Drawing.Point(709, 193);
this.hslA10.Name = "hslA10";
this.hslA10.Size = new System.Drawing.Size(20, 20);
this.hslA10.TabIndex = 10;
this.hslA10.Text = "hslLanternSimple1";
//
// hslA9
//
this.hslA9.LanternBackground = System.Drawing.Color.Chartreuse;
this.hslA9.Location = new System.Drawing.Point(615, 193);
this.hslA9.Name = "hslA9";
this.hslA9.Size = new System.Drawing.Size(20, 20);
this.hslA9.TabIndex = 9;
this.hslA9.Text = "hslLanternSimple1";
//
// hslA8
//
this.hslA8.LanternBackground = System.Drawing.Color.Chartreuse;
this.hslA8.Location = new System.Drawing.Point(527, 224);
this.hslA8.Name = "hslA8";
this.hslA8.Size = new System.Drawing.Size(20, 20);
this.hslA8.TabIndex = 8;
this.hslA8.Text = "hslLanternSimple1";
//
// hslA7
//
this.hslA7.LanternBackground = System.Drawing.Color.Chartreuse;
this.hslA7.Location = new System.Drawing.Point(479, 224);
this.hslA7.Name = "hslA7";
this.hslA7.Size = new System.Drawing.Size(20, 20);
this.hslA7.TabIndex = 7;
this.hslA7.Text = "hslLanternSimple1";
//
// hslA6
//
this.hslA6.LanternBackground = System.Drawing.Color.Chartreuse;
this.hslA6.Location = new System.Drawing.Point(328, 202);
this.hslA6.Name = "hslA6";
this.hslA6.Size = new System.Drawing.Size(20, 20);
this.hslA6.TabIndex = 6;
this.hslA6.Text = "hslLanternSimple1";
//
// hslA5
//
this.hslA5.LanternBackground = System.Drawing.Color.Chartreuse;
this.hslA5.Location = new System.Drawing.Point(376, 115);
this.hslA5.Name = "hslA5";
this.hslA5.Size = new System.Drawing.Size(20, 20);
this.hslA5.TabIndex = 5;
this.hslA5.Text = "hslLanternSimple1";
//
// hslA1
//
this.hslA1.LanternBackground = System.Drawing.Color.Chartreuse;
this.hslA1.Location = new System.Drawing.Point(72, 115);
this.hslA1.Name = "hslA1";
this.hslA1.Size = new System.Drawing.Size(20, 20);
this.hslA1.TabIndex = 4;
this.hslA1.Text = "hslLanternSimple1";
//
// hslA4
//
this.hslA4.LanternBackground = System.Drawing.Color.Chartreuse;
this.hslA4.Location = new System.Drawing.Point(205, 202);
this.hslA4.Name = "hslA4";
this.hslA4.Size = new System.Drawing.Size(20, 20);
this.hslA4.TabIndex = 3;
this.hslA4.Text = "hslLanternSimple1";
//
// hslA3
//
this.hslA3.LanternBackground = System.Drawing.Color.Chartreuse;
this.hslA3.Location = new System.Drawing.Point(252, 147);
this.hslA3.Name = "hslA3";
this.hslA3.Size = new System.Drawing.Size(20, 20);
this.hslA3.TabIndex = 2;
this.hslA3.Text = "hslLanternSimple1";
//
// hslA2
//
this.hslA2.LanternBackground = System.Drawing.Color.Chartreuse;
this.hslA2.Location = new System.Drawing.Point(162, 147);
this.hslA2.Name = "hslA2";
this.hslA2.Size = new System.Drawing.Size(20, 20);
this.hslA2.TabIndex = 1;
this.hslA2.Text = "hslLanternSimple1";
//
// groupBox2
//
this.groupBox2.BackgroundImage = global::RfidWeb.Properties.Resources.Snipaste_2024_11_14_10_33_44;
this.groupBox2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.groupBox2.Controls.Add(this.hslB14);
this.groupBox2.Controls.Add(this.hslB13);
this.groupBox2.Controls.Add(this.hsl0);
this.groupBox2.Controls.Add(this.hslB2);
this.groupBox2.Controls.Add(this.hslB3);
this.groupBox2.Controls.Add(this.hslB1);
this.groupBox2.Controls.Add(this.hslB5);
this.groupBox2.Controls.Add(this.hslB7);
this.groupBox2.Controls.Add(this.hslB8);
this.groupBox2.Controls.Add(this.hslB9);
this.groupBox2.Controls.Add(this.hslB10);
this.groupBox2.Controls.Add(this.hslB11);
this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox2.Location = new System.Drawing.Point(0, 330);
this.groupBox2.Name = "groupBox2";
@ -154,27 +322,113 @@
this.groupBox2.TabStop = false;
this.groupBox2.Text = "料盘侧(收料2)";
//
// groupBox1
// hslB14
//
this.groupBox1.BackgroundImage = global::RfidWeb.Properties.Resources.Snipaste_2024_11_14_10_28_21;
this.groupBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.groupBox1.Controls.Add(this.hslLanternSimple1);
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox1.Location = new System.Drawing.Point(0, 0);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(910, 330);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "卷料侧(收料1)";
this.hslB14.LanternBackground = System.Drawing.Color.Chartreuse;
this.hslB14.Location = new System.Drawing.Point(768, 194);
this.hslB14.Name = "hslB14";
this.hslB14.Size = new System.Drawing.Size(20, 20);
this.hslB14.TabIndex = 23;
this.hslB14.Text = "hslLanternSimple1";
//
// hslB13
//
this.hslB13.LanternBackground = System.Drawing.Color.Chartreuse;
this.hslB13.Location = new System.Drawing.Point(721, 194);
this.hslB13.Name = "hslB13";
this.hslB13.Size = new System.Drawing.Size(20, 20);
this.hslB13.TabIndex = 22;
this.hslB13.Text = "hslLanternSimple1";
//
// hsl0
//
this.hsl0.LanternBackground = System.Drawing.Color.Chartreuse;
this.hsl0.Location = new System.Drawing.Point(32, 63);
this.hsl0.Name = "hsl0";
this.hsl0.Size = new System.Drawing.Size(40, 75);
this.hsl0.TabIndex = 21;
this.hsl0.Text = "系统异常";
//
// hslB2
//
this.hslB2.LanternBackground = System.Drawing.Color.Chartreuse;
this.hslB2.Location = new System.Drawing.Point(721, 154);
this.hslB2.Name = "hslB2";
this.hslB2.Size = new System.Drawing.Size(20, 20);
this.hslB2.TabIndex = 20;
this.hslB2.Text = "hslLanternSimple1";
//
// hslB3
//
this.hslB3.LanternBackground = System.Drawing.Color.Chartreuse;
this.hslB3.Location = new System.Drawing.Point(629, 154);
this.hslB3.Name = "hslB3";
this.hslB3.Size = new System.Drawing.Size(20, 20);
this.hslB3.TabIndex = 19;
this.hslB3.Text = "hslLanternSimple1";
//
// hslB1
//
this.hslB1.LanternBackground = System.Drawing.Color.Chartreuse;
this.hslB1.Location = new System.Drawing.Point(768, 118);
this.hslB1.Name = "hslB1";
this.hslB1.Size = new System.Drawing.Size(20, 20);
this.hslB1.TabIndex = 18;
this.hslB1.Text = "hslLanternSimple1";
//
// hslB5
//
this.hslB5.LanternBackground = System.Drawing.Color.Chartreuse;
this.hslB5.Location = new System.Drawing.Point(469, 118);
this.hslB5.Name = "hslB5";
this.hslB5.Size = new System.Drawing.Size(20, 20);
this.hslB5.TabIndex = 17;
this.hslB5.Text = "hslLanternSimple1";
//
// hslB7
//
this.hslB7.LanternBackground = System.Drawing.Color.Chartreuse;
this.hslB7.Location = new System.Drawing.Point(388, 244);
this.hslB7.Name = "hslB7";
this.hslB7.Size = new System.Drawing.Size(20, 20);
this.hslB7.TabIndex = 16;
this.hslB7.Text = "hslLanternSimple1";
//
// hslB8
//
this.hslB8.LanternBackground = System.Drawing.Color.Chartreuse;
this.hslB8.Location = new System.Drawing.Point(344, 244);
this.hslB8.Name = "hslB8";
this.hslB8.Size = new System.Drawing.Size(20, 20);
this.hslB8.TabIndex = 15;
this.hslB8.Text = "hslLanternSimple1";
//
// hslB9
//
this.hslB9.LanternBackground = System.Drawing.Color.Chartreuse;
this.hslB9.Location = new System.Drawing.Point(282, 194);
this.hslB9.Name = "hslB9";
this.hslB9.Size = new System.Drawing.Size(20, 20);
this.hslB9.TabIndex = 14;
this.hslB9.Text = "hslLanternSimple1";
//
// hslB10
//
this.hslB10.LanternBackground = System.Drawing.Color.Chartreuse;
this.hslB10.Location = new System.Drawing.Point(191, 194);
this.hslB10.Name = "hslB10";
this.hslB10.Size = new System.Drawing.Size(20, 20);
this.hslB10.TabIndex = 13;
this.hslB10.Text = "hslLanternSimple1";
//
// hslLanternSimple1
// hslB11
//
this.hslLanternSimple1.LanternBackground = System.Drawing.Color.DarkViolet;
this.hslLanternSimple1.Location = new System.Drawing.Point(44, 215);
this.hslLanternSimple1.Name = "hslLanternSimple1";
this.hslLanternSimple1.Size = new System.Drawing.Size(15, 14);
this.hslLanternSimple1.TabIndex = 0;
this.hslLanternSimple1.Text = "hslLanternSimple1";
this.hslB11.LanternBackground = System.Drawing.Color.Chartreuse;
this.hslB11.Location = new System.Drawing.Point(32, 206);
this.hslB11.Name = "hslB11";
this.hslB11.Size = new System.Drawing.Size(20, 20);
this.hslB11.TabIndex = 12;
this.hslB11.Text = "hslLanternSimple1";
//
// UserAlarmShow
//
@ -190,6 +444,7 @@
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
this.panel1.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.ResumeLayout(false);
}
@ -206,6 +461,29 @@
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.GroupBox groupBox1;
private HslControls.HslLanternSimple hslLanternSimple1;
private HslControls.HslLanternSimple hslA8;
private HslControls.HslLanternSimple hslA7;
private HslControls.HslLanternSimple hslA6;
private HslControls.HslLanternSimple hslA5;
private HslControls.HslLanternSimple hslA1;
private HslControls.HslLanternSimple hslA4;
private HslControls.HslLanternSimple hslA3;
private HslControls.HslLanternSimple hslA2;
private HslControls.HslLanternSimple hslA11;
private HslControls.HslLanternSimple hslA10;
private HslControls.HslLanternSimple hslA9;
private HslControls.HslLanternSimple hslB2;
private HslControls.HslLanternSimple hslB3;
private HslControls.HslLanternSimple hslB1;
private HslControls.HslLanternSimple hslB5;
private HslControls.HslLanternSimple hslB7;
private HslControls.HslLanternSimple hslB8;
private HslControls.HslLanternSimple hslB9;
private HslControls.HslLanternSimple hslB10;
private HslControls.HslLanternSimple hslB11;
private HslControls.HslLanternSimple hslA12;
private HslControls.HslLanternSimple hsl0;
private HslControls.HslLanternSimple hslB14;
private HslControls.HslLanternSimple hslB13;
}
}

@ -17,6 +17,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DB.Service;
using HslControls;
using Tool;
using Tool.Model;
@ -30,15 +31,24 @@ namespace RfidWeb.Frm
public UserAlarmShow()
{
InitializeComponent();
_timer = new TimerX(TimeState, null, 1000, 1200);
_timer = new TimerX(TimeState, null, 2000, 1000);
_timer.Async = true;
}
void TimeState(Object state)
{
var dataTime = DateTime.Now;
List< GridViewData > lsList=new List< GridViewData >();
FillAlarmGrid();
FillPromptGrid();
FillAlartLed();
}
/// <summary>
/// 右下角的gridView
/// </summary>
void FillAlarmGrid()
{
List<GridViewData> lsList = new List<GridViewData>();
var list = himAlarmManager.GetList();
foreach (var keyValuePair in list)
{
@ -51,17 +61,231 @@ namespace RfidWeb.Frm
this.Invoke(() =>
{
int currentFirstVisibleRowIndex = dataGridView1.FirstDisplayedScrollingRowIndex;
this.dataGridView1.DataSource=lsList;
this.dataGridView1.DataSource = lsList;
if (currentFirstVisibleRowIndex > 0)
{
dataGridView1.FirstDisplayedScrollingRowIndex = currentFirstVisibleRowIndex;
}
});
}
// ThreadPoolX.QueueUserWorkItem(UpdateLog);
PromptAlarmManager promptAlarmManager=new PromptAlarmManager();
void FillPromptGrid()
{
List<GridViewData> lsList = new List<GridViewData>();
var list = promptAlarmManager.GetList();
foreach (var keyValuePair in list)
{
lsList.Add(new GridViewData()
{
AlartTime = keyValuePair.Value.ToString("MM-dd HH:mm:ss"),
Msg = keyValuePair.Key
});
}
this.Invoke(() =>
{
int currentFirstVisibleRowIndex = dataGridView2.FirstDisplayedScrollingRowIndex;
this.dataGridView2.DataSource = lsList;
if (currentFirstVisibleRowIndex > 0)
{
dataGridView2.FirstDisplayedScrollingRowIndex = currentFirstVisibleRowIndex;
}
});
}
private ICache cache = Cache.Default;
private Color defaColor = Color.Chartreuse;
void FillAlartLed()
{
var plcCh = cache.Get<PlcBoolModel>(CacheKeyManager.CH_alarm);
var plcCq= cache.Get<PlcBoolModel>(CacheKeyManager.CQ_alarm);
var plcStop = cache.Get<List<bool>>(CacheKeyManager.estop_temporary_storage);
var plcAlarm= cache.Get<List<bool>>(CacheKeyManager.Prompt_alarm);
if (plcStop==null || plcCh ==null || plcCq==null ) return;
//No0
if (plcStop[4] || plcStop[0] || plcStop[1])
{
SetTrueLed(hsl0);
}
else
{
SetTrueLed(hsl0);
}
//No1
if (plcCh.B6 || plcCh.B7)
{
SetTrueLed(hslA1, hslB1);
}
else
{
SetFaileLed(hslA1, hslB1);
}
//No2
if (plcCh.A1 || plcCh.A2 || plcCh.B3 || plcCh.B4 || plcStop[12])
{
SetTrueLed(hslA2,hslB2);
}
else
{
SetTrueLed(hslA2, hslB2);
}
//No3
if (plcCh.A0 || plcCh.B0 || plcCh.B1 || plcStop[10] || plcStop[11])
{
SetTrueLed(hslA3,hslB3);
}
else
{
SetFaileLed(hslA3, hslB3);
}
//No4
if (plcCh.B10 || plcCh.B11 || plcCh.B12 || plcCh.B14 || plcCh.B5 || plcCh.B8 || plcStop[14] || plcStop[25])
{
SetTrueLed(hslA4);
}
else
{
SetFaileLed(hslA4);
}
//No5
SetLed(plcCh.B9,hslA5,hslB5);
//No6
if (plcCh.B13 || plcStop[15])
{
SetTrueLed(hslA6);
}
else
{
SetFaileLed(hslA6);
}
//No7
if (plcStop[3] || plcStop[5])
{
SetTrueLed(hslA7,hslB7);
}
else
{
SetFaileLed(hslA7, hslB7);
}
//No8
SetLed(plcStop[6],hslA8,hslB8);
//No9
if (plcCq.B9 || plcStop[16])
{
SetTrueLed(hslA9,hslB9);
}
else
{
SetFaileLed(hslA9, hslB9);
}
//No10
if (plcCq.A0 || plcCq.A1 || plcCq.A2
|| plcCq.B0 || plcCq.B1 || plcCq.B3 || plcCq.B4 || plcStop[13] || plcStop[24] || plcAlarm[0] || plcAlarm[1])
{
SetTrueLed(hslA10,hslB10);
}
else
{
SetFaileLed(hslA10, hslB10);
}
//No11
if (plcCq.B2 || plcCq.B5 || plcCq.B6 ||
plcStop[2] || plcStop[7] || plcStop[17] || plcStop[18])
{
SetTrueLed(hslA11, hslB11);
}
else
{
SetFaileLed(hslA11, hslB11);
}
//No12
if (plcCq.B7 || plcCq.B8)
{
SetTrueLed(hslA12);
}
else
{
SetFaileLed(hslA12);
}
//No13
if (plcStop[8] || plcStop[21] || plcStop[22] || plcStop[23] || plcStop[26])
{
SetTrueLed(hslB13);
}
else
{
SetFaileLed(hslB13);
}
//No14
if (plcStop[9] || plcStop[19] || plcStop[20])
{
SetTrueLed(hslB14);
}
else
{
SetFaileLed(hslB14);
}
}
private void SetTrueLed(params HslLanternSimple[] simples)
{
SetLed(true,simples);
}
private void SetFaileLed(params HslLanternSimple[] simples)
{
SetLed(false, simples);
}
private void SetLed( bool b, params HslLanternSimple[] simples)
{
if (b)
{
foreach (var simple in simples)
{
if (simple.LanternBackground != Color.Red)
{
simple.LanternBackground = Color.Red;
}
}
}
else
{
foreach (var simple in simples)
{
if (simple.LanternBackground != Color.Chartreuse)
{
simple.LanternBackground = Color.Chartreuse;
}
}
}
}
}
}

@ -123,12 +123,6 @@
<metadata name="dataGridViewTextBoxColumn2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="al.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>

@ -40,7 +40,7 @@ namespace RfidWeb
for (int i = 0; i < 31; i++)
{
data.ID = GetId;
data.Address = "estop_temporary_storage";
data.Address = "Prompt_alarm";
data.No = i;
data.PlcAb = "";
data.Msg = "";

@ -19,7 +19,7 @@ namespace RfidWeb
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
// Application.Run(new FromSQl());
// Application.Run(new FromSQl());
Application.Run(new FormMain());
}
}

@ -215,6 +215,7 @@
</EmbeddedResource>
<EmbeddedResource Include="Frm\UserAlarmShow.resx">
<DependentUpon>UserAlarmShow.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Frm\UserMain.resx">
<DependentUpon>UserMain.cs</DependentUpon>

@ -193,4 +193,64 @@ namespace RfidWeb
}
}
public class PromptAlarmManager
{
private Dictionary<int, string> GetDic(List<AlarmData> list, string plcAb, string address)
{
var dicCha = list.Where(x => x.PlcAb == plcAb && x.Address == address
&& !string.IsNullOrEmpty(x.Msg))
.ToDictionary(x => x.No, x => x.Msg);
return dicCha;
}
AlarmDataService alarmDataService = new AlarmDataService();
PromptAlarm cPromptAlarm=new PromptAlarm();
private readonly int Max = 31;
private readonly TimeSpan timeOut = TimeSpan.FromSeconds(5);
ICache cache = Cache.Default;
public Dictionary<string, DateTime> GetList()
{
Dictionary<string, DateTime> dictionary = cache[CacheKeyManager.Prompt_alarmList] as Dictionary<string, DateTime>
?? new Dictionary<string, DateTime>();
List<AlarmData> list = alarmDataService.GetList();
var listEs = GetDic(list, "", "Prompt_alarm");
var bools = cPromptAlarm.GetDb();
cache.Set(CacheKeyManager.Prompt_alarm, bools, timeOut);
for (int i = 0; i < Max; i++)
{
var obj = bools[i];
if (!listEs.TryGetValue(i, out var value)) continue;
if (Convert.ToBoolean(obj))
{
if (!dictionary.ContainsKey(value))
{
dictionary[value] = DateTime.Now;
}
}
else
{
dictionary.Remove(value);
}
}
cache.Set(CacheKeyManager.Prompt_alarmList, dictionary, TimeSpan.FromMinutes(10));
return dictionary;
}
}
//
}

@ -72,7 +72,11 @@ namespace Tool.Model
public static readonly string CH_alarm = "CH_alarm";
public static readonly string CQ_alarm = "CQ_alarm";
public static readonly string estop_temporary_storage = "estop_temporary_storage";
public static readonly string Prompt_alarm = "Prompt_alarm";
public static readonly string Prompt_alarmList = "Prompt_alarmList";
}
}

@ -0,0 +1,33 @@
using HslCommunication;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Tool.Model
{
public class PromptAlarm
{
public List<bool> GetDb()
{
bool[] bitArray = new bool[32];
var readUInt32 = PlcConnect.Instance.ReadUInt32("Prompt_alarm");
var bo = readUInt32.IsSuccess;
var context = readUInt32.Content;
if (bo)
{
for (int i = 0; i < 31; i++)
{
bitArray[i] = context.GetBoolByIndex(i);
}
}
return bitArray.ToList();
}
}
}

@ -76,6 +76,7 @@
<Compile Include="Model\HmiLpModel.cs" />
<Compile Include="Model\HmiPoint.cs" />
<Compile Include="Model\PlcBoolModel.cs" />
<Compile Include="Model\PromptAlarm.cs" />
<Compile Include="PagedList.cs" />
<Compile Include="Result.cs" />
<Compile Include="RfidSetting.cs" />

Loading…
Cancel
Save