30 lines
1.0 KiB
C#
30 lines
1.0 KiB
C#
using Inspectron.Epson.PrintServer.Printers.Utils.OrderItems;
|
|
|
|
namespace Inspectron.Epson.PrintServer.Printers.Utils;
|
|
|
|
public class ReceiptConverterFactory : IReceiptConverterFactory
|
|
{
|
|
public IReceiptConverter Create(int receiptType, byte printerId)
|
|
{
|
|
return (EReceiptType)receiptType switch
|
|
{
|
|
EReceiptType.Receipt => new FinalReceipt.FinalReceiptConverter(48, 24),
|
|
EReceiptType.WorkareaTicket => printerId switch
|
|
{
|
|
0x01=>new KitchenReceipt.KitchenReceiptConverterAdapter(48, 24),
|
|
_=> new KitchenReceipt.KitchenReceiptConverterAdapter(33, 20),
|
|
},
|
|
EReceiptType.NextCourse => new KitchenReceipt.KitchenReceiptConverterAdapter(33, 20),
|
|
EReceiptType.OrdersOverview => new OrderItemsReceiptConverter(48, 24),
|
|
_ => throw new ArgumentException($"Unknown receipt type: {receiptType}")
|
|
};
|
|
}
|
|
public enum EReceiptType
|
|
{
|
|
Receipt,
|
|
WorkareaTicket,
|
|
NextCourse,
|
|
OrdersOverview
|
|
}
|
|
}
|