Commit ae03e891 LN

增加模板匹配控件。把AccAOI项目改为类库,方便引用。

1 个父辈 8777cc79
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" 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>{ACE00C09-176E-4AE7-92D1-3D58080E1561}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>AOIProject</RootNamespace>
<AssemblyName>AOIProject</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<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' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Asa.Theme">
<HintPath>..\dll\Asa.Theme.dll</HintPath>
</Reference>
<Reference Include="OpenCvSharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\lib\net40\OpenCvSharp.dll</HintPath>
</Reference>
<Reference Include="OpenCvSharp.Blob, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\lib\net40\OpenCvSharp.Blob.dll</HintPath>
</Reference>
<Reference Include="OpenCvSharp.Extensions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\lib\net40\OpenCvSharp.Extensions.dll</HintPath>
</Reference>
<Reference Include="OpenCvSharp.UserInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\lib\net40\OpenCvSharp.UserInterface.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.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AccAOI\AccAOI.csproj">
<Project>{81d116dc-69c9-4b3b-ab7b-e324af18ca3e}</Project>
<Name>AccAOI</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>
\ No newline at end of file \ No newline at end of file
using AccAOI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AOIProject
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new FrmAoiSetting());
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("AOIProject")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AOIProject")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("ace00c09-176e-4ae7-92d1-3d58080e1561")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace AOIProject.Properties
{
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AOIProject.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 覆盖当前线程的 CurrentUICulture 属性
/// 使用此强类型的资源类的资源查找。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file \ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace AOIProject.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
...@@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AccImageBox", "ImageBox\Acc ...@@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AccImageBox", "ImageBox\Acc
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AOI", "AOI\AOI.csproj", "{529F3829-BD91-42A7-95AF-9DEA2DC409CB}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AOI", "AOI\AOI.csproj", "{529F3829-BD91-42A7-95AF-9DEA2DC409CB}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AOIProject", "AOIProject\AOIProject.csproj", "{ACE00C09-176E-4AE7-92D1-3D58080E1561}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
...@@ -27,6 +29,10 @@ Global ...@@ -27,6 +29,10 @@ Global
{529F3829-BD91-42A7-95AF-9DEA2DC409CB}.Debug|Any CPU.Build.0 = Debug|Any CPU {529F3829-BD91-42A7-95AF-9DEA2DC409CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{529F3829-BD91-42A7-95AF-9DEA2DC409CB}.Release|Any CPU.ActiveCfg = Release|Any CPU {529F3829-BD91-42A7-95AF-9DEA2DC409CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{529F3829-BD91-42A7-95AF-9DEA2DC409CB}.Release|Any CPU.Build.0 = Release|Any CPU {529F3829-BD91-42A7-95AF-9DEA2DC409CB}.Release|Any CPU.Build.0 = Release|Any CPU
{ACE00C09-176E-4AE7-92D1-3D58080E1561}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ACE00C09-176E-4AE7-92D1-3D58080E1561}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ACE00C09-176E-4AE7-92D1-3D58080E1561}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ACE00C09-176E-4AE7-92D1-3D58080E1561}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AccAOI
{
class AOIFormUtil
{
public static int GetIntValue(Asa.Theme.FlatText text)
{
int value = 0;
try
{
value = int.Parse(text.Text);
}
catch (Exception ex)
{
value = 0;
}
return value;
}
}
}
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{81D116DC-69C9-4B3B-AB7B-E324AF18CA3E}</ProjectGuid> <ProjectGuid>{81D116DC-69C9-4B3B-AB7B-E324AF18CA3E}</ProjectGuid>
<OutputType>WinExe</OutputType> <OutputType>Library</OutputType>
<RootNamespace>AccAOI</RootNamespace> <RootNamespace>AccAOI</RootNamespace>
<AssemblyName>AccAOI</AssemblyName> <AssemblyName>AccAOI</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
...@@ -31,6 +31,9 @@ ...@@ -31,6 +31,9 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Asa.Theme"> <Reference Include="Asa.Theme">
<HintPath>..\dll\Asa.Theme.dll</HintPath> <HintPath>..\dll\Asa.Theme.dll</HintPath>
...@@ -63,6 +66,14 @@ ...@@ -63,6 +66,14 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="AOIFormUtil.cs" />
<Compile Include="ControlUtil.cs" />
<Compile Include="control\AioTempMatchControl.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="control\AioTempMatchControl.Designer.cs">
<DependentUpon>AioTempMatchControl.cs</DependentUpon>
</Compile>
<Compile Include="control\AioMarkControl.cs"> <Compile Include="control\AioMarkControl.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
...@@ -93,9 +104,11 @@ ...@@ -93,9 +104,11 @@
<Compile Include="FrmAoiSetting.Designer.cs"> <Compile Include="FrmAoiSetting.Designer.cs">
<DependentUpon>FrmAoiSetting.cs</DependentUpon> <DependentUpon>FrmAoiSetting.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="FormUtil.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="control\AioTempMatchControl.resx">
<DependentUpon>AioTempMatchControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="control\AioMarkControl.resx"> <EmbeddedResource Include="control\AioMarkControl.resx">
<DependentUpon>AioMarkControl.cs</DependentUpon> <DependentUpon>AioMarkControl.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
......
using AccAOI.control;
using AOI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AccAOI
{
public class ControlUtil
{
public static AoiMethod GetMethod(string type)
{
AoiMethod methodInfo = null;
if (type.Equals(ControlType.Mark))
{
methodInfo = new AoiMarkMethod();
}
else if (type.Equals(ControlType.AOIBlob))
{
methodInfo = new AoiBlobMethod();
}
else if (type.Equals(ControlType.AOIRGB))
{
methodInfo = new AoiMethodRgb();
}
else if (type.Equals(ControlType.Match))
{
methodInfo = new AoiTemplateMethod();
}
return methodInfo;
}
public static ABaseControl GetControl(AoiMethod method)
{
ABaseControl aoiControl = null;
if (method is AoiBlobMethod)
{
aoiControl = new control.AoiBlobControl();
}
else if (method is AoiMarkMethod)
{
aoiControl = new control.AioMarkControl();
}
else if (method is AoiMethodRgb)
{
aoiControl = new control.AoiRgbControl();
}
else if (method is AoiTemplateMethod)
{
aoiControl = new control.AioTempMatchControl();
}
return aoiControl;
}
}
public class ControlType
{
/// <summary>
/// Mark点设置
/// </summary>
public static string Mark = "Mark点设置";
/// <summary>
/// 斑点分析
/// </summary>
public static string AOIBlob = "斑点分析";
/// <summary>
/// 颜色抽取
/// </summary>
public static string AOIRGB = "颜色抽取";
/// <summary>
/// 模板匹配
/// </summary>
public static string Match = "模板匹配";
}
}
...@@ -8,18 +8,6 @@ namespace AccAOI ...@@ -8,18 +8,6 @@ namespace AccAOI
{ {
public class FormUtil public class FormUtil
{ {
public static int GetIntValue(Asa.Theme.FlatText text)
{
int value = 0;
try
{
value = int.Parse(text.Text);
}
catch (Exception ex)
{
value = 0;
}
return value;
}
} }
} }
...@@ -37,10 +37,11 @@ namespace AccAOI ...@@ -37,10 +37,11 @@ namespace AccAOI
} }
private void FrmAoiSetting_Load(object sender, EventArgs e) private void FrmAoiSetting_Load(object sender, EventArgs e)
{ {
comType.ItemAdd("Mark点设置"); comType.ItemAdd(ControlType.Mark);
comType.ItemAdd("斑点分析"); comType.ItemAdd(ControlType.AOIBlob);
comType.ItemAdd("颜色抽取"); comType.ItemAdd(ControlType.AOIRGB);
comType.Text = "Mark点设置"; comType.ItemAdd(ControlType.Match);
comType.Text = ControlType.Mark;
string defaultImg = "F:\\电路板图片\\照片 2创建于2019年4月19日 11_34_53.jpg"; string defaultImg = "F:\\电路板图片\\照片 2创建于2019年4月19日 11_34_53.jpg";
if (System.IO.File.Exists(defaultImg)) if (System.IO.File.Exists(defaultImg))
{ {
...@@ -138,20 +139,8 @@ namespace AccAOI ...@@ -138,20 +139,8 @@ namespace AccAOI
} }
string text = comType.Text; string text = comType.Text;
CloseCurrAoi(); CloseCurrAoi();
AoiMethod methodInfo = null; AoiMethod methodInfo = ControlUtil.GetMethod(text);
if (text.Equals("Mark点设置"))
{
methodInfo = new AoiMarkMethod();
}
else if (text.Equals("斑点分析"))
{
methodInfo = new AoiBlobMethod();
}
else
{
methodInfo = new AoiMethodRgb();
}
methodInfo.MethodName = Project.methodMap.Values.Count.ToString().PadLeft(2, '0') + "_" + text; methodInfo.MethodName = Project.methodMap.Values.Count.ToString().PadLeft(2, '0') + "_" + text;
Project.methodMap.Add(methodInfo.MethodName, methodInfo); Project.methodMap.Add(methodInfo.MethodName, methodInfo);
...@@ -167,16 +156,7 @@ namespace AccAOI ...@@ -167,16 +156,7 @@ namespace AccAOI
CanSel = true; CanSel = true;
if (aoiControl == null) if (aoiControl == null)
{ {
if(method is AoiBlobMethod) aoiControl = ControlUtil.GetControl(method);
{
aoiControl = new control.AoiBlobControl();
}else if(method is AoiMarkMethod)
{
aoiControl = new control.AioMarkControl();
}else if(method is AoiMethodRgb)
{
aoiControl = new control.AoiRgbControl();
}
} }
this.aoiControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.aoiControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
...@@ -344,5 +324,6 @@ namespace AccAOI ...@@ -344,5 +324,6 @@ namespace AccAOI
} }
} }
} }
} }
} }
...@@ -115,4 +115,5 @@ namespace AccAOI.control ...@@ -115,4 +115,5 @@ namespace AccAOI.control
UpdateImage(); UpdateImage();
} }
} }
} }
...@@ -173,7 +173,7 @@ namespace AccAOI.control ...@@ -173,7 +173,7 @@ namespace AccAOI.control
} }
private void txtSamePercent_TextChanged(object sender, EventArgs e) private void txtSamePercent_TextChanged(object sender, EventArgs e)
{ {
int value = FormUtil.GetIntValue(txtSamePercent); int value = AOIFormUtil.GetIntValue(txtSamePercent);
SetTbValue(trackBarSamePercent, value); SetTbValue(trackBarSamePercent, value);
UpdateImage(); UpdateImage();
} }
......
namespace AccAOI.control
{
partial class AioTempMatchControl
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.lblResult = new System.Windows.Forms.Label();
this.btnTest = new Asa.Theme.FlatButton();
this.btnOpenImage = new Asa.Theme.FlatButton();
this.txtImage = new Asa.Theme.FlatText();
this.lblTime = new System.Windows.Forms.Label();
this.trackBarSamePercent = new System.Windows.Forms.TrackBar();
this.flatLabel3 = new Asa.Theme.FlatLabel();
this.txtSamePercent = new Asa.Theme.FlatText();
this.panParam.SuspendLayout();
this.panResult.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.trackBarSamePercent)).BeginInit();
this.SuspendLayout();
//
// panParam
//
this.panParam.Controls.Add(this.txtSamePercent);
this.panParam.Controls.Add(this.trackBarSamePercent);
this.panParam.Controls.Add(this.flatLabel3);
//
// panResult
//
this.panResult.Controls.Add(this.lblTime);
this.panResult.Controls.Add(this.txtImage);
this.panResult.Controls.Add(this.btnOpenImage);
this.panResult.Controls.Add(this.btnTest);
this.panResult.Controls.Add(this.lblResult);
this.panResult.Size = new System.Drawing.Size(298, 197);
//
// lblResult
//
this.lblResult.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(30)))), ((int)(((byte)(30)))));
this.lblResult.Font = new System.Drawing.Font("微软雅黑", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblResult.ForeColor = System.Drawing.Color.Red;
this.lblResult.Location = new System.Drawing.Point(29, 123);
this.lblResult.Name = "lblResult";
this.lblResult.Size = new System.Drawing.Size(231, 24);
this.lblResult.TabIndex = 4;
this.lblResult.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnTest
//
this.btnTest.ImageSize = new System.Drawing.Size(0, 0);
this.btnTest.Inside = false;
this.btnTest.Location = new System.Drawing.Point(141, 79);
this.btnTest.Name = "btnTest";
this.btnTest.Size = new System.Drawing.Size(90, 30);
this.btnTest.StateColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(30)))), ((int)(((byte)(30)))));
this.btnTest.TabIndex = 5;
this.btnTest.Text = "测试结果";
this.btnTest.Click += new System.EventHandler(this.btnTest_Click);
//
// btnOpenImage
//
this.btnOpenImage.ImageSize = new System.Drawing.Size(0, 0);
this.btnOpenImage.Inside = false;
this.btnOpenImage.Location = new System.Drawing.Point(45, 79);
this.btnOpenImage.Name = "btnOpenImage";
this.btnOpenImage.Size = new System.Drawing.Size(90, 30);
this.btnOpenImage.StateColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(30)))), ((int)(((byte)(30)))));
this.btnOpenImage.TabIndex = 6;
this.btnOpenImage.Text = "打开本地图片";
this.btnOpenImage.Click += new System.EventHandler(this.btnOpenImage_Click);
//
// txtImage
//
this.txtImage.Font = new System.Drawing.Font("宋体", 9F);
this.txtImage.Inside = false;
this.txtImage.Location = new System.Drawing.Point(8, 33);
this.txtImage.Name = "txtImage";
this.txtImage.Size = new System.Drawing.Size(281, 30);
this.txtImage.TabIndex = 7;
//
// lblTime
//
this.lblTime.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(30)))), ((int)(((byte)(30)))));
this.lblTime.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblTime.ForeColor = System.Drawing.Color.Green;
this.lblTime.Location = new System.Drawing.Point(29, 158);
this.lblTime.Name = "lblTime";
this.lblTime.Size = new System.Drawing.Size(231, 24);
this.lblTime.TabIndex = 8;
this.lblTime.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// trackBarSamePercent
//
this.trackBarSamePercent.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(30)))), ((int)(((byte)(30)))));
this.trackBarSamePercent.Location = new System.Drawing.Point(125, 40);
this.trackBarSamePercent.Maximum = 100;
this.trackBarSamePercent.Name = "trackBarSamePercent";
this.trackBarSamePercent.Size = new System.Drawing.Size(165, 45);
this.trackBarSamePercent.TabIndex = 12;
this.trackBarSamePercent.TickStyle = System.Windows.Forms.TickStyle.None;
this.trackBarSamePercent.Value = 50;
this.trackBarSamePercent.ValueChanged += new System.EventHandler(this.trackBarSamePercent_ValueChanged);
//
// flatLabel3
//
this.flatLabel3.Inside = false;
this.flatLabel3.Location = new System.Drawing.Point(14, 37);
this.flatLabel3.Name = "flatLabel3";
this.flatLabel3.Size = new System.Drawing.Size(55, 30);
this.flatLabel3.TabIndex = 11;
this.flatLabel3.Text = "相似度:";
this.flatLabel3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// txtSamePercent
//
this.txtSamePercent.Font = new System.Drawing.Font("宋体", 9F);
this.txtSamePercent.Inside = false;
this.txtSamePercent.Location = new System.Drawing.Point(75, 37);
this.txtSamePercent.Name = "txtSamePercent";
this.txtSamePercent.Padding = new System.Windows.Forms.Padding(3);
this.txtSamePercent.Size = new System.Drawing.Size(41, 30);
this.txtSamePercent.TabIndex = 26;
this.txtSamePercent.Text = "50";
this.txtSamePercent.TextChanged += new System.EventHandler(this.txtSamePercent_TextChanged);
//
// AioMatchControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(312, 700);
this.Name = "AioMatchControl";
this.TitleName = "模板匹配";
this.panParam.ResumeLayout(false);
this.panParam.PerformLayout();
this.panResult.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.trackBarSamePercent)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label lblResult;
private Asa.Theme.FlatButton btnTest;
private Asa.Theme.FlatText txtImage;
private Asa.Theme.FlatButton btnOpenImage;
private System.Windows.Forms.Label lblTime;
private System.Windows.Forms.TrackBar trackBarSamePercent;
private Asa.Theme.FlatLabel flatLabel3;
private Asa.Theme.FlatText txtSamePercent;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using AOI;
using System.Threading;
using System.Drawing.Drawing2D;
using System.IO;
using Asa.Theme;
namespace AccAOI.control
{
public partial class AioTempMatchControl : ABaseControl
{
public AioTempMatchControl()
{
InitializeComponent();
}
public override AoiMethod GetAoiInfo()
{
if (this.AoiInfo is AoiTemplateMethod)
{
AoiTemplateMethod method = (AoiTemplateMethod)AoiInfo;
if (currPath != null)
{
method.RoiPath = currPath;
}
int value =trackBarSamePercent.Value;
SetText(txtSamePercent, trackBarSamePercent.Value);
// int value = trackBarSamePercent.Value;
method.SamePercent = value;
AoiInfo = method;
}
return AoiInfo;
}
private void btnTest_Click(object sender, EventArgs e)
{
if (this.AoiInfo is AoiTemplateMethod)
{
string fileName = txtImage.Text.ToString();
Image checkImg = null;
if (File.Exists(fileName))
{
//读取图片内容
checkImg = (Image)Image.FromFile(fileName).Clone();
}
if (checkImg == null)
{
checkImg = FrmAoiSetting.Img;
}
DateTime time = DateTime.Now;
AoiTemplateMethod Match = (AoiTemplateMethod)AoiInfo;
ResultBean result= Match.Check(FrmAoiSetting.Img, checkImg);
TimeSpan span = DateTime.Now - time;
if (result == null)
{
this.aoiImage.Image = null;
lblResult.ForeColor = Color.Red ;
lblResult.Text = "匹配失败";
}
else
{
lblResult.ForeColor = Color.Green;
lblResult.Text =result.result? "OK":"NG" ;
if (result.currentRoiImage != null)
{
this.aoiImage.Image = result.currentRoiImage;
}
}
lblTime.Text= "耗时:" + Math.Round(span.TotalSeconds, 1)+ "秒";
}
}
public override void UpdateImage()
{
if (!IsShowOk)
{
return;
}
if (Monitor.TryEnter(UpdateLock))
{
try
{
int value = trackBarSamePercent.Value;
SetText(txtSamePercent, trackBarSamePercent.Value);
Image BaseImage = GetImg();
if (BaseImage == null || currPath == null)
{
return;
}
GetAoiInfo();
AoiTemplateMethod MatchMethod = (AoiTemplateMethod)AoiInfo;
MatchMethod.RoiPath = currPath;
GC.Collect();
}
catch (Exception ex)
{
Console.WriteLine("UpdateImage出错:" + ex.ToString());
}
finally
{
Monitor.Exit(UpdateLock);
}
}
else
{
Console.WriteLine("UpdateImage执行失败,未得到锁");
}
}
private void btnOpenImage_Click(object sender, EventArgs e)
{
System.Windows.Forms.OpenFileDialog openDialog = new System.Windows.Forms.OpenFileDialog();
openDialog.Title = "打开本地图片";
openDialog.Filter = "All Supported Images (*.bmp;*.dib;*.rle;*.gif;*.jpg;*.png)|*.bmp;*.dib;*.rle;*.gif;*.jpg;*.png|Bitmaps (*.bmp;*.dib;*.rle)|*.bmp;*.dib;*.rle|Graphics Interchange Format (*.gif)|*.gif|Joint Photographic Experts (*.jpg)|*.jpg|Portable Network Graphics (*.png)|*.png|All Files (*.*)|*.*";
openDialog.DefaultExt = "png";
//openDialog.DefaultExt = "png";
System.Windows.Forms.DialogResult result = openDialog.ShowDialog();
if (result == System.Windows.Forms.DialogResult.Cancel)
{
return;
}
string fileName = openDialog.FileName;
txtImage.Text = fileName;
}
private void trackBarSamePercent_ValueChanged(object sender, EventArgs e)
{
UpdateImage();
}
private void SetTbValue(TrackBar tb, int value)
{
if (tb.Value.Equals(value.ToString()))
{
return;
}
if (value < tb.Minimum)
{
tb.Value = tb.Minimum;
}
else if (value > tb.Maximum)
{
tb.Value = tb.Maximum;
}
else
{
tb.Value = value;
}
UpdateImage();
}
private void SetText(FlatText text, int value)
{
if (text.Text.ToString().Equals(value.ToString()))
{
return;
}
text.Text = value.ToString();
}
private void txtSamePercent_TextChanged(object sender, EventArgs e)
{
int value = AOIFormUtil.GetIntValue(txtSamePercent);
SetTbValue(trackBarSamePercent, value);
UpdateImage();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file \ No newline at end of file
...@@ -67,10 +67,10 @@ namespace AccAOI.control ...@@ -67,10 +67,10 @@ namespace AccAOI.control
} }
MethodBlob.whiteOnBlack= chkwhiteOnBlack.Checked ; MethodBlob.whiteOnBlack= chkwhiteOnBlack.Checked ;
MethodBlob.maxArea = FormUtil.GetIntValue(txtmaxArea); MethodBlob.maxArea = AOIFormUtil.GetIntValue(txtmaxArea);
MethodBlob.minArea = FormUtil.GetIntValue(txtminArea); MethodBlob.minArea = AOIFormUtil.GetIntValue(txtminArea);
MethodBlob.maxNum = FormUtil.GetIntValue(txtmaxNum); MethodBlob.maxNum = AOIFormUtil.GetIntValue(txtmaxNum);
MethodBlob.minNum = FormUtil.GetIntValue(txtminNum); MethodBlob.minNum = AOIFormUtil.GetIntValue(txtminNum);
if (currPath != null) if (currPath != null)
{ {
MethodBlob.RoiPath = currPath; MethodBlob.RoiPath = currPath;
......
...@@ -64,8 +64,8 @@ namespace AccAOI.control ...@@ -64,8 +64,8 @@ namespace AccAOI.control
SetText(txtMaxB, methodRgb.maxB); SetText(txtMaxB, methodRgb.maxB);
SetText(txtMinB, methodRgb.minB); SetText(txtMinB, methodRgb.minB);
methodRgb.minRate = FormUtil.GetIntValue(txtminRate); methodRgb.minRate = AOIFormUtil.GetIntValue(txtminRate);
methodRgb.maxRate = FormUtil.GetIntValue(txtmaxRate); methodRgb.maxRate = AOIFormUtil.GetIntValue(txtmaxRate);
if (currPath != null) if (currPath != null)
{ {
methodRgb.RoiPath = currPath; methodRgb.RoiPath = currPath;
...@@ -176,37 +176,37 @@ namespace AccAOI.control ...@@ -176,37 +176,37 @@ namespace AccAOI.control
} }
private void txtMaxG_TextChanged(object sender, EventArgs e) private void txtMaxG_TextChanged(object sender, EventArgs e)
{ {
int value = FormUtil.GetIntValue(txtMaxG); int value = AOIFormUtil.GetIntValue(txtMaxG);
SetTbValue(tbMaxG, value); SetTbValue(tbMaxG, value);
} }
private void txtMaxR_TextChanged(object sender, EventArgs e) private void txtMaxR_TextChanged(object sender, EventArgs e)
{ {
int value = FormUtil.GetIntValue(txtMaxR); int value = AOIFormUtil.GetIntValue(txtMaxR);
SetTbValue(tbMaxR, value); SetTbValue(tbMaxR, value);
} }
private void txtMinG_TextChanged(object sender, EventArgs e) private void txtMinG_TextChanged(object sender, EventArgs e)
{ {
int value = FormUtil.GetIntValue(txtMinG); int value = AOIFormUtil.GetIntValue(txtMinG);
SetTbValue(tbMinG, value); SetTbValue(tbMinG, value);
} }
private void txtMaxB_TextChanged(object sender, EventArgs e) private void txtMaxB_TextChanged(object sender, EventArgs e)
{ {
int value = FormUtil.GetIntValue(txtMaxB); int value = AOIFormUtil.GetIntValue(txtMaxB);
SetTbValue(tbMaxB, value); SetTbValue(tbMaxB, value);
} }
private void txtMinR_TextChanged(object sender, EventArgs e) private void txtMinR_TextChanged(object sender, EventArgs e)
{ {
int value = FormUtil.GetIntValue(txtMinR); int value = AOIFormUtil.GetIntValue(txtMinR);
SetTbValue(tbMinR, value); SetTbValue(tbMinR, value);
} }
private void txtMinB_TextChanged(object sender, EventArgs e) private void txtMinB_TextChanged(object sender, EventArgs e)
{ {
int value = FormUtil.GetIntValue(txtMinB); int value = AOIFormUtil.GetIntValue(txtMinB);
SetTbValue(tbMinB, value); SetTbValue(tbMinB, value);
} }
private void SetText(FlatText text, int value) private void SetText(FlatText text, int value)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!