From 8647094253f540e9f89976cb9b421fbe1ed15711 Mon Sep 17 00:00:00 2001 From: frankiecao Date: Thu, 14 Dec 2023 17:44:56 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E6=96=87=E4=BB=B6=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PrintManager.cs | 37 ++++++--- .../SlnMesnac.LabelPrint.BarTender.csproj | 4 + .../equip/DrumLabelPrintEquip.cs | 74 +++++++++++++++++ .../equip/GasLabelPrintEquip.cs | 36 ++++++++- .../equip/PalletLabelPrintEquip.cs | 47 +++++++++++ .../equip/PrintEquip.cs | 2 +- .../equip/TFLablePrintEquip.cs | 74 +++++++++++++++++ .../equip/UnitLabelPrintEquip.cs | 66 ++++++++++++++++ .../FileHelper.cs | 79 +++++++++++++++---- SlnMesnac.LabelPrint.Log4net/LogHelper.cs | 2 +- SlnMesnac.LabelPrint.Timer/PrintTimer.cs | 4 +- SlnMesnac.LabelPrint/MainWindow.xaml | 4 +- .../viewModel/MainWindowViewModel.cs | 2 +- 13 files changed, 398 insertions(+), 33 deletions(-) create mode 100644 SlnMesnac.LabelPrint.BarTender/equip/DrumLabelPrintEquip.cs create mode 100644 SlnMesnac.LabelPrint.BarTender/equip/PalletLabelPrintEquip.cs create mode 100644 SlnMesnac.LabelPrint.BarTender/equip/TFLablePrintEquip.cs create mode 100644 SlnMesnac.LabelPrint.BarTender/equip/UnitLabelPrintEquip.cs diff --git a/SlnMesnac.LabelPrint.BarTender/PrintManager.cs b/SlnMesnac.LabelPrint.BarTender/PrintManager.cs index d1ab2c1..cf8d28e 100644 --- a/SlnMesnac.LabelPrint.BarTender/PrintManager.cs +++ b/SlnMesnac.LabelPrint.BarTender/PrintManager.cs @@ -37,9 +37,12 @@ namespace SlnMesnac.LabelPrint.BarTender bool result = false; try { - if (labelInfo.productType == "Gas" || labelInfo.productType == "TF") + if (labelInfo.productType == "Gas") { result = this.PrintGasLabel(labelInfo); + }else if (labelInfo.productType == "TF") + { + result = this.PrintTFLabel(labelInfo); }else if(labelInfo.productType == "Drum") { result = this.PrintDrumLabel(labelInfo); @@ -88,14 +91,30 @@ namespace SlnMesnac.LabelPrint.BarTender } /// - /// 气体、不锈钢标签打印 + /// 气体打印 /// /// private bool PrintGasLabel(BaseLabelInfo labelInfo) { bool result = false; PrintEquip equip = new GasLabelPrintEquip(); - equip.tempPath = "C:\\Users\\Administrator\\Desktop\\模板01.btw"; + equip.tempPath = "C:\\Users\\Administrator\\Desktop\\模板一.btw"; + equip.ParaClass = labelInfo; + equip.Open(); + result = equip.print(); + equip.Colse(); + return result; + } + + /// + /// 不锈钢标签打印 + /// + /// + private bool PrintTFLabel(BaseLabelInfo labelInfo) + { + bool result = false; + PrintEquip equip = new TFLabelPrintEquip(); + equip.tempPath = "C:\\Users\\Administrator\\Desktop\\模板二.btw"; equip.ParaClass = labelInfo; equip.Open(); result = equip.print(); @@ -110,8 +129,8 @@ namespace SlnMesnac.LabelPrint.BarTender private bool PrintDrumLabel(BaseLabelInfo labelInfo) { bool result = false; - PrintEquip equip = new LabelPrintEquip(); - equip.tempPath = "C:\\Users\\Administrator\\Desktop\\模板01.btw"; + PrintEquip equip = new DrumLabelPrintEquip(); + equip.tempPath = "C:\\Users\\Administrator\\Desktop\\模板三.btw"; equip.ParaClass = labelInfo; equip.Open(); result = equip.print(); @@ -123,8 +142,8 @@ namespace SlnMesnac.LabelPrint.BarTender private bool PrintUnitLabel(BaseLabelInfo labelInfo) { bool result = false; - PrintEquip equip = new LabelPrintEquip(); - equip.tempPath = "C:\\Users\\Administrator\\Desktop\\模板01.btw"; + PrintEquip equip = new UnitLabelPrintEquip(); + equip.tempPath = "C:\\Users\\Administrator\\Desktop\\模板四.btw"; equip.ParaClass = labelInfo; equip.Open(); result = equip.print(); @@ -136,8 +155,8 @@ namespace SlnMesnac.LabelPrint.BarTender private bool PrintPalletLabel(BaseLabelInfo labelInfo) { bool result = false; - PrintEquip equip = new LabelPrintEquip(); - equip.tempPath = "C:\\Users\\Administrator\\Desktop\\模板01.btw"; + PrintEquip equip = new PalletLabelPrintEquip(); + equip.tempPath = "C:\\Users\\Administrator\\Desktop\\模板五.btw"; equip.ParaClass = labelInfo; equip.Open(); result = equip.print(); diff --git a/SlnMesnac.LabelPrint.BarTender/SlnMesnac.LabelPrint.BarTender.csproj b/SlnMesnac.LabelPrint.BarTender/SlnMesnac.LabelPrint.BarTender.csproj index 29c8508..7297500 100644 --- a/SlnMesnac.LabelPrint.BarTender/SlnMesnac.LabelPrint.BarTender.csproj +++ b/SlnMesnac.LabelPrint.BarTender/SlnMesnac.LabelPrint.BarTender.csproj @@ -46,9 +46,13 @@ + + + + diff --git a/SlnMesnac.LabelPrint.BarTender/equip/DrumLabelPrintEquip.cs b/SlnMesnac.LabelPrint.BarTender/equip/DrumLabelPrintEquip.cs new file mode 100644 index 0000000..547e743 --- /dev/null +++ b/SlnMesnac.LabelPrint.BarTender/equip/DrumLabelPrintEquip.cs @@ -0,0 +1,74 @@ +using SlnMesnac.LabelPrint.Bartender.equip; +using SlnMesnac.LabelPrint.Common; +using SlnMesnac.LabelPrint.Log4net; +using SlnMesnac.LabelPrint.Model; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SlnMesnac.LabelPrint.BarTender.equip +{ + public class DrumLabelPrintEquip : PrintEquip + { + private readonly LogHelper logHelper = LogHelper.Instance; + private readonly JsonChange jsonChange = JsonChange.Instance; + public override bool AddPara() + { + var para = base.ParaClass as BaseLabelInfo; + if (para != null) + { + try + { + logHelper.Info($"打印标签信息:{jsonChange.ModeToJson(para)}"); + //base.EngineFormat.SubStrings["rfid"].Value = + // para.column_A.ToString() + para.column_B.ToString() + para.column_C.ToString() + // + para.column_D.ToString() + para.column_E.ToString() + para.column_F.ToString() + // + para.column_G.ToString() + para.column_H.ToString() + para.column_I.ToString() + // + para.column_J.ToString(); + + //stirng 转为16进制 + + string msg = para.column_A.ToString() + para.column_B.ToString() + para.column_C.ToString() + + para.column_D.ToString() + para.column_E.ToString() + para.column_F.ToString() + + para.column_G.ToString() + para.column_H.ToString() + para.column_I.ToString() + + para.column_J.ToString(); + + byte[] buffer = Encoding.UTF8.GetBytes(msg); + + string hexString = BitConverter.ToString(buffer).Replace("-",string.Empty); + //Console.WriteLine(hexString); + + base.EngineFormat.SubStrings["rfid"].Value = hexString; + + base.EngineFormat.SubStrings["qrcode"].Value = + para.column_A.ToString() + para.column_B.ToString() + para.column_C.ToString() + + para.column_D.ToString() + para.column_E.ToString() + para.column_F.ToString() + + para.column_G.ToString() + para.column_H.ToString() + para.column_I.ToString() + + para.column_J.ToString(); + base.EngineFormat.SubStrings["cylinder"].Value = para.column_H.ToString(); + base.EngineFormat.SubStrings["exp.date"].Value = para.column_J.ToString(); + base.EngineFormat.SubStrings["lot"].Value = para.column_F.ToString(); + base.EngineFormat.SubStrings["p/n"].Value = para.column_D.ToString(); + base.EngineFormat.SubStrings["barcode1"].Value = "4" + para.column_D.ToString() + " " + para.column_J.ToString(); + base.EngineFormat.SubStrings["barcode2"].Value = "5" + para.column_H.ToString(); + base.EngineFormat.SubStrings["barcode3"].Value = "6" + para.column_F.ToString(); + //para.column_A.ToString(); + + return true; + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + return false; + } + + } + else + { + return false; + } + } + } +} diff --git a/SlnMesnac.LabelPrint.BarTender/equip/GasLabelPrintEquip.cs b/SlnMesnac.LabelPrint.BarTender/equip/GasLabelPrintEquip.cs index da89a5b..e682ecf 100644 --- a/SlnMesnac.LabelPrint.BarTender/equip/GasLabelPrintEquip.cs +++ b/SlnMesnac.LabelPrint.BarTender/equip/GasLabelPrintEquip.cs @@ -14,7 +14,6 @@ namespace SlnMesnac.LabelPrint.BarTender.equip { private readonly LogHelper logHelper = LogHelper.Instance; private readonly JsonChange jsonChange = JsonChange.Instance; - public override bool AddPara() { var para = base.ParaClass as BaseLabelInfo; @@ -23,7 +22,40 @@ namespace SlnMesnac.LabelPrint.BarTender.equip try { logHelper.Info($"打印标签信息:{jsonChange.ModeToJson(para)}"); - base.EngineFormat.SubStrings["barcode"].Value = para.column_A.ToString(); + //base.EngineFormat.SubStrings["rfid"].Value = + // para.column_A.ToString() + para.column_B.ToString() + para.column_C.ToString() + // + para.column_D.ToString() + para.column_E.ToString() + para.column_F.ToString() + // + para.column_G.ToString() + para.column_H.ToString() + para.column_I.ToString() + // + para.column_J.ToString(); + + //stirng 转为16进制 + + string msg = para.column_A.ToString() + para.column_B.ToString() + para.column_C.ToString() + + para.column_D.ToString() + para.column_E.ToString() + para.column_F.ToString() + + para.column_G.ToString() + para.column_H.ToString() + para.column_I.ToString() + + para.column_J.ToString(); + + byte[] buffer = Encoding.UTF8.GetBytes(msg); + + string hexString = BitConverter.ToString(buffer).Replace("-",string.Empty); + //Console.WriteLine(hexString); + + base.EngineFormat.SubStrings["rfid"].Value = hexString; + + base.EngineFormat.SubStrings["qrcode"].Value = + para.column_A.ToString() + para.column_B.ToString() + para.column_C.ToString() + + para.column_D.ToString() + para.column_E.ToString() + para.column_F.ToString() + + para.column_G.ToString() + para.column_H.ToString() + para.column_I.ToString() + + para.column_J.ToString(); + base.EngineFormat.SubStrings["cylinder"].Value = para.column_H.ToString(); + base.EngineFormat.SubStrings["exp.date"].Value = para.column_J.ToString(); + base.EngineFormat.SubStrings["lot"].Value = para.column_F.ToString(); + base.EngineFormat.SubStrings["p/n"].Value = para.column_D.ToString(); + base.EngineFormat.SubStrings["barcode1"].Value = "4" + para.column_D.ToString() + " " + para.column_J.ToString(); + base.EngineFormat.SubStrings["barcode2"].Value = "5" + para.column_H.ToString(); + base.EngineFormat.SubStrings["barcode3"].Value = "6" + para.column_F.ToString(); + //para.column_A.ToString(); + return true; } catch (Exception e) diff --git a/SlnMesnac.LabelPrint.BarTender/equip/PalletLabelPrintEquip.cs b/SlnMesnac.LabelPrint.BarTender/equip/PalletLabelPrintEquip.cs new file mode 100644 index 0000000..3637fe1 --- /dev/null +++ b/SlnMesnac.LabelPrint.BarTender/equip/PalletLabelPrintEquip.cs @@ -0,0 +1,47 @@ +using SlnMesnac.LabelPrint.Bartender.equip; +using SlnMesnac.LabelPrint.Common; +using SlnMesnac.LabelPrint.Log4net; +using SlnMesnac.LabelPrint.Model; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SlnMesnac.LabelPrint.BarTender.equip +{ + public class PalletLabelPrintEquip : PrintEquip + { + private readonly LogHelper logHelper = LogHelper.Instance; + private readonly JsonChange jsonChange = JsonChange.Instance; + public override bool AddPara() + { + var para = base.ParaClass as BaseLabelInfo; + if (para != null) + { + try + { + logHelper.Info($"打印标签信息:{jsonChange.ModeToJson(para)}"); + string msg = "25BUN33000074" + para.column_A.ToString(); + byte[] buffer = Encoding.UTF8.GetBytes( msg ); + string hexString = BitConverter.ToString( buffer).Replace("-",string.Empty); + base.EngineFormat.SubStrings["rfid"].Value = hexString; + base.EngineFormat.SubStrings["qrcode"].Value = "25BUN33000074" + para.column_A.ToString(); + base.EngineFormat.SubStrings["barcode"].Value = "25BUN33000074" + para.column_A.ToString(); + base.EngineFormat.SubStrings["pallet"].Value = para.column_A.ToString(); + return true; + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + return false; + } + + } + else + { + return false; + } + } + } +} diff --git a/SlnMesnac.LabelPrint.BarTender/equip/PrintEquip.cs b/SlnMesnac.LabelPrint.BarTender/equip/PrintEquip.cs index e390468..aca5bd7 100644 --- a/SlnMesnac.LabelPrint.BarTender/equip/PrintEquip.cs +++ b/SlnMesnac.LabelPrint.BarTender/equip/PrintEquip.cs @@ -68,7 +68,7 @@ namespace SlnMesnac.LabelPrint.Bartender.equip Result re = EngineFormat.Print(); result = re == Result.Success ? true : false; string st = re == Result.Success ? "成功" : "失败"; - Console.WriteLine("文件打印" + st + re.ToString()); + Console.WriteLine($"{DateTime.Now.ToString("HH:mm:ss")}文件打印" + st + re.ToString()); } else { diff --git a/SlnMesnac.LabelPrint.BarTender/equip/TFLablePrintEquip.cs b/SlnMesnac.LabelPrint.BarTender/equip/TFLablePrintEquip.cs new file mode 100644 index 0000000..df71c79 --- /dev/null +++ b/SlnMesnac.LabelPrint.BarTender/equip/TFLablePrintEquip.cs @@ -0,0 +1,74 @@ +using SlnMesnac.LabelPrint.Bartender.equip; +using SlnMesnac.LabelPrint.Common; +using SlnMesnac.LabelPrint.Log4net; +using SlnMesnac.LabelPrint.Model; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SlnMesnac.LabelPrint.BarTender.equip +{ + public class TFLabelPrintEquip : PrintEquip + { + private readonly LogHelper logHelper = LogHelper.Instance; + private readonly JsonChange jsonChange = JsonChange.Instance; + public override bool AddPara() + { + var para = base.ParaClass as BaseLabelInfo; + if (para != null) + { + try + { + logHelper.Info($"打印标签信息:{jsonChange.ModeToJson(para)}"); + //base.EngineFormat.SubStrings["rfid"].Value = + // para.column_A.ToString() + para.column_B.ToString() + para.column_C.ToString() + // + para.column_D.ToString() + para.column_E.ToString() + para.column_F.ToString() + // + para.column_G.ToString() + para.column_H.ToString() + para.column_I.ToString() + // + para.column_J.ToString(); + + //stirng 转为16进制 + + string msg = para.column_A.ToString() + para.column_B.ToString() + para.column_C.ToString() + + para.column_D.ToString() + para.column_E.ToString() + para.column_F.ToString() + + para.column_G.ToString() + para.column_H.ToString() + para.column_I.ToString() + + para.column_J.ToString(); + + byte[] buffer = Encoding.UTF8.GetBytes(msg); + + string hexString = BitConverter.ToString(buffer).Replace("-", string.Empty); + //Console.WriteLine(hexString); + + base.EngineFormat.SubStrings["rfid"].Value = hexString; + + base.EngineFormat.SubStrings["qrcode"].Value = + para.column_A.ToString() + para.column_B.ToString() + para.column_C.ToString() + + para.column_D.ToString() + para.column_E.ToString() + para.column_F.ToString() + + para.column_G.ToString() + para.column_H.ToString() + para.column_I.ToString() + + para.column_J.ToString(); + base.EngineFormat.SubStrings["cylinder"].Value = para.column_H.ToString(); + base.EngineFormat.SubStrings["exp.date"].Value = para.column_J.ToString(); + base.EngineFormat.SubStrings["lot"].Value = para.column_F.ToString(); + base.EngineFormat.SubStrings["p/n"].Value = para.column_D.ToString(); + base.EngineFormat.SubStrings["barcode1"].Value = "4" + para.column_D.ToString() + " " + para.column_J.ToString(); + base.EngineFormat.SubStrings["barcode2"].Value = "5" + para.column_H.ToString(); + base.EngineFormat.SubStrings["barcode3"].Value = "6" + para.column_F.ToString(); + //para.column_A.ToString(); + + return true; + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + return false; + } + + } + else + { + return false; + } + } + } +} diff --git a/SlnMesnac.LabelPrint.BarTender/equip/UnitLabelPrintEquip.cs b/SlnMesnac.LabelPrint.BarTender/equip/UnitLabelPrintEquip.cs new file mode 100644 index 0000000..eab1872 --- /dev/null +++ b/SlnMesnac.LabelPrint.BarTender/equip/UnitLabelPrintEquip.cs @@ -0,0 +1,66 @@ +using SlnMesnac.LabelPrint.Bartender.equip; +using SlnMesnac.LabelPrint.Common; +using SlnMesnac.LabelPrint.Log4net; +using SlnMesnac.LabelPrint.Model; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SlnMesnac.LabelPrint.BarTender.equip +{ + public class UnitLabelPrintEquip : PrintEquip + { + private readonly LogHelper logHelper = LogHelper.Instance; + private readonly JsonChange jsonChange = JsonChange.Instance; + public override bool AddPara() + { + var para = base.ParaClass as BaseLabelInfo; + if (para != null) + { + try + { + logHelper.Info($"打印标签信息:{jsonChange.ModeToJson(para)}"); + //base.EngineFormat.SubStrings["rfid"].Value = + // para.column_A.ToString() + para.column_B.ToString() + para.column_C.ToString() + // + para.column_D.ToString() + para.column_E.ToString() + para.column_F.ToString() + // + para.column_G.ToString() + para.column_H.ToString() + para.column_I.ToString() + // + para.column_J.ToString(); + + //stirng 转为16进制 + + string msg = para.column_A.ToString() + para.column_B.ToString() + para.column_C.ToString() + + para.column_D.ToString() + para.column_E.ToString(); + + byte[] buffer = Encoding.UTF8.GetBytes(msg); + + string hexString = BitConverter.ToString(buffer).Replace("-", string.Empty); + //Console.WriteLine(hexString); + + base.EngineFormat.SubStrings["rfid"].Value = hexString; + base.EngineFormat.SubStrings["qrcode"].Value = para.column_A.ToString() + para.column_B.ToString() + para.column_C.ToString() + + para.column_D.ToString() + para.column_E.ToString(); + base.EngineFormat.SubStrings["exp.date"].Value = para.column_E.ToString(); + base.EngineFormat.SubStrings["lot"].Value = para.column_B.ToString(); + base.EngineFormat.SubStrings["serial"].Value = para.column_D.ToString(); + base.EngineFormat.SubStrings["p/n"].Value = para.column_A.ToString(); + base.EngineFormat.SubStrings["barcode"].Value = para.column_D.ToString(); + //"UN1H1/Y2.0/170/23 USA/+AA1964" + + + return true; + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + return false; + } + + } + else + { + return false; + } + } + } +} diff --git a/SlnMesnac.LabelPrint.FileOperate/FileHelper.cs b/SlnMesnac.LabelPrint.FileOperate/FileHelper.cs index d0c00d0..a65036f 100644 --- a/SlnMesnac.LabelPrint.FileOperate/FileHelper.cs +++ b/SlnMesnac.LabelPrint.FileOperate/FileHelper.cs @@ -36,6 +36,12 @@ namespace SlnMesnac.LabelPrint.FileOperate List result = null; try { + string fileName = GetFileName(filePath); + if (string.IsNullOrEmpty(fileName)) + { + return result; + } + var sheetNames = MiniExcel.GetSheetNames(filePath); if (sheetNames != null) @@ -56,13 +62,9 @@ namespace SlnMesnac.LabelPrint.FileOperate dynamic labelDynamic = info[i]; BaseLabelInfo labelInfo = new BaseLabelInfo(); labelInfo.label = labelDynamic; - labelInfo.productType = sheetName; - if(labelDynamic.A == null) - { - continue; - } + labelInfo.productType = fileName; labelInfo.column_A = labelDynamic.A; - if (sheetName == "Pallet") + if (fileName == "Pallet") { labelInfo.recordTime = DateTime.Now; result.Add(labelInfo); @@ -71,20 +73,34 @@ namespace SlnMesnac.LabelPrint.FileOperate labelInfo.column_B = labelDynamic.B; labelInfo.column_C = labelDynamic.C; labelInfo.column_D = labelDynamic.D; - labelInfo.column_E = labelDynamic.E; - if (sheetName == "Unit") + if(fileName == "Gas" || fileName == "TF" || fileName == "Drum") { labelInfo.recordTime = DateTime.Now; result.Add(labelInfo); continue; } - labelInfo.column_F = labelDynamic.F; - labelInfo.column_G = labelDynamic.G; - labelInfo.column_H = labelDynamic.H; - labelInfo.column_I = labelDynamic.I; - labelInfo.column_J = labelDynamic.J; - labelInfo.recordTime = DateTime.Now; - result.Add(labelInfo); + labelInfo.column_E = labelDynamic.E; + if (fileName == "Unit") + { + if (labelInfo.column_D == null) + { + continue; + } + else + { + labelInfo.recordTime = DateTime.Now; + result.Add(labelInfo); + continue; + } + + } + //labelInfo.column_F = labelDynamic.F; + //labelInfo.column_G = labelDynamic.G; + //labelInfo.column_H = labelDynamic.H; + //labelInfo.column_I = labelDynamic.I; + //labelInfo.column_J = labelDynamic.J; + //labelInfo.recordTime = DateTime.Now; + //result.Add(labelInfo); } } } @@ -97,5 +113,38 @@ namespace SlnMesnac.LabelPrint.FileOperate return result; } + + /// + /// 获取产品型号 + /// + /// + /// + private string GetFileName(string filePath) + { + if (filePath.Contains("Gas")) + { + return "Gas"; + }else if (filePath.Contains("TF")) + { + return "TF"; + } + else if (filePath.Contains("Drum")) + { + return "Drum"; + } + else if (filePath.Contains("Unit")) + { + return "Unit"; + } + else if (filePath.Contains("Pallet")) + { + return "Pallet"; + } + else + { + return string.Empty; + } + + } } } diff --git a/SlnMesnac.LabelPrint.Log4net/LogHelper.cs b/SlnMesnac.LabelPrint.Log4net/LogHelper.cs index 743068d..63b7b1b 100644 --- a/SlnMesnac.LabelPrint.Log4net/LogHelper.cs +++ b/SlnMesnac.LabelPrint.Log4net/LogHelper.cs @@ -32,7 +32,7 @@ namespace SlnMesnac.LabelPrint.Log4net * */ //private readonly string fileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "log4net.config"); - private readonly string fileName = "C:\\项目代码\\RFID标签打印项目\\SlnMesnac.LabelPrint\\SlnMesnac.LabelPrint.Log4net\\config\\log4net.config"; + private readonly string fileName = "D:\\project\\RFID标签打印项目\\SlnMesnac.LabelPrint\\SlnMesnac.LabelPrint.Log4net\\config\\log4net.config"; private LogHelper() { diff --git a/SlnMesnac.LabelPrint.Timer/PrintTimer.cs b/SlnMesnac.LabelPrint.Timer/PrintTimer.cs index a8653bc..2c88650 100644 --- a/SlnMesnac.LabelPrint.Timer/PrintTimer.cs +++ b/SlnMesnac.LabelPrint.Timer/PrintTimer.cs @@ -18,7 +18,7 @@ namespace SlnMesnac.LabelPrint.Timer private readonly PrintManager printManager = PrintManager.Instance; private readonly JsonChange jsonChange = JsonChange.Instance; - private System.Timers.Timer timer = new System.Timers.Timer(2000); + private System.Timers.Timer timer = new System.Timers.Timer(5000); /// /// 日志刷新 @@ -121,7 +121,7 @@ namespace SlnMesnac.LabelPrint.Timer timer.Stop(); timer.Close(); timer.Dispose(); - timer = new System.Timers.Timer(2000); + timer = new System.Timers.Timer(5000); } result = true; } diff --git a/SlnMesnac.LabelPrint/MainWindow.xaml b/SlnMesnac.LabelPrint/MainWindow.xaml index 69c76b5..505aae2 100644 --- a/SlnMesnac.LabelPrint/MainWindow.xaml +++ b/SlnMesnac.LabelPrint/MainWindow.xaml @@ -57,11 +57,11 @@ - + diff --git a/SlnMesnac.LabelPrint/viewModel/MainWindowViewModel.cs b/SlnMesnac.LabelPrint/viewModel/MainWindowViewModel.cs index 0833d59..f2db8ea 100644 --- a/SlnMesnac.LabelPrint/viewModel/MainWindowViewModel.cs +++ b/SlnMesnac.LabelPrint/viewModel/MainWindowViewModel.cs @@ -103,7 +103,7 @@ namespace SlnMesnac.LabelPrint.viewModel OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Multiselect = true; //该值确定是否可以选择多个文件 openFileDialog.Title = "请选择文件"; //弹窗的标题 - openFileDialog.InitialDirectory = "D:\\"; //默认打开的文件夹的位置 + openFileDialog.InitialDirectory = "C:\\Users\\Administrator\\Desktop"; //默认打开的文件夹的位置 openFileDialog.Filter = "MicroSoft Excel文件(*.xlsx)|*.xlsx|所有文件(*.*)|*.*"; //筛选文件 if (openFileDialog.ShowDialog() == true)