diff --git a/LeatherProject/LeatherApp/Config.cs b/LeatherProject/LeatherApp/Config.cs index 9539112..0723e30 100644 --- a/LeatherProject/LeatherApp/Config.cs +++ b/LeatherProject/LeatherApp/Config.cs @@ -146,6 +146,15 @@ namespace LeatherApp public static Dictionary DownGradeReason; //开启超速报警 public static bool OpenOverSpeed; + //开启激光标示 + public static bool OpenLaser; + public static double LED1_Pos { get; set; } + public static double LED2_Pos { get; set; } + public static double LED3_Pos { get; set; } + public static double LED4_Pos { get; set; } + public static double LED5_Pos { get; set; } + public static double LED6_Pos { get; set; } + public static double LED7_Pos { get; set; } // public static void LoadCloudConfig() { @@ -331,6 +340,15 @@ namespace LeatherApp ServerIP = ini.ReadString("ServerVD", "ServerIP", "172.16.21.210"); JMOffset = ini.ReadDouble("Fun", "JMOffset", 0); + + OpenLaser = ini.ReadBool("Fun", "OpenLaser"); + LED1_Pos = ini.ReadDouble("LEDOffset", "LED1_Pos", 0); + LED2_Pos = ini.ReadDouble("LEDOffset", "LED2_Pos", 0); + LED3_Pos = ini.ReadDouble("LEDOffset", "LED3_Pos", 0); + LED4_Pos = ini.ReadDouble("LEDOffset", "LED4_Pos", 0); + LED5_Pos = ini.ReadDouble("LEDOffset", "LED5_Pos", 0); + LED6_Pos = ini.ReadDouble("LEDOffset", "LED6_Pos", 0); + LED7_Pos = ini.ReadDouble("LEDOffset", "LED7_Pos", 0); } public static Dictionary LoadDownGradeReasonInfo() diff --git a/LeatherProject/LeatherApp/Device/DefectLib.cs b/LeatherProject/LeatherApp/Device/DefectLib.cs index db212d3..f5b5cd5 100644 --- a/LeatherProject/LeatherApp/Device/DefectLib.cs +++ b/LeatherProject/LeatherApp/Device/DefectLib.cs @@ -1365,8 +1365,8 @@ namespace LeatherApp.Device public DataTable excelTable=new DataTable(); public long[] stopwatch = new long[4]; - public int xw; - + public int xw;//大图偏差,缺陷位置计算 + public int xo;//相机图偏差,激光和打标位置计算 //传统算法使用 public HObject ho_Img = new HObject(); public HObject ho_imgG = new HObject(); diff --git a/LeatherProject/LeatherApp/Enums.cs b/LeatherProject/LeatherApp/Enums.cs index 4561709..a03abf8 100644 --- a/LeatherProject/LeatherApp/Enums.cs +++ b/LeatherProject/LeatherApp/Enums.cs @@ -173,6 +173,16 @@ namespace LeatherApp 金属检测输入 = 40, //Y轴复位完成输入 = 41, + + //新增激光指示 + LED0 = 50, + LED1 = 51, + LED2 = 52, + LED3 = 53, + LED4 = 54, + LED5 = 55, + LED6 = 56, + LED7 = 57, } //--- diff --git a/LeatherProject/LeatherApp/FrmVerList.resx b/LeatherProject/LeatherApp/FrmVerList.resx index 1f186e7..ebed94b 100644 --- a/LeatherProject/LeatherApp/FrmVerList.resx +++ b/LeatherProject/LeatherApp/FrmVerList.resx @@ -118,7 +118,14 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - v1.2.0.12(2025-4-09) + v1.2.0.13(2025-6-23) +1.加入激光标示功能 +v1.2.0.12(2025-6-10) +1.修复成检半检刷新问题 +2.上传长度改为小数点后一位 +3.加入幅宽补正 +4.界面开放报警不停车功能 +v1.2.0.12(2025-4-09) 1.门幅显示改为有效门幅 2.新材料厚度上传修改为最大最小和中间值 3.加入计米器偏差修正功能 diff --git a/LeatherProject/LeatherApp/Page/FHome.Designer.cs b/LeatherProject/LeatherApp/Page/FHome.Designer.cs index 5056918..5a322fa 100644 --- a/LeatherProject/LeatherApp/Page/FHome.Designer.cs +++ b/LeatherProject/LeatherApp/Page/FHome.Designer.cs @@ -29,14 +29,14 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FHome)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = 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(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle(); this.uiPanel1 = new Sunny.UI.UIPanel(); this.lblLen = new Sunny.UI.UILabel(); this.lblSpeed = new Sunny.UI.UISymbolLabel(); @@ -102,9 +102,7 @@ this.uiTitlePanel7 = new Sunny.UI.UITitlePanel(); this.btnEditQualifications = new Sunny.UI.UISymbolButton(); this.lblScanner2Cache = new Sunny.UI.UILabel(); - this.uiLabel13 = new Sunny.UI.UILabel(); this.lblScanner1Cache = new Sunny.UI.UILabel(); - this.uiLabel11 = new Sunny.UI.UILabel(); this.lblDefectQueue2 = new Sunny.UI.UILabel(); this.lblDefectQueue1 = new Sunny.UI.UILabel(); this.lblDefectQueue0 = new Sunny.UI.UILabel(); @@ -118,6 +116,8 @@ this.lineChartHouDu = new Sunny.UI.UILineChart(); this.picDefectImage = new LeatherApp.UIExtend.UCImageView(); this.ucColorListDefect = new LeatherApp.UIExtend.UCColorList(); + this.uiLabel11 = new Sunny.UI.UILabel(); + this.uiSwitch1 = new Sunny.UI.UISwitch(); this.uiPanel1.SuspendLayout(); this.uiTitlePanel1.SuspendLayout(); this.uiPanel2.SuspendLayout(); @@ -974,21 +974,21 @@ // // uiDataGridView1 // - dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(251)))), ((int)(((byte)(250))))); - this.uiDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle9.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(251)))), ((int)(((byte)(250))))); + this.uiDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle9; this.uiDataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.uiDataGridView1.BackgroundColor = System.Drawing.Color.White; this.uiDataGridView1.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle2.BackColor = System.Drawing.Color.Blue; - dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle2.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(29)))), ((int)(((byte)(138))))); - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.uiDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle10.BackColor = System.Drawing.Color.Blue; + dataGridViewCellStyle10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle10.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle10.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(29)))), ((int)(((byte)(138))))); + dataGridViewCellStyle10.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.uiDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle10; this.uiDataGridView1.ColumnHeadersHeight = 32; this.uiDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.uiDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { @@ -1003,14 +1003,14 @@ this.colArea, this.colZXD, this.colTarget}); - dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle6.BackColor = System.Drawing.Color.White; - 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.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(242)))), ((int)(((byte)(238))))); - dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); - dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.uiDataGridView1.DefaultCellStyle = dataGridViewCellStyle6; + dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle14.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle14.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle14.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle14.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(242)))), ((int)(((byte)(238))))); + dataGridViewCellStyle14.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); + dataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.uiDataGridView1.DefaultCellStyle = dataGridViewCellStyle14; this.uiDataGridView1.EnableHeadersVisualStyles = false; this.uiDataGridView1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.uiDataGridView1.GridColor = System.Drawing.Color.CornflowerBlue; @@ -1018,21 +1018,21 @@ this.uiDataGridView1.MultiSelect = false; this.uiDataGridView1.Name = "uiDataGridView1"; this.uiDataGridView1.RectColor = System.Drawing.Color.DodgerBlue; - dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(251)))), ((int)(((byte)(250))))); - dataGridViewCellStyle7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); - dataGridViewCellStyle7.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(29)))), ((int)(((byte)(138))))); - dataGridViewCellStyle7.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); - dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.uiDataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle7; + dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle15.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(251)))), ((int)(((byte)(250))))); + dataGridViewCellStyle15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle15.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); + dataGridViewCellStyle15.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(29)))), ((int)(((byte)(138))))); + dataGridViewCellStyle15.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); + dataGridViewCellStyle15.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.uiDataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle15; this.uiDataGridView1.RowHeadersWidth = 62; - dataGridViewCellStyle8.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); - dataGridViewCellStyle8.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(242)))), ((int)(((byte)(238))))); - dataGridViewCellStyle8.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); - this.uiDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle8; + dataGridViewCellStyle16.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle16.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle16.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); + dataGridViewCellStyle16.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(242)))), ((int)(((byte)(238))))); + dataGridViewCellStyle16.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); + this.uiDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle16; this.uiDataGridView1.RowTemplate.Height = 30; this.uiDataGridView1.ScrollBarBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(251)))), ((int)(((byte)(250))))); this.uiDataGridView1.ScrollBarColor = System.Drawing.Color.DodgerBlue; @@ -1083,9 +1083,9 @@ // colX // this.colX.DataPropertyName = "X"; - dataGridViewCellStyle3.Format = "N1"; - dataGridViewCellStyle3.NullValue = null; - this.colX.DefaultCellStyle = dataGridViewCellStyle3; + dataGridViewCellStyle11.Format = "N1"; + dataGridViewCellStyle11.NullValue = null; + this.colX.DefaultCellStyle = dataGridViewCellStyle11; this.colX.HeaderText = "X(cm)"; this.colX.MinimumWidth = 8; this.colX.Name = "colX"; @@ -1095,9 +1095,9 @@ // colY // this.colY.DataPropertyName = "Y"; - dataGridViewCellStyle4.Format = "N2"; - dataGridViewCellStyle4.NullValue = null; - this.colY.DefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle12.Format = "N2"; + dataGridViewCellStyle12.NullValue = null; + this.colY.DefaultCellStyle = dataGridViewCellStyle12; this.colY.HeaderText = "Y(米)"; this.colY.MinimumWidth = 8; this.colY.Name = "colY"; @@ -1120,9 +1120,9 @@ // // colArea // - dataGridViewCellStyle5.Format = "N2"; - dataGridViewCellStyle5.NullValue = null; - this.colArea.DefaultCellStyle = dataGridViewCellStyle5; + dataGridViewCellStyle13.Format = "N2"; + dataGridViewCellStyle13.NullValue = null; + this.colArea.DefaultCellStyle = dataGridViewCellStyle13; this.colArea.HeaderText = "面积(mm²)"; this.colArea.MinimumWidth = 8; this.colArea.Name = "colArea"; @@ -1424,11 +1424,11 @@ // uiTitlePanel7 // this.uiTitlePanel7.BackColor = System.Drawing.Color.White; + this.uiTitlePanel7.Controls.Add(this.uiSwitch1); + this.uiTitlePanel7.Controls.Add(this.uiLabel11); this.uiTitlePanel7.Controls.Add(this.btnEditQualifications); this.uiTitlePanel7.Controls.Add(this.lblScanner2Cache); - this.uiTitlePanel7.Controls.Add(this.uiLabel13); this.uiTitlePanel7.Controls.Add(this.lblScanner1Cache); - this.uiTitlePanel7.Controls.Add(this.uiLabel11); this.uiTitlePanel7.Controls.Add(this.lblDefectQueue2); this.uiTitlePanel7.Controls.Add(this.lblDefectQueue1); this.uiTitlePanel7.Controls.Add(this.lblDefectQueue0); @@ -1480,7 +1480,7 @@ this.lblScanner2Cache.AutoSize = true; this.lblScanner2Cache.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblScanner2Cache.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(29)))), ((int)(((byte)(138))))); - this.lblScanner2Cache.Location = new System.Drawing.Point(323, 134); + this.lblScanner2Cache.Location = new System.Drawing.Point(129, 169); this.lblScanner2Cache.Name = "lblScanner2Cache"; this.lblScanner2Cache.Size = new System.Drawing.Size(19, 21); this.lblScanner2Cache.Style = Sunny.UI.UIStyle.Custom; @@ -1489,26 +1489,12 @@ this.lblScanner2Cache.Text = "0"; this.lblScanner2Cache.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // uiLabel13 - // - this.uiLabel13.AutoSize = true; - this.uiLabel13.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.uiLabel13.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(29)))), ((int)(((byte)(138))))); - this.uiLabel13.Location = new System.Drawing.Point(190, 134); - this.uiLabel13.Name = "uiLabel13"; - this.uiLabel13.Size = new System.Drawing.Size(99, 21); - this.uiLabel13.Style = Sunny.UI.UIStyle.Custom; - this.uiLabel13.StyleCustomMode = true; - this.uiLabel13.TabIndex = 19; - this.uiLabel13.Text = "相机2缓存:"; - this.uiLabel13.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // // lblScanner1Cache // this.lblScanner1Cache.AutoSize = true; this.lblScanner1Cache.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblScanner1Cache.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(29)))), ((int)(((byte)(138))))); - this.lblScanner1Cache.Location = new System.Drawing.Point(141, 134); + this.lblScanner1Cache.Location = new System.Drawing.Point(104, 169); this.lblScanner1Cache.Name = "lblScanner1Cache"; this.lblScanner1Cache.Size = new System.Drawing.Size(19, 21); this.lblScanner1Cache.Style = Sunny.UI.UIStyle.Custom; @@ -1517,26 +1503,12 @@ this.lblScanner1Cache.Text = "0"; this.lblScanner1Cache.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // uiLabel11 - // - this.uiLabel11.AutoSize = true; - this.uiLabel11.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.uiLabel11.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(29)))), ((int)(((byte)(138))))); - this.uiLabel11.Location = new System.Drawing.Point(8, 134); - this.uiLabel11.Name = "uiLabel11"; - this.uiLabel11.Size = new System.Drawing.Size(99, 21); - this.uiLabel11.Style = Sunny.UI.UIStyle.Custom; - this.uiLabel11.StyleCustomMode = true; - this.uiLabel11.TabIndex = 17; - this.uiLabel11.Text = "相机1缓存:"; - this.uiLabel11.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // // lblDefectQueue2 // this.lblDefectQueue2.AutoSize = true; this.lblDefectQueue2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblDefectQueue2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(29)))), ((int)(((byte)(138))))); - this.lblDefectQueue2.Location = new System.Drawing.Point(323, 169); + this.lblDefectQueue2.Location = new System.Drawing.Point(322, 169); this.lblDefectQueue2.Name = "lblDefectQueue2"; this.lblDefectQueue2.Size = new System.Drawing.Size(19, 21); this.lblDefectQueue2.Style = Sunny.UI.UIStyle.Custom; @@ -1550,7 +1522,7 @@ this.lblDefectQueue1.AutoSize = true; this.lblDefectQueue1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblDefectQueue1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192))))); - this.lblDefectQueue1.Location = new System.Drawing.Point(292, 169); + this.lblDefectQueue1.Location = new System.Drawing.Point(300, 169); this.lblDefectQueue1.Name = "lblDefectQueue1"; this.lblDefectQueue1.Size = new System.Drawing.Size(19, 21); this.lblDefectQueue1.Style = Sunny.UI.UIStyle.Custom; @@ -1564,7 +1536,7 @@ this.lblDefectQueue0.AutoSize = true; this.lblDefectQueue0.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblDefectQueue0.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(29)))), ((int)(((byte)(138))))); - this.lblDefectQueue0.Location = new System.Drawing.Point(261, 169); + this.lblDefectQueue0.Location = new System.Drawing.Point(278, 169); this.lblDefectQueue0.Name = "lblDefectQueue0"; this.lblDefectQueue0.Size = new System.Drawing.Size(19, 21); this.lblDefectQueue0.Style = Sunny.UI.UIStyle.Custom; @@ -1578,7 +1550,7 @@ this.lblWaitImageCount.AutoSize = true; this.lblWaitImageCount.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblWaitImageCount.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(29)))), ((int)(((byte)(138))))); - this.lblWaitImageCount.Location = new System.Drawing.Point(117, 169); + this.lblWaitImageCount.Location = new System.Drawing.Point(154, 169); this.lblWaitImageCount.Name = "lblWaitImageCount"; this.lblWaitImageCount.Size = new System.Drawing.Size(19, 21); this.lblWaitImageCount.Style = Sunny.UI.UIStyle.Custom; @@ -1604,7 +1576,7 @@ this.uiLabel9.AutoSize = true; this.uiLabel9.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.uiLabel9.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(29)))), ((int)(((byte)(138))))); - this.uiLabel9.Location = new System.Drawing.Point(152, 169); + this.uiLabel9.Location = new System.Drawing.Point(181, 169); this.uiLabel9.Name = "uiLabel9"; this.uiLabel9.Size = new System.Drawing.Size(90, 21); this.uiLabel9.Style = Sunny.UI.UIStyle.Custom; @@ -1733,6 +1705,32 @@ this.ucColorListDefect.Text = "ucColorList1"; this.ucColorListDefect.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; // + // uiLabel11 + // + this.uiLabel11.AutoSize = true; + this.uiLabel11.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.uiLabel11.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(29)))), ((int)(((byte)(138))))); + this.uiLabel11.Location = new System.Drawing.Point(8, 133); + this.uiLabel11.Name = "uiLabel11"; + this.uiLabel11.Size = new System.Drawing.Size(90, 21); + this.uiLabel11.Style = Sunny.UI.UIStyle.Custom; + this.uiLabel11.StyleCustomMode = true; + this.uiLabel11.TabIndex = 21; + this.uiLabel11.Text = "报警不停车"; + this.uiLabel11.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // uiSwitch1 + // + this.uiSwitch1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.uiSwitch1.Location = new System.Drawing.Point(132, 129); + this.uiSwitch1.MinimumSize = new System.Drawing.Size(1, 1); + this.uiSwitch1.Name = "uiSwitch1"; + this.uiSwitch1.Size = new System.Drawing.Size(80, 29); + this.uiSwitch1.Style = Sunny.UI.UIStyle.Custom; + this.uiSwitch1.TabIndex = 22; + this.uiSwitch1.Text = "uiSwitch1"; + this.uiSwitch1.ValueChanged += new Sunny.UI.UISwitch.OnValueChanged(this.uiSwitch1_ValueChanged); + // // FHome // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; @@ -1833,9 +1831,7 @@ private Sunny.UI.UITextBox txtBarCodeName; private Sunny.UI.UINumPadTextBox numErpLen; private Sunny.UI.UILabel lblScanner2Cache; - private Sunny.UI.UILabel uiLabel13; private Sunny.UI.UILabel lblScanner1Cache; - private Sunny.UI.UILabel uiLabel11; private System.Windows.Forms.DataGridViewTextBoxColumn colUid; private System.Windows.Forms.DataGridViewTextBoxColumn colCode; private System.Windows.Forms.DataGridViewTextBoxColumn colIndex; @@ -1865,5 +1861,7 @@ private Sunny.UI.UISymbolButton btnCut; private System.Windows.Forms.RadioButton radioButton2; private System.Windows.Forms.RadioButton radioButton1; + private Sunny.UI.UISwitch uiSwitch1; + private Sunny.UI.UILabel uiLabel11; } } diff --git a/LeatherProject/LeatherApp/Page/FHome.cs b/LeatherProject/LeatherApp/Page/FHome.cs index 03e088a..bbbcd58 100644 --- a/LeatherProject/LeatherApp/Page/FHome.cs +++ b/LeatherProject/LeatherApp/Page/FHome.cs @@ -3,6 +3,7 @@ //#define Oracle //禾欣使用oracle数据库 #define NT //新流程 //#define UPDATA +#define LED using Automation.BDaq; using DocumentFormat.OpenXml.EMMA; @@ -126,6 +127,13 @@ namespace LeatherApp.Page mat = _mat; CurrDis = dis; } + public tScanPhotoInfo(int _devIndex, int _photoIndex, Mat _mat, int xoffsrt) + { + devIndex = _devIndex; + photoIndex = _photoIndex; + mat = _mat; + X_offset = xoffsrt; + } public int devIndex { get; set; } /// /// 0-n @@ -136,6 +144,11 @@ namespace LeatherApp.Page public double CurrDis { get; set; } + /// + /// 实际偏差 + /// + public int X_offset { get; set; } + } #endregion @@ -311,8 +324,11 @@ namespace LeatherApp.Page picScanner1.Refresh(); picScanner2.Refresh(); - radioButton1.Checked = false; - radioButton2.Checked = false; + if (resetCurrKey) + { + radioButton1.Checked = false; + radioButton2.Checked = false; + } })); } /// @@ -1455,6 +1471,8 @@ namespace LeatherApp.Page // this.swcDefectPauseForUser.Active = this.defectPauseForUser = productInfo.DefectPauseForUser; + + this.uiSwitch1.Active = Config.OpenWarnBeep; })); // @@ -1671,6 +1689,14 @@ namespace LeatherApp.Page photoIndex = _photoIndex; mat = _mat; } + + public ScanPhotoInfo(int _devIndex, int _photoIndex, Mat _mat, int xoffsrt) + { + devIndex = _devIndex; + photoIndex = _photoIndex; + mat = _mat; + X_offset = xoffsrt; + } public int devIndex { get; set; } /// /// 0-n @@ -1678,6 +1704,10 @@ namespace LeatherApp.Page public int photoIndex { get; set; } public string path { get; set; } public Mat mat { get; set; } + /// + /// 实际偏差 + /// + public int X_offset { get; set; } } //private List> scanPhotoQueue1 = new List>(); @@ -1704,6 +1734,119 @@ namespace LeatherApp.Page } #endregion + #region 缺陷指示 + /// + /// 缺陷LED指示 + /// + /// + public void ShowLedOpen(List data) + { +#if LED + if (!Config.StopIO && devContainer.devIOCard.IsInit && Config.OpenLaser) + { + //开启横灯 + devContainer.io_output(CMDName.LED0); + + //区域1 + var led1Get = data.Where(x => (x.CentreX + x.X_offset) <= Config.LED1_Pos).ToList(); + if (led1Get != null && led1Get.Count > 0) + { + AddTextEvent(DateTime.Now, $"激光指示", $"缺陷位置{Math.Round(led1Get[0].CentreX + led1Get[0].X_offset, 2)}《=LED1位置{Math.Round(Config.LED1_Pos, 2)}"); + devContainer.io_output(CMDName.LED1); + } + + //区域2 + var led2Get = data.Where(x => (x.CentreX + x.X_offset) <= Config.LED2_Pos + && (x.CentreX + x.X_offset) > Config.LED1_Pos).ToList(); + if (led2Get != null && led2Get.Count > 0) + { + AddTextEvent(DateTime.Now, $"激光指示", $"LED1位置{Math.Round(Config.LED1_Pos, 2)}< 缺陷位置{Math.Round(led2Get[0].CentreX + led2Get[0].X_offset, 2)}《=LED2位置{Math.Round(Config.LED2_Pos, 2)}"); + devContainer.io_output(CMDName.LED1); + devContainer.io_output(CMDName.LED2); + } + + //区域3 + var led3Get = data.Where(x => (x.CentreX + x.X_offset) < Config.LED3_Pos + && (x.CentreX + x.X_offset) > Config.LED2_Pos).ToList(); + if (led3Get != null && led3Get.Count > 0) + { + AddTextEvent(DateTime.Now, $"激光指示", $"LED2位置{Math.Round(Config.LED2_Pos, 2)}< 缺陷位置{Math.Round(led3Get[0].CentreX + led3Get[0].X_offset, 2)}《LED3位置{Math.Round(Config.LED3_Pos, 2)}"); + devContainer.io_output(CMDName.LED2); + devContainer.io_output(CMDName.LED3); + } + + //区域4 + var led4Get = data.Where(x => (x.CentreX + x.X_offset) <= Config.LED4_Pos + && (x.CentreX + x.X_offset) > Config.LED3_Pos).ToList(); + if (led4Get != null && led4Get.Count > 0) + { + AddTextEvent(DateTime.Now, $"激光指示", $"LED3位置{Math.Round(Config.LED3_Pos, 2)}< 缺陷位置{Math.Round(led4Get[0].CentreX + led4Get[0].X_offset, 2)}《=LED4位置{Math.Round(Config.LED4_Pos, 2)}"); + devContainer.io_output(CMDName.LED3); + devContainer.io_output(CMDName.LED4); + } + + //区域5 + var led5Get = data.Where(x => (x.CentreX + x.X_offset) < Config.LED5_Pos + && (x.CentreX + x.X_offset) > Config.LED4_Pos).ToList(); + if (led5Get != null && led5Get.Count > 0) + { + AddTextEvent(DateTime.Now, $"激光指示", $"LED4位置{Math.Round(Config.LED4_Pos, 2)}< 缺陷位置{Math.Round(led5Get[0].CentreX + led5Get[0].X_offset, 2)}《LED5位置{Math.Round(Config.LED5_Pos, 2)}"); + devContainer.io_output(CMDName.LED4); + devContainer.io_output(CMDName.LED5); + } + + //区域6 + var led6Get = data.Where(x => (x.CentreX + x.X_offset) < Config.LED6_Pos + && (x.CentreX + x.X_offset) > Config.LED5_Pos).ToList(); + if (led6Get != null && led6Get.Count > 0) + { + AddTextEvent(DateTime.Now, $"激光指示", $"LED5位置{Math.Round(Config.LED5_Pos, 2)}< 缺陷位置{Math.Round(led6Get[0].CentreX + led6Get[0].X_offset, 2)}《LED6位置{Math.Round(Config.LED6_Pos, 2)}"); + devContainer.io_output(CMDName.LED5); + devContainer.io_output(CMDName.LED6); + } + + //区域7 + var led7Get = data.Where(x => (x.CentreX + x.X_offset) <= Config.LED7_Pos + && (x.CentreX + x.X_offset) > Config.LED6_Pos).ToList(); + if (led7Get != null && led7Get.Count > 0) + { + AddTextEvent(DateTime.Now, $"激光指示", $"LED6位置{Math.Round(Config.LED6_Pos, 2)}< 缺陷位置{Math.Round(led7Get[0].CentreX + led7Get[0].X_offset, 2)}《=LED7位置{Math.Round(Config.LED7_Pos, 2)}"); + devContainer.io_output(CMDName.LED6); + devContainer.io_output(CMDName.LED7); + } + + //区域8 + var led8Get = data.Where(x => (x.CentreX + x.X_offset) >= Config.LED7_Pos).ToList(); + if (led8Get != null && led8Get.Count > 0) + { + AddTextEvent(DateTime.Now, $"激光指示", $"缺陷位置{Math.Round(led8Get[0].CentreX + led8Get[0].X_offset, 2)}>=LED7位置{Math.Round(Config.LED7_Pos, 2)}"); + devContainer.io_output(CMDName.LED7); + } + } +#endif + } + + /// + /// LED指示灯关闭 + /// + public void ShowLedClose() + { +#if LED + if (!Config.StopIO && devContainer.devIOCard.IsInit && Config.OpenLaser) + { + devContainer.io_output(CMDName.LED0, false, true, 0); + devContainer.io_output(CMDName.LED1, false, true, 0); + devContainer.io_output(CMDName.LED2, false, true, 0); + devContainer.io_output(CMDName.LED3, false, true, 0); + devContainer.io_output(CMDName.LED4, false, true, 0); + devContainer.io_output(CMDName.LED5, false, true, 0); + devContainer.io_output(CMDName.LED6, false, true, 0); + devContainer.io_output(CMDName.LED7, false, true, 0); + } +#endif + } + #endregion + #region 长度与速度流程 #region 计米器位置和速度 @@ -2013,6 +2156,9 @@ namespace LeatherApp.Page else AddTextEvent(DateTime.Now, $"二次检测", $"图像{liPhotoIndex}丢失", WarningEnum.Low, true); + //指示灯 + ShowLedOpen(lstEditDefect); + FHome_Defect frmDefect = new FHome_Defect(curRecord.ProductInfo.ModelName, lstEditDefect, pmat, curRecord, defectWaitList, SectioningLen); var sd = frmDefect.ShowDialog(); if (sd == DialogResult.OK || sd == DialogResult.Yes) @@ -2080,6 +2226,10 @@ namespace LeatherApp.Page //this.reDrawDefectPoints(curRecord.DefectInfoList, new double[] { 0, Math.Round(curRecord.FaceWidthMax + 0.005f, 2) }, new double[] { 0, len }); AddTextEvent(DateTime.Now, $"二次检测", $"本次忽略{frmDefect.lstDel.Count}个瑕疵,本张图由{liDefectCount} -> {lstEditDefect.Count},总数{curRecord.DefectInfoList.Count}", WarningEnum.Normal, false); } + + //指示灯 + ShowLedClose(); + this.uiMiniPagination1.TotalCount = curRecord.DefectTotalCount = curRecord.DefectInfoList.Count; // //double len = Math.Round((res.photoIndex + 1) * bmpHeight * 1.0d / Config.cm2px_y + 0.005f, 2); @@ -2215,7 +2365,7 @@ namespace LeatherApp.Page if(true) #endif { - if (Math.Abs(yqjimi - hdJMDis) * 100 > 10) //在10cm以内不做记录 + if (Math.Abs(yqjimi - hdJMDis) * 100 > 30) //在30cm以内不做记录 { //加入偏差计算 d1 = Math.Round(d1 + Config.DataOffset1, 2); @@ -2474,7 +2624,9 @@ namespace LeatherApp.Page Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); int marginWidth; + int imgXwidth = Image.Width; //记录原图的宽度 Image = OpenCVUtil.getMaxInsetRect2(Image, devNo == 1 ? true : false, Config.MarginHoleWidth, out marginWidth); + int xoffset = imgXwidth - marginWidth;//计算裁边之后偏差 //AddTextEvent(DateTime.Now,"裁边", $"(图像{scanPhotos0.photoIndex})-图0裁边后:{mat0.Width}*{mat0.Height}"); errStep = 55; string time = $"dev{devNo}-图{index}裁边({stopWatch.ElapsedMilliseconds})"; @@ -2630,8 +2782,9 @@ namespace LeatherApp.Page } else AddTextEvent(DateTime.Now, $"二次检测", $"图像{liPhotoIndex}丢失", WarningEnum.Low, true); - - + + //指示灯 + ShowLedOpen(lstEditDefect); //var pimage = (Bitmap)pmat.ToBitmap().Clone(); FHome_Defect frmDefect = new FHome_Defect(curRecord.ProductInfo.ModelName, lstEditDefect, pmat, curRecord, defectWaitList, SectioningLen); var sd = frmDefect.ShowDialog(); @@ -2700,6 +2853,10 @@ namespace LeatherApp.Page //this.reDrawDefectPoints(curRecord.DefectInfoList, new double[] { 0, Math.Round(curRecord.FaceWidthMax + 0.005f, 2) }, new double[] { 0, len }); AddTextEvent(DateTime.Now, $"二次检测", $"本次忽略{frmDefect.lstDel.Count}个瑕疵,本张图由{liDefectCount} -> {lstEditDefect.Count},总数{curRecord.DefectInfoList.Count}", WarningEnum.Normal, false); } + + //指示灯 + ShowLedClose(); + this.uiMiniPagination1.TotalCount = curRecord.DefectTotalCount = curRecord.DefectInfoList.Count; // //double len = Math.Round((res.photoIndex + 1) * bmpHeight * 1.0d / Config.cm2px_y + 0.005f, 2); @@ -2793,19 +2950,35 @@ namespace LeatherApp.Page //只是设备暂停,APP没暂停 devContainer.io_output(CMDName.绿灯输出, false, true, 0); devContainer.io_output(CMDName.黄灯输出); - devContainer.devIOCard.writeBitState(0, 1, true); - Task.Run(async () => + if (Config.OpenWarnBeep) { - await Task.Delay(500); - this.devContainer.devIOCard.writeBitState(0, 1, false); - }); - if (Config.OpenBeep && !IsTopAlm) + if (Config.OpenBeep) + { + IsTopAlm = true; + Task.Run(async () => + { + devContainer.io_output(CMDName.蜂鸣器输出, true, false, 5000); + //devContainer.io_output(CMDName.蜂鸣器输出, false, true, Config.BeepTime); + await Task.Delay(5); + }); + } + } + else { + devContainer.devIOCard.writeBitState(0, 1, true); Task.Run(async () => { - devContainer.io_output(CMDName.蜂鸣器输出, false, true, Config.BeepTime); - await Task.Delay(5); + await Task.Delay(500); + this.devContainer.devIOCard.writeBitState(0, 1, false); }); + if (Config.OpenBeep && !IsTopAlm) + { + Task.Run(async () => + { + devContainer.io_output(CMDName.蜂鸣器输出, false, true, 5000); + await Task.Delay(5); + }); + } } } } @@ -2840,21 +3013,38 @@ namespace LeatherApp.Page //只是设备暂停,APP没暂停 devContainer.io_output(CMDName.绿灯输出, false, true, 0); devContainer.io_output(CMDName.黄灯输出); - devContainer.devIOCard.writeBitState(0, 1, true); - Task.Run(async () => + if (Config.OpenWarnBeep) { - await Task.Delay(500); - this.devContainer.devIOCard.writeBitState(0, 1, false); - }); - if (Config.OpenBeep) + //强报警!! + if (Config.OpenBeep) + { + IsTopAlm = true; + Task.Run(async () => + { + devContainer.io_output(CMDName.蜂鸣器输出, true, false, 5000); + //devContainer.io_output(CMDName.蜂鸣器输出, false, true, Config.BeepTime); + await Task.Delay(5); + }); + } + } + else { - IsTopAlm = true; + devContainer.devIOCard.writeBitState(0, 1, true); Task.Run(async () => { - devContainer.io_output(CMDName.蜂鸣器输出, true, false, Config.BeepTime); - //devContainer.io_output(CMDName.蜂鸣器输出, false, true, Config.BeepTime); - await Task.Delay(5); + await Task.Delay(500); + this.devContainer.devIOCard.writeBitState(0, 1, false); }); + if (Config.OpenBeep) + { + IsTopAlm = true; + Task.Run(async () => + { + devContainer.io_output(CMDName.蜂鸣器输出, true, false, 5000); + //devContainer.io_output(CMDName.蜂鸣器输出, false, true, Config.BeepTime); + await Task.Delay(5); + }); + } } } } @@ -2865,7 +3055,7 @@ namespace LeatherApp.Page errStep = 21; //Application.DoEvents(); } - _matList1.Enqueue(new tScanPhotoInfo(1, index, Image.Clone())); + _matList1.Enqueue(new tScanPhotoInfo(1, index, Image.Clone(), xoffset)); } #endregion @@ -3244,6 +3434,7 @@ namespace LeatherApp.Page qualifiedLimitList = curRecord.ProductInfo.QualifiedLimitList, finishEvent = callBackDefectEvent, xw = oxw, + xo = scanPhotos0.X_offset, CurrDis = tscanPhotos1.CurrDis, }); errStep = 10; @@ -3370,6 +3561,7 @@ namespace LeatherApp.Page imageID = imgid,//res.lstDefectBmp[i].Clone(), PicY = double.Parse(res.excelTable.Rows[i]["Y"].ToString()),//cm CurrDis = res.CurrDis, + X_offset = Math.Round((double)res.xo / Config.cm2px_x, 2) }; } else @@ -3394,6 +3586,7 @@ namespace LeatherApp.Page imageID = imgid,//res.lstDefectBmp[i].Clone(), PicY = double.Parse(res.excelTable.Rows[i]["Y"].ToString()),//cm CurrDis = res.CurrDis, + X_offset = Math.Round((double)res.xo / Config.cm2px_x, 2) }; } defectInfo.ModifyUserCode = defectInfo.CreateUserCode = res.record.CreateUserCode; @@ -3473,12 +3666,28 @@ namespace LeatherApp.Page //只是设备暂停,APP没暂停 devContainer.io_output(CMDName.绿灯输出, false, true, 0); devContainer.io_output(CMDName.黄灯输出); - devContainer.devIOCard.writeBitState(0, 1, true); - Task.Run(async () => + if (Config.OpenWarnBeep) { - await Task.Delay(500); - this.devContainer.devIOCard.writeBitState(0, 1, false); - }); + if (Config.OpenBeep) + { + IsTopAlm = true; + Task.Run(async () => + { + devContainer.io_output(CMDName.蜂鸣器输出, true, false, 5000); + //devContainer.io_output(CMDName.蜂鸣器输出, false, true, Config.BeepTime); + await Task.Delay(5); + }); + } + } + else + { + devContainer.devIOCard.writeBitState(0, 1, true); + Task.Run(async () => + { + await Task.Delay(500); + this.devContainer.devIOCard.writeBitState(0, 1, false); + }); + } } } @@ -4271,7 +4480,7 @@ namespace LeatherApp.Page ptLen = Math.Round(devContainer.GetLength(), 2); #endif //校正从复位-》运行,不会新启动 - resetUIValue(); + resetUIValue(false); AddTextEvent(DateTime.Now,"启动", "开始测试..."); if(Config.OpenClearPic) @@ -5853,5 +6062,15 @@ namespace LeatherApp.Page record.DefectType = "半检"; } } + + /// + /// 开启报警不停车 + /// + /// + /// + private void uiSwitch1_ValueChanged(object sender, bool value) + { + Config.OpenWarnBeep = this.uiSwitch1.Active; + } } } diff --git a/LeatherProject/LeatherApp/Properties/AssemblyInfo.cs b/LeatherProject/LeatherApp/Properties/AssemblyInfo.cs index 05dd771..ac8dcc5 100644 --- a/LeatherProject/LeatherApp/Properties/AssemblyInfo.cs +++ b/LeatherProject/LeatherApp/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //通过使用 "*",如下所示: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2.0.11")] -[assembly: AssemblyFileVersion("1.2.0.11")] +[assembly: AssemblyVersion("1.2.0.13")] +[assembly: AssemblyFileVersion("1.2.0.13")] diff --git a/LeatherProject/LeatherApp/Utils/DBUtils.cs b/LeatherProject/LeatherApp/Utils/DBUtils.cs index c5da9d2..cabbe4a 100644 --- a/LeatherProject/LeatherApp/Utils/DBUtils.cs +++ b/LeatherProject/LeatherApp/Utils/DBUtils.cs @@ -329,16 +329,16 @@ namespace LeatherApp.Utils JH = records.ReelId, FJH = string.IsNullOrEmpty(records.PartReelId) ? "0" : records.PartReelId, Grade = string.IsNullOrEmpty(grade) ? "一等品" : grade, - Len = slen, - NetLen = jlen, + Len = Math.Round(slen, 1), + NetLen = Math.Round(jlen, 1), SegmentCnt = fd, SegmentLen = string.IsNullOrEmpty(fdinfo) ? "无" : fdinfo, DefectType = string.IsNullOrEmpty(records.DefectType) ? "错误" : records.DefectType, - MF1 = mf1, - MF2 = mf2, - MF3 = mf3, - AvgMF = agvmf, + MF1 = Math.Round(mf1, 0), + MF2 = Math.Round(mf2, 0), + MF3 = Math.Round(mf3, 0), + AvgMF = Math.Round(agvmf, 0), HD1= hd1, HD2= hd2, diff --git a/LeatherProject/LeatherApp/bin/Debug/CMDProcess/50.json b/LeatherProject/LeatherApp/bin/Debug/CMDProcess/50.json new file mode 100644 index 0000000..8f9b2ff --- /dev/null +++ b/LeatherProject/LeatherApp/bin/Debug/CMDProcess/50.json @@ -0,0 +1,10 @@ +{ + "Direction": 1, + "IN_OP_SHOW": [ "XXXX XXXX", "XXXX XXXX", "XXXX XXXX", "XXXX XXXX" ], + "IN_Waiting_Timeout": 0, + "OUT_OP_SHOW": [ "XXXH XXXX", "XXXX XXXX", "XXXX XXXX", "XXXX XXXX" ], + "SleepPre": 0, + "SleepLater": 0, + "AsynRun": false, + "Disable": false +} \ No newline at end of file diff --git a/LeatherProject/LeatherApp/bin/Debug/CMDProcess/51.json b/LeatherProject/LeatherApp/bin/Debug/CMDProcess/51.json new file mode 100644 index 0000000..515e430 --- /dev/null +++ b/LeatherProject/LeatherApp/bin/Debug/CMDProcess/51.json @@ -0,0 +1,10 @@ +{ + "Direction": 1, + "IN_OP_SHOW": [ "XXXX XXXX", "XXXX XXXX", "XXXX XXXX", "XXXX XXXX" ], + "IN_Waiting_Timeout": 0, + "OUT_OP_SHOW": [ "XXHX XXXX", "XXXX XXXX", "XXXX XXXX", "XXXX XXXX" ], + "SleepPre": 0, + "SleepLater": 0, + "AsynRun": false, + "Disable": false +} \ No newline at end of file diff --git a/LeatherProject/LeatherApp/bin/Debug/CMDProcess/52.json b/LeatherProject/LeatherApp/bin/Debug/CMDProcess/52.json new file mode 100644 index 0000000..d0c4f82 --- /dev/null +++ b/LeatherProject/LeatherApp/bin/Debug/CMDProcess/52.json @@ -0,0 +1,10 @@ +{ + "Direction": 1, + "IN_OP_SHOW": [ "XXXX XXXX", "XXXX XXXX", "XXXX XXXX", "XXXX XXXX" ], + "IN_Waiting_Timeout": 0, + "OUT_OP_SHOW": [ "XHXX XXXX", "XXXX XXXX", "XXXX XXXX", "XXXX XXXX" ], + "SleepPre": 0, + "SleepLater": 0, + "AsynRun": false, + "Disable": false +} \ No newline at end of file diff --git a/LeatherProject/LeatherApp/bin/Debug/CMDProcess/53.json b/LeatherProject/LeatherApp/bin/Debug/CMDProcess/53.json new file mode 100644 index 0000000..6a1615a --- /dev/null +++ b/LeatherProject/LeatherApp/bin/Debug/CMDProcess/53.json @@ -0,0 +1,10 @@ +{ + "Direction": 1, + "IN_OP_SHOW": [ "XXXX XXXX", "XXXX XXXX", "XXXX XXXX", "XXXX XXXX" ], + "IN_Waiting_Timeout": 0, + "OUT_OP_SHOW": [ "HXXX XXXX", "XXXX XXXX", "XXXX XXXX", "XXXX XXXX" ], + "SleepPre": 0, + "SleepLater": 0, + "AsynRun": false, + "Disable": false +} \ No newline at end of file diff --git a/LeatherProject/LeatherApp/bin/Debug/CMDProcess/54.json b/LeatherProject/LeatherApp/bin/Debug/CMDProcess/54.json new file mode 100644 index 0000000..c2b4aba --- /dev/null +++ b/LeatherProject/LeatherApp/bin/Debug/CMDProcess/54.json @@ -0,0 +1,10 @@ +{ + "Direction": 1, + "IN_OP_SHOW": [ "XXXX XXXX", "XXXX XXXX", "XXXX XXXX", "XXXX XXXX" ], + "IN_Waiting_Timeout": 0, + "OUT_OP_SHOW": [ "XXXX XXXX", "XXXH XXXX", "XXXX XXXX", "XXXX XXXX" ], + "SleepPre": 0, + "SleepLater": 0, + "AsynRun": false, + "Disable": false +} \ No newline at end of file diff --git a/LeatherProject/LeatherApp/bin/Debug/CMDProcess/55.json b/LeatherProject/LeatherApp/bin/Debug/CMDProcess/55.json new file mode 100644 index 0000000..724c14f --- /dev/null +++ b/LeatherProject/LeatherApp/bin/Debug/CMDProcess/55.json @@ -0,0 +1,10 @@ +{ + "Direction": 1, + "IN_OP_SHOW": [ "XXXX XXXX", "XXXX XXXX", "XXXX XXXX", "XXXX XXXX" ], + "IN_Waiting_Timeout": 0, + "OUT_OP_SHOW": [ "XXXX XXXX", "XXHX XXXX", "XXXX XXXX", "XXXX XXXX" ], + "SleepPre": 0, + "SleepLater": 0, + "AsynRun": false, + "Disable": false +} \ No newline at end of file diff --git a/LeatherProject/LeatherApp/bin/Debug/CMDProcess/56.json b/LeatherProject/LeatherApp/bin/Debug/CMDProcess/56.json new file mode 100644 index 0000000..335733b --- /dev/null +++ b/LeatherProject/LeatherApp/bin/Debug/CMDProcess/56.json @@ -0,0 +1,10 @@ +{ + "Direction": 1, + "IN_OP_SHOW": [ "XXXX XXXX", "XXXX XXXX", "XXXX XXXX", "XXXX XXXX" ], + "IN_Waiting_Timeout": 0, + "OUT_OP_SHOW": [ "XXXX XXXX", "XHXX XXXX", "XXXX XXXX", "XXXX XXXX" ], + "SleepPre": 0, + "SleepLater": 0, + "AsynRun": false, + "Disable": false +} \ No newline at end of file diff --git a/LeatherProject/LeatherApp/bin/Debug/CMDProcess/57.json b/LeatherProject/LeatherApp/bin/Debug/CMDProcess/57.json new file mode 100644 index 0000000..c313136 --- /dev/null +++ b/LeatherProject/LeatherApp/bin/Debug/CMDProcess/57.json @@ -0,0 +1,10 @@ +{ + "Direction": 1, + "IN_OP_SHOW": [ "XXXX XXXX", "XXXX XXXX", "XXXX XXXX", "XXXX XXXX" ], + "IN_Waiting_Timeout": 0, + "OUT_OP_SHOW": [ "XXXX XXXX", "HXXX XXXX", "XXXX XXXX", "XXXX XXXX" ], + "SleepPre": 0, + "SleepLater": 0, + "AsynRun": false, + "Disable": false +} \ No newline at end of file diff --git a/LeatherProject/LeatherApp/bin/Debug/SysConfig.ini b/LeatherProject/LeatherApp/bin/Debug/SysConfig.ini index da3e1c7..51084af 100644 --- a/LeatherProject/LeatherApp/bin/Debug/SysConfig.ini +++ b/LeatherProject/LeatherApp/bin/Debug/SysConfig.ini @@ -78,6 +78,7 @@ OpenClearPic=False ClearDays=3 JMOffset=6.8 OpenOverSpeed=False +OpenLaser=True [BOffset] L_offset=0 R_offset=0 @@ -86,3 +87,11 @@ EdgeOffset=3 DataOffset1=0 DataOffset2=0 DataOffset3=0 +[LEDOffset] +LED1_Pos=0 +LED2_Pos=0 +LED3_Pos=0 +LED4_Pos=0 +LED5_Pos=0 +LED6_Pos=0 +LED7_Pos=0 \ No newline at end of file diff --git a/LeatherProject/LeatherApp/obj/Debug/LeatherApp.FrmVerList.resources b/LeatherProject/LeatherApp/obj/Debug/LeatherApp.FrmVerList.resources index ad05db3..91ba538 100644 Binary files a/LeatherProject/LeatherApp/obj/Debug/LeatherApp.FrmVerList.resources and b/LeatherProject/LeatherApp/obj/Debug/LeatherApp.FrmVerList.resources differ diff --git a/LeatherProject/LeatherApp/obj/Debug/LeatherApp.csproj.FileListAbsolute.txt b/LeatherProject/LeatherApp/obj/Debug/LeatherApp.csproj.FileListAbsolute.txt index cd8257d..c1b60bd 100644 --- a/LeatherProject/LeatherApp/obj/Debug/LeatherApp.csproj.FileListAbsolute.txt +++ b/LeatherProject/LeatherApp/obj/Debug/LeatherApp.csproj.FileListAbsolute.txt @@ -682,3 +682,5 @@ E:\CPL\迈沐智能项目\2023\革博士\源码\V1.0\LeatherProject\LeatherApp\o E:\CPL\迈沐智能项目\2023\革博士\源码\V1.0\LeatherProject\LeatherApp\obj\Debug\LeatherApp.Page.EditStandardFrm.resources E:\CPL\迈沐智能项目\2023\革博士\源码\V1.0\LeatherProject\LeatherApp\obj\Debug\LeatherApp.Page.GetHeightFrm.resources E:\CPL\迈沐智能项目\2023\革博士\源码\V1.0\LeatherProject\LeatherApp\obj\Debug\LeatherApp.Page.WaitFMFrm.resources +E:\CPL\迈沐智能项目\2023\革博士\源码\V1.0\LeatherProject\LeatherApp\bin\Debug\IKapBoardClassLibrary.dll +E:\CPL\迈沐智能项目\2023\革博士\源码\V1.0\LeatherProject\LeatherApp\bin\Debug\IKapC.NET.dll diff --git a/LeatherProject/Models/Records.cs b/LeatherProject/Models/Records.cs index d598ccd..0bb591d 100644 --- a/LeatherProject/Models/Records.cs +++ b/LeatherProject/Models/Records.cs @@ -279,6 +279,12 @@ namespace Models /// //[SugarColumn(IsIgnore = true)] public double CurrDis { get; set; } + + /// + /// cm 左侧偏移的距离 + /// + [SugarColumn(IsIgnore = true)] + public double X_offset { get; set; }//cm 左侧偏移的距离 } ///