test run works

This commit is contained in:
EugeneTes
2026-01-20 10:11:04 +01:00
parent 4720ca2d57
commit 6f5116736c
22 changed files with 351 additions and 441 deletions

View File

@@ -1,9 +1,9 @@
using Inspectron.Epson.PrintServer.PrintServices;
using System.Reflection;
using Inspectron.Epson.PrintServer.Printers.Utils;
using Inspectron.Epson.PrintServer.PrintServices;
namespace Inspectron.Epson.PrintServer.Printers;
public class TM_U220II:IPrinter
public class TM_U220II : IPrinter
{
private readonly EpsonPrinter _printer;
@@ -31,14 +31,20 @@ public class TM_U220II:IPrinter
await Task.Delay(200);
}
public async Task PrintTextAsync(string text)
public async Task PrintAsync(List<PrintCommand> commands)
{
await _printer.PrintTextAsync(text);
var lines = text.Split('\n').Length;
for (int i = 0; i < lines; i++)
foreach (var command in commands)
{
await _printer.SetBiggerFontTM220(command.IsBig);
await Task.Delay(200);
await _printer.SetRedColor(command.IsRed);
await Task.Delay(200);
await _printer.SetEmphasized(command.IsBold);
await Task.Delay(200);
await _printer.PrintTextAsync(command.Text + "\n");
await Task.Delay(200);
}
await _printer.FeedLinesAsync(5);
await Task.Delay(200);
}