diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html
index 0c0df5b..a40c364 100644
--- a/Resources/ChangeLog.html
+++ b/Resources/ChangeLog.html
@@ -1,6 +1,6 @@
WebDoorCreator - Egalware
- Version: 0.9.2406.2015
+ Version: 0.9.2406.2715
Release note:
-
diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt
index 48e0906..874b098 100644
--- a/Resources/VersNum.txt
+++ b/Resources/VersNum.txt
@@ -1 +1 @@
-0.9.2406.2015
+0.9.2406.2715
diff --git a/Resources/manifest.xml b/Resources/manifest.xml
index 7048842..d32d02e 100644
--- a/Resources/manifest.xml
+++ b/Resources/manifest.xml
@@ -1,6 +1,6 @@
-
- 0.9.2406.2015
+ 0.9.2406.2715
http://nexus.steamware.net/repository/SWS/WDC/stable/WDC.UI.zip
http://nexus.steamware.net/repository/SWS/WDC/stable/ChangeLog.html
false
diff --git a/WebDoorCreator.API/Controllers/DoorImageController.cs b/WebDoorCreator.API/Controllers/DoorImageController.cs
index 50fbe88..6f8c2ac 100644
--- a/WebDoorCreator.API/Controllers/DoorImageController.cs
+++ b/WebDoorCreator.API/Controllers/DoorImageController.cs
@@ -71,16 +71,6 @@ namespace WebDoorCreator.API.Controllers
}
}
}
-#if false
- var mySvg = SvgDocument.FromSvg(svgContent);
- //result = System.Text.Encoding.UTF8.GetBytes(svgContent);
- var myBmp = mySvg.Draw();
- using (var stream = new MemoryStream())
- {
- img.Save(stream, System.Drawing.Imaging.ImageFormat.Png);
- result= stream.ToArray();
- }
-#endif
}
return File(result, "image/png");
}
diff --git a/WebDoorCreator.API/Controllers/QueueController.cs b/WebDoorCreator.API/Controllers/QueueController.cs
index ecafa22..27fa372 100644
--- a/WebDoorCreator.API/Controllers/QueueController.cs
+++ b/WebDoorCreator.API/Controllers/QueueController.cs
@@ -196,7 +196,7 @@ namespace WebDoorCreator.API.Controllers
///
///
[HttpGet("TakeNextItems")]
- public async Task> TakeProcessingItems(int numItems = 10)
+ public async Task> TakeProcessingItems(int numItems = 10)
{
var actQueue = await QDataServ.TakeProcessingItems(numItems);
Log.Debug($"Eseguito TakeProcessingItems per {numItems} items");
diff --git a/WebDoorCreator.CamSrv/ProcMan.vb b/WebDoorCreator.CamSrv/ProcMan.vb
index 80f8b5f..e79a5fa 100644
--- a/WebDoorCreator.CamSrv/ProcMan.vb
+++ b/WebDoorCreator.CamSrv/ProcMan.vb
@@ -986,7 +986,7 @@ Public Class ProcMan
currRes.DoorIdVers = Item.Key
' se NON fosse validato --> messo il messaggio...
If (currRes.Validated) Then
- currRes.SvgGen = fContent
+ currRes.RawContent = fContent
Else
bOk = GetFileContent(Path.ChangeExtension(sDdfPath, "txt"), fContent)
currRes.ErrorMsg = fContent
diff --git a/WebDoorCreator.Core/Constants.cs b/WebDoorCreator.Core/Constants.cs
index ba4b3f0..8a8b75a 100644
--- a/WebDoorCreator.Core/Constants.cs
+++ b/WebDoorCreator.Core/Constants.cs
@@ -24,6 +24,7 @@ namespace WebDoorCreator.Core
public static readonly string CALC_REQ_ERRS = $"{BASE_HASH}:CalcRequests:Errors";
public static readonly string CALC_REQ_PEND = $"{BASE_HASH}:CalcRequests:Pending";
public static readonly string CALC_REQ_PROC = $"{BASE_HASH}:CalcRequests:Processing";
+ public static readonly string CALC_REQ_TYPE = $"{BASE_HASH}:CalcRequests:Type";
public static readonly string CALC_REQ_DDF_CACHE = $"{BASE_HASH}:CalcRequests:CacheDDF";
public static readonly string CALC_REQ_SVG_CACHE = $"{BASE_HASH}:CalcRequests:CacheSVG";
public static readonly string CALC_REQ_VETO_REC = $"{BASE_HASH}:CalcRequests:VetoRecalc";
diff --git a/WebDoorCreator.Data/DTO/CalcReqDTO.cs b/WebDoorCreator.Data/DTO/CalcReqDTO.cs
new file mode 100644
index 0000000..8aa1401
--- /dev/null
+++ b/WebDoorCreator.Data/DTO/CalcReqDTO.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WebDoorCreator.Data.DTO
+{
+ ///
+ /// Oggetto contenitore richiesta calcolo
+ ///
+ public class CalcReqtDTO
+ {
+ ///
+ /// DDF file content (origin)
+ ///
+ public string DDF { get; set; } = "";
+ ///
+ /// MimeType (out) requested: svg / 3dm...
+ ///
+ public string MimeType { get; set; } = "";
+ }
+}
diff --git a/WebDoorCreator.Data/DTO/CalcResultDTO.cs b/WebDoorCreator.Data/DTO/CalcResultDTO.cs
index 2a3dc41..f20e328 100644
--- a/WebDoorCreator.Data/DTO/CalcResultDTO.cs
+++ b/WebDoorCreator.Data/DTO/CalcResultDTO.cs
@@ -24,9 +24,13 @@ namespace WebDoorCreator.Data.DTO
///
public string ErrorMsg { get; set; } = "";
///
- /// SVG generated
+ /// Object RAW generated output ( was SvgGen )
///
- public string SvgGen { get; set; } = "";
+ public string RawContent { get; set; } = "";
+ ///
+ /// MimeType: svg / 3dm...
+ ///
+ public string MimeType { get; set; } = "";
///
/// Artifats path (ex 3d zip/pack)
///
diff --git a/WebDoorCreator.Data/Services/QueueDataService.cs b/WebDoorCreator.Data/Services/QueueDataService.cs
index 4efdf73..c0ba56a 100644
--- a/WebDoorCreator.Data/Services/QueueDataService.cs
+++ b/WebDoorCreator.Data/Services/QueueDataService.cs
@@ -356,7 +356,6 @@ namespace WebDoorCreator.Data.Services
public async Task NumRequestDone()
{
long numReq = 0;
- string source = "REDIS";
Dictionary dictResult = new Dictionary();
// cerco da cache
RedisKey currKey = new RedisKey(Constants.CALC_REQ_DONE);
@@ -381,7 +380,6 @@ namespace WebDoorCreator.Data.Services
public async Task NumRequestErrors()
{
long numReq = 0;
- string source = "REDIS";
Dictionary dictResult = new Dictionary();
// cerco da cache
RedisKey currKey = new RedisKey(Constants.CALC_REQ_ERRS);
@@ -406,7 +404,6 @@ namespace WebDoorCreator.Data.Services
public async Task NumRequestPending()
{
long numReq = 0;
- string source = "REDIS";
Dictionary dictResult = new Dictionary();
// cerco da cache
RedisKey currKey = new RedisKey(Constants.CALC_REQ_PEND);
@@ -431,7 +428,6 @@ namespace WebDoorCreator.Data.Services
public async Task NumRequestProcessing()
{
long numReq = 0;
- string source = "REDIS";
Dictionary dictResult = new Dictionary();
// cerco da cache
RedisKey currKey = new RedisKey(Constants.CALC_REQ_PROC);
@@ -567,7 +563,7 @@ namespace WebDoorCreator.Data.Services
}
///
- /// Restitusice gli errori della porta in oggetto
+ /// Rimuove info della porta in oggetto
///
/// formato DoorId:Versione
///
@@ -576,6 +572,7 @@ namespace WebDoorCreator.Data.Services
await DoorRefreshRemove($"{doorId}");
await RequestDoneRemove($"{doorId}");
await RequestErrRemove($"{doorId}");
+ await RequestTypeRemove($"{doorId}");
await RequestPendingRemove($"{doorId}");
await RequestProcessingRemove($"{doorId}");
@@ -771,7 +768,7 @@ namespace WebDoorCreator.Data.Services
}
///
- /// Upsert for single hash record
+ /// Upsert for single hash record of req pending
///
/// Dictionary of DoorId, saveVersNumb
public async Task RequestPendingUpsert(string doorId, string vers)
@@ -839,6 +836,73 @@ namespace WebDoorCreator.Data.Services
return numReq;
}
+ ///
+ /// Get list of request type
+ ///
+ /// Dictionary of DoorId, saveVersNumb
+ public async Task> RequestType()
+ {
+ long numReq = 0;
+ Dictionary dictResult = new Dictionary();
+ // cerco da cache
+ RedisKey currKey = new RedisKey(Constants.CALC_REQ_TYPE);
+ Stopwatch sw = new Stopwatch();
+ if (logTimingEnable)
+ {
+ sw.Start();
+ }
+ numReq = redisDb.HashLength(currKey);
+ if (numReq > 0)
+ {
+ var rawData = await redisDb.HashGetAllAsync(currKey);
+ foreach (var item in rawData)
+ {
+ dictResult.Add($"{item.Name}", $"{item.Value}");
+ }
+ }
+ if (logTimingEnable)
+ {
+ sw.Stop();
+ // gestione statistiche
+ await ProcStatLog("RequestType", sw.Elapsed, 1, 10);
+ }
+ return dictResult;
+ }
+
+ ///
+ /// Remove for single hash record from TYPE hash table
+ ///
+ /// Dictionary of DoorId, saveVersNumb
+ public async Task RequestTypeRemove(string doorId)
+ {
+ RedisKey currKey = new RedisKey(Constants.CALC_REQ_TYPE);
+ bool fatto = await RedHashRemove(currKey, doorId);
+ return fatto;
+ }
+
+ ///
+ /// Upsert for single hash record of TYPE
+ ///
+ /// Dictionary of DoorId, Type proc requested
+ public async Task RequestTypeUpsert(string doorId, string type)
+ {
+ RedisKey currKey = new RedisKey(Constants.CALC_REQ_TYPE);
+ long numReq = 0;
+ bool answ = false;
+ if (!string.IsNullOrEmpty(type))
+ {
+ numReq = await RedHashUpsert(currKey, doorId, type);
+ answ = numReq > 0;
+ }
+ // se vuoto --> rimuovo!
+ else
+ {
+ await RedHashRemove(currKey, doorId);
+ answ = true;
+ }
+ return answ;
+ }
+
///
/// Reset to queue request all processing/processed data
///
@@ -878,6 +942,14 @@ namespace WebDoorCreator.Data.Services
await RequestDoneRemove(item.Name!);
fatto = true;
}
+ // svuoto in blocco hashatble tipo richieste...
+ currKey = new RedisKey(Constants.CALC_REQ_TYPE);
+ rawData = await redisDb.HashGetAllAsync(currKey);
+ foreach (var item in rawData)
+ {
+ await RequestTypeRemove(item.Name!);
+ fatto = true;
+ }
if (logTimingEnable)
{
sw.Stop();
@@ -906,11 +978,11 @@ namespace WebDoorCreator.Data.Services
foreach (var item in rawData)
{
// se è nell'elenco...
- if (DoorIdList.Contains(item.Name.ToString()))
+ if (DoorIdList.Contains($"{item.Name}"))
{
await RequestPendingUpsert(item.Name!, item.Value!);
await RequestProcessingRemove(item.Name!);
- listDone.Add(item.Name.ToString());
+ listDone.Add($"{item.Name}");
}
}
// cerco le richieste con errori
@@ -919,11 +991,11 @@ namespace WebDoorCreator.Data.Services
foreach (var item in rawData)
{
// se è nell'elenco...
- if (DoorIdList.Contains(item.Name.ToString()))
+ if (DoorIdList.Contains($"{item.Name}"))
{
await RequestPendingUpsert(item.Name!, item.Value!);
await RequestErrRemove(item.Name!);
- listDone.Add(item.Name.ToString());
+ listDone.Add($"{item.Name}");
}
}
// cerco le richieste processed
@@ -932,20 +1004,25 @@ namespace WebDoorCreator.Data.Services
foreach (var item in rawData)
{
// se è nell'elenco...
- if (DoorIdList.Contains(item.Name.ToString()))
+ if (DoorIdList.Contains($"{item.Name}"))
{
await RequestPendingUpsert(item.Name!, item.Value!);
await RequestDoneRemove(item.Name!);
- listDone.Add(item.Name.ToString());
+ listDone.Add($"{item.Name}");
}
}
-#if false
- // calcolo eventuali porte NON ancora richieste...
- foreach (var item in listDone)
+ // svuoto hashatble tipo richieste...
+ currKey = new RedisKey(Constants.CALC_REQ_TYPE);
+ rawData = await redisDb.HashGetAllAsync(currKey);
+ foreach (var item in rawData)
{
- DoorIdList.Remove(item);
+ // se è nell'elenco...
+ if (DoorIdList.Contains($"{item.Name}"))
+ {
+ await RequestTypeRemove(item.Name!);
+ listDone.Add($"{item.Name}");
+ }
}
-#endif
if (logTimingEnable)
{
sw.Stop();
@@ -1021,12 +1098,12 @@ namespace WebDoorCreator.Data.Services
// se template --> no scadenza
if (doorIsTpl)
{
- await redisDb.StringSetAsync(currSvgKey, calcTask.SvgGen);
+ await redisDb.StringSetAsync(currSvgKey, calcTask.RawContent);
}
else
{
// 2024.02.15 salvo in cache x 2 settimane, fare 1+ mesi?!?
- await redisDb.StringSetAsync(currSvgKey, calcTask.SvgGen, DblWeekLongCache);
+ await redisDb.StringSetAsync(currSvgKey, calcTask.RawContent, DblWeekLongCache);
}
// elimino dalle code proc/err
await RequestProcessingRemove(sDoorId);
@@ -1069,8 +1146,9 @@ namespace WebDoorCreator.Data.Services
///
///
/// Contenuto completo del DDF
+ /// Tipo di file richeisto in OUT: svg / 3dm...
/// indice/versione del calcolo DDF
- public async Task SendCalcReq(int DoorId, string FullDDF)
+ public async Task SendCalcReq(int DoorId, string FullDDF, string? MimeType = "")
{
Stopwatch sw = new Stopwatch();
if (logTimingEnable)
@@ -1080,6 +1158,9 @@ namespace WebDoorCreator.Data.Services
string sDoorId = $"{DoorId}";
int currVers = await DoorCalcRev(sDoorId);
string sCurrVers = $"{currVers}";
+ // salvo il mimeType (se nullo è "svg")
+ string mimeType = MimeType ?? "";
+ await RequestTypeUpsert(sDoorId, mimeType);
// elimino da code errori (SE fosse presente)
await RequestErrRemove(sDoorId);
@@ -1175,11 +1256,11 @@ namespace WebDoorCreator.Data.Services
/// Get Queue request pending, removing from queue and putting on processing queue
///
/// Dictionary of DoorId, saveVersNumb
- public async Task> TakeProcessingItems(int numItems)
+ public async Task> TakeProcessingItems(int numItems)
{
int maxTake = Math.Min(10, numItems);
long numReq = 0;
- Dictionary dictResult = new Dictionary();
+ Dictionary dictResult = new Dictionary();
// cerco da cache
RedisKey currKey = new RedisKey(Constants.CALC_REQ_PEND);
Stopwatch sw = new Stopwatch();
@@ -1209,7 +1290,17 @@ namespace WebDoorCreator.Data.Services
// recupero il DDF...
RedisKey currDdfKey = new RedisKey($"{Constants.CALC_REQ_DDF_CACHE}:{item.Name}:{item.Value}");
var rawDDF = await redisDb.StringGetAsync(currDdfKey);
- dictResult.Add($"{item.Name}.{item.Value}", $"{rawDDF}");
+ // verifico il tpo richiesta, se non trovassi prendo "svg" default...
+ var curTypeKey = new RedisKey(Constants.CALC_REQ_TYPE);
+ var rawType = await RedHashGetString(curTypeKey, item.Name!, true);
+ string mimeType = string.IsNullOrEmpty(rawType) ? "svg" : $"{rawType}";
+ // preparo DTO
+ CalcReqtDTO currReq = new CalcReqtDTO()
+ {
+ MimeType = mimeType,
+ DDF = $"{rawDDF}"
+ };
+ dictResult.Add($"{item.Name}.{item.Value}", currReq);
if (maxTake <= 0)
{
break;
diff --git a/WebDoorCreator.SDK/CalcReqDTO.cs b/WebDoorCreator.SDK/CalcReqDTO.cs
new file mode 100644
index 0000000..85a2f0f
--- /dev/null
+++ b/WebDoorCreator.SDK/CalcReqDTO.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WebDoorCreator.SDK
+{
+ /// Oggetto contenitore richiesta calcolo
+ ///
+ public class CalcReqtDTO
+ {
+ ///
+ /// DDF file content (origin)
+ ///
+ public string DDF { get; set; } = "";
+ ///
+ /// MimeType (out) requested: svg / 3dm...
+ ///
+ public string MimeType { get; set; } = "";
+ }
+}
diff --git a/WebDoorCreator.SDK/CalcResultDTO.cs b/WebDoorCreator.SDK/CalcResultDTO.cs
index 1e88bd3..b7b1456 100644
--- a/WebDoorCreator.SDK/CalcResultDTO.cs
+++ b/WebDoorCreator.SDK/CalcResultDTO.cs
@@ -24,9 +24,13 @@ namespace WebDoorCreator.SDK
///
public string ErrorMsg { get; set; } = "";
///
- /// SVG generated
+ /// Object RAW generated output ( was SvgGen )
///
- public string SvgGen { get; set; } = "";
+ public string RawContent { get; set; } = "";
+ ///
+ /// MimeType: svg / 3dm...
+ ///
+ public string MimeType { get; set; } = "";
///
/// Articat path (ex 3d zip/pack)
///
diff --git a/WebDoorCreator.UI/Components/Buttons/ButtonsDoorDef.razor b/WebDoorCreator.UI/Components/Buttons/ButtonsDoorDef.razor
index 6258040..ed55243 100644
--- a/WebDoorCreator.UI/Components/Buttons/ButtonsDoorDef.razor
+++ b/WebDoorCreator.UI/Components/Buttons/ButtonsDoorDef.razor
@@ -1,18 +1,25 @@
@if (B_doorOpUpd)
{
-
-
-
+
+
@if (IsErr)
{
-
+
}
}
else
{
-
-
+
+ }
+ @if (IsErr)
+ {
+
+ }
+ else
+ {
+ @* *@
+
}
@@ -40,4 +47,8 @@
+}
+@if (isRecalc)
+{
+
}
\ No newline at end of file
diff --git a/WebDoorCreator.UI/Components/Buttons/ButtonsDoorDef.razor.cs b/WebDoorCreator.UI/Components/Buttons/ButtonsDoorDef.razor.cs
index 96f07a4..ab2a5f8 100644
--- a/WebDoorCreator.UI/Components/Buttons/ButtonsDoorDef.razor.cs
+++ b/WebDoorCreator.UI/Components/Buttons/ButtonsDoorDef.razor.cs
@@ -83,15 +83,6 @@ namespace WebDoorCreator.UI.Components.Buttons
await refreshSVG();
}
- ///
- /// Effettua Richiesta visione porta 3D
- ///
- ///
- protected async Task doReq3D()
- {
- await Task.Delay(1);
- }
-
protected override void OnInitialized()
{
base.OnInitialized();
@@ -99,6 +90,7 @@ namespace WebDoorCreator.UI.Components.Buttons
bool remDoorOp = config.GetValue("ConfDDF:RemoveDoorOps");
var headRows = config.GetSection("ConfDDF:Header").Get>();
var footRows = config.GetSection("ConfDDF:Footer").Get>();
+ WaitOpen3d = config.GetValue("ServerConf:WaitOpen3d");
currDdfConv = new WebDoorCreator.Data.DDF.Converter(vers, remDoorOp, headRows, footRows);
WDCRService.EA_UpdDoorOp += WDCRService_EA_UpdDoorOp;
}
@@ -109,11 +101,76 @@ namespace WebDoorCreator.UI.Components.Buttons
await Task.Delay(1);
}
+ ///
+ /// Apertura visualizzatore 3D della porta in oggetto
+ ///
+ ///
+ ///
+ protected async Task open3D()
+ {
+ isRecalc = true;
+ // inserisco richiesta calcolo
+ await sendCalcReqForType("3dm");
+ // apro link in nuova pagina...
+ //var url = $"api/Report/GetOrderReport?OrderId={orderId}&Format=PDF";
+ var url = $"https://iis01.egalware.com/Test3D/TJSD/index_2.html?src=Door2.3dm";
+ //var url = $"https://iis01.egalware.com/Test3D/TJSD/index_2.html?src=D{idDoor:000000000000}.3dm";
+ // chiamo apertura via jscript in target _blank
+
+ // attendo per apertura WaitOpen3d ms
+ await Task.Delay(WaitOpen3d);
+ isRecalc = false;
+ await InvokeAsync(StateHasChanged);
+ await Task.Delay(10);
+ await JSRuntime.InvokeAsync