diff --git a/Rs.DeweyTester/BaseForm.cs b/Rs.DeweyTester/BaseForm.cs index 61f7e52..d5f171b 100644 --- a/Rs.DeweyTester/BaseForm.cs +++ b/Rs.DeweyTester/BaseForm.cs @@ -48,12 +48,12 @@ namespace Rs.MotionPlat if (double.TryParse(value, out double dValue)) { SysConfigParam.Update(txtSysParam.Name.Replace("txt", ""), dValue.ToString()); - SysConfigParam.Init(); + //SysConfigParam.Init(); } else { SysConfigParam.Update(txtSysParam.Name.Replace("txt", ""), value.ToString()); - SysConfigParam.Init(); + //SysConfigParam.Init(); } } catch (Exception) diff --git a/Rs.DeweyTester/Commom/GlobalVar.cs b/Rs.DeweyTester/Commom/GlobalVar.cs index c1306ee..206187e 100644 --- a/Rs.DeweyTester/Commom/GlobalVar.cs +++ b/Rs.DeweyTester/Commom/GlobalVar.cs @@ -21,6 +21,18 @@ namespace Rs.Framework public static class GlobalVar { #region newpro + + /// + /// 启用料仓 + /// + [ParameterInit("int", "5", "system", "启用料仓")] + public static int UphRefreshCycle + { + get + { + return SysConfigParam.GetValue(nameof(UphRefreshCycle)); + } + } /// /// 启用料仓 diff --git a/Rs.DeweyTester/FormMain.cs b/Rs.DeweyTester/FormMain.cs index afeda26..877bfbc 100644 --- a/Rs.DeweyTester/FormMain.cs +++ b/Rs.DeweyTester/FormMain.cs @@ -256,6 +256,7 @@ namespace Rs.MotionPlat timertc4.Enabled = true; timertc5.Enabled = true; timertc6.Enabled = true; + timeruph.Enabled = true; BindParameter(); //if (!string.IsNullOrEmpty(GlobalUser.UserName)) //{ @@ -776,5 +777,20 @@ namespace Rs.MotionPlat textBox.Text = msg.ToString(); //textBox.Select(msg.Length, 0); } + + private void timer3_Tick_1(object sender, EventArgs e) + { + DateTime start = DateTime.Now.AddMinutes(GlobalVar.UphRefreshCycle*-1); + string querySql = $"select count(0) from records where placetime >= '{start}'"; + DataSet ds = MySqlHelper.GetDataSet(querySql); + if(ds!=null && ds.Tables.Count>0) + { + if(int.TryParse(ds.Tables[0].Rows[0][0].ToString(),out int totalNum)) + { + int uph = (int)(((double)totalNum / GlobalVar.UphRefreshCycle) * 60); + lblAvgUpg.Text = uph.ToString(); + } + } + } } } diff --git a/Rs.DeweyTester/FormMain.designer.cs b/Rs.DeweyTester/FormMain.designer.cs index de96a81..9103052 100644 --- a/Rs.DeweyTester/FormMain.designer.cs +++ b/Rs.DeweyTester/FormMain.designer.cs @@ -106,10 +106,12 @@ namespace Rs.MotionPlat this.btnBuzzer = new System.Windows.Forms.Button(); this.trayNozzle = new Rs.Controls.RsTray(); this.groupBox38 = new System.Windows.Forms.GroupBox(); + this.lblAvgUpg = new System.Windows.Forms.Label(); this.lblTotalYield = new System.Windows.Forms.Label(); this.lblNgNum = new System.Windows.Forms.Label(); this.lblPassNum = new System.Windows.Forms.Label(); this.lblTotalNum = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); this.label13 = new System.Windows.Forms.Label(); this.label11 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); @@ -159,6 +161,7 @@ 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.timeruph = new System.Windows.Forms.Timer(this.components); this.panel1.SuspendLayout(); this.tableLayoutPanel3.SuspendLayout(); this.panel3.SuspendLayout(); @@ -1234,10 +1237,12 @@ namespace Rs.MotionPlat // // groupBox38 // + this.groupBox38.Controls.Add(this.lblAvgUpg); this.groupBox38.Controls.Add(this.lblTotalYield); this.groupBox38.Controls.Add(this.lblNgNum); this.groupBox38.Controls.Add(this.lblPassNum); this.groupBox38.Controls.Add(this.lblTotalNum); + this.groupBox38.Controls.Add(this.label10); this.groupBox38.Controls.Add(this.label13); this.groupBox38.Controls.Add(this.label11); this.groupBox38.Controls.Add(this.label7); @@ -1252,6 +1257,16 @@ namespace Rs.MotionPlat this.groupBox38.TabStop = false; this.groupBox38.Text = "Statistics info"; // + // lblAvgUpg + // + this.lblAvgUpg.AutoSize = true; + this.lblAvgUpg.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.lblAvgUpg.Location = new System.Drawing.Point(630, 26); + this.lblAvgUpg.Name = "lblAvgUpg"; + this.lblAvgUpg.Size = new System.Drawing.Size(11, 12); + this.lblAvgUpg.TabIndex = 14; + this.lblAvgUpg.Text = "0"; + // // lblTotalYield // this.lblTotalYield.AutoSize = true; @@ -1292,6 +1307,16 @@ namespace Rs.MotionPlat this.lblTotalNum.TabIndex = 14; this.lblTotalNum.Text = "0"; // + // label10 + // + this.label10.AutoSize = true; + this.label10.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.label10.Location = new System.Drawing.Point(574, 26); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(29, 12); + this.label10.TabIndex = 14; + this.label10.Text = "Uph:"; + // // label13 // this.label13.AutoSize = true; @@ -1839,6 +1864,11 @@ namespace Rs.MotionPlat this.timertc6.Interval = 500; this.timertc6.Tick += new System.EventHandler(this.timertc6_Tick); // + // timeruph + // + this.timeruph.Interval = 3000; + this.timeruph.Tick += new System.EventHandler(this.timer3_Tick_1); + // // FormMain // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -2016,5 +2046,8 @@ namespace Rs.MotionPlat private System.Windows.Forms.Label label13; private System.Windows.Forms.Label label11; private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label lblAvgUpg; + private System.Windows.Forms.Timer timeruph; } } \ No newline at end of file diff --git a/Rs.DeweyTester/FormMain.resx b/Rs.DeweyTester/FormMain.resx index 915fbba..983c46f 100644 --- a/Rs.DeweyTester/FormMain.resx +++ b/Rs.DeweyTester/FormMain.resx @@ -153,4 +153,7 @@ 691, 17 + + 792, 17 + \ No newline at end of file diff --git a/Rs.DeweyTester/SysConfig/CommonConfig.Designer.cs b/Rs.DeweyTester/SysConfig/CommonConfig.Designer.cs index 128b844..34c4f9d 100644 --- a/Rs.DeweyTester/SysConfig/CommonConfig.Designer.cs +++ b/Rs.DeweyTester/SysConfig/CommonConfig.Designer.cs @@ -60,12 +60,14 @@ this.txtMachineID = new System.Windows.Forms.TextBox(); this.label5 = new System.Windows.Forms.Label(); this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.txtUphRefreshCycle = new System.Windows.Forms.TextBox(); this.cboxMsgShowEn = new System.Windows.Forms.CheckBox(); this.cboxMsgShowCn = new System.Windows.Forms.CheckBox(); this.txtSimulateTestYield = new System.Windows.Forms.TextBox(); this.txtSimulateTestTime = new System.Windows.Forms.TextBox(); this.label13 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); this.label12 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.panelEx1 = new Rs.Controls.PanelEx(); @@ -371,12 +373,14 @@ // // groupBox1 // + this.groupBox1.Controls.Add(this.txtUphRefreshCycle); this.groupBox1.Controls.Add(this.cboxMsgShowEn); this.groupBox1.Controls.Add(this.cboxMsgShowCn); this.groupBox1.Controls.Add(this.txtSimulateTestYield); this.groupBox1.Controls.Add(this.txtSimulateTestTime); this.groupBox1.Controls.Add(this.label13); this.groupBox1.Controls.Add(this.label10); + this.groupBox1.Controls.Add(this.label9); this.groupBox1.Controls.Add(this.label12); this.groupBox1.Controls.Add(this.label7); this.groupBox1.Controls.Add(this.panelEx1); @@ -414,6 +418,12 @@ this.groupBox1.Name = "groupBox1"; this.groupBox1.TabStop = false; // + // txtUphRefreshCycle + // + resources.ApplyResources(this.txtUphRefreshCycle, "txtUphRefreshCycle"); + this.txtUphRefreshCycle.Name = "txtUphRefreshCycle"; + this.txtUphRefreshCycle.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txtSysParam_KeyUp); + // // cboxMsgShowEn // resources.ApplyResources(this.cboxMsgShowEn, "cboxMsgShowEn"); @@ -448,6 +458,11 @@ resources.ApplyResources(this.label10, "label10"); this.label10.Name = "label10"; // + // label9 + // + resources.ApplyResources(this.label9, "label9"); + this.label9.Name = "label9"; + // // label12 // resources.ApplyResources(this.label12, "label12"); @@ -944,5 +959,7 @@ private System.Windows.Forms.Label label3; private System.Windows.Forms.Button btnSaveRelCategory; private System.Windows.Forms.CheckBox cboxEnableStock; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.TextBox txtUphRefreshCycle; } } \ No newline at end of file diff --git a/Rs.DeweyTester/SysConfig/CommonConfig.resx b/Rs.DeweyTester/SysConfig/CommonConfig.resx index fbcd482..b602f3b 100644 --- a/Rs.DeweyTester/SysConfig/CommonConfig.resx +++ b/Rs.DeweyTester/SysConfig/CommonConfig.resx @@ -993,6 +993,27 @@ 1 + + 155, 109 + + + 100, 21 + + + 12 + + + txtUphRefreshCycle + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + True @@ -1024,7 +1045,7 @@ groupBox1 - 0 + 1 True @@ -1057,7 +1078,7 @@ groupBox1 - 1 + 2 386, 142 @@ -1078,7 +1099,7 @@ groupBox1 - 2 + 3 386, 107 @@ -1099,7 +1120,7 @@ groupBox1 - 3 + 4 True @@ -1129,7 +1150,7 @@ groupBox1 - 4 + 5 True @@ -1162,7 +1183,37 @@ groupBox1 - 5 + 6 + + + True + + + NoControl + + + 50, 113 + + + 77, 12 + + + 10 + + + UPH刷新周期: + + + label9 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 7 True @@ -1192,7 +1243,7 @@ groupBox1 - 6 + 8 True @@ -1222,7 +1273,7 @@ groupBox1 - 7 + 9 Bottom, Right @@ -1339,7 +1390,7 @@ groupBox1 - 8 + 10 False @@ -1366,7 +1417,7 @@ groupBox1 - 9 + 11 False @@ -1393,7 +1444,7 @@ groupBox1 - 10 + 12 True @@ -1423,7 +1474,7 @@ groupBox1 - 11 + 13 True @@ -1453,7 +1504,7 @@ groupBox1 - 12 + 14 True @@ -1483,7 +1534,7 @@ groupBox1 - 13 + 15 True @@ -1513,7 +1564,7 @@ groupBox1 - 14 + 16 True @@ -1543,7 +1594,7 @@ groupBox1 - 15 + 17 True @@ -1573,7 +1624,7 @@ groupBox1 - 16 + 18 True @@ -1603,7 +1654,7 @@ groupBox1 - 17 + 19 True @@ -1633,7 +1684,7 @@ groupBox1 - 18 + 20 True @@ -1663,7 +1714,7 @@ groupBox1 - 19 + 21 True @@ -1693,7 +1744,7 @@ groupBox1 - 20 + 22 True @@ -1723,7 +1774,7 @@ groupBox1 - 21 + 23 True @@ -1753,7 +1804,7 @@ groupBox1 - 22 + 24 True @@ -1783,7 +1834,7 @@ groupBox1 - 23 + 25 True @@ -1816,7 +1867,7 @@ groupBox1 - 24 + 26 True @@ -1849,7 +1900,7 @@ groupBox1 - 25 + 27 True @@ -1882,7 +1933,7 @@ groupBox1 - 26 + 28 True @@ -1915,7 +1966,7 @@ groupBox1 - 27 + 29 True @@ -1948,7 +1999,7 @@ groupBox1 - 28 + 30 True @@ -1981,7 +2032,7 @@ groupBox1 - 29 + 31 True @@ -2011,7 +2062,7 @@ groupBox1 - 30 + 32 False @@ -2038,7 +2089,7 @@ groupBox1 - 31 + 33 True @@ -2068,7 +2119,7 @@ groupBox1 - 32 + 34 True @@ -2098,7 +2149,7 @@ groupBox1 - 33 + 35 True @@ -2128,7 +2179,7 @@ groupBox1 - 34 + 36 True @@ -2158,7 +2209,7 @@ groupBox1 - 35 + 37 True @@ -2188,7 +2239,7 @@ groupBox1 - 36 + 38 True @@ -2218,7 +2269,7 @@ groupBox1 - 37 + 39 Fill