Commit c8d77942 刘韬

1

2 个父辈 7458229f 5fb72a03
正在显示 97 个修改的文件 包含 2172 行增加120 行删除
......@@ -22,6 +22,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
......@@ -105,6 +106,7 @@
<Compile Include="MatchAnalysis.cs" />
<Compile Include="MonitorMouseKeyboard.cs" />
<Compile Include="NamedPipeClient.cs" />
<Compile Include="PaddleOCRHelper.cs" />
<Compile Include="PrinterHelper.cs" />
<Compile Include="PrintLabelEdit.cs" />
<Compile Include="MaterialEdit.cs" />
......
......@@ -132,7 +132,7 @@ namespace BLL
extensions[i].Control.Text = key["reelid"];
}
}
SaveRetrospect?.Invoke(key);
//SaveRetrospect?.Invoke(key);
return true;
}
......@@ -228,7 +228,7 @@ namespace BLL
private void PrintLabel(object sender, EventArgs e)
{
LogNet.log.Debug("Enter PrintLabel Method");
if (lastkey == null) return;
//Dictionary<string, string> key = new();
for (int i = 0; i < extensions.Count; i++)
{
......
......@@ -425,21 +425,37 @@ namespace BLL
Bitmap bmp = CodeOcr(ocrcode[i], ocrlist[i], CurrntBitmap);
bool algro = ConfigHelper.Config.Get("UsePaddleOCR", true);
string codeOcr = "";
if (algro)
{
codeOcr=PaddleOCRHelper.StartTest("..\\ocr.jpg");
}
else
{
#region ocrr文字提取开始
//ocr匹配调用
var resp = namedPipeClient.Request("..\\ocr.jpg");
//ocr结果
var lp = JsonConvert.DeserializeObject<List<TextBlock>>(resp);
string codeOcr = "";
double maxbox = 0;
foreach (var l in lp) {
var boxa= l.CalculateArea(l.BoxPoints);
if (boxa > maxbox) {
foreach (var l in lp)
{
var boxa = l.CalculateArea(l.BoxPoints);
if (boxa > maxbox)
{
maxbox = boxa;
codeOcr = l.Text;
}
}
#endregion ocr文字提取结束
if(string.IsNullOrEmpty(codeOcr))
{
codeOcr = PaddleOCRHelper.StartTest("..\\ocr.jpg");
}
}
var x = new BarcodeInfo() {Text=codeOcr,CodeType="OCR"};
Dictionary<string, string> matchKey = CodeMatch(x, codeMatch);
if (matchKey != null)
......
using Model;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Runtime.ExceptionServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace BLL
{
public class PaddleOCRHelper
{
static string baseUrl = ConfigHelper.Config.Get("PaddleServiceBase", "http://192.168.101.12:8090/paddle/getOcr");
/// <summary>
/// 开始检测
/// </summary>
/// <param name="pythonExePath">python解释器路径</param>
/// <param name="pythonFile">python文件</param>
/// <param name="imgPath">图像文件路径</param>
/// <returns></returns>
public static string StartTest(string imgPath)
{
string ocr = StartCplusOcr(imgPath);
if (!string.IsNullOrEmpty(ocr))
{
return ocr;
}
ocr= StartPythonOcr(imgPath);
if (!AppIsRun())
{
var onnxexe = ".\\PaddleOCRSDK\\paddleOCR.exe";
Process.Start(onnxexe);
}
return ocr;
}
[HandleProcessCorruptedStateExceptions]
static string StartCplusOcr(string imgPath)
{
string json=Http.Get($"{baseUrl}?ver=cplus&imgPath={imgPath}");
Result result= JsonConvert.DeserializeObject<Result>(json);
return result?.data??"";
}
static string StartPythonOcr(string imgPath)
{
if (!AppIsRun())
{
var onnxexe = ".\\PaddleOCRSDK\\paddleOCR.exe";
Process.Start(onnxexe);
Thread.Sleep(2000);
}
string json = Http.Get($"{baseUrl}?ver=python&imgPath={imgPath}");
Result result = JsonConvert.DeserializeObject<Result>(json);
return result?.data ?? "";
}
static bool AppIsRun()
{
Process[] processes = Process.GetProcessesByName("paddleOCR");
if (processes.Length > 0)
{
return true;
}
LogNet.log.Info("paddleOCR 未在运行,启动程序");
return false;
}
public class Result
{
/// <summary>
/// 状态码,0为正常
/// </summary>
public int code { get; set; } = 0;
/// <summary>
/// 返回数据
/// </summary>
public string data { get; set; } = "";
/// <summary>
/// 提示信息
/// </summary>
public string msg { get; set; } = "ok";
/// <summary>
/// 版本
/// </summary>
public string ver { get; set; } = "";
}
}
}
此文件类型无法预览
2fb499259307536b9adb5ee8edb012a13c9ede06
1c92e9c1a18f82621ee6c586b63427453996ef1a
......@@ -106,3 +106,46 @@ D:\rick\vs\SmartScan\BLL\bin\Debug\ClosedXML.pdb
D:\rick\vs\SmartScan\BLL\bin\Debug\ClosedXML.xml
D:\rick\vs\SmartScan\BLL\bin\Debug\DocumentFormat.OpenXml.xml
D:\rick\vs\SmartScan\BLL\bin\Debug\ExcelNumberFormat.xml
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\x86\liblept1753.dll
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\x86\libtesseract3052.dll
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\x64\liblept1753.dll
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\x64\libtesseract3052.dll
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\BLL.dll
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\BLL.pdb
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\Asa.Camera.VisionLib.dll
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\Asa.Face.Control.dll
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\ClosedXML.dll
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\ConfigHelper.dll
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\DAL.dll
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\DocumentFormat.OpenXml.dll
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\ExcelNumberFormat.dll
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\log4net.dll
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\Model.dll
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\Newtonsoft.Json.dll
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\zxing.dll
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\zxing.presentation.dll
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\System.Data.SQLite.dll
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\RestSharp.dll
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\Tesseract.dll
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\Basler.Pylon.dll
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\MvCameraControl.Net.dll
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\DAL.pdb
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\Model.pdb
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\Asa.Camera.VisionLib.xml
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\ClosedXML.pdb
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\ClosedXML.xml
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\ConfigHelper.xml
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\DocumentFormat.OpenXml.xml
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\ExcelNumberFormat.xml
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\log4net.xml
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\Newtonsoft.Json.xml
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\zxing.xml
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\zxing.presentation.xml
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\System.Data.SQLite.xml
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\RestSharp.xml
E:\Codes\Neotel\SmartScan\BLL\bin\Debug\MvCameraControl.Net.xml
E:\Codes\Neotel\SmartScan\BLL\obj\Debug\BLL.csproj.AssemblyReference.cache
E:\Codes\Neotel\SmartScan\BLL\obj\Debug\BLL.csproj.CoreCompileInputs.cache
E:\Codes\Neotel\SmartScan\BLL\obj\Debug\BLL.csproj.CopyComplete
E:\Codes\Neotel\SmartScan\BLL\obj\Debug\BLL.dll
E:\Codes\Neotel\SmartScan\BLL\obj\Debug\BLL.pdb
......@@ -23,6 +23,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
......
944f9390cb2c28eeb1acf86a089b3432e2967b18
4dcab845fc2ffd8a4f82e25805cd3c1e6dab6a84
......@@ -75,3 +75,32 @@ D:\rick\vs\SmartScan\DAL\bin\Debug\halcondotnet.dll
D:\rick\vs\SmartScan\DAL\bin\Debug\Asa.Camera.VisionLib.pdb
D:\rick\vs\SmartScan\DAL\bin\Debug\Asa.Camera.VisionLib.xml
D:\rick\vs\SmartScan\DAL\bin\Debug\MvCameraControl.Net.xml
E:\Codes\Neotel\SmartScan\DAL\bin\Debug\x86\liblept1753.dll
E:\Codes\Neotel\SmartScan\DAL\bin\Debug\x86\libtesseract3052.dll
E:\Codes\Neotel\SmartScan\DAL\bin\Debug\x64\liblept1753.dll
E:\Codes\Neotel\SmartScan\DAL\bin\Debug\x64\libtesseract3052.dll
E:\Codes\Neotel\SmartScan\DAL\bin\Debug\DAL.dll
E:\Codes\Neotel\SmartScan\DAL\bin\Debug\DAL.pdb
E:\Codes\Neotel\SmartScan\DAL\bin\Debug\log4net.dll
E:\Codes\Neotel\SmartScan\DAL\bin\Debug\Model.dll
E:\Codes\Neotel\SmartScan\DAL\bin\Debug\System.Data.SQLite.dll
E:\Codes\Neotel\SmartScan\DAL\bin\Debug\Asa.Face.Control.dll
E:\Codes\Neotel\SmartScan\DAL\bin\Debug\RestSharp.dll
E:\Codes\Neotel\SmartScan\DAL\bin\Debug\Asa.Camera.VisionLib.dll
E:\Codes\Neotel\SmartScan\DAL\bin\Debug\Tesseract.dll
E:\Codes\Neotel\SmartScan\DAL\bin\Debug\Newtonsoft.Json.dll
E:\Codes\Neotel\SmartScan\DAL\bin\Debug\Basler.Pylon.dll
E:\Codes\Neotel\SmartScan\DAL\bin\Debug\MvCameraControl.Net.dll
E:\Codes\Neotel\SmartScan\DAL\bin\Debug\Model.pdb
E:\Codes\Neotel\SmartScan\DAL\bin\Debug\log4net.xml
E:\Codes\Neotel\SmartScan\DAL\bin\Debug\System.Data.SQLite.xml
E:\Codes\Neotel\SmartScan\DAL\bin\Debug\Asa.Face.Control.pdb
E:\Codes\Neotel\SmartScan\DAL\bin\Debug\RestSharp.xml
E:\Codes\Neotel\SmartScan\DAL\bin\Debug\Asa.Camera.VisionLib.xml
E:\Codes\Neotel\SmartScan\DAL\bin\Debug\Newtonsoft.Json.xml
E:\Codes\Neotel\SmartScan\DAL\bin\Debug\MvCameraControl.Net.xml
E:\Codes\Neotel\SmartScan\DAL\obj\Debug\DAL.csproj.AssemblyReference.cache
E:\Codes\Neotel\SmartScan\DAL\obj\Debug\DAL.csproj.CoreCompileInputs.cache
E:\Codes\Neotel\SmartScan\DAL\obj\Debug\DAL.csproj.CopyComplete
E:\Codes\Neotel\SmartScan\DAL\obj\Debug\DAL.dll
E:\Codes\Neotel\SmartScan\DAL\obj\Debug\DAL.pdb
......@@ -21,6 +21,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
......
......@@ -24,6 +24,5 @@ namespace Model
public static readonly string CONFIG_EXTENSION = Environment.CurrentDirectory + "\\Config\\Extension.json";
public static readonly string CONFIG_REELID = Environment.CurrentDirectory + "\\Config\\ReelID";
public static readonly string CONFIG_DATABASE = Environment.CurrentDirectory + "\\Config\\Database.db3";
}
}
......@@ -29,12 +29,12 @@ namespace Model
public static string Get(string url)
{
LogNet.log.Info("[GET]URL:" + url);
RestClient client = new(url) { Timeout = 10000 };
RestRequest request = new(Method.GET);
IRestResponse response = client.Execute(request);
string s = response.Content;
LogNet.log.Info("Return:" + s);
LogNet.log.Info($"[GET][URL:{url}][Return:{s}]");
return FormatContent(s);
}
......
......@@ -25,6 +25,7 @@
<WarningLevel>4</WarningLevel>
<DocumentationFile>
</DocumentationFile>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
......
9bd7f8609943181f9f6af8193ba5950aa3b8270f
a7358fca3bf98c76d19f72d792795aecea1e1eda
......@@ -62,3 +62,27 @@ D:\rick\vs\SmartScan\Model\bin\Debug\Asa.Camera.VisionLib.pdb
D:\rick\vs\SmartScan\Model\bin\Debug\Asa.Camera.VisionLib.xml
D:\rick\vs\SmartScan\Model\bin\Debug\MvCameraControl.Net.xml
D:\rick\vs\SmartScan\Model\obj\Debug\Model.csproj.AssemblyReference.cache
E:\Codes\Neotel\SmartScan\Model\bin\Debug\x86\liblept1753.dll
E:\Codes\Neotel\SmartScan\Model\bin\Debug\x86\libtesseract3052.dll
E:\Codes\Neotel\SmartScan\Model\bin\Debug\x64\liblept1753.dll
E:\Codes\Neotel\SmartScan\Model\bin\Debug\x64\libtesseract3052.dll
E:\Codes\Neotel\SmartScan\Model\bin\Debug\Model.dll
E:\Codes\Neotel\SmartScan\Model\bin\Debug\Model.pdb
E:\Codes\Neotel\SmartScan\Model\bin\Debug\Asa.Camera.VisionLib.dll
E:\Codes\Neotel\SmartScan\Model\bin\Debug\Asa.Face.Control.dll
E:\Codes\Neotel\SmartScan\Model\bin\Debug\log4net.dll
E:\Codes\Neotel\SmartScan\Model\bin\Debug\Newtonsoft.Json.dll
E:\Codes\Neotel\SmartScan\Model\bin\Debug\RestSharp.dll
E:\Codes\Neotel\SmartScan\Model\bin\Debug\Tesseract.dll
E:\Codes\Neotel\SmartScan\Model\bin\Debug\Basler.Pylon.dll
E:\Codes\Neotel\SmartScan\Model\bin\Debug\MvCameraControl.Net.dll
E:\Codes\Neotel\SmartScan\Model\bin\Debug\Asa.Camera.VisionLib.xml
E:\Codes\Neotel\SmartScan\Model\bin\Debug\log4net.xml
E:\Codes\Neotel\SmartScan\Model\bin\Debug\Newtonsoft.Json.xml
E:\Codes\Neotel\SmartScan\Model\bin\Debug\RestSharp.xml
E:\Codes\Neotel\SmartScan\Model\bin\Debug\MvCameraControl.Net.xml
E:\Codes\Neotel\SmartScan\Model\obj\Debug\Model.csproj.AssemblyReference.cache
E:\Codes\Neotel\SmartScan\Model\obj\Debug\Model.csproj.CoreCompileInputs.cache
E:\Codes\Neotel\SmartScan\Model\obj\Debug\Model.csproj.CopyComplete
E:\Codes\Neotel\SmartScan\Model\obj\Debug\Model.dll
E:\Codes\Neotel\SmartScan\Model\obj\Debug\Model.pdb

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31112.23
# Visual Studio Version 17
VisualStudioVersion = 17.4.33205.214
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SmartScan", "SmartScan\SmartScan.csproj", "{D7FE70F5-DDE7-4A87-A69C-8B2DE5D88207}"
EndProject
......@@ -13,32 +13,90 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DAL", "DAL\DAL.csproj", "{E
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Model", "Model\Model.csproj", "{20E61A3D-BF87-4A99-9756-7FE13D2DAA6E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "paddleOCR", "paddleOCR\paddleOCR.csproj", "{7178A902-E193-40CB-8AF5-4EEA05876522}"
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
{D7FE70F5-DDE7-4A87-A69C-8B2DE5D88207}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D7FE70F5-DDE7-4A87-A69C-8B2DE5D88207}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D7FE70F5-DDE7-4A87-A69C-8B2DE5D88207}.Debug|x64.ActiveCfg = Debug|x64
{D7FE70F5-DDE7-4A87-A69C-8B2DE5D88207}.Debug|x64.Build.0 = Debug|x64
{D7FE70F5-DDE7-4A87-A69C-8B2DE5D88207}.Debug|x86.ActiveCfg = Debug|Any CPU
{D7FE70F5-DDE7-4A87-A69C-8B2DE5D88207}.Debug|x86.Build.0 = Debug|Any CPU
{D7FE70F5-DDE7-4A87-A69C-8B2DE5D88207}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D7FE70F5-DDE7-4A87-A69C-8B2DE5D88207}.Release|Any CPU.Build.0 = Release|Any CPU
{D7FE70F5-DDE7-4A87-A69C-8B2DE5D88207}.Release|x64.ActiveCfg = Release|x64
{D7FE70F5-DDE7-4A87-A69C-8B2DE5D88207}.Release|x64.Build.0 = Release|x64
{D7FE70F5-DDE7-4A87-A69C-8B2DE5D88207}.Release|x86.ActiveCfg = Release|Any CPU
{D7FE70F5-DDE7-4A87-A69C-8B2DE5D88207}.Release|x86.Build.0 = Release|Any CPU
{2AB75B8C-0538-423C-83EA-702379AD622A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2AB75B8C-0538-423C-83EA-702379AD622A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2AB75B8C-0538-423C-83EA-702379AD622A}.Debug|x64.ActiveCfg = Debug|Any CPU
{2AB75B8C-0538-423C-83EA-702379AD622A}.Debug|x64.Build.0 = Debug|Any CPU
{2AB75B8C-0538-423C-83EA-702379AD622A}.Debug|x86.ActiveCfg = Debug|Any CPU
{2AB75B8C-0538-423C-83EA-702379AD622A}.Debug|x86.Build.0 = Debug|Any CPU
{2AB75B8C-0538-423C-83EA-702379AD622A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2AB75B8C-0538-423C-83EA-702379AD622A}.Release|Any CPU.Build.0 = Release|Any CPU
{2AB75B8C-0538-423C-83EA-702379AD622A}.Release|x64.ActiveCfg = Release|Any CPU
{2AB75B8C-0538-423C-83EA-702379AD622A}.Release|x64.Build.0 = Release|Any CPU
{2AB75B8C-0538-423C-83EA-702379AD622A}.Release|x86.ActiveCfg = Release|Any CPU
{2AB75B8C-0538-423C-83EA-702379AD622A}.Release|x86.Build.0 = Release|Any CPU
{F7499DE9-5665-49FD-BDB6-602B9AF98541}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F7499DE9-5665-49FD-BDB6-602B9AF98541}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F7499DE9-5665-49FD-BDB6-602B9AF98541}.Debug|x64.ActiveCfg = Debug|Any CPU
{F7499DE9-5665-49FD-BDB6-602B9AF98541}.Debug|x64.Build.0 = Debug|Any CPU
{F7499DE9-5665-49FD-BDB6-602B9AF98541}.Debug|x86.ActiveCfg = Debug|Any CPU
{F7499DE9-5665-49FD-BDB6-602B9AF98541}.Debug|x86.Build.0 = Debug|Any CPU
{F7499DE9-5665-49FD-BDB6-602B9AF98541}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F7499DE9-5665-49FD-BDB6-602B9AF98541}.Release|Any CPU.Build.0 = Release|Any CPU
{F7499DE9-5665-49FD-BDB6-602B9AF98541}.Release|x64.ActiveCfg = Release|Any CPU
{F7499DE9-5665-49FD-BDB6-602B9AF98541}.Release|x64.Build.0 = Release|Any CPU
{F7499DE9-5665-49FD-BDB6-602B9AF98541}.Release|x86.ActiveCfg = Release|Any CPU
{F7499DE9-5665-49FD-BDB6-602B9AF98541}.Release|x86.Build.0 = Release|Any CPU
{E28DE77A-FC70-4BE4-96EC-D0C1A7215A15}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E28DE77A-FC70-4BE4-96EC-D0C1A7215A15}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E28DE77A-FC70-4BE4-96EC-D0C1A7215A15}.Debug|x64.ActiveCfg = Debug|Any CPU
{E28DE77A-FC70-4BE4-96EC-D0C1A7215A15}.Debug|x64.Build.0 = Debug|Any CPU
{E28DE77A-FC70-4BE4-96EC-D0C1A7215A15}.Debug|x86.ActiveCfg = Debug|Any CPU
{E28DE77A-FC70-4BE4-96EC-D0C1A7215A15}.Debug|x86.Build.0 = Debug|Any CPU
{E28DE77A-FC70-4BE4-96EC-D0C1A7215A15}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E28DE77A-FC70-4BE4-96EC-D0C1A7215A15}.Release|Any CPU.Build.0 = Release|Any CPU
{E28DE77A-FC70-4BE4-96EC-D0C1A7215A15}.Release|x64.ActiveCfg = Release|Any CPU
{E28DE77A-FC70-4BE4-96EC-D0C1A7215A15}.Release|x64.Build.0 = Release|Any CPU
{E28DE77A-FC70-4BE4-96EC-D0C1A7215A15}.Release|x86.ActiveCfg = Release|Any CPU
{E28DE77A-FC70-4BE4-96EC-D0C1A7215A15}.Release|x86.Build.0 = Release|Any CPU
{20E61A3D-BF87-4A99-9756-7FE13D2DAA6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{20E61A3D-BF87-4A99-9756-7FE13D2DAA6E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{20E61A3D-BF87-4A99-9756-7FE13D2DAA6E}.Debug|x64.ActiveCfg = Debug|Any CPU
{20E61A3D-BF87-4A99-9756-7FE13D2DAA6E}.Debug|x64.Build.0 = Debug|Any CPU
{20E61A3D-BF87-4A99-9756-7FE13D2DAA6E}.Debug|x86.ActiveCfg = Debug|Any CPU
{20E61A3D-BF87-4A99-9756-7FE13D2DAA6E}.Debug|x86.Build.0 = Debug|Any CPU
{20E61A3D-BF87-4A99-9756-7FE13D2DAA6E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{20E61A3D-BF87-4A99-9756-7FE13D2DAA6E}.Release|Any CPU.Build.0 = Release|Any CPU
{20E61A3D-BF87-4A99-9756-7FE13D2DAA6E}.Release|x64.ActiveCfg = Release|Any CPU
{20E61A3D-BF87-4A99-9756-7FE13D2DAA6E}.Release|x64.Build.0 = Release|Any CPU
{20E61A3D-BF87-4A99-9756-7FE13D2DAA6E}.Release|x86.ActiveCfg = Release|Any CPU
{20E61A3D-BF87-4A99-9756-7FE13D2DAA6E}.Release|x86.Build.0 = Release|Any CPU
{7178A902-E193-40CB-8AF5-4EEA05876522}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7178A902-E193-40CB-8AF5-4EEA05876522}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7178A902-E193-40CB-8AF5-4EEA05876522}.Debug|x64.ActiveCfg = Debug|Any CPU
{7178A902-E193-40CB-8AF5-4EEA05876522}.Debug|x64.Build.0 = Debug|Any CPU
{7178A902-E193-40CB-8AF5-4EEA05876522}.Debug|x86.ActiveCfg = Debug|x86
{7178A902-E193-40CB-8AF5-4EEA05876522}.Debug|x86.Build.0 = Debug|x86
{7178A902-E193-40CB-8AF5-4EEA05876522}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7178A902-E193-40CB-8AF5-4EEA05876522}.Release|Any CPU.Build.0 = Release|Any CPU
{7178A902-E193-40CB-8AF5-4EEA05876522}.Release|x64.ActiveCfg = Release|Any CPU
{7178A902-E193-40CB-8AF5-4EEA05876522}.Release|x64.Build.0 = Release|Any CPU
{7178A902-E193-40CB-8AF5-4EEA05876522}.Release|x86.ActiveCfg = Release|x86
{7178A902-E193-40CB-8AF5-4EEA05876522}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
......@@ -75,6 +75,7 @@ namespace SmartScan
this.faceLabel2.Size = new System.Drawing.Size(464, 45);
this.faceLabel2.TabIndex = 9;
this.faceLabel2.Text = "faceLabel2";
this.faceLabel2.Click += new System.EventHandler(this.faceLabel2_Click);
//
// FrmAbout
//
......
......@@ -22,5 +22,10 @@ namespace SmartScan
faceLabel2.Text = Common.config.SoftVersion;
}
private void faceLabel2_Click(object sender, EventArgs e)
{
ConfigHelper.AdvanceConfigForm.ShowEditDialog(this);
}
}
}
......@@ -83,11 +83,6 @@ namespace SmartScan
}
private string GetOcrString(Rectangle rect)
{
Bitmap bmpTemp = new(rect.Width, rect.Height);
......@@ -98,20 +93,8 @@ namespace SmartScan
g.Dispose();
bmpTemp.Save("ocrt.jpg");
bmpTemp.Dispose();
var resp = Common.mateEdit.namedPipeClient.Request("..\\ocrt.jpg");
string codeOcr = getOcrString();
var lp = JsonConvert.DeserializeObject<List<TextBlock>>(resp);
string codeOcr = "";
double maxbox = 0;
foreach (var l in lp)
{
var boxa = l.CalculateArea(l.BoxPoints);
if (boxa > maxbox)
{
maxbox = boxa;
codeOcr = l.Text;
}
}
return codeOcr;
}
......@@ -218,10 +201,29 @@ namespace SmartScan
g.Dispose();
bmp.Save("ocrt.jpg");
bmp.Dispose();
var resp = Common.mateEdit.namedPipeClient.Request("..\\ocrt.jpg");
var lp = JsonConvert.DeserializeObject<List<TextBlock>>(resp);
string codeOcrs = getOcrString();
codeOcr[ocrRectIndex].Text = codeOcrs;
PicImage.Cursor = Cursors.Cross;
//_ocr[ocrIndex[codeOcrIndex]].Offset = new Point(Convert.ToInt32(ocrRect[codeOcrIndex].X - codeCenter.X), Convert.ToInt32(ocrRect[codeOcrIndex].Y - codeCenter.Y));
}
PicImage.Refresh();
}
}
string getOcrString()
{
string codeOcrs = "";
bool algro = ConfigHelper.Config.Get("UsePaddleOCR", true);
if (algro)
{
codeOcrs = PaddleOCRHelper.StartTest("..\\ocrt.jpg");
}
else
{
var resp = Common.mateEdit.namedPipeClient.Request("..\\ocrt.jpg");
var lp = JsonConvert.DeserializeObject<List<TextBlock>>(resp);
double maxbox = 0;
foreach (var l in lp)
{
......@@ -232,15 +234,13 @@ namespace SmartScan
codeOcrs = l.Text;
}
}
codeOcr[ocrRectIndex].Text = codeOcrs;
PicImage.Cursor = Cursors.Cross;
//_ocr[ocrIndex[codeOcrIndex]].Offset = new Point(Convert.ToInt32(ocrRect[codeOcrIndex].X - codeCenter.X), Convert.ToInt32(ocrRect[codeOcrIndex].Y - codeCenter.Y));
if (string.IsNullOrEmpty(codeOcrs))
{
codeOcrs = PaddleOCRHelper.StartTest("..\\ocrt.jpg");
}
PicImage.Refresh();
}
return codeOcrs;
}
private void PicImage_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
......
......@@ -11,6 +11,8 @@ using BLL;
using Model;
using System.Web.Script.Serialization;
using System.Threading.Tasks;
using DocumentFormat.OpenXml.Drawing.Charts;
using System.IO;
namespace SmartScan
{
......@@ -75,7 +77,7 @@ namespace SmartScan
}
}
private void SaveRetrospect(Bitmap labelBmp, string[] barcode)
private void SaveRetrospect(Bitmap labelBmp, string[] barcode, Dictionary<string, string> content)
{
string path = FilePath.RETROSPECT_DIR + string.Format("{0:yyyy-MM-dd}\\", DateTime.Now);
......@@ -125,7 +127,8 @@ namespace SmartScan
Dictionary<string, object[]> dic = new()
{
{ "Code", scanWork.SaveCodeInfo() },
{ "Label", barcode }
{ "Label", barcode },
{"Content",new object[]{ content } },
};
JavaScriptSerializer serializer = new();
string json = serializer.Serialize(dic);
......@@ -162,8 +165,7 @@ namespace SmartScan
//Common.labelEdit.PrintLast(Common.config.DefaultPrintLabel, Common.config.PrinterName, Common.config.PrintLandscape, content, out string[] barcode);
//LogNet.log.Info(string.Format("打印标签 Label[{0}] Printer[{1}]", Common.config.DefaultPrintLabel, Common.config.PrinterName));
var barcode = content.Values.ToArray();
SaveRetrospect(labelBmp, barcode);
SaveRetrospect(labelBmp, barcode, content);
}
catch (Exception ex)
......@@ -171,6 +173,31 @@ namespace SmartScan
LogNet.log.Error("Extension_Printing", ex);
}
}
string dir_Res = ConfigHelper.Config.Get("DirReelResult","");
string reelResultFileNameKey = ConfigHelper.Config.Get("FileNameKeyReelResult", "");
void SaveResult(Dictionary<string, string> content)
{
if (string.IsNullOrEmpty(dir_Res))
return;
if(!Directory.Exists(dir_Res))
Directory.CreateDirectory(dir_Res);
string filename = "";
if (string.IsNullOrEmpty(reelResultFileNameKey))
{
filename = dir_Res + DateTime.Now.ToString() + ".csv";
}
else
{
filename = dir_Res + content[reelResultFileNameKey] + ".csv";
}
StringBuilder sb = new StringBuilder();
sb.AppendLine("ReelID,PartNumber,Vendor,Lot,UserData1,UserData2,UserData3,UserData4,UserData5,InitialQuantity,MSDLevel,MSDInitialFloorTime ,MSDBagSealDate,MarketUsage,QuantityOverride,ShelfTime,SPMaterialName,WarningLimit,MaximumLimit,Comments,WarmupTime,StorageUnit,SubStorageUnit,LocationOverride,ExpirationDate,ManufacturingDate,PartClass,PSDOverride,AltPartNumber");
sb.AppendLine($"1,1005C,,,,,,,,2,,,,,1,,,,,,,SMT,,,,,,,");
//sb.AppendLine(string.Join(",", content.Keys.ToArray()));
//sb.AppendLine(string.Join(",", content.Values.ToArray()));
System.IO.File.WriteAllText(filename, sb.ToString(), Encoding.UTF8);
}
private void Extension_Printing(Dictionary<string, string> content)
{
try
......@@ -178,13 +205,13 @@ namespace SmartScan
string str = "打印内容:";
foreach (string key in content.Keys)
str += string.Format("({0}:{1})", key, content[key]);
SaveResult(content);
LogNet.log.Info(str);
//Bitmap labelBmp = Common.labelEdit.PrintImage(Common.config.DefaultPrintLabel, content, out _);
Common.labelEdit.PrintLast(Common.config.DefaultPrintLabel, Common.config.PrinterName, Common.config.PrintLandscape, content, out string[] barcode);
LogNet.log.Info(string.Format("打印标签 Label[{0}] Printer[{1}]", Common.config.DefaultPrintLabel, Common.config.PrinterName));
//SaveRetrospect(labelBmp, barcode);
if (Common.config.PrintCompletedClear)
Common.extension.Clear();
}
......@@ -347,7 +374,8 @@ namespace SmartScan
private void BtnTriggerIO_Click(object sender, EventArgs e)
{
LogNet.log.Info("按钮点击触发Work");
Task.Run(()=>{
Task.Run(() =>
{
scanWork.Scan();
//scanWork.TouchOff();
});
......@@ -361,11 +389,13 @@ namespace SmartScan
#endregion
public DialogResult ShowWaittingDialog() {
public DialogResult ShowWaittingDialog()
{
Common.frmWaitting = new FrmWaitting();
return Common.frmWaitting.ShowDialog();
}
public void CloseWaittingDialog() {
public void CloseWaittingDialog()
{
if (Common.frmMain.InvokeRequired)
{
if (Common.frmWaitting.Created)
......
......@@ -7,6 +7,10 @@ using System.Linq;
using System.Text;
using Asa.FaceControl;
using System.Windows.Forms;
using System.Reflection;
using System.Web.UI.WebControls;
using DocumentFormat.OpenXml.ExtendedProperties;
using DocumentFormat.OpenXml.Wordprocessing;
namespace SmartScan
{
......@@ -42,9 +46,12 @@ namespace SmartScan
}
}
}
private string ExportIndex(int index)
{
return exportOriginalFormat(index);
}
string exportOriginalFormat(int index)
{
HistoryPath path = fileFull[index];
string json = System.IO.File.ReadAllText(path.codePath);
System.Web.Script.Serialization.JavaScriptSerializer serializer = new();
......@@ -72,9 +79,16 @@ namespace SmartScan
items[i] = obj[i].ToString();
content += "Label," + string.Join(",", items);
}
if (dic.ContainsKey("Content"))
{
object[] obj = (object[])dic["Content"];
string[] items = new string[obj.Length];
for (int i = 0; i < items.Length; i++)
items[i] = obj[i].ToString();
content += "Content," + string.Join(",", items);
}
return content;
}
private List<HistoryPath> CheckFiles(string[] files)
{
string[] affix = new string[3] { "_camera", "_label", "_code" };
......@@ -223,24 +237,179 @@ namespace SmartScan
}
}
/// <summary>
/// 导出文件格式
/// </summary>
int exportFileFormat = ConfigHelper.Config.Get("ExportFileFormat", 1);
private void BtnExport_Click(object sender, EventArgs e)
{
if (LstRecord.SelectedIndex == -1) return;
SaveFileDialog dlg = new() { Filter = "TXT文件|*.txt|CSV文件|*.csv" };
switch (exportFileFormat)
{
case 1:
exportByMacroKey(LstRecord.SelectedIndex);
break;
default:
SaveFileDialog dlg = new() { Filter = "TXT文件|*.txt" };
if (dlg.ShowDialog() == DialogResult.Cancel) return;
string content = ExportIndex(LstRecord.SelectedIndex);
System.IO.File.WriteAllText(dlg.FileName, content, Encoding.UTF8);
break;
}
}
string genLine(Dictionary<string, object> pairs)
{
List<string> lines = new List<string>();
foreach (var item in Common.macroKey)
{
if (pairs.ContainsKey(item))
{
lines.Add(pairs[item].ToString());
}
else
{
lines.Add("");
}
}
return string.Join(",", lines);
}
string genLine(string txt)
{
List<string> lines = new List<string>();
string[] fields = txt.Split(';');
if (fields != null && fields.Length > 0)
{
Dictionary<string, string> dic = new Dictionary<string, string>();
foreach (var item in fields)
{
string[] pairs = item.Split(':');
if (pairs != null && pairs.Length > 0)
{
if (Common.macroKey.Contains(pairs[0]))
{
dic[pairs[0]] = pairs[1];
}
}
}
foreach (var item in Common.macroKey)
{
if (dic.ContainsKey(item))
{
lines.Add(dic[item]);
}
else
{
lines.Add("");
}
}
}
return string.Join(",", lines);
}
bool checkHasMacroKey(string content)
{
string[] fields = content.Split(';');
if (fields != null && fields.Length > 0)
{
for (int i = 0; i < fields.Length; i++)
{
string[] pairs = fields[i].Split(':');
if (pairs != null && pairs.Length > 0)
{
if (i > 0)
return true;
else if (!Common.macroKey.Contains(pairs[0])) { return false; }
}
}
}
return true;
}
bool checkHasMacroKey(Dictionary<string, object> content)
{
for (int i = 0; i < Common.macroKey.Count; i++)
{
if (i > 0)
return true;
else if (!content.ContainsKey(Common.macroKey[i])) { return false; }
}
return true;
}
void exportByMacroKey(int index)
{
SaveFileDialog dlg = new() { Filter = "CSV文件|*.csv" };
if (dlg.ShowDialog() == DialogResult.Cancel) return;
StringBuilder content = new StringBuilder();
content.AppendLine(string.Join(",", Common.macroKey));
var path = fileFull[index];
{
string json = System.IO.File.ReadAllText(path.codePath);
System.Web.Script.Serialization.JavaScriptSerializer serializer = new();
Dictionary<string, object> dic = (Dictionary<string, object>)serializer.DeserializeObject(json);
if (dic.ContainsKey("Content"))
{
object[] obj = (object[])dic["Content"];
for (int i = 0; i < obj.Length; i++)
{
Dictionary<string, object> dicCode = (Dictionary<string, object>)obj[i];
if (checkHasMacroKey(dicCode))
{
content.AppendLine(genLine(dicCode));
break;
}
}
}
}
System.IO.File.WriteAllText(dlg.FileName, content.ToString(), Encoding.UTF8);
}
void exportAllByMacroKey()
{
SaveFileDialog dlg = new() { Filter = "CSV文件|*.csv" };
if (dlg.ShowDialog() == DialogResult.Cancel) return;
StringBuilder content = new StringBuilder();
content.AppendLine(string.Join(",", Common.macroKey));
foreach (var path in fileFull)
{
string json = System.IO.File.ReadAllText(path.codePath);
System.Web.Script.Serialization.JavaScriptSerializer serializer = new();
Dictionary<string, object> dic = (Dictionary<string, object>)serializer.DeserializeObject(json);
if (dic.ContainsKey("Content"))
{
object[] obj = (object[])dic["Content"];
for (int i = 0; i < obj.Length; i++)
{
Dictionary<string, object> dicCode = (Dictionary<string, object>)obj[i];
if (checkHasMacroKey(dicCode))
{
content.AppendLine(genLine(dicCode));
break;
}
}
}
}
System.IO.File.WriteAllText(dlg.FileName, content.ToString(), Encoding.UTF8);
}
private void BtnExportAll_Click(object sender, EventArgs e)
{
SaveFileDialog dlg = new() { Filter = "TXT文件|*.txt|CSV文件|*.csv" };
switch (exportFileFormat)
{
case 1:
exportAllByMacroKey();
break;
default:
SaveFileDialog dlg = new() { Filter = "TXT文件|*.txt" };
if (dlg.ShowDialog() == DialogResult.Cancel) return;
string[] content = new string[fileFull.Count];
for (int i = 0; i < fileFull.Count; i++)
content[i] = ExportIndex(i);
System.IO.File.WriteAllLines(dlg.FileName, content, Encoding.UTF8);
break;
}
}
}
}
......@@ -45,7 +45,8 @@ namespace SmartScan
var onnxexe = "onnx\\OcrLiteOnnxForm.exe";
Process.Start(onnxexe);
var paddle = ".\\PaddleOCRSDK\\paddleOCR.exe";
Process.Start(paddle);
......
using System;
using System.Collections.Generic;
using System.IO;
using System.Windows.Forms;
using Asa.FaceControl;
using BLL;
using ClosedXML.Excel;
using Model;
namespace SmartScan
{
public partial class UsrExportData : UserControl, ISetMenu
{
public UsrExportData()
{
InitializeComponent();
CboDataType.Items.Add("None");
CboDataType.Items.Add("Excel/CSV");
CboDataType.SelectedIndex = 0;
TxtDataSource.TextChanged += TxtDataSource_TextChanged;
TxtDataSource.Text = Config.DataSource_String;
ChkRecursive.Checked= Config.DataSource_Recursive;
Asa.FaceControl.Language.SetLanguage(this);
}
private void TxtDataSource_TextChanged(object sender, EventArgs e)
{
var filestring = TxtDataSource.Text.Trim();
if (string.IsNullOrEmpty(filestring)) {
LblFilestatus.Text = Language.Dialog("selectdatasource","请选择数据文件");
}
if (!File.Exists(filestring))
{
LblFilestatus.Text = Language.Dialog("filenotexists", "文件状态:改文件不存在");
}
List<string> titles;
if (Path.GetExtension(TxtDataSource.Text).ToLower() == ".csv")
{
titles = ExtraFileData.ParseCSVFileTitle(TxtDataSource.Text);
}
else if (Path.GetExtension(TxtDataSource.Text).ToLower() == ".xlsx")
{
try
{
XLWorkbook wb = new XLWorkbook(filestring);
}
catch
{
LblFilestatus.Text = Language.Dialog("filepatseerror", "文件内容解析失败");
return;
}
titles = ExtraFileData.ParseXLSFileTitle(TxtDataSource.Text);
}
else
{
LblFilestatus.Text = Language.Dialog("fileformaterror", "文件格式不正确");
return;
}
txtkey.Text = "";
CboDataTitle.Items.Clear();
titles.ForEach(t => {
CboDataTitle.Items.Add(t);
txtkey.Text += $"{{{t}}}\r\n";
});
if (CboDataTitle.Items.Count > 0)
CboDataTitle.SelectedIndex = 0;
if (!string.IsNullOrEmpty(Config.DataSource_DataTitle))
{
CboDataTitle.SelectedText = Config.DataSource_DataTitle;
}
}
public Asa.FaceControl.FacePanel GetPanel()
{
if (Config.DataSource_Type == "xls")
{
CboDataType.SelectedIndex = 1;
}
else {
}
CboDataKey.Items.Clear();
CboDataKey.Items.AddRange(Common.macroKey.ToArray());
CboDataKey.SelectedIndex = 0;
if (!string.IsNullOrEmpty(Config.DataSource_DataKey))
{
CboDataKey.SelectedText = Config.DataSource_DataKey;
}
TxtDataSource.Text = Config.DataSource_String;
return facePanel1;
}
public void Save()
{
if (CboDataType.SelectedIndex == 1)
Config.DataSource_Type = "xls";
else
Config.DataSource_Type = "none";
Config.DataSource_String = TxtDataSource.Text;
Config.DataSource_DataKey = CboDataKey.Text;
Config.DataSource_DataTitle = CboDataTitle.Text;
Config.DataSource_Recursive = ChkRecursive.Checked;
ExtraFileData.Init();
Common.extraKey = ExtraFileData.Titles;
}
private void BtnSelectFile_Click(object sender, EventArgs e)
{
OpenFileDialog fileDialog = new OpenFileDialog();
fileDialog.Filter = "Excel files (*.csv;*.xlsx)|*.csv;*.xlsx";
fileDialog.RestoreDirectory = true;
if (fileDialog.ShowDialog() != DialogResult.OK)
return;
if (Path.GetExtension(fileDialog.FileName).ToLower() == ".csv")
{
if (!FrmDataFilePreview.ShowPreview(fileDialog.FileName, out string encodingtxt))
return;
Config.DataSource_Encoding = encodingtxt;
}
TxtDataSource.Text = fileDialog.FileName;
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
......@@ -15,7 +15,7 @@
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<PlatformTarget>x64</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
......@@ -43,6 +43,25 @@
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>preview</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>preview</LangVersion>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Asa.Camera.VisionLib, Version=1.3.8398.28384, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
......@@ -118,6 +137,12 @@
<Compile Include="SetControl\FrmDataFilePreview.Designer.cs">
<DependentUpon>FrmDataFilePreview.cs</DependentUpon>
</Compile>
<Compile Include="SetControl\UsrExportData.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="SetControl\UsrExportData.Designer.cs">
<DependentUpon>UsrExportData.cs</DependentUpon>
</Compile>
<Compile Include="SetControl\UsrDataSource.cs">
<SubType>UserControl</SubType>
</Compile>
......@@ -290,6 +315,9 @@
<EmbeddedResource Include="SetControl\FrmDataFilePreview.resx">
<DependentUpon>FrmDataFilePreview.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="SetControl\UsrExportData.resx">
<DependentUpon>UsrExportData.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="SetControl\UsrDataSource.resx">
<DependentUpon>UsrDataSource.cs</DependentUpon>
</EmbeddedResource>
......
......@@ -4,6 +4,9 @@
<StartArguments>hide-</StartArguments>
</PropertyGroup>
<PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView>
<ProjectView>ProjectFiles</ProjectView>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<StartArguments>hide-</StartArguments>
</PropertyGroup>
</Project>
\ No newline at end of file
Reelid
PN
RID
DC
RDC
QTY
BAT
PRO
EXP
SP
test
PN
VC
MSD
1562
\ No newline at end of file
86
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<appSettings>
<Language>English</Language>
<Language>简体中文</Language>
<PrinterName>Microsoft Print to PDF</PrinterName>
<PrintLandscape>False</PrintLandscape>
<HistoryImage>Original</HistoryImage>
<SelectHttpPN>True</SelectHttpPN>
<LabelEmptyCheck>False</LabelEmptyCheck>
<SelectHttpPN>False</SelectHttpPN>
<LabelEmptyCheck>True</LabelEmptyCheck>
<PrintCompletedClear>False</PrintCompletedClear>
<OpenStartWork>True</OpenStartWork>
<OpenMaximize>True</OpenMaximize>
<DefaultPrintLabel>test2</DefaultPrintLabel>
<EnabledIO>False</EnabledIO>
<EnabledCamera>False</EnabledCamera>
<IOIP>192.168.0.101</IOIP>
<DefaultPrintLabel>Print_Test</DefaultPrintLabel>
<EnabledIO>True</EnabledIO>
<EnabledCamera>True</EnabledCamera>
<IOIP>192.168.20.100</IOIP>
<IOTouch>0</IOTouch>
<IOLight>0</IOLight>
<ExtensionWidth>300</ExtensionWidth>
<ReelIDMatch>[Reelid][datetime:yyyyMMdd]</ReelIDMatch>
<ReelIDMatch>[Sample_1]</ReelIDMatch>
<ReelIDPlaces>9</ReelIDPlaces>
<ReelIDFillZero>True</ReelIDFillZero>
<ReelIDPrefix>C</ReelIDPrefix>
<ReelIDPostfix>
</ReelIDPostfix>
<ReelIDFillZero>False</ReelIDFillZero>
<ReelIDPrefix>S</ReelIDPrefix>
<ReelIDPostfix>b</ReelIDPostfix>
<LockPassword>12345</LockPassword>
<ExtensionGroup>General</ExtensionGroup>
<HttpServer>
</HttpServer>
<HttpReelID>
</HttpReelID>
<DefaultMaterialName>t1</DefaultMaterialName>
<DefaultMaterialName>New</DefaultMaterialName>
<TriggerOpenLight>True</TriggerOpenLight>
<WebService>http://127.0.0.1:58137</WebService>
<EnabledUserLogin>Flase</EnabledUserLogin>
<OperateTimeout>60</OperateTimeout>
<PromptAfterPrinting>False</PromptAfterPrinting>
<AutoPrint>True</AutoPrint>
<ReelIDKeyWord>SP</ReelIDKeyWord>
<SmfServer>http://192.168.1.243/smf-core/</SmfServer>
<CID>NeoScan01</CID>
<IOModule>NiRen</IOModule>
<ReelIDKeyWord>Sample_2</ReelIDKeyWord>
<ReelIDAutoResetByDate>True</ReelIDAutoResetByDate>
</appSettings>
\ No newline at end of file
......@@ -31,6 +31,12 @@
<MatchType_min>匹配数量至少</MatchType_min>
<OcrNeedCodeSetKey>Ocr的基准条码必须先匹配关键字</OcrNeedCodeSetKey>
<ThisMatchHasOcrCantdelete>该匹配规则下有Ocr规则,不能删除全部关键字</ThisMatchHasOcrCantdelete>
<!--原文:请选择数据文件-->
<selectdatasource>请选择数据文件</selectdatasource>
<!--原文:文件状态:改文件不存在-->
<filenotexists>文件状态:改文件不存在</filenotexists>
<!--原文:文件格式不正确-->
<fileformaterror>文件格式不正确</fileformaterror>
</Dialog>
<FrmUsersLogin Text="登录" Font="微软雅黑,24,B,">
<LblUser Text="用户名:" Font="微软雅黑,11,," />
......@@ -68,46 +74,9 @@
<BtnLabel Text="打印模版" Font="微软雅黑,12,B," />
<BtnMaterial Text="物料模版" Font="微软雅黑,12,B," />
<BtnKeyword Text="关键字" Font="微软雅黑,12,B," />
<BtnRetrospect Text="追溯" Font="微软雅黑,14,B," />
<BtnOK Text="保存" Font="微软雅黑,12,," />
<BtnCancel Text="取消" Font="微软雅黑,12,," />
<BtnApply Text="应用" Font="微软雅黑,12,," />
<!--原文:简体中文-->
<CboLanguage Text="简体中文" Font="微软雅黑,12,," />
<!--原文:自动打印-->
<ChkAutoPrint Text="自动打印" Font="微软雅黑,12,," />
<!--原文:打印完成后提示-->
<ChkPromptAfterPrinting Text="打印完成后提示" Font="微软雅黑,12,," />
<!--原文:触发信号亮灯-->
<ChkTriggerOpenLight Text="触发信号亮灯" Font="微软雅黑,12,," />
<!--原文:优先匹配模板-->
<LblDefaultMate Text="优先匹配模板" Font="微软雅黑,12,," />
<!--原文:标签打印完成后清除数据-->
<ChkPrintCompletedClear Text="标签打印完成后清除数据" Font="微软雅黑,12,," />
<!--原文:软件打开最大化-->
<ChkOpenMaximize Text="软件打开最大化" Font="微软雅黑,12,," />
<!--原文:软件打开自动进入工作-->
<ChkOpenEnterWork Text="软件打开自动进入工作" Font="微软雅黑,12,," />
<!--原文:标签空内容校验-->
<ChkLabelEmptyCheck Text="标签空内容校验" Font="微软雅黑,12,," />
<!--原文:通过服务器查询PN-->
<ChkSelectPN Text="通过服务器查询PN" Font="微软雅黑,12,," />
<!--原文:默认打印标签-->
<LblDefaultLabel Text="默认打印标签" Font="微软雅黑,12,," />
<!--原文:纵向打印-->
<RdoVertical Text="纵向打印" Font="微软雅黑,12,," />
<!--原文:横向打印-->
<RdoLandscape Text="横向打印" Font="微软雅黑,12,," />
<!--原文:打印机-->
<LblPrint Text="打印机" Font="微软雅黑,12,," />
<!--原文:不保存-->
<RdoNoImage Text="不保存" Font="微软雅黑,12,," />
<!--原文:压缩图-->
<RdoCondense Text="压缩图" Font="微软雅黑,12,," />
<!--原文:原始图-->
<RdoOriginal Text="原始图" Font="微软雅黑,12,," />
<!--原文:追溯图像保存-->
<LblHistoryImage Text="追溯图像保存" Font="微软雅黑,12,," />
</FrmSetPlus>
<UsrWorkMode>
<LblPrint Text="打印机" Font="微软雅黑,12,B," />
......@@ -212,11 +181,45 @@
<BtnInsert Text="插入" Font="微软雅黑,12,," />
<BtnOK Text="确定" Font="微软雅黑,12,," />
<BtnCancel Text="取消" Font="微软雅黑,12,," />
<!--原文:数量:[QTY]-->
<faceTextBox1 Text="数量:[QTY]" Font="微软雅黑,12,," />
</FrmFieldContent>
<FrmCodeExtract Text="提取条码" Font="微软雅黑,24,B,">
<BtnAddMatch Text="+" Font="微软雅黑,12,," />
<BtnOK Text="确定" Font="微软雅黑,12,," />
<BtnCancel Text="取消" Font="微软雅黑,12,," />
<!--原文:匹配数量至多-->
<ChoMatchMiddleType Text="匹配数量至多" Font="微软雅黑,12,," />
<!--原文:必须为数字-->
<ChkMatchisnumber Text="必须为数字" Font="微软雅黑,12,," />
<!--原文:匹配条码编码类型-->
<ChkCheckCodeType Text="匹配条码编码类型" Font="微软雅黑,12,," />
<!--原文:获取分割部分-->
<LblSplitPart Text="获取分割部分" Font="微软雅黑,12,," />
<!--原文:条码分割字符-->
<ChkMatchingSplit Text="条码分割字符" Font="微软雅黑,12,," />
<!--原文:匹配开头字符-->
<ChkMatchingStart Text="匹配开头字符" Font="微软雅黑,12,," />
<!--原文:截取至结尾-->
<ChkLengthEnd Text="截取至结尾" Font="微软雅黑,12,," />
<!--原文:匹配结尾字符-->
<ChkMatchingEnd Text="匹配结尾字符" Font="微软雅黑,12,," />
<!--原文:匹配任意位置字符-->
<ChkMatchingMiddle Text="匹配任意位置字符" Font="微软雅黑,12,," />
<!--原文:内容截取长度-->
<LblLength Text="内容截取长度" Font="微软雅黑,12,," />
<!--原文:内容截取起始位-->
<LblStart Text="内容截取起始位" Font="微软雅黑,12,," />
<!--原文:设置关键字-->
<LblKeyword Text="设置关键字" Font="微软雅黑,12,," />
<!--原文:区分大小写-->
<ChkCaseSensitivity Text="区分大小写" Font="微软雅黑,12,," />
<!--原文:最小长度-->
<ChkMinLength Text="最小长度" Font="微软雅黑,12,," />
<!--原文:最大长度-->
<ChkMaxLength Text="最大长度" Font="微软雅黑,12,," />
<!--原文:删除-->
<BtnDel Text="删除" Font="微软雅黑,12,," />
</FrmCodeExtract>
<FrmCodeOCR Text="OCR" Font="微软雅黑,24,B,">
<BtnSelect Text="矩形选择框" Font="微软雅黑,12,," />
......
此文件的差异太大,无法显示。
此文件的差异太大,无法显示。
<?xml version="1.0" encoding="utf-8"?>
<Label Name="test2" Size="78,25">
<Field Type="QRCode" Text="[Reelid]_[MATERIALNO]_[BATCHNO]_[QTY][SN]" Rectangle="3.048,0.508,22.112,22.272" Font="宋体,9,," />
<Field Type="Text" Text="唯一码内容:[Reelid]_[MATERIALNO]_[BATCHNO]_[QTY][SN]5" Rectangle="29.21,11.938,51.83,20.75" Font="仿宋,10.5,B," />
<Label Name="test2" Size="50,20">
<Field Type="QRCode" Text="[PN][SP][QTY][PO][BATCH][PRODATE][Reelid]" Rectangle="3.048,0.508,13.984,12.366" Font="SimSun,9,," />
<Field Type="Text" Text="[Reelid]" Rectangle="24.638,13.462,13.476,5.174" Font="SimSun,9,," />
<Field Type="Text" Text="Field1:[Test2]" Rectangle="0,0,15,10" Font="SimSun,9,," />
<Field Type="Text" Text="Field1:[title]-[factory];[type]" Rectangle="26.162,3.302,15,10" Font="SimSun,9,," />
</Label>
\ No newline at end of file
241b51085ef418e6fbb6d29e411a9bbcee2997c1
df69419fd8d4c3e1c4b7ebcf5acafd67833542c4
......@@ -177,3 +177,74 @@ D:\rick\vs\SmartScan\SmartScan\bin\Debug\DocumentFormat.OpenXml.xml
D:\rick\vs\SmartScan\SmartScan\bin\Debug\ExcelNumberFormat.xml
D:\rick\vs\SmartScan\SmartScan\obj\Debug\SmartScan.FrmDataFilePreview.resources
D:\rick\vs\SmartScan\SmartScan\obj\Debug\SmartScan.UsrWorkMode2.resources
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\x86\liblept1753.dll
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\x86\libtesseract3052.dll
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\x64\liblept1753.dll
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\x64\libtesseract3052.dll
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\log4net.config
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\SmartScan.exe.config
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\SmartScan.exe
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\SmartScan.pdb
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\Asa.Camera.VisionLib.dll
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\Asa.Face.Control.dll
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\BLL.dll
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\ClosedXML.dll
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\ConfigHelper.dll
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\DocumentFormat.OpenXml.dll
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\ExcelNumberFormat.dll
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\log4net.dll
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\Model.dll
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\Newtonsoft.Json.dll
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\DAL.dll
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\zxing.dll
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\RestSharp.dll
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\Tesseract.dll
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\Basler.Pylon.dll
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\MvCameraControl.Net.dll
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\System.Data.SQLite.dll
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\BLL.pdb
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\Model.pdb
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\Asa.Camera.VisionLib.xml
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\ClosedXML.pdb
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\ClosedXML.xml
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\ConfigHelper.xml
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\DocumentFormat.OpenXml.xml
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\ExcelNumberFormat.xml
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\log4net.xml
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\Newtonsoft.Json.xml
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\DAL.pdb
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\zxing.xml
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\RestSharp.xml
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\MvCameraControl.Net.xml
E:\Codes\Neotel\SmartScan\SmartScan\bin\Debug\System.Data.SQLite.xml
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.csproj.AssemblyReference.cache
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.csproj.SuggestedBindingRedirects.cache
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.FrmAbout.resources
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.FrmCodeExtract.resources
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.FrmCodeOCR.resources
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.FrmFieldContent.resources
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.FrmLoading.resources
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.FrmMain.resources
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.FrmMatchingInfo.resources
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.FrmRetrospect.resources
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.FrmSet.resources
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.FrmUsersLogin.resources
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.FrmWaitting.resources
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.FrmSetPlus.resources
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.UsrLabeling.resources
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.Properties.Resources.resources
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.FrmDataFilePreview.resources
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.UsrDataSource.resources
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.UsrWorkMode2.resources
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.UsrWorkMode.resources
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.UsrCamera.resources
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.UsrMacro.resources
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.UsrMaterialTemplate.resources
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.UsrPrintTemplate.resources
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.UsrCodeExtractList.resources
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.csproj.GenerateResource.cache
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.csproj.CoreCompileInputs.cache
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.csproj.CopyComplete
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.exe
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.pdb
E:\Codes\Neotel\SmartScan\SmartScan\obj\Debug\SmartScan.UsrExportData.resources
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>
\ No newline at end of file
namespace paddleOCR
{
partial class Paddle
{
/// <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.textBox1 = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.button4 = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(11, 11);
this.textBox1.Margin = new System.Windows.Forms.Padding(2);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(569, 21);
this.textBox1.TabIndex = 0;
//
// button1
//
this.button1.Location = new System.Drawing.Point(594, 11);
this.button1.Margin = new System.Windows.Forms.Padding(2);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(105, 29);
this.button1.TabIndex = 1;
this.button1.Text = "打开";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(119, 68);
this.button2.Margin = new System.Windows.Forms.Padding(2);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(112, 39);
this.button2.TabIndex = 2;
this.button2.Text = "python识别";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// pictureBox1
//
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.pictureBox1.Location = new System.Drawing.Point(0, 213);
this.pictureBox1.Margin = new System.Windows.Forms.Padding(2);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(745, 470);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.pictureBox1.TabIndex = 3;
this.pictureBox1.TabStop = false;
//
// textBox2
//
this.textBox2.Dock = System.Windows.Forms.DockStyle.Bottom;
this.textBox2.Location = new System.Drawing.Point(0, 118);
this.textBox2.Margin = new System.Windows.Forms.Padding(2);
this.textBox2.Multiline = true;
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(745, 95);
this.textBox2.TabIndex = 4;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(494, 81);
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(49, 13);
this.label1.TabIndex = 7;
this.label1.Text = "label1";
//
// button4
//
this.button4.Location = new System.Drawing.Point(262, 68);
this.button4.Margin = new System.Windows.Forms.Padding(2);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(112, 39);
this.button4.TabIndex = 8;
this.button4.Text = "c++识别";
this.button4.UseVisualStyleBackColor = true;
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// Paddle
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(745, 683);
this.Controls.Add(this.button4);
this.Controls.Add(this.label1);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.textBox1);
this.Margin = new System.Windows.Forms.Padding(2);
this.Name = "Paddle";
this.Text = "PaddleOcr";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Paddle_FormClosed);
this.Load += new System.EventHandler(this.Form1_Load);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button button4;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Net.Mime.MediaTypeNames;
using Newtonsoft;
using Newtonsoft.Json;
using System.Runtime.InteropServices;
using System.Runtime.ExceptionServices;
namespace paddleOCR
{
public partial class Paddle : Form
{
public Paddle()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
using (OpenFileDialog openFileDialog = new OpenFileDialog())
{
openFileDialog.Filter = "image files All files (*.*)|*.*";
openFileDialog.RestoreDirectory = true;
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
textBox1.Text = openFileDialog.FileName;
}
}
}
private void button2_Click(object sender, EventArgs e)
{
try
{
string path = System.Windows.Forms.Application.StartupPath + @"\paddleOCR.py";//py文件路径
if (string.IsNullOrEmpty(textBox1.Text))
{
return;
}
this.Invoke(new Action(() =>
{
startTime=DateTime.Now;
this.textBox2.Text = PaddleOCRHelper.StartPythonOcr(textBox1.Text);
this.label1.Text = $"elapsed:{(DateTime.Now - startTime).TotalSeconds.ToString("f2")}s";
try
{
Stream s = File.Open(System.Windows.Forms.Application.StartupPath + @"\ocr_result.jpg", FileMode.Open);
pictureBox1.Image = Bitmap.FromStream(s);
s.Close();
s.Dispose();
}
catch
{
}
}));
}
catch (Exception e1)
{
MessageBox.Show(e1.Message);
}
}
DateTime startTime;
public static List<T> DeserializeJsonToList<T>(string json) where T : class
{
JsonSerializer serializer = new JsonSerializer();
StringReader sr = new StringReader(json);
object o = serializer.Deserialize(new JsonTextReader(sr), typeof(List<T>));
List<T> list = o as List<T>;
return list;
}
public void outputDataReceived(object sender, DataReceivedEventArgs e)
{
if (!string.IsNullOrEmpty(e.Data))
{
this.Invoke(new Action(() =>
{
this.textBox2.Text = e.Data;
this.label1.Text = $"elapsed:{(DateTime.Now - startTime).TotalSeconds.ToString("f2")}s";
try
{
Stream s = File.Open(System.Windows.Forms.Application.StartupPath + @"\ocr_result.jpg", FileMode.Open);
pictureBox1.Image = Bitmap.FromStream(s);
s.Close();
s.Dispose();
}
catch
{
}
}));
}
}
private void button3_Click(object sender, EventArgs e)
{
using (OpenFileDialog openFileDialog = new OpenFileDialog())
{
openFileDialog.InitialDirectory = "c:\\";
openFileDialog.Filter = "python files (*.exe)|*.exe|All files (*.*)|*.*";
openFileDialog.RestoreDirectory = true;
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
textBox1.Text = openFileDialog.FileName;
}
}
}
private void button4_Click(object sender, EventArgs e)
{
try
{
this.Invoke(new Action(() =>
{
startTime= DateTime.Now;
this.textBox2.Text = PaddleOCRHelper.StartCPlusOcr(textBox1.Text);
this.label1.Text = $"elapsed:{(DateTime.Now - startTime).TotalSeconds.ToString("f2")}s";
try
{
Stream s = File.Open(System.Windows.Forms.Application.StartupPath + @"\ocr_result.jpg", FileMode.Open);
pictureBox1.Image = Bitmap.FromStream(s);
s.Close();
s.Dispose();
}
catch
{
}
}));
}
catch (Exception e1)
{
MessageBox.Show(e1.Message);
}
}
private NotifyIcon notify;
private ContextMenuStrip notifyMenu;
bool exit=false;
DeviceLibrary.Service service;
string url = ConfigHelper.Config.Get("url", "http://localhost:8090");
private void Form1_Load(object sender, EventArgs e)
{
service = new DeviceLibrary.Service();
service.Open(url);
//托盘菜单
notifyMenu = new ContextMenuStrip();
ToolStripMenuItem itemShow = new ToolStripMenuItem("显示(&S)");
itemShow.Click += ItemShow_Click;
ToolStripMenuItem itemExit = new ToolStripMenuItem("退出(&X)");
itemExit.Click += ItemExit_Click;
notifyMenu.Items.Add(itemShow);
notifyMenu.Items.Add(itemExit);
//托盘控件
notify = new NotifyIcon { Icon = Icon, Visible = true, ContextMenuStrip = notifyMenu, Text = Text };
this.WindowState= FormWindowState.Minimized;
ShowInTaskbar = false;
}
private void ItemShow_Click(object sender, EventArgs e)
{
Show();
if (WindowState == FormWindowState.Minimized)
WindowState = FormWindowState.Normal;
}
private void ItemExit_Click(object sender, EventArgs e)
{
notify.Dispose();
exit = true;
Close();
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (!exit)
{
e.Cancel = true;
Hide();
}
}
private void Paddle_FormClosed(object sender, FormClosedEventArgs e)
{
service.Close();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Runtime.ExceptionServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace paddleOCR
{
public class PaddleOCRHelper
{
static string pythonEnvPath = ConfigHelper.Config.Get("pythonEnvPath", "C:\\ProgramData\\miniconda3\\envs\\paddle_env\\");
private static Process progressTest;
/// <summary>
/// 开始检测
/// </summary>
/// <param name="pythonExePath">python解释器路径</param>
/// <param name="pythonFile">python文件</param>
/// <param name="imgPath">图像文件路径</param>
/// <returns></returns>
public static string StartPythonOcr(string imgPath)
{
string state = "";
try
{
string sArguments = ".\\paddleOCR.py" + " " + imgPath;
ProcessStartInfo start = new ProcessStartInfo();
start.FileName = pythonEnvPath + "python.exe" + " ";//环境路径需要配置好
start.Arguments = sArguments;
start.UseShellExecute = false;
start.RedirectStandardOutput = true;
start.RedirectStandardInput = true;
start.RedirectStandardError = true;
start.CreateNoWindow = true;
using (progressTest = Process.Start(start))
{
state = progressTest.StandardOutput.ReadToEnd();
progressTest.WaitForExit(30000);
//// 异步获取命令行内容
//progressTest.BeginOutputReadLine();
//// 为异步获取订阅事件
//progressTest.OutputDataReceived += new DataReceivedEventHandler(outputDataReceived);
}
string[] result = state.Split(new string[] { "\r\n" }, StringSplitOptions.None);
state = "";
if (result != null && result.Length > 1)
{
foreach (var item in result.Reverse())
{
if (item.Contains("OCR-Result:"))
{
var ocrR = item.Substring(12);
if (!string.IsNullOrEmpty(ocrR))
{
var lst = DeserializeJsonToList<string>(ocrR);
if (lst != null && lst.Count > 0)
{
state = string.Join(" ", lst);
//LogNet.log.Info($"Paddle Python OCR匹配[" + $"{(DateTime.Now - startTime).TotalSeconds.ToString("f2")}s" + "]:" + state);
}
else
{
state = "";
}
}
break;
}
}
return state;
}
else
return "";
}
catch (Exception ex)
{
//LogNet.log.Error("Paddle OCR匹配异常", ex);
}
return "";
}
[HandleProcessCorruptedStateExceptions]
public static string StartCPlusOcr(string imgPath)
{
StringBuilder sb = new StringBuilder(1024);
try
{
eyemOCRRecognizer(".\\config.txt", imgPath, sb);
}
catch (Exception ex)
{
return ex.Message;
}
return sb.ToString().Trim();
}
static List<T> DeserializeJsonToList<T>(string json) where T : class
{
JsonSerializer serializer = new JsonSerializer();
StringReader sr = new StringReader(json);
object o = serializer.Deserialize(new JsonTextReader(sr), typeof(List<T>));
List<T> list = o as List<T>;
return list;
}
[DllImport("PaddleOCRSDK.dll", CharSet = CharSet.None, CallingConvention = CallingConvention.Cdecl)]
private static extern int eyemOCRRecognizer(string extractorModelPath, string path, [MarshalAs(UnmanagedType.LPStr)] StringBuilder lpszContent);
}
}
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace paddleOCR
{
internal static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
if (IsRun())
return;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Paddle());
}
private static bool IsRun()
{
Process current = Process.GetCurrentProcess();
try
{
Process[] processes = Process.GetProcessesByName(current.ProcessName);
foreach (Process process in processes)
{
if (process.Id == current.Id) continue; //自己
if (process.MainModule.FileName == current.MainModule.FileName)
return true;
}
}
catch {
return true;
}
return false;
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("paddleOCR")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("paddleOCR")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("7178a902-e193-40cb-8af5-4eea05876522")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace paddleOCR.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("paddleOCR.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
//------------------------------------------------------------------------------
// <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 paddleOCR.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC 清单选项
如果想要更改 Windows 用户帐户控制级别,请使用
以下节点之一替换 requestedExecutionLevel 节点。
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
指定 requestedExecutionLevel 元素将禁用文件和注册表虚拟化。
如果你的应用程序需要此虚拟化来实现向后兼容性,则移除此
元素。
-->
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- 设计此应用程序与其一起工作且已针对此应用程序进行测试的
Windows 版本的列表。取消评论适当的元素,
Windows 将自动选择最兼容的环境。 -->
<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
<!-- Windows 7 -->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
<!-- Windows 8.1 -->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
<!-- Windows 10 -->
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
</application>
</compatibility>
<!-- 指示该应用程序可感知 DPI 且 Windows 在 DPI 较高时将不会对其进行
自动缩放。Windows Presentation Foundation (WPF)应用程序自动感知 DPI,无需
选择加入。选择加入此设置的 Windows 窗体应用程序(面向 .NET Framework 4.6)还应
在其 app.config 中将 "EnableWindowsFormsHighDpiAutoResizing" 设置设置为 "true"。
将应用程序设为感知长路径。请参阅 https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation -->
<!--
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
</windowsSettings>
</application>
-->
<!-- 启用 Windows 公共控件和对话框的主题(Windows XP 和更高版本) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->
</assembly>
<?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>{7178A902-E193-40CB-8AF5-4EEA05876522}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>paddleOCR</RootNamespace>
<AssemblyName>paddleOCR</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x64</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|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<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>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup />
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>pp.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="ConfigHelper">
<HintPath>..\SharedDll\ConfigHelper.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\SmartScan\bin\Debug\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.ServiceModel.Web" />
<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="PaddleOCRHelper.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="service\IService.cs" />
<Compile Include="service\Service.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="app.manifest" />
<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>
<Content Include="pp.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
此文件类型无法预览
using System.ServiceModel;
using System.ServiceModel.Web;
using System.IO;
using System.Runtime.Serialization;
using System.Collections.Generic;
namespace DeviceLibrary
{
[ServiceContract(Name = "Service")]
internal interface IService
{
[OperationContract]
[WebInvoke(UriTemplate = "/paddle/getOcr?ver={ver}&imgPath={imgPath}", Method = "GET", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
Result Readocr(string ver,string imgPath);
}
[DataContract]
public class Result
{
/// <summary>
/// 状态码,0为正常
/// </summary>
[DataMember]
public int code { get; set; } = 0;
/// <summary>
/// 返回数据
/// </summary>
[DataMember]
public string data { get; set; } = "";
/// <summary>
/// 提示信息
/// </summary>
[DataMember]
public string msg { get; set; } = "ok";
/// <summary>
/// 版本
/// </summary>
[DataMember]
public string ver { get; set; } = "";
}
}
using System.ServiceModel;
using System.ServiceModel.Web;
using System.ServiceModel.Activation;
using System;
using System.IO;
using System.Runtime.Serialization;
using System.Reflection;
using paddleOCR;
namespace DeviceLibrary
{
[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Single, IncludeExceptionDetailInFaults = true)]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
internal class WebService : IService
{
public Result Readocr(string ver, string imgPath)
{
Result result = new Result();
DateTime dateTime = DateTime.Now;
if (string.IsNullOrEmpty(ver))
{
result.data = PaddleOCRHelper.StartCPlusOcr(imgPath);
}
else if(ver.ToLower().Equals("python"))
{
result.data = PaddleOCRHelper.StartPythonOcr(imgPath);
}
else if(ver.ToLower().Equals("cplus"))
{
result.data = PaddleOCRHelper.StartCPlusOcr(imgPath);
}
else
{
result.data = PaddleOCRHelper.StartCPlusOcr(imgPath);
}
result.ver = ver;
result.msg = $"Paddle Ocr elapsed:{(DateTime.Now-dateTime).TotalSeconds.ToString("f2")}s";
return result;
}
}
public class Service
{
private WebServiceHost _serviceHost;
public bool State = false;
public void Open(string url)
{
try
{
WebService service = new WebService();
_serviceHost = new WebServiceHost(service, new Uri(url));//service, new Uri(url)
_serviceHost.Open();
State = true;
}
catch (Exception ex)
{
State = false;
}
}
public void Close()
{
try
{
if (_serviceHost != null)//判断服务是否关闭
_serviceHost.Close();//关闭服务
State = false;
}
catch (Exception ex)
{
}
}
}
}
文件属性发生变化
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!