添添加功能:1、增加采图工具 2、增加拖拽后值传递功能 3、

This commit is contained in:
liu.wenjie
2019-08-09 20:52:17 +08:00
committed by liu.wenjie
parent 9d8944dcc3
commit 4dbab27caf
162 changed files with 225412 additions and 205 deletions

Binary file not shown.

162
CaliperTool/CaliperTool.cs Normal file
View File

@@ -0,0 +1,162 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CommonMethods;
using HalconDotNet;
using static DataStruct.DataStruct;
namespace CaliperTool
{
[Serializable]
public class CaliperTool:IToolInfo
{
public bool toolEnable = true;
/// <summary>
/// 输入姿态
/// </summary>
public PosXYU inputPose = new PosXYU();
/// <summary>
/// 制作模板时的输入位姿
/// </summary>
public PosXYU templatePose = new PosXYU();
/// <summary>
/// 卡尺
/// </summary>
public HObject contoursDisp = null;
/// <summary>
/// 箭头
/// </summary>
public HObject arrowDisp = null;
/// <summary>
/// 交点
/// </summary>
public HObject crossDisp = null;
/// <summary>
/// 期望矩形中心行坐标
/// </summary>
public HTuple expectRecStartRow = 200;
/// <summary>
/// 期望矩形中心列坐标
/// </summary>
public HTuple expectRecStartColumn = 200;
/// <summary>
/// 期望矩形起点方向
/// </summary>
public HTuple expectAngle = 0;
/// <summary>
/// 卡尺高
/// </summary>
public int length1 = 40;
/// <summary>
/// 卡尺宽
/// </summary>
public int length2 = 40;
/// <summary>
/// 找边极性,从明到暗或从暗到明
/// </summary>
public string polarity = "negative";
/// <summary>
/// 边阈值
/// </summary>
public int threshold = 30;
/// <summary>
/// 边Sigma
/// </summary>
public double sigma = 1.0;
/// <summary>
/// 选择所查找到的点
/// </summary>
public string edgeSelect = "all";
/// <summary>
/// 矩形框显示
/// </summary>
public bool dispRec = true;
/// <summary>
/// 交点显示
/// </summary>
public bool dispCross = true;
/// <summary>
/// 找到的线段
/// </summary>
public Point resultPoint = null;
/// <summary>
/// 显示的线
/// </summary>
public HObject LineDisp = null;
/// <summary>
/// 新的跟随姿态变化后的预期线信息
/// </summary>
HTuple newExpectLineStartRow = new HTuple(200), newExpectLineStartCol = new HTuple(200), newExpectLineEndRow = new HTuple(200), newExpectLineEndCol = new HTuple(600);
/// <summary>
/// 查找到的线的起点行坐标
/// </summary>
private HTuple _resultLineStartRow = 0;
internal HTuple ResultLineStartRow
{
get
{
_resultLineStartRow = Math.Round((double)_resultLineStartRow, 3);
return _resultLineStartRow;
}
set { _resultLineStartRow = value; }
}
/// <summary>
/// 查找到的线的起点列坐标
/// </summary>
private HTuple _resultLineStartCol = 0;
internal HTuple ResultLineStartCol
{
get
{
_resultLineStartCol = Math.Round((double)_resultLineStartCol, 3);
return _resultLineStartCol;
}
set { _resultLineStartCol = value; }
}
/// <summary>
/// 查找到的线的终点行坐标
/// </summary>
private HTuple _resultLineEndRow = 0;
internal HTuple ResultLineEndRow
{
get
{
_resultLineEndRow = Math.Round((double)_resultLineEndRow, 3);
return _resultLineEndRow;
}
set { _resultLineEndRow = value; }
}
/// <summary>
/// 查找到的线的终点列坐标
/// </summary>
private HTuple _resultLineEndCol = 0;
internal HTuple ResultLineEndCol
{
get
{
_resultLineEndCol = Math.Round((double)_resultLineEndCol, 3);
return _resultLineEndCol;
}
set { _resultLineEndCol = value; }
}
/// <summary>
/// 查找到线的方向
/// </summary>
private HTuple _angle = 0;
internal HTuple Angle
{
get
{
_angle = Math.Round((double)_angle, 3);
return _angle;
}
set { _angle = value; }
}
public HObject inputImage { get; set; } = null;
public ToolRunStatu toolRunStatu { get; set; } = ToolRunStatu.Not_Run;
}
}

View File

@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{AABF8D49-FA00-4E25-9410-4A573D48DAB1}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CaliperTool</RootNamespace>
<AssemblyName>CaliperTool</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="halcondotnet">
<HintPath>C:\Program Files\MVTec\HALCON-19.05-Progress\bin\dotnet20\halcondotnet.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CaliperTool.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CommonMethods\CommonHelper.csproj">
<Project>{1C8D0DDC-2086-48A9-9586-F2B643E2FC54}</Project>
<Name>CommonHelper</Name>
</ProjectReference>
<ProjectReference Include="..\DataStruct\DataStruct.csproj">
<Project>{DF3D4D4C-02DF-4F92-9FD4-0A861F64B0EF}</Project>
<Name>DataStruct</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

View File

@@ -20,7 +20,7 @@ namespace CommonMethods
}
set
{
}
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -11,68 +11,84 @@ namespace FindLineTool
[Serializable]
public class FindLine:IToolBase
{
internal bool toolEnable = true;
public bool toolEnable = true;
/// <summary>
/// 输入姿态
/// </summary>
internal PosXYU inputPose = new PosXYU();
public PosXYU inputPose = new PosXYU();
/// <summary>
/// 制作模板时的输入位姿
/// </summary>
internal PosXYU templatePose = new PosXYU();
public PosXYU templatePose = new PosXYU();
/// <summary>
/// 期望线起点行坐标
/// </summary>
internal HTuple expectLineStartRow = 200;
public HTuple expectLineStartRow = 200;
/// <summary>
/// 卡尺
/// </summary>
internal HObject contours;
public HObject contoursDisp = null;
/// <summary>
/// 箭头
/// </summary>
public HObject arrowDisp = null;
/// <summary>
/// 交点
/// </summary>
public HObject crossDisp = null;
/// <summary>
/// 期望线起点列坐标
/// </summary>
internal HTuple expectLineStartCol = 200;
public HTuple expectLineStartCol = 200;
/// <summary>
/// 期望线终点行坐标
/// </summary>
internal HTuple expectLineEndRow = 200;
public HTuple expectLineEndRow = 200;
/// <summary>
/// 期望线终点列坐标
/// </summary>
internal HTuple expectLineEndCol = 600;
public HTuple expectLineEndCol = 600;
/// <summary>
/// 找边极性,从明到暗或从暗到明
/// </summary>
internal string polarity = "negative";
public string polarity = "negative";
/// <summary>
/// 卡尺数量
/// </summary>
internal int cliperNum = 20;
public int cliperNum = 20;
/// <summary>
/// 卡尺高
/// </summary>
internal int length = 80;
public int length = 80;
/// <summary>
/// 卡尺宽
/// </summary>
internal int weidth = 5;
public int weidth = 5;
/// <summary>
/// 边阈值
/// </summary>
internal int threshold = 30;
public int threshold = 30;
/// <summary>
/// 边Sigma
/// </summary>
internal double sigma = 1.0;
public double sigma = 1.0;
/// <summary>
/// 选择所查找到的边
/// </summary>
internal string edgeSelect = "all";
public string edgeSelect = "all";
/// <summary>
/// 分数阈值
/// </summary>
internal double _minScore = 0.5;
internal double minScore
public double _minScore = 0.5;
/// <summary>
/// 矩形框显示
/// </summary>
public bool dispRec = true;
/// <summary>
/// 交点显示
/// </summary>
public bool dispCross = true;
public double minScore
{
get
{
@@ -93,11 +109,15 @@ namespace FindLineTool
_minScore = value;
}
}
}
}
/// <summary>
/// 找到的线段
/// </summary>
internal Line resultLine = new Line();
public Line resultLine = null;
/// <summary>
/// 显示的线
/// </summary>
public HObject LineDisp = null;
/// <summary>
/// 新的跟随姿态变化后的预期线信息
/// </summary>
@@ -168,12 +188,15 @@ namespace FindLineTool
set { _angle = value; }
}
public HObject inputImage { get; set; }
public HObject inputImage { get; set; } = null;
public ToolRunStatu toolRunStatu { get; set; }
public ToolRunStatu toolRunStatu { get; set; } = ToolRunStatu.Not_Run;
public void DispImage()
{
FormFindLine.Instance.myHwindow.HobjectToHimage(inputImage);
if(inputImage != null)
{
FormFindLine.Instance.myHwindow.HobjectToHimage(inputImage);
}
}
public void UpdateImage()
@@ -184,7 +207,11 @@ namespace FindLineTool
public void Run()
{
if(inputImage == null)
HTuple homMat2DArrow = null;
HObject arrow = null, arrowTrans = null;
HObject drawLine = null, imageReducedLine;
if (inputImage == null)
{
FormFindLine.Instance.TextBoxMessageDisp("图像为空", System.Drawing.Color.Red);
toolRunStatu = ToolRunStatu.Not_Input_Image;
@@ -237,61 +264,35 @@ namespace FindLineTool
//显示所有卡尺
HTuple pointRow, pointCol;
HOperatorSet.GetMetrologyObjectMeasures(out contours, handleID, new HTuple("all"), new HTuple("all"), out pointRow, out pointCol);
HOperatorSet.SetColor(FormFindLine.Instance.myHwindow.hWindowControl.HalconWindow, new HTuple("blue"));
HOperatorSet.DispObj(contours, FormFindLine.Instance.myHwindow.hWindowControl.HalconWindow);
FormFindLine.Instance.myHwindow.DispObj(contours, "blue");
HOperatorSet.GetMetrologyObjectMeasures(out contoursDisp, handleID, new HTuple("all"), new HTuple("all"), out pointRow, out pointCol);
//显示指示找线方向的箭头
HTuple arrowAngle;
HOperatorSet.AngleLx(newExpectLineStartRow, newExpectLineStartCol, newExpectLineEndRow, newExpectLineEndCol, out arrowAngle);
#region
#region
HTuple arrowRow = null, arrowColumn = null;
HOperatorSet.GenRegionLine(out drawLine, newExpectLineStartRow, newExpectLineStartCol, newExpectLineEndRow, newExpectLineEndCol);
HOperatorSet.ReduceDomain(inputImage, drawLine, out imageReducedLine);
HOperatorSet.GetRegionPoints(imageReducedLine, out arrowRow, out arrowColumn);
if(arrowRow.Length < 200)
{
CommonMethods.CommonMethods.gen_arrow_contour_xld(out arrow, arrowRow[0], arrowColumn[0], arrowRow[arrowRow.Length-1], arrowColumn[arrowRow.Length - 1], 20, 20);
}
else
{
CommonMethods.CommonMethods.gen_arrow_contour_xld(out arrow, arrowRow[0], arrowColumn[0], arrowRow[200], arrowColumn[200], 20, 20);
}
HOperatorSet.VectorAngleToRigid(newExpectLineStartRow, newExpectLineStartCol, 0, (newExpectLineStartRow + newExpectLineEndRow) / 2, (newExpectLineStartCol + newExpectLineEndCol) / 2, new HTuple(-90).TupleRad(), out homMat2DArrow);
HOperatorSet.AffineTransContourXld(arrow, out arrowDisp, homMat2DArrow);
#endregion
arrowAngle = arrowAngle + Math.PI / 2;
arrowAngle = arrowAngle.TupleDeg();
HTuple row = (newExpectLineStartRow + newExpectLineEndRow) / 2;
HTuple column = (newExpectLineStartCol + newExpectLineEndCol) / 2;
double drow, dcolumn;
double arrowLength = length + 100;
if (0 <= arrowAngle && arrowAngle <= 90)
{
drow = Math.Abs(arrowLength * Math.Sin(((HTuple)arrowAngle).TupleRad()));
dcolumn = Math.Abs(arrowLength * Math.Cos(((HTuple)arrowAngle).TupleRad()));
HOperatorSet.DispArrow(FormFindLine.Instance.myHwindow.hWindowControl.HalconWindow, row, column, row - drow, column + dcolumn, 5.0);
}
else if (arrowAngle > 90 && arrowAngle <= 180)
{
drow = arrowLength * Math.Sin(((HTuple)(180 - arrowAngle)).TupleRad());
dcolumn = arrowLength * Math.Cos(((HTuple)(180 - arrowAngle)).TupleRad());
HOperatorSet.DispArrow(FormFindLine.Instance.myHwindow.hWindowControl.HalconWindow, row, column, row - drow, column - dcolumn, 5.0);
}
else if (arrowAngle < 0 && arrowAngle >= -90)
{
drow = arrowLength * Math.Sin(((HTuple)arrowAngle * -1).TupleRad());
dcolumn = arrowLength * Math.Cos(((HTuple)arrowAngle * -1).TupleRad());
HOperatorSet.DispArrow(FormFindLine.Instance.myHwindow.hWindowControl.HalconWindow, row, column, row + drow, column + dcolumn, 5.0);
}
else if (arrowAngle < -90 && arrowAngle >= -180)
{
drow = Math.Abs(arrowLength * Math.Sin(((HTuple)arrowAngle + 180).TupleRad()));
dcolumn = Math.Abs(arrowLength * Math.Cos(((HTuple)arrowAngle + 180).TupleRad()));
HOperatorSet.DispArrow(FormFindLine.Instance.myHwindow.hWindowControl.HalconWindow, row, column, row + drow, column - dcolumn, 5.0);
}
//把点显示出来
HObject cross;
HOperatorSet.GenCrossContourXld(out cross, pointRow, pointCol, new HTuple(12), new HTuple(0));
HOperatorSet.SetColor(FormFindLine.Instance.myHwindow.hWindowControl.HalconWindow, new HTuple("orange"));
HOperatorSet.DispObj(cross, FormFindLine.Instance.myHwindow.hWindowControl.HalconWindow);
FormFindLine.Instance.myHwindow.DispObj(cross, "orange");
HOperatorSet.GenCrossContourXld(out crossDisp, pointRow, pointCol, new HTuple(12), new HTuple(0));
//得到所找到的线
HTuple parameter;
HObject line;
HOperatorSet.GetMetrologyObjectResult(handleID, new HTuple("all"), new HTuple("all"), new HTuple("result_type"), new HTuple("all_param"), out parameter);
HOperatorSet.GetMetrologyObjectResultContour(out line, handleID, new HTuple("all"), new HTuple("all"), new HTuple(1.5));
HOperatorSet.GetMetrologyObjectResultContour(out LineDisp, handleID, new HTuple("all"), new HTuple("all"), new HTuple(1.5));
if (parameter.Length >= 4)
{
@@ -302,16 +303,12 @@ namespace FindLineTool
Point start = new Point() { Row = ResultLineStartRow, Col = ResultLineStartCol };
Point end = new Point() { Row = ResultLineEndRow, Col = ResultLineEndCol };
resultLine = new Line() { StartPoint = start, EndPoint = end };
//显示找到的线
HOperatorSet.SetColor(FormFindLine.Instance.myHwindow.hWindowControl.HalconWindow, new HTuple("green"));
// HOperatorSet.DispObj(line, GetWindowHandle(jobName));
FormFindLine.Instance.myHwindow.hWindowControl.HalconWindow.SetLineWidth(2);
FormFindLine.Instance.myHwindow.DispObj(line, "green");
}
DispMainWindow(FormFindLine.Instance.myHwindow);
HOperatorSet.AngleLx(ResultLineStartRow, ResultLineStartCol, ResultLineEndRow, ResultLineEndCol, out _angle);
HOperatorSet.ClearMetrologyModel(handleID);
// 参数传递
ParamsTrans();
FormFindLine.Instance.tbx_resultStartRow.Text = ResultLineStartRow.ToString();
FormFindLine.Instance.tbx_resultStartCol.Text = ResultLineEndCol.ToString();
FormFindLine.Instance.tbx_resultEndRow.Text = ResultLineEndRow.ToString();
@@ -323,6 +320,12 @@ namespace FindLineTool
{
FormFindLine.Instance.TextBoxMessageDisp("工具运行异常" + ex.Message, System.Drawing.Color.Red);
}
finally
{
//homMat2DArrow.Dispose();
//arrow.Dispose();
//arrowTrans.Dispose();
}
}
internal void DrawExpectLine(HWindow_Final myHwindow)
@@ -363,6 +366,35 @@ namespace FindLineTool
}
/// <summary>
/// 将数据传递给FindlineToolInterface
/// </summary>
private void ParamsTrans()
{
FormFindLine.Instance.myToolInfo.toolOutput.Clear();
FormFindLine.Instance.myToolInfo.toolOutput.Add(new ToolIO("outputXld", resultLine, DataType.Line));
FormFindLine.Instance.myToolInfo.toolOutput.Add(new ToolIO("StartPoint.Row", ResultLineStartRow, DataType.IntValue));
FormFindLine.Instance.myToolInfo.toolOutput.Add(new ToolIO("StartPoint.Column", ResultLineStartCol, DataType.IntValue));
FormFindLine.Instance.myToolInfo.toolOutput.Add(new ToolIO("EndPoint.Row", ResultLineEndRow, DataType.IntValue));
FormFindLine.Instance.myToolInfo.toolOutput.Add(new ToolIO("EndPoint.Column", ResultLineEndCol, DataType.IntValue));
}
public void DispMainWindow(HWindow_Final window)
{
// 显示矩形
if (dispRec)
{
window.DispObj(contoursDisp, "blue");
}
// 显示交点
if (dispCross)
{
window.DispObj(arrowDisp, "red");
window.DispObj(crossDisp, "orange");
}
//显示找到的线
window.DispObj(LineDisp, "green");
}
}
}

View File

@@ -31,6 +31,9 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormFindLine));
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.panel1 = new System.Windows.Forms.Panel();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.chBDispCross = new System.Windows.Forms.CheckBox();
this.chBDispRec = new System.Windows.Forms.CheckBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label3 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
@@ -52,10 +55,14 @@
this.label9 = new System.Windows.Forms.Label();
this.tbx_minScore = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.label16 = new System.Windows.Forms.Label();
this.label14 = new System.Windows.Forms.Label();
this.label15 = new System.Windows.Forms.Label();
this.label13 = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.tbx_caliperLength2 = new System.Windows.Forms.TextBox();
this.tbx_Sigma = new System.Windows.Forms.TextBox();
this.tbx_caliperLength = new System.Windows.Forms.TextBox();
this.tbx_threshold = new System.Windows.Forms.TextBox();
this.tbx_caliperNum = new System.Windows.Forms.TextBox();
@@ -64,20 +71,13 @@
this.btn_moveCliperRegion = new System.Windows.Forms.Button();
this.cbx_edgeSelect = new System.Windows.Forms.ComboBox();
this.txbLog = new System.Windows.Forms.TextBox();
this.tbx_Sigma = new System.Windows.Forms.TextBox();
this.label15 = new System.Windows.Forms.Label();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.checkBox2 = new System.Windows.Forms.CheckBox();
this.tbx_caliperLength2 = new System.Windows.Forms.TextBox();
this.label16 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.SuspendLayout();
//
// splitContainer1
@@ -128,6 +128,39 @@
this.panel1.Size = new System.Drawing.Size(563, 479);
this.panel1.TabIndex = 272;
//
// groupBox3
//
this.groupBox3.Controls.Add(this.chBDispCross);
this.groupBox3.Controls.Add(this.chBDispRec);
this.groupBox3.Location = new System.Drawing.Point(296, 200);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(213, 96);
this.groupBox3.TabIndex = 319;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "显示";
//
// chBDispCross
//
this.chBDispCross.AutoSize = true;
this.chBDispCross.Location = new System.Drawing.Point(29, 60);
this.chBDispCross.Name = "chBDispCross";
this.chBDispCross.Size = new System.Drawing.Size(96, 16);
this.chBDispCross.TabIndex = 0;
this.chBDispCross.Text = "结果显示交点";
this.chBDispCross.UseVisualStyleBackColor = true;
this.chBDispCross.CheckedChanged += new System.EventHandler(this.chBDispCross_CheckedChanged);
//
// chBDispRec
//
this.chBDispRec.AutoSize = true;
this.chBDispRec.Location = new System.Drawing.Point(29, 29);
this.chBDispRec.Name = "chBDispRec";
this.chBDispRec.Size = new System.Drawing.Size(108, 16);
this.chBDispRec.TabIndex = 0;
this.chBDispRec.Text = "结果显示矩形框";
this.chBDispRec.UseVisualStyleBackColor = true;
this.chBDispRec.CheckedChanged += new System.EventHandler(this.chBDispRec_CheckedChanged);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.label3);
@@ -343,6 +376,17 @@
this.label5.TabIndex = 279;
this.label5.Text = "结果选择:";
//
// label16
//
this.label16.AutoSize = true;
this.label16.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label16.Location = new System.Drawing.Point(34, 280);
this.label16.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(65, 20);
this.label16.TabIndex = 302;
this.label16.Text = "卡尺宽:";
//
// label14
//
this.label14.AutoSize = true;
@@ -354,6 +398,17 @@
this.label14.TabIndex = 302;
this.label14.Text = "卡尺长:";
//
// label15
//
this.label15.AutoSize = true;
this.label15.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label15.Location = new System.Drawing.Point(36, 347);
this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(54, 20);
this.label15.TabIndex = 310;
this.label15.Text = "Sigma:";
//
// label13
//
this.label13.AutoSize = true;
@@ -387,6 +442,24 @@
this.label11.TabIndex = 298;
this.label11.Text = "极性:";
//
// tbx_caliperLength2
//
this.tbx_caliperLength2.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.tbx_caliperLength2.Location = new System.Drawing.Point(124, 277);
this.tbx_caliperLength2.Margin = new System.Windows.Forms.Padding(2);
this.tbx_caliperLength2.Name = "tbx_caliperLength2";
this.tbx_caliperLength2.Size = new System.Drawing.Size(92, 26);
this.tbx_caliperLength2.TabIndex = 301;
//
// tbx_Sigma
//
this.tbx_Sigma.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.tbx_Sigma.Location = new System.Drawing.Point(126, 344);
this.tbx_Sigma.Margin = new System.Windows.Forms.Padding(2);
this.tbx_Sigma.Name = "tbx_Sigma";
this.tbx_Sigma.Size = new System.Drawing.Size(92, 26);
this.tbx_Sigma.TabIndex = 309;
//
// tbx_caliperLength
//
this.tbx_caliperLength.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@@ -429,24 +502,26 @@
//
// btn_runFindLineTool
//
this.btn_runFindLineTool.BackColor = System.Drawing.Color.White;
this.btn_runFindLineTool.Location = new System.Drawing.Point(440, 400);
this.btn_runFindLineTool.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.btn_runFindLineTool.Name = "btn_runFindLineTool";
this.btn_runFindLineTool.Size = new System.Drawing.Size(90, 48);
this.btn_runFindLineTool.TabIndex = 270;
this.btn_runFindLineTool.Text = "运行";
this.btn_runFindLineTool.UseVisualStyleBackColor = true;
this.btn_runFindLineTool.UseVisualStyleBackColor = false;
this.btn_runFindLineTool.Click += new System.EventHandler(this.btn_runFindLineTool_Click);
//
// btn_moveCliperRegion
//
this.btn_moveCliperRegion.BackColor = System.Drawing.Color.White;
this.btn_moveCliperRegion.Location = new System.Drawing.Point(296, 400);
this.btn_moveCliperRegion.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.btn_moveCliperRegion.Name = "btn_moveCliperRegion";
this.btn_moveCliperRegion.Size = new System.Drawing.Size(90, 48);
this.btn_moveCliperRegion.TabIndex = 269;
this.btn_moveCliperRegion.Text = "编辑卡尺";
this.btn_moveCliperRegion.UseVisualStyleBackColor = true;
this.btn_moveCliperRegion.UseVisualStyleBackColor = false;
this.btn_moveCliperRegion.Click += new System.EventHandler(this.btn_moveCliperRegion_Click);
//
// cbx_edgeSelect
@@ -473,77 +548,6 @@
this.txbLog.Size = new System.Drawing.Size(1129, 21);
this.txbLog.TabIndex = 274;
//
// tbx_Sigma
//
this.tbx_Sigma.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.tbx_Sigma.Location = new System.Drawing.Point(126, 344);
this.tbx_Sigma.Margin = new System.Windows.Forms.Padding(2);
this.tbx_Sigma.Name = "tbx_Sigma";
this.tbx_Sigma.Size = new System.Drawing.Size(92, 26);
this.tbx_Sigma.TabIndex = 309;
//
// label15
//
this.label15.AutoSize = true;
this.label15.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label15.Location = new System.Drawing.Point(36, 347);
this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(54, 20);
this.label15.TabIndex = 310;
this.label15.Text = "Sigma:";
//
// groupBox3
//
this.groupBox3.Controls.Add(this.checkBox2);
this.groupBox3.Controls.Add(this.checkBox1);
this.groupBox3.Location = new System.Drawing.Point(296, 200);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(213, 96);
this.groupBox3.TabIndex = 319;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "显示";
//
// checkBox1
//
this.checkBox1.AutoSize = true;
this.checkBox1.Location = new System.Drawing.Point(29, 29);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(108, 16);
this.checkBox1.TabIndex = 0;
this.checkBox1.Text = "结果显示矩形框";
this.checkBox1.UseVisualStyleBackColor = true;
//
// checkBox2
//
this.checkBox2.AutoSize = true;
this.checkBox2.Location = new System.Drawing.Point(29, 60);
this.checkBox2.Name = "checkBox2";
this.checkBox2.Size = new System.Drawing.Size(96, 16);
this.checkBox2.TabIndex = 0;
this.checkBox2.Text = "结果显示交点";
this.checkBox2.UseVisualStyleBackColor = true;
//
// tbx_caliperLength2
//
this.tbx_caliperLength2.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.tbx_caliperLength2.Location = new System.Drawing.Point(124, 277);
this.tbx_caliperLength2.Margin = new System.Windows.Forms.Padding(2);
this.tbx_caliperLength2.Name = "tbx_caliperLength2";
this.tbx_caliperLength2.Size = new System.Drawing.Size(92, 26);
this.tbx_caliperLength2.TabIndex = 301;
//
// label16
//
this.label16.AutoSize = true;
this.label16.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label16.Location = new System.Drawing.Point(34, 280);
this.label16.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(65, 20);
this.label16.TabIndex = 302;
this.label16.Text = "卡尺宽:";
//
// FormFindLine
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -554,18 +558,19 @@
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "FormFindLine";
this.Text = "找线工具";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormFindLine_FormClosing);
this.Load += new System.EventHandler(this.FormFindLine_Load);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.Panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@@ -611,8 +616,8 @@
private System.Windows.Forms.Label label15;
public System.Windows.Forms.TextBox tbx_Sigma;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.CheckBox checkBox2;
private System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.CheckBox chBDispCross;
private System.Windows.Forms.CheckBox chBDispRec;
private System.Windows.Forms.Label label16;
public System.Windows.Forms.TextBox tbx_caliperLength2;
}

View File

@@ -4,6 +4,7 @@ using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
@@ -26,15 +27,25 @@ namespace FindLineTool
{
get
{
lock (_instance)
if(_instance != null)
{
if (_instance == null)
lock (_instance)
{
object line = new object();
_instance = new FormFindLine(ref line);
}
if (_instance == null)
{
object line = new object();
_instance = new FormFindLine(ref line);
}
return _instance;
}
}
else
{
object line = new object();
_instance = new FormFindLine(ref line);
return _instance;
}
}
}
@@ -45,9 +56,9 @@ namespace FindLineTool
_instance = this;
myToolInfo = (IToolInfo)findLine;
myFindLine = (FindLine)myToolInfo.tool;
myFindLine.inputImage = ComGlobalParams.inputImageGlobal; // 暂时直接将图像传递给该工具
//myFindLine.inputImage = ComGlobalParams.inputImageGlobal; // 暂时直接将图像传递给该工具
myFindLine.DispImage();
}
private void FormFindLine_Load(object sender, EventArgs e)
@@ -59,9 +70,11 @@ namespace FindLineTool
private void btn_moveCliperRegion_Click(object sender, EventArgs e)
{
myFindLine.UpdateImage();
myFindLine.DrawExpectLine(myHwindow);
}
public void TextBoxMessageDisp(string mes, Color setColor)
{
txbLog.BackColor = setColor;
@@ -84,7 +97,7 @@ namespace FindLineTool
myFindLine.threshold = Convert.ToInt16(tbx_threshold.Text.Trim());
myFindLine.length = Convert.ToInt16(tbx_caliperLength.Text.Trim());
myFindLine.weidth = Convert.ToInt16(tbx_caliperLength2.Text.Trim());
myFindLine.polarity = cbx_polarity.SelectedItem.ToString() == "明到暗" ? "negative":"positive";
myFindLine.polarity = cbx_polarity.SelectedItem.ToString() == "明到暗" ? "negative":"positive";
myFindLine.edgeSelect = cbx_edgeSelect.SelectedItem.ToString();
myFindLine.sigma = Convert.ToDouble(tbx_Sigma.Text.Trim());
// Run
@@ -105,12 +118,14 @@ namespace FindLineTool
tbx_expectLineEndCol.Text = myFindLine.expectLineEndCol.ToString();
cbx_edgeSelect.Text = myFindLine.edgeSelect;
tbx_minScore.Text = myFindLine.minScore.ToString();
cbx_polarity.Text = myFindLine.polarity == "positive" ? "暗到明" : "明到暗";
cbx_polarity.Text = myFindLine.polarity == "positive" ? "暗到明" : "明到暗";
tbx_caliperNum.Text = myFindLine.cliperNum.ToString();
tbx_caliperLength.Text = myFindLine.length.ToString();
tbx_threshold.Text = myFindLine.threshold.ToString();
tbx_Sigma.Text = myFindLine.sigma.ToString();
tbx_caliperLength2.Text = myFindLine.weidth.ToString();
chBDispRec.Checked = myFindLine.dispRec;
chBDispCross.Checked = myFindLine.dispCross;
}
#region
@@ -165,6 +180,40 @@ namespace FindLineTool
tbx_expectLineEndCol.Text = "600";
}
}
private void chBDispRec_CheckedChanged(object sender, EventArgs e)
{
if(chBDispRec.Checked)
{
myFindLine.dispRec = true;
}
else
{
myFindLine.dispRec = false;
}
}
private void chBDispCross_CheckedChanged(object sender, EventArgs e)
{
if(chBDispCross.Checked)
{
myFindLine.dispCross = true;
}
else
{
myFindLine.dispCross = false;
}
}
#endregion
private void FormFindLine_FormClosing(object sender, FormClosingEventArgs e)
{
myHwindow.Dispose();
this.Dispose();
this.Dispose();
GC.Collect();
}
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -28,19 +28,667 @@
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormHalconTool));
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.superTabControl1 = new DevComponents.DotNetBar.SuperTabControl();
this.superTabControlPanel1 = new DevComponents.DotNetBar.SuperTabControlPanel();
this.txbLog = new System.Windows.Forms.TextBox();
this.panelMultImage = new System.Windows.Forms.Panel();
this.gpb_multImage = new System.Windows.Forms.GroupBox();
this.btn_selectImageDirectory = new System.Windows.Forms.Button();
this.lbl_imageNum = new System.Windows.Forms.Label();
this.lbl_imageName = new System.Windows.Forms.Label();
this.btn_lastImage = new System.Windows.Forms.Button();
this.btn_nextImage = new System.Windows.Forms.Button();
this.tbx_imageDirectory = new System.Windows.Forms.TextBox();
this.panelOneImage = new System.Windows.Forms.Panel();
this.gpb_oneImage = new System.Windows.Forms.GroupBox();
this.btn_readImage = new System.Windows.Forms.Button();
this.tbx_imagePath = new System.Windows.Forms.TextBox();
this.btn_browseImage = new System.Windows.Forms.Button();
this.ckb_autoSwitch = new System.Windows.Forms.CheckBox();
this.btn_runHalconInterfaceTool = new System.Windows.Forms.Button();
this.btn_registImage = new System.Windows.Forms.Button();
this.rdo_readOneImage = new System.Windows.Forms.RadioButton();
this.rdo_readMultImage = new System.Windows.Forms.RadioButton();
this.ckb_RGBToGray = new System.Windows.Forms.CheckBox();
this.tabReadFormLocal = new DevComponents.DotNetBar.SuperTabItem();
this.superTabControlPanel2 = new DevComponents.DotNetBar.SuperTabControlPanel();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.btn_RealTime = new System.Windows.Forms.Button();
this.cbx_deviceList = new System.Windows.Forms.ComboBox();
this.button1 = new System.Windows.Forms.Button();
this.label148 = new System.Windows.Forms.Label();
this.tbx_exposure = new System.Windows.Forms.TextBox();
this.button2 = new System.Windows.Forms.Button();
this.label147 = new System.Windows.Forms.Label();
this.btn_saveImage = new System.Windows.Forms.Button();
this.label123 = new System.Windows.Forms.Label();
this.tabReadFormCamera = new DevComponents.DotNetBar.SuperTabItem();
this.superTabControl2 = new DevComponents.DotNetBar.SuperTabControl();
this.imageDispPanel = new DevComponents.DotNetBar.SuperTabControlPanel();
this.superTabItem1 = new DevComponents.DotNetBar.SuperTabItem();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.superTabControl1)).BeginInit();
this.superTabControl1.SuspendLayout();
this.superTabControlPanel1.SuspendLayout();
this.panelMultImage.SuspendLayout();
this.gpb_multImage.SuspendLayout();
this.panelOneImage.SuspendLayout();
this.gpb_oneImage.SuspendLayout();
this.superTabControlPanel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.superTabControl2)).BeginInit();
this.superTabControl2.SuspendLayout();
this.SuspendLayout();
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.superTabControl1);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.superTabControl2);
this.splitContainer1.Size = new System.Drawing.Size(1111, 477);
this.splitContainer1.SplitterDistance = 590;
this.splitContainer1.TabIndex = 1;
//
// superTabControl1
//
this.superTabControl1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(239)))), ((int)(((byte)(239)))), ((int)(((byte)(242)))));
//
//
//
//
//
//
this.superTabControl1.ControlBox.CloseBox.Name = "";
//
//
//
this.superTabControl1.ControlBox.MenuBox.Name = "";
this.superTabControl1.ControlBox.Name = "";
this.superTabControl1.ControlBox.SubItems.AddRange(new DevComponents.DotNetBar.BaseItem[] {
this.superTabControl1.ControlBox.MenuBox,
this.superTabControl1.ControlBox.CloseBox});
this.superTabControl1.Controls.Add(this.superTabControlPanel1);
this.superTabControl1.Controls.Add(this.superTabControlPanel2);
this.superTabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.superTabControl1.ForeColor = System.Drawing.Color.Black;
this.superTabControl1.Location = new System.Drawing.Point(0, 0);
this.superTabControl1.Name = "superTabControl1";
this.superTabControl1.ReorderTabsEnabled = true;
this.superTabControl1.SelectedTabFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold);
this.superTabControl1.SelectedTabIndex = 0;
this.superTabControl1.Size = new System.Drawing.Size(590, 477);
this.superTabControl1.TabFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.superTabControl1.TabIndex = 1;
this.superTabControl1.Tabs.AddRange(new DevComponents.DotNetBar.BaseItem[] {
this.tabReadFormLocal,
this.tabReadFormCamera});
this.superTabControl1.TabStyle = DevComponents.DotNetBar.eSuperTabStyle.OfficeMobile2014;
this.superTabControl1.Text = "superTabControl1";
//
// superTabControlPanel1
//
this.superTabControlPanel1.Controls.Add(this.txbLog);
this.superTabControlPanel1.Controls.Add(this.panelMultImage);
this.superTabControlPanel1.Controls.Add(this.panelOneImage);
this.superTabControlPanel1.Controls.Add(this.btn_browseImage);
this.superTabControlPanel1.Controls.Add(this.ckb_autoSwitch);
this.superTabControlPanel1.Controls.Add(this.btn_runHalconInterfaceTool);
this.superTabControlPanel1.Controls.Add(this.btn_registImage);
this.superTabControlPanel1.Controls.Add(this.rdo_readOneImage);
this.superTabControlPanel1.Controls.Add(this.rdo_readMultImage);
this.superTabControlPanel1.Controls.Add(this.ckb_RGBToGray);
this.superTabControlPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.superTabControlPanel1.Location = new System.Drawing.Point(0, 36);
this.superTabControlPanel1.Name = "superTabControlPanel1";
this.superTabControlPanel1.Size = new System.Drawing.Size(590, 441);
this.superTabControlPanel1.TabIndex = 1;
this.superTabControlPanel1.TabItem = this.tabReadFormLocal;
//
// txbLog
//
this.txbLog.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txbLog.Location = new System.Drawing.Point(3, 420);
this.txbLog.Name = "txbLog";
this.txbLog.Size = new System.Drawing.Size(585, 21);
this.txbLog.TabIndex = 93;
//
// panelMultImage
//
this.panelMultImage.BackColor = System.Drawing.Color.White;
this.panelMultImage.Controls.Add(this.gpb_multImage);
this.panelMultImage.Location = new System.Drawing.Point(77, 69);
this.panelMultImage.Name = "panelMultImage";
this.panelMultImage.Size = new System.Drawing.Size(462, 182);
this.panelMultImage.TabIndex = 92;
//
// gpb_multImage
//
this.gpb_multImage.Controls.Add(this.btn_selectImageDirectory);
this.gpb_multImage.Controls.Add(this.lbl_imageNum);
this.gpb_multImage.Controls.Add(this.lbl_imageName);
this.gpb_multImage.Controls.Add(this.btn_lastImage);
this.gpb_multImage.Controls.Add(this.btn_nextImage);
this.gpb_multImage.Controls.Add(this.tbx_imageDirectory);
this.gpb_multImage.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.gpb_multImage.Location = new System.Drawing.Point(6, 4);
this.gpb_multImage.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.gpb_multImage.Name = "gpb_multImage";
this.gpb_multImage.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.gpb_multImage.Size = new System.Drawing.Size(451, 170);
this.gpb_multImage.TabIndex = 15;
this.gpb_multImage.TabStop = false;
this.gpb_multImage.Text = "图像文件夹路径";
//
// btn_selectImageDirectory
//
this.btn_selectImageDirectory.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_selectImageDirectory.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn_selectImageDirectory.Location = new System.Drawing.Point(18, 99);
this.btn_selectImageDirectory.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.btn_selectImageDirectory.Name = "btn_selectImageDirectory";
this.btn_selectImageDirectory.Size = new System.Drawing.Size(98, 32);
this.btn_selectImageDirectory.TabIndex = 63;
this.btn_selectImageDirectory.Text = "选择路径";
this.btn_selectImageDirectory.UseVisualStyleBackColor = true;
this.btn_selectImageDirectory.Click += new System.EventHandler(this.btn_selectImageDirectory_Click);
//
// lbl_imageNum
//
this.lbl_imageNum.AutoSize = true;
this.lbl_imageNum.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbl_imageNum.Location = new System.Drawing.Point(386, 70);
this.lbl_imageNum.Name = "lbl_imageNum";
this.lbl_imageNum.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.lbl_imageNum.Size = new System.Drawing.Size(39, 17);
this.lbl_imageNum.TabIndex = 62;
this.lbl_imageNum.Text = "共0张";
this.lbl_imageNum.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// lbl_imageName
//
this.lbl_imageName.AutoSize = true;
this.lbl_imageName.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbl_imageName.Location = new System.Drawing.Point(15, 70);
this.lbl_imageName.Name = "lbl_imageName";
this.lbl_imageName.Size = new System.Drawing.Size(0, 17);
this.lbl_imageName.TabIndex = 61;
//
// btn_lastImage
//
this.btn_lastImage.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_lastImage.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn_lastImage.Location = new System.Drawing.Point(339, 99);
this.btn_lastImage.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.btn_lastImage.Name = "btn_lastImage";
this.btn_lastImage.Size = new System.Drawing.Size(33, 32);
this.btn_lastImage.TabIndex = 9;
this.btn_lastImage.TabStop = false;
this.btn_lastImage.Text = "<<";
this.btn_lastImage.UseVisualStyleBackColor = true;
this.btn_lastImage.Click += new System.EventHandler(this.btn_nextImage_Click);
//
// btn_nextImage
//
this.btn_nextImage.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_nextImage.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn_nextImage.Location = new System.Drawing.Point(375, 99);
this.btn_nextImage.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.btn_nextImage.Name = "btn_nextImage";
this.btn_nextImage.Size = new System.Drawing.Size(33, 32);
this.btn_nextImage.TabIndex = 8;
this.btn_nextImage.TabStop = false;
this.btn_nextImage.Text = ">>";
this.btn_nextImage.UseVisualStyleBackColor = true;
this.btn_nextImage.Click += new System.EventHandler(this.btn_nextImage_Click);
//
// tbx_imageDirectory
//
this.tbx_imageDirectory.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.tbx_imageDirectory.Location = new System.Drawing.Point(18, 28);
this.tbx_imageDirectory.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.tbx_imageDirectory.Multiline = true;
this.tbx_imageDirectory.Name = "tbx_imageDirectory";
this.tbx_imageDirectory.Size = new System.Drawing.Size(415, 38);
this.tbx_imageDirectory.TabIndex = 5;
//
// panelOneImage
//
this.panelOneImage.BackColor = System.Drawing.Color.White;
this.panelOneImage.Controls.Add(this.gpb_oneImage);
this.panelOneImage.Location = new System.Drawing.Point(79, 69);
this.panelOneImage.Name = "panelOneImage";
this.panelOneImage.Size = new System.Drawing.Size(460, 176);
this.panelOneImage.TabIndex = 91;
//
// gpb_oneImage
//
this.gpb_oneImage.BackColor = System.Drawing.Color.White;
this.gpb_oneImage.Controls.Add(this.btn_readImage);
this.gpb_oneImage.Controls.Add(this.tbx_imagePath);
this.gpb_oneImage.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.gpb_oneImage.Location = new System.Drawing.Point(9, 10);
this.gpb_oneImage.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.gpb_oneImage.Name = "gpb_oneImage";
this.gpb_oneImage.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.gpb_oneImage.Size = new System.Drawing.Size(440, 153);
this.gpb_oneImage.TabIndex = 83;
this.gpb_oneImage.TabStop = false;
this.gpb_oneImage.Text = "图像路径";
//
// btn_readImage
//
this.btn_readImage.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_readImage.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn_readImage.Location = new System.Drawing.Point(21, 95);
this.btn_readImage.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.btn_readImage.Name = "btn_readImage";
this.btn_readImage.Size = new System.Drawing.Size(85, 32);
this.btn_readImage.TabIndex = 3;
this.btn_readImage.Text = "加载";
this.btn_readImage.UseVisualStyleBackColor = true;
this.btn_readImage.Click += new System.EventHandler(this.btn_readImage_Click);
//
// tbx_imagePath
//
this.tbx_imagePath.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.tbx_imagePath.Location = new System.Drawing.Point(18, 28);
this.tbx_imagePath.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.tbx_imagePath.Name = "tbx_imagePath";
this.tbx_imagePath.Size = new System.Drawing.Size(415, 23);
this.tbx_imagePath.TabIndex = 1;
//
// btn_browseImage
//
this.btn_browseImage.BackColor = System.Drawing.Color.White;
this.btn_browseImage.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_browseImage.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn_browseImage.Location = new System.Drawing.Point(156, 357);
this.btn_browseImage.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.btn_browseImage.Name = "btn_browseImage";
this.btn_browseImage.Size = new System.Drawing.Size(76, 26);
this.btn_browseImage.TabIndex = 90;
this.btn_browseImage.Text = "查看图像";
this.btn_browseImage.UseVisualStyleBackColor = false;
//
// ckb_autoSwitch
//
this.ckb_autoSwitch.AutoSize = true;
this.ckb_autoSwitch.BackColor = System.Drawing.Color.White;
this.ckb_autoSwitch.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.ckb_autoSwitch.Location = new System.Drawing.Point(74, 322);
this.ckb_autoSwitch.Margin = new System.Windows.Forms.Padding(2);
this.ckb_autoSwitch.Name = "ckb_autoSwitch";
this.ckb_autoSwitch.Size = new System.Drawing.Size(99, 21);
this.ckb_autoSwitch.TabIndex = 82;
this.ckb_autoSwitch.Text = "图像自动切换";
this.ckb_autoSwitch.UseVisualStyleBackColor = false;
//
// btn_runHalconInterfaceTool
//
this.btn_runHalconInterfaceTool.BackColor = System.Drawing.Color.White;
this.btn_runHalconInterfaceTool.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_runHalconInterfaceTool.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn_runHalconInterfaceTool.Location = new System.Drawing.Point(436, 348);
this.btn_runHalconInterfaceTool.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.btn_runHalconInterfaceTool.Name = "btn_runHalconInterfaceTool";
this.btn_runHalconInterfaceTool.Size = new System.Drawing.Size(98, 45);
this.btn_runHalconInterfaceTool.TabIndex = 88;
this.btn_runHalconInterfaceTool.TabStop = false;
this.btn_runHalconInterfaceTool.Text = "运行";
this.btn_runHalconInterfaceTool.UseVisualStyleBackColor = false;
this.btn_runHalconInterfaceTool.Click += new System.EventHandler(this.btn_runHalconInterfaceTool_Click);
//
// btn_registImage
//
this.btn_registImage.BackColor = System.Drawing.Color.White;
this.btn_registImage.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_registImage.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn_registImage.Location = new System.Drawing.Point(74, 357);
this.btn_registImage.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.btn_registImage.Name = "btn_registImage";
this.btn_registImage.Size = new System.Drawing.Size(76, 26);
this.btn_registImage.TabIndex = 84;
this.btn_registImage.Text = "注册图像";
this.btn_registImage.UseVisualStyleBackColor = false;
//
// rdo_readOneImage
//
this.rdo_readOneImage.AutoSize = true;
this.rdo_readOneImage.BackColor = System.Drawing.Color.White;
this.rdo_readOneImage.Checked = true;
this.rdo_readOneImage.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.rdo_readOneImage.Location = new System.Drawing.Point(365, 25);
this.rdo_readOneImage.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.rdo_readOneImage.Name = "rdo_readOneImage";
this.rdo_readOneImage.Size = new System.Drawing.Size(74, 21);
this.rdo_readOneImage.TabIndex = 86;
this.rdo_readOneImage.TabStop = true;
this.rdo_readOneImage.Text = "单张图像";
this.rdo_readOneImage.UseVisualStyleBackColor = false;
this.rdo_readOneImage.Click += new System.EventHandler(this.rdo_readMultImage_CheckedChanged);
//
// rdo_readMultImage
//
this.rdo_readMultImage.AutoSize = true;
this.rdo_readMultImage.BackColor = System.Drawing.Color.White;
this.rdo_readMultImage.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.rdo_readMultImage.Location = new System.Drawing.Point(139, 25);
this.rdo_readMultImage.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.rdo_readMultImage.Name = "rdo_readMultImage";
this.rdo_readMultImage.Size = new System.Drawing.Size(74, 21);
this.rdo_readMultImage.TabIndex = 85;
this.rdo_readMultImage.Text = "多张图像";
this.rdo_readMultImage.UseVisualStyleBackColor = false;
this.rdo_readMultImage.Click += new System.EventHandler(this.rdo_readMultImage_CheckedChanged);
//
// ckb_RGBToGray
//
this.ckb_RGBToGray.AutoSize = true;
this.ckb_RGBToGray.BackColor = System.Drawing.Color.White;
this.ckb_RGBToGray.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.ckb_RGBToGray.Location = new System.Drawing.Point(74, 297);
this.ckb_RGBToGray.Margin = new System.Windows.Forms.Padding(2);
this.ckb_RGBToGray.Name = "ckb_RGBToGray";
this.ckb_RGBToGray.Size = new System.Drawing.Size(99, 21);
this.ckb_RGBToGray.TabIndex = 89;
this.ckb_RGBToGray.Text = "彩图转灰度图";
this.ckb_RGBToGray.UseVisualStyleBackColor = false;
//
// tabReadFormLocal
//
this.tabReadFormLocal.AttachedControl = this.superTabControlPanel1;
this.tabReadFormLocal.GlobalItem = false;
this.tabReadFormLocal.Name = "tabReadFormLocal";
this.tabReadFormLocal.Text = "本地读取";
//
// superTabControlPanel2
//
this.superTabControlPanel2.Controls.Add(this.checkBox1);
this.superTabControlPanel2.Controls.Add(this.btn_RealTime);
this.superTabControlPanel2.Controls.Add(this.cbx_deviceList);
this.superTabControlPanel2.Controls.Add(this.button1);
this.superTabControlPanel2.Controls.Add(this.label148);
this.superTabControlPanel2.Controls.Add(this.tbx_exposure);
this.superTabControlPanel2.Controls.Add(this.button2);
this.superTabControlPanel2.Controls.Add(this.label147);
this.superTabControlPanel2.Controls.Add(this.btn_saveImage);
this.superTabControlPanel2.Controls.Add(this.label123);
this.superTabControlPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.superTabControlPanel2.Location = new System.Drawing.Point(0, 36);
this.superTabControlPanel2.Name = "superTabControlPanel2";
this.superTabControlPanel2.Size = new System.Drawing.Size(590, 441);
this.superTabControlPanel2.TabIndex = 0;
this.superTabControlPanel2.TabItem = this.tabReadFormCamera;
//
// checkBox1
//
this.checkBox1.AutoSize = true;
this.checkBox1.BackColor = System.Drawing.Color.White;
this.checkBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.checkBox1.Location = new System.Drawing.Point(46, 164);
this.checkBox1.Margin = new System.Windows.Forms.Padding(2);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(99, 21);
this.checkBox1.TabIndex = 113;
this.checkBox1.Text = "彩图转灰度图";
this.checkBox1.UseVisualStyleBackColor = false;
//
// btn_RealTime
//
this.btn_RealTime.BackColor = System.Drawing.Color.White;
this.btn_RealTime.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_RealTime.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn_RealTime.Location = new System.Drawing.Point(150, 200);
this.btn_RealTime.Margin = new System.Windows.Forms.Padding(2);
this.btn_RealTime.Name = "btn_RealTime";
this.btn_RealTime.Size = new System.Drawing.Size(76, 26);
this.btn_RealTime.TabIndex = 110;
this.btn_RealTime.Text = "实时显示";
this.btn_RealTime.UseVisualStyleBackColor = false;
//
// cbx_deviceList
//
this.cbx_deviceList.BackColor = System.Drawing.Color.Gainsboro;
this.cbx_deviceList.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbx_deviceList.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.cbx_deviceList.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.cbx_deviceList.FormattingEnabled = true;
this.cbx_deviceList.Items.AddRange(new object[] {
""});
this.cbx_deviceList.Location = new System.Drawing.Point(49, 61);
this.cbx_deviceList.Margin = new System.Windows.Forms.Padding(2);
this.cbx_deviceList.Name = "cbx_deviceList";
this.cbx_deviceList.Size = new System.Drawing.Size(522, 25);
this.cbx_deviceList.TabIndex = 104;
//
// button1
//
this.button1.BackColor = System.Drawing.Color.White;
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button1.Location = new System.Drawing.Point(460, 288);
this.button1.Margin = new System.Windows.Forms.Padding(2);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(98, 45);
this.button1.TabIndex = 109;
this.button1.Text = "运行";
this.button1.UseVisualStyleBackColor = false;
//
// label148
//
this.label148.AutoSize = true;
this.label148.BackColor = System.Drawing.Color.White;
this.label148.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label148.Location = new System.Drawing.Point(170, 107);
this.label148.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label148.Name = "label148";
this.label148.Size = new System.Drawing.Size(25, 17);
this.label148.TabIndex = 107;
this.label148.Text = "ms";
//
// tbx_exposure
//
this.tbx_exposure.BackColor = System.Drawing.Color.White;
this.tbx_exposure.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.tbx_exposure.Location = new System.Drawing.Point(109, 103);
this.tbx_exposure.Margin = new System.Windows.Forms.Padding(2);
this.tbx_exposure.Name = "tbx_exposure";
this.tbx_exposure.Size = new System.Drawing.Size(61, 23);
this.tbx_exposure.TabIndex = 106;
this.tbx_exposure.Text = "0";
//
// button2
//
this.button2.BackColor = System.Drawing.Color.White;
this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button2.Location = new System.Drawing.Point(46, 200);
this.button2.Margin = new System.Windows.Forms.Padding(2);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(76, 26);
this.button2.TabIndex = 112;
this.button2.Text = "注册图像";
this.button2.UseVisualStyleBackColor = false;
//
// label147
//
this.label147.AutoSize = true;
this.label147.BackColor = System.Drawing.Color.White;
this.label147.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label147.Location = new System.Drawing.Point(46, 106);
this.label147.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label147.Name = "label147";
this.label147.Size = new System.Drawing.Size(68, 17);
this.label147.TabIndex = 105;
this.label147.Text = "曝光时间:";
//
// btn_saveImage
//
this.btn_saveImage.BackColor = System.Drawing.Color.White;
this.btn_saveImage.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_saveImage.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn_saveImage.Location = new System.Drawing.Point(248, 200);
this.btn_saveImage.Margin = new System.Windows.Forms.Padding(2);
this.btn_saveImage.Name = "btn_saveImage";
this.btn_saveImage.Size = new System.Drawing.Size(76, 26);
this.btn_saveImage.TabIndex = 111;
this.btn_saveImage.Text = "图像另存";
this.btn_saveImage.UseVisualStyleBackColor = false;
//
// label123
//
this.label123.AutoSize = true;
this.label123.BackColor = System.Drawing.Color.White;
this.label123.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label123.Location = new System.Drawing.Point(46, 42);
this.label123.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label123.Name = "label123";
this.label123.Size = new System.Drawing.Size(56, 17);
this.label123.TabIndex = 108;
this.label123.Text = "设备列表";
//
// tabReadFormCamera
//
this.tabReadFormCamera.AttachedControl = this.superTabControlPanel2;
this.tabReadFormCamera.GlobalItem = false;
this.tabReadFormCamera.Name = "tabReadFormCamera";
this.tabReadFormCamera.Text = "相机读取";
//
// superTabControl2
//
this.superTabControl2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(239)))), ((int)(((byte)(239)))), ((int)(((byte)(242)))));
//
//
//
//
//
//
this.superTabControl2.ControlBox.CloseBox.Name = "";
//
//
//
this.superTabControl2.ControlBox.MenuBox.Name = "";
this.superTabControl2.ControlBox.Name = "";
this.superTabControl2.ControlBox.SubItems.AddRange(new DevComponents.DotNetBar.BaseItem[] {
this.superTabControl2.ControlBox.MenuBox,
this.superTabControl2.ControlBox.CloseBox});
this.superTabControl2.Controls.Add(this.imageDispPanel);
this.superTabControl2.Dock = System.Windows.Forms.DockStyle.Fill;
this.superTabControl2.ForeColor = System.Drawing.Color.Black;
this.superTabControl2.Location = new System.Drawing.Point(0, 0);
this.superTabControl2.Name = "superTabControl2";
this.superTabControl2.ReorderTabsEnabled = true;
this.superTabControl2.SelectedTabFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold);
this.superTabControl2.SelectedTabIndex = 0;
this.superTabControl2.Size = new System.Drawing.Size(517, 477);
this.superTabControl2.TabFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.superTabControl2.TabIndex = 0;
this.superTabControl2.Tabs.AddRange(new DevComponents.DotNetBar.BaseItem[] {
this.superTabItem1});
this.superTabControl2.TabStyle = DevComponents.DotNetBar.eSuperTabStyle.OfficeMobile2014;
this.superTabControl2.Text = "显示图像";
//
// imageDispPanel
//
this.imageDispPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.imageDispPanel.Location = new System.Drawing.Point(0, 36);
this.imageDispPanel.Name = "imageDispPanel";
this.imageDispPanel.Size = new System.Drawing.Size(517, 441);
this.imageDispPanel.TabIndex = 1;
this.imageDispPanel.TabItem = this.superTabItem1;
//
// superTabItem1
//
this.superTabItem1.AttachedControl = this.imageDispPanel;
this.superTabItem1.GlobalItem = false;
this.superTabItem1.Name = "superTabItem1";
this.superTabItem1.Text = "显示图像";
//
// FormHalconTool
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(816, 438);
this.ClientSize = new System.Drawing.Size(1111, 477);
this.Controls.Add(this.splitContainer1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "FormHalconTool";
this.Text = "FormHalconTool";
this.Text = "Halcon读取";
this.Load += new System.EventHandler(this.FormHalconTool_Load);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.superTabControl1)).EndInit();
this.superTabControl1.ResumeLayout(false);
this.superTabControlPanel1.ResumeLayout(false);
this.superTabControlPanel1.PerformLayout();
this.panelMultImage.ResumeLayout(false);
this.gpb_multImage.ResumeLayout(false);
this.gpb_multImage.PerformLayout();
this.panelOneImage.ResumeLayout(false);
this.gpb_oneImage.ResumeLayout(false);
this.gpb_oneImage.PerformLayout();
this.superTabControlPanel2.ResumeLayout(false);
this.superTabControlPanel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.superTabControl2)).EndInit();
this.superTabControl2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.SplitContainer splitContainer1;
private DevComponents.DotNetBar.SuperTabControl superTabControl1;
private DevComponents.DotNetBar.SuperTabControlPanel superTabControlPanel1;
private System.Windows.Forms.Panel panelMultImage;
public System.Windows.Forms.GroupBox gpb_multImage;
public System.Windows.Forms.Button btn_selectImageDirectory;
public System.Windows.Forms.Label lbl_imageNum;
public System.Windows.Forms.Label lbl_imageName;
internal System.Windows.Forms.Button btn_lastImage;
internal System.Windows.Forms.Button btn_nextImage;
internal System.Windows.Forms.TextBox tbx_imageDirectory;
private System.Windows.Forms.Panel panelOneImage;
public System.Windows.Forms.GroupBox gpb_oneImage;
internal System.Windows.Forms.Button btn_readImage;
internal System.Windows.Forms.TextBox tbx_imagePath;
public System.Windows.Forms.Button btn_browseImage;
public System.Windows.Forms.CheckBox ckb_autoSwitch;
public System.Windows.Forms.Button btn_runHalconInterfaceTool;
public System.Windows.Forms.Button btn_registImage;
public System.Windows.Forms.RadioButton rdo_readOneImage;
public System.Windows.Forms.RadioButton rdo_readMultImage;
public System.Windows.Forms.CheckBox ckb_RGBToGray;
private DevComponents.DotNetBar.SuperTabItem tabReadFormLocal;
private DevComponents.DotNetBar.SuperTabControlPanel superTabControlPanel2;
public System.Windows.Forms.CheckBox checkBox1;
internal System.Windows.Forms.Button btn_RealTime;
internal System.Windows.Forms.ComboBox cbx_deviceList;
internal System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label148;
internal System.Windows.Forms.TextBox tbx_exposure;
internal System.Windows.Forms.Button button2;
private System.Windows.Forms.Label label147;
internal System.Windows.Forms.Button btn_saveImage;
private System.Windows.Forms.Label label123;
private DevComponents.DotNetBar.SuperTabItem tabReadFormCamera;
private DevComponents.DotNetBar.SuperTabControl superTabControl2;
private DevComponents.DotNetBar.SuperTabControlPanel imageDispPanel;
private DevComponents.DotNetBar.SuperTabItem superTabItem1;
public System.Windows.Forms.TextBox txbLog;
}
}

View File

@@ -3,18 +3,193 @@ using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using CommonMethods;
using HalconDotNet;
using HalconWindow.HalconWindow;
namespace HalconTool
{
public partial class FormHalconTool : Form
{
public FormHalconTool()
public HalconTool myHalconTool = null;
public IToolInfo myToolInfo = null;
public HWindow_Final myHwindow = new HWindow_Final();
public FormHalconTool(ref object halconTool)
{
InitializeComponent();
myToolInfo = (IToolInfo)halconTool;
myHalconTool = (HalconTool)myToolInfo.tool;
_instance = this;
}
private static FormHalconTool _instance;
public static FormHalconTool Instance
{
get
{
lock (_instance)
{
if (_instance == null)
{
object halconTool = new object();
_instance = new FormHalconTool(ref halconTool);
}
return _instance;
}
}
}
private void rdo_readMultImage_CheckedChanged(object sender, EventArgs e)
{
if (rdo_readOneImage.Checked)
{
this.ckb_autoSwitch.Visible = false;
this.panelOneImage.Visible = true;
this.panelMultImage.Visible = false;
this.btn_browseImage.Visible = false;
myHalconTool.workMode = WorkMode.ReadOneImage;
myHalconTool.outputImageFilePath = myHalconTool.imagePath;
}
else
{
this.ckb_autoSwitch.Visible = true;
this.panelMultImage.Visible = true;
this.panelOneImage.Visible = false;
this.btn_browseImage.Visible = true;
myHalconTool.workMode = WorkMode.ReadMultImage;
myHalconTool.outputImageFilePath = myHalconTool.L_imageFile[myHalconTool.currentImageIndex];
}
btn_runHalconInterfaceTool_Click(null, null);
}
private void FormHalconTool_Load(object sender, EventArgs e)
{
rdo_readMultImage_CheckedChanged(null, null);
this.imageDispPanel.Controls.Add(myHwindow);
myHwindow.Dock = DockStyle.Fill;
InitTool();
}
private void btn_readImage_Click(object sender, EventArgs e)
{
myHalconTool.ReadImage(out myHalconTool.imagePath);
this.tbx_imagePath.Text = myHalconTool.imagePath;
btn_runHalconInterfaceTool_Click(null, null);
}
private void btn_runHalconInterfaceTool_Click(object sender, EventArgs e)
{
if(myHalconTool.workMode == WorkMode.ReadOneImage)
{
}
if(myHalconTool.workMode == WorkMode.ReadMultImage)
{
}
myHalconTool.DispImage();
ParamsTrans();
}
public void InitTool()
{
tbx_imagePath.Text = myHalconTool.imagePath;
tbx_imageDirectory.Text = myHalconTool.imageDirectoryPath;
ckb_RGBToGray.Checked = myHalconTool.RGBToGray;
ckb_autoSwitch.Checked = myHalconTool.autoSwitch;
}
private void btn_selectImageDirectory_Click(object sender, EventArgs e)
{
myHalconTool.imageDirectoryPath = string.Empty;
try
{
FolderBrowserDialog folderBrowseDialog = new FolderBrowserDialog();
if (Directory.Exists(myHalconTool.imageDirectoryPath))
folderBrowseDialog.SelectedPath = myHalconTool.imageDirectoryPath;
folderBrowseDialog.Description = "请选择图像文件夹路径";
if (folderBrowseDialog.ShowDialog() == DialogResult.OK)
{
myHalconTool.imageDirectoryPath = folderBrowseDialog.SelectedPath;
this.tbx_imageDirectory.Text = myHalconTool.imageDirectoryPath;
myHalconTool.L_imageFile.Clear();
string[] files = Directory.GetFiles(folderBrowseDialog.SelectedPath);
for (int i = 0; i < files.Length; i++)
{
FileInfo fileInfo = new FileInfo(files[i]);
if (fileInfo.Extension == ".jpg" || fileInfo.Extension == ".bmp" || fileInfo.Extension == ".png" || fileInfo.Extension == ".tif")
myHalconTool.L_imageFile.Add(files[i]);
}
if (myHalconTool.L_imageFile.Count > 0)
{
myHalconTool.currentImageIndex = 0;
myHalconTool.outputImageFilePath = myHalconTool.L_imageFile[myHalconTool.currentImageIndex];
myHalconTool.DispImage();
myHalconTool.currentImageName = Path.GetFileName(myHalconTool.L_imageFile[0]);
lbl_imageName.Text = myHalconTool.currentImageName;
}
lbl_imageNum.Text = "共" + myHalconTool.L_imageFile.Count + "张";
}
}
catch (Exception ex)
{
this.txbLog.Text = ex.Message;
}
}
private void btn_nextImage_Click(object sender, EventArgs e)
{
try
{
HObject image = new HObject();
Button btnClick = sender as Button;
if(btnClick.Name == "btn_nextImage")
{
myHalconTool.currentImageIndex = myHalconTool.currentImageIndex + 1;
}
else
{
myHalconTool.currentImageIndex = myHalconTool.currentImageIndex - 1;
}
if (myHalconTool.currentImageIndex > myHalconTool.L_imageFile.Count - 1)
{
myHalconTool.currentImageIndex = 0;
}
try
{
myHalconTool.outputImageFilePath = myHalconTool.L_imageFile[myHalconTool.currentImageIndex];
}
catch
{
txbLog.Text = "图像文件异常或路径不合法";
return;
}
myHalconTool.DispImage();
myHalconTool.currentImageName = Path.GetFileName(myHalconTool.L_imageFile[myHalconTool.currentImageIndex]);
Instance.lbl_imageName.Text = myHalconTool.currentImageName;
Instance.lbl_imageNum.Text = "共" + myHalconTool.L_imageFile.Count + "张";
}
catch (Exception ex)
{
txbLog.Text = ex.Message;
}
}
/// <summary>
/// 将数据传递给HalconToolInterface
/// </summary>
private void ParamsTrans()
{
myToolInfo.toolOutput.Clear();
myToolInfo.toolOutput.Add(new ToolIO("OutputImage", myHalconTool.outputImage, DataType.Image));
}
}
}

View File

@@ -117,4 +117,89 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAIyAAAAEAIACoEgAAFgAAACgAAAAjAAAAQAAAAAEAIAAAAAAAgBEAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAGyU0ZFdeafFscnz/bHJ8/2xyfP9scnz/bHJ8/2xyfP9scnz/bHJ8/2xyfP9scnz/bHJ8/2xy
fP9scnz/bHJ8/2xyfP9scnz/bHJ8/2xyfP9scnz/bHJ8/2xyfP9scnz/bHJ8/2xyfP9scnz/bHJ8/2xy
fP9scnz/bHJ8/1dfavUcJjRsAAAAABkjMgZbYWnz+fHY//nv0f/579H/+e/R//nv0f/579H/+e/R//nv
0f/579H/+e/R//nv0f/579H/+e/R//nv0f/579H/+e/R//nv0f/579H/+e/R//nv0f/579H/+e/R//nv
0f/579H/+e/R//nv0f/579H/+e/R//nv0f/579H/+vHX/19lbPcZIzIIGSQ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LzpHvxkjMgYAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkk
MgoeKDeHUlll5Wlxe/1qcnz/anJ8/2pyfP9qcnz/anJ8/2pyfP9qcnz/anJ8/2pyfP9qcXv9U1pm5x8o
N4kZIzIKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAGAAAACAAAAAIAAAAIAA
AAAgAAAAgAAAACAAAACAAAAAIAAAAIAAAAAgAAAAgAAAACAAAACAAAAAIAAAAIAAAAAgAAAAgAAAACAA
AACAAAAAIAAAAIAAAAAgAAAAgAAAACAAAACAAAAAIAAAAIAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAACAA
AAD/H/8f4AAAAP8f/x/gAAAA/x//H+AAAAD/H/8f4AAAAP+AAD/gAAAA/4AAP+AAAAD/wAB/4AAAAA==
</value>
</data>
</root>

View File

@@ -4,75 +4,160 @@ using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using CommonMethods;
using HalconDotNet;
using ToolBase;
namespace HalconTool
{
public class HalconTool
public class HalconTool: IToolBase
{
/// <summary>
/// 流程名
/// </summary>
internal string jobName = string.Empty;
public string jobName = string.Empty;
/// <summary>
/// 曝光时间
/// </summary>
internal Int32 exposure = 30;
public Int32 exposure = 5;
/// <summary>
/// 图像的获取方式
/// </summary>
//internal ImageSourceMode imageSourceMode = ImageSourceMode.FormDevice;
public ImageSourceMode imageSourceMode = ImageSourceMode.FormDevice;
/// <summary>
/// 是否处于实时采集模式
/// </summary>
internal bool realTimeMode = false;
public bool realTimeMode = false;
/// <summary>
/// 相机句柄
/// </summary>
internal Int64 cameraHandle = -1;
public Int64 cameraHandle = -1;
/// <summary>
/// 设备信息字符串包括了相机SN、品牌等信息
/// </summary>
internal string deviceInfoStr = string.Empty;
public string deviceInfoStr = string.Empty;
/// <summary>
/// 实时采集线程
/// </summary>
internal static Thread th_acq; //Thread类不能序列化所以申明为静态的
public static Thread th_acq ; //Thread类不能序列化所以申明为静态的
/// <summary>
/// 读取文件夹图像模式时每次运行是否自动切换图像
/// </summary>
internal bool autoSwitch = true;
public bool autoSwitch = true;
/// <summary>
/// 是否将彩色图像转化成灰度图像
/// </summary>
internal bool RGBToGray = true;
public bool RGBToGray = true;
/// <summary>
/// 工作模式为读取文件夹图像时,当前图像的名称
/// </summary>
internal string currentImageName = "";
public string currentImageName = "";
/// <summary>
/// 工作模式为读取文件夹图像时,当前显示的图片的索引
/// </summary>
internal int currentImageIndex = 0;
public int currentImageIndex = 0;
/// <summary>
/// 文件夹中的图像文件集合
/// </summary>
internal List<string> L_imageFile = new List<string>();
public List<string> L_imageFile = new List<string>();
/// <summary>
/// 单张图像的文件路径
/// </summary>
internal string imagePath = string.Empty;
public string imagePath = string.Empty;
/// <summary>
/// 图像文件夹路径
/// </summary>
internal string imageDirectoryPath = string.Empty;
public string imageDirectoryPath = string.Empty;
/// <summary>
/// 输出图像
/// </summary>
internal HObject outputImage;
public HObject outputImage = null;
/// <summary>
/// 输出图像的路径
/// </summary>
public string outputImageFilePath = null;
/// <summary>
/// 读取单张图像或批量读取文件夹图像工作模式
/// </summary>
//internal WorkMode workMode = WorkMode.ReadMultImage;
internal WorkMode workMode = WorkMode.ReadMultImage;
public ToolRunStatu toolRunStatu
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public HObject inputImage
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public bool ReadImage(out string filePath)
{
filePath = string.Empty;
HTuple channelCount = 0;
OpenFileDialog dig_openImage = new OpenFileDialog();
dig_openImage.Title = "请选择图像文件路径";
dig_openImage.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
dig_openImage.Filter = "图像文件(*.*)|*.*|图像文件(*.png)|*.png|图像文件(*.jpg)|*.jpg|图像文件(*.tif)|*.tif";
if (dig_openImage.ShowDialog() == DialogResult.OK)
{
filePath = dig_openImage.FileName;
outputImageFilePath = dig_openImage.FileName;
}
return true;
}
public void Run()
{
DispImage();
}
public void DispImage()
{
HObject image = new HObject();
try
{
if(outputImageFilePath != null)
{
HOperatorSet.ReadImage(out image, outputImageFilePath);
if (RGBToGray)
{
HTuple channel;
HOperatorSet.CountChannels(image, out channel);
if (channel == 3)
HOperatorSet.Rgb1ToGray(image, out image);
}
outputImage = image;
}
}
catch
{
FormHalconTool.Instance.txbLog.Text = "图像文件异常或路径不合法";
CommonMethods.CommonMethods.Delay(1000);
return;
}
if (outputImage != null)
{
FormHalconTool.Instance.myHwindow.HobjectToHimage(outputImage);
}
}
}
}

View File

@@ -11,6 +11,7 @@
<AssemblyName>HalconTool</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -30,6 +31,7 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="DevComponents.DotNetBar2, Version=14.0.0.15, Culture=neutral, PublicKeyToken=c39c3242a43eee2b, processorArchitecture=MSIL" />
<Reference Include="halcondotnet">
<HintPath>C:\Program Files\MVTec\HALCON-19.05-Progress\bin\dotnet20\halcondotnet.dll</HintPath>
</Reference>
@@ -59,6 +61,20 @@
<DependentUpon>FormHalconTool.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CommonMethods\CommonHelper.csproj">
<Project>{1C8D0DDC-2086-48A9-9586-F2B643E2FC54}</Project>
<Name>CommonHelper</Name>
</ProjectReference>
<ProjectReference Include="..\HalconWindowTest\HalconWindow.csproj">
<Project>{4ADC75AE-59C7-4D36-B675-A6CE51B6F5BA}</Project>
<Name>HalconWindow</Name>
</ProjectReference>
<ProjectReference Include="..\ToolBase\ToolBase.csproj">
<Project>{7CD50B44-BF56-4E8E-8FA1-05F6968C1835}</Project>
<Name>ToolBase</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -416,7 +416,6 @@ namespace HalconWindow.HalconWindow
}
#endregion
/// <summary>

View File

@@ -29,20 +29,32 @@
private void InitializeComponent()
{
this.panel1 = new System.Windows.Forms.Panel();
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// panel1
//
this.panel1.Location = new System.Drawing.Point(27, 53);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(685, 501);
this.panel1.Size = new System.Drawing.Size(521, 501);
this.panel1.TabIndex = 0;
//
// button1
//
this.button1.Location = new System.Drawing.Point(600, 106);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(89, 57);
this.button1.TabIndex = 1;
this.button1.Text = "button1";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(807, 600);
this.Controls.Add(this.button1);
this.Controls.Add(this.panel1);
this.Name = "MainForm";
this.Text = "MainForm";
@@ -54,5 +66,6 @@
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button button1;
}
}

View File

@@ -8,11 +8,13 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using HalconWindow.HalconWindow;
using HalconDotNet;
namespace HalconWindow
{
public partial class MainForm : Form
{
HWindow_Final myWindow = new HWindow_Final();
public MainForm()
{
InitializeComponent();
@@ -20,7 +22,14 @@ namespace HalconWindow
private void MainForm_Load(object sender, EventArgs e)
{
this.panel1.Controls.Add(new HWindow_Final());
this.panel1.Controls.Add(myWindow);
}
private void button1_Click(object sender, EventArgs e)
{
HObject image = new HObject();
HOperatorSet.ReadImage(out image, @"G:\Outer_HB.bmp");
myWindow.HobjectToHimage(image);
}
}
}

View File

@@ -0,0 +1,11 @@
<?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>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More