Compare commits

...

34 Commits

Author SHA1 Message Date
d887364a36 ocrsharp version 5.1.0 2026-01-04 16:42:32 +08:00
2d00c46ea0 update version 2026-01-04 13:35:55 +08:00
410312864b clean package reference 2025-12-26 15:06:30 +08:00
d7ef283b9d add camera driver layer 2025-12-26 14:54:32 +08:00
c6be81d1dd use commplc interface for main thread 2025-12-24 15:16:29 +08:00
8d4774964c add libcomm for plc layer 2025-12-24 14:46:43 +08:00
6308aee750 complete config for reading excel data 2025-12-24 13:45:37 +08:00
b460906b45 update paddle ocr 6.0.0 2025-12-23 16:27:02 +08:00
fed944a3cf Add LibDataBase 2025-12-23 10:35:27 +08:00
2a6e5cb0d0 Add TetraPackOCR 2025-12-23 10:19:58 +08:00
446281afaa start ocr after finish zero action 2025-11-24 14:19:28 +08:00
61a4294205 show error if no match 2025-11-11 16:58:56 +08:00
7c7e69bee5 add k maybe wrong hint 2025-11-06 16:39:28 +08:00
4b6af405fd on site debug 2025-11-06 15:44:42 +08:00
7f6bcb527d update algo for position 2025-11-05 17:04:17 +08:00
b4d33c9c0e delete no need camera response 2025-11-05 15:08:47 +08:00
1a54dcdf2c add debug checkbox for test 2025-11-05 14:48:41 +08:00
292075db7f add heigt data 2025-11-05 14:26:24 +08:00
e610ceeeb3 add m_height variable 2025-11-05 14:08:14 +08:00
649d44f001 delete qsv 2025-11-05 13:47:25 +08:00
5ce98df631 log exception message 2025-11-05 13:31:25 +08:00
ed5357d5ef read excel data 2025-11-05 13:30:08 +08:00
efa9e8eb3c cam1 to camDET 2025-11-05 11:03:33 +08:00
299502b23c cam0 to camOCR 2025-11-05 10:37:51 +08:00
3173e91d95 debug on site 2025-11-04 17:22:50 +08:00
42c72fabb0 ocr s,h,v 2025-11-04 11:42:27 +08:00
6c3d42328f add stop button, button lock 2025-11-04 09:45:39 +08:00
506f537347 check order text null or empty 2025-11-03 17:42:36 +08:00
081f3481bd get order c type info 2025-11-03 17:20:23 +08:00
87fe8027b5 change save directory & modify position offset computation 2025-11-03 13:20:30 +08:00
95573c98c6 add step debug button 2025-10-28 17:53:16 +08:00
e8581ae11c add log config 2025-10-28 17:42:43 +08:00
ff127b6a0f remove change & compile pass 2025-10-28 16:55:56 +08:00
3868825a60 prepare reset 2025-10-28 13:34:47 +08:00
87 changed files with 18148 additions and 7635 deletions

84
LibCamera/CameraDriver.cs Normal file
View File

@@ -0,0 +1,84 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ThridLibray;
namespace LibCamera
{
public class CameraDriver : ICameraDriver
{
public event OnCameraImage OnCameraImage;
private IDevice m_dev_cam;
private bool camOpened;
public void Initialize(string serial, string pixelFormat, double exposure, double gain)
{
try
{
camOpened = false;
List<IDeviceInfo> deviceList = Enumerator.EnumerateDevices();
m_dev_cam = Enumerator.GetDeviceByKey(serial);
if (m_dev_cam == null)
return;
if (!m_dev_cam.Open())
return;
using (IEnumParameter p = m_dev_cam.ParameterCollection[ParametrizeNameSet.ImagePixelFormat])
{
p.SetValue(pixelFormat);
}
using (IFloatParameter p = m_dev_cam.ParameterCollection[ParametrizeNameSet.ExposureTime])
{
p.SetValue(exposure);
}
using (IFloatParameter p = m_dev_cam.ParameterCollection[ParametrizeNameSet.GainRaw])
{
p.SetValue(gain);
}
using (IEnumParameter p = m_dev_cam.ParameterCollection[ParametrizeNameSet.AcquisitionMode])
{
p.SetValue("Continuous");
}
using (IEnumParameter p = m_dev_cam.ParameterCollection[ParametrizeNameSet.TriggerMode])
{
p.SetValue("On");
}
m_dev_cam.StreamGrabber.ImageGrabbed += StreamGrabber_ImageGrabbed;
m_dev_cam.TriggerSet.Open(TriggerSourceEnum.Software);
if (!m_dev_cam.GrabUsingGrabLoopThread())
return;
camOpened = true;
}
catch (Exception ex)
{
camOpened = false;
m_dev_cam = null;
}
}
private void StreamGrabber_ImageGrabbed(object sender, GrabbedEventArgs e)
{
OnCameraImage?.Invoke(e.GrabResult.ToBitmap(true));
}
public void Stop()
{
if (!IsOpened())
return;
m_dev_cam.StreamGrabber.ImageGrabbed -= StreamGrabber_ImageGrabbed;
m_dev_cam.ShutdownGrab();
m_dev_cam.Dispose();
m_dev_cam = null;
}
public void GrabImage()
{
if (!IsOpened())
return;
m_dev_cam?.ExecuteSoftwareTrigger();
}
public bool IsOpened()
{
return m_dev_cam != null && camOpened;
}
}
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LibCamera
{
public delegate void OnCameraImage(Bitmap bmp);
public interface ICameraDriver
{
event OnCameraImage OnCameraImage;
void Initialize(string serial, string pixelFormat, double exposure, double gain);
void Stop();
void GrabImage();
bool IsOpened();
}
}

View File

@@ -0,0 +1,75 @@
<?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>{37CE1F86-519D-44DE-92F7-00ACB78FFDF1}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LibCamera</RootNamespace>
<AssemblyName>LibCamera</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</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>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="CLIDelegate, Version=1.0.8452.36887, Culture=neutral, PublicKeyToken=71f71440696c7e6b, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\dll\CLIDelegate.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<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="ThridLibray">
<HintPath>..\dll\ThridLibray.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="CameraDriver.cs" />
<Compile Include="ICameraDriver.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("LibCamera")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("HP")]
[assembly: AssemblyProduct("LibCamera")]
[assembly: AssemblyCopyright("Copyright © HP 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("37ce1f86-519d-44de-92f7-00acb78ffdf1")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

81
LibComm/CommWithCC24.cs Normal file
View File

@@ -0,0 +1,81 @@
using Bjcve.Comm.FFP;
using Cognex.VisionPro.Comm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LibComm
{
public class CommWithCC24 : ICommPLC
{
private CC24 cc24;
public event OnDataReceived OnDataReceived;
public event OnConnectStatus OnConnectStatus;
public event OnTrigCamera OnTrigCamera;
public event OnCameraStatus OnCameraStatus;
public void Start()
{
cc24 = new CC24();
cc24.VisionReceivedNewUserData += CC24_NewUserDataReceived;
cc24.PlcConnectionStatusChanged += CC24_PlcConnectionStatusChanged;
cc24.PlcTriggerCamAcqStart += CC24_PlcTriggerCamAcqStart;
cc24.PlcTriggerCamAcqStop += CC24_PlcTriggerCamAcqStop;
cc24.NotifyCamAcqEnabled += CC24_NotifyCamAcqEnabled;
cc24.NotifyCamAcqDisabled += CC24_NotifyCamAcqDisabled;
Task.Run(() =>
{
cc24.Initialize();
cc24.NotifyCamAcqEnable(0);
cc24.NotifyCamAcqEnable(1);
});
}
public void Stop()
{
cc24.VisionReceivedNewUserData -= CC24_NewUserDataReceived;
cc24.PlcConnectionStatusChanged -= CC24_PlcConnectionStatusChanged;
cc24.PlcTriggerCamAcqStart -= CC24_PlcTriggerCamAcqStart;
cc24.PlcTriggerCamAcqStop -= CC24_PlcTriggerCamAcqStop;
cc24.NotifyCamAcqEnabled -= CC24_NotifyCamAcqEnabled;
cc24.NotifyCamAcqDisabled -= CC24_NotifyCamAcqDisabled;
cc24.Shutdown();
}
public void NoticeCamComplete(int index, float data)
{
cc24?.NotifyCamInspectionComplete(index, DataConverter.FloatToByte(data, true));
cc24?.NotifyCamAcqComplete(index);
}
public void NoticeCamComplete(int index, List<float> data)
{
cc24?.NotifyCamInspectionComplete(index, DataConverter.FloatToByte(data, true));
cc24?.NotifyCamAcqComplete(index);
}
private void CC24_NewUserDataReceived(object sender, CogNdmNewUserDataEventArgs e)
{
OnDataReceived?.Invoke(DataConverter.ByteToFloat(cc24.ReadBytesFromPLC(0, 4), true));
}
private void CC24_PlcConnectionStatusChanged(object sender, CogNdmProtocolStatusChangedEventArgs e)
{
OnConnectStatus?.Invoke(e.ProtocolStatus == CogNdmConnectionStatusConstants.Connected);
}
private void CC24_PlcTriggerCamAcqStart(object sender, CogNdmTriggerAcquisitionEventArgs e)
{
OnTrigCamera?.Invoke(e.CameraIndex);
}
private void CC24_PlcTriggerCamAcqStop(object sender, CogNdmTriggerAcquisitionStopEventArgs e)
{
}
private void CC24_NotifyCamAcqEnabled(int cameraIndex, bool isEnabled)
{
OnCameraStatus?.Invoke(cameraIndex, isEnabled);
}
private void CC24_NotifyCamAcqDisabled(int cameraIndex, bool isEnabled)
{
OnCameraStatus?.Invoke(cameraIndex, isEnabled);
}
}
}

24
LibComm/ICommPLC.cs Normal file
View File

@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LibComm
{
public delegate void OnDataReceived(float data);
public delegate void OnConnectStatus(bool connected);
public delegate void OnTrigCamera(int index);
public delegate void OnCameraStatus(int index, bool enable);
public interface ICommPLC
{
event OnDataReceived OnDataReceived;
event OnConnectStatus OnConnectStatus;
event OnTrigCamera OnTrigCamera;
event OnCameraStatus OnCameraStatus;
void Start();
void Stop();
void NoticeCamComplete(int index, float data);
void NoticeCamComplete(int index, List<float> data);
}
}

74
LibComm/LibComm.csproj Normal file
View File

@@ -0,0 +1,74 @@
<?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>{E44B1774-093E-4617-AF7A-474A88B89100}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LibComm</RootNamespace>
<AssemblyName>LibComm</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</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>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="Bjcve.Comm.FFP">
<HintPath>..\dll\Bjcve.Comm.FFP.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.Comm, Version=59.2.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\dll\Cognex.VisionPro.Comm.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="CommWithCC24.cs" />
<Compile Include="ICommPLC.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("LibComm")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("HP")]
[assembly: AssemblyProduct("LibComm")]
[assembly: AssemblyCopyright("Copyright © HP 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("e44b1774-093e-4617-af7a-474a88b89100")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,69 @@
<?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>{D03A85CC-A53B-4434-A560-7A89563292E8}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LibDataBase</RootNamespace>
<AssemblyName>LibDataBase</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</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>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<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="OrderConfig.cs" />
<Compile Include="TextPoint.cs" />
<Compile Include="OCRTextResult.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LibDataBase
{
public class OCRTextResult
{
public bool match;
public string text;
public List<PointF[]> points = new List<PointF[]>();
}
}

View File

@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LibDataBase
{
public class OrderConfig
{
public string QSV;
public int NumberOfLanes;
public Dictionary<int, List<string>> OCRRequest = new Dictionary<int, List<string>>();
public Dictionary<int, string> OCRDesign = new Dictionary<int, string>();
public string ProductStandard;
public double Width;
public double Height;
public double Gradient;
public bool ParseQSV;
public bool ParseProduct;
public bool ParseArrange;
public double DistX;
public double DistY;
public int ColorMax;
public string ColorArray;
}
}

View File

@@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("LibDataBase")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("HP")]
[assembly: AssemblyProduct("LibDataBase")]
[assembly: AssemblyCopyright("Copyright © HP 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("d03a85cc-a53b-4434-a560-7a89563292e8")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

21
LibDataBase/TextPoint.cs Normal file
View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
namespace LibDataBase
{
/// <summary>
/// 点
/// </summary>
public class TextPoint
{
public int x;
public int y;
public string txt;
public TextPoint(int x, int y,string txt)
{
this.x = x;
this.y = y;
this.txt = txt;
}
}
}

View File

@@ -0,0 +1,126 @@
using LibDataBase;
using OfficeOpenXml;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
namespace LibReadTetraExcel
{
public class ExcelHelper
{
public static OrderConfig ReadOCROrder(string execlFileName, string order)
{
OrderConfig config = new OrderConfig();
try
{
ExcelPackage.License.SetNonCommercialOrganization("My Noncommercial organization");
using (ExcelPackage package = new ExcelPackage(execlFileName))
{
ExcelWorksheet sheet1 = package.Workbook.Worksheets["P2生成数据"];
config.ParseQSV = false;
config.ParseProduct = false;
config.ParseArrange = false;
config.QSV = "";
config.NumberOfLanes = 0;
for (int i = 1; i < sheet1.Dimension.Rows; i++)
{
if (sheet1.GetValue(i, 3) == null)
continue;
if (sheet1.Cells[i, 3].Value.ToString() != order)
continue;
config.QSV = sheet1.Cells[i, 4].Value.ToString();
config.NumberOfLanes = Convert.ToInt32(sheet1.Cells[i, 5].Value.ToString());
int num = 0;
for (int k = 0; k < 10; k++)
{
string lanes = sheet1.Cells[i + k, 6].Value.ToString();
string design = sheet1.Cells[i + k, 7].Value.ToString().Split('-')[1];
string[] tmp = lanes.Substring(1, lanes.Length - 2).Split(',');
num += tmp.Length;
List<string> textOCR = ExecelGetOcrText(design, sheet1.Cells[i + k, 8].Value.ToString());
foreach (string lan in tmp)
{
int lanInt = Convert.ToInt32(lan);
config.OCRRequest[lanInt] = textOCR;
config.OCRDesign[lanInt] = design;
}
if (num >= config.NumberOfLanes)
{
config.ParseQSV = true;
break;
}
}
break;
}
if (!config.ParseQSV)
return config;
config.ProductStandard = "";
ExcelWorksheet sheet2 = package.Workbook.Worksheets["QSV对应产品规格和梯度"];
for (int j = 1; j <= sheet2.Dimension.Rows; j++)
{
if (sheet2.GetValue(j, 1) == null)
continue;
if (sheet2.Cells[j, 1].Value.ToString() != config.QSV)
continue;
config.ProductStandard = sheet2.Cells[j, 2].Value.ToString();
config.Width = Convert.ToDouble(sheet2.Cells[j, 3].Value.ToString());
config.Height = Convert.ToDouble(sheet2.Cells[j, 4].Value.ToString());
config.Gradient = Convert.ToDouble(sheet2.Cells[j, 5].Value.ToString());
config.ParseProduct = true;
break;
}
if (!config.ParseProduct)
return config;
ExcelWorksheet sheet3 = package.Workbook.Worksheets["产品规格对应排布方式"];
for (int n = 1; n < sheet3.Dimension.Rows; n++)
{
if (sheet3.GetValue(n, 1) == null)
continue;
if (sheet3.Cells[n, 1].Value.ToString() != config.ProductStandard)
continue;
string str = sheet3.Cells[n + config.OCRRequest[1].Count - 1, 4].Value.ToString();
string[] x_y = str.Split(',');
string[] X = x_y[0].Split(':');
string[] Y = x_y[1].Split(':');
config.DistX = Convert.ToDouble(X[1].Replace("mm", ""));
config.DistY = Convert.ToDouble(Y[1].Replace("mm", ""));
string alignColor = sheet3.Cells[n + config.OCRRequest[1].Count - 1, 3].Value.ToString();
if (alignColor.Contains("单排"))
config.ColorMax = config.OCRRequest.Values.Select(x => x.Count).Max();
else
config.ColorMax = alignColor.Replace("排布", "").Split('').ToList().Select(int.Parse).Max();
config.ColorArray = alignColor;
config.ParseArrange = true;
break;
}
}
}
catch (Exception)
{
}
return config;
}
private static List<string> ExecelGetOcrText(string design, string layer)
{
List<string> result = new List<string>();
string[] ll = layer.Replace("[", "").Replace("]", "").Split(',');
for (int i = 0; i < ll.Length; i++)
{
ll[i] = ll[i].Replace(" ", "");
string[] str = ll[i].Split('-');
if (str.Length < 2)
continue;
result.Add(design + str[1] + str[0]);
}
return result;
}
}
}

View File

@@ -0,0 +1,123 @@
<?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>{B88B2FA9-0D9D-4EBB-A87A-4DE2DC2DD70F}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LibReadTetraExcel</RootNamespace>
<AssemblyName>LibReadTetraExcel</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</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>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="EPPlus, Version=8.4.0.0, Culture=neutral, PublicKeyToken=ea159fdaa78159a1, processorArchitecture=MSIL">
<HintPath>..\packages\EPPlus.8.4.0\lib\net462\EPPlus.dll</HintPath>
</Reference>
<Reference Include="EPPlus.Interfaces, Version=8.4.0.0, Culture=neutral, PublicKeyToken=a694d7f3b0907a61, processorArchitecture=MSIL">
<HintPath>..\packages\EPPlus.Interfaces.8.4.0\lib\net462\EPPlus.Interfaces.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Bcl.Cryptography, Version=10.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.Cryptography.10.0.1\lib\net462\Microsoft.Bcl.Cryptography.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IO.RecyclableMemoryStream, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IO.RecyclableMemoryStream.3.0.1\lib\netstandard2.0\Microsoft.IO.RecyclableMemoryStream.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.6.1\lib\net462\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.Annotations, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.ComponentModel.Annotations.5.0.0\lib\net461\System.ComponentModel.Annotations.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Formats.Asn1, Version=10.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Formats.Asn1.10.0.1\lib\net462\System.Formats.Asn1.dll</HintPath>
</Reference>
<Reference Include="System.Memory, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.6.3\lib\net462\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.6.1\lib\net462\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.1.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Security" />
<Reference Include="System.Security.Cryptography.Xml, Version=10.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Xml.10.0.1\lib\net462\System.Security.Cryptography.Xml.dll</HintPath>
</Reference>
<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="ExcelHelper.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LibDataBase\LibDataBase.csproj">
<Project>{d03a85cc-a53b-4434-a560-7a89563292e8}</Project>
<Name>LibDataBase</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\System.ValueTuple.4.6.1\build\net471\System.ValueTuple.targets" Condition="Exists('..\packages\System.ValueTuple.4.6.1\build\net471\System.ValueTuple.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\System.ValueTuple.4.6.1\build\net471\System.ValueTuple.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.ValueTuple.4.6.1\build\net471\System.ValueTuple.targets'))" />
</Target>
</Project>

View File

@@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("LibReadTetraExcel")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("HP")]
[assembly: AssemblyProduct("LibReadTetraExcel")]
[assembly: AssemblyCopyright("Copyright © HP 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("b88b2fa9-0d9d-4ebb-a87a-4de2dc2dd70f")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.3.0" newVersion="6.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.6.0" newVersion="4.1.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.4.0" newVersion="4.2.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="ExtendedNumerics.BigDecimal" publicKeyToken="65f1315a45ad8949" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3003.0.0.346" newVersion="3003.0.0.346" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EPPlus" version="8.4.0" targetFramework="net472" />
<package id="EPPlus.Interfaces" version="8.4.0" targetFramework="net472" />
<package id="Microsoft.Bcl.Cryptography" version="10.0.1" targetFramework="net472" />
<package id="Microsoft.IO.RecyclableMemoryStream" version="3.0.1" targetFramework="net472" />
<package id="System.Buffers" version="4.6.1" targetFramework="net472" />
<package id="System.ComponentModel.Annotations" version="5.0.0" targetFramework="net472" />
<package id="System.Formats.Asn1" version="10.0.1" targetFramework="net472" />
<package id="System.Memory" version="4.6.3" targetFramework="net472" />
<package id="System.Numerics.Vectors" version="4.6.1" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.1.2" targetFramework="net472" />
<package id="System.Security.Cryptography.Xml" version="10.0.1" targetFramework="net472" />
<package id="System.ValueTuple" version="4.6.1" targetFramework="net472" />
</packages>

6
TestPackOCR/App.config Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

85
TestPackOCR/Form1.Designer.cs generated Normal file
View File

@@ -0,0 +1,85 @@
namespace TestPackOCR
{
partial class Form1
{
/// <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 Windows
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.txt_OrderNum = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.listBox1 = new System.Windows.Forms.ListBox();
this.SuspendLayout();
//
// txt_OrderNum
//
this.txt_OrderNum.Location = new System.Drawing.Point(216, 74);
this.txt_OrderNum.Name = "txt_OrderNum";
this.txt_OrderNum.Size = new System.Drawing.Size(131, 21);
this.txt_OrderNum.TabIndex = 0;
//
// button1
//
this.button1.Location = new System.Drawing.Point(353, 76);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 1;
this.button1.Text = "button1";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// listBox1
//
this.listBox1.FormattingEnabled = true;
this.listBox1.ItemHeight = 12;
this.listBox1.Location = new System.Drawing.Point(216, 120);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(561, 88);
this.listBox1.TabIndex = 2;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.listBox1);
this.Controls.Add(this.button1);
this.Controls.Add(this.txt_OrderNum);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox txt_OrderNum;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.ListBox listBox1;
}
}

83
TestPackOCR/Form1.cs Normal file
View File

@@ -0,0 +1,83 @@
using LibReadTetraExcel;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TestPackOCR
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
string order = txt_OrderNum.Text;
if (string.IsNullOrEmpty(order))
{
Console.WriteLine("订单号为空,请输入订单号。");
return;
}
Console.WriteLine("当前订单号为:" + order);
var config = ExcelHelper.ReadOCROrder("OCR文件0602.xlsx", order);
if (config.ParseQSV)
{
Console.WriteLine("当前订单QSV:" + config.QSV);
Console.WriteLine("当前订单Number Of Lanes:" + config.NumberOfLanes);
var result = config.OCRDesign
.GroupBy(kvp => kvp.Value, kvp => kvp.Key)
.ToDictionary(g => g.Key, g => g.ToList());
foreach (var kvp in result)
{
listBox1.Items.Add(string.Join(",", kvp.Value));
listBox1.Items.Add(string.Join(",", config.OCRRequest[kvp.Value[0]]));
}
}
else
{
Console.WriteLine("QSV未找到请检查订单号是否正确");
return;
}
if (config.ParseProduct)
{
Console.WriteLine("当前订单产品编号:" + config.ProductStandard);
Console.WriteLine("当前订单幅宽:" + config.Width);
Console.WriteLine ("当前订单幅高:" + config.Height);
Console.WriteLine("当前订单梯度:" + config.Gradient);
}
else
{
Console.WriteLine("ProductStandard未找到请检查订单号是否正确");
return;
}
if (config.ParseArrange)
{
Console.WriteLine("当前订单X偏移:" + config.DistX);
Console.WriteLine("当前订单Y偏移:" + config.DistY);
Console.WriteLine("当前排布方式:" + config.ColorArray);
Console.WriteLine("单行最大数量:" + config.ColorMax.ToString());
}
else
{
Console.WriteLine("DistXDistY未找到请检查订单号是否正确");
return;
}
Console.WriteLine("相关数据已获取完成,且已显示在界面中,请查看。");
}
}
}

120
TestPackOCR/Form1.resx Normal file
View File

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

22
TestPackOCR/Program.cs Normal file
View File

@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TestPackOCR
{
internal static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}

View File

@@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("TestPackOCR")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("HP")]
[assembly: AssemblyProduct("TestPackOCR")]
[assembly: AssemblyCopyright("Copyright © HP 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("717ba61b-8c31-473f-8a02-626337a90a5e")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace TestPackOCR.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("TestPackOCR.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;
}
}
}
}

View File

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

View File

@@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <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 TestPackOCR.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;
}
}
}
}

View File

@@ -0,0 +1,113 @@
<?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>{717BA61B-8C31-473F-8A02-626337A90A5E}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>TestPackOCR</RootNamespace>
<AssemblyName>TestPackOCR</AssemblyName>
<TargetFrameworkVersion>v4.7.2</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>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<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="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<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="..\LibDataBase\LibDataBase.csproj">
<Project>{d03a85cc-a53b-4434-a560-7a89563292e8}</Project>
<Name>LibDataBase</Name>
</ProjectReference>
<ProjectReference Include="..\LibReadTetraExcel\LibReadTetraExcel.csproj">
<Project>{b88b2fa9-0d9d-4ebb-a87a-4de2dc2dd70f}</Project>
<Name>LibReadTetraExcel</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

58
TetraPackOCR/App.config Normal file
View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.3.0" newVersion="6.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.6.0" newVersion="4.1.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IO.RecyclableMemoryStream" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Cognex.VisionPro.Comm" publicKeyToken="ef0f902af9dee505" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-69.3.0.0" newVersion="69.3.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Cognex.VisionPro" publicKeyToken="ef0f902af9dee505" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-69.3.0.0" newVersion="69.3.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.14.0" newVersion="2.0.14.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Encoding.CodePages" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.4.0" newVersion="4.2.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="ExtendedNumerics.BigDecimal" publicKeyToken="65f1315a45ad8949" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3003.0.0.346" newVersion="3003.0.0.346" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Drawing.Common" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

1266
TetraPackOCR/Form1.Designer.cs generated Normal file

File diff suppressed because it is too large Load Diff

1570
TetraPackOCR/Form1.cs Normal file

File diff suppressed because it is too large Load Diff

5136
TetraPackOCR/Form1.resx Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Threading.Tasks;
namespace TetraPackOCR
{
class GetOCRImage
{
//获取文件夹下最新文件的名称
public class FileTimeInfo
{
public string FileName;
public DateTime FileCreateTime;
}
public FileTimeInfo GetLatesFileImageName(string dir,string ext)
{
List<FileTimeInfo> list = new List<FileTimeInfo>();
DirectoryInfo d = new DirectoryInfo(dir);
foreach (FileInfo file in d.GetFiles())
{
if (file.Extension.ToUpper() == ext.ToUpper())
{
list.Add(new FileTimeInfo()
{
FileName = file.FullName,
FileCreateTime = file.CreationTime
});
}
}
var f = from x in list
orderby x.FileCreateTime
select x;
return f.LastOrDefault();
}
}
}

View File

@@ -0,0 +1,42 @@
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
</configSections>
<log4net>
<root>
<level value="ALL" />
<!---日志级别 从低到高 ALL DEBUG INFO WARN ERROR FATAL None-->
<appender-ref ref="RollingLogFileAppender" />
<appender-ref ref="listViewAppender" />
</root>
<!-- name属性指定其名称,type则是log4net.Appender命名空间的一个类的名称,意思是指定使用哪种介质-->
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="Log\\" />
<!-- 输出到什么目录-->
<appendToFile value="true" />
<!-- 是否到附加到文件中-->
<rollingStyle value="Date" />
<!-- 文件创建方式,以日期的方式记录-->
<datePattern value="yyyy-MM-dd&quot;.txt&quot;" />
<!-- 文件格式-->
<staticLogFileName value="false" />
<!--否采用静态文件名,文件名是否唯一-->
<layout type="log4net.Layout.PatternLayout">
<!---日志内容布局-->
<param name="ConversionPattern" value="%date %-5level %message%newline" />
</layout>
</appender>
<!---listView日志显示-->
<appender name="listViewAppender" type="LogShowLib.ListViewAppender, LogShowLib">
<formName value="Form1" />
<listViewName value="list_Log" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%message%newline" />
</layout>
</appender>
</log4net>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
</startup>
</configuration>

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("利乐包装OCR")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("CVE")]
[assembly: AssemblyProduct("利乐包装OCR")]
[assembly: AssemblyCopyright("Copyright ©BJCVE. 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("533800aa-d6a6-4ef7-825f-aa143b1ee901")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,83 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace TetraPackOCR.Properties {
using System;
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.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 (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TetraPackOCR.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性
/// 重写当前线程的 CurrentUICulture 属性。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap OFF {
get {
object obj = ResourceManager.GetObject("OFF", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap ON {
get {
object obj = ResourceManager.GetObject("ON", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View File

@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace TetraPackOCR.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.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;
}
}
}
}

View File

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

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -0,0 +1,260 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\OpenCvSharp4.runtime.win.4.11.0.20250507\build\netstandard\OpenCvSharp4.runtime.win.props" Condition="Exists('..\packages\OpenCvSharp4.runtime.win.4.11.0.20250507\build\netstandard\OpenCvSharp4.runtime.win.props')" />
<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>{3377D856-D94D-4EF1-9F16-9F19390C0BB3}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>TetraPackOCR</RootNamespace>
<AssemblyName>TetraPackOCR</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</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>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>favicon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="Cognex.VisionPro, Version=59.2.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\dll\Cognex.VisionPro.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.Controls, Version=59.2.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\dll\Cognex.VisionPro.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.Core, Version=59.2.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\dll\Cognex.VisionPro.Core.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.Display.Controls, Version=59.2.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\dll\Cognex.VisionPro.Display.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.ImageProcessing, Version=59.2.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\dll\Cognex.VisionPro.ImageProcessing.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.PMAlign, Version=59.2.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\dll\Cognex.VisionPro.PMAlign.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.QuickBuild.Core, Version=59.2.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\dll\Cognex.VisionPro.QuickBuild.Core.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.ToolGroup, Version=59.2.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\dll\Cognex.VisionPro.ToolGroup.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=2.0.14.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\dll\log4net.dll</HintPath>
</Reference>
<Reference Include="LogShowLib">
<HintPath>..\dll\LogShowLib.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.5-beta1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="OpenCvSharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
<HintPath>..\packages\OpenCvSharp4.4.11.0.20250507\lib\netstandard2.0\OpenCvSharp.dll</HintPath>
</Reference>
<Reference Include="OpenCvSharp.Extensions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
<HintPath>..\packages\OpenCvSharp4.Extensions.4.11.0.20250507\lib\netstandard2.0\OpenCvSharp.Extensions.dll</HintPath>
</Reference>
<Reference Include="PaddleOCRSharp, Version=5.1.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\PaddleOCRSharp.5.1.0\lib\net47\PaddleOCRSharp.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="QWhale.Common, Version=1.62.4104.36375, Culture=neutral, PublicKeyToken=da632fd1713dff10" />
<Reference Include="QWhale.Editor, Version=1.62.4104.36377, Culture=neutral, PublicKeyToken=da632fd1713dff10" />
<Reference Include="QWhale.Syntax, Version=1.62.4104.36376, Culture=neutral, PublicKeyToken=da632fd1713dff10" />
<Reference Include="QWhale.Syntax.Parsers, Version=1.62.4104.36376, Culture=neutral, PublicKeyToken=da632fd1713dff10" />
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.6.1\lib\net462\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Drawing.Common.10.0.1\lib\net462\System.Drawing.Common.dll</HintPath>
</Reference>
<Reference Include="System.Memory, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.6.3\lib\net462\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.6.1\lib\net462\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.1.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Security" />
<Reference Include="System.Threading.Tasks" />
<Reference Include="System.Xaml" />
<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" />
<Reference Include="WindowsBase" />
<Reference Include="WindowsFormsIntegration" />
</ItemGroup>
<ItemGroup>
<Compile Include="GetOCRImage.cs" />
<Compile Include="CPMARunStatus.cs" />
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<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>
<DesignTime>True</DesignTime>
</Compile>
<None Include="packages.config" />
<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>
<BootstrapperPackage Include=".NETFramework,Version=v4.7.1">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.7.1 %28x86 和 x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Content Include="favicon.ico" />
<Content Include="LogConfig.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="Resources\ON.png" />
<None Include="Resources\OFF.png" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LibCamera\LibCamera.csproj">
<Project>{37ce1f86-519d-44de-92f7-00acb78ffdf1}</Project>
<Name>LibCamera</Name>
</ProjectReference>
<ProjectReference Include="..\LibComm\LibComm.csproj">
<Project>{e44b1774-093e-4617-af7a-474a88b89100}</Project>
<Name>LibComm</Name>
</ProjectReference>
<ProjectReference Include="..\LibDataBase\LibDataBase.csproj">
<Project>{d03a85cc-a53b-4434-a560-7a89563292e8}</Project>
<Name>LibDataBase</Name>
</ProjectReference>
<ProjectReference Include="..\LibReadTetraExcel\LibReadTetraExcel.csproj">
<Project>{b88b2fa9-0d9d-4ebb-a87a-4de2dc2dd70f}</Project>
<Name>LibReadTetraExcel</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\System.ValueTuple.4.6.1\build\net471\System.ValueTuple.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.ValueTuple.4.6.1\build\net471\System.ValueTuple.targets'))" />
<Error Condition="!Exists('..\packages\OpenCvSharp4.runtime.win.4.11.0.20250507\build\netstandard\OpenCvSharp4.runtime.win.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\OpenCvSharp4.runtime.win.4.11.0.20250507\build\netstandard\OpenCvSharp4.runtime.win.props'))" />
<Error Condition="!Exists('..\packages\Paddle.Runtime.win_x64.3.2.2\build\Paddle.Runtime.win_x64.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Paddle.Runtime.win_x64.3.2.2\build\Paddle.Runtime.win_x64.targets'))" />
<Error Condition="!Exists('..\packages\PaddleOCRSharp.5.1.0\build\PaddleOCRSharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\PaddleOCRSharp.5.1.0\build\PaddleOCRSharp.targets'))" />
</Target>
<Import Project="..\packages\System.ValueTuple.4.6.1\build\net471\System.ValueTuple.targets" Condition="Exists('..\packages\System.ValueTuple.4.6.1\build\net471\System.ValueTuple.targets')" />
<Import Project="..\packages\Paddle.Runtime.win_x64.3.2.2\build\Paddle.Runtime.win_x64.targets" Condition="Exists('..\packages\Paddle.Runtime.win_x64.3.2.2\build\Paddle.Runtime.win_x64.targets')" />
<Import Project="..\packages\PaddleOCRSharp.5.1.0\build\PaddleOCRSharp.targets" Condition="Exists('..\packages\PaddleOCRSharp.5.1.0\build\PaddleOCRSharp.targets')" />
</Project>

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="13.0.5-beta1" targetFramework="net472" />
<package id="OpenCvSharp4" version="4.11.0.20250507" targetFramework="net472" />
<package id="OpenCvSharp4.Extensions" version="4.11.0.20250507" targetFramework="net472" />
<package id="OpenCvSharp4.runtime.win" version="4.11.0.20250507" targetFramework="net472" />
<package id="Paddle.Runtime.win_x64" version="3.2.2" targetFramework="net472" />
<package id="PaddleOCRSharp" version="5.1.0" targetFramework="net472" />
<package id="System.Buffers" version="4.6.1" targetFramework="net472" />
<package id="System.Drawing.Common" version="10.0.1" targetFramework="net472" />
<package id="System.Memory" version="4.6.3" targetFramework="net472" />
<package id="System.Numerics.Vectors" version="4.6.1" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.1.2" targetFramework="net472" />
<package id="System.ValueTuple" version="4.6.1" targetFramework="net472" />
</packages>

View File

@@ -1,36 +1,98 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.1972
# Visual Studio Version 18
VisualStudioVersion = 18.0.11123.170
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TetraParkOCR", "利乐包装OCR\TetraParkOCR.csproj", "{533800AA-D6A6-4EF7-825F-AA143B1EE901}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TetraParkOCR", "TetraParkOCR\TetraParkOCR.csproj", "{533800AA-D6A6-4EF7-825F-AA143B1EE901}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TetraPackOCR", "TetraPackOCR\TetraPackOCR.csproj", "{3377D856-D94D-4EF1-9F16-9F19390C0BB3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dll", "Dll", "{C0079401-F420-4256-B991-3BF16D3296C7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibReadTetraExcel", "LibReadTetraExcel\LibReadTetraExcel.csproj", "{B88B2FA9-0D9D-4EBB-A87A-4DE2DC2DD70F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibDataBase", "LibDataBase\LibDataBase.csproj", "{D03A85CC-A53B-4434-A560-7A89563292E8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestPackOCR", "TestPackOCR\TestPackOCR.csproj", "{717BA61B-8C31-473F-8A02-626337A90A5E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibComm", "LibComm\LibComm.csproj", "{E44B1774-093E-4617-AF7A-474A88B89100}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibCamera", "LibCamera\LibCamera.csproj", "{37CE1F86-519D-44DE-92F7-00ACB78FFDF1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{533800AA-D6A6-4EF7-825F-AA143B1EE901}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{533800AA-D6A6-4EF7-825F-AA143B1EE901}.Debug|Any CPU.Build.0 = Debug|Any CPU
{533800AA-D6A6-4EF7-825F-AA143B1EE901}.Debug|x64.ActiveCfg = Debug|x64
{533800AA-D6A6-4EF7-825F-AA143B1EE901}.Debug|x64.Build.0 = Debug|x64
{533800AA-D6A6-4EF7-825F-AA143B1EE901}.Debug|x86.ActiveCfg = Debug|x86
{533800AA-D6A6-4EF7-825F-AA143B1EE901}.Debug|x86.Build.0 = Debug|x86
{533800AA-D6A6-4EF7-825F-AA143B1EE901}.Release|Any CPU.ActiveCfg = Release|Any CPU
{533800AA-D6A6-4EF7-825F-AA143B1EE901}.Release|Any CPU.Build.0 = Release|Any CPU
{533800AA-D6A6-4EF7-825F-AA143B1EE901}.Release|x64.ActiveCfg = Release|x64
{533800AA-D6A6-4EF7-825F-AA143B1EE901}.Release|x64.Build.0 = Release|x64
{533800AA-D6A6-4EF7-825F-AA143B1EE901}.Release|x86.ActiveCfg = Release|x86
{533800AA-D6A6-4EF7-825F-AA143B1EE901}.Release|x86.Build.0 = Release|x86
{3377D856-D94D-4EF1-9F16-9F19390C0BB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3377D856-D94D-4EF1-9F16-9F19390C0BB3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3377D856-D94D-4EF1-9F16-9F19390C0BB3}.Debug|x64.ActiveCfg = Debug|x64
{3377D856-D94D-4EF1-9F16-9F19390C0BB3}.Debug|x64.Build.0 = Debug|x64
{3377D856-D94D-4EF1-9F16-9F19390C0BB3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3377D856-D94D-4EF1-9F16-9F19390C0BB3}.Release|Any CPU.Build.0 = Release|Any CPU
{3377D856-D94D-4EF1-9F16-9F19390C0BB3}.Release|x64.ActiveCfg = Release|x64
{3377D856-D94D-4EF1-9F16-9F19390C0BB3}.Release|x64.Build.0 = Release|x64
{B88B2FA9-0D9D-4EBB-A87A-4DE2DC2DD70F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B88B2FA9-0D9D-4EBB-A87A-4DE2DC2DD70F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B88B2FA9-0D9D-4EBB-A87A-4DE2DC2DD70F}.Debug|x64.ActiveCfg = Debug|x64
{B88B2FA9-0D9D-4EBB-A87A-4DE2DC2DD70F}.Debug|x64.Build.0 = Debug|x64
{B88B2FA9-0D9D-4EBB-A87A-4DE2DC2DD70F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B88B2FA9-0D9D-4EBB-A87A-4DE2DC2DD70F}.Release|Any CPU.Build.0 = Release|Any CPU
{B88B2FA9-0D9D-4EBB-A87A-4DE2DC2DD70F}.Release|x64.ActiveCfg = Release|Any CPU
{B88B2FA9-0D9D-4EBB-A87A-4DE2DC2DD70F}.Release|x64.Build.0 = Release|Any CPU
{D03A85CC-A53B-4434-A560-7A89563292E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D03A85CC-A53B-4434-A560-7A89563292E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D03A85CC-A53B-4434-A560-7A89563292E8}.Debug|x64.ActiveCfg = Debug|x64
{D03A85CC-A53B-4434-A560-7A89563292E8}.Debug|x64.Build.0 = Debug|x64
{D03A85CC-A53B-4434-A560-7A89563292E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D03A85CC-A53B-4434-A560-7A89563292E8}.Release|Any CPU.Build.0 = Release|Any CPU
{D03A85CC-A53B-4434-A560-7A89563292E8}.Release|x64.ActiveCfg = Release|Any CPU
{D03A85CC-A53B-4434-A560-7A89563292E8}.Release|x64.Build.0 = Release|Any CPU
{717BA61B-8C31-473F-8A02-626337A90A5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{717BA61B-8C31-473F-8A02-626337A90A5E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{717BA61B-8C31-473F-8A02-626337A90A5E}.Debug|x64.ActiveCfg = Debug|x64
{717BA61B-8C31-473F-8A02-626337A90A5E}.Debug|x64.Build.0 = Debug|x64
{717BA61B-8C31-473F-8A02-626337A90A5E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{717BA61B-8C31-473F-8A02-626337A90A5E}.Release|Any CPU.Build.0 = Release|Any CPU
{717BA61B-8C31-473F-8A02-626337A90A5E}.Release|x64.ActiveCfg = Release|Any CPU
{717BA61B-8C31-473F-8A02-626337A90A5E}.Release|x64.Build.0 = Release|Any CPU
{E44B1774-093E-4617-AF7A-474A88B89100}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E44B1774-093E-4617-AF7A-474A88B89100}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E44B1774-093E-4617-AF7A-474A88B89100}.Debug|x64.ActiveCfg = Debug|x64
{E44B1774-093E-4617-AF7A-474A88B89100}.Debug|x64.Build.0 = Debug|x64
{E44B1774-093E-4617-AF7A-474A88B89100}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E44B1774-093E-4617-AF7A-474A88B89100}.Release|Any CPU.Build.0 = Release|Any CPU
{E44B1774-093E-4617-AF7A-474A88B89100}.Release|x64.ActiveCfg = Release|Any CPU
{E44B1774-093E-4617-AF7A-474A88B89100}.Release|x64.Build.0 = Release|Any CPU
{37CE1F86-519D-44DE-92F7-00ACB78FFDF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{37CE1F86-519D-44DE-92F7-00ACB78FFDF1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{37CE1F86-519D-44DE-92F7-00ACB78FFDF1}.Debug|x64.ActiveCfg = Debug|x64
{37CE1F86-519D-44DE-92F7-00ACB78FFDF1}.Debug|x64.Build.0 = Debug|x64
{37CE1F86-519D-44DE-92F7-00ACB78FFDF1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{37CE1F86-519D-44DE-92F7-00ACB78FFDF1}.Release|Any CPU.Build.0 = Release|Any CPU
{37CE1F86-519D-44DE-92F7-00ACB78FFDF1}.Release|x64.ActiveCfg = Release|Any CPU
{37CE1F86-519D-44DE-92F7-00ACB78FFDF1}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{B88B2FA9-0D9D-4EBB-A87A-4DE2DC2DD70F} = {C0079401-F420-4256-B991-3BF16D3296C7}
{D03A85CC-A53B-4434-A560-7A89563292E8} = {C0079401-F420-4256-B991-3BF16D3296C7}
{E44B1774-093E-4617-AF7A-474A88B89100} = {C0079401-F420-4256-B991-3BF16D3296C7}
{37CE1F86-519D-44DE-92F7-00ACB78FFDF1} = {C0079401-F420-4256-B991-3BF16D3296C7}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F550CA1D-FC09-446C-B501-170B642AAC00}
EndGlobalSection

View File

@@ -37,6 +37,10 @@
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Encoding.CodePages" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.4.0" newVersion="4.2.4.0" />
@@ -45,6 +49,10 @@
<assemblyIdentity name="ExtendedNumerics.BigDecimal" publicKeyToken="65f1315a45ad8949" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3001.1.0.233" newVersion="3001.1.0.233" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Drawing.Common" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -0,0 +1,157 @@
/********************************************
* 版本号V1.2
* 作者: 孙剑
* 最后修改时间2022年5月23日
*
* 类功能说明:
*
*
* 第一个方法:
* public static bool PMARunStatus(CogPMAlignTool pmaTool, int i) 可保证任何情况下使用PMATool的结果是可用的
* 不可用时返回false。程序不会报错和崩溃。
* -------------------------------------------
* 调用例程:
* double pmaRotation = 0;
* double pmaX = 0;
* double pmaY = 0;
* if (CPMARunStatus.PMARunStatus(myPMATool, 1))
{
pmaRotation = myPMATool.Results[i].GetPose().Rotation;
pmaX = myPMATool.Results[i].GetPose().TranslationX;
pmaY = myPMATool.Results[i].GetPose().TranslationY;
}
* --------------------------------------------
* 第二个方法 在cogRecordDisplay_0的控件上画出匹配的外形轮廓和十字标线
* 注意您如果没让PMATool图形显示您所要的轮廓线有可能不能画出
* CPMARunStatus.DrawPMA(myPMATool, cogRecordDisplay_0);
*
* 第三个方法只是画了一个自定义的十字。
*
* 备注画图的方法是在一个CogRecordDisplay上画出。
*
********************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cognex.VisionPro.PMAlign;
using Cognex.VisionPro;
namespace AVP.CRobot
{
/// <summary>
/// 返回CogPMAlignTool的运行结果,请调用PMARunStatus方法
/// </summary>
class CPMARunStatus
{
/// <summary>
/// 返回CogPMAlignTool的运行结果工具运行成功并且数量>=i 的时候返回true
/// </summary>
/// <param name="pmaTool">PMA工具Tool</param>
/// <param name="i">预期找到的数量</param>
/// <returns>数量>=i 的时候返回true</returns>
public static bool PMARunStatus(CogPMAlignTool pmaTool, int i)
{
if (pmaTool.RunStatus.Result == CogToolResultConstants.Accept)
{
if (pmaTool.Results.Count >= i)
return true;
}
return false;
}
/// <summary>
/// 利用输入的PMATool在CogRecordDisplay 上画出找到工件的轮廓
/// </summary>
/// <param name="pmaTool">输入的PMATool</param>
/// <param name="disp">输入要显示的CogRecordDisplay</param>
public static void DrawPMA(CogPMAlignTool pmaTool, CogRecordDisplay disp)
{
if (pmaTool.RunStatus.Result == CogToolResultConstants.Accept)
{
if (pmaTool.Results.Count > 0) //判断输入的PMATool是否有结果才可以画图
{
foreach (CogPMAlignResult item in pmaTool.Results)
{
disp.InteractiveGraphics.Add(item.CreateResultGraphics(CogPMAlignResultGraphicConstants.MatchFeatures),
"", false);
disp.InteractiveGraphics.Add(item.CreateResultGraphics(CogPMAlignResultGraphicConstants.CoordinateAxes), "", false);
}
}
}
}
/// <summary>
/// 画十字
/// </summary>
/// <param name="centerX"></param>
/// <param name="centerY"></param>
/// <param name="angle"></param>
/// <param name="color"></param>
/// <param name="myDisplay"></param>
/// <param name="spaceName"></param>
public static void DrawPointMarker(double centerX, double centerY, double angle, CogColorConstants color, CogRecordDisplay myDisplay, string spaceName)
{
CogPointMarker cgMarker = new CogPointMarker
{
X = centerX,
Y = centerY,
Rotation = angle, //弧度
Color = color,
SelectedSpaceName = spaceName,
Interactive = true,
LineWidthInScreenPixels = 2,
SizeInScreenPixels = 50
};
myDisplay.InteractiveGraphics.Add(cgMarker, null, false);
}
/// <summary>
/// 在给定的图像空间中画圆
/// </summary>
/// <param name="centerX"></param>
/// <param name="centerY"></param>
/// <param name="color"></param>
/// <param name="myDisplay"></param>
/// <param name="spaceName"></param>
public static void DrawCircle(double centerX, double centerY, CogColorConstants color, CogRecordDisplay myDisplay, string spaceName)
{
CogCircle cgCirlcle = new CogCircle
{
CenterX = centerX,
CenterY = centerY,
Color = color,
SelectedSpaceName = spaceName
};
myDisplay.InteractiveGraphics.Add(cgCirlcle, null, false);
}
/// <summary>
/// 在给定的图像空间中画线段
/// </summary>
/// <param name="startX"></param>
/// <param name="startY"></param>
/// <param name="endX"></param>
/// <param name="endY"></param>
/// <param name="color"></param>
/// <param name="myDisplay"></param>
/// <param name="spaceName"></param>
public static void DrawLineSegment(double startX, double startY, double endX, double endY, CogColorConstants color, CogRecordDisplay myDisplay, string spaceName)
{
CogLineSegment cgLineSegment = new CogLineSegment
{
StartX = startX,
StartY = startY,
EndX = endX,
EndY = endY,
Color = color,
SelectedSpaceName = spaceName,
StartPointAdornment = CogLineSegmentAdornmentConstants.Arrow,
EndPointAdornment = CogLineSegmentAdornmentConstants.Arrow
};
myDisplay.InteractiveGraphics.Add(cgLineSegment, null, false);
}
}
}

View File

@@ -37,27 +37,28 @@
this.lbl_Y = new System.Windows.Forms.Label();
this.lbl_X = new System.Windows.Forms.Label();
this.lbl_verOcr = new System.Windows.Forms.Label();
this.lbl_verOcrShow = new System.Windows.Forms.Label();
this.lbl_XShow = new System.Windows.Forms.Label();
this.lbl_YShow = new System.Windows.Forms.Label();
this.lbl_RShow = new System.Windows.Forms.Label();
this.lbl_readOcrResult = new System.Windows.Forms.Label();
this.lbl_ocrResultState = new System.Windows.Forms.Label();
this.tableLayoutPanel_productInformtion = new System.Windows.Forms.TableLayoutPanel();
this.lbl_DistYShow = new System.Windows.Forms.Label();
this.lbl_DistXShow = new System.Windows.Forms.Label();
this.lbl_GradientShow = new System.Windows.Forms.Label();
this.lbl_widthShow = new System.Windows.Forms.Label();
this.lbl_ProductStandardShow = new System.Windows.Forms.Label();
this.lbl_NOFShow = new System.Windows.Forms.Label();
this.lbl_QSVShow = new System.Windows.Forms.Label();
this.lbl_height = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.lbl_DistY = new System.Windows.Forms.Label();
this.lbl_QSV = new System.Windows.Forms.Label();
this.lbl_DistX = new System.Windows.Forms.Label();
this.lbl_Gradient = new System.Windows.Forms.Label();
this.lbl_width = new System.Windows.Forms.Label();
this.lbl_ProductStandard = new System.Windows.Forms.Label();
this.lbl_NOF = new System.Windows.Forms.Label();
this.lbl_NO = new System.Windows.Forms.Label();
this.lbl_QSV = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.Location_Display = new Cognex.VisionPro.CogRecordDisplay();
this.Ocr_picBox = new System.Windows.Forms.PictureBox();
this.btn_manualOcr = new System.Windows.Forms.Button();
@@ -98,16 +99,22 @@
this.panel_OrderInformation = new System.Windows.Forms.Panel();
this.lbl_orderinfo = new System.Windows.Forms.Label();
this.panel_AutoRun = new System.Windows.Forms.Panel();
this.label3 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.menuStrip_topmenu = new System.Windows.Forms.MenuStrip();
this.tableLayoutPanel_mainForm = new System.Windows.Forms.TableLayoutPanel();
this.panel_midup = new System.Windows.Forms.Panel();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label12 = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.listBox1 = new System.Windows.Forms.ListBox();
this.btn_StarDet_manual = new System.Windows.Forms.Button();
this.panel_log = new System.Windows.Forms.Panel();
this.panel_pixshow = new System.Windows.Forms.Panel();
this.panel_auto = new System.Windows.Forms.Panel();
this.panel_locationDisplay = new System.Windows.Forms.Panel();
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
this.button2 = new System.Windows.Forms.Button();
this.tableLayoutPanel_productInformtion.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.Location_Display)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.Ocr_picBox)).BeginInit();
@@ -129,7 +136,7 @@
this.btn_OrderNum.BackColor = System.Drawing.Color.DeepSkyBlue;
this.btn_OrderNum.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.btn_OrderNum.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn_OrderNum.Location = new System.Drawing.Point(519, 26);
this.btn_OrderNum.Location = new System.Drawing.Point(520, 19);
this.btn_OrderNum.Name = "btn_OrderNum";
this.btn_OrderNum.Size = new System.Drawing.Size(116, 29);
this.btn_OrderNum.TabIndex = 2;
@@ -141,7 +148,7 @@
// txt_OrderNum
//
this.txt_OrderNum.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txt_OrderNum.Location = new System.Drawing.Point(328, 26);
this.txt_OrderNum.Location = new System.Drawing.Point(329, 19);
this.txt_OrderNum.Name = "txt_OrderNum";
this.txt_OrderNum.Size = new System.Drawing.Size(176, 29);
this.txt_OrderNum.TabIndex = 3;
@@ -150,7 +157,7 @@
// lbl_OrderNum
//
this.lbl_OrderNum.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbl_OrderNum.Location = new System.Drawing.Point(231, 26);
this.lbl_OrderNum.Location = new System.Drawing.Point(232, 19);
this.lbl_OrderNum.Name = "lbl_OrderNum";
this.lbl_OrderNum.Size = new System.Drawing.Size(95, 29);
this.lbl_OrderNum.TabIndex = 4;
@@ -160,7 +167,7 @@
// lbl_R
//
this.lbl_R.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbl_R.Location = new System.Drawing.Point(532, 89);
this.lbl_R.Location = new System.Drawing.Point(507, 284);
this.lbl_R.Name = "lbl_R";
this.lbl_R.Size = new System.Drawing.Size(129, 29);
this.lbl_R.TabIndex = 5;
@@ -170,7 +177,7 @@
// lbl_Y
//
this.lbl_Y.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbl_Y.Location = new System.Drawing.Point(277, 89);
this.lbl_Y.Location = new System.Drawing.Point(252, 284);
this.lbl_Y.Name = "lbl_Y";
this.lbl_Y.Size = new System.Drawing.Size(129, 29);
this.lbl_Y.TabIndex = 6;
@@ -180,7 +187,7 @@
// lbl_X
//
this.lbl_X.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbl_X.Location = new System.Drawing.Point(36, 89);
this.lbl_X.Location = new System.Drawing.Point(11, 284);
this.lbl_X.Name = "lbl_X";
this.lbl_X.Size = new System.Drawing.Size(129, 29);
this.lbl_X.TabIndex = 7;
@@ -190,7 +197,7 @@
// lbl_verOcr
//
this.lbl_verOcr.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbl_verOcr.Location = new System.Drawing.Point(151, 225);
this.lbl_verOcr.Location = new System.Drawing.Point(14, 53);
this.lbl_verOcr.Name = "lbl_verOcr";
this.lbl_verOcr.Size = new System.Drawing.Size(99, 29);
this.lbl_verOcr.TabIndex = 9;
@@ -198,24 +205,12 @@
this.lbl_verOcr.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.toolTip.SetToolTip(this.lbl_verOcr, "字符从数据表格抓取以做验证使用");
//
// lbl_verOcrShow
//
this.lbl_verOcrShow.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.lbl_verOcrShow.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lbl_verOcrShow.Font = new System.Drawing.Font("宋体", 12F);
this.lbl_verOcrShow.Location = new System.Drawing.Point(150, 254);
this.lbl_verOcrShow.Name = "lbl_verOcrShow";
this.lbl_verOcrShow.Size = new System.Drawing.Size(539, 40);
this.lbl_verOcrShow.TabIndex = 10;
this.lbl_verOcrShow.Text = "等待订单确认...";
this.lbl_verOcrShow.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// lbl_XShow
//
this.lbl_XShow.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.lbl_XShow.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lbl_XShow.Font = new System.Drawing.Font("宋体", 12F);
this.lbl_XShow.Location = new System.Drawing.Point(154, 89);
this.lbl_XShow.Location = new System.Drawing.Point(129, 284);
this.lbl_XShow.Name = "lbl_XShow";
this.lbl_XShow.Size = new System.Drawing.Size(117, 29);
this.lbl_XShow.TabIndex = 11;
@@ -226,7 +221,7 @@
this.lbl_YShow.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.lbl_YShow.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lbl_YShow.Font = new System.Drawing.Font("宋体", 12F);
this.lbl_YShow.Location = new System.Drawing.Point(395, 88);
this.lbl_YShow.Location = new System.Drawing.Point(370, 283);
this.lbl_YShow.Name = "lbl_YShow";
this.lbl_YShow.Size = new System.Drawing.Size(117, 29);
this.lbl_YShow.TabIndex = 12;
@@ -237,7 +232,7 @@
this.lbl_RShow.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.lbl_RShow.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lbl_RShow.Font = new System.Drawing.Font("宋体", 12F);
this.lbl_RShow.Location = new System.Drawing.Point(650, 89);
this.lbl_RShow.Location = new System.Drawing.Point(625, 284);
this.lbl_RShow.Name = "lbl_RShow";
this.lbl_RShow.Size = new System.Drawing.Size(117, 29);
this.lbl_RShow.TabIndex = 13;
@@ -246,7 +241,7 @@
// lbl_readOcrResult
//
this.lbl_readOcrResult.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbl_readOcrResult.Location = new System.Drawing.Point(147, 307);
this.lbl_readOcrResult.Location = new System.Drawing.Point(14, 321);
this.lbl_readOcrResult.Name = "lbl_readOcrResult";
this.lbl_readOcrResult.Size = new System.Drawing.Size(127, 29);
this.lbl_readOcrResult.TabIndex = 14;
@@ -272,194 +267,219 @@
this.tableLayoutPanel_productInformtion.ColumnCount = 2;
this.tableLayoutPanel_productInformtion.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel_productInformtion.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel_productInformtion.Controls.Add(this.lbl_DistYShow, 1, 6);
this.tableLayoutPanel_productInformtion.Controls.Add(this.lbl_DistXShow, 1, 5);
this.tableLayoutPanel_productInformtion.Controls.Add(this.lbl_GradientShow, 1, 4);
this.tableLayoutPanel_productInformtion.Controls.Add(this.lbl_widthShow, 1, 3);
this.tableLayoutPanel_productInformtion.Controls.Add(this.lbl_ProductStandardShow, 1, 2);
this.tableLayoutPanel_productInformtion.Controls.Add(this.lbl_NOFShow, 1, 1);
this.tableLayoutPanel_productInformtion.Controls.Add(this.lbl_QSVShow, 1, 0);
this.tableLayoutPanel_productInformtion.Controls.Add(this.lbl_DistY, 0, 6);
this.tableLayoutPanel_productInformtion.Controls.Add(this.lbl_QSV, 0, 0);
this.tableLayoutPanel_productInformtion.Controls.Add(this.lbl_DistX, 0, 5);
this.tableLayoutPanel_productInformtion.Controls.Add(this.lbl_Gradient, 0, 4);
this.tableLayoutPanel_productInformtion.Controls.Add(this.lbl_width, 0, 3);
this.tableLayoutPanel_productInformtion.Controls.Add(this.lbl_ProductStandard, 0, 2);
this.tableLayoutPanel_productInformtion.Controls.Add(this.lbl_NOF, 0, 1);
this.tableLayoutPanel_productInformtion.Controls.Add(this.lbl_height, 1, 4);
this.tableLayoutPanel_productInformtion.Controls.Add(this.label5, 0, 4);
this.tableLayoutPanel_productInformtion.Controls.Add(this.lbl_DistY, 1, 7);
this.tableLayoutPanel_productInformtion.Controls.Add(this.lbl_DistX, 1, 6);
this.tableLayoutPanel_productInformtion.Controls.Add(this.lbl_Gradient, 1, 5);
this.tableLayoutPanel_productInformtion.Controls.Add(this.lbl_width, 1, 3);
this.tableLayoutPanel_productInformtion.Controls.Add(this.lbl_ProductStandard, 1, 2);
this.tableLayoutPanel_productInformtion.Controls.Add(this.lbl_NO, 1, 1);
this.tableLayoutPanel_productInformtion.Controls.Add(this.lbl_QSV, 1, 0);
this.tableLayoutPanel_productInformtion.Controls.Add(this.label8, 0, 7);
this.tableLayoutPanel_productInformtion.Controls.Add(this.label1, 0, 0);
this.tableLayoutPanel_productInformtion.Controls.Add(this.label7, 0, 6);
this.tableLayoutPanel_productInformtion.Controls.Add(this.label6, 0, 5);
this.tableLayoutPanel_productInformtion.Controls.Add(this.label4, 0, 3);
this.tableLayoutPanel_productInformtion.Controls.Add(this.label3, 0, 2);
this.tableLayoutPanel_productInformtion.Controls.Add(this.label2, 0, 1);
this.tableLayoutPanel_productInformtion.Location = new System.Drawing.Point(2, 38);
this.tableLayoutPanel_productInformtion.Name = "tableLayoutPanel_productInformtion";
this.tableLayoutPanel_productInformtion.RowCount = 7;
this.tableLayoutPanel_productInformtion.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28571F));
this.tableLayoutPanel_productInformtion.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28572F));
this.tableLayoutPanel_productInformtion.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28572F));
this.tableLayoutPanel_productInformtion.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28572F));
this.tableLayoutPanel_productInformtion.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28572F));
this.tableLayoutPanel_productInformtion.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28572F));
this.tableLayoutPanel_productInformtion.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28572F));
this.tableLayoutPanel_productInformtion.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel_productInformtion.RowCount = 8;
this.tableLayoutPanel_productInformtion.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
this.tableLayoutPanel_productInformtion.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
this.tableLayoutPanel_productInformtion.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
this.tableLayoutPanel_productInformtion.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
this.tableLayoutPanel_productInformtion.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
this.tableLayoutPanel_productInformtion.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
this.tableLayoutPanel_productInformtion.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
this.tableLayoutPanel_productInformtion.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
this.tableLayoutPanel_productInformtion.Size = new System.Drawing.Size(308, 282);
this.tableLayoutPanel_productInformtion.TabIndex = 20;
//
// lbl_DistYShow
// lbl_height
//
this.lbl_DistYShow.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.lbl_DistYShow.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lbl_DistYShow.Font = new System.Drawing.Font("宋体", 12F);
this.lbl_DistYShow.Location = new System.Drawing.Point(155, 237);
this.lbl_DistYShow.Margin = new System.Windows.Forms.Padding(0);
this.lbl_DistYShow.Name = "lbl_DistYShow";
this.lbl_DistYShow.Size = new System.Drawing.Size(150, 38);
this.lbl_DistYShow.TabIndex = 27;
this.lbl_DistYShow.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.lbl_height.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.lbl_height.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lbl_height.Font = new System.Drawing.Font("宋体", 12F);
this.lbl_height.Location = new System.Drawing.Point(155, 139);
this.lbl_height.Margin = new System.Windows.Forms.Padding(0);
this.lbl_height.Name = "lbl_height";
this.lbl_height.Size = new System.Drawing.Size(150, 31);
this.lbl_height.TabIndex = 29;
this.lbl_height.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// lbl_DistXShow
// label5
//
this.lbl_DistXShow.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.lbl_DistXShow.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lbl_DistXShow.Font = new System.Drawing.Font("宋体", 12F);
this.lbl_DistXShow.Location = new System.Drawing.Point(155, 198);
this.lbl_DistXShow.Margin = new System.Windows.Forms.Padding(0);
this.lbl_DistXShow.Name = "lbl_DistXShow";
this.lbl_DistXShow.Size = new System.Drawing.Size(150, 36);
this.lbl_DistXShow.TabIndex = 26;
this.lbl_DistXShow.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// lbl_GradientShow
//
this.lbl_GradientShow.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.lbl_GradientShow.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lbl_GradientShow.Font = new System.Drawing.Font("宋体", 12F);
this.lbl_GradientShow.Location = new System.Drawing.Point(155, 159);
this.lbl_GradientShow.Margin = new System.Windows.Forms.Padding(0);
this.lbl_GradientShow.Name = "lbl_GradientShow";
this.lbl_GradientShow.Size = new System.Drawing.Size(150, 36);
this.lbl_GradientShow.TabIndex = 25;
this.lbl_GradientShow.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// lbl_widthShow
//
this.lbl_widthShow.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.lbl_widthShow.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lbl_widthShow.Font = new System.Drawing.Font("宋体", 12F);
this.lbl_widthShow.Location = new System.Drawing.Point(155, 120);
this.lbl_widthShow.Margin = new System.Windows.Forms.Padding(0);
this.lbl_widthShow.Name = "lbl_widthShow";
this.lbl_widthShow.Size = new System.Drawing.Size(150, 36);
this.lbl_widthShow.TabIndex = 24;
this.lbl_widthShow.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// lbl_ProductStandardShow
//
this.lbl_ProductStandardShow.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.lbl_ProductStandardShow.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lbl_ProductStandardShow.Font = new System.Drawing.Font("宋体", 12F);
this.lbl_ProductStandardShow.Location = new System.Drawing.Point(155, 81);
this.lbl_ProductStandardShow.Margin = new System.Windows.Forms.Padding(0);
this.lbl_ProductStandardShow.Name = "lbl_ProductStandardShow";
this.lbl_ProductStandardShow.Size = new System.Drawing.Size(150, 36);
this.lbl_ProductStandardShow.TabIndex = 23;
this.lbl_ProductStandardShow.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// lbl_NOFShow
//
this.lbl_NOFShow.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.lbl_NOFShow.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lbl_NOFShow.Font = new System.Drawing.Font("宋体", 12F);
this.lbl_NOFShow.Location = new System.Drawing.Point(155, 42);
this.lbl_NOFShow.Margin = new System.Windows.Forms.Padding(0);
this.lbl_NOFShow.Name = "lbl_NOFShow";
this.lbl_NOFShow.Size = new System.Drawing.Size(150, 36);
this.lbl_NOFShow.TabIndex = 22;
this.lbl_NOFShow.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// lbl_QSVShow
//
this.lbl_QSVShow.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.lbl_QSVShow.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lbl_QSVShow.Font = new System.Drawing.Font("宋体", 12F);
this.lbl_QSVShow.Location = new System.Drawing.Point(155, 3);
this.lbl_QSVShow.Margin = new System.Windows.Forms.Padding(0);
this.lbl_QSVShow.Name = "lbl_QSVShow";
this.lbl_QSVShow.Size = new System.Drawing.Size(150, 36);
this.lbl_QSVShow.TabIndex = 21;
this.lbl_QSVShow.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.label5.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label5.Location = new System.Drawing.Point(3, 139);
this.label5.Margin = new System.Windows.Forms.Padding(0);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(149, 31);
this.label5.TabIndex = 28;
this.label5.Text = "包材高度:";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lbl_DistY
//
this.lbl_DistY.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbl_DistY.Location = new System.Drawing.Point(3, 237);
this.lbl_DistY.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.lbl_DistY.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lbl_DistY.Font = new System.Drawing.Font("宋体", 12F);
this.lbl_DistY.Location = new System.Drawing.Point(155, 241);
this.lbl_DistY.Margin = new System.Windows.Forms.Padding(0);
this.lbl_DistY.Name = "lbl_DistY";
this.lbl_DistY.Size = new System.Drawing.Size(149, 41);
this.lbl_DistY.TabIndex = 12;
this.lbl_DistY.Text = "Y距离";
this.lbl_DistY.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lbl_QSV
//
this.lbl_QSV.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbl_QSV.Location = new System.Drawing.Point(3, 3);
this.lbl_QSV.Margin = new System.Windows.Forms.Padding(0);
this.lbl_QSV.Name = "lbl_QSV";
this.lbl_QSV.Size = new System.Drawing.Size(149, 36);
this.lbl_QSV.TabIndex = 6;
this.lbl_QSV.Text = "QSV";
this.lbl_QSV.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lbl_DistY.Size = new System.Drawing.Size(150, 38);
this.lbl_DistY.TabIndex = 27;
this.lbl_DistY.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// lbl_DistX
//
this.lbl_DistX.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbl_DistX.Location = new System.Drawing.Point(3, 198);
this.lbl_DistX.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.lbl_DistX.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lbl_DistX.Font = new System.Drawing.Font("宋体", 12F);
this.lbl_DistX.Location = new System.Drawing.Point(155, 207);
this.lbl_DistX.Margin = new System.Windows.Forms.Padding(0);
this.lbl_DistX.Name = "lbl_DistX";
this.lbl_DistX.Size = new System.Drawing.Size(149, 36);
this.lbl_DistX.TabIndex = 7;
this.lbl_DistX.Text = "X距离";
this.lbl_DistX.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lbl_DistX.Size = new System.Drawing.Size(150, 31);
this.lbl_DistX.TabIndex = 26;
this.lbl_DistX.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// lbl_Gradient
//
this.lbl_Gradient.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbl_Gradient.Location = new System.Drawing.Point(3, 159);
this.lbl_Gradient.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.lbl_Gradient.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lbl_Gradient.Font = new System.Drawing.Font("宋体", 12F);
this.lbl_Gradient.Location = new System.Drawing.Point(155, 173);
this.lbl_Gradient.Margin = new System.Windows.Forms.Padding(0);
this.lbl_Gradient.Name = "lbl_Gradient";
this.lbl_Gradient.Size = new System.Drawing.Size(149, 36);
this.lbl_Gradient.TabIndex = 8;
this.lbl_Gradient.Text = "梯度:";
this.lbl_Gradient.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lbl_Gradient.Size = new System.Drawing.Size(150, 31);
this.lbl_Gradient.TabIndex = 25;
this.lbl_Gradient.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// lbl_width
//
this.lbl_width.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbl_width.Location = new System.Drawing.Point(3, 120);
this.lbl_width.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.lbl_width.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lbl_width.Font = new System.Drawing.Font("宋体", 12F);
this.lbl_width.Location = new System.Drawing.Point(155, 105);
this.lbl_width.Margin = new System.Windows.Forms.Padding(0);
this.lbl_width.Name = "lbl_width";
this.lbl_width.Size = new System.Drawing.Size(149, 36);
this.lbl_width.TabIndex = 9;
this.lbl_width.Text = "包材宽度:";
this.lbl_width.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lbl_width.Size = new System.Drawing.Size(150, 31);
this.lbl_width.TabIndex = 24;
this.lbl_width.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// lbl_ProductStandard
//
this.lbl_ProductStandard.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbl_ProductStandard.Location = new System.Drawing.Point(3, 81);
this.lbl_ProductStandard.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.lbl_ProductStandard.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lbl_ProductStandard.Font = new System.Drawing.Font("宋体", 12F);
this.lbl_ProductStandard.Location = new System.Drawing.Point(155, 71);
this.lbl_ProductStandard.Margin = new System.Windows.Forms.Padding(0);
this.lbl_ProductStandard.Name = "lbl_ProductStandard";
this.lbl_ProductStandard.Size = new System.Drawing.Size(149, 36);
this.lbl_ProductStandard.TabIndex = 10;
this.lbl_ProductStandard.Text = "产品规格:";
this.lbl_ProductStandard.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lbl_ProductStandard.Size = new System.Drawing.Size(150, 31);
this.lbl_ProductStandard.TabIndex = 23;
this.lbl_ProductStandard.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// lbl_NOF
// lbl_NO
//
this.lbl_NOF.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbl_NOF.Location = new System.Drawing.Point(3, 42);
this.lbl_NOF.Margin = new System.Windows.Forms.Padding(0);
this.lbl_NOF.Name = "lbl_NOF";
this.lbl_NOF.Size = new System.Drawing.Size(149, 36);
this.lbl_NOF.TabIndex = 11;
this.lbl_NOF.Text = "Number Of Lanes";
this.lbl_NOF.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lbl_NO.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.lbl_NO.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lbl_NO.Font = new System.Drawing.Font("宋体", 12F);
this.lbl_NO.Location = new System.Drawing.Point(155, 37);
this.lbl_NO.Margin = new System.Windows.Forms.Padding(0);
this.lbl_NO.Name = "lbl_NO";
this.lbl_NO.Size = new System.Drawing.Size(150, 31);
this.lbl_NO.TabIndex = 22;
this.lbl_NO.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// lbl_QSV
//
this.lbl_QSV.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.lbl_QSV.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.lbl_QSV.Font = new System.Drawing.Font("宋体", 12F);
this.lbl_QSV.Location = new System.Drawing.Point(155, 3);
this.lbl_QSV.Margin = new System.Windows.Forms.Padding(0);
this.lbl_QSV.Name = "lbl_QSV";
this.lbl_QSV.Size = new System.Drawing.Size(150, 31);
this.lbl_QSV.TabIndex = 21;
this.lbl_QSV.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label8
//
this.label8.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label8.Location = new System.Drawing.Point(3, 241);
this.label8.Margin = new System.Windows.Forms.Padding(0);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(149, 38);
this.label8.TabIndex = 12;
this.label8.Text = "Y距离";
this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label1
//
this.label1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(3, 3);
this.label1.Margin = new System.Windows.Forms.Padding(0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(149, 31);
this.label1.TabIndex = 6;
this.label1.Text = "QSV";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label7
//
this.label7.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label7.Location = new System.Drawing.Point(3, 207);
this.label7.Margin = new System.Windows.Forms.Padding(0);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(149, 31);
this.label7.TabIndex = 7;
this.label7.Text = "X距离";
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label6
//
this.label6.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label6.Location = new System.Drawing.Point(3, 173);
this.label6.Margin = new System.Windows.Forms.Padding(0);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(149, 31);
this.label6.TabIndex = 8;
this.label6.Text = "梯度:";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label4
//
this.label4.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label4.Location = new System.Drawing.Point(3, 105);
this.label4.Margin = new System.Windows.Forms.Padding(0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(149, 31);
this.label4.TabIndex = 9;
this.label4.Text = "包材宽度:";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label3
//
this.label3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label3.Location = new System.Drawing.Point(3, 71);
this.label3.Margin = new System.Windows.Forms.Padding(0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(149, 31);
this.label3.TabIndex = 10;
this.label3.Text = "产品规格:";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label2
//
this.label2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(3, 37);
this.label2.Margin = new System.Windows.Forms.Padding(0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(149, 31);
this.label2.TabIndex = 11;
this.label2.Text = "Number Of Lanes";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// Location_Display
//
@@ -507,10 +527,10 @@
// txt_readOcrResultShow
//
this.txt_readOcrResultShow.Font = new System.Drawing.Font("宋体", 12F);
this.txt_readOcrResultShow.Location = new System.Drawing.Point(150, 339);
this.txt_readOcrResultShow.Location = new System.Drawing.Point(17, 353);
this.txt_readOcrResultShow.Multiline = true;
this.txt_readOcrResultShow.Name = "txt_readOcrResultShow";
this.txt_readOcrResultShow.Size = new System.Drawing.Size(539, 41);
this.txt_readOcrResultShow.Size = new System.Drawing.Size(772, 69);
this.txt_readOcrResultShow.TabIndex = 24;
this.txt_readOcrResultShow.Text = "等待读取字符...";
//
@@ -964,7 +984,7 @@
this.panel_AutoRun.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel_AutoRun.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel_AutoRun.Controls.Add(this.label3);
this.panel_AutoRun.Controls.Add(this.label9);
this.panel_AutoRun.Controls.Add(this.check_Autorun);
this.panel_AutoRun.Location = new System.Drawing.Point(2, 345);
this.panel_AutoRun.Name = "panel_AutoRun";
@@ -972,19 +992,19 @@
this.panel_AutoRun.Size = new System.Drawing.Size(314, 144);
this.panel_AutoRun.TabIndex = 30;
//
// label3
// label9
//
this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
this.label9.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label3.BackColor = System.Drawing.Color.DeepSkyBlue;
this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label3.Location = new System.Drawing.Point(-3, -1);
this.label3.Margin = new System.Windows.Forms.Padding(3);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(317, 35);
this.label3.TabIndex = 26;
this.label3.Text = "自动运行";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.label9.BackColor = System.Drawing.Color.DeepSkyBlue;
this.label9.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label9.Location = new System.Drawing.Point(-3, -1);
this.label9.Margin = new System.Windows.Forms.Padding(3);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(317, 35);
this.label9.TabIndex = 26;
this.label9.Text = "自动运行";
this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// menuStrip_topmenu
//
@@ -1017,13 +1037,18 @@
//
// panel_midup
//
this.panel_midup.Controls.Add(this.button2);
this.panel_midup.Controls.Add(this.textBox1);
this.panel_midup.Controls.Add(this.label12);
this.panel_midup.Controls.Add(this.label11);
this.panel_midup.Controls.Add(this.button1);
this.panel_midup.Controls.Add(this.listBox1);
this.panel_midup.Controls.Add(this.btn_StarDet_manual);
this.panel_midup.Controls.Add(this.lbl_RShow);
this.panel_midup.Controls.Add(this.lbl_OrderNum);
this.panel_midup.Controls.Add(this.lbl_YShow);
this.panel_midup.Controls.Add(this.lbl_readOcrResult);
this.panel_midup.Controls.Add(this.lbl_XShow);
this.panel_midup.Controls.Add(this.lbl_verOcrShow);
this.panel_midup.Controls.Add(this.txt_readOcrResultShow);
this.panel_midup.Controls.Add(this.lbl_verOcr);
this.panel_midup.Controls.Add(this.btn_OrderNum);
@@ -1037,12 +1062,70 @@
this.panel_midup.Size = new System.Drawing.Size(801, 388);
this.panel_midup.TabIndex = 33;
//
// textBox1
//
this.textBox1.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.textBox1.Location = new System.Drawing.Point(391, 52);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(61, 29);
this.textBox1.TabIndex = 32;
this.textBox1.Text = "19";
this.textBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.textBox1.Visible = false;
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(458, 61);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(17, 12);
this.label12.TabIndex = 31;
this.label12.Text = "mm";
this.label12.Visible = false;
//
// label11
//
this.label11.AutoSize = true;
this.label11.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label11.Location = new System.Drawing.Point(209, 59);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(184, 16);
this.label11.TabIndex = 29;
this.label11.Text = "当前单颜色段字符长度:";
this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label11.Visible = false;
//
// button1
//
this.button1.BackColor = System.Drawing.Color.LimeGreen;
this.button1.Enabled = false;
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button1.Location = new System.Drawing.Point(370, 219);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(149, 46);
this.button1.TabIndex = 27;
this.button1.Text = "手动停止";
this.toolTip.SetToolTip(this.button1, "此操作为当前暂定方式");
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// listBox1
//
this.listBox1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.listBox1.FormattingEnabled = true;
this.listBox1.ItemHeight = 16;
this.listBox1.Location = new System.Drawing.Point(9, 85);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(781, 116);
this.listBox1.TabIndex = 26;
//
// btn_StarDet_manual
//
this.btn_StarDet_manual.BackColor = System.Drawing.Color.LimeGreen;
this.btn_StarDet_manual.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_StarDet_manual.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn_StarDet_manual.Location = new System.Drawing.Point(344, 153);
this.btn_StarDet_manual.Location = new System.Drawing.Point(190, 219);
this.btn_StarDet_manual.Name = "btn_StarDet_manual";
this.btn_StarDet_manual.Size = new System.Drawing.Size(149, 46);
this.btn_StarDet_manual.TabIndex = 25;
@@ -1092,6 +1175,21 @@
this.panel_locationDisplay.Size = new System.Drawing.Size(478, 388);
this.panel_locationDisplay.TabIndex = 0;
//
// button2
//
this.button2.BackColor = System.Drawing.Color.LimeGreen;
this.button2.Enabled = false;
this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button2.Location = new System.Drawing.Point(542, 219);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(149, 46);
this.button2.TabIndex = 33;
this.button2.Text = "去零点";
this.toolTip.SetToolTip(this.button2, "此操作为当前暂定方式");
this.button2.UseVisualStyleBackColor = false;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -1137,27 +1235,26 @@
private System.Windows.Forms.Label lbl_Y;
private System.Windows.Forms.Label lbl_X;
private System.Windows.Forms.Label lbl_verOcr;
private System.Windows.Forms.Label lbl_verOcrShow;
private System.Windows.Forms.Label lbl_XShow;
private System.Windows.Forms.Label lbl_YShow;
private System.Windows.Forms.Label lbl_RShow;
private System.Windows.Forms.Label lbl_readOcrResult;
private System.Windows.Forms.Label lbl_ocrResultState;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel_productInformtion;
private System.Windows.Forms.Label lbl_QSVShow;
private System.Windows.Forms.Label lbl_DistY;
private System.Windows.Forms.Label lbl_QSV;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label lbl_DistY;
private System.Windows.Forms.Label lbl_DistX;
private System.Windows.Forms.Label lbl_Gradient;
private System.Windows.Forms.Label lbl_width;
private System.Windows.Forms.Label lbl_ProductStandard;
private System.Windows.Forms.Label lbl_NOF;
private System.Windows.Forms.Label lbl_DistYShow;
private System.Windows.Forms.Label lbl_DistXShow;
private System.Windows.Forms.Label lbl_GradientShow;
private System.Windows.Forms.Label lbl_widthShow;
private System.Windows.Forms.Label lbl_ProductStandardShow;
private System.Windows.Forms.Label lbl_NOFShow;
private System.Windows.Forms.Label lbl_NO;
private Cognex.VisionPro.CogRecordDisplay Location_Display;
private System.Windows.Forms.PictureBox Ocr_picBox;
private System.Windows.Forms.Button btn_manualOcr;
@@ -1197,7 +1294,7 @@
private System.Windows.Forms.Panel panel_OrderInformation;
private System.Windows.Forms.Label lbl_orderinfo;
private System.Windows.Forms.Panel panel_AutoRun;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.MenuStrip menuStrip_topmenu;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel_mainForm;
private System.Windows.Forms.Panel panel_locationDisplay;
@@ -1208,6 +1305,14 @@
private System.Windows.Forms.Button btn_StarDet_manual;
private System.Windows.Forms.ToolTip toolTip;
private System.Windows.Forms.ListView list_Log;
private System.Windows.Forms.ListBox listBox1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label lbl_height;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.Button button2;
}
}

2075
TetraParkOCR/Form1.cs Normal file

File diff suppressed because it is too large Load Diff

5136
TetraParkOCR/Form1.resx Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,42 @@
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
</configSections>
<log4net>
<root>
<level value="ALL" />
<!---日志级别 从低到高 ALL DEBUG INFO WARN ERROR FATAL None-->
<appender-ref ref="RollingLogFileAppender" />
<appender-ref ref="listViewAppender" />
</root>
<!-- name属性指定其名称,type则是log4net.Appender命名空间的一个类的名称,意思是指定使用哪种介质-->
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="Log\\" />
<!-- 输出到什么目录-->
<appendToFile value="true" />
<!-- 是否到附加到文件中-->
<rollingStyle value="Date" />
<!-- 文件创建方式,以日期的方式记录-->
<datePattern value="yyyy-MM-dd&quot;.txt&quot;" />
<!-- 文件格式-->
<staticLogFileName value="false" />
<!--否采用静态文件名,文件名是否唯一-->
<layout type="log4net.Layout.PatternLayout">
<!---日志内容布局-->
<param name="ConversionPattern" value="%date %-5level %message%newline" />
</layout>
</appender>
<!---listView日志显示-->
<appender name="listViewAppender" type="LogShowLib.ListViewAppender, LogShowLib">
<formName value="Form1" />
<listViewName value="list_Log" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%message%newline" />
</layout>
</appender>
</log4net>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
</startup>
</configuration>

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TetraParkOCR
{
internal class OCRTextResult
{
public bool match;
public string text;
public List<PointF[]> points = new List<PointF[]>();
}
}

22
TetraParkOCR/Program.cs Normal file
View File

@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TetraPackOCR
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}

View File

@@ -0,0 +1,127 @@
<?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>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="OFF" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\OFF.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ON" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ON.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\OpenCvSharp4.runtime.win.4.11.0.20250507\build\netstandard\OpenCvSharp4.runtime.win.props" Condition="Exists('..\packages\OpenCvSharp4.runtime.win.4.11.0.20250507\build\netstandard\OpenCvSharp4.runtime.win.props')" />
<Import Project="..\packages\SixLabors.ImageSharp.3.1.11\build\SixLabors.ImageSharp.props" Condition="Exists('..\packages\SixLabors.ImageSharp.3.1.11\build\SixLabors.ImageSharp.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
@@ -71,33 +72,13 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>favicon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="Bjcve.Comm.FFP, Version=1.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>dll\Bjcve.Comm.FFP.dll</HintPath>
<HintPath>..\dll\Bjcve.Comm.FFP.dll</HintPath>
</Reference>
<Reference Include="BouncyCastle.Crypto, Version=1.9.0.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
<HintPath>..\packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll</HintPath>
@@ -106,43 +87,43 @@
<HintPath>..\packages\BouncyCastle.Cryptography.2.7.0-beta.98\lib\net461\BouncyCastle.Cryptography.dll</HintPath>
</Reference>
<Reference Include="CLIDelegate">
<HintPath>dll\CLIDelegate.dll</HintPath>
<HintPath>..\dll\CLIDelegate.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro, Version=59.2.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>dll\Cognex.VisionPro.dll</HintPath>
<HintPath>..\dll\Cognex.VisionPro.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.Comm, Version=59.2.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>dll\Cognex.VisionPro.Comm.dll</HintPath>
<HintPath>..\dll\Cognex.VisionPro.Comm.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.Controls, Version=59.2.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>dll\Cognex.VisionPro.Controls.dll</HintPath>
<HintPath>..\dll\Cognex.VisionPro.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.Core, Version=59.2.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>dll\Cognex.VisionPro.Core.dll</HintPath>
<HintPath>..\dll\Cognex.VisionPro.Core.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.Display.Controls, Version=59.2.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>dll\Cognex.VisionPro.Display.Controls.dll</HintPath>
<HintPath>..\dll\Cognex.VisionPro.Display.Controls.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.ImageProcessing, Version=59.2.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>dll\Cognex.VisionPro.ImageProcessing.dll</HintPath>
<HintPath>..\dll\Cognex.VisionPro.ImageProcessing.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.PMAlign, Version=59.2.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>dll\Cognex.VisionPro.PMAlign.dll</HintPath>
<HintPath>..\dll\Cognex.VisionPro.PMAlign.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.QuickBuild.Core, Version=59.2.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>dll\Cognex.VisionPro.QuickBuild.Core.dll</HintPath>
<HintPath>..\dll\Cognex.VisionPro.QuickBuild.Core.dll</HintPath>
</Reference>
<Reference Include="Cognex.VisionPro.ToolGroup, Version=59.2.0.0, Culture=neutral, PublicKeyToken=ef0f902af9dee505, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>dll\Cognex.VisionPro.ToolGroup.dll</HintPath>
<HintPath>..\dll\Cognex.VisionPro.ToolGroup.dll</HintPath>
</Reference>
<Reference Include="Enums.NET, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7ea1c1650d506225, processorArchitecture=MSIL">
<HintPath>..\packages\Enums.NET.5.0.0\lib\net461\Enums.NET.dll</HintPath>
@@ -164,10 +145,10 @@
</Reference>
<Reference Include="log4net, Version=2.0.14.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>dll\log4net.dll</HintPath>
<HintPath>..\dll\log4net.dll</HintPath>
</Reference>
<Reference Include="LogShowLib">
<HintPath>dll\LogShowLib.dll</HintPath>
<HintPath>..\dll\LogShowLib.dll</HintPath>
</Reference>
<Reference Include="MathNet.Numerics, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cd8b63ad3d691a37, processorArchitecture=MSIL">
<HintPath>..\packages\MathNet.Numerics.Signed.5.0.0\lib\net461\MathNet.Numerics.dll</HintPath>
@@ -199,6 +180,9 @@
<Reference Include="OpenCvSharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
<HintPath>..\packages\OpenCvSharp4.4.11.0.20250507\lib\netstandard2.0\OpenCvSharp.dll</HintPath>
</Reference>
<Reference Include="OpenCvSharp.Extensions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
<HintPath>..\packages\OpenCvSharp4.Extensions.4.11.0.20250507\lib\netstandard2.0\OpenCvSharp.Extensions.dll</HintPath>
</Reference>
<Reference Include="PaddleOCRSharp, Version=5.1.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\PaddleOCRSharp.5.1.0\lib\net47\PaddleOCRSharp.dll</HintPath>
</Reference>
@@ -221,6 +205,9 @@
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Drawing.Common.10.0.0-rc.2.25502.107\lib\net462\System.Drawing.Common.dll</HintPath>
</Reference>
<Reference Include="System.Formats.Asn1, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Formats.Asn1.10.0.0-rc.2.25502.107\lib\net462\System.Formats.Asn1.dll</HintPath>
</Reference>
@@ -272,7 +259,7 @@
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="ThridLibray">
<HintPath>dll\ThridLibray.dll</HintPath>
<HintPath>..\dll\ThridLibray.dll</HintPath>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="WindowsFormsIntegration" />
@@ -290,6 +277,7 @@
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="HPoint.cs" />
<Compile Include="OCRTextResult.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
@@ -333,6 +321,9 @@
</ItemGroup>
<ItemGroup>
<Content Include="favicon.ico" />
<Content Include="LogConfig.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="Resources\ON.png" />
<None Include="Resources\OFF.png" />
</ItemGroup>
@@ -342,9 +333,10 @@
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\PaddleOCRSharp.5.1.0\build\PaddleOCRSharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\PaddleOCRSharp.5.1.0\build\PaddleOCRSharp.targets'))" />
<Error Condition="!Exists('..\packages\SixLabors.ImageSharp.3.1.11\build\SixLabors.ImageSharp.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\SixLabors.ImageSharp.3.1.11\build\SixLabors.ImageSharp.props'))" />
<Error Condition="!Exists('..\packages\System.ValueTuple.4.6.1\build\net471\System.ValueTuple.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.ValueTuple.4.6.1\build\net471\System.ValueTuple.targets'))" />
<Error Condition="!Exists('..\packages\Paddle.Runtime.win_x64.3.1.0.1\build\Paddle.Runtime.win_x64.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Paddle.Runtime.win_x64.3.1.0.1\build\Paddle.Runtime.win_x64.targets'))" />
<Error Condition="!Exists('..\packages\SixLabors.ImageSharp.3.1.11\build\SixLabors.ImageSharp.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\SixLabors.ImageSharp.3.1.11\build\SixLabors.ImageSharp.props'))" />
<Error Condition="!Exists('..\packages\OpenCvSharp4.runtime.win.4.11.0.20250507\build\netstandard\OpenCvSharp4.runtime.win.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\OpenCvSharp4.runtime.win.4.11.0.20250507\build\netstandard\OpenCvSharp4.runtime.win.props'))" />
</Target>
<Import Project="..\packages\PaddleOCRSharp.5.1.0\build\PaddleOCRSharp.targets" Condition="Exists('..\packages\PaddleOCRSharp.5.1.0\build\PaddleOCRSharp.targets')" />
<Import Project="..\packages\System.ValueTuple.4.6.1\build\net471\System.ValueTuple.targets" Condition="Exists('..\packages\System.ValueTuple.4.6.1\build\net471\System.ValueTuple.targets')" />

BIN
TetraParkOCR/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -13,6 +13,8 @@
<package id="NPOI" version="2.7.5" targetFramework="net472" />
<package id="NSax" version="1.0.2" targetFramework="net472" />
<package id="OpenCvSharp4" version="4.11.0.20250507" targetFramework="net472" />
<package id="OpenCvSharp4.Extensions" version="4.11.0.20250507" targetFramework="net472" />
<package id="OpenCvSharp4.runtime.win" version="4.11.0.20250507" targetFramework="net472" />
<package id="Paddle.Runtime.win_x64" version="3.1.0.1" targetFramework="net472" />
<package id="PaddleOCRSharp" version="5.1.0" targetFramework="net472" />
<package id="Portable.BouncyCastle" version="1.9.0" targetFramework="net472" />
@@ -21,6 +23,7 @@
<package id="SixLabors.ImageSharp" version="3.1.11" targetFramework="net472" />
<package id="System.Buffers" version="4.6.1" targetFramework="net472" />
<package id="System.ComponentModel.Annotations" version="5.0.0" targetFramework="net472" />
<package id="System.Drawing.Common" version="10.0.0-rc.2.25502.107" targetFramework="net472" />
<package id="System.Formats.Asn1" version="10.0.0-rc.2.25502.107" targetFramework="net472" />
<package id="System.IO.Compression" version="4.3.0" targetFramework="net472" />
<package id="System.IO.FileSystem.Primitives" version="4.3.0" targetFramework="net472" />

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff