experiments for the new client

This commit is contained in:
EugeneTes
2026-01-21 11:59:13 +01:00
parent 5cef04bf92
commit 729679d283
5 changed files with 903 additions and 18 deletions

View File

@@ -318,9 +318,9 @@ public class EpsonPrinter : IEpsonPrinter
byte value = 0x00;
if (biggerWidth)
value += 0x10;
if (biggerHeight)
value += 0x20;
if (biggerHeight)
value += 0x10;
if (secondaryFont)
value += 0x01;

View File

@@ -16,7 +16,7 @@ public class KitchenReceiptConverter
var commands = new List<PrintCommand>();
// Header - Restaurant name in red
commands.Add(new PrintCommand(Center(kitchenReceipt.Title, true)) { IsRed = true , IsBig = true});
commands.Add(new PrintCommand(Center(kitchenReceipt.Title, true)) { IsRed = true , IsBig = true, IsTall = true });
commands.Add(new PrintCommand(CreateDashedLine()));
commands.Add(new PrintCommand(""));
@@ -50,7 +50,7 @@ public class KitchenReceiptConverter
foreach (Gang gang in kitchenReceipt.Gangs)
{
commands.Add(new PrintCommand(Center($"{gang.Id}. {gang.Name}", false)) { IsRed = true });
commands.Add(new PrintCommand(Center($"{gang.Id}. {gang.Name}", true)) { IsRed = true, IsBig = true, IsTall = true});
foreach (var dish in gang.Dishes)
{
PrintDish(dish, commands);
@@ -96,25 +96,25 @@ public class KitchenReceiptConverter
private static void PrintDish(Dish dish, List<PrintCommand> commands)
{
string dishLine = $"{dish.Number}x {dish.Name}";
commands.Add(new PrintCommand(dishLine));
commands.Add(new PrintCommand(dishLine){IsTall = true});
// Modifications
if (dish.Modifications != null && (dish.Modifications.Removed.Any() || dish.Modifications.Added.Any()))
{
foreach (var removed in dish.Modifications.Removed)
{
commands.Add(new PrintCommand($" - {removed}", isBold:true));
commands.Add(new PrintCommand($" - {removed}", isBold:true) { IsTall = true });
}
foreach (var added in dish.Modifications.Added)
{
commands.Add(new PrintCommand($" + {added}", isBold: true));
commands.Add(new PrintCommand($" + {added}", isBold: true) { IsTall = true });
}
}
// SpecialInstruction
if (!string.IsNullOrEmpty(dish.Comment))
{
commands.Add(new PrintCommand($" Comment: {dish.Comment}", isBold: true));
commands.Add(new PrintCommand($" Comment: {dish.Comment}", isBold: true) { IsTall = true });
}
//commands.Add(new PrintCommand($""));

View File

@@ -4,6 +4,7 @@ public class PrintCommand
{
public string Text { get; set; }
public bool IsBig { get; set; }
public bool IsTall { get; set; }
public bool IsBold { get; set; }
public bool IsRed { get; set; }
public int? SetLineSpacing { get; set; }=null;