From e8d20c77c772c8687fb786597be99de9e46b0872 Mon Sep 17 00:00:00 2001 From: EugeneTes Date: Thu, 5 Feb 2026 11:39:06 +0100 Subject: [PATCH] size to kitchen printer logs removed --- EpsonTest/TestHelpers.cs | 1 + Inspectron.Epson/DiscoveryService.cs | 2 +- Inspectron.Epson/EpsonDiagnostics.cs | 2 +- .../PrintServer/Printers/EpsonPrinterFactory.cs | 2 +- .../Utils/KitchenReceipt/KitchenReceiptConverter.cs | 6 ++++++ .../PrintServer/Printers/Utils/KitchenReceipt/Models.cs | 8 +------- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/EpsonTest/TestHelpers.cs b/EpsonTest/TestHelpers.cs index f2ff269..3293bc6 100644 --- a/EpsonTest/TestHelpers.cs +++ b/EpsonTest/TestHelpers.cs @@ -314,6 +314,7 @@ public static class TestHelpers receipt.Gangs[0].Dishes.Add(new Dish(1, "Avocado Sashimi") { + Size = "XL", Modifications = new DishModifications { Removed = new List { "Wasabi" }, diff --git a/Inspectron.Epson/DiscoveryService.cs b/Inspectron.Epson/DiscoveryService.cs index 801d154..cbbd9ee 100644 --- a/Inspectron.Epson/DiscoveryService.cs +++ b/Inspectron.Epson/DiscoveryService.cs @@ -112,7 +112,7 @@ public class DiscoveryService : IDiscoveryService { _logger?.LogDebug("Connecting to printer at {IP} to retrieve model", ipAddress); - await using var epsonPrinter = new EpsonPrinter(_logger); + await using var epsonPrinter = new EpsonPrinter(); await epsonPrinter.ConnectAsync(ipAddress, port, timeoutSeconds: 3); var printerId = await epsonPrinter.GetPrinterIdAsync(); diff --git a/Inspectron.Epson/EpsonDiagnostics.cs b/Inspectron.Epson/EpsonDiagnostics.cs index 9f0e693..bf5dbdb 100644 --- a/Inspectron.Epson/EpsonDiagnostics.cs +++ b/Inspectron.Epson/EpsonDiagnostics.cs @@ -41,7 +41,7 @@ public class EpsonDiagnostics _logger?.LogInformation("Starting diagnostics for printer at {Ip}:{Port}", ip, port); - await using var printer = new EpsonPrinter(_logger); + await using var printer = new EpsonPrinter(); // Connect to printer report.AppendLine(); diff --git a/Inspectron.Epson/PrintServer/Printers/EpsonPrinterFactory.cs b/Inspectron.Epson/PrintServer/Printers/EpsonPrinterFactory.cs index dd6b572..3b2f709 100644 --- a/Inspectron.Epson/PrintServer/Printers/EpsonPrinterFactory.cs +++ b/Inspectron.Epson/PrintServer/Printers/EpsonPrinterFactory.cs @@ -13,6 +13,6 @@ public class EpsonPrinterFactory:IPrinterFactory public IEpsonPrinter CreatePrinter() { - return new EpsonPrinter(_logger); + return new EpsonPrinter(); } } \ No newline at end of file diff --git a/Inspectron.Epson/PrintServer/Printers/Utils/KitchenReceipt/KitchenReceiptConverter.cs b/Inspectron.Epson/PrintServer/Printers/Utils/KitchenReceipt/KitchenReceiptConverter.cs index 2176ff8..3a4c795 100644 --- a/Inspectron.Epson/PrintServer/Printers/Utils/KitchenReceipt/KitchenReceiptConverter.cs +++ b/Inspectron.Epson/PrintServer/Printers/Utils/KitchenReceipt/KitchenReceiptConverter.cs @@ -107,6 +107,11 @@ public class KitchenReceiptConverter string fullPrefix = guestInfo + quantityPrefix; string fullLine = fullPrefix + dish.Name; + if (!string.IsNullOrEmpty(dish.Size)) + { + fullLine+= $" ({dish.Size})"; + } + if (fullLine.Length <= _lineWidth || string.IsNullOrEmpty(dish.Name)) { commands.Add(new PrintCommand(fullLine) { IsTall = true }); @@ -158,6 +163,7 @@ public class KitchenReceiptConverter } } } + // Modifications if (dish.Modifications != null && (dish.Modifications.Removed.Any() || dish.Modifications.Added.Any())) { diff --git a/Inspectron.Epson/PrintServer/Printers/Utils/KitchenReceipt/Models.cs b/Inspectron.Epson/PrintServer/Printers/Utils/KitchenReceipt/Models.cs index 189f519..131f752 100644 --- a/Inspectron.Epson/PrintServer/Printers/Utils/KitchenReceipt/Models.cs +++ b/Inspectron.Epson/PrintServer/Printers/Utils/KitchenReceipt/Models.cs @@ -68,20 +68,14 @@ /// public class Dish { - /// - /// Number ordered - /// public int Number { get; set; } - /// - /// Name of the dish - /// public string Name { get; set; } public Dish(){} public int? GuestId { get; set; } - + public string Size { get; set; } public Dish(int number, string name) { Number = number;