refactor Queue namespace
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
using Inspectron.Epson;
|
using Inspectron.Epson;
|
||||||
using Inspectron.Epson.PrintServer.ConfigurationSources;
|
using Inspectron.Epson.PrintServer.ConfigurationSources;
|
||||||
|
using Inspectron.Epson.Queue;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace EpsonPrintService;
|
namespace EpsonPrintService;
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ using Inspectron.Epson.PrintServer.Printers;
|
|||||||
using Inspectron.Epson.PrintServer.Printers.Utils;
|
using Inspectron.Epson.PrintServer.Printers.Utils;
|
||||||
using Inspectron.Epson.PrintServer.PrintServices;
|
using Inspectron.Epson.PrintServer.PrintServices;
|
||||||
using EpsonPrintService;
|
using EpsonPrintService;
|
||||||
|
using Inspectron.Epson.Queue;
|
||||||
|
|
||||||
StandardKernel kernel = new StandardKernel();
|
StandardKernel kernel = new StandardKernel();
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
namespace Inspectron.Epson.PrintServer;
|
using Inspectron.Epson.Queue;
|
||||||
|
|
||||||
|
namespace Inspectron.Epson.PrintServer;
|
||||||
|
|
||||||
public interface IPrintJobSource
|
public interface IPrintJobSource
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using System.Threading.Channels;
|
using System.Threading.Channels;
|
||||||
using Inspectron.Epson.PrintServer.ConfigurationSources;
|
using Inspectron.Epson.PrintServer.ConfigurationSources;
|
||||||
|
using Inspectron.Epson.Queue;
|
||||||
using Microsoft.AspNetCore.SignalR.Client;
|
using Microsoft.AspNetCore.SignalR.Client;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Threading.Channels;
|
using System.Threading.Channels;
|
||||||
|
using Inspectron.Epson.Queue;
|
||||||
|
|
||||||
namespace Inspectron.Epson.PrintServer.JobSources;
|
namespace Inspectron.Epson.PrintServer.JobSources;
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
using Inspectron.Epson.PrintServer.PrintServices;
|
using Inspectron.Epson.PrintServer.PrintServices;
|
||||||
|
using Inspectron.Epson.Queue;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace Inspectron.Epson.PrintServer;
|
namespace Inspectron.Epson.PrintServer;
|
||||||
|
|
||||||
public class PrintLoop
|
public class PrintLoop
|
||||||
{
|
{
|
||||||
private readonly global::PrintServer _printServer;
|
private readonly global::Inspectron.Epson.Queue.PrintServer _printServer;
|
||||||
private readonly IPrintService _printService;
|
private readonly IPrintService _printService;
|
||||||
private readonly IPrintJobSource _jobSource;
|
private readonly IPrintJobSource _jobSource;
|
||||||
|
|
||||||
@@ -13,7 +14,7 @@ public class PrintLoop
|
|||||||
private CancellationTokenSource? _cancellationSource;
|
private CancellationTokenSource? _cancellationSource;
|
||||||
private CancellationToken _cancellationToken;
|
private CancellationToken _cancellationToken;
|
||||||
|
|
||||||
public PrintLoop(global::PrintServer printServer,IPrintService printService, IPrintJobSource jobSource, ILogger logger)
|
public PrintLoop(global::Inspectron.Epson.Queue.PrintServer printServer,IPrintService printService, IPrintJobSource jobSource, ILogger logger)
|
||||||
{
|
{
|
||||||
_printServer = printServer;
|
_printServer = printServer;
|
||||||
_printService = printService;
|
_printService = printService;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Inspectron.Epson.PrintServer.Printers;
|
using Inspectron.Epson.PrintServer.Printers;
|
||||||
using Inspectron.Epson.PrintServer.Printers.Utils;
|
using Inspectron.Epson.PrintServer.Printers.Utils;
|
||||||
|
using Inspectron.Epson.Queue;
|
||||||
|
|
||||||
namespace Inspectron.Epson.PrintServer.PrintServices;
|
namespace Inspectron.Epson.PrintServer.PrintServices;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System.Threading.Tasks;
|
namespace Inspectron.Epson.Queue;
|
||||||
|
|
||||||
public interface IJobStatusReporter
|
public interface IJobStatusReporter
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System.Threading.Tasks;
|
namespace Inspectron.Epson.Queue;
|
||||||
|
|
||||||
public interface IPrintService
|
public interface IPrintService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System.Threading.Tasks;
|
namespace Inspectron.Epson.Queue;
|
||||||
|
|
||||||
public class NullJobStatusReporter : IJobStatusReporter
|
public class NullJobStatusReporter : IJobStatusReporter
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
namespace Inspectron.Epson.Queue;
|
||||||
|
|
||||||
public enum PrintErrorType
|
public enum PrintErrorType
|
||||||
{
|
{
|
||||||
None,
|
None,
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
using static Inspectron.Epson.PrintServer.JobSources.SignalRPrintJobSource;
|
using static Inspectron.Epson.PrintServer.JobSources.SignalRPrintJobSource;
|
||||||
|
|
||||||
|
namespace Inspectron.Epson.Queue;
|
||||||
|
|
||||||
public class PrintJob
|
public class PrintJob
|
||||||
{
|
{
|
||||||
// todo: change to ip address
|
// todo: change to ip address
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
namespace Inspectron.Epson.Queue;
|
||||||
|
|
||||||
public enum PrintJobStatus
|
public enum PrintJobStatus
|
||||||
{
|
{
|
||||||
Received,
|
Received,
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
namespace Inspectron.Epson.Queue;
|
||||||
|
|
||||||
public class PrintResult
|
public class PrintResult
|
||||||
{
|
{
|
||||||
public bool Success { get; }
|
public bool Success { get; }
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
|
namespace Inspectron.Epson.Queue;
|
||||||
|
|
||||||
public class PrintServer
|
public class PrintServer
|
||||||
{
|
{
|
||||||
private readonly IPrintService _printService;
|
private readonly IPrintService _printService;
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
using System;
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Concurrent;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
|
namespace Inspectron.Epson.Queue;
|
||||||
|
|
||||||
public class PrinterQueue
|
public class PrinterQueue
|
||||||
{
|
{
|
||||||
public string PrinterIp { get; }
|
public string PrinterIp { get; }
|
||||||
@@ -140,4 +138,3 @@ public class PrinterQueue
|
|||||||
return new List<PrintJob>(_queue);
|
return new List<PrintJob>(_queue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user