1、修改Halcon取图工具,对功能进行拆分,简化逻辑

2、修改PMA工具,修正其中的bug
3、其他BUG修复
This commit is contained in:
liu.wenjie
2022-04-08 15:31:57 +08:00
parent 159fb6b967
commit 8f7a1e0ffd
52 changed files with 1360 additions and 1457 deletions

View File

@@ -346,46 +346,6 @@ namespace FindLineTool
//arrowTrans.Dispose();
}
}
internal void DrawExpectLine(HWindow myHwindow)
{
/*
if(inputImage != null)
{
try
{
HOperatorSet.SetColor(myHwindow, new HTuple("green"));
Stopwatch sw = new Stopwatch();
sw.Restart();
HOperatorSet.DrawLineMod(myHwindow, newExpectLineStartRow, newExpectLineStartCol, newExpectLineEndRow, newExpectLineEndCol, out expectLineStartRow, out expectLineStartCol, out expectLineEndRow, out expectLineEndCol);
if (inputPose != null)
{
templatePose.X = inputPose.X;
templatePose.Y = inputPose.Y;
templatePose.U = inputPose.U;
}
FormFindLine.Instance.tbx_expectLineStartRow.Text = expectLineStartRow.TupleString("10.3f");
FormFindLine.Instance.tbx_expectLineStartCol.Text = expectLineStartCol.TupleString("10.3f");
FormFindLine.Instance.tbx_expectLineEndRow.Text = expectLineEndRow.TupleString("10.3f");
FormFindLine.Instance.tbx_expectLineEndCol.Text = expectLineEndCol.TupleString("10.3f");
Run(SoftwareRunState.Debug);
}
catch (Exception ex)
{
FormFindLine.Instance.SetToolStatus($"编辑卡尺时工具出现异常!{ex}", ToolRunStatu.Tool_Run_Error);
}
}
else
{
FormFindLine.Instance.SetToolStatus("输入图像为空!", ToolRunStatu.Not_Input_Image);
}
*/
}
/// <summary>
/// 将数据传递给FindlineToolInterface
/// </summary>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?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>
@@ -9,8 +9,9 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FindLineTool</RootNamespace>
<AssemblyName>FindLineTool</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>

View File

@@ -25,6 +25,7 @@ using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;
using ToolLib.VisionJob;
using static DataStruct.DataStruct;
namespace FindLineTool
{
@@ -38,18 +39,30 @@ namespace FindLineTool
{
if (L_toolList[toolIndex].GetInput(L_toolList[toolIndex].toolInput[j].IOName).value == null)
{
selectNode.ForeColor = Color.Red;
LoggerClass.WriteLog(L_toolList[toolIndex].toolName + " 无输入图像", MsgLevel.Exception);
// 仅当无输入图像时,将工具置为错误
if (L_toolList[toolIndex].toolInput[j].IOName == "InputImage")
{
selectNode.ForeColor = Color.Red;
LoggerClass.WriteLog(L_toolList[toolIndex].toolName + " 无输入图像", MsgLevel.Exception);
myFindLine.runMessage = "无输入图像";
}
}
else
{
string sourceFrom = L_toolList[toolIndex].GetInput(L_toolList[toolIndex].toolInput[j].IOName).value.ToString();
if (L_toolList[toolIndex].toolInput[j].IOName == "InputImage")
string sourceToolName = Regex.Split(sourceFrom, "->")[0];
sourceToolName = sourceToolName.Substring(3, Regex.Split(sourceFrom, "->")[0].Length - 3);
string toolItem = Regex.Split(sourceFrom, "->")[1];
switch (L_toolList[toolIndex].toolInput[j].IOName)
{
string sourceToolName = Regex.Split(sourceFrom, "->")[0];
sourceToolName = sourceToolName.Substring(3, Regex.Split(sourceFrom, "->")[0].Length - 3);
string toolItem = Regex.Split(sourceFrom, "->")[1];
myFindLine.inputImage = myJob.GetToolInfoByToolName(sourceToolName).GetOutput(toolItem).value as HObject;
case "InputImage":
myFindLine.inputImage = myJob.GetToolInfoByToolName(sourceToolName).GetOutput(toolItem).value as HObject;
break;
case "InputPos":
myFindLine.inputPose = myJob.GetToolInfoByToolName(sourceToolName).GetOutput(toolItem).value as PosXYU;
break;
default:
break;
}
}
}