diff --git a/Inspectron.Epson/PrintServer/Printers/TM-T30IIITranslated.cs b/Inspectron.Epson/PrintServer/Printers/TM-T30IIITranslated.cs index db808f5..ec1214f 100644 --- a/Inspectron.Epson/PrintServer/Printers/TM-T30IIITranslated.cs +++ b/Inspectron.Epson/PrintServer/Printers/TM-T30IIITranslated.cs @@ -7,6 +7,8 @@ public class TM_T30IIITranslated : IPrinter { private readonly IEpsonPrinter _printer; + public bool SkipDelays { get; set; } + public TM_T30IIITranslated(IEpsonPrinter printer) { _printer = printer; @@ -22,7 +24,7 @@ public class TM_T30IIITranslated : IPrinter await _printer.FeedLinesAsync(1); await _printer.SetAbsolutePrintPosition(100); await _printer.LoadImageAsync(path, 384); - await Task.Delay(100); + if (!SkipDelays) await Task.Delay(100); if (_printer is HtmlPrinter) { await _printer.PrintLoadedImage(); @@ -65,12 +67,12 @@ public class TM_T30IIITranslated : IPrinter await _printer.SetDefaultLineSpacing(); await _printer.FeedLinesAsync(10); - await Task.Delay(200); + if (!SkipDelays) await Task.Delay(200); } public async Task Cut() { await _printer.CutAsync(); - await Task.Delay(200); + if (!SkipDelays) await Task.Delay(200); } } \ No newline at end of file diff --git a/Inspectron.Epson/PrintServer/Printers/TM-U220IITranslated.cs b/Inspectron.Epson/PrintServer/Printers/TM-U220IITranslated.cs index 7151295..4ad9bd2 100644 --- a/Inspectron.Epson/PrintServer/Printers/TM-U220IITranslated.cs +++ b/Inspectron.Epson/PrintServer/Printers/TM-U220IITranslated.cs @@ -8,6 +8,8 @@ public class TM_U220IITranslated : IPrinter { private readonly IEpsonPrinter _printer; + public bool SkipDelays { get; set; } + public TM_U220IITranslated(IEpsonPrinter printer) { _printer = printer; @@ -16,7 +18,7 @@ public class TM_U220IITranslated : IPrinter public async Task InitAsync() { await _printer.InitAsync(); - await Task.Delay(200); + if (!SkipDelays) await Task.Delay(200); } public Task PrintImageAsync(string path) @@ -39,28 +41,28 @@ public class TM_U220IITranslated : IPrinter if (command.IsCut) { await _printer.FeedLinesAsync(10); - await Task.Delay(200 * 5); + if (!SkipDelays) await Task.Delay(200 * 5); await _printer.CutAsync(false); - await Task.Delay(200); + if (!SkipDelays) await Task.Delay(200); continue; } await _printer.SetBiggerFontTM220(command.IsBig, command.IsTall | command.IsBig); - await Task.Delay(200); + if (!SkipDelays) await Task.Delay(200); await _printer.SetRedColor(command.IsRed); - await Task.Delay(200); + if (!SkipDelays) await Task.Delay(200); await _printer.SetEmphasized(command.IsBold); - await Task.Delay(200); + if (!SkipDelays) await Task.Delay(200); await _printer.PrintTextAsync(command.Text + "\n"); - await Task.Delay(200); + if (!SkipDelays) await Task.Delay(200); } await _printer.FeedLinesAsync(10); - await Task.Delay(1000); + if (!SkipDelays) await Task.Delay(1000); } public async Task Cut() { await _printer.CutAsync(); - await Task.Delay(200); + if (!SkipDelays) await Task.Delay(200); } } \ No newline at end of file diff --git a/Inspectron.PrintServer.TemplateEditor/Components/Pages/Home.razor b/Inspectron.PrintServer.TemplateEditor/Components/Pages/Home.razor index 31ac06f..31672f7 100644 --- a/Inspectron.PrintServer.TemplateEditor/Components/Pages/Home.razor +++ b/Inspectron.PrintServer.TemplateEditor/Components/Pages/Home.razor @@ -3,6 +3,9 @@ @using BlazorMonaco.Editor @using BlazorMonaco.Languages @using CommunityToolkit.Maui.Storage +@using Inspectron.Epson +@using Inspectron.Epson.PrintServer.Printers +@using Inspectron.Epson.TemplateEngine @using Inspectron.PrintServer.TemplateEditor.Services @inject IJSRuntime JSRuntime @@ -20,6 +23,11 @@ { @_loadedJsonFile } +
+