1.0.12
This commit is contained in:
@@ -397,7 +397,7 @@ public class EpsonPrinter : IEpsonPrinter
|
||||
public async Task CutAsync(bool fullCut=true)
|
||||
{
|
||||
_logger?.LogInformation("Cutting paper");
|
||||
await SendRawAsync(EpsonCommands.CutPaperFull);
|
||||
await SendRawAsync(fullCut ? EpsonCommands.CutPaperFull : EpsonCommands.CutPaperPartial);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -44,6 +44,12 @@ public class TM_T30IIITranslated : IPrinter
|
||||
|
||||
foreach (var command in commands)
|
||||
{
|
||||
if (command.IsCut)
|
||||
{
|
||||
await _printer.FeedLinesAsync(10);
|
||||
await _printer.CutAsync(false);
|
||||
continue;
|
||||
}
|
||||
if(command.SetLineSpacing.HasValue)
|
||||
{
|
||||
Console.WriteLine($"Setting line spacing to {command.SetLineSpacing.Value}");
|
||||
@@ -51,16 +57,17 @@ public class TM_T30IIITranslated : IPrinter
|
||||
Console.WriteLine($"------------------------------------------------------");
|
||||
continue;
|
||||
}
|
||||
if (command.IsBig)
|
||||
{
|
||||
await _printer.SetFontSizeAsync(2, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
await _printer.SetFontSizeAsync(1, 1);
|
||||
}
|
||||
await _printer.SetFontSizeAsync(command.IsBig?2:1, command.IsTall?2:1);
|
||||
//if (command.IsBig)
|
||||
//{
|
||||
// await _printer.SetFontSizeAsync(2, 1);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// await _printer.SetFontSizeAsync(1, 1);
|
||||
//}
|
||||
|
||||
|
||||
|
||||
await _printer.SetEmphasized(command.IsBold);
|
||||
await _printer.PrintTextAsync(command.Text + "\n");
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public class BarReceiptConverter
|
||||
commands.Add(new PrintCommand(Center(kitchenReceipt.SpecialInstruction, true), true, true));
|
||||
commands.Add(new PrintCommand(""));
|
||||
}
|
||||
|
||||
commands.Add(new PrintCommand(""));
|
||||
commands.Add(new PrintCommand(CreateDashedLine()));
|
||||
|
||||
|
||||
@@ -52,11 +52,19 @@ public class BarReceiptConverter
|
||||
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)) { IsBig = true });
|
||||
commands.Add(new PrintCommand(""));
|
||||
commands.Add(new PrintCommand(""));
|
||||
foreach (var dish in gang.Dishes)
|
||||
{
|
||||
PrintDish(dish, commands);
|
||||
}
|
||||
if (gang != kitchenReceipt.Gangs.Last())
|
||||
{
|
||||
commands.Add(new PrintCommand("") { IsCut = true });
|
||||
commands.Add(new PrintCommand(""));
|
||||
commands.Add(new PrintCommand(""));
|
||||
}
|
||||
}
|
||||
|
||||
if (kitchenReceipt.Gangs.Count > 0)
|
||||
@@ -98,25 +106,25 @@ public class BarReceiptConverter
|
||||
private static void PrintDish(Dish drink, List<PrintCommand> commands)
|
||||
{
|
||||
string drinkLine = $"{drink.Number}x {drink.Name}";
|
||||
commands.Add(new PrintCommand(drinkLine,isBig:true));
|
||||
commands.Add(new PrintCommand(drinkLine){IsTall = true});
|
||||
// Modifications
|
||||
if (drink.Modifications != null && (drink.Modifications.Removed.Any() || drink.Modifications.Added.Any()))
|
||||
{
|
||||
foreach (var removed in drink.Modifications.Removed)
|
||||
{
|
||||
commands.Add(new PrintCommand($" - {removed}", isBold:true));
|
||||
commands.Add(new PrintCommand($" - {removed}", isBold:true){IsTall = true});
|
||||
}
|
||||
|
||||
foreach (var added in drink.Modifications.Added)
|
||||
{
|
||||
commands.Add(new PrintCommand($" + {added}", isBold: true));
|
||||
commands.Add(new PrintCommand($" + {added}", isBold: true){IsTall = true});
|
||||
}
|
||||
}
|
||||
|
||||
// SpecialInstruction
|
||||
if (!string.IsNullOrEmpty(drink.Comment))
|
||||
{
|
||||
commands.Add(new PrintCommand($" Comment: {drink.Comment}", isBold: true));
|
||||
commands.Add(new PrintCommand($" Comment: {drink.Comment}", isBold: true){IsTall = true});
|
||||
}
|
||||
|
||||
commands.Add(new PrintCommand("")); // Extra line between drinks for bar
|
||||
|
||||
@@ -15,4 +15,9 @@ public class PrintCommand
|
||||
IsBig = isBig;
|
||||
IsBold = isBold;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Text: {Text}, IsBig: {IsBig}, IsBold: {IsBold}, IsRed: {IsRed}, SetLineSpacing: {SetLineSpacing}, IsCut: {IsCut}";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user