mirror of
https://github.com/eggplantlwj/VisionEdit.git
synced 2026-03-30 04:28:38 +08:00
修复了一些bug,降低插件之间耦合度
This commit is contained in:
71
ToolListRun/CaliperRun.cs
Normal file
71
ToolListRun/CaliperRun.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using CaliperTool;
|
||||
using CommonMethods;
|
||||
using HalconDotNet;
|
||||
using VisionEdit;
|
||||
using VisionEdit.FormLib;
|
||||
|
||||
namespace ToolListRun
|
||||
{
|
||||
public class CaliperRun
|
||||
{
|
||||
public void ToolRun(int toolIndex, int inputItemNum, TreeNode selectNode, FormLog myFormLog, FormImageWindow myFormWindow, List<IToolInfo> L_toolList, VisionJob myVisionJob)
|
||||
{
|
||||
Caliper myCaliper = (Caliper)L_toolList[toolIndex].tool;
|
||||
for (int j = 0; j < inputItemNum; j++)
|
||||
{
|
||||
if (L_toolList[toolIndex].toolInput[j].IOName == "InputImage" && L_toolList[toolIndex].GetInput(L_toolList[toolIndex].toolInput[j].IOName).value == null)
|
||||
{
|
||||
selectNode.ForeColor = Color.Red;
|
||||
myFormLog.ShowLog(L_toolList[toolIndex].toolName + " 无输入图像");
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (L_toolList[toolIndex].GetInput(L_toolList[toolIndex].toolInput[j].IOName).value != null)
|
||||
{
|
||||
string sourceFrom = L_toolList[toolIndex].GetInput(L_toolList[toolIndex].toolInput[j].IOName).value.ToString();
|
||||
string sourceToolName = Regex.Split(sourceFrom, " . ")[0];
|
||||
sourceToolName = sourceToolName.Substring(3, Regex.Split(sourceFrom, " . ")[0].Length - 3);
|
||||
string toolItem = Regex.Split(sourceFrom, " . ")[1];
|
||||
if (L_toolList[toolIndex].toolInput[j].IOName == "InputImage")
|
||||
{
|
||||
myCaliper.inputImage = myVisionJob.GetToolInfoByToolName(myVisionJob.JobName, sourceToolName).GetOutput(toolItem).value as HObject;
|
||||
}
|
||||
if (L_toolList[toolIndex].toolInput[j].IOName == "inputCenterRow")
|
||||
{
|
||||
myCaliper.expectRecStartRow = myVisionJob.GetToolInfoByToolName(myVisionJob.JobName, sourceToolName).GetOutput(toolItem).value as HTuple;
|
||||
}
|
||||
if (L_toolList[toolIndex].toolInput[j].IOName == "inputCenterCol")
|
||||
{
|
||||
myCaliper.expectRecStartColumn = myVisionJob.GetToolInfoByToolName(myVisionJob.JobName, sourceToolName).GetOutput(toolItem).value as HTuple;
|
||||
}
|
||||
if (L_toolList[toolIndex].toolInput[j].IOName == "inputPhi")
|
||||
{
|
||||
myCaliper.expectAngle = myVisionJob.GetToolInfoByToolName(myVisionJob.JobName, sourceToolName).GetOutput(toolItem).value as HTuple;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
myCaliper.Run(SoftwareRunState.Release);
|
||||
if (myCaliper.toolRunStatu == ToolRunStatu.Succeed)
|
||||
{
|
||||
myCaliper.DispMainWindow(myFormWindow.myHWindow);
|
||||
myVisionJob.FormLogDisp(L_toolList[toolIndex].toolName + " 运行成功", Color.Green, selectNode);
|
||||
}
|
||||
else
|
||||
{
|
||||
myVisionJob.FormLogDisp(L_toolList[toolIndex].toolName + " 运行失败", Color.Red, selectNode);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
36
ToolListRun/Properties/AssemblyInfo.cs
Normal file
36
ToolListRun/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("ToolListRun")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("ToolListRun")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
//将 ComVisible 设置为 false 将使此程序集中的类型
|
||||
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
|
||||
//请将此类型的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("cdb92f0e-2065-4116-874d-3142fa19c2e6")]
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
|
||||
// 方法是按如下所示使用“*”: :
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
81
ToolListRun/ToolListRun.csproj
Normal file
81
ToolListRun/ToolListRun.csproj
Normal file
@@ -0,0 +1,81 @@
|
||||
<?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>{CDB92F0E-2065-4116-874D-3142FA19C2E6}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ToolListRun</RootNamespace>
|
||||
<AssemblyName>ToolListRun</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="PresentationCore" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<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" />
|
||||
<Reference Include="WeifenLuo.WinFormsUI.Docking">
|
||||
<HintPath>E:\VisionAndMotionPro V0.0.0.3\VisionAndMotionPro V0.0.0.3\VisionAndMotion\bin\Debug\WeifenLuo.WinFormsUI.Docking.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="CaliperRun.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\CaliperTool\CaliperTool.csproj">
|
||||
<Project>{AABF8D49-FA00-4E25-9410-4A573D48DAB1}</Project>
|
||||
<Name>CaliperTool</Name>
|
||||
</ProjectReference>
|
||||
<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="..\VisionEdit\VisionEdit.csproj">
|
||||
<Project>{2CD1B0C2-D64A-4DA4-8A9E-64D5AB35DE25}</Project>
|
||||
<Name>VisionEdit</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>
|
||||
BIN
ToolListRun/bin/Debug/CaliperTool.dll
Normal file
BIN
ToolListRun/bin/Debug/CaliperTool.dll
Normal file
Binary file not shown.
BIN
ToolListRun/bin/Debug/CaliperTool.pdb
Normal file
BIN
ToolListRun/bin/Debug/CaliperTool.pdb
Normal file
Binary file not shown.
BIN
ToolListRun/bin/Debug/CommonMethods.dll
Normal file
BIN
ToolListRun/bin/Debug/CommonMethods.dll
Normal file
Binary file not shown.
BIN
ToolListRun/bin/Debug/CommonMethods.pdb
Normal file
BIN
ToolListRun/bin/Debug/CommonMethods.pdb
Normal file
Binary file not shown.
BIN
ToolListRun/bin/Debug/DataStruct.dll
Normal file
BIN
ToolListRun/bin/Debug/DataStruct.dll
Normal file
Binary file not shown.
BIN
ToolListRun/bin/Debug/DataStruct.pdb
Normal file
BIN
ToolListRun/bin/Debug/DataStruct.pdb
Normal file
Binary file not shown.
BIN
ToolListRun/bin/Debug/DevComponents.DotNetBar2.dll
Normal file
BIN
ToolListRun/bin/Debug/DevComponents.DotNetBar2.dll
Normal file
Binary file not shown.
81015
ToolListRun/bin/Debug/DevComponents.DotNetBar2.xml
Normal file
81015
ToolListRun/bin/Debug/DevComponents.DotNetBar2.xml
Normal file
File diff suppressed because it is too large
Load Diff
BIN
ToolListRun/bin/Debug/FindLineTool.dll
Normal file
BIN
ToolListRun/bin/Debug/FindLineTool.dll
Normal file
Binary file not shown.
BIN
ToolListRun/bin/Debug/FindLineTool.pdb
Normal file
BIN
ToolListRun/bin/Debug/FindLineTool.pdb
Normal file
Binary file not shown.
BIN
ToolListRun/bin/Debug/HalconTool.dll
Normal file
BIN
ToolListRun/bin/Debug/HalconTool.dll
Normal file
Binary file not shown.
BIN
ToolListRun/bin/Debug/HalconTool.pdb
Normal file
BIN
ToolListRun/bin/Debug/HalconTool.pdb
Normal file
Binary file not shown.
BIN
ToolListRun/bin/Debug/HalconWindow.exe
Normal file
BIN
ToolListRun/bin/Debug/HalconWindow.exe
Normal file
Binary file not shown.
BIN
ToolListRun/bin/Debug/HalconWindow.pdb
Normal file
BIN
ToolListRun/bin/Debug/HalconWindow.pdb
Normal file
Binary file not shown.
BIN
ToolListRun/bin/Debug/ToolBase.dll
Normal file
BIN
ToolListRun/bin/Debug/ToolBase.dll
Normal file
Binary file not shown.
BIN
ToolListRun/bin/Debug/ToolBase.pdb
Normal file
BIN
ToolListRun/bin/Debug/ToolBase.pdb
Normal file
Binary file not shown.
BIN
ToolListRun/bin/Debug/ToolListRun.dll
Normal file
BIN
ToolListRun/bin/Debug/ToolListRun.dll
Normal file
Binary file not shown.
BIN
ToolListRun/bin/Debug/ToolListRun.pdb
Normal file
BIN
ToolListRun/bin/Debug/ToolListRun.pdb
Normal file
Binary file not shown.
BIN
ToolListRun/bin/Debug/VisionEdit.exe
Normal file
BIN
ToolListRun/bin/Debug/VisionEdit.exe
Normal file
Binary file not shown.
BIN
ToolListRun/bin/Debug/VisionEdit.pdb
Normal file
BIN
ToolListRun/bin/Debug/VisionEdit.pdb
Normal file
Binary file not shown.
BIN
ToolListRun/bin/Debug/VisionJobFactory.dll
Normal file
BIN
ToolListRun/bin/Debug/VisionJobFactory.dll
Normal file
Binary file not shown.
BIN
ToolListRun/bin/Debug/VisionJobFactory.pdb
Normal file
BIN
ToolListRun/bin/Debug/VisionJobFactory.pdb
Normal file
Binary file not shown.
BIN
ToolListRun/bin/Debug/WeifenLuo.WinFormsUI.Docking.dll
Normal file
BIN
ToolListRun/bin/Debug/WeifenLuo.WinFormsUI.Docking.dll
Normal file
Binary file not shown.
BIN
ToolListRun/bin/Debug/WeifenLuo.WinFormsUI.Docking.pdb
Normal file
BIN
ToolListRun/bin/Debug/WeifenLuo.WinFormsUI.Docking.pdb
Normal file
Binary file not shown.
BIN
ToolListRun/bin/Debug/halcondotnet.dll
Normal file
BIN
ToolListRun/bin/Debug/halcondotnet.dll
Normal file
Binary file not shown.
61480
ToolListRun/bin/Debug/halcondotnet.xml
Normal file
61480
ToolListRun/bin/Debug/halcondotnet.xml
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
BIN
ToolListRun/obj/Debug/ToolListRun.csproj.FileListAbsolute.txt
Normal file
BIN
ToolListRun/obj/Debug/ToolListRun.csproj.FileListAbsolute.txt
Normal file
Binary file not shown.
Binary file not shown.
BIN
ToolListRun/obj/Debug/ToolListRun.dll
Normal file
BIN
ToolListRun/obj/Debug/ToolListRun.dll
Normal file
Binary file not shown.
BIN
ToolListRun/obj/Debug/ToolListRun.pdb
Normal file
BIN
ToolListRun/obj/Debug/ToolListRun.pdb
Normal file
Binary file not shown.
Reference in New Issue
Block a user