Bozza gestione setup conf

This commit is contained in:
Samuele Locatelli
2023-10-03 12:23:19 +02:00
parent 35767c2716
commit a6f45ff908
2 changed files with 28 additions and 2 deletions
+28
View File
@@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Components;
using MP.Data.DatabaseModels;
using MP.Data.Services;
using NLog.Fluent;
namespace MP_TAB_SERV.Pages
{
@@ -13,6 +14,8 @@ namespace MP_TAB_SERV.Pages
[Inject]
protected MessageService MsgServ { get; set; } = null!;
[Inject]
protected TabDataService TabServ { get; set; } = null!;
#endregion Protected Properties
@@ -68,8 +71,33 @@ namespace MP_TAB_SERV.Pages
CurrMSE = await MsgServ.GetMachineMse(IdxMacc);
}
}
// recupero parametri configurazione...
await setupConf();
}
private async Task setupConf()
{
CurrConfig = await TabServ.ConfigGetAll();
#if false
if (CurrConfig != null && CurrConfig.Count > 0)
{
// sistemo i parametri opzionali...
getConfValInt("keepAliveMin", ref keepAliveMin);
getConfValInt("MON_maxCol", ref maxCol);
int intDoAnim = 0;
getConfValInt("doAnimate", ref intDoAnim);
doAnimate = intDoAnim == 1;
getConfValInt("pageRefreshSec", ref slowRefreshSec);
getConfVal("sART", ref showArt);
Log.Info($"setupConf | Effettuato setup parametri | keepAlive: {keepAliveMin} | MaxCol: {maxCol} | doAnimate: {doAnimate} | slowRefreshSec: {slowRefreshSec}");
}
#endif
}
private List<ConfigModel>? CurrConfig = null;
private bool enableSchedaTecnica = false;
#endregion Private Methods
}
}
-2
View File
@@ -113,8 +113,6 @@ namespace MP.Data.Services
sw.Stop();
Log.Debug($"ConfigGetAll | {source} | {sw.Elapsed.TotalMilliseconds}ms");
return result;
//return Task.FromResult(dbController.ConfigGetAll().ToList());
}
public void Dispose()