diff --git a/Lux.API/Controllers/JwdController.cs b/Lux.API/Controllers/JwdController.cs deleted file mode 100644 index c5ac5689..00000000 --- a/Lux.API/Controllers/JwdController.cs +++ /dev/null @@ -1,253 +0,0 @@ -using EgwMultiEngineManager; -using EgwCoreLib.Lux.Core.RestPayload; -using EgwCoreLib.Lux.Data; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using System.Diagnostics; - -namespace Lux.API.Controllers -{ - [Route("api/[controller]")] - [ApiController] - public class JwdController : ControllerBase - { - #region Public Constructors - - public JwdController(IConfiguration config, ILogger logger, ExecProcessManager EgwProcManager) - { - _logger = logger; - _config = config; - } - - #endregion Public Constructors - - #region Public Methods - - /// - /// Chiamata POST: riceve Json in formato JwdDto, restituisce jpeg file - /// PUT: api/Jwd/svg/00000000-0000-0000-0000-000000000000 - /// - /// token comunicazione - /// - [HttpPost("jpegfile/{id}")] - public async Task jpegFile(string id, [FromBody] Lux.Core.RestPayload.JwdDTO currJwd) - { - // finta attesa/elaborazione - await Task.Delay(waitDelay); - // path immagine finto... - string fakeImagePath = "DemoImg/Window01.jpg"; - var imageBytes = await System.IO.File.ReadAllBytesAsync(fakeImagePath); - return File(imageBytes, "image/jpeg"); - } - - /// - /// Chiamata POST: riceve Json in formato JwdDto, restituisce png file - /// PUT: api/Jwd/svg/00000000-0000-0000-0000-000000000000 - /// - /// token comunicazione - /// - [HttpPost("pngfile/{id}")] - public async Task pngFile(string id, [FromBody] Core.RestPayload.JwdDTO currJwd) - { - // finta attesa/elaborazione - await Task.Delay(waitDelay); - // path immagine finto... - string fakeImagePath = "DemoImg/Window01.png"; - var imageBytes = await System.IO.File.ReadAllBytesAsync(fakeImagePath); - return File(imageBytes, "image/png"); - } - - /// - /// Chiamata POST: riceve Json in formato JwdDto, restituisce una BOM completa - /// PUT: api/Jwd/svg/00000000-0000-0000-0000-000000000000 - /// - /// token comunicazione - /// - [HttpPost("bom/{id}")] - public async Task> ProductionBOM(string id, [FromBody] Core.RestPayload.JwdDTO currJwd) - { - // finta attesa/elaborazione - await Task.Delay(waitDelay); - // path immagine finto... - List listItems = new List(); - - for (int i = 0; i < 5; i++) - { - BomRowDTO item = new BomRowDTO() - { - BR_UID = $"ABC_{i:000}", - index = i, - ItemID = $"ART-{i:00000}", - Name = $"Finestra {i}", - PriceUM = 320, - Qty = 2 - }; - listItems.Add(item); - } - - BomDTO answ = new BomDTO() - { - UID = $"{DateTime.Now:yyyyMMdd-HHmmss}", - Customer = "Demo Customer", - ItemList = listItems - }; - - return Ok(answ); - } - - /// - /// Chiamata POST: riceve Json in formato JwdDto, restituisce svg file - /// PUT: api/Jwd/svg/00000000-0000-0000-0000-000000000000 - /// - /// token comunicazione - /// - [HttpPost("svgfile/{id}")] - public async Task svgFile(string id, [FromBody] Core.RestPayload.JwdDTO currJwd) - { - // finta attesa/elaborazione - await Task.Delay(waitDelay); - // path immagine finto... - string fakeImagePath = "DemoImg/Window01.svg"; - var svgContent = await System.IO.File.ReadAllTextAsync(fakeImagePath); - var bytes = System.Text.Encoding.UTF8.GetBytes(svgContent); - return File(bytes, "image/svg+xml"); - } - - /// - /// Chiamata POST: riceve Json in formato JwdDto, restituisce svg come string - /// PUT: api/Jwd/svg/00000000-0000-0000-0000-000000000000 - /// - /// token comunicazione - /// - [HttpPost("svg/{id}")] - public async Task> svgString(string id, [FromBody] Core.RestPayload.JwdDTO currJwd) - { - Stopwatch sw = new Stopwatch(); - sw.Start(); - lastSvg = ""; - string filePath = Path.Combine("DemoData", "AntaDoppia.jwd"); - string svgName = ""; - string rawData = ""; - string svgContent = ""; - // ...se ricevo percorso --> leggo jwd/svg cablato - if (!string.IsNullOrEmpty(currJwd.nameUrl)) - { - filePath = Path.Combine("DemoData", $"{currJwd.nameUrl}.jwd"); - svgName = Path.Combine("DemoImg", $"{currJwd.nameUrl}.svg"); - } - if (!string.IsNullOrEmpty(svgName)) - { - string fakeImagePath = $"DemoImg/{currJwd.nameUrl}.svg"; - svgContent = await System.IO.File.ReadAllTextAsync(fakeImagePath); - } - else - { - if (enableEgwEng && ProcessMan != null) - { - if (System.IO.File.Exists(filePath)) - { - rawData = System.IO.File.ReadAllText(filePath); - } - Dictionary DictExec = new Dictionary(); - DictExec.Add("Mode", "1"); - DictExec.Add("Jwd", rawData); - int nId = 1; - ProcessArgs currArgs = new ProcessArgs(nId, DictExec); - bool done = ProcessMan.ArgumentsEnqueue(currArgs); - - waitResult = true; - - int numWait = 40; - while (numWait > 0 && waitResult) - { - numWait--; - await Task.Delay(waitDelay); - } - } - // se ho risultato mostro... - if (!string.IsNullOrEmpty(lastSvg)) - { - svgContent = lastSvg; - } - else - { - // path immagine finto... - string fakeImagePath = "DemoImg/Window01.svg"; - svgContent = await System.IO.File.ReadAllTextAsync(fakeImagePath); - } - } - sw.Stop(); - _logger.LogInformation($"svgString | {sw.Elapsed.TotalMilliseconds:N3} ms"); - return Ok(svgContent); - } - - #endregion Public Methods - - #region Private Fields - - private readonly ILogger _logger; - private IConfiguration _config; - - //private Dictionary listSvg = new Dictionary(); - private string lastSvg = ""; - - private int waitDelay = 250; - private bool waitResult = false; - - #endregion Private Fields - - #region Private Properties - - - #endregion Private Properties - - #region Private Methods - - /// - /// Restituisce una risposta all'esecuzione - /// - /// - private void ProcessMan_m_AnswerReceived(ProcessArgsResult result) - { - // verifico che sia la mia richeista con nId cablato a 1 - if (result.nId == 1) - { - } - // salvo il risultato... - if (result.Args != null && result.Args.Count > 0) - { - if (result.Args.ContainsKey("Svg")) - { - // salvo SVG - string newSvg = result.Args["Svg"]; - // salvo nel dizionario - lastSvg = newSvg; - waitResult = false; - } - } - } - - #endregion Private Methods - -#if false - /// - /// Chiamata GETT: riceve Json in formato JwdDto, restituisce svg file - /// GET: api/Jwd/svg/00000000-0000-0000-0000-000000000000 - /// - /// id univoco img - /// - [HttpGet("svg/{id}")] - public async Task svgFileGet(string id) - { - Stopwatch sw = new Stopwatch(); - sw.Start(); - string filePath = Path.Combine("DemoImg", "AntaDoppia.svg"); - var svgContent = await System.IO.File.ReadAllTextAsync(filePath); - var bytes = System.Text.Encoding.UTF8.GetBytes(svgContent); - sw.Stop(); - _logger.LogInformation($"svgString | {sw.Elapsed.TotalMilliseconds:N3} ms"); - return File(bytes, "image/svg+xml"); - } -#endif - } -} \ No newline at end of file diff --git a/Lux.API/Lux.API.csproj b/Lux.API/Lux.API.csproj index 828812cd..16e81fd0 100644 --- a/Lux.API/Lux.API.csproj +++ b/Lux.API/Lux.API.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 0.9.2509.1218 + 0.9.2509.1615 diff --git a/Lux.UI/Lux.UI.csproj b/Lux.UI/Lux.UI.csproj index 11318e30..e2a81f0b 100644 --- a/Lux.UI/Lux.UI.csproj +++ b/Lux.UI/Lux.UI.csproj @@ -1,11 +1,11 @@ - + net8.0 enable enable aspnet-Lux.UI-a758c101-a2f4-4e38-977d-1c4887dbbd50 - 0.9.2509.1216 + 0.9.2509.1312 diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index b22ab198..27d5cee5 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ LUX - Web Windows MES -

Versione: 0.9.2509.1218

+

Versione: 0.9.2509.1615


Note di rilascio:
  • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index 6b5afbb4..041672c4 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -0.9.2509.1218 +0.9.2509.1615 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index c85f81fc..721fb003 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 0.9.2509.1218 + 0.9.2509.1615 http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html false