mirror of
https://github.com/eggplantlwj/VisionEdit.git
synced 2026-04-13 06:46:35 +08:00
1、所有工具参数以Job分隔进行保存到本地
2、PMA工具修改
This commit is contained in:
Binary file not shown.
@@ -29,7 +29,8 @@ namespace CommonMethods
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 工具窗体,由于无法对Form进行序列化,所以作为静态变量
|
/// 工具窗体,由于无法对Form进行序列化,所以作为静态变量
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static Form FormTool { get; set; }
|
[NonSerialized]
|
||||||
|
public Form FormTool = new Form();
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 工具窗体名
|
/// 工具窗体名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -54,11 +55,16 @@ namespace CommonMethods
|
|||||||
/// 工具运行结果
|
/// 工具运行结果
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ToolRunStatu toolRunStatu { get; set; }
|
public ToolRunStatu toolRunStatu { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 绑定的JOB名称
|
||||||
|
/// </summary>
|
||||||
|
public string bingingJobName { get; set; }
|
||||||
public IToolInfo()
|
public IToolInfo()
|
||||||
{
|
{
|
||||||
enable = true;
|
enable = true;
|
||||||
toolType = ToolType.None;
|
toolType = ToolType.None;
|
||||||
toolName = string.Empty;
|
toolName = string.Empty;
|
||||||
|
bingingJobName = string.Empty;
|
||||||
tool = new object();
|
tool = new object();
|
||||||
toolInput = new List<ToolIO>();
|
toolInput = new List<ToolIO>();
|
||||||
toolOutput = new List<ToolIO>();
|
toolOutput = new List<ToolIO>();
|
||||||
|
|||||||
14
DataStruct/ConfigData.cs
Normal file
14
DataStruct/ConfigData.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace DataStruct
|
||||||
|
{
|
||||||
|
[Serializable]
|
||||||
|
public class ConfigData
|
||||||
|
{
|
||||||
|
public static string ConfigPath { get; set; } = @"D:\VisionSystem\";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -44,6 +44,7 @@
|
|||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="ConfigData.cs" />
|
||||||
<Compile Include="DataStruct.cs" />
|
<Compile Include="DataStruct.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -87,8 +87,14 @@ namespace FindLineTool
|
|||||||
chBDispRec.Checked = myFindLine.dispRec;
|
chBDispRec.Checked = myFindLine.dispRec;
|
||||||
chBDispCross.Checked = myFindLine.dispCross;
|
chBDispCross.Checked = myFindLine.dispCross;
|
||||||
//// 将要编辑的线显示
|
//// 将要编辑的线显示
|
||||||
selected_drawing_object = myFindLine.inputPoseHomMat2D.Length != 0? HDrawingObject.CreateDrawingObject(HDrawingObject.HDrawingObjectType.LINE, new HTuple[] { myFindLine.newExpectLineStartRow, myFindLine.newExpectLineStartCol, myFindLine.newExpectLineEndRow, myFindLine.newExpectLineEndCol })
|
if(myFindLine.inputPoseHomMat2D.Type != HTupleType.EMPTY)
|
||||||
:HDrawingObject.CreateDrawingObject(HDrawingObject.HDrawingObjectType.LINE, new HTuple[] {myFindLine.modelStartRow, myFindLine.modelStartCol, myFindLine.modelEndRow, myFindLine.modelEndCol });
|
{
|
||||||
|
selected_drawing_object = HDrawingObject.CreateDrawingObject(HDrawingObject.HDrawingObjectType.LINE, new HTuple[] { myFindLine.newExpectLineStartRow, myFindLine.newExpectLineStartCol, myFindLine.newExpectLineEndRow, myFindLine.newExpectLineEndCol });
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
selected_drawing_object = HDrawingObject.CreateDrawingObject(HDrawingObject.HDrawingObjectType.LINE, new HTuple[] { myFindLine.modelStartRow, myFindLine.modelStartCol, myFindLine.modelEndRow, myFindLine.modelEndCol });
|
||||||
|
}
|
||||||
GC.KeepAlive(selected_drawing_object);
|
GC.KeepAlive(selected_drawing_object);
|
||||||
selected_drawing_object.OnSelect(OnSelectDrawingObject);
|
selected_drawing_object.OnSelect(OnSelectDrawingObject);
|
||||||
selected_drawing_object.OnAttach(OnSelectDrawingObject);
|
selected_drawing_object.OnAttach(OnSelectDrawingObject);
|
||||||
|
|||||||
@@ -76,7 +76,8 @@ namespace HalconTool
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 输出图像
|
/// 输出图像
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public HObject outputImage = null;
|
[NonSerialized]
|
||||||
|
public HObject outputImage = new HObject();
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 输出图像的路径
|
/// 输出图像的路径
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -98,7 +99,7 @@ namespace HalconTool
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (currentImageIndex <= L_imageFile.Count)
|
if (currentImageIndex <= L_imageFile.Count && L_imageFile.Count != 0)
|
||||||
{
|
{
|
||||||
currentImageIndex = currentImageIndex == L_imageFile.Count ? 0 : currentImageIndex;
|
currentImageIndex = currentImageIndex == L_imageFile.Count ? 0 : currentImageIndex;
|
||||||
outputImageFilePath = L_imageFile[currentImageIndex];
|
outputImageFilePath = L_imageFile[currentImageIndex];
|
||||||
|
|||||||
52
PMAlignTool/FormPMAlignTool.Designer.cs
generated
52
PMAlignTool/FormPMAlignTool.Designer.cs
generated
@@ -29,10 +29,6 @@ namespace PMAlignTool
|
|||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormPMAlignTool));
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormPMAlignTool));
|
||||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
|
|
||||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
|
|
||||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
|
|
||||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
|
|
||||||
this.statusStrip = new System.Windows.Forms.StatusStrip();
|
this.statusStrip = new System.Windows.Forms.StatusStrip();
|
||||||
this.lb_RunStatus = new System.Windows.Forms.ToolStripStatusLabel();
|
this.lb_RunStatus = new System.Windows.Forms.ToolStripStatusLabel();
|
||||||
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
|
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
|
||||||
@@ -123,7 +119,7 @@ namespace PMAlignTool
|
|||||||
this.ckb_showFeature = new System.Windows.Forms.CheckBox();
|
this.ckb_showFeature = new System.Windows.Forms.CheckBox();
|
||||||
this.ckb_showCross = new System.Windows.Forms.CheckBox();
|
this.ckb_showCross = new System.Windows.Forms.CheckBox();
|
||||||
this.tabPage3 = new System.Windows.Forms.TabPage();
|
this.tabPage3 = new System.Windows.Forms.TabPage();
|
||||||
this.dgv_matchResult = new Sunny.UI.UIDataGridView();
|
this.dgv_matchResult = new System.Windows.Forms.DataGridView();
|
||||||
this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
@@ -1550,21 +1546,7 @@ namespace PMAlignTool
|
|||||||
//
|
//
|
||||||
// dgv_matchResult
|
// dgv_matchResult
|
||||||
//
|
//
|
||||||
dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
|
this.dgv_matchResult.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
this.dgv_matchResult.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
|
|
||||||
this.dgv_matchResult.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
|
|
||||||
this.dgv_matchResult.BackgroundColor = System.Drawing.Color.White;
|
|
||||||
this.dgv_matchResult.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
|
|
||||||
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
|
|
||||||
dataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
|
||||||
dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
|
||||||
dataGridViewCellStyle2.ForeColor = System.Drawing.Color.White;
|
|
||||||
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
|
||||||
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
|
||||||
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
|
|
||||||
this.dgv_matchResult.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
|
|
||||||
this.dgv_matchResult.ColumnHeadersHeight = 32;
|
|
||||||
this.dgv_matchResult.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
|
|
||||||
this.dgv_matchResult.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
this.dgv_matchResult.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||||
this.Column1,
|
this.Column1,
|
||||||
this.Column2,
|
this.Column2,
|
||||||
@@ -1572,62 +1554,36 @@ namespace PMAlignTool
|
|||||||
this.Column4,
|
this.Column4,
|
||||||
this.Column5});
|
this.Column5});
|
||||||
this.dgv_matchResult.Dock = System.Windows.Forms.DockStyle.Fill;
|
this.dgv_matchResult.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
this.dgv_matchResult.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
|
|
||||||
this.dgv_matchResult.EnableHeadersVisualStyles = false;
|
|
||||||
this.dgv_matchResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
|
||||||
this.dgv_matchResult.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
|
||||||
this.dgv_matchResult.Location = new System.Drawing.Point(0, 0);
|
this.dgv_matchResult.Location = new System.Drawing.Point(0, 0);
|
||||||
this.dgv_matchResult.Name = "dgv_matchResult";
|
this.dgv_matchResult.Name = "dgv_matchResult";
|
||||||
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
|
||||||
dataGridViewCellStyle3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
|
|
||||||
dataGridViewCellStyle3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
|
||||||
dataGridViewCellStyle3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
|
|
||||||
dataGridViewCellStyle3.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
|
||||||
dataGridViewCellStyle3.SelectionForeColor = System.Drawing.Color.White;
|
|
||||||
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
|
|
||||||
this.dgv_matchResult.RowHeadersDefaultCellStyle = dataGridViewCellStyle3;
|
|
||||||
this.dgv_matchResult.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.AutoSizeToFirstHeader;
|
|
||||||
dataGridViewCellStyle4.BackColor = System.Drawing.Color.White;
|
|
||||||
this.dgv_matchResult.RowsDefaultCellStyle = dataGridViewCellStyle4;
|
|
||||||
this.dgv_matchResult.RowTemplate.Height = 23;
|
this.dgv_matchResult.RowTemplate.Height = 23;
|
||||||
this.dgv_matchResult.SelectedIndex = -1;
|
|
||||||
this.dgv_matchResult.ShowGridLine = true;
|
|
||||||
this.dgv_matchResult.Size = new System.Drawing.Size(392, 568);
|
this.dgv_matchResult.Size = new System.Drawing.Size(392, 568);
|
||||||
this.dgv_matchResult.TabIndex = 0;
|
this.dgv_matchResult.TabIndex = 0;
|
||||||
//
|
//
|
||||||
// Column1
|
// Column1
|
||||||
//
|
//
|
||||||
this.Column1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
|
this.Column1.HeaderText = "序号";
|
||||||
this.Column1.HeaderText = "编号";
|
|
||||||
this.Column1.Name = "Column1";
|
this.Column1.Name = "Column1";
|
||||||
this.Column1.Width = 66;
|
|
||||||
//
|
//
|
||||||
// Column2
|
// Column2
|
||||||
//
|
//
|
||||||
this.Column2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
|
||||||
this.Column2.HeaderText = "分值";
|
this.Column2.HeaderText = "分值";
|
||||||
this.Column2.Name = "Column2";
|
this.Column2.Name = "Column2";
|
||||||
//
|
//
|
||||||
// Column3
|
// Column3
|
||||||
//
|
//
|
||||||
this.Column3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
|
|
||||||
this.Column3.HeaderText = "行";
|
this.Column3.HeaderText = "行";
|
||||||
this.Column3.Name = "Column3";
|
this.Column3.Name = "Column3";
|
||||||
this.Column3.Width = 50;
|
|
||||||
//
|
//
|
||||||
// Column4
|
// Column4
|
||||||
//
|
//
|
||||||
this.Column4.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
|
|
||||||
this.Column4.HeaderText = "列";
|
this.Column4.HeaderText = "列";
|
||||||
this.Column4.Name = "Column4";
|
this.Column4.Name = "Column4";
|
||||||
this.Column4.Width = 50;
|
|
||||||
//
|
//
|
||||||
// Column5
|
// Column5
|
||||||
//
|
//
|
||||||
this.Column5.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
|
|
||||||
this.Column5.HeaderText = "角度";
|
this.Column5.HeaderText = "角度";
|
||||||
this.Column5.Name = "Column5";
|
this.Column5.Name = "Column5";
|
||||||
this.Column5.Width = 66;
|
|
||||||
//
|
//
|
||||||
// FormPMAlignTool
|
// FormPMAlignTool
|
||||||
//
|
//
|
||||||
@@ -1788,6 +1744,6 @@ namespace PMAlignTool
|
|||||||
private System.Windows.Forms.DataGridViewTextBoxColumn Column3;
|
private System.Windows.Forms.DataGridViewTextBoxColumn Column3;
|
||||||
private System.Windows.Forms.DataGridViewTextBoxColumn Column4;
|
private System.Windows.Forms.DataGridViewTextBoxColumn Column4;
|
||||||
private System.Windows.Forms.DataGridViewTextBoxColumn Column5;
|
private System.Windows.Forms.DataGridViewTextBoxColumn Column5;
|
||||||
public Sunny.UI.UIDataGridView dgv_matchResult;
|
public System.Windows.Forms.DataGridView dgv_matchResult;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -33,7 +33,8 @@ namespace PMAlignTool
|
|||||||
{
|
{
|
||||||
myToolInfo = (IToolInfo)pmalign;
|
myToolInfo = (IToolInfo)pmalign;
|
||||||
myPMAlign = (PMAlign)myToolInfo.tool;
|
myPMAlign = (PMAlign)myToolInfo.tool;
|
||||||
myPMAlign.toolName = myToolInfo.FormToolName;
|
myPMAlign.toolName = myToolInfo.toolName;
|
||||||
|
myPMAlign.bingdingJobName = myToolInfo.bingingJobName;
|
||||||
myPMAlign.DispImage();
|
myPMAlign.DispImage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,12 +25,20 @@ using Logger;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using ViewROI;
|
using ViewROI;
|
||||||
|
using DataStruct;
|
||||||
|
|
||||||
namespace PMAlignTool
|
namespace PMAlignTool
|
||||||
{
|
{
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class PMAlign : IToolBase
|
public class PMAlign : IToolBase
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 绑定job名称
|
||||||
|
/// </summary>
|
||||||
|
public string bingdingJobName { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 工具名称
|
||||||
|
/// </summary>
|
||||||
public string toolName { get; set; } = string.Empty;
|
public string toolName { get; set; } = string.Empty;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 输入姿态
|
/// 输入姿态
|
||||||
@@ -115,12 +123,14 @@ namespace PMAlignTool
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 训练时所使用的模板图像,不点击获取图像时,不进行更新
|
/// 训练时所使用的模板图像,不点击获取图像时,不进行更新
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public HObject oldTrainImage { get; set; }
|
[NonSerialized]
|
||||||
|
public HObject oldTrainImage;
|
||||||
public bool isCreateModel { get; set; }
|
public bool isCreateModel { get; set; }
|
||||||
internal string pmaModelName { get; set; } = Guid.NewGuid().ToString();
|
internal string pmaModelName { get; set; } = Guid.NewGuid().ToString();
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 剪出的模板图像
|
/// 剪出的模板图像
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[NonSerialized]
|
||||||
public HObject modelPartImage = new HObject();
|
public HObject modelPartImage = new HObject();
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 模板位置和实际位置的姿态差异
|
/// 模板位置和实际位置的姿态差异
|
||||||
@@ -163,7 +173,8 @@ namespace PMAlignTool
|
|||||||
public bool isAutoConstants { get; set; }
|
public bool isAutoConstants { get; set; }
|
||||||
public string modelFilePath { get; set; }
|
public string modelFilePath { get; set; }
|
||||||
public RegionType searchRegionType { get; set; }
|
public RegionType searchRegionType { get; set; }
|
||||||
public HObject SearchRegion { get; set; }
|
[NonSerialized]
|
||||||
|
public HObject SearchRegion;
|
||||||
public override void Run(SoftwareRunState softwareState)
|
public override void Run(SoftwareRunState softwareState)
|
||||||
{
|
{
|
||||||
Stopwatch sw = new Stopwatch();
|
Stopwatch sw = new Stopwatch();
|
||||||
@@ -195,7 +206,6 @@ namespace PMAlignTool
|
|||||||
//对预期线的找模板区域做放射变换
|
//对预期线的找模板区域做放射变换
|
||||||
|
|
||||||
}
|
}
|
||||||
// UpdateParamsFromUI(); // 操作前先将UI中参数写入类
|
|
||||||
HObject findModelImg = ProcessImage(inputImage);
|
HObject findModelImg = ProcessImage(inputImage);
|
||||||
int ret = FindModelTemplate(findModelImg);
|
int ret = FindModelTemplate(findModelImg);
|
||||||
UpdateResultDataGridview();
|
UpdateResultDataGridview();
|
||||||
@@ -220,10 +230,16 @@ namespace PMAlignTool
|
|||||||
public void UpdateResultDataGridview()
|
public void UpdateResultDataGridview()
|
||||||
{
|
{
|
||||||
FormPMAlignTool.Instance.dgv_matchResult.Rows.Clear();
|
FormPMAlignTool.Instance.dgv_matchResult.Rows.Clear();
|
||||||
|
//FormPMAlignTool.Instance.dgv_matchResult.Columns.Clear();
|
||||||
|
//FormPMAlignTool.Instance.dgv_matchResult.Columns.Add("num", "序号");
|
||||||
|
//FormPMAlignTool.Instance.dgv_matchResult.Columns.Add("Socre", "分值");
|
||||||
|
//FormPMAlignTool.Instance.dgv_matchResult.Columns.Add("Row", "行");
|
||||||
|
//FormPMAlignTool.Instance.dgv_matchResult.Columns.Add("Col", "列");
|
||||||
|
//FormPMAlignTool.Instance.dgv_matchResult.Columns.Add("Angle", "角度");
|
||||||
int count = 0;
|
int count = 0;
|
||||||
foreach (var item in L_resultList)
|
foreach (var item in L_resultList)
|
||||||
{
|
{
|
||||||
FormPMAlignTool.Instance.dgv_matchResult.AddRow(++count, item.Socre, item.Row, item.Col, item.Angle);
|
FormPMAlignTool.Instance.dgv_matchResult.Rows.Add(++count, item.Socre, item.Row, item.Col, item.Angle);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -355,8 +371,9 @@ namespace PMAlignTool
|
|||||||
out scores);
|
out scores);
|
||||||
}
|
}
|
||||||
isCreateModel = true;
|
isCreateModel = true;
|
||||||
HOperatorSet.WriteRegion(templateRegion, FormPMAlignTool.Instance.myToolInfo.FormToolName + ".hobj");
|
// 模板句柄信息
|
||||||
HOperatorSet.WriteShapeModel(modelID, pmaModelName + ".ShapeModel");
|
Directory.CreateDirectory(ConfigData.ConfigPath + $"\\{bingdingJobName}\\");
|
||||||
|
HOperatorSet.WriteShapeModel(modelID, ConfigData.ConfigPath + $"\\{bingdingJobName}\\{toolName}_{pmaModelName}.Shm");
|
||||||
|
|
||||||
if (scores != null && scores.Type != HTupleType.EMPTY)
|
if (scores != null && scores.Type != HTupleType.EMPTY)
|
||||||
{
|
{
|
||||||
@@ -380,12 +397,12 @@ namespace PMAlignTool
|
|||||||
|
|
||||||
public int FindModelTemplate(HObject findModelImage)
|
public int FindModelTemplate(HObject findModelImage)
|
||||||
{
|
{
|
||||||
if (!File.Exists(pmaModelName + ".ShapeModel"))
|
if (!File.Exists(ConfigData.ConfigPath + $"\\{bingdingJobName}\\{toolName}_{pmaModelName}.Shm"))
|
||||||
{
|
{
|
||||||
LoggerClass.WriteLog($"{toolName}未创建或加载模板", MsgLevel.Exception);
|
LoggerClass.WriteLog($"{toolName}未创建或加载模板", MsgLevel.Exception);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
HOperatorSet.ReadShapeModel(pmaModelName + ".ShapeModel", out modelID);
|
HOperatorSet.ReadShapeModel(ConfigData.ConfigPath + $"\\{bingdingJobName}\\{toolName}_{pmaModelName}.Shm", out modelID);
|
||||||
HObject image;
|
HObject image;
|
||||||
if (searchRegionType == RegionType.AllImage)
|
if (searchRegionType == RegionType.AllImage)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -64,7 +64,6 @@ namespace ToolLib.VisionJob
|
|||||||
{
|
{
|
||||||
VisionJobParams.pVisionProject.Project.Add(jobName, new VisionJob(jobName));
|
VisionJobParams.pVisionProject.Project.Add(jobName, new VisionJob(jobName));
|
||||||
FormJobManage.Instance.tabJobUnion.SelectedTab = newTab;
|
FormJobManage.Instance.tabJobUnion.SelectedTab = newTab;
|
||||||
// newTab.Select();
|
|
||||||
}
|
}
|
||||||
InitJob(VisionJobParams.pVisionProject.Project[jobName]);
|
InitJob(VisionJobParams.pVisionProject.Project[jobName]);
|
||||||
}
|
}
|
||||||
@@ -219,12 +218,12 @@ namespace ToolLib.VisionJob
|
|||||||
string AssemblyName = VisionJobParams.pVisionProject.Project[jobName].L_toolList[i].FormToolName.Split('.')[0];
|
string AssemblyName = VisionJobParams.pVisionProject.Project[jobName].L_toolList[i].FormToolName.Split('.')[0];
|
||||||
string className = VisionJobParams.pVisionProject.Project[jobName].L_toolList[i].FormToolName;
|
string className = VisionJobParams.pVisionProject.Project[jobName].L_toolList[i].FormToolName;
|
||||||
toolClass = VisionJobParams.pVisionProject.Project[jobName].L_toolList[i];
|
toolClass = VisionJobParams.pVisionProject.Project[jobName].L_toolList[i];
|
||||||
IToolInfo.FormTool = (Form)Assembly.Load(AssemblyName).CreateInstance(className, false, BindingFlags.Default, null, new object[] { toolClass }, null, null);
|
VisionJobParams.pVisionProject.Project[jobName].L_toolList[i].bingingJobName = jobName;
|
||||||
IToolInfo.FormTool.ShowDialog();
|
//IToolInfo.FormTool = (Form)Assembly.Load(AssemblyName).CreateInstance(className, false, BindingFlags.Default, null, new object[] { toolClass }, null, null);
|
||||||
//VisionJobParams.myProject[jobName].L_toolList[i].SetFormTool(IToolInfo.FormTool);
|
//IToolInfo.FormTool.ShowDialog();
|
||||||
//VisionJobParams.myProject[jobName].L_toolList[i].GetFormTool().ShowDialog();
|
VisionJobParams.pVisionProject.Project[jobName].L_toolList[i].FormTool = (Form)Assembly.Load(AssemblyName).CreateInstance(className, false, BindingFlags.Default, null, new object[] { toolClass }, null, null);
|
||||||
//VisionJobParams.myProject[jobName].L_toolList[i].FormTool = (Form)Assembly.Load(AssemblyName).CreateInstance(className, false, BindingFlags.Default, null, new object[] { toolClass }, null, null);
|
VisionJobParams.pVisionProject.Project[jobName].L_toolList[i].FormTool.Show();
|
||||||
//VisionJobParams.myProject[jobName].L_toolList[i].FormTool.ShowDialog();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -904,6 +904,7 @@ namespace ToolLib.VisionJob
|
|||||||
}
|
}
|
||||||
[NonSerialized]
|
[NonSerialized]
|
||||||
public FormImageWindow myHalconWindow = new FormImageWindow();
|
public FormImageWindow myHalconWindow = new FormImageWindow();
|
||||||
|
public string JobDirectoryPath { get; set; } = @"D:\VisionSystem\";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using WeifenLuo.WinFormsUI.Docking;
|
|
||||||
|
|
||||||
namespace VisionEdit
|
|
||||||
{
|
|
||||||
public class AppConfig
|
|
||||||
{
|
|
||||||
public static DockState leftForm = DockState.DockLeft; // 功能窗体,左端停靠
|
|
||||||
public static DockState rightForm = DockState.DockRight; // 功能窗体,右端停靠
|
|
||||||
public static DockState docForm = DockState.Document; // 功能窗体,中间停靠
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -59,7 +59,6 @@
|
|||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="AppConfig.cs" />
|
|
||||||
<Compile Include="FormMain.cs">
|
<Compile Include="FormMain.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
|||||||
Binary file not shown.
@@ -1,11 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
||||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
|
||||||
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
|
|
||||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
|
||||||
<security>
|
|
||||||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
|
||||||
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
|
|
||||||
</requestedPrivileges>
|
|
||||||
</security>
|
|
||||||
</trustInfo>
|
|
||||||
</assembly>
|
|
||||||
Reference in New Issue
Block a user