步进电机 挡料地

This commit is contained in:
Admin
2025-04-22 18:03:12 +08:00
parent 74051a4287
commit 33e94b92f9
13 changed files with 1378 additions and 585 deletions

View File

@ -53,9 +53,19 @@
label5 = new AntdUI.Label();
sltDirection = new AntdUI.Select();
label4 = new AntdUI.Label();
panelMotor = new AntdUI.Panel();
btnSaveMotorPos = new AntdUI.Button();
iptMotorPos = new AntdUI.InputNumber();
label9 = new AntdUI.Label();
btnMotorZero = new AntdUI.Button();
btnMotorReverse = new AntdUI.Button();
btnMotorForward = new AntdUI.Button();
iptMotorSpeed = new AntdUI.InputNumber();
label8 = new AntdUI.Label();
imageViewerControl1 = new ImageViewerControl();
panel1.SuspendLayout();
panel2.SuspendLayout();
panelMotor.SuspendLayout();
SuspendLayout();
//
// titlebar
@ -67,11 +77,12 @@
titlebar.Font = new Font("Microsoft YaHei UI", 12F, FontStyle.Regular, GraphicsUnit.Point, 134);
titlebar.ForeColor = Color.White;
titlebar.Location = new Point(0, 0);
titlebar.Margin = new Padding(4, 4, 4, 4);
titlebar.Mode = AntdUI.TAMode.Dark;
titlebar.Name = "titlebar";
titlebar.ShowButton = true;
titlebar.ShowIcon = true;
titlebar.Size = new Size(1210, 37);
titlebar.Size = new Size(1551, 44);
titlebar.SubText = "视觉定位系统";
titlebar.TabIndex = 1;
titlebar.Text = "山东迭慧智能科技有限公司";
@ -89,35 +100,39 @@
panel1.Controls.Add(sltCameraName);
panel1.Controls.Add(label1);
panel1.Dock = DockStyle.Top;
panel1.Location = new Point(0, 37);
panel1.Location = new Point(0, 44);
panel1.Margin = new Padding(4, 4, 4, 4);
panel1.Name = "panel1";
panel1.Size = new Size(1210, 56);
panel1.Size = new Size(1551, 66);
panel1.TabIndex = 2;
panel1.Text = "panel1";
//
// iptThreshold
//
iptThreshold.Location = new Point(1094, 6);
iptThreshold.Location = new Point(1407, 7);
iptThreshold.Margin = new Padding(4, 4, 4, 4);
iptThreshold.Name = "iptThreshold";
iptThreshold.Size = new Size(107, 43);
iptThreshold.Size = new Size(138, 51);
iptThreshold.TabIndex = 15;
iptThreshold.Text = "0";
//
// label6
//
label6.BackColor = SystemColors.Window;
label6.Location = new Point(1044, 18);
label6.Location = new Point(1342, 21);
label6.Margin = new Padding(4, 4, 4, 4);
label6.Name = "label6";
label6.Size = new Size(57, 23);
label6.Size = new Size(73, 27);
label6.TabIndex = 14;
label6.Text = "定位阈值";
//
// btnSelectBackImg
//
btnSelectBackImg.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
btnSelectBackImg.Location = new Point(963, 11);
btnSelectBackImg.Location = new Point(1238, 13);
btnSelectBackImg.Margin = new Padding(4, 4, 4, 4);
btnSelectBackImg.Name = "btnSelectBackImg";
btnSelectBackImg.Size = new Size(75, 38);
btnSelectBackImg.Size = new Size(96, 45);
btnSelectBackImg.TabIndex = 13;
btnSelectBackImg.Text = "打开";
btnSelectBackImg.Type = AntdUI.TTypeMini.Primary;
@ -125,63 +140,70 @@
// btnSelectModel
//
btnSelectModel.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
btnSelectModel.Location = new Point(525, 9);
btnSelectModel.Location = new Point(675, 11);
btnSelectModel.Margin = new Padding(4, 4, 4, 4);
btnSelectModel.Name = "btnSelectModel";
btnSelectModel.Size = new Size(75, 38);
btnSelectModel.Size = new Size(96, 45);
btnSelectModel.TabIndex = 12;
btnSelectModel.Text = "打开";
btnSelectModel.Type = AntdUI.TTypeMini.Primary;
//
// iptBackImg
//
iptBackImg.Location = new Point(694, 6);
iptBackImg.Location = new Point(892, 7);
iptBackImg.Margin = new Padding(4, 4, 4, 4);
iptBackImg.Name = "iptBackImg";
iptBackImg.PlaceholderText = "请选择背景图片";
iptBackImg.Size = new Size(263, 43);
iptBackImg.Size = new Size(338, 51);
iptBackImg.TabIndex = 10;
//
// label3
//
label3.BackColor = SystemColors.Window;
label3.Location = new Point(606, 18);
label3.Location = new Point(779, 21);
label3.Margin = new Padding(4, 4, 4, 4);
label3.Name = "label3";
label3.Size = new Size(82, 23);
label3.Size = new Size(105, 27);
label3.TabIndex = 9;
label3.Text = "背景图片路径";
//
// iptModel
//
iptModel.Location = new Point(256, 6);
iptModel.Location = new Point(329, 7);
iptModel.Margin = new Padding(4, 4, 4, 4);
iptModel.Name = "iptModel";
iptModel.PlaceholderText = "请选择算法";
iptModel.Size = new Size(263, 43);
iptModel.Size = new Size(338, 51);
iptModel.TabIndex = 3;
//
// label2
//
label2.BackColor = SystemColors.Window;
label2.Location = new Point(193, 18);
label2.Location = new Point(248, 21);
label2.Margin = new Padding(4, 4, 4, 4);
label2.Name = "label2";
label2.Size = new Size(57, 23);
label2.Size = new Size(73, 27);
label2.TabIndex = 2;
label2.Text = "算法路径";
//
// sltCameraName
//
sltCameraName.List = true;
sltCameraName.Location = new Point(72, 7);
sltCameraName.Location = new Point(93, 8);
sltCameraName.Margin = new Padding(4, 4, 4, 4);
sltCameraName.MaxCount = 10;
sltCameraName.Name = "sltCameraName";
sltCameraName.PlaceholderText = "请选择相机";
sltCameraName.Size = new Size(115, 43);
sltCameraName.Size = new Size(148, 51);
sltCameraName.TabIndex = 1;
//
// label1
//
label1.BackColor = SystemColors.Window;
label1.Location = new Point(9, 18);
label1.Location = new Point(12, 21);
label1.Margin = new Padding(4, 4, 4, 4);
label1.Name = "label1";
label1.Size = new Size(57, 23);
label1.Size = new Size(73, 27);
label1.TabIndex = 0;
label1.Text = "相机名称";
//
@ -200,35 +222,39 @@
panel2.Controls.Add(sltDirection);
panel2.Controls.Add(label4);
panel2.Dock = DockStyle.Top;
panel2.Location = new Point(0, 93);
panel2.Location = new Point(0, 110);
panel2.Margin = new Padding(4, 4, 4, 4);
panel2.Name = "panel2";
panel2.Size = new Size(1210, 56);
panel2.Size = new Size(1551, 66);
panel2.TabIndex = 3;
panel2.Text = "panel2";
//
// iptSpeed
//
iptSpeed.Location = new Point(256, 6);
iptSpeed.Location = new Point(329, 7);
iptSpeed.Margin = new Padding(4, 4, 4, 4);
iptSpeed.Name = "iptSpeed";
iptSpeed.Size = new Size(107, 43);
iptSpeed.Size = new Size(138, 51);
iptSpeed.TabIndex = 20;
iptSpeed.Text = "0";
//
// label7
//
label7.BackColor = SystemColors.Window;
label7.Location = new Point(193, 18);
label7.Location = new Point(248, 21);
label7.Margin = new Padding(4, 4, 4, 4);
label7.Name = "label7";
label7.Size = new Size(57, 23);
label7.Size = new Size(73, 27);
label7.TabIndex = 19;
label7.Text = "转盘速度";
//
// btnSaveImg
//
btnSaveImg.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
btnSaveImg.Location = new Point(1126, 11);
btnSaveImg.Location = new Point(1448, 13);
btnSaveImg.Margin = new Padding(4, 4, 4, 4);
btnSaveImg.Name = "btnSaveImg";
btnSaveImg.Size = new Size(75, 38);
btnSaveImg.Size = new Size(96, 45);
btnSaveImg.TabIndex = 18;
btnSaveImg.Text = "保存图像";
btnSaveImg.Type = AntdUI.TTypeMini.Primary;
@ -236,9 +262,10 @@
// btnSavePos
//
btnSavePos.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
btnSavePos.Location = new Point(1013, 11);
btnSavePos.Location = new Point(1302, 13);
btnSavePos.Margin = new Padding(4, 4, 4, 4);
btnSavePos.Name = "btnSavePos";
btnSavePos.Size = new Size(75, 38);
btnSavePos.Size = new Size(96, 45);
btnSavePos.TabIndex = 17;
btnSavePos.Text = "保存定位";
btnSavePos.Type = AntdUI.TTypeMini.Primary;
@ -246,9 +273,10 @@
// btnReverse
//
btnReverse.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
btnReverse.Location = new Point(904, 11);
btnReverse.Location = new Point(1162, 13);
btnReverse.Margin = new Padding(4, 4, 4, 4);
btnReverse.Name = "btnReverse";
btnReverse.Size = new Size(75, 38);
btnReverse.Size = new Size(96, 45);
btnReverse.TabIndex = 16;
btnReverse.Text = "转盘反转";
btnReverse.Type = AntdUI.TTypeMini.Primary;
@ -256,9 +284,10 @@
// btnForward
//
btnForward.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
btnForward.Location = new Point(804, 11);
btnForward.Location = new Point(1034, 13);
btnForward.Margin = new Padding(4, 4, 4, 4);
btnForward.Name = "btnForward";
btnForward.Size = new Size(75, 38);
btnForward.Size = new Size(96, 45);
btnForward.TabIndex = 15;
btnForward.Text = "转盘正转";
btnForward.Type = AntdUI.TTypeMini.Primary;
@ -266,9 +295,10 @@
// btnLocalization
//
btnLocalization.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
btnLocalization.Location = new Point(704, 11);
btnLocalization.Location = new Point(905, 13);
btnLocalization.Margin = new Padding(4, 4, 4, 4);
btnLocalization.Name = "btnLocalization";
btnLocalization.Size = new Size(75, 38);
btnLocalization.Size = new Size(96, 45);
btnLocalization.TabIndex = 14;
btnLocalization.Text = "开始定位";
btnLocalization.Type = AntdUI.TTypeMini.Primary;
@ -276,28 +306,31 @@
// btnAcquisition
//
btnAcquisition.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
btnAcquisition.Location = new Point(606, 11);
btnAcquisition.Location = new Point(779, 13);
btnAcquisition.Margin = new Padding(4, 4, 4, 4);
btnAcquisition.Name = "btnAcquisition";
btnAcquisition.Size = new Size(75, 38);
btnAcquisition.Size = new Size(96, 45);
btnAcquisition.TabIndex = 13;
btnAcquisition.Text = "开始采集";
btnAcquisition.Type = AntdUI.TTypeMini.Primary;
//
// iptPosition
//
iptPosition.Location = new Point(425, 6);
iptPosition.Location = new Point(546, 7);
iptPosition.Margin = new Padding(4, 4, 4, 4);
iptPosition.Name = "iptPosition";
iptPosition.ReadOnly = true;
iptPosition.Size = new Size(175, 43);
iptPosition.Size = new Size(225, 51);
iptPosition.TabIndex = 7;
iptPosition.Text = "0";
//
// label5
//
label5.BackColor = SystemColors.Window;
label5.Location = new Point(369, 18);
label5.Location = new Point(474, 21);
label5.Margin = new Padding(4, 4, 4, 4);
label5.Name = "label5";
label5.Size = new Size(59, 23);
label5.Size = new Size(76, 27);
label5.TabIndex = 6;
label5.Text = "当前位置";
//
@ -305,45 +338,152 @@
//
sltDirection.Items.AddRange(new object[] { "正方向", "反方向" });
sltDirection.List = true;
sltDirection.Location = new Point(72, 6);
sltDirection.Location = new Point(93, 7);
sltDirection.Margin = new Padding(4, 4, 4, 4);
sltDirection.MaxCount = 10;
sltDirection.Name = "sltDirection";
sltDirection.PlaceholderText = "请选择方向";
sltDirection.Size = new Size(115, 43);
sltDirection.Size = new Size(148, 51);
sltDirection.TabIndex = 5;
//
// label4
//
label4.BackColor = SystemColors.Window;
label4.Location = new Point(9, 18);
label4.Location = new Point(12, 21);
label4.Margin = new Padding(4, 4, 4, 4);
label4.Name = "label4";
label4.Size = new Size(57, 23);
label4.Size = new Size(73, 27);
label4.TabIndex = 4;
label4.Text = "转盘方向";
//
// panelMotor
//
panelMotor.Controls.Add(btnSaveMotorPos);
panelMotor.Controls.Add(iptMotorPos);
panelMotor.Controls.Add(label9);
panelMotor.Controls.Add(btnMotorZero);
panelMotor.Controls.Add(btnMotorReverse);
panelMotor.Controls.Add(btnMotorForward);
panelMotor.Controls.Add(iptMotorSpeed);
panelMotor.Controls.Add(label8);
panelMotor.Dock = DockStyle.Top;
panelMotor.Location = new Point(0, 176);
panelMotor.Margin = new Padding(4, 4, 4, 4);
panelMotor.Name = "panelMotor";
panelMotor.Size = new Size(1551, 54);
panelMotor.TabIndex = 4;
panelMotor.Text = "panel3";
//
// btnSaveMotorPos
//
btnSaveMotorPos.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
btnSaveMotorPos.Location = new Point(966, 6);
btnSaveMotorPos.Margin = new Padding(4, 4, 4, 4);
btnSaveMotorPos.Name = "btnSaveMotorPos";
btnSaveMotorPos.Size = new Size(111, 45);
btnSaveMotorPos.TabIndex = 21;
btnSaveMotorPos.Text = "保存电机位置";
btnSaveMotorPos.Type = AntdUI.TTypeMini.Primary;
//
// iptMotorPos
//
iptMotorPos.Location = new Point(365, 0);
iptMotorPos.Margin = new Padding(4, 4, 4, 4);
iptMotorPos.Name = "iptMotorPos";
iptMotorPos.ReadOnly = true;
iptMotorPos.Size = new Size(225, 51);
iptMotorPos.TabIndex = 20;
iptMotorPos.Text = "0";
//
// label9
//
label9.BackColor = SystemColors.Window;
label9.Location = new Point(261, 12);
label9.Margin = new Padding(4, 4, 4, 4);
label9.Name = "label9";
label9.Size = new Size(104, 27);
label9.TabIndex = 19;
label9.Text = "变焦电机位置";
//
// btnMotorZero
//
btnMotorZero.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
btnMotorZero.Location = new Point(598, 6);
btnMotorZero.Margin = new Padding(4, 4, 4, 4);
btnMotorZero.Name = "btnMotorZero";
btnMotorZero.Size = new Size(96, 45);
btnMotorZero.TabIndex = 18;
btnMotorZero.Text = "电机回原点";
btnMotorZero.Type = AntdUI.TTypeMini.Primary;
//
// btnMotorReverse
//
btnMotorReverse.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
btnMotorReverse.Location = new Point(847, 6);
btnMotorReverse.Margin = new Padding(4, 4, 4, 4);
btnMotorReverse.Name = "btnMotorReverse";
btnMotorReverse.Size = new Size(96, 45);
btnMotorReverse.TabIndex = 17;
btnMotorReverse.Text = "电机反转";
btnMotorReverse.Type = AntdUI.TTypeMini.Primary;
//
// btnMotorForward
//
btnMotorForward.Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 134);
btnMotorForward.Location = new Point(724, 6);
btnMotorForward.Margin = new Padding(4, 4, 4, 4);
btnMotorForward.Name = "btnMotorForward";
btnMotorForward.Size = new Size(96, 45);
btnMotorForward.TabIndex = 16;
btnMotorForward.Text = "电机正转";
btnMotorForward.Type = AntdUI.TTypeMini.Primary;
//
// iptMotorSpeed
//
iptMotorSpeed.Location = new Point(116, 0);
iptMotorSpeed.Margin = new Padding(4, 4, 4, 4);
iptMotorSpeed.Name = "iptMotorSpeed";
iptMotorSpeed.Size = new Size(138, 51);
iptMotorSpeed.TabIndex = 8;
iptMotorSpeed.Text = "0";
//
// label8
//
label8.BackColor = SystemColors.Window;
label8.Location = new Point(12, 12);
label8.Margin = new Padding(4, 4, 4, 4);
label8.Name = "label8";
label8.Size = new Size(104, 27);
label8.TabIndex = 1;
label8.Text = "变焦电机速度";
//
// imageViewerControl1
//
imageViewerControl1.Dock = DockStyle.Fill;
imageViewerControl1.Image = null;
imageViewerControl1.Location = new Point(0, 149);
imageViewerControl1.Location = new Point(0, 230);
imageViewerControl1.Margin = new Padding(4, 4, 4, 4);
imageViewerControl1.Name = "imageViewerControl1";
imageViewerControl1.Size = new Size(1210, 558);
imageViewerControl1.TabIndex = 4;
imageViewerControl1.Size = new Size(1551, 593);
imageViewerControl1.TabIndex = 5;
//
// VisualLocalizationWindow
//
AutoScaleDimensions = new SizeF(7F, 17F);
AutoScaleDimensions = new SizeF(9F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(1210, 707);
ClientSize = new Size(1551, 823);
Controls.Add(imageViewerControl1);
Controls.Add(panelMotor);
Controls.Add(panel2);
Controls.Add(panel1);
Controls.Add(titlebar);
Margin = new Padding(4, 4, 4, 4);
Name = "VisualLocalizationWindow";
Text = "CCD光学筛选定位系统";
WindowState = FormWindowState.Maximized;
panel1.ResumeLayout(false);
panel2.ResumeLayout(false);
panelMotor.ResumeLayout(false);
ResumeLayout(false);
}
@ -370,10 +510,19 @@
private AntdUI.Button btnForward;
private AntdUI.Button btnSaveImg;
private AntdUI.Button btnSavePos;
private ImageViewerControl imageViewerControl1;
private AntdUI.InputNumber iptThreshold;
private AntdUI.Label label6;
private AntdUI.InputNumber iptSpeed;
private AntdUI.Label label7;
private AntdUI.Panel panelMotor;
private AntdUI.InputNumber iptMotorSpeed;
private AntdUI.Label label8;
private ImageViewerControl imageViewerControl1;
private AntdUI.Button btnMotorReverse;
private AntdUI.Button btnMotorForward;
private AntdUI.InputNumber iptMotorPos;
private AntdUI.Label label9;
private AntdUI.Button btnMotorZero;
private AntdUI.Button btnSaveMotorPos;
}
}