This commit is contained in:
qianjiawei
2023-12-22 14:27:17 +08:00
parent 5c9a27f848
commit 7ede7e4f08
2 changed files with 31 additions and 34 deletions

View File

@@ -222,7 +222,7 @@ namespace Tnb.WarehouseMgr
/// <param name="copies">打印份数</param>
/// <returns></returns>
[NonAction]
protected void BarCodePrint(List<string> barCodes,int copies)
protected void BarCodePrint(List<string> barCodes,int copies,string ip)
{
TaskCompletionSource tcs = new();
// open port.
@@ -281,28 +281,28 @@ namespace Tnb.WarehouseMgr
}
else
{
//ret = PPLBUtility.B_CreatePrn(13, "192.168.1.233");
_ = System.IO.Directory.CreateDirectory(PPLBUtility.szSavePath);
ret = PPLBUtility.B_CreatePrn(0, PPLBUtility.szSaveFile);// open file.
strmsg += "Open ";
strmsg += PPLBUtility.szSaveFile;
if (0 != ret)
{
strmsg += " file fail!";
}
else
{
strmsg += " file succeed!";
}
ret = PPLBUtility.B_CreatePrn(13, ip);
}
/* else
{
_ = System.IO.Directory.CreateDirectory(PPLBUtility.szSavePath);
ret = PPLBUtility.B_CreatePrn(0, PPLBUtility.szSaveFile);// open file.
strmsg += "Open ";
strmsg += PPLBUtility.szSaveFile;
if (0 != ret)
{
strmsg += " file fail!";
}
else
{
strmsg += " file succeed!";
}
}*/
if (0 != ret)
{
return;
}
// sample setting.
_ = PPLBUtility.B_Set_Originpoint(0, 0);
_ = PPLBUtility.B_Select_Option(2);
@@ -321,13 +321,15 @@ namespace Tnb.WarehouseMgr
{
for (int i = 0; i < copies; i++)
{
//print text, true type text.
_ = PPLBUtility.B_Prn_Text(150, 50, 0, 2, 2, 2, 'N', code);
//barcode.
_ = PPLBUtility.B_Prn_Barcode(50, 100, 0, "1", 3, 5, 70, 'N', code);//have a counter
// output.
_ = PPLBUtility.B_Print_Out(1);// copy 2.
}
// _ = PPLBUtility.B_Prn_Text(50, 90, 0, 2, 2, 2, 'N', code);
// _ = PPLBUtility.B_Prn_Barcode(50, 270, 0, "1", 3, 5, 70, 'N', code);
_ = PPLBUtility.B_Prn_Text(50, 100, 0, 2, 2, 2, 'N', code);
_ = PPLBUtility.B_Prn_Barcode(50, 150, 0, "1", 3, 5, 100, 'N', code);
_ = PPLBUtility.B_Prn_Text(50, 305, 0, 2, 2, 2, 'N', code);
_ = PPLBUtility.B_Print_Out(1);
}
}
}
catch (Exception ex)