|
|
@ -14,6 +14,7 @@ namespace SlnMesnac.LabelPrint.BarTender
|
|
|
|
public class PrintManager
|
|
|
|
public class PrintManager
|
|
|
|
{
|
|
|
|
{
|
|
|
|
private LogHelper logHelper = LogHelper.Instance;
|
|
|
|
private LogHelper logHelper = LogHelper.Instance;
|
|
|
|
|
|
|
|
private string modelPath = "";
|
|
|
|
#region 单例实现
|
|
|
|
#region 单例实现
|
|
|
|
private static readonly Lazy<PrintManager> lazy = new Lazy<PrintManager>(() => new PrintManager());
|
|
|
|
private static readonly Lazy<PrintManager> lazy = new Lazy<PrintManager>(() => new PrintManager());
|
|
|
|
|
|
|
|
|
|
|
@ -26,7 +27,11 @@ namespace SlnMesnac.LabelPrint.BarTender
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
public PrintManager() { }
|
|
|
|
public PrintManager()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
modelPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory);
|
|
|
|
|
|
|
|
Console.WriteLine(modelPath);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 标签打印
|
|
|
|
/// 标签打印
|
|
|
@ -98,7 +103,7 @@ namespace SlnMesnac.LabelPrint.BarTender
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool result = false;
|
|
|
|
bool result = false;
|
|
|
|
PrintEquip equip = new GasLabelPrintEquip();
|
|
|
|
PrintEquip equip = new GasLabelPrintEquip();
|
|
|
|
equip.tempPath = "C:\\temp\\bartender打印模板\\Gas.btw";
|
|
|
|
equip.tempPath = modelPath + "lableTemplate\\Gas.btw";
|
|
|
|
equip.ParaClass = labelInfo;
|
|
|
|
equip.ParaClass = labelInfo;
|
|
|
|
equip.Open();
|
|
|
|
equip.Open();
|
|
|
|
result = equip.print();
|
|
|
|
result = equip.print();
|
|
|
@ -114,7 +119,7 @@ namespace SlnMesnac.LabelPrint.BarTender
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool result = false;
|
|
|
|
bool result = false;
|
|
|
|
PrintEquip equip = new TFLabelPrintEquip();
|
|
|
|
PrintEquip equip = new TFLabelPrintEquip();
|
|
|
|
equip.tempPath = "C:\\temp\\bartender打印模板\\TF.btw";
|
|
|
|
equip.tempPath = modelPath + "lableTemplate\\TF.btw";
|
|
|
|
equip.ParaClass = labelInfo;
|
|
|
|
equip.ParaClass = labelInfo;
|
|
|
|
equip.Open();
|
|
|
|
equip.Open();
|
|
|
|
result = equip.print();
|
|
|
|
result = equip.print();
|
|
|
@ -130,7 +135,7 @@ namespace SlnMesnac.LabelPrint.BarTender
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool result = false;
|
|
|
|
bool result = false;
|
|
|
|
PrintEquip equip = new DrumLabelPrintEquip();
|
|
|
|
PrintEquip equip = new DrumLabelPrintEquip();
|
|
|
|
equip.tempPath = "C:\\temp\\bartender打印模板\\Drum.btw";
|
|
|
|
equip.tempPath = modelPath + "lableTemplate\\Drum.btw";
|
|
|
|
equip.ParaClass = labelInfo;
|
|
|
|
equip.ParaClass = labelInfo;
|
|
|
|
equip.Open();
|
|
|
|
equip.Open();
|
|
|
|
result = equip.print();
|
|
|
|
result = equip.print();
|
|
|
@ -143,7 +148,7 @@ namespace SlnMesnac.LabelPrint.BarTender
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool result = false;
|
|
|
|
bool result = false;
|
|
|
|
PrintEquip equip = new UnitLabelPrintEquip();
|
|
|
|
PrintEquip equip = new UnitLabelPrintEquip();
|
|
|
|
equip.tempPath = "C:\\temp\\bartender打印模板\\Unit.btw";
|
|
|
|
equip.tempPath = modelPath + "lableTemplate\\Unit.btw";
|
|
|
|
equip.ParaClass = labelInfo;
|
|
|
|
equip.ParaClass = labelInfo;
|
|
|
|
equip.Open();
|
|
|
|
equip.Open();
|
|
|
|
result = equip.print();
|
|
|
|
result = equip.print();
|
|
|
@ -156,7 +161,7 @@ namespace SlnMesnac.LabelPrint.BarTender
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool result = false;
|
|
|
|
bool result = false;
|
|
|
|
PrintEquip equip = new PalletLabelPrintEquip();
|
|
|
|
PrintEquip equip = new PalletLabelPrintEquip();
|
|
|
|
equip.tempPath = "C:\\temp\\bartender打印模板\\Pallet.btw";
|
|
|
|
equip.tempPath = modelPath + "lableTemplate\\Pallet.btw";
|
|
|
|
equip.ParaClass = labelInfo;
|
|
|
|
equip.ParaClass = labelInfo;
|
|
|
|
equip.Open();
|
|
|
|
equip.Open();
|
|
|
|
result = equip.print();
|
|
|
|
result = equip.print();
|
|
|
|