diff --git a/MP.IOC/Controllers/IOBController.cs b/MP.IOC/Controllers/IOBController.cs index a0276ab4..7914e22a 100644 --- a/MP.IOC/Controllers/IOBController.cs +++ b/MP.IOC/Controllers/IOBController.cs @@ -483,6 +483,7 @@ namespace MP.IOC.Controllers return Ok(actValues); } +#if false /// /// Recupera ODL corrente x macchina: /// GET: IOB/getCurrODL/SIMUL_03 @@ -507,6 +508,7 @@ namespace MP.IOC.Controllers return StatusCode(StatusCodes.Status500InternalServerError, "NO"); } } +#endif /// /// Restituisce la quantità pezzi dell'odl correntemente in lavorazione sulla macchina... @@ -901,7 +903,6 @@ namespace MP.IOC.Controllers Stopwatch sw = new Stopwatch(); sw.Start(); answ = await IOCService.ProcessInputAsync(id, valore, dtEve, dtCurr, cnt); - //answ = await DService.ProcessInputAsync(id, valore, dtEve, dtCurr, cnt); sw.Stop(); Log.Debug($"Input | elapsed: {sw.Elapsed.TotalMilliseconds:N1} | id: {id} | val: {valore} | cnt: {cnt}"); return Ok(answ); diff --git a/MP.IOC/Endpoints/IobEndpoints.cs b/MP.IOC/Endpoints/IobEndpoints.cs index b977d971..68a04527 100644 --- a/MP.IOC/Endpoints/IobEndpoints.cs +++ b/MP.IOC/Endpoints/IobEndpoints.cs @@ -34,8 +34,38 @@ namespace MP.IOC.Endpoints } }); + // 3. Metodo: GetCurrODL (api/IOB/getCurrODL/{id}) + app.MapGet("api/IOB/getCurrODL/{id}", async (string id, IIocService iocService, HttpContext context) => + { + if (string.IsNullOrEmpty(id)) + { + context.Response.StatusCode = StatusCodes.Status400BadRequest; + return "Missing ID"; + } + + if (id.Contains('|')) + { + id = id.Replace('|', '#'); + } + + try + { + var odl = await iocService.GetCurrOdlAsync(id); + + // Ottimizzazione: Se 'odl' è già una stringa, ritornala direttamente. + // Se è un oggetto o un numero, il C# gestirà l'estrazione. Evitiamo $"{odl}" che alloca memoria inutilmente. + return odl?.ToString() ?? string.Empty; + } + catch (Exception exc) + { + Log.Error(exc, "Errore GetCurrODL | macchina {MachineId}", id); + context.Response.StatusCode = StatusCodes.Status500InternalServerError; + return "NO"; + } + }); + #if false - // 3. Metodo: SetCounter (api/IOB/setCounter/{id}?counter=10) + // 4. Metodo: SetCounter (api/IOB/setCounter/{id}?counter=10) // Nota: 'counter' viene letto automaticamente dalla Query String grazie al Model Binding automatico app.MapGet("api/IOB/setCounter/{id}", async (string id, string counter, IIocService iocService, HttpContext context) => { @@ -71,35 +101,6 @@ namespace MP.IOC.Endpoints } }); - // 4. Metodo: GetCurrODL (api/IOB/getCurrODL/{id}) - app.MapGet("api/IOB/getCurrODL/{id}", async (string id, IIocService iocService, HttpContext context) => - { - if (string.IsNullOrEmpty(id)) - { - context.Response.StatusCode = StatusCodes.Status400BadRequest; - return "Missing ID"; - } - - if (id.Contains('|')) - { - id = id.Replace('|', '#'); - } - - try - { - var odl = await iocService.GetCurrOdlAsync(id); - - // Ottimizzazione: Se 'odl' è già una stringa, ritornala direttamente. - // Se è un oggetto o un numero, il C# gestirà l'estrazione. Evitiamo $"{odl}" che alloca memoria inutilmente. - return odl?.ToString() ?? string.Empty; - } - catch (Exception exc) - { - Log.Error(exc, "Errore GetCurrODL | macchina {MachineId}", id); - context.Response.StatusCode = StatusCodes.Status500InternalServerError; - return "NO"; - } - }); #endif } diff --git a/MP.IOC/MP.IOC.csproj b/MP.IOC/MP.IOC.csproj index 202183d5..746511b7 100644 --- a/MP.IOC/MP.IOC.csproj +++ b/MP.IOC/MP.IOC.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 8.16.2606.1511 + 8.16.2606.2010 diff --git a/MP.IOC/Resources/ChangeLog.html b/MP.IOC/Resources/ChangeLog.html index 8bf6f1c5..05636903 100644 --- a/MP.IOC/Resources/ChangeLog.html +++ b/MP.IOC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MP-IOC -

Versione: 8.16.2606.1511

+

Versione: 8.16.2606.2010


Note di rilascio:
  • diff --git a/MP.IOC/Resources/VersNum.txt b/MP.IOC/Resources/VersNum.txt index 27bab3be..eb7b715b 100644 --- a/MP.IOC/Resources/VersNum.txt +++ b/MP.IOC/Resources/VersNum.txt @@ -1 +1 @@ -8.16.2606.1511 +8.16.2606.2010 diff --git a/MP.IOC/Resources/manifest.xml b/MP.IOC/Resources/manifest.xml index f9e64e4d..7436d253 100644 --- a/MP.IOC/Resources/manifest.xml +++ b/MP.IOC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 8.16.2606.1511 + 8.16.2606.2010 https://nexus.steamware.net/repository/SWS/MP-IOC/stable/LAST/MP.IOC.zip https://nexus.steamware.net/repository/SWS/MP-IOC/stable/LAST/ChangeLog.html false