修改一些变量和界面

This commit is contained in:
xhm\HP 2025-03-21 16:29:08 +08:00
parent 9a5d3be528
commit f0f88624ae
10 changed files with 102 additions and 114 deletions

View File

@ -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;

View File

@ -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));
}
}

View File

@ -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;
}
}

View File

@ -48,6 +48,8 @@ namespace AntdUIDemo.Views.Table
user.LabelDescription = input_name.Text;
user.ScoreMinValue =(double)input_minScore.Value;
user.ScoreMaxValue = (double)input_maxScore.Value;
user.AreaMinValue = (double)input_minArea.Value;
user.AreaMaxValue = (double)input_maxArea.Value;
submit = true;
this.Dispose();
}
@ -58,8 +60,8 @@ namespace AntdUIDemo.Views.Table
// input_addr.Text = user.Address;
input_minScore.Value =(decimal) user.ScoreMinValue;
input_maxScore.Value =(decimal) user.ScoreMaxValue;
input_minArea.Value =(decimal) user.ScoreMaxValue;
input_maxScore.Value =(decimal) user.ScoreMaxValue;
input_minArea.Value =(decimal) user.AreaMinValue;
input_maxArea.Value =(decimal) user.AreaMaxValue;
}
}
}

View File

@ -74,7 +74,7 @@ namespace DHSoftware.Views
{
InitializeComponent();
InitTableColumns();
InitData();
//InitData();
BindEventHandler();
foreach (var item in MLModelTypes)
{
@ -85,63 +85,6 @@ namespace DHSoftware.Views
}
public bool IsEnabled
{
get => switchEnable.AutoCheck;
set => switchEnable.AutoCheck = value;
}
// 模型路径属性
public string ModelPath
{
get => Detection.ModelPath;
set
{
Detection.ModelPath = value;
tbModelpath.Text = value; // 更新到文本框
}
}
public bool IsPicNGEnable
{
get => sthSaveNGPic.AutoCheck;
set => sthSaveNGPic.AutoCheck = value;
}
public bool IsPicEnable
{
get => sthPic.AutoCheck;
set => sthPic.AutoCheck = value;
}
//public MLModelType LModelType
//{
//}
private string _picTag;
public string picTag
{
get => _picTag;
set
{
_picTag = value;
}
}
private string _afterTag;
public string afterTag
{
get => _afterTag;
set
{
_afterTag = value;
}
}
private void InitTableColumns()
{
table_base.Columns = new ColumnCollection() {

View File

@ -95,7 +95,6 @@
tabs1.Pages.Add(tabPage1);
tabs1.Pages.Add(tabPage2);
tabs1.Pages.Add(tabPage3);
tabs1.SelectedIndex = 2;
tabs1.Size = new Size(915, 609);
tabs1.Style = styleLine1;
tabs1.TabIndex = 1;
@ -116,7 +115,7 @@
tabPage1.Controls.Add(label2);
tabPage1.Controls.Add(iptPrePath);
tabPage1.Controls.Add(label1);
tabPage1.Location = new Point(-909, -575);
tabPage1.Location = new Point(3, 31);
tabPage1.Name = "tabPage1";
tabPage1.Size = new Size(909, 575);
tabPage1.TabIndex = 0;
@ -550,7 +549,7 @@
// tabPage3
//
tabPage3.Controls.Add(tabPage4);
tabPage3.Location = new Point(3, 31);
tabPage3.Location = new Point(-909, -575);
tabPage3.Name = "tabPage3";
tabPage3.Size = new Size(909, 575);
tabPage3.TabIndex = 3;

View File

@ -603,9 +603,9 @@ namespace DHSoftware.Views
lableTable.Columns = new ColumnCollection() {
new ColumnCheck("Selected"){Fixed = true},
new Column("LabelName", "名称", ColumnAlign.Center),
new Column("MinSource", "最小得分",ColumnAlign.Center),
new Column("MaxArea", "最大得分", ColumnAlign.Center),
new Column("MinSource", "最小面积",ColumnAlign.Center),
new Column("MinScore", "最小得分",ColumnAlign.Center),
new Column("MaxScore", "最大得分", ColumnAlign.Center),
new Column("MinArea", "最小面积",ColumnAlign.Center),
new Column("MaxArea", "最大面积", ColumnAlign.Center),
new Column("ResultState", "结果", ColumnAlign.Center),
new Column("CellLinks", "操作", ColumnAlign.Center)

View File

@ -49,8 +49,8 @@ namespace DHSoftware.Views
return;
}
detectionLable.LabelName = iptName.Text;
detectionLable.MinSource=Convert.ToDouble(iptMinSource.Text);
detectionLable.MaxSource = Convert.ToDouble(iptMaxSource.Text);
detectionLable.MinScore=Convert.ToDouble(iptMinSource.Text);
detectionLable.MaxScore = Convert.ToDouble(iptMaxSource.Text);
detectionLable.MinArea = Convert.ToDouble(iptMinArea.Text);
detectionLable.MaxArea = Convert.ToDouble(iptMaxArea.Text);
ResultState state = EnumHelper.GetEnumFromDescription<ResultState>(sltResultState.Text);
@ -84,8 +84,8 @@ namespace DHSoftware.Views
else
{
iptName.Text = detectionLable.LabelName;
iptMinSource.Text = detectionLable.MinSource.ToString();
iptMaxSource.Text = detectionLable.MaxSource.ToString();
iptMinSource.Text = detectionLable.MinScore.ToString();
iptMaxSource.Text = detectionLable.MaxScore.ToString();
iptMinArea.Text = detectionLable.MinArea.ToString();
iptMaxArea.Text = detectionLable.MaxArea.ToString();
sltResultState.Text= EnumHelper.GetEnumDescription(detectionLable.ResultState);