Aggiunta e testata rilettura DDF + SVG da missing
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user