From 7fe560326fff283c436caccb3c6de2f245dbe68f Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 23 Feb 2024 09:03:17 +0100 Subject: [PATCH] update altri test... --- EgwCoreLib.BlazorTest/Pages/TestLoading.razor | 39 +++++++--- .../Pages/TestLoading.razor.cs | 16 +++- .../Pages/TestQrDisplay.razor | 73 +++++++++++-------- EgwCoreLib.BlazorTest/Pages/_Layout.cshtml | 2 - 4 files changed, 84 insertions(+), 46 deletions(-) diff --git a/EgwCoreLib.BlazorTest/Pages/TestLoading.razor b/EgwCoreLib.BlazorTest/Pages/TestLoading.razor index e9bdada..05cbeb4 100644 --- a/EgwCoreLib.BlazorTest/Pages/TestLoading.razor +++ b/EgwCoreLib.BlazorTest/Pages/TestLoading.razor @@ -1,14 +1,31 @@ @page "/TestLoading" -

TestLoading

-
- - -
-
- - -
- - +
+
+

Test Modale Loading

+
+
+
+
+
+ Tempo sim + +
+
+ Num steps + +
+ +
@realTime
+
+
+

Fake Progressbar

+

Modale che mostra avanzamento (progressbar con %) di un task lungo.

+

Devono essere definiti il numero degli step attesi e per ogni step la durata attesa di completamento.

+

Viene definito fake poiché l'avanzamento è artificialmente rallentato quando si approssima allo scadere di uno step per dare impressione di un sistema realmente (ri)calcolato di continuo, mentre al superamento di ogni step viene portato avanti il conteggio recuperando eventuali ritardi di stima.

+
+
+
+
+ \ No newline at end of file diff --git a/EgwCoreLib.BlazorTest/Pages/TestLoading.razor.cs b/EgwCoreLib.BlazorTest/Pages/TestLoading.razor.cs index 3648af6..a1ad99c 100644 --- a/EgwCoreLib.BlazorTest/Pages/TestLoading.razor.cs +++ b/EgwCoreLib.BlazorTest/Pages/TestLoading.razor.cs @@ -1,18 +1,24 @@ +using System.Diagnostics; + namespace EgwCoreLib.BlazorTest.Pages { public partial class TestLoading { #region Protected Properties - protected double expTime { get; set; } = 6; - protected int numSteps { get; set; } = 4; + protected double expTime { get; set; } = 5; + protected int numSteps { get; set; } = 10; #endregion Protected Properties #region Protected Methods + protected string realTime = ""; + protected async Task StartLongTimer() { + Stopwatch sw = new Stopwatch(); + sw.Start(); maxVal = numSteps * 10; double stdWait = expTime / numSteps; int nextWait = 1000; @@ -31,13 +37,15 @@ namespace EgwCoreLib.BlazorTest.Pages nextVal = maxVal; } await InvokeAsync(StateHasChanged); - // simulo ritardo importante (da 2 a 3 volte - nextWait = (int)(rnd.Next(2000, 3000) * stdWait); + // simulo ritardo importante (da 0 a 2 volte) + nextWait = (int)(rnd.Next(100, 2000) * stdWait); // attendo step successivi... await Task.Delay(nextWait); } await Task.Delay(1); currVal = maxVal; + sw.Stop(); + realTime = $"Real: {sw.Elapsed.TotalSeconds:N3}s"; await InvokeAsync(StateHasChanged); } diff --git a/EgwCoreLib.BlazorTest/Pages/TestQrDisplay.razor b/EgwCoreLib.BlazorTest/Pages/TestQrDisplay.razor index abb1c7e..ada0643 100644 --- a/EgwCoreLib.BlazorTest/Pages/TestQrDisplay.razor +++ b/EgwCoreLib.BlazorTest/Pages/TestQrDisplay.razor @@ -11,38 +11,53 @@
- @*
Header
*@ -
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
+
AZTEC
-
-
-
- - @* *@ -
-
+
+ +
+
+ Quadrato, control point centrale +
+ @* *@ +
+
+
+
+
QR_CODE
+
+
+ +
+
+ Quadrato, 3 control point vertici +
+
+
+
+
+
DATA_MATRIX
+
+
+ +
+
+ Quadrato/Rettangolare (se codice lungo), linee controllo sx/basso +
+
+
+
+
+
PDF_417
+
+
+ + @* *@ +
+
+ Rettangolare, linee controllo verticali sx/dx differenti (verso)
-
- @*

PDF_417

- *@
diff --git a/EgwCoreLib.BlazorTest/Pages/_Layout.cshtml b/EgwCoreLib.BlazorTest/Pages/_Layout.cshtml index 09d3a05..48d1302 100644 --- a/EgwCoreLib.BlazorTest/Pages/_Layout.cshtml +++ b/EgwCoreLib.BlazorTest/Pages/_Layout.cshtml @@ -60,7 +60,5 @@ - -