From f0f88624ae7708dfd1ab2ef0d707b842c02446e8 Mon Sep 17 00:00:00 2001 From: "xhm\\HP" <1173131411@qq.com> Date: Fri, 21 Mar 2025 16:29:08 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E5=92=8C=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DH.Commons/Base/CameraBase.cs | 6 +- DH.Commons/Base/DetectionConfig.cs | 24 +++--- DHSoftware/Views/CameraControl.Designer.cs | 94 ++++++++++++++++------ DHSoftware/Views/CameraControl.resx | 4 +- DHSoftware/Views/DefectRowEdit.cs | 6 +- DHSoftware/Views/DetectConfigControl.cs | 59 +------------- DHSoftware/Views/DetectControl.Designer.cs | 5 +- DHSoftware/Views/DetectControl.cs | 6 +- DHSoftware/Views/DetectControl.resx | 4 +- DHSoftware/Views/DetectionLableEdit.cs | 8 +- 10 files changed, 102 insertions(+), 114 deletions(-) diff --git a/DH.Commons/Base/CameraBase.cs b/DH.Commons/Base/CameraBase.cs index ee9ac95..c46eb10 100644 --- a/DH.Commons/Base/CameraBase.cs +++ b/DH.Commons/Base/CameraBase.cs @@ -20,14 +20,14 @@ namespace DH.Commons.Base private string _cameraIP = string.Empty; private string _computerIP = string.Empty; private bool _isDirectHardwareTrigger = false; - private float _gain = -1; + private float _gain =6; private float _rotateImage = 0; private float _exposure = 200; private float _triggerDelay = 0; private decimal _roiX = 0; private decimal _roiY = 0; - private decimal _roiW = 0; - private decimal _roiH = 0; + private decimal _roiW = 2448; + private decimal _roiH = 2048; private int _lineDebouncerTime = 0; public volatile int SnapshotCount = 0; diff --git a/DH.Commons/Base/DetectionConfig.cs b/DH.Commons/Base/DetectionConfig.cs index eef9d99..60f89a9 100644 --- a/DH.Commons/Base/DetectionConfig.cs +++ b/DH.Commons/Base/DetectionConfig.cs @@ -932,8 +932,8 @@ namespace DH.Commons.Base private bool _selected = false; private string _labelId; private string _labelName; - private double _maxSource; - private double _minSource; + private double _maxScore; + private double _minScore; private double _maxArea; private double _minArea; private ResultState _resultState = ResultState.ResultTBD; @@ -976,25 +976,25 @@ namespace DH.Commons.Base } } - public double MaxSource + public double MaxScore { - get { return _maxSource; } + get { return _maxScore; } set { - if (_maxSource.Equals(value)) return; - _maxSource = value; - OnPropertyChanged(nameof(MaxSource)); + if (_maxScore.Equals(value)) return; + _maxScore = value; + OnPropertyChanged(nameof(MaxScore)); } } - public double MinSource + public double MinScore { - get { return _minSource; } + get { return _minScore; } set { - if (_minSource.Equals(value)) return; - _minSource = value; - OnPropertyChanged(nameof(MinSource)); + if (_minScore.Equals(value)) return; + _minScore = value; + OnPropertyChanged(nameof(MinScore)); } } diff --git a/DHSoftware/Views/CameraControl.Designer.cs b/DHSoftware/Views/CameraControl.Designer.cs index 086b611..1cfa034 100644 --- a/DHSoftware/Views/CameraControl.Designer.cs +++ b/DHSoftware/Views/CameraControl.Designer.cs @@ -52,15 +52,19 @@ button3 = new AntdUI.Button(); sthPic = new AntdUI.Switch(); label6 = new AntdUI.Label(); + label8 = new AntdUI.Label(); + label9 = new AntdUI.Label(); + label10 = new AntdUI.Label(); + label11 = new AntdUI.Label(); ((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit(); SuspendLayout(); // // swhEnable // swhEnable.CheckedText = "启用"; - swhEnable.Location = new Point(84, 13); + swhEnable.Location = new Point(93, 13); swhEnable.Name = "swhEnable"; - swhEnable.Size = new Size(93, 33); + swhEnable.Size = new Size(94, 33); swhEnable.TabIndex = 13; swhEnable.UnCheckedText = "关闭"; // @@ -98,26 +102,26 @@ // // iptExposure // - iptExposure.Location = new Point(84, 100); + iptExposure.Location = new Point(93, 100); iptExposure.Name = "iptExposure"; - iptExposure.Size = new Size(93, 37); + iptExposure.Size = new Size(94, 37); iptExposure.TabIndex = 17; iptExposure.Tag = ""; iptExposure.Text = "0"; // // iptGain // - iptGain.Location = new Point(84, 143); + iptGain.Location = new Point(93, 143); iptGain.Name = "iptGain"; - iptGain.Size = new Size(93, 37); + iptGain.Size = new Size(94, 37); iptGain.TabIndex = 18; iptGain.Text = "0"; // // iptRevolve // - iptRevolve.Location = new Point(84, 186); + iptRevolve.Location = new Point(93, 186); iptRevolve.Name = "iptRevolve"; - iptRevolve.Size = new Size(93, 37); + iptRevolve.Size = new Size(94, 37); iptRevolve.TabIndex = 19; iptRevolve.Text = "0"; // @@ -132,9 +136,9 @@ // sltAcquisitionMode // sltAcquisitionMode.List = true; - sltAcquisitionMode.Location = new Point(84, 229); + sltAcquisitionMode.Location = new Point(93, 229); sltAcquisitionMode.Name = "sltAcquisitionMode"; - sltAcquisitionMode.Size = new Size(93, 36); + sltAcquisitionMode.Size = new Size(94, 36); sltAcquisitionMode.TabIndex = 21; // // label5 @@ -148,49 +152,49 @@ // sltTriggerMode // sltTriggerMode.List = true; - sltTriggerMode.Location = new Point(84, 274); + sltTriggerMode.Location = new Point(93, 274); sltTriggerMode.Name = "sltTriggerMode"; - sltTriggerMode.Size = new Size(93, 36); + sltTriggerMode.Size = new Size(94, 36); sltTriggerMode.TabIndex = 26; // // label7 // - label7.Location = new Point(28, 397); + label7.Location = new Point(19, 396); label7.Name = "label7"; - label7.Size = new Size(59, 23); + label7.Size = new Size(29, 23); label7.TabIndex = 28; - label7.Text = "ROI范围"; + label7.Text = "ROI"; // // iptROIW // - iptROIW.Location = new Point(84, 414); + iptROIW.Location = new Point(93, 414); iptROIW.Name = "iptROIW"; - iptROIW.Size = new Size(93, 37); + iptROIW.Size = new Size(94, 37); iptROIW.TabIndex = 31; iptROIW.Text = "0"; // // iptROIY // - iptROIY.Location = new Point(84, 371); + iptROIY.Location = new Point(93, 371); iptROIY.Name = "iptROIY"; - iptROIY.Size = new Size(93, 37); + iptROIY.Size = new Size(94, 37); iptROIY.TabIndex = 30; iptROIY.Text = "0"; // // iptROIX // - iptROIX.Location = new Point(84, 328); + iptROIX.Location = new Point(93, 328); iptROIX.Name = "iptROIX"; - iptROIX.Size = new Size(93, 37); + iptROIX.Size = new Size(94, 37); iptROIX.TabIndex = 29; iptROIX.Tag = ""; iptROIX.Text = "0"; // // iptROIH // - iptROIH.Location = new Point(84, 457); + iptROIH.Location = new Point(93, 457); iptROIH.Name = "iptROIH"; - iptROIH.Size = new Size(93, 37); + iptROIH.Size = new Size(94, 37); iptROIH.TabIndex = 32; iptROIH.Text = "0"; // @@ -258,9 +262,9 @@ // sthPic // sthPic.CheckedText = "启用"; - sthPic.Location = new Point(84, 60); + sthPic.Location = new Point(93, 60); sthPic.Name = "sthPic"; - sthPic.Size = new Size(93, 33); + sthPic.Size = new Size(94, 33); sthPic.TabIndex = 39; sthPic.UnCheckedText = "关闭"; // @@ -272,10 +276,46 @@ label6.TabIndex = 38; label6.Text = "相 机 图"; // + // label8 + // + label8.Location = new Point(58, 328); + label8.Name = "label8"; + label8.Size = new Size(29, 37); + label8.TabIndex = 40; + label8.Text = "X:"; + // + // label9 + // + label9.Location = new Point(58, 371); + label9.Name = "label9"; + label9.Size = new Size(29, 37); + label9.TabIndex = 41; + label9.Text = "Y:"; + // + // label10 + // + label10.Location = new Point(43, 414); + label10.Name = "label10"; + label10.Size = new Size(44, 37); + label10.TabIndex = 42; + label10.Text = "宽度:"; + // + // label11 + // + label11.Location = new Point(43, 458); + label11.Name = "label11"; + label11.Size = new Size(44, 36); + label11.TabIndex = 43; + label11.Text = "高度:"; + // // CameraControl // AutoScaleDimensions = new SizeF(7F, 17F); AutoScaleMode = AutoScaleMode.Font; + Controls.Add(label11); + Controls.Add(label10); + Controls.Add(label9); + Controls.Add(label8); Controls.Add(sthPic); Controls.Add(label6); Controls.Add(button3); @@ -332,5 +372,9 @@ private AntdUI.Button button3; private AntdUI.Switch sthPic; private AntdUI.Label label6; + private AntdUI.Label label8; + private AntdUI.Label label9; + private AntdUI.Label label10; + private AntdUI.Label label11; } } diff --git a/DHSoftware/Views/CameraControl.resx b/DHSoftware/Views/CameraControl.resx index 8b2ff64..af32865 100644 --- a/DHSoftware/Views/CameraControl.resx +++ b/DHSoftware/Views/CameraControl.resx @@ -1,7 +1,7 @@