diff --git a/CleanMachineHMI/CleanMachineHMI.csproj b/CleanMachineHMI/CleanMachineHMI.csproj index 067b8b6..6a5de17 100644 --- a/CleanMachineHMI/CleanMachineHMI.csproj +++ b/CleanMachineHMI/CleanMachineHMI.csproj @@ -1,10 +1,12 @@  - Exe + WinExe net472 true + + diff --git a/CleanMachineHMI/DataBase/clearMac.db b/CleanMachineHMI/DataBase/clearMac.db index fb6286b..f72b6fe 100644 Binary files a/CleanMachineHMI/DataBase/clearMac.db and b/CleanMachineHMI/DataBase/clearMac.db differ diff --git a/CleanMachineHMI/FrmUserControl/frmMainDetail.Designer.cs b/CleanMachineHMI/FrmUserControl/frmMainDetail.Designer.cs index eacd73d..49e72ae 100644 --- a/CleanMachineHMI/FrmUserControl/frmMainDetail.Designer.cs +++ b/CleanMachineHMI/FrmUserControl/frmMainDetail.Designer.cs @@ -50,7 +50,6 @@ namespace CleanMachineHMI.FrmUserControl this.kryptonButton3 = new Krypton.Toolkit.KryptonButton(); this.knud_WorkedFullPalletNum = new Krypton.Toolkit.KryptonTextBox(); this.kryptonGroupBox7 = new Krypton.Toolkit.KryptonGroupBox(); - this.circleButton1 = new CleanMachineHMI.CircleButton(); this.kryptonLabel12 = new Krypton.Toolkit.KryptonLabel(); this.kryptonLabel11 = new Krypton.Toolkit.KryptonLabel(); this.cbt_fpalletmod = new CleanMachineHMI.CircleButton(); @@ -75,6 +74,7 @@ namespace CleanMachineHMI.FrmUserControl this.kryptonLabel9 = new Krypton.Toolkit.KryptonLabel(); this.swtbtn_brush2 = new CleanMachineHMI.LSwitchButton(); this.cbt_Brush2StatusTran = new CleanMachineHMI.CircleButton(); + this.circleButton1 = new CleanMachineHMI.CircleButton(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.kryptonGroupBox1 = new Krypton.Toolkit.KryptonGroupBox(); this.kryptonLabel13 = new Krypton.Toolkit.KryptonLabel(); @@ -86,13 +86,10 @@ namespace CleanMachineHMI.FrmUserControl this.kdtp_RecordDate = new Krypton.Toolkit.KryptonDateTimePicker(); this.label8 = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); - this.kryptonButton8 = new Krypton.Toolkit.KryptonButton(); this.ktb_CurrPalletCode = new Krypton.Toolkit.KryptonTextBox(); this.kryptonLabel10 = new Krypton.Toolkit.KryptonLabel(); - this.ktb_ShiftCount = new Krypton.Toolkit.KryptonTextBox(); this.ktb_FinishedPalletNum = new Krypton.Toolkit.KryptonTextBox(); this.ktb_CurrentPalletNum = new Krypton.Toolkit.KryptonTextBox(); - this.kryptonLabel16 = new Krypton.Toolkit.KryptonLabel(); this.kryptonLabel15 = new Krypton.Toolkit.KryptonLabel(); this.ktb_ScrapNum = new Krypton.Toolkit.KryptonTextBox(); this.kryptonLabel14 = new Krypton.Toolkit.KryptonLabel(); @@ -105,6 +102,9 @@ namespace CleanMachineHMI.FrmUserControl this.ktb_IR = new Krypton.Toolkit.KryptonTextBox(); this.kryptonLabel1 = new Krypton.Toolkit.KryptonLabel(); this.kryptonLabel2 = new Krypton.Toolkit.KryptonLabel(); + this.kryptonButton8 = new Krypton.Toolkit.KryptonButton(); + this.ktb_ShiftCount = new Krypton.Toolkit.KryptonTextBox(); + this.kryptonLabel16 = new Krypton.Toolkit.KryptonLabel(); this.kryptonButton1 = new Krypton.Toolkit.KryptonButton(); this.kryptonGroupBox5 = new Krypton.Toolkit.KryptonGroupBox(); this.kryptonPanel24 = new Krypton.Toolkit.KryptonPanel(); @@ -528,21 +528,6 @@ namespace CleanMachineHMI.FrmUserControl this.kryptonGroupBox7.TabIndex = 5; this.kryptonGroupBox7.Values.Heading = ""; // - // circleButton1 - // - this.circleButton1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(237)))), ((int)(((byte)(64)))), ((int)(((byte)(20))))); - this.circleButton1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.circleButton1.ForeColor = System.Drawing.Color.White; - this.circleButton1.Location = new System.Drawing.Point(37, 125); - this.circleButton1.Name = "circleButton1"; - this.circleButton1.Size = new System.Drawing.Size(60, 60); - this.circleButton1.TabIndex = 53; - this.circleButton1.Text = "Auto Stop"; - this.circleButton1.UseVisualStyleBackColor = false; - this.circleButton1.Visible = false; - this.circleButton1.Click += new System.EventHandler(this.circleButton1_Click); - this.circleButton1.KeyUp += new System.Windows.Forms.KeyEventHandler(this.circleButton1_KeyUp); - // // kryptonLabel12 // this.kryptonLabel12.Location = new System.Drawing.Point(21, 302); @@ -835,6 +820,21 @@ namespace CleanMachineHMI.FrmUserControl this.cbt_Brush2StatusTran.TabIndex = 36; this.cbt_Brush2StatusTran.UseVisualStyleBackColor = false; // + // circleButton1 + // + this.circleButton1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(237)))), ((int)(((byte)(64)))), ((int)(((byte)(20))))); + this.circleButton1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.circleButton1.ForeColor = System.Drawing.Color.White; + this.circleButton1.Location = new System.Drawing.Point(37, 125); + this.circleButton1.Name = "circleButton1"; + this.circleButton1.Size = new System.Drawing.Size(60, 60); + this.circleButton1.TabIndex = 53; + this.circleButton1.Text = "Auto Stop"; + this.circleButton1.UseVisualStyleBackColor = false; + this.circleButton1.Visible = false; + this.circleButton1.Click += new System.EventHandler(this.circleButton1_Click); + this.circleButton1.KeyUp += new System.Windows.Forms.KeyEventHandler(this.circleButton1_KeyUp); + // // tableLayoutPanel2 // this.tableLayoutPanel2.BackColor = System.Drawing.Color.Transparent; @@ -997,20 +997,9 @@ namespace CleanMachineHMI.FrmUserControl this.panel1.Controls.Add(this.kryptonLabel4); this.panel1.Location = new System.Drawing.Point(6, 79); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(390, 102); + this.panel1.Size = new System.Drawing.Size(336, 159); this.panel1.TabIndex = 3; // - // kryptonButton8 - // - this.kryptonButton8.Location = new System.Drawing.Point(169, 99); - this.kryptonButton8.Name = "kryptonButton8"; - this.kryptonButton8.Size = new System.Drawing.Size(73, 26); - this.kryptonButton8.StateCommon.Content.ShortText.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.kryptonButton8.TabIndex = 49; - this.kryptonButton8.Values.Text = "reset"; - this.kryptonButton8.Visible = false; - this.kryptonButton8.Click += new System.EventHandler(this.kryptonButton8_Click); - // // ktb_CurrPalletCode // this.ktb_CurrPalletCode.AlwaysActive = false; @@ -1030,17 +1019,6 @@ namespace CleanMachineHMI.FrmUserControl this.kryptonLabel10.TabIndex = 9; this.kryptonLabel10.Values.Text = "Current Pallet Code"; // - // ktb_ShiftCount - // - this.ktb_ShiftCount.AlwaysActive = false; - this.ktb_ShiftCount.Location = new System.Drawing.Point(61, 102); - this.ktb_ShiftCount.Name = "ktb_ShiftCount"; - this.ktb_ShiftCount.ReadOnly = true; - this.ktb_ShiftCount.Size = new System.Drawing.Size(71, 23); - this.ktb_ShiftCount.TabIndex = 1; - this.ktb_ShiftCount.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - this.ktb_ShiftCount.Visible = false; - // // ktb_FinishedPalletNum // this.ktb_FinishedPalletNum.AlwaysActive = false; @@ -1061,16 +1039,6 @@ namespace CleanMachineHMI.FrmUserControl this.ktb_CurrentPalletNum.TabIndex = 1; this.ktb_CurrentPalletNum.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; // - // kryptonLabel16 - // - this.kryptonLabel16.LabelStyle = Krypton.Toolkit.LabelStyle.BoldControl; - this.kryptonLabel16.Location = new System.Drawing.Point(-15, 103); - this.kryptonLabel16.Name = "kryptonLabel16"; - this.kryptonLabel16.Size = new System.Drawing.Size(76, 20); - this.kryptonLabel16.TabIndex = 0; - this.kryptonLabel16.Values.Text = "Shift Count"; - this.kryptonLabel16.Visible = false; - // // kryptonLabel15 // this.kryptonLabel15.LabelStyle = Krypton.Toolkit.LabelStyle.BoldControl; @@ -1190,6 +1158,38 @@ namespace CleanMachineHMI.FrmUserControl this.kryptonLabel2.TabIndex = 0; this.kryptonLabel2.Values.Text = "Sheet Type"; // + // kryptonButton8 + // + this.kryptonButton8.Location = new System.Drawing.Point(169, 99); + this.kryptonButton8.Name = "kryptonButton8"; + this.kryptonButton8.Size = new System.Drawing.Size(73, 26); + this.kryptonButton8.StateCommon.Content.ShortText.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.kryptonButton8.TabIndex = 49; + this.kryptonButton8.Values.Text = "reset"; + this.kryptonButton8.Visible = false; + this.kryptonButton8.Click += new System.EventHandler(this.kryptonButton8_Click); + // + // ktb_ShiftCount + // + this.ktb_ShiftCount.AlwaysActive = false; + this.ktb_ShiftCount.Location = new System.Drawing.Point(61, 102); + this.ktb_ShiftCount.Name = "ktb_ShiftCount"; + this.ktb_ShiftCount.ReadOnly = true; + this.ktb_ShiftCount.Size = new System.Drawing.Size(71, 23); + this.ktb_ShiftCount.TabIndex = 1; + this.ktb_ShiftCount.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.ktb_ShiftCount.Visible = false; + // + // kryptonLabel16 + // + this.kryptonLabel16.LabelStyle = Krypton.Toolkit.LabelStyle.BoldControl; + this.kryptonLabel16.Location = new System.Drawing.Point(-15, 103); + this.kryptonLabel16.Name = "kryptonLabel16"; + this.kryptonLabel16.Size = new System.Drawing.Size(76, 20); + this.kryptonLabel16.TabIndex = 0; + this.kryptonLabel16.Values.Text = "Shift Count"; + this.kryptonLabel16.Visible = false; + // // kryptonButton1 // this.kryptonButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -1532,27 +1532,27 @@ namespace CleanMachineHMI.FrmUserControl this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 1; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 213F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 213F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 213F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 213F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 213F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 213F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 213F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 213F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 213F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 213F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 213F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 213F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 213F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 213F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 213F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 213F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 213F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 213F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 213F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 213F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 213F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 270F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 270F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 270F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 270F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 270F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 270F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 270F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 270F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 270F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 270F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 270F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 270F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 270F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 270F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 270F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 270F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 270F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 270F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 270F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 270F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 270F)); this.tableLayoutPanel1.Size = new System.Drawing.Size(1000, 270); this.tableLayoutPanel1.TabIndex = 8; // diff --git a/CleanMachineHMI/FrmUserControl/frmMainDetail.cs b/CleanMachineHMI/FrmUserControl/frmMainDetail.cs index 503c005..c2865e6 100644 --- a/CleanMachineHMI/FrmUserControl/frmMainDetail.cs +++ b/CleanMachineHMI/FrmUserControl/frmMainDetail.cs @@ -333,7 +333,81 @@ namespace CleanMachineHMI.FrmUserControl { Console.WriteLine("数据变化"); - + this.ktb_ShiftCount.Text = _device.ShiftCount.ToString(); + + string ktb_IRTest = this.ktb_IR.Text; + string kcmb_SheetTypeText = this.kcmb_SheetType.Text; + + string CurrPalletCodeText = ktb_CurrPalletCode.Text.Trim(); + + //读取PLC当前值-这个值带有初始值 + int currNum = _device.NozzleNum; + + int fullPalletNum = _device.WorkedFullPalletNum; + // + + if (0 < (fullPalletNum - currNum) && (fullPalletNum - currNum) <= 10 && fullPalletNum != 0) + { + if ((fullPalletNum - currNum) != remainingQty) + { + frmMainNew.RefreshFrmHost($"The tray is about to fill up and the remaining quantity is [{fullPalletNum - currNum}]!!"); + LogHelper.WriteLog($"托盘即将满料,剩余数量为【{fullPalletNum - currNum}】!!", LogTypeEum.Run); + remainingQty = fullPalletNum - currNum; + } + } + else + { + + remainingQty = fullPalletNum - currNum; + frmMainNew.RefreshFrmHost(null); + } + //托盘在当前IR中的数量 + currNum -= this.lastPaltteRemain; + if (currNum >= 0) + { + //string sqlFinishIrSheetTypeDtl = $"select sum(CURRENT_NUMBER) from CM_WORKING_PALLET_DTL where CLEAN_MODE_CODE = 'SortedCleaned' and WORKING_DTL_STATUS = 1"; + //DataTable dtFinishIrSheetTypeDtl = LeadDbHelperSQLite.Query(sqlFinishIrSheetTypeDtl).Tables[0]; + + //int finishIrSheetTypeNum = 0; + //if (dtFinishIrSheetTypeDtl != null && dtFinishIrSheetTypeDtl.Rows.Count > 0) + //{ + // finishIrSheetTypeNum = Convert.ToInt32(dtFinishIrSheetTypeDtl.Rows[0][0] == DBNull.Value ? 0 : dtFinishIrSheetTypeDtl.Rows[0][0]); + //} + //if (autoCleanNum != (currNum - finishIrSheetTypeNum)) + //{ + //防止中途关闭系统后产生内存数据丢失 + string sql12 = $@" + UPDATE CM_WORKING_PALLET_DTL + SET CURRENT_NUMBER = '{currNum }', + UPDATE_BY = '{Global.UserInfo.UserId}', + UPDATE_TIME = datetime('now', 'localtime'), + DATA_VERSION = DATA_VERSION + 1 + WHERE + CLEAN_MODE_CODE = 'SortedCleaned' + AND IR_CODE = '{ktb_IRTest}' + AND SHEET_TYPE_CODE = '{kcmb_SheetTypeText}' + AND WORKING_DTL_STATUS = 0 + AND WORKING_PALLET_CODE = '{CurrPalletCodeText}' + "; + + int row = LeadDbHelperSQLite.Execute(sql12); + //autoCleanNum = currNum - finishIrSheetTypeNum; + if (row > 0) + { + //LogHelper.WriteLog($"用户:【{GlobalHelper.UserInfo.USER_NAME}】作业托盘:【{ktb_CurrPalletCode.Text}】作业IR:【{ktb_IR.Text}】作业板材:【{kcmb_SheetType.Text}】顺序清洗计数+1成功,数量为:【{currNum}】。", LogTypeEum.Run); + } + else + { + //LogHelper.WriteLog($"用户:【{GlobalHelper.UserInfo.USER_NAME}】作业托盘:【{ktb_CurrPalletCode.Text}】作业IR:【{ktb_IR.Text}】作业板材:【{kcmb_SheetType.Text}】顺序清洗计数+1失败。", LogTypeEum.Run); + } + //} + } + else + { + //autoCleanNum = 0; + } + + cbt_RunStatusTran.BackColor = _device.CleanMacRunStatusNew ? Color.Lime : Color.Gray; cbt_Brush1StatusTran.BackColor = _device.Hairbrush1Selection ? Color.Lime : Color.Gray; @@ -349,12 +423,7 @@ namespace CleanMachineHMI.FrmUserControl // 显示班次计数 //ShiftCount - this.ktb_ShiftCount.Text = _device.ShiftCount.ToString(); - string ktb_IRTest = this.ktb_IR.Text; - string kcmb_SheetTypeText = this.kcmb_SheetType.Text; - - string CurrPalletCodeText = ktb_CurrPalletCode.Text.Trim(); //防止中途关闭系统产生数据丢失,因此每周期都会更新数据 @@ -428,72 +497,7 @@ namespace CleanMachineHMI.FrmUserControl } - //读取PLC当前值-这个值带有初始值 - int currNum = _device.NozzleNum; - int fullPalletNum = _device.WorkedFullPalletNum; - // - - if (0 < (fullPalletNum - currNum) && (fullPalletNum - currNum) <= 10 && fullPalletNum != 0) - { - if ((fullPalletNum - currNum) != remainingQty) - { - frmMainNew.RefreshFrmHost($"The tray is about to fill up and the remaining quantity is [{fullPalletNum - currNum}]!!"); - LogHelper.WriteLog($"托盘即将满料,剩余数量为【{fullPalletNum - currNum}】!!", LogTypeEum.Run); - remainingQty = fullPalletNum - currNum; - } - } - else - { - - remainingQty = fullPalletNum - currNum; - frmMainNew.RefreshFrmHost(null); - } - //托盘在当前IR中的数量 - currNum -= this.lastPaltteRemain; - if (currNum > 0) - { - //string sqlFinishIrSheetTypeDtl = $"select sum(CURRENT_NUMBER) from CM_WORKING_PALLET_DTL where CLEAN_MODE_CODE = 'SortedCleaned' and WORKING_DTL_STATUS = 1"; - //DataTable dtFinishIrSheetTypeDtl = LeadDbHelperSQLite.Query(sqlFinishIrSheetTypeDtl).Tables[0]; - - //int finishIrSheetTypeNum = 0; - //if (dtFinishIrSheetTypeDtl != null && dtFinishIrSheetTypeDtl.Rows.Count > 0) - //{ - // finishIrSheetTypeNum = Convert.ToInt32(dtFinishIrSheetTypeDtl.Rows[0][0] == DBNull.Value ? 0 : dtFinishIrSheetTypeDtl.Rows[0][0]); - //} - //if (autoCleanNum != (currNum - finishIrSheetTypeNum)) - //{ - //防止中途关闭系统后产生内存数据丢失 - string sql12 = $@" - UPDATE CM_WORKING_PALLET_DTL - SET CURRENT_NUMBER = '{currNum }', - UPDATE_BY = '{Global.UserInfo.UserId}', - UPDATE_TIME = datetime('now', 'localtime'), - DATA_VERSION = DATA_VERSION + 1 - WHERE - CLEAN_MODE_CODE = 'SortedCleaned' - AND IR_CODE = '{ktb_IRTest}' - AND SHEET_TYPE_CODE = '{kcmb_SheetTypeText}' - AND WORKING_DTL_STATUS = 0 - AND WORKING_PALLET_CODE = '{CurrPalletCodeText}' - "; - - int row = LeadDbHelperSQLite.Execute(sql12); - //autoCleanNum = currNum - finishIrSheetTypeNum; - if (row > 0) - { - //LogHelper.WriteLog($"用户:【{GlobalHelper.UserInfo.USER_NAME}】作业托盘:【{ktb_CurrPalletCode.Text}】作业IR:【{ktb_IR.Text}】作业板材:【{kcmb_SheetType.Text}】顺序清洗计数+1成功,数量为:【{currNum}】。", LogTypeEum.Run); - } - else - { - //LogHelper.WriteLog($"用户:【{GlobalHelper.UserInfo.USER_NAME}】作业托盘:【{ktb_CurrPalletCode.Text}】作业IR:【{ktb_IR.Text}】作业板材:【{kcmb_SheetType.Text}】顺序清洗计数+1失败。", LogTypeEum.Run); - } - //} - } - else - { - //autoCleanNum = 0; - } FinishWorkingPallet1(); @@ -1216,6 +1220,7 @@ namespace CleanMachineHMI.FrmUserControl KryptonMessageBox.Show($"Clean type: [{md.CleanModeCode}] pollution types: {md.ContaminationTypeCode} [pollution] detail: [{md.ContaminationTypeName}] count + 1 function, abnormity data updates to the database."); } kryptonGroupBox1.Focus(); + Instance_OnReadFinish(); } catch (Exception ex) { @@ -1255,6 +1260,7 @@ namespace CleanMachineHMI.FrmUserControl KryptonMessageBox.Show("Other count +1 function, data update to the database occurred an exception."); } kryptonGroupBox1.Focus(); + Instance_OnReadFinish(); } catch (Exception ex) { @@ -1354,6 +1360,9 @@ namespace CleanMachineHMI.FrmUserControl KryptonMessageBox.Show("Waste count +1 function, data update to the database occurred an exception."); } kryptonGroupBox1.Focus(); + Instance_OnReadFinish(); + + } catch (Exception ex) { @@ -1518,7 +1527,7 @@ namespace CleanMachineHMI.FrmUserControl } private bool _nextFullStop = false; - + @@ -1541,7 +1550,7 @@ namespace CleanMachineHMI.FrmUserControl } - + if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("StopSys", PlcItemTypeDesc.M)) && !Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("ManualOrAuto", PlcItemTypeDesc.M))) @@ -2349,6 +2358,7 @@ namespace CleanMachineHMI.FrmUserControl KryptonMessageBox.Show("Other count -1 function, data update to the database occurred an exception."); } kryptonGroupBox1.Focus(); + Instance_OnReadFinish(); } catch (Exception ex) { @@ -2393,6 +2403,7 @@ namespace CleanMachineHMI.FrmUserControl KryptonMessageBox.Show($"Clean type: [{md.CleanModeCode}] pollution types: {md.ContaminationTypeCode} [pollution] detail: [{md.ContaminationTypeName}] count - 1 function, abnormity data updates to the database."); } kryptonGroupBox1.Focus(); + Instance_OnReadFinish(); } catch (Exception ex) { @@ -2439,7 +2450,9 @@ namespace CleanMachineHMI.FrmUserControl LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】,托盘号:【{ktb_CurrPalletCode.Text.Trim()}】,IR:【{ktb_IR.Text.Trim()}】,板材信息:【{kcmb_SheetType.Text}】。废料计数 -1 功能,数据更新到数据库发生异常!", LogTypeEum.Err); KryptonMessageBox.Show("Waste count -1 function, data update to the database occurred an exception."); } + kryptonGroupBox1.Focus(); + Instance_OnReadFinish(); } catch (Exception ex) { @@ -2811,7 +2824,7 @@ namespace CleanMachineHMI.FrmUserControl } - + private void kryptonDropButton1_Click(object sender, EventArgs e) { diff --git a/CleanMachineHMI/Utils/frmUtil.cs b/CleanMachineHMI/Utils/frmUtil.cs index 8a60dea..b710dfe 100644 --- a/CleanMachineHMI/Utils/frmUtil.cs +++ b/CleanMachineHMI/Utils/frmUtil.cs @@ -182,22 +182,29 @@ namespace CleanMachineHMI.Utils public static void SetSingleControlText(this Control form, Control control) { +#if RELEASE + try { - var key = form.Name + "|" + control.Name; - if (!Global.ThemeLanguage.ContainsKey(key)) - { - control.Text = control.Name; - } - AddzhCN(key, control.Text, ""); - +#endif + var key = form.Name + "|" + control.Name; + if (!Global.ThemeLanguage.ContainsKey(key)) + { + control.Text = control.Name; + } + else + { control.Text = Global.ThemeLanguage[key]; + } + AddzhCN(key, control.Text, ""); +#if RELEASE } catch (Exception ex) { LogHelper.WriteLog(ex.Message, LogTypeEum.Err); } +#endif } ///