size to kitchen

printer logs removed
This commit is contained in:
EugeneTes
2026-02-05 11:39:06 +01:00
parent f0ae32c9e5
commit e8d20c77c7
6 changed files with 11 additions and 10 deletions

View File

@@ -314,6 +314,7 @@ public static class TestHelpers
receipt.Gangs[0].Dishes.Add(new Dish(1, "Avocado Sashimi") receipt.Gangs[0].Dishes.Add(new Dish(1, "Avocado Sashimi")
{ {
Size = "XL",
Modifications = new DishModifications Modifications = new DishModifications
{ {
Removed = new List<string> { "Wasabi" }, Removed = new List<string> { "Wasabi" },

View File

@@ -112,7 +112,7 @@ public class DiscoveryService : IDiscoveryService
{ {
_logger?.LogDebug("Connecting to printer at {IP} to retrieve model", ipAddress); _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); await epsonPrinter.ConnectAsync(ipAddress, port, timeoutSeconds: 3);
var printerId = await epsonPrinter.GetPrinterIdAsync(); var printerId = await epsonPrinter.GetPrinterIdAsync();

View File

@@ -41,7 +41,7 @@ public class EpsonDiagnostics
_logger?.LogInformation("Starting diagnostics for printer at {Ip}:{Port}", ip, port); _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 // Connect to printer
report.AppendLine(); report.AppendLine();

View File

@@ -13,6 +13,6 @@ public class EpsonPrinterFactory:IPrinterFactory
public IEpsonPrinter CreatePrinter() public IEpsonPrinter CreatePrinter()
{ {
return new EpsonPrinter(_logger); return new EpsonPrinter();
} }
} }

View File

@@ -107,6 +107,11 @@ public class KitchenReceiptConverter
string fullPrefix = guestInfo + quantityPrefix; string fullPrefix = guestInfo + quantityPrefix;
string fullLine = fullPrefix + dish.Name; string fullLine = fullPrefix + dish.Name;
if (!string.IsNullOrEmpty(dish.Size))
{
fullLine+= $" ({dish.Size})";
}
if (fullLine.Length <= _lineWidth || string.IsNullOrEmpty(dish.Name)) if (fullLine.Length <= _lineWidth || string.IsNullOrEmpty(dish.Name))
{ {
commands.Add(new PrintCommand(fullLine) { IsTall = true }); commands.Add(new PrintCommand(fullLine) { IsTall = true });
@@ -158,6 +163,7 @@ public class KitchenReceiptConverter
} }
} }
} }
// Modifications // Modifications
if (dish.Modifications != null && (dish.Modifications.Removed.Any() || dish.Modifications.Added.Any())) if (dish.Modifications != null && (dish.Modifications.Removed.Any() || dish.Modifications.Added.Any()))
{ {

View File

@@ -68,20 +68,14 @@
/// </summary> /// </summary>
public class Dish public class Dish
{ {
/// <summary>
/// Number ordered
/// </summary>
public int Number { get; set; } public int Number { get; set; }
/// <summary>
/// Name of the dish
/// </summary>
public string Name { get; set; } public string Name { get; set; }
public Dish(){} public Dish(){}
public int? GuestId { get; set; } public int? GuestId { get; set; }
public string Size { get; set; }
public Dish(int number, string name) public Dish(int number, string name)
{ {
Number = number; Number = number;