From d1663b74b8619341371c2aed2f82e75e9c9e8e9a Mon Sep 17 00:00:00 2001 From: lhiven <236881222@qq.com> Date: Sun, 23 Jun 2024 21:54:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8A=A5=E8=AD=A6=E6=97=B6?= =?UTF-8?q?=E4=BA=AE=E7=81=AF=E5=92=8C=E8=9C=82=E9=B8=A3=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rs.DeweyTester/Commom/GlobalVar.cs | 13 ++ Rs.DeweyTester/Commom/Msgbox.cs | 36 +++++ Rs.DeweyTester/FormMain.cs | 5 + Rs.DeweyTester/FormMain.designer.cs | 136 ++++++++++-------- Rs.DeweyTester/FormMain.resx | 6 + .../SysConfig/CommonConfig.Designer.cs | 10 ++ Rs.DeweyTester/SysConfig/CommonConfig.resx | 62 +++++--- 7 files changed, 193 insertions(+), 75 deletions(-) diff --git a/Rs.DeweyTester/Commom/GlobalVar.cs b/Rs.DeweyTester/Commom/GlobalVar.cs index c95c907..3f7c595 100644 --- a/Rs.DeweyTester/Commom/GlobalVar.cs +++ b/Rs.DeweyTester/Commom/GlobalVar.cs @@ -16,6 +16,19 @@ namespace Rs.Framework public static class GlobalVar { #region newpro + + /// + /// 禁用蜂鸣器 + /// + [ParameterInit("bool", "true", "system", "禁用蜂鸣器")] + public static bool DisableBuzzer + { + get + { + return SysConfigParam.GetValue(nameof(DisableBuzzer)); + } + } + /// /// TestMode /// diff --git a/Rs.DeweyTester/Commom/Msgbox.cs b/Rs.DeweyTester/Commom/Msgbox.cs index 65ee2a7..a05d873 100644 --- a/Rs.DeweyTester/Commom/Msgbox.cs +++ b/Rs.DeweyTester/Commom/Msgbox.cs @@ -1,5 +1,6 @@ using Rs.Framework; using Rs.MotionPlat.Entitys; +using Rs.MotionPlat.Flow; using System; using System.Collections.Generic; using System.Linq; @@ -18,9 +19,27 @@ namespace Rs.MotionPlat.Commom /// public static EButtonType ShowDialog(EButtonType buttons,string content,string title="") { + if(!GlobalVar.DisableBuzzer) + { + Ops.On("蜂鸣器"); + } + LightManger.Instance.SetStatus(ELightStatus.Red); + LogHelper.Debug(content); EButtonType ret = EButtonType.None; FrmDialog fd = new FrmDialog(); ret = fd.ShowMessage(buttons, content, "",title); + if (!GlobalVar.DisableBuzzer) + { + Ops.Off("蜂鸣器"); + } + if (MachineManage.Instance.MachineStatus== EMachineStatus.Stop) + { + LightManger.Instance.SetStatus(ELightStatus.Yellow); + } + else if(MachineManage.Instance.MachineStatus== EMachineStatus.Working) + { + LightManger.Instance.SetStatus(ELightStatus.Green); + } return ret; } @@ -32,6 +51,11 @@ namespace Rs.MotionPlat.Commom /// public static EButtonType ShowDialog(AlarmEntity alarmInfo, EButtonType buttons) { + if (!GlobalVar.DisableBuzzer) + { + Ops.On("蜂鸣器"); + } + LightManger.Instance.SetStatus(ELightStatus.Red); string logInfo = $"{alarmInfo.CN}"; LogHelper.Debug(logInfo); EButtonType ret = EButtonType.None; @@ -41,6 +65,18 @@ namespace Rs.MotionPlat.Commom boxList.Add(alarmInfo.AlarmID, fd); ret = fd.ShowMessage(buttons, alarmInfo.CN,alarmInfo.EN); boxList.Remove(alarmInfo.AlarmID); + if (!GlobalVar.DisableBuzzer) + { + Ops.Off("蜂鸣器"); + } + if (MachineManage.Instance.MachineStatus == EMachineStatus.Stop) + { + LightManger.Instance.SetStatus(ELightStatus.Yellow); + } + else if (MachineManage.Instance.MachineStatus == EMachineStatus.Working) + { + LightManger.Instance.SetStatus(ELightStatus.Green); + } } return ret; } diff --git a/Rs.DeweyTester/FormMain.cs b/Rs.DeweyTester/FormMain.cs index cec67b6..318fe3c 100644 --- a/Rs.DeweyTester/FormMain.cs +++ b/Rs.DeweyTester/FormMain.cs @@ -632,5 +632,10 @@ namespace Rs.MotionPlat nozzleFrm.ShowInTaskbar = false; nozzleFrm.Show(); } + + private void btnBuzzer_Click(object sender, EventArgs e) + { + Ops.Off("蜂鸣器"); + } } } diff --git a/Rs.DeweyTester/FormMain.designer.cs b/Rs.DeweyTester/FormMain.designer.cs index 93e1bcb..2a83fda 100644 --- a/Rs.DeweyTester/FormMain.designer.cs +++ b/Rs.DeweyTester/FormMain.designer.cs @@ -32,8 +32,8 @@ namespace Rs.MotionPlat private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.panel1 = new System.Windows.Forms.Panel(); this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); @@ -83,6 +83,11 @@ namespace Rs.MotionPlat this.cboxTestMode = new System.Windows.Forms.ComboBox(); this.label4 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); + this.panel22 = new System.Windows.Forms.Panel(); + this.btnNozzleStatus = new System.Windows.Forms.Button(); + this.panel23 = new System.Windows.Forms.Panel(); + this.btnBuzzer = new System.Windows.Forms.Button(); + this.panel24 = new System.Windows.Forms.Panel(); this.trayNozzle = new Rs.Controls.RsTray(); this.panel6 = new System.Windows.Forms.Panel(); this.tableLayoutPanel6 = new System.Windows.Forms.TableLayoutPanel(); @@ -151,10 +156,6 @@ namespace Rs.MotionPlat this.timertc4 = new System.Windows.Forms.Timer(this.components); this.timertc5 = new System.Windows.Forms.Timer(this.components); this.timertc6 = new System.Windows.Forms.Timer(this.components); - this.panel22 = new System.Windows.Forms.Panel(); - this.panel23 = new System.Windows.Forms.Panel(); - this.panel24 = new System.Windows.Forms.Panel(); - this.btnNozzleStatus = new System.Windows.Forms.Button(); this.panel1.SuspendLayout(); this.tableLayoutPanel3.SuspendLayout(); this.panel3.SuspendLayout(); @@ -182,6 +183,8 @@ namespace Rs.MotionPlat this.panel13.SuspendLayout(); this.panel14.SuspendLayout(); this.panel15.SuspendLayout(); + this.panel22.SuspendLayout(); + this.panel23.SuspendLayout(); this.panel6.SuspendLayout(); this.tableLayoutPanel6.SuspendLayout(); this.panel7.SuspendLayout(); @@ -195,7 +198,6 @@ namespace Rs.MotionPlat this.tabPage2.SuspendLayout(); this.tableLayoutPanel5.SuspendLayout(); this.tableLayoutPanel4.SuspendLayout(); - this.panel22.SuspendLayout(); this.SuspendLayout(); // // timer1 @@ -245,14 +247,14 @@ namespace Rs.MotionPlat this.dgv_errinfo.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dgv_errinfo.BackgroundColor = System.Drawing.SystemColors.ActiveCaptionText; this.dgv_errinfo.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.Red; - dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle1.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dgv_errinfo.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle3.BackColor = System.Drawing.Color.Red; + dataGridViewCellStyle3.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle3.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dgv_errinfo.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle3; this.dgv_errinfo.ColumnHeadersHeight = 30; this.dgv_errinfo.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.dataGridViewTextBoxColumn1, @@ -330,8 +332,8 @@ namespace Rs.MotionPlat // Time // this.Time.DataPropertyName = "Time"; - dataGridViewCellStyle2.BackColor = System.Drawing.Color.Red; - this.Time.DefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle4.BackColor = System.Drawing.Color.Red; + this.Time.DefaultCellStyle = dataGridViewCellStyle4; this.Time.FillWeight = 25F; this.Time.HeaderText = "Time"; this.Time.MinimumWidth = 6; @@ -809,7 +811,7 @@ namespace Rs.MotionPlat this.btnSelectProduct.Name = "btnSelectProduct"; this.btnSelectProduct.Size = new System.Drawing.Size(88, 32); this.btnSelectProduct.TabIndex = 0; - this.btnSelectProduct.Text = "挑料"; + this.btnSelectProduct.Text = "Pick product"; this.btnSelectProduct.UseVisualStyleBackColor = false; this.btnSelectProduct.Click += new System.EventHandler(this.btnSelectProduct_Click); // @@ -846,7 +848,7 @@ namespace Rs.MotionPlat this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(77, 42); this.label4.TabIndex = 5; - this.label4.Text = "测试方式"; + this.label4.Text = "Test method"; this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // label5 @@ -856,9 +858,61 @@ namespace Rs.MotionPlat this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(77, 42); this.label5.TabIndex = 6; - this.label5.Text = "测试模式"; + this.label5.Text = "Test mode"; this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // + // panel22 + // + this.panel22.Controls.Add(this.btnNozzleStatus); + this.panel22.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel22.Location = new System.Drawing.Point(4, 133); + this.panel22.Name = "panel22"; + this.panel22.Size = new System.Drawing.Size(77, 36); + this.panel22.TabIndex = 7; + // + // btnNozzleStatus + // + this.btnNozzleStatus.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); + this.btnNozzleStatus.FlatAppearance.BorderSize = 0; + this.btnNozzleStatus.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnNozzleStatus.Location = new System.Drawing.Point(10, 4); + this.btnNozzleStatus.Name = "btnNozzleStatus"; + this.btnNozzleStatus.Size = new System.Drawing.Size(56, 32); + this.btnNozzleStatus.TabIndex = 0; + this.btnNozzleStatus.Text = "Nozzle"; + this.btnNozzleStatus.UseVisualStyleBackColor = false; + this.btnNozzleStatus.Click += new System.EventHandler(this.btnNozzleStatus_Click); + // + // panel23 + // + this.panel23.Controls.Add(this.btnBuzzer); + this.panel23.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel23.Location = new System.Drawing.Point(4, 176); + this.panel23.Name = "panel23"; + this.panel23.Size = new System.Drawing.Size(77, 36); + this.panel23.TabIndex = 7; + // + // btnBuzzer + // + this.btnBuzzer.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); + this.btnBuzzer.FlatAppearance.BorderSize = 0; + this.btnBuzzer.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnBuzzer.Location = new System.Drawing.Point(10, 1); + this.btnBuzzer.Name = "btnBuzzer"; + this.btnBuzzer.Size = new System.Drawing.Size(56, 32); + this.btnBuzzer.TabIndex = 0; + this.btnBuzzer.Text = "Buzzer"; + this.btnBuzzer.UseVisualStyleBackColor = false; + this.btnBuzzer.Click += new System.EventHandler(this.btnBuzzer_Click); + // + // panel24 + // + this.panel24.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel24.Location = new System.Drawing.Point(4, 219); + this.panel24.Name = "panel24"; + this.panel24.Size = new System.Drawing.Size(77, 36); + this.panel24.TabIndex = 7; + // // trayNozzle // this.trayNozzle.CanDraw = true; @@ -1740,44 +1794,6 @@ namespace Rs.MotionPlat this.timertc6.Interval = 500; this.timertc6.Tick += new System.EventHandler(this.timertc6_Tick); // - // panel22 - // - this.panel22.Controls.Add(this.btnNozzleStatus); - this.panel22.Dock = System.Windows.Forms.DockStyle.Fill; - this.panel22.Location = new System.Drawing.Point(4, 133); - this.panel22.Name = "panel22"; - this.panel22.Size = new System.Drawing.Size(77, 36); - this.panel22.TabIndex = 7; - // - // panel23 - // - this.panel23.Dock = System.Windows.Forms.DockStyle.Fill; - this.panel23.Location = new System.Drawing.Point(4, 176); - this.panel23.Name = "panel23"; - this.panel23.Size = new System.Drawing.Size(77, 36); - this.panel23.TabIndex = 7; - // - // panel24 - // - this.panel24.Dock = System.Windows.Forms.DockStyle.Fill; - this.panel24.Location = new System.Drawing.Point(4, 219); - this.panel24.Name = "panel24"; - this.panel24.Size = new System.Drawing.Size(77, 36); - this.panel24.TabIndex = 7; - // - // btnNozzleStatus - // - this.btnNozzleStatus.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); - this.btnNozzleStatus.FlatAppearance.BorderSize = 0; - this.btnNozzleStatus.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnNozzleStatus.Location = new System.Drawing.Point(10, 4); - this.btnNozzleStatus.Name = "btnNozzleStatus"; - this.btnNozzleStatus.Size = new System.Drawing.Size(56, 32); - this.btnNozzleStatus.TabIndex = 0; - this.btnNozzleStatus.Text = "Nozzle"; - this.btnNozzleStatus.UseVisualStyleBackColor = false; - this.btnNozzleStatus.Click += new System.EventHandler(this.btnNozzleStatus_Click); - // // FormMain // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -1819,6 +1835,8 @@ namespace Rs.MotionPlat this.panel13.ResumeLayout(false); this.panel14.ResumeLayout(false); this.panel15.ResumeLayout(false); + this.panel22.ResumeLayout(false); + this.panel23.ResumeLayout(false); this.panel6.ResumeLayout(false); this.tableLayoutPanel6.ResumeLayout(false); this.panel7.ResumeLayout(false); @@ -1832,7 +1850,6 @@ namespace Rs.MotionPlat this.tabPage2.ResumeLayout(false); this.tableLayoutPanel5.ResumeLayout(false); this.tableLayoutPanel4.ResumeLayout(false); - this.panel22.ResumeLayout(false); this.ResumeLayout(false); } @@ -1960,5 +1977,6 @@ namespace Rs.MotionPlat private System.Windows.Forms.Button btnNozzleStatus; private System.Windows.Forms.Panel panel23; private System.Windows.Forms.Panel panel24; + private System.Windows.Forms.Button btnBuzzer; } } \ No newline at end of file diff --git a/Rs.DeweyTester/FormMain.resx b/Rs.DeweyTester/FormMain.resx index 915fbba..fc06a1b 100644 --- a/Rs.DeweyTester/FormMain.resx +++ b/Rs.DeweyTester/FormMain.resx @@ -132,6 +132,12 @@ True + + True + + + True + 107, 17 diff --git a/Rs.DeweyTester/SysConfig/CommonConfig.Designer.cs b/Rs.DeweyTester/SysConfig/CommonConfig.Designer.cs index 2e8793f..5bfad6e 100644 --- a/Rs.DeweyTester/SysConfig/CommonConfig.Designer.cs +++ b/Rs.DeweyTester/SysConfig/CommonConfig.Designer.cs @@ -112,6 +112,7 @@ this.txtControlCenterPort = new System.Windows.Forms.TextBox(); this.cboxEnableExceptionHandlingNozzle = new System.Windows.Forms.CheckBox(); this.cboxEnableScanBarCodeByDownCamera = new System.Windows.Forms.CheckBox(); + this.cboxDisableBuzzer = new System.Windows.Forms.CheckBox(); this.tableLayoutPanel1.SuspendLayout(); this.groupBox8.SuspendLayout(); this.groupBox3.SuspendLayout(); @@ -332,6 +333,7 @@ this.groupBox1.Controls.Add(this.cboxEnableTC3); this.groupBox1.Controls.Add(this.cboxEnableTC2); this.groupBox1.Controls.Add(this.cboxEnableTC1); + this.groupBox1.Controls.Add(this.cboxDisableBuzzer); this.groupBox1.Controls.Add(this.cboxCheckVisionSwOpened); this.groupBox1.Controls.Add(this.cboxIsSimTest); this.groupBox1.Controls.Add(this.cboxPrintTC6Communicate); @@ -756,6 +758,13 @@ this.cboxEnableScanBarCodeByDownCamera.Name = "cboxEnableScanBarCodeByDownCamera"; this.cboxEnableScanBarCodeByDownCamera.UseVisualStyleBackColor = true; // + // cboxDisableBuzzer + // + resources.ApplyResources(this.cboxDisableBuzzer, "cboxDisableBuzzer"); + this.cboxDisableBuzzer.Name = "cboxDisableBuzzer"; + this.cboxDisableBuzzer.UseVisualStyleBackColor = true; + this.cboxDisableBuzzer.CheckedChanged += new System.EventHandler(this.cbox_CheckedChanged); + // // CommonConfig // resources.ApplyResources(this, "$this"); @@ -869,5 +878,6 @@ private System.Windows.Forms.Label label20; private System.Windows.Forms.Label label21; private System.Windows.Forms.TextBox txtProjectID; + private System.Windows.Forms.CheckBox cboxDisableBuzzer; } } \ No newline at end of file diff --git a/Rs.DeweyTester/SysConfig/CommonConfig.resx b/Rs.DeweyTester/SysConfig/CommonConfig.resx index 1605f2e..9e93312 100644 --- a/Rs.DeweyTester/SysConfig/CommonConfig.resx +++ b/Rs.DeweyTester/SysConfig/CommonConfig.resx @@ -1509,6 +1509,36 @@ 21 + + True + + + NoControl + + + 638, 225 + + + 84, 16 + + + 8 + + + 禁用蜂鸣器 + + + cboxDisableBuzzer + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 22 + True @@ -1537,7 +1567,7 @@ groupBox1 - 22 + 23 True @@ -1567,7 +1597,7 @@ groupBox1 - 23 + 24 True @@ -1597,7 +1627,7 @@ groupBox1 - 24 + 25 True @@ -1627,7 +1657,7 @@ groupBox1 - 25 + 26 True @@ -1657,7 +1687,7 @@ groupBox1 - 26 + 27 True @@ -1687,7 +1717,7 @@ groupBox1 - 27 + 28 True @@ -1717,7 +1747,7 @@ groupBox1 - 28 + 29 True @@ -1747,7 +1777,7 @@ groupBox1 - 29 + 30 True @@ -1777,7 +1807,7 @@ groupBox1 - 30 + 31 False @@ -1804,7 +1834,7 @@ groupBox1 - 31 + 32 True @@ -1834,7 +1864,7 @@ groupBox1 - 32 + 33 True @@ -1864,7 +1894,7 @@ groupBox1 - 33 + 34 True @@ -1894,7 +1924,7 @@ groupBox1 - 34 + 35 True @@ -1924,7 +1954,7 @@ groupBox1 - 35 + 36 True @@ -1954,7 +1984,7 @@ groupBox1 - 36 + 37 True @@ -1984,7 +2014,7 @@ groupBox1 - 37 + 38 Fill