cập nhật trạng thái máy in
cập nhật trạng thái DE70
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Custom.CuCustomWndAPI;
|
||||
using HandyControl.Data;
|
||||
using Microsoft.IdentityModel.Abstractions;
|
||||
using SafeBagDE70.API;
|
||||
using Serilog;
|
||||
using System;
|
||||
@@ -28,9 +29,9 @@ namespace SafeBagDE70.Services
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Information("[PRINTER] Không thể khởi tạo máy in");
|
||||
Log.Fatal(ex,"[PRINTER] Không thể khởi tạo máy in");
|
||||
|
||||
AppData.DeviceStatus.PrinterStatus = 3;
|
||||
AppData.DeviceStatus.PrinterStatus = (int)PrinterStatusCode.ERROR;
|
||||
AppData.DeviceStatus.Description = "[PRINTER] Không thể khởi tạo máy in";
|
||||
APIModels.SendEvent(AppData.DeviceStatus);
|
||||
}
|
||||
@@ -38,13 +39,19 @@ namespace SafeBagDE70.Services
|
||||
|
||||
public PrinterStatus? GetStatus()
|
||||
{
|
||||
if(dev!=null)
|
||||
try
|
||||
{
|
||||
var status = dev.GetPrinterFullStatus();
|
||||
return status;
|
||||
if (dev != null)
|
||||
{
|
||||
var status = dev.GetPrinterFullStatus();
|
||||
return status;
|
||||
}
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
Log.Fatal(ex, "Get Printer Status");
|
||||
}
|
||||
return null;
|
||||
|
||||
}
|
||||
public bool IsNearPaperOut()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user