Aggiunta e testata rilettura DDF + SVG da missing

This commit is contained in:
Samuele Locatelli
2024-02-16 18:05:43 +01:00
parent 70cd621f80
commit 4585ac4bf8
9 changed files with 58 additions and 13 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>WebDoorCreator - Egalware</i>
<h4>Version: 0.9.2402.1617</h4>
<h4>Version: 0.9.2402.1618</h4>
<br /> Release note:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
0.9.2402.1617
0.9.2402.1618
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>0.9.2402.1617</version>
<version>0.9.2402.1618</version>
<url>http://nexus.steamware.net/repository/SWS/WDC/stable/WDC.UI.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/WDC/stable/ChangeLog.html</changelog>
<mandatory>false</mandatory>
@@ -23,6 +23,7 @@ namespace WebDoorCreator.API.Controllers
{
Log.Info("Starting DoorImageController");
_configuration = configuration;
WaitReloadSvg = _configuration.GetValue<int>("RuntimeOpt:WaitReloadSvg");
QDService = cQDService;
WDService = cWDCService;
Log.Info("Avviato DoorImageController");
@@ -48,7 +49,11 @@ namespace WebDoorCreator.API.Controllers
if (string.IsNullOrEmpty(svgContent))
{
// richiede ricalcolo img
await SendRecalcReq(DoorId);
svgContent = await SendRecalcReq(DoorId);
}
// se fosse vuoto...
if (string.IsNullOrEmpty(svgContent))
{
// legge img vuota
svgContent = QDService.DoorGetMissingSvg();
}
@@ -104,6 +109,8 @@ namespace WebDoorCreator.API.Controllers
private static Logger Log = LogManager.GetCurrentClassLogger();
private int WaitReloadSvg = 100;
#endregion Private Fields
#region Private Properties
@@ -121,8 +128,9 @@ namespace WebDoorCreator.API.Controllers
/// </summary>
/// <param name="DoorId"></param>
/// <returns></returns>
private async Task SendRecalcReq(int DoorId)
private async Task<string> SendRecalcReq(int DoorId)
{
string answ = "";
// richiede ricalcolo img
List<string> doorIdList = new List<string>() { $"{DoorId}" };
// chiamo reset richieste
@@ -135,6 +143,12 @@ namespace WebDoorCreator.API.Controllers
// versione corrente del DDF generato
int currVers = await QDService.SendCalcReq(DoorId, currDDF);
}
// attende ...
await Task.Delay(WaitReloadSvg);
// riprova lettura
answ = await QDService.DoorGetLastSvg(DoorId);
return answ;
}
#endregion Private Methods
+1
View File
@@ -28,6 +28,7 @@
"TimbCheck": "samuele.locatelli@egalware.com"
},
"RuntimeOpt": {
"WaitReloadSvg": 200,
"VetoRemoveProcessing": 5,
"StatSampleSize": 30,
"LogTimingEnable": true
@@ -36,6 +36,10 @@ namespace WebDoorCreator.UI.Components.DoorDef
#region Protected Properties
protected bool B_doorOpUpd { get; set; } = false;
[Inject]
protected IConfiguration configuration { get; set; } = null!;
protected OrderStatusViewModel? currOrder { get; set; } = null;
protected string DoorSvgContent { get; set; } = "";
@@ -95,7 +99,7 @@ namespace WebDoorCreator.UI.Components.DoorDef
protected override async Task OnInitializedAsync()
{
await Task.Delay(1);
WaitReloadSvg = configuration.GetValue<int>("RuntimeOpt:WaitReloadSvg");
var uri = NavManager.ToAbsoluteUri(NavManager.Uri);
//if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("idOrd", out var _idOrd) && QueryHelpers.ParseQuery(uri.Query).TryGetValue("idDoor", out var _idDoor))
//{
@@ -120,7 +124,11 @@ namespace WebDoorCreator.UI.Components.DoorDef
if (string.IsNullOrEmpty(DoorSvgContent))
{
// richiede ricalcolo img
await SendRecalcReq(idDoor);
DoorSvgContent = await SendRecalcReq(idDoor);
}
// se fosse vuoto...
if (string.IsNullOrEmpty(DoorSvgContent))
{
// legge img vuota
DoorSvgContent = QDService.DoorGetMissingSvg();
}
@@ -174,6 +182,8 @@ namespace WebDoorCreator.UI.Components.DoorDef
private static Logger Log = LogManager.GetCurrentClassLogger();
private int WaitReloadSvg = 100;
#endregion Private Fields
#region Private Properties
@@ -231,8 +241,9 @@ namespace WebDoorCreator.UI.Components.DoorDef
/// </summary>
/// <param name="DoorId"></param>
/// <returns></returns>
private async Task SendRecalcReq(int DoorId)
private async Task<string> SendRecalcReq(int DoorId)
{
string answ = "";
// richiede ricalcolo img
List<string> doorIdList = new List<string>() { $"{DoorId}" };
// chiamo reset richieste
@@ -245,6 +256,12 @@ namespace WebDoorCreator.UI.Components.DoorDef
// versione corrente del DDF generato
int currVers = await QDService.SendCalcReq(DoorId, currDDF);
}
// attende ...
await Task.Delay(WaitReloadSvg);
// riprova lettura
answ = await QDService.DoorGetLastSvg(DoorId);
return answ;
}
private void WDService_EA_DoorOpUpdated()
@@ -17,6 +17,7 @@ namespace WebDoorCreator.UI.Controllers
{
Log.Info("Starting DoorImageController");
_configuration = configuration;
WaitReloadSvg = _configuration.GetValue<int>("RuntimeOpt:WaitReloadSvg");
QDService = cQDService;
WDService = cWDCService;
Log.Info("Avviato DoorImageController");
@@ -41,7 +42,11 @@ namespace WebDoorCreator.UI.Controllers
if (string.IsNullOrEmpty(svgContent))
{
// richiede ricalcolo img
await SendRecalcReq(DoorId);
svgContent = await SendRecalcReq(DoorId);
}
// se fosse vuoto...
if (string.IsNullOrEmpty(svgContent))
{
// legge img vuota
svgContent = QDService.DoorGetMissingSvg();
}
@@ -53,9 +58,9 @@ namespace WebDoorCreator.UI.Controllers
#region Private Fields
private static IConfiguration _configuration = null!;
private static Logger Log = LogManager.GetCurrentClassLogger();
private IConfiguration _configuration = null!;
private int WaitReloadSvg = 100;
#endregion Private Fields
@@ -74,8 +79,9 @@ namespace WebDoorCreator.UI.Controllers
/// </summary>
/// <param name="DoorId"></param>
/// <returns></returns>
private async Task SendRecalcReq(int DoorId)
private async Task<string> SendRecalcReq(int DoorId)
{
string answ = "";
// richiede ricalcolo img
List<string> doorIdList = new List<string>() { $"{DoorId}" };
// chiamo reset richieste
@@ -88,6 +94,12 @@ namespace WebDoorCreator.UI.Controllers
// versione corrente del DDF generato
int currVers = await QDService.SendCalcReq(DoorId, currDDF);
}
// attende ...
await Task.Delay(WaitReloadSvg);
// riprova lettura
answ = await QDService.DoorGetLastSvg(DoorId);
return answ;
}
#endregion Private Methods
+1 -1
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<Version>0.9.2402.1617</Version>
<Version>0.9.2402.1618</Version>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>aspnet-WebDoorCreator.UI-dfe95fed-1398-4144-bd43-8b3a765d6608</UserSecretsId>
</PropertyGroup>
+1
View File
@@ -31,6 +31,7 @@
"DisableWDCMigrate": true
},
"RuntimeOpt": {
"WaitReloadSvg": 200,
"VetoRemoveProcessing": 5,
"MaxDayCalcCache": 7,
"BaseUrl": "/WDC/UI",