..
This commit is contained in:
@@ -10,6 +10,7 @@ using System.Threading.Tasks;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Runtime.InteropServices;
|
||||
using AR;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace Project.Device
|
||||
{
|
||||
@@ -323,7 +324,30 @@ namespace Project.Device
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public bool BSave(int no)
|
||||
{
|
||||
var cmd = "BSAVE,{no}";
|
||||
try
|
||||
{
|
||||
ws.Send(cmd + "\r");
|
||||
return true;
|
||||
}
|
||||
catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public bool BLoad(int no)
|
||||
{
|
||||
var cmd = "BLOAD,{no}";
|
||||
try
|
||||
{
|
||||
ws.Send(cmd + "\r");
|
||||
return true;
|
||||
}
|
||||
catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public void Trigger(bool bOn)
|
||||
{
|
||||
//if (IsTriggerOn) return;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using AR;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -10,7 +11,7 @@ namespace Project.Device
|
||||
{
|
||||
public string LastPrintZPL = string.Empty;
|
||||
public string qrData = string.Empty;
|
||||
public string ZPLFileName { get; set; } = "zpl.txt";
|
||||
public string ZPLFileName { get; set; } = UTIL.MakePath("data","zpl.txt");
|
||||
public string baseZPL
|
||||
{
|
||||
get
|
||||
@@ -19,7 +20,7 @@ namespace Project.Device
|
||||
if (fi.Exists == false || fi.Length == 0)
|
||||
{
|
||||
PUB.log.AddE($"{ZPLFileName} does not exist or has no data. Changed to default zpl.txt");
|
||||
fi = new System.IO.FileInfo("zpl.txt");
|
||||
fi = new System.IO.FileInfo( UTIL.MakePath("data", "zpl.txt"));
|
||||
if (fi.Exists == false) PUB.log.AddE("Print template file (zpl.txt) does not exist");
|
||||
}
|
||||
if (fi.Exists && fi.Length > 1)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Project.Device
|
||||
public string PortName { get; set; }
|
||||
public int BaudRate { get; set; }
|
||||
|
||||
public string ZPLFileName { get; set; } = "zpl.txt";
|
||||
public string ZPLFileName { get; set; } = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Data", "zpl.txt");
|
||||
public string baseZPL
|
||||
{
|
||||
get
|
||||
@@ -28,7 +28,7 @@ namespace Project.Device
|
||||
if (fi.Exists == false || fi.Length == 0)
|
||||
{
|
||||
PUB.log.AddE($"{ZPLFileName} does not exist or has no data. Changed to default zpl.txt");
|
||||
fi = new System.IO.FileInfo("zpl.txt");
|
||||
fi = new System.IO.FileInfo(UTIL.MakePath("Data", "zpl.txt"));
|
||||
if (fi.Exists == false) PUB.log.AddE("Print template file (zpl.txt) does not exist");
|
||||
}
|
||||
if (fi.Exists && fi.Length > 1)
|
||||
@@ -38,7 +38,7 @@ namespace Project.Device
|
||||
PUB.log.AddAT("No ZPL file found, using ZPL code from settings");
|
||||
return Properties.Settings.Default.ZPL7;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user