This commit is contained in:
atvstdla
2025-09-25 08:23:36 +09:00
parent ee122a6daf
commit a34dbecfb9
10 changed files with 1574 additions and 1584 deletions

View File

@@ -62,7 +62,7 @@ namespace Project.Device
_isopen = true;
return _isopen;
}
catch { _isopen = false; return false; }
catch(Exception ex) { _isopen = false; return false; }
}
private string ControlCharReplace(string data)
@@ -219,7 +219,7 @@ namespace Project.Device
// PUB.log.Add($"SATO Recv : " + e.StrValue);
//}
public Boolean TestPrint(Boolean drawbox, string manu = "", string mfgdate = "")
public (Boolean result, string errmessage) TestPrint(Boolean drawbox, string manu = "", string mfgdate = "")
{
var dtstr = DateTime.Now.ToShortDateString();
var printcode = "103077807;Z577603504;105-35282-1105;15000;RC00004A219001W;20210612";
@@ -243,7 +243,7 @@ namespace Project.Device
}
public Boolean Print(Class.Reel reel, Boolean display1drid, Boolean drawOUtBox)
public (Boolean result, string errmessage) Print(Class.Reel reel, Boolean display1drid, Boolean drawOUtBox)
{
string prtData;
prtData = makeZPL_210908(reel, drawOUtBox, out qrData);
@@ -251,19 +251,18 @@ namespace Project.Device
return Print(prtData);
}
public bool Print(string _zpl)
public (Boolean result, string errmessage) Print(string _zpl)
{
this.LastPrintZPL = _zpl;
//if (this.IsOpen == false) return false;
try
{
byte[] cmddata = Utils.StringToByteArray(ControlCharReplace(_zpl));
SATOPrinter.Send(cmddata);
return true;
return (true,"");
}
catch (Exception ex)
{
return false;
return (false,ex.Message);
}
}

View File

@@ -231,7 +231,7 @@ namespace Project
}
catch (Exception ex)
{
PUB.log.AddE($"Printer(L) {ex.Message}");
}
}
else
@@ -260,7 +260,9 @@ namespace Project
PUB.PrinterR.Open();
PrintRConTime = DateTime.Now;
}
catch (Exception ex) { }
catch (Exception ex) {
PUB.log.AddE($"Printer(R) {ex.Message}");
}
}
else
{