Merge branch 'release/UpdUiRefresh'

This commit is contained in:
Samuele Locatelli
2022-10-25 15:33:35 +02:00
18 changed files with 79 additions and 59 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Platforms>AnyCPU;x86;x64</Platforms>
<Version>1.2.2210.2514</Version>
<Version>1.2.2210.2515</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>MAPO-MONO</i>
<h4>Version: 1.2.2210.2514</h4>
<h4>Version: 1.2.2210.2515</h4>
<br /> Release Note:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
1.2.2210.2514
1.2.2210.2515
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.2.2210.2514</version>
<version>1.2.2210.2515</version>
<url>http://nexus.steamware.net/repository/SWS/MP.MONO.ANALYZER/stable/LAST/MP.Mon.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/MP.MONO.ANALYZER/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+1 -1
View File
@@ -6,7 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Platforms>AnyCPU;x86;x64</Platforms>
<Version>1.2.2210.2514</Version>
<Version>1.2.2210.2515</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>MAPO-MONO</i>
<h4>Version: 1.2.2210.2514</h4>
<h4>Version: 1.2.2210.2515</h4>
<br /> Release Note:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
1.2.2210.2514
1.2.2210.2515
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.2.2210.2514</version>
<version>1.2.2210.2515</version>
<url>http://nexus.steamware.net/repository/SWS/MP.MONO.DECODER/stable/LAST/MP.Mon.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/MP.MONO.DECODER/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+1 -1
View File
@@ -6,7 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Platforms>AnyCPU;x86;x64</Platforms>
<Version>1.2.2210.2514</Version>
<Version>1.2.2210.2515</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>MAPO-MONO</i>
<h4>Version: 1.2.2210.2514</h4>
<h4>Version: 1.2.2210.2515</h4>
<br /> Release Note:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
1.2.2210.2514
1.2.2210.2515
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.2.2210.2514</version>
<version>1.2.2210.2515</version>
<url>http://nexus.steamware.net/repository/SWS/MP.MONO.SIM/stable/LAST/MP.Mon.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/MP.MONO.SIM/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Platforms>AnyCPU;x86;x64</Platforms>
<Version>1.2.2210.2514</Version>
<Version>1.2.2210.2515</Version>
</PropertyGroup>
<ItemGroup>
+62 -42
View File
@@ -9,14 +9,14 @@ namespace MP.MONO.UI.Pages
{
#region Public Properties
public string lastUpdate { get; set; } = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
public bool liveUpdate { get; set; } = true;
public bool isActive
{
get => MMDataService.AlarmLogActive;
}
public string lastUpdate { get; set; } = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
public bool liveUpdate { get; set; } = true;
public bool setLogRec
{
get => currFilter.isActive;
@@ -29,13 +29,16 @@ namespace MP.MONO.UI.Pages
public void Dispose()
{
SearchRecords = null;
SearchRecordsREC = null;
ListRecords = null;
ListRecordsREC = null;
aTimer.Elapsed -= ElapsedTimer;
aTimer.Stop();
aTimer.Dispose();
GC.Collect();
}
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
public void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e)
{
if (!isLoading && liveUpdate)
@@ -57,9 +60,10 @@ namespace MP.MONO.UI.Pages
aTimer.Interval = deltaTime > 100 ? deltaTime : 100;
aTimer.Start();
Log.Debug("ElapsedTimer: Timer Restarted");
GC.Collect();
}
}
private static System.Timers.Timer aTimer = null!;
public void StartTimer()
{
aTimer = new System.Timers.Timer(RefreshPeriod);
@@ -81,18 +85,7 @@ namespace MP.MONO.UI.Pages
#endregion Protected Fields
#region Protected Properties
private bool filtActive
{
get => dtRif != DateTime.Now.Date || MaxRecord != 200;
}
protected void resetDate()
{
dtRif = DateTime.Now;
}
protected void resetMaxRecord()
{
MaxRecord = 200;
}
protected string currMode
{
get => setLogRec ? "Status History mode" : "Single Rec mode";
@@ -195,35 +188,54 @@ namespace MP.MONO.UI.Pages
}
await Task.Delay(1);
isLoading = false;
}
protected async Task reloadFromMessage()
{
isLoading = true;
if (aTimer != null)
{
aTimer.Stop();
}
// verifico veto
DateTime adesso = DateTime.Now;
await Task.Delay(50);
await ReloadData(true);
await Task.Delay(1);
await InvokeAsync(() =>
{
StateHasChanged();
});
}
protected async Task reloadFromMessage()
{
DateTime adesso = DateTime.Now;
Random rand = new Random();
int numTry = 0;
while (isLoading)
{
await Task.Delay(rand.Next(10, 30));
if (numTry % 2 == 0)
{
TimeSpan ts = DateTime.Now.Subtract(adesso);
Log.Info($"Wait for reloadFromMessage | total wait {ts.TotalMilliseconds:N3}ms");
}
numTry++;
}
isLoading = true;
try
{
aTimer.Stop();
}
catch
{ }
await Task.Delay(1);
isLoading = false;
if (aTimer != null)
await ReloadData(true);
try
{
aTimer.Start();
}
catch
{ }
isLoading = false;
}
protected void resetDate()
{
dtRif = DateTime.Now;
}
protected void resetMaxRecord()
{
MaxRecord = 200;
}
protected async Task ShowSetup()
@@ -257,6 +269,8 @@ namespace MP.MONO.UI.Pages
#region Private Fields
private static System.Timers.Timer aTimer = null!;
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
private DateTime _dtRif = DateTime.Now;
private int _MaxRecord = 200;
private List<AlarmLogModel>? ListRecords = null;
@@ -277,11 +291,6 @@ namespace MP.MONO.UI.Pages
private int _numRecord { get; set; } = 10;
private selectGlobalToggle currFilter { get; set; } = new selectGlobalToggle();
private int numAlarm
{
get => currFilter.numAlarms;
}
private int currPage
{
get => _currPage;
@@ -329,7 +338,13 @@ namespace MP.MONO.UI.Pages
}
}
private bool filtActive
{
get => dtRif != DateTime.Now.Date || MaxRecord != 200;
}
private bool isLoading { get; set; } = false;
private bool isLoadingData { get; set; } = false;
private int MaxRecord
{
@@ -350,6 +365,11 @@ namespace MP.MONO.UI.Pages
private bool maxRecordStatus { get; set; } = false;
private int numAlarm
{
get => currFilter.numAlarms;
}
private int numRecord
{
get => _numRecord;
+1 -1
View File
@@ -30,7 +30,7 @@
{
<div class="row">
<div class="col-4">
<h4>Gestione Licenza</h4>
<h4>Licence Manager</h4>
</div>
<div class="col-4 text-center">
<a target="_blank" href="Download?fileName=@fileName" class="btn btn-block btn-warning"><span class="bi bi-file-earmark-arrow-down-fill"></span> Download Fingerprint File</a>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>MAPO-MONO</i>
<h4>Version: 1.2.2210.2514</h4>
<h4>Version: 1.2.2210.2515</h4>
<br /> Release Note:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
1.2.2210.2514
1.2.2210.2515
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.2.2210.2514</version>
<version>1.2.2210.2515</version>
<url>http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/MP.Mon.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>