Commit 4ee377f3 张东亮

追溯导出文件格式优化

1 个父辈 2dca365c
......@@ -425,7 +425,7 @@ namespace BLL
Bitmap bmp = CodeOcr(ocrcode[i], ocrlist[i], CurrntBitmap);
bool algro = ConfigHelper.Config.Get("UsePaddleOCR", true);
bool algro = ConfigHelper.Config.Get("UsePaddleOCR", false);
string codeOcr = "";
if (algro)
{
......
......@@ -216,7 +216,7 @@ namespace SmartScan
string getOcrString()
{
string codeOcrs = "";
bool algro = ConfigHelper.Config.Get("UsePaddleOCR", true);
bool algro = ConfigHelper.Config.Get("UsePaddleOCR", false);
if (algro)
{
codeOcrs = PaddleOCRHelper.StartTest("..\\ocrt.jpg");
......
......@@ -3,6 +3,8 @@ using Model;
using System.Threading;
using System.Windows.Forms;
using BLL;
using System.Diagnostics;
using System.IO;
namespace SmartScan
{
......@@ -18,7 +20,10 @@ namespace SmartScan
private void Init()
{
string version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
Process current = Process.GetCurrentProcess();
FileInfo fileInfo = new FileInfo(current.MainModule.FileName);
DateTime dateTime = fileInfo.CreationTime;
string version = $"{dateTime.Year%10}.{dateTime.Month}.{dateTime.Day}{dateTime.Hour}";
LogNet.log = log4net.LogManager.GetLogger("SmartScan");
LogNet.log.Info($"===== 程序开始 {version} =====");
......
......@@ -173,40 +173,44 @@ namespace SmartScan
LogNet.log.Error("Extension_Printing", ex);
}
}
string dir_Res = ConfigHelper.Config.Get("DirReelResult","");
string dir_Res = ConfigHelper.Config.Get("DirReelResult", ".\\ReelResult");
string reelResultFileNameKey = ConfigHelper.Config.Get("FileNameKeyReelResult", "");
/// <summary>
/// 保存检测结果
/// </summary>
/// <param name="content"></param>
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);
//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)
{
string str = "打印内容:";
try
{
string str = "打印内容:";
foreach (string key in content.Keys)
str += string.Format("({0}:{1})", key, content[key]);
SaveResult(content);
LogNet.log.Info(str);
SaveResult(content);
//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));
......@@ -217,7 +221,7 @@ namespace SmartScan
}
catch (Exception ex)
{
LogNet.log.Error("Extension_Printing", ex);
LogNet.log.Error($"Extension_Printing", ex);
}
}
......
......@@ -46,7 +46,7 @@ namespace SmartScan
var onnxexe = "onnx\\OcrLiteOnnxForm.exe";
Process.Start(onnxexe);
var paddle = "paddle\\paddleOCR.exe";
var paddle = ".\\paddle\\paddleOCR.exe";
Process.Start(paddle);
......
......@@ -134,3 +134,121 @@
[2023-03-08 17:02:12,774][SmartScan.Program:92]INFO =====程序结束=====
>>>>>>> d74613d158adbe1ef35172eefd805698bc4f0254
[2023-03-14 15:10:34,832][SmartScan.FrmLoading:23]INFO ===== 程序开始 3.1.8473.27210 =====
[2023-03-14 15:10:34,857][DAL.ConfigRW:17]INFO 读取配置文件
[2023-03-14 15:10:34,864][BLL.ExtraFileData:32]INFO 数据源:C:\download\sample.csv
[2023-03-14 15:10:34,865][BLL.ExtraFileData:55]INFO 数据源加载文件:C:\download\sample.csv
[2023-03-14 15:10:45,593][SmartScan.FrmLoading:23]INFO ===== 程序开始 3.1.8473.27321 =====
[2023-03-14 15:10:45,626][DAL.ConfigRW:17]INFO 读取配置文件
[2023-03-14 15:10:45,634][BLL.ExtraFileData:32]INFO 数据源:C:\download\sample.csv
[2023-03-14 15:10:45,635][BLL.ExtraFileData:55]INFO 数据源加载文件:C:\download\sample.csv
[2023-03-14 15:10:49,491][SmartScan.FrmLoading:35]INFO 加载相机,数量:0
[2023-03-14 15:10:59,093][BLL.KND_IO:127]INFO Ping 192.168.20.100 请求没有回应
[2023-03-14 15:10:59,094][SmartScan.FrmLoading:42]INFO 加载IO模块,IP地址:192.168.20.100,iomodule:
[2023-03-14 15:10:59,094][SmartScan.FrmLoading:48]INFO 加载OCR模块
[2023-03-14 15:10:59,096][BLL.Extension:38]INFO 加载扩展:General
[2023-03-14 15:10:59,098][BLL.PrintLabelEdit:49]INFO 读取打印标签
[2023-03-14 15:10:59,103][BLL.MaterialEdit:20]INFO 读取物料模板
[2023-03-14 15:11:00,072][SmartScan.WebService:19]INFO WebService没有配置,不开启
[2023-03-14 15:11:00,073][SmartScan.FrmLoading:64]INFO 读取关键字文件
[2023-03-14 15:11:00,434][SmartScan.FrmMain:35]INFO 相机数量为0
[2023-03-14 15:11:39,956][SmartScan.FrmLoading:23]INFO ===== 程序开始 3.1.8473.27321 =====
[2023-03-14 15:11:39,984][DAL.ConfigRW:17]INFO 读取配置文件
[2023-03-14 15:11:39,997][BLL.ExtraFileData:32]INFO 数据源:C:\download\sample.csv
[2023-03-14 15:11:39,998][BLL.ExtraFileData:55]INFO 数据源加载文件:C:\download\sample.csv
[2023-03-14 15:11:43,837][SmartScan.FrmLoading:35]INFO 加载相机,数量:0
[2023-03-14 15:11:53,585][BLL.KND_IO:127]INFO Ping 192.168.20.100 请求没有回应
[2023-03-14 15:11:53,585][SmartScan.FrmLoading:42]INFO 加载IO模块,IP地址:192.168.20.100,iomodule:
[2023-03-14 15:11:53,586][SmartScan.FrmLoading:48]INFO 加载OCR模块
[2023-03-14 15:11:53,588][BLL.Extension:38]INFO 加载扩展:General
[2023-03-14 15:11:53,591][BLL.PrintLabelEdit:49]INFO 读取打印标签
[2023-03-14 15:11:53,595][BLL.MaterialEdit:20]INFO 读取物料模板
[2023-03-14 15:11:54,545][SmartScan.WebService:19]INFO WebService没有配置,不开启
[2023-03-14 15:11:54,545][SmartScan.FrmLoading:64]INFO 读取关键字文件
[2023-03-14 15:11:54,981][SmartScan.FrmMain:35]INFO 相机数量为0
[2023-03-14 15:14:21,948][SmartScan.FrmLoading:23]INFO ===== 程序开始 3.1.8473.27427 =====
[2023-03-14 15:14:21,972][DAL.ConfigRW:17]INFO 读取配置文件
[2023-03-14 15:14:21,979][BLL.ExtraFileData:32]INFO 数据源:C:\download\sample.csv
[2023-03-14 15:14:21,980][BLL.ExtraFileData:55]INFO 数据源加载文件:C:\download\sample.csv
[2023-03-14 15:14:25,727][SmartScan.FrmLoading:35]INFO 加载相机,数量:0
[2023-03-14 15:14:35,582][BLL.KND_IO:127]INFO Ping 192.168.20.100 请求没有回应
[2023-03-14 15:14:35,582][SmartScan.FrmLoading:42]INFO 加载IO模块,IP地址:192.168.20.100,iomodule:
[2023-03-14 15:14:35,583][SmartScan.FrmLoading:48]INFO 加载OCR模块
[2023-03-14 15:14:35,585][BLL.Extension:38]INFO 加载扩展:General
[2023-03-14 15:14:35,587][BLL.PrintLabelEdit:49]INFO 读取打印标签
[2023-03-14 15:14:35,591][BLL.MaterialEdit:20]INFO 读取物料模板
[2023-03-14 15:14:36,409][SmartScan.WebService:19]INFO WebService没有配置,不开启
[2023-03-14 15:14:36,409][SmartScan.FrmLoading:64]INFO 读取关键字文件
[2023-03-14 15:14:36,714][SmartScan.FrmMain:35]INFO 相机数量为0
[2023-03-14 15:15:14,170][SmartScan.Program:89]INFO =====准备退出...=====
[2023-03-14 15:15:14,200][SmartScan.WebService:42]INFO Web服务已关闭
[2023-03-14 15:15:14,200][SmartScan.Program:94]INFO =====程序结束=====
[2023-03-14 15:39:38,594][SmartScan.FrmLoading:23]INFO ===== 程序开始 3.1.8473.27877 =====
[2023-03-14 15:39:38,617][DAL.ConfigRW:17]INFO 读取配置文件
[2023-03-14 15:39:38,624][BLL.ExtraFileData:32]INFO 数据源:C:\download\sample.csv
[2023-03-14 15:39:38,625][BLL.ExtraFileData:55]INFO 数据源加载文件:C:\download\sample.csv
[2023-03-14 15:39:42,386][SmartScan.FrmLoading:35]INFO 加载相机,数量:0
[2023-03-14 15:39:52,091][BLL.KND_IO:127]INFO Ping 192.168.20.100 请求没有回应
[2023-03-14 15:39:52,092][SmartScan.FrmLoading:42]INFO 加载IO模块,IP地址:192.168.20.100,iomodule:
[2023-03-14 15:39:52,092][SmartScan.FrmLoading:48]INFO 加载OCR模块
[2023-03-14 15:39:52,094][BLL.Extension:38]INFO 加载扩展:General
[2023-03-14 15:39:52,096][BLL.PrintLabelEdit:49]INFO 读取打印标签
[2023-03-14 15:39:52,100][BLL.MaterialEdit:20]INFO 读取物料模板
[2023-03-14 15:39:53,022][SmartScan.WebService:19]INFO WebService没有配置,不开启
[2023-03-14 15:39:53,023][SmartScan.FrmLoading:64]INFO 读取关键字文件
[2023-03-14 15:39:53,453][SmartScan.FrmMain:35]INFO 相机数量为0
[2023-03-14 15:48:49,407][SmartScan.Program:89]INFO =====准备退出...=====
[2023-03-14 15:48:49,436][SmartScan.WebService:42]INFO Web服务已关闭
[2023-03-14 15:48:49,436][SmartScan.Program:94]INFO =====程序结束=====
[2023-03-14 16:00:57,171][SmartScan.FrmLoading:28]INFO ===== 程序开始 3.3.147 =====
[2023-03-14 16:00:57,196][DAL.ConfigRW:17]INFO 读取配置文件
[2023-03-14 16:00:57,202][BLL.ExtraFileData:32]INFO 数据源:C:\download\sample.csv
[2023-03-14 16:00:57,203][BLL.ExtraFileData:55]INFO 数据源加载文件:C:\download\sample.csv
[2023-03-14 16:01:00,944][SmartScan.FrmLoading:40]INFO 加载相机,数量:0
[2023-03-14 16:01:10,585][BLL.KND_IO:127]INFO Ping 192.168.20.100 请求没有回应
[2023-03-14 16:01:10,585][SmartScan.FrmLoading:47]INFO 加载IO模块,IP地址:192.168.20.100,iomodule:
[2023-03-14 16:01:10,586][SmartScan.FrmLoading:53]INFO 加载OCR模块
[2023-03-14 16:01:10,588][BLL.Extension:38]INFO 加载扩展:General
[2023-03-14 16:01:10,590][BLL.PrintLabelEdit:49]INFO 读取打印标签
[2023-03-14 16:01:10,594][BLL.MaterialEdit:20]INFO 读取物料模板
[2023-03-14 16:01:11,394][SmartScan.WebService:19]INFO WebService没有配置,不开启
[2023-03-14 16:01:11,394][SmartScan.FrmLoading:69]INFO 读取关键字文件
[2023-03-14 16:01:11,729][SmartScan.FrmMain:35]INFO 相机数量为0
[2023-03-14 16:04:55,349][SmartScan.FrmLoading:28]INFO ===== 程序开始 3.3.1416 =====
[2023-03-14 16:04:55,374][DAL.ConfigRW:17]INFO 读取配置文件
[2023-03-14 16:04:55,384][BLL.ExtraFileData:32]INFO 数据源:C:\download\sample.csv
[2023-03-14 16:04:55,385][BLL.ExtraFileData:55]INFO 数据源加载文件:C:\download\sample.csv
[2023-03-14 16:04:59,158][SmartScan.FrmLoading:40]INFO 加载相机,数量:0
[2023-03-14 16:05:09,085][BLL.KND_IO:127]INFO Ping 192.168.20.100 请求没有回应
[2023-03-14 16:05:09,085][SmartScan.FrmLoading:47]INFO 加载IO模块,IP地址:192.168.20.100,iomodule:
[2023-03-14 16:05:09,086][SmartScan.FrmLoading:53]INFO 加载OCR模块
[2023-03-14 16:05:09,088][BLL.Extension:38]INFO 加载扩展:General
[2023-03-14 16:05:09,090][BLL.PrintLabelEdit:49]INFO 读取打印标签
[2023-03-14 16:05:09,094][BLL.MaterialEdit:20]INFO 读取物料模板
[2023-03-14 16:05:09,874][SmartScan.WebService:19]INFO WebService没有配置,不开启
[2023-03-14 16:05:09,874][SmartScan.FrmLoading:69]INFO 读取关键字文件
[2023-03-14 16:05:10,203][SmartScan.FrmMain:35]INFO 相机数量为0
[2023-03-14 16:06:21,386][SmartScan.Program:89]INFO =====准备退出...=====
[2023-03-14 16:06:21,407][SmartScan.WebService:42]INFO Web服务已关闭
[2023-03-14 16:06:21,407][SmartScan.Program:94]INFO =====程序结束=====
[2023-03-14 16:07:01,719][SmartScan.FrmLoading:28]INFO ===== 程序开始 3.3.1416 =====
[2023-03-14 16:07:01,744][DAL.ConfigRW:17]INFO 读取配置文件
[2023-03-14 16:07:01,753][BLL.ExtraFileData:32]INFO 数据源:C:\download\sample.csv
[2023-03-14 16:07:01,754][BLL.ExtraFileData:55]INFO 数据源加载文件:C:\download\sample.csv
[2023-03-14 16:07:05,516][SmartScan.FrmLoading:40]INFO 加载相机,数量:0
[2023-03-14 16:07:15,087][BLL.KND_IO:127]INFO Ping 192.168.20.100 请求没有回应
[2023-03-14 16:07:15,087][SmartScan.FrmLoading:47]INFO 加载IO模块,IP地址:192.168.20.100,iomodule:
[2023-03-14 16:07:15,088][SmartScan.FrmLoading:53]INFO 加载OCR模块
[2023-03-14 16:07:15,090][BLL.Extension:38]INFO 加载扩展:General
[2023-03-14 16:07:15,091][BLL.PrintLabelEdit:49]INFO 读取打印标签
[2023-03-14 16:07:15,095][BLL.MaterialEdit:20]INFO 读取物料模板
[2023-03-14 16:07:15,909][SmartScan.WebService:19]INFO WebService没有配置,不开启
[2023-03-14 16:07:15,910][SmartScan.FrmLoading:69]INFO 读取关键字文件
[2023-03-14 16:07:16,251][SmartScan.FrmMain:35]INFO 相机数量为0
[2023-03-14 16:09:14,481][SmartScan.Program:89]INFO =====准备退出...=====
[2023-03-14 16:09:14,512][SmartScan.WebService:42]INFO Web服务已关闭
[2023-03-14 16:09:14,512][SmartScan.Program:94]INFO =====程序结束=====
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!