Commit 5d993d2e 刘韬

添加TSC打印机支持

1 个父辈 feb17f26
...@@ -23,9 +23,17 @@ namespace DeviceLibrary ...@@ -23,9 +23,17 @@ namespace DeviceLibrary
public bool Connection(string port) { public bool Connection(string port) {
Port = port; Port = port;
if (port.ToLower()=="usb") if (port.ToLower() == "usb")
zebraManger = new ZebraPrinterHelper.ZebraManger("", ZebraPrinterHelper.ConnectionType.UsbDirect); zebraManger = new ZebraPrinterHelper.ZebraManger("", ZebraPrinterHelper.ConnectionType.UsbDirect);
else else
if (port.ToLower().Contains("tsc"))
{
zebraManger = null;
print = new Asa.PrintLabel(Application.StartupPath + "\\Label", 100);
print.Printer(port, false);
return true;
}
else
zebraManger = new ZebraPrinterHelper.ZebraManger(Port, ZebraPrinterHelper.ConnectionType.Network); zebraManger = new ZebraPrinterHelper.ZebraManger(Port, ZebraPrinterHelper.ConnectionType.Network);
if (!zebraManger.Connection(out string msg)) if (!zebraManger.Connection(out string msg))
{ {
...@@ -67,6 +75,8 @@ namespace DeviceLibrary ...@@ -67,6 +75,8 @@ namespace DeviceLibrary
bool Print(string labelname,Dictionary<string, string> data,out string msg) { bool Print(string labelname,Dictionary<string, string> data,out string msg) {
msg = ""; msg = "";
print.LoadLabel(labelname); print.LoadLabel(labelname);
if (zebraManger != null)
{
var bmp = print.PrintPreview(data); var bmp = print.PrintPreview(data);
//LogUtil.info("标签图像生成"); //LogUtil.info("标签图像生成");
//bmp.Save("currentlabel.bmp"); //bmp.Save("currentlabel.bmp");
...@@ -88,6 +98,11 @@ namespace DeviceLibrary ...@@ -88,6 +98,11 @@ namespace DeviceLibrary
{ {
bmp.Dispose(); bmp.Dispose();
} }
}
else
{
print.Print(data);
}
return true; return true;
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!