From 8d0a72ed94a22e588ddc1cee6f0473879775b244 Mon Sep 17 00:00:00 2001 From: lhiven <236881222@qq.com> Date: Tue, 19 Mar 2024 08:36:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=89=AB=E7=A0=81=E9=80=9F?= =?UTF-8?q?=E5=BA=A6=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rs.SkyLine/Commom/GlobalVar.cs | 11 +++ Rs.SkyLine/Commom/Ops.cs | 12 ++- .../Flow/SubFlow/UpCameraScanBarCodeFlow.cs | 12 +-- Rs.SkyLine/SysConfig/CommonConfig.Designer.cs | 79 ++++++++++++++----- Rs.SkyLine/SysConfig/CommonConfig.cs | 5 ++ 5 files changed, 93 insertions(+), 26 deletions(-) diff --git a/Rs.SkyLine/Commom/GlobalVar.cs b/Rs.SkyLine/Commom/GlobalVar.cs index 20be6a6..2db3ce3 100644 --- a/Rs.SkyLine/Commom/GlobalVar.cs +++ b/Rs.SkyLine/Commom/GlobalVar.cs @@ -1141,5 +1141,16 @@ namespace Rs.Framework return SysConfigParam.GetValue(nameof(LasterCom)); } } + + /// + /// 扫码速度 + /// + public static int ScanBarcodeSpeed + { + get + { + return SysConfigParam.GetValue(nameof(ScanBarcodeSpeed)); + } + } } } diff --git a/Rs.SkyLine/Commom/Ops.cs b/Rs.SkyLine/Commom/Ops.cs index d5b207b..f566571 100644 --- a/Rs.SkyLine/Commom/Ops.cs +++ b/Rs.SkyLine/Commom/Ops.cs @@ -262,7 +262,7 @@ namespace Rs.MotionPlat.Commom insertSql = $"insert into SysParameter(fieldname,fieldtype,fieldvalue,Desc,category,enable) values('StockTakePictureOffsetY','double','0','料仓拍照偏移Y','tray',1)"; db.ExecuteNonQuery(insertSql); } - + querySql = "select * from SysParameter where fieldname='LasterCom'"; dt = db.GetDataTable(querySql); if (dt == null || dt.Rows.Count == 0) @@ -270,7 +270,15 @@ namespace Rs.MotionPlat.Commom insertSql = $"insert into SysParameter(fieldname,fieldtype,fieldvalue,Desc,category,enable) values('LasterCom','string','COM1','镭射头端口','system',1)"; db.ExecuteNonQuery(insertSql); } - + + + querySql = "select * from SysParameter where fieldname='ScanBarcodeSpeed'"; + dt = db.GetDataTable(querySql); + if (dt == null || dt.Rows.Count == 0) + { + insertSql = $"insert into SysParameter(fieldname,fieldtype,fieldvalue,Desc,category,enable) values('ScanBarcodeSpeed','int','40','扫码速度','system',1)"; + db.ExecuteNonQuery(insertSql); + } } diff --git a/Rs.SkyLine/Flow/SubFlow/UpCameraScanBarCodeFlow.cs b/Rs.SkyLine/Flow/SubFlow/UpCameraScanBarCodeFlow.cs index a85c461..fe1a2da 100644 --- a/Rs.SkyLine/Flow/SubFlow/UpCameraScanBarCodeFlow.cs +++ b/Rs.SkyLine/Flow/SubFlow/UpCameraScanBarCodeFlow.cs @@ -105,10 +105,10 @@ namespace Rs.MotionPlat.Flow.SubFlow targetPostion.X += GlobalVar.TurnoverTakePictureOffsetX; targetPostion.Y+= GlobalVar.TurnoverTakePictureOffsetY; - errCode = AxisControl.LoadX.MovePos(targetPostion.X, GlobalVar.FlyCameraSpeed); + errCode = AxisControl.LoadX.MovePos(targetPostion.X, GlobalVar.ScanBarcodeSpeed); if (errCode == ErrorCode.Ok || GlobalVar.VirtualAxis) { - errCode = AxisControl.LoadY.MovePos(targetPostion.Y, GlobalVar.FlyCameraSpeed); + errCode = AxisControl.LoadY.MovePos(targetPostion.Y, GlobalVar.ScanBarcodeSpeed); if (errCode == ErrorCode.Ok || GlobalVar.VirtualAxis) { logInfo = GetClassName() + $"正向扫码,到扫码起始位"; @@ -135,10 +135,10 @@ namespace Rs.MotionPlat.Flow.SubFlow targetPostion.Y = startPoint.Y; targetPostion.X += GlobalVar.TurnoverTakePictureOffsetX; targetPostion.Y += GlobalVar.TurnoverTakePictureOffsetY; - errCode = AxisControl.LoadX.MovePos(targetPostion.X, GlobalVar.FlyCameraSpeed); + errCode = AxisControl.LoadX.MovePos(targetPostion.X, GlobalVar.ScanBarcodeSpeed); if (errCode == ErrorCode.Ok) { - errCode = AxisControl.LoadY.MovePos(targetPostion.Y, GlobalVar.FlyCameraSpeed); + errCode = AxisControl.LoadY.MovePos(targetPostion.Y, GlobalVar.ScanBarcodeSpeed); if (errCode == ErrorCode.Ok) { logInfo = GetClassName() + $"反向扫码,到扫码起始位"; @@ -204,7 +204,7 @@ namespace Rs.MotionPlat.Flow.SubFlow { targetPostion.X = endPoint.X + 50; targetPostion.X += GlobalVar.TurnoverTakePictureOffsetX; - errCode = AxisControl.LoadX.MovePos(targetPostion.X, GlobalVar.FlyCameraSpeed); + errCode = AxisControl.LoadX.MovePos(targetPostion.X, GlobalVar.ScanBarcodeSpeed); if (errCode == ErrorCode.Ok || GlobalVar.VirtualAxis) { logInfo = GetClassName() + $"正向扫码,到扫码结束位"; @@ -221,7 +221,7 @@ namespace Rs.MotionPlat.Flow.SubFlow else { targetPostion.X = endPoint.X - 50; - errCode = AxisControl.LoadX.MovePos(targetPostion.X, GlobalVar.FlyCameraSpeed); + errCode = AxisControl.LoadX.MovePos(targetPostion.X, GlobalVar.ScanBarcodeSpeed); if (errCode == ErrorCode.Ok) { diff --git a/Rs.SkyLine/SysConfig/CommonConfig.Designer.cs b/Rs.SkyLine/SysConfig/CommonConfig.Designer.cs index b2a6291..b97aad4 100644 --- a/Rs.SkyLine/SysConfig/CommonConfig.Designer.cs +++ b/Rs.SkyLine/SysConfig/CommonConfig.Designer.cs @@ -102,6 +102,9 @@ this.txtControlCenterIP = new System.Windows.Forms.TextBox(); this.label26 = new System.Windows.Forms.Label(); this.cboxInputTrayLoop = new System.Windows.Forms.CheckBox(); + this.label16 = new System.Windows.Forms.Label(); + this.lblScanBarcodeSpeed = new System.Windows.Forms.Label(); + this.tbarScanBarcodeSpeed = new System.Windows.Forms.TrackBar(); this.tableLayoutPanel1.SuspendLayout(); this.groupBox8.SuspendLayout(); this.groupBox3.SuspendLayout(); @@ -117,6 +120,7 @@ ((System.ComponentModel.ISupportInitialize)(this.tbarTakeTrayFromNg2InputSpeed)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tbarStockBeltSpeed)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tbarWholeSpeed)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.tbarScanBarcodeSpeed)).BeginInit(); this.SuspendLayout(); // // tableLayoutPanel1 @@ -422,12 +426,14 @@ this.groupBox1.Controls.Add(this.label4); this.groupBox1.Controls.Add(this.tbarPressLowSpeed); this.groupBox1.Controls.Add(this.tbarTakeTraySpeed); + this.groupBox1.Controls.Add(this.tbarScanBarcodeSpeed); this.groupBox1.Controls.Add(this.tbarFlyCameraSpeed); this.groupBox1.Controls.Add(this.tbarTakeTrayFromNg2InputSpeed); this.groupBox1.Controls.Add(this.tbarStockBeltSpeed); this.groupBox1.Controls.Add(this.tbarWholeSpeed); this.groupBox1.Controls.Add(this.lblPressLowSpeed); this.groupBox1.Controls.Add(this.lblTakeTraySpeed); + this.groupBox1.Controls.Add(this.lblScanBarcodeSpeed); this.groupBox1.Controls.Add(this.lblFlyCameraSpeed); this.groupBox1.Controls.Add(this.label20); this.groupBox1.Controls.Add(this.label5); @@ -436,6 +442,7 @@ this.groupBox1.Controls.Add(this.lblStockBeltSpeed); this.groupBox1.Controls.Add(this.lblWholeSpeed); this.groupBox1.Controls.Add(this.label11); + this.groupBox1.Controls.Add(this.label16); this.groupBox1.Controls.Add(this.label3); this.groupBox1.Controls.Add(this.label1); this.groupBox1.Controls.Add(this.txtControlCenterPort); @@ -740,7 +747,7 @@ // this.tbarPressLowSpeed.AutoSize = false; this.tbarPressLowSpeed.LargeChange = 1; - this.tbarPressLowSpeed.Location = new System.Drawing.Point(155, 122); + this.tbarPressLowSpeed.Location = new System.Drawing.Point(155, 117); this.tbarPressLowSpeed.Maximum = 100; this.tbarPressLowSpeed.Minimum = 1; this.tbarPressLowSpeed.Name = "tbarPressLowSpeed"; @@ -754,7 +761,7 @@ // this.tbarTakeTraySpeed.AutoSize = false; this.tbarTakeTraySpeed.LargeChange = 1; - this.tbarTakeTraySpeed.Location = new System.Drawing.Point(155, 90); + this.tbarTakeTraySpeed.Location = new System.Drawing.Point(155, 88); this.tbarTakeTraySpeed.Maximum = 100; this.tbarTakeTraySpeed.Minimum = 1; this.tbarTakeTraySpeed.Name = "tbarTakeTraySpeed"; @@ -768,7 +775,7 @@ // this.tbarFlyCameraSpeed.AutoSize = false; this.tbarFlyCameraSpeed.LargeChange = 1; - this.tbarFlyCameraSpeed.Location = new System.Drawing.Point(155, 59); + this.tbarFlyCameraSpeed.Location = new System.Drawing.Point(155, 38); this.tbarFlyCameraSpeed.Maximum = 100; this.tbarFlyCameraSpeed.Minimum = 1; this.tbarFlyCameraSpeed.Name = "tbarFlyCameraSpeed"; @@ -782,7 +789,7 @@ // this.tbarTakeTrayFromNg2InputSpeed.AutoSize = false; this.tbarTakeTrayFromNg2InputSpeed.LargeChange = 1; - this.tbarTakeTrayFromNg2InputSpeed.Location = new System.Drawing.Point(153, 190); + this.tbarTakeTrayFromNg2InputSpeed.Location = new System.Drawing.Point(153, 172); this.tbarTakeTrayFromNg2InputSpeed.Maximum = 100; this.tbarTakeTrayFromNg2InputSpeed.Minimum = 1; this.tbarTakeTrayFromNg2InputSpeed.Name = "tbarTakeTrayFromNg2InputSpeed"; @@ -796,7 +803,7 @@ // this.tbarStockBeltSpeed.AutoSize = false; this.tbarStockBeltSpeed.LargeChange = 1; - this.tbarStockBeltSpeed.Location = new System.Drawing.Point(153, 155); + this.tbarStockBeltSpeed.Location = new System.Drawing.Point(153, 144); this.tbarStockBeltSpeed.Maximum = 100; this.tbarStockBeltSpeed.Minimum = 1; this.tbarStockBeltSpeed.Name = "tbarStockBeltSpeed"; @@ -810,7 +817,7 @@ // this.tbarWholeSpeed.AutoSize = false; this.tbarWholeSpeed.LargeChange = 1; - this.tbarWholeSpeed.Location = new System.Drawing.Point(155, 28); + this.tbarWholeSpeed.Location = new System.Drawing.Point(155, 14); this.tbarWholeSpeed.Maximum = 100; this.tbarWholeSpeed.Minimum = 1; this.tbarWholeSpeed.Name = "tbarWholeSpeed"; @@ -823,7 +830,7 @@ // lblPressLowSpeed // this.lblPressLowSpeed.AutoSize = true; - this.lblPressLowSpeed.Location = new System.Drawing.Point(458, 125); + this.lblPressLowSpeed.Location = new System.Drawing.Point(458, 120); this.lblPressLowSpeed.Name = "lblPressLowSpeed"; this.lblPressLowSpeed.Size = new System.Drawing.Size(17, 12); this.lblPressLowSpeed.TabIndex = 0; @@ -832,7 +839,7 @@ // lblTakeTraySpeed // this.lblTakeTraySpeed.AutoSize = true; - this.lblTakeTraySpeed.Location = new System.Drawing.Point(458, 96); + this.lblTakeTraySpeed.Location = new System.Drawing.Point(458, 94); this.lblTakeTraySpeed.Name = "lblTakeTraySpeed"; this.lblTakeTraySpeed.Size = new System.Drawing.Size(17, 12); this.lblTakeTraySpeed.TabIndex = 0; @@ -841,7 +848,7 @@ // lblFlyCameraSpeed // this.lblFlyCameraSpeed.AutoSize = true; - this.lblFlyCameraSpeed.Location = new System.Drawing.Point(458, 64); + this.lblFlyCameraSpeed.Location = new System.Drawing.Point(458, 43); this.lblFlyCameraSpeed.Name = "lblFlyCameraSpeed"; this.lblFlyCameraSpeed.Size = new System.Drawing.Size(17, 12); this.lblFlyCameraSpeed.TabIndex = 0; @@ -850,7 +857,7 @@ // label20 // this.label20.AutoSize = true; - this.label20.Location = new System.Drawing.Point(74, 127); + this.label20.Location = new System.Drawing.Point(74, 122); this.label20.Name = "label20"; this.label20.Size = new System.Drawing.Size(59, 12); this.label20.TabIndex = 0; @@ -859,7 +866,7 @@ // label5 // this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(50, 94); + this.label5.Location = new System.Drawing.Point(50, 92); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(83, 12); this.label5.TabIndex = 0; @@ -868,7 +875,7 @@ // label15 // this.label15.AutoSize = true; - this.label15.Location = new System.Drawing.Point(26, 190); + this.label15.Location = new System.Drawing.Point(26, 172); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(107, 12); this.label15.TabIndex = 0; @@ -877,7 +884,7 @@ // lblTakeTrayFromNg2InputSpeed // this.lblTakeTrayFromNg2InputSpeed.AutoSize = true; - this.lblTakeTrayFromNg2InputSpeed.Location = new System.Drawing.Point(459, 194); + this.lblTakeTrayFromNg2InputSpeed.Location = new System.Drawing.Point(459, 176); this.lblTakeTrayFromNg2InputSpeed.Name = "lblTakeTrayFromNg2InputSpeed"; this.lblTakeTrayFromNg2InputSpeed.Size = new System.Drawing.Size(17, 12); this.lblTakeTrayFromNg2InputSpeed.TabIndex = 0; @@ -886,7 +893,7 @@ // lblStockBeltSpeed // this.lblStockBeltSpeed.AutoSize = true; - this.lblStockBeltSpeed.Location = new System.Drawing.Point(459, 157); + this.lblStockBeltSpeed.Location = new System.Drawing.Point(459, 146); this.lblStockBeltSpeed.Name = "lblStockBeltSpeed"; this.lblStockBeltSpeed.Size = new System.Drawing.Size(17, 12); this.lblStockBeltSpeed.TabIndex = 0; @@ -895,7 +902,7 @@ // lblWholeSpeed // this.lblWholeSpeed.AutoSize = true; - this.lblWholeSpeed.Location = new System.Drawing.Point(458, 32); + this.lblWholeSpeed.Location = new System.Drawing.Point(458, 18); this.lblWholeSpeed.Name = "lblWholeSpeed"; this.lblWholeSpeed.Size = new System.Drawing.Size(17, 12); this.lblWholeSpeed.TabIndex = 0; @@ -904,7 +911,7 @@ // label11 // this.label11.AutoSize = true; - this.label11.Location = new System.Drawing.Point(74, 159); + this.label11.Location = new System.Drawing.Point(74, 148); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(59, 12); this.label11.TabIndex = 0; @@ -913,7 +920,7 @@ // label3 // this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(74, 62); + this.label3.Location = new System.Drawing.Point(74, 41); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(59, 12); this.label3.TabIndex = 0; @@ -922,7 +929,7 @@ // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(74, 32); + this.label1.Location = new System.Drawing.Point(74, 18); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(59, 12); this.label1.TabIndex = 0; @@ -986,6 +993,38 @@ this.cboxInputTrayLoop.Text = "循环跑"; this.cboxInputTrayLoop.UseVisualStyleBackColor = true; // + // label16 + // + this.label16.AutoSize = true; + this.label16.Location = new System.Drawing.Point(74, 67); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(59, 12); + this.label16.TabIndex = 0; + this.label16.Text = "扫码速度:"; + // + // lblScanBarcodeSpeed + // + this.lblScanBarcodeSpeed.AutoSize = true; + this.lblScanBarcodeSpeed.Location = new System.Drawing.Point(458, 69); + this.lblScanBarcodeSpeed.Name = "lblScanBarcodeSpeed"; + this.lblScanBarcodeSpeed.Size = new System.Drawing.Size(17, 12); + this.lblScanBarcodeSpeed.TabIndex = 0; + this.lblScanBarcodeSpeed.Text = "5%"; + // + // tbarScanBarcodeSpeed + // + this.tbarScanBarcodeSpeed.AutoSize = false; + this.tbarScanBarcodeSpeed.LargeChange = 1; + this.tbarScanBarcodeSpeed.Location = new System.Drawing.Point(155, 64); + this.tbarScanBarcodeSpeed.Maximum = 100; + this.tbarScanBarcodeSpeed.Minimum = 1; + this.tbarScanBarcodeSpeed.Name = "tbarScanBarcodeSpeed"; + this.tbarScanBarcodeSpeed.Size = new System.Drawing.Size(300, 20); + this.tbarScanBarcodeSpeed.TabIndex = 1; + this.tbarScanBarcodeSpeed.TickStyle = System.Windows.Forms.TickStyle.None; + this.tbarScanBarcodeSpeed.Value = 1; + this.tbarScanBarcodeSpeed.ValueChanged += new System.EventHandler(this.tbarScanBarcodeSpeed_ValueChanged); + // // CommonConfig // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -1017,6 +1056,7 @@ ((System.ComponentModel.ISupportInitialize)(this.tbarTakeTrayFromNg2InputSpeed)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.tbarStockBeltSpeed)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.tbarWholeSpeed)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.tbarScanBarcodeSpeed)).EndInit(); this.ResumeLayout(false); } @@ -1097,5 +1137,8 @@ private System.Windows.Forms.Label label11; private System.Windows.Forms.TextBox txtQifuValue; private System.Windows.Forms.CheckBox cboxInputTrayLoop; + private System.Windows.Forms.TrackBar tbarScanBarcodeSpeed; + private System.Windows.Forms.Label lblScanBarcodeSpeed; + private System.Windows.Forms.Label label16; } } \ No newline at end of file diff --git a/Rs.SkyLine/SysConfig/CommonConfig.cs b/Rs.SkyLine/SysConfig/CommonConfig.cs index 2b8a139..4758084 100644 --- a/Rs.SkyLine/SysConfig/CommonConfig.cs +++ b/Rs.SkyLine/SysConfig/CommonConfig.cs @@ -192,5 +192,10 @@ namespace Rs.MotionPlat.SysConfig { lblTakeTrayFromNg2InputSpeed.Text = $"{tbarTakeTrayFromNg2InputSpeed.Value}%"; } + + private void tbarScanBarcodeSpeed_ValueChanged(object sender, EventArgs e) + { + lblScanBarcodeSpeed.Text = $"{tbarScanBarcodeSpeed.Value}%"; + } } }